From 98b198c1cce1d65119aaf014cb3d11262b929eaf Mon Sep 17 00:00:00 2001 From: Date: Tue, 16 Dec 2008 05:27:17 +0000 Subject: [PATCH] Add Business BASIC viewer support --- .../webcodepro/applecommander/ui/UiBundle.properties | 4 ++++ .../applecommander/ui/swt/DiskExplorerTab.java | 10 ++++++++++ .../applecommander/ui/swt/FileViewerWindow.java | 4 ++-- .../ui/swt/wizard/exportfile/ExportFileStartPane.java | 9 +++++++++ 4 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/com/webcodepro/applecommander/ui/UiBundle.properties b/src/com/webcodepro/applecommander/ui/UiBundle.properties index a664c96..47d6949 100644 --- a/src/com/webcodepro/applecommander/ui/UiBundle.properties +++ b/src/com/webcodepro/applecommander/ui/UiBundle.properties @@ -38,6 +38,7 @@ VeiwAsGraphicsMenuItem=Graphics ExportAsRawDiskDataMenuItem=Raw disk data... ExportAsApplesoftBasicMenuItem=Applesoft Basic... ExportAsIntegerBasicMenuItem=Integer Basic... +ExportAsBusinessBASICMenuItem=Apple /// Business Basic... ExportAsAsciiTextMenuItem=ASCII Text... ExportAsFormattedAssemblyMenuItem=Formatted Assembly... ExportAsPascalTextMenuItem=Pascal Text... @@ -148,6 +149,7 @@ ExportFileAsFormattedAssemblyTextFile=Formatted Assembly text file ExportFileAsPascalTextFile=Pascal text file ExportFileAsApplesoftBasicFile=Applesoft BASIC file ExportFileAsIntegerBasicFile=Integer BASIC file +ExportFileAsBusinessBASICFile=Business BASIC file ExportFileAsAppleworksWordProcessorFile=AppleWorks Word Processor file ExportFileAsAppleworksDatabaseFile=AppleWorks Data Base file ExportFileAsAppleworksSpreadsheetFile=AppleWorks Spread Sheet file @@ -282,6 +284,8 @@ SwingAppleCommander.MenuFileQuit=Exit FileViewerWindow.Title=AppleCommander File View - {0} FileViewerWindow.ApplesoftButton=Applesoft FileViewerWindow.ApplesoftTooltip=Displays file as an Applesoft BASIC program (F2) +FileViewerWindow.BusinessBASICButton=Business BASIC +FileViewerWindow.BusinessBASICTooltip=Displays file as an Apple /// Business BASIC program (F2) FileViewerWindow.DatabaseButton=Database FileViewerWindow.DatabaseTooltip=Displays file as a database file (F2) FileViewerWindow.SpreadsheetButton=Spreadsheet diff --git a/src/com/webcodepro/applecommander/ui/swt/DiskExplorerTab.java b/src/com/webcodepro/applecommander/ui/swt/DiskExplorerTab.java index 3af8b98..b1ca1e1 100644 --- a/src/com/webcodepro/applecommander/ui/swt/DiskExplorerTab.java +++ b/src/com/webcodepro/applecommander/ui/swt/DiskExplorerTab.java @@ -82,6 +82,7 @@ import com.webcodepro.applecommander.storage.filters.AppleWorksWordProcessorFile import com.webcodepro.applecommander.storage.filters.ApplesoftFileFilter; import com.webcodepro.applecommander.storage.filters.AssemblySourceFileFilter; import com.webcodepro.applecommander.storage.filters.BinaryFileFilter; +import com.webcodepro.applecommander.storage.filters.BusinessBASICFileFilter; import com.webcodepro.applecommander.storage.filters.GraphicsFileFilter; import com.webcodepro.applecommander.storage.filters.IntegerBasicFileFilter; import com.webcodepro.applecommander.storage.filters.PascalTextFileFilter; @@ -497,6 +498,15 @@ public class DiskExplorerTab { } }); + item = new MenuItem(menu, SWT.NONE); + item.setText(textBundle.get("ExportAsBusinessBASICMenuItem")); //$NON-NLS-1$ + item.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent event) { + setFileFilter(new BusinessBASICFileFilter()); + exportFile(null); + } + }); + item = new MenuItem(menu, SWT.NONE); item.setText(textBundle.get("ExportAsAsciiTextMenuItem")); //$NON-NLS-1$ item.addSelectionListener(new SelectionAdapter() { diff --git a/src/com/webcodepro/applecommander/ui/swt/FileViewerWindow.java b/src/com/webcodepro/applecommander/ui/swt/FileViewerWindow.java index 14ba8ec..4279f22 100644 --- a/src/com/webcodepro/applecommander/ui/swt/FileViewerWindow.java +++ b/src/com/webcodepro/applecommander/ui/swt/FileViewerWindow.java @@ -172,8 +172,8 @@ public class FileViewerWindow { imageManager.get(ImageManager.ICON_VIEW_AS_BASIC_PROGRAM) )); nativeFilterAdapterMap.put(BusinessBASICFileFilter.class, - new BusinessBASICFilterAdapter(this, textBundle.get("FileViewerWindow.ApplesoftButton"), //$NON-NLS-1$ - textBundle.get("FileViewerWindow.ApplesoftTooltip"), //$NON-NLS-1$ + new BusinessBASICFilterAdapter(this, textBundle.get("FileViewerWindow.BusinessBASICButton"), //$NON-NLS-1$ + textBundle.get("FileViewerWindow.BusinessBASICTooltip"), //$NON-NLS-1$ imageManager.get(ImageManager.ICON_VIEW_AS_BASIC_PROGRAM) )); nativeFilterAdapterMap.put(AppleWorksDataBaseFileFilter.class, diff --git a/src/com/webcodepro/applecommander/ui/swt/wizard/exportfile/ExportFileStartPane.java b/src/com/webcodepro/applecommander/ui/swt/wizard/exportfile/ExportFileStartPane.java index 538ebd4..1c8215c 100644 --- a/src/com/webcodepro/applecommander/ui/swt/wizard/exportfile/ExportFileStartPane.java +++ b/src/com/webcodepro/applecommander/ui/swt/wizard/exportfile/ExportFileStartPane.java @@ -33,6 +33,7 @@ import com.webcodepro.applecommander.storage.filters.AppleWorksWordProcessorFile import com.webcodepro.applecommander.storage.filters.ApplesoftFileFilter; import com.webcodepro.applecommander.storage.filters.AssemblySourceFileFilter; import com.webcodepro.applecommander.storage.filters.BinaryFileFilter; +import com.webcodepro.applecommander.storage.filters.BusinessBASICFileFilter; import com.webcodepro.applecommander.storage.filters.GraphicsFileFilter; import com.webcodepro.applecommander.storage.filters.HexDumpFileFilter; import com.webcodepro.applecommander.storage.filters.IntegerBasicFileFilter; @@ -151,6 +152,14 @@ public class ExportFileStartPane extends WizardPane { } }); button = new Button(buttonSubpanel, SWT.RADIO); + button.setText(textBundle.get("ExportFileAsBusinessBASICFile")); //$NON-NLS-1$ + button.setSelection(wizard.getFileFilter() instanceof BusinessBASICFileFilter); + button.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + getWizard().setFileFilter(new BusinessBASICFileFilter()); + } + }); + button = new Button(buttonSubpanel, SWT.RADIO); button.setText(textBundle.get("ExportFileAsAppleworksWordProcessorFile")); //$NON-NLS-1$ button.setSelection(wizard.getFileFilter() instanceof AppleWorksWordProcessorFileFilter); button.addSelectionListener(new SelectionAdapter() {