diff --git a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/E4LifeCycle.java b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/E4LifeCycle.java index d04500b..07d2a46 100644 --- a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/E4LifeCycle.java +++ b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/E4LifeCycle.java @@ -64,7 +64,7 @@ public class E4LifeCycle { eventBroker.subscribe(UIEvents.UILifeCycle.ACTIVATE, new EventHandler() { @Override public void handleEvent(Event event) { - MPart part = (MPart) event.getProperty("ChangedElement"); + MPart part = (MPart) event.getProperty("ChangedElement"); //$NON-NLS-1$ if(part!=null){ IEclipseContext ctx = part.getContext(); OpenViewHandler openViewHandler= new OpenViewHandler(); @@ -115,7 +115,7 @@ public class E4LifeCycle { StringBuilder sb = new StringBuilder(); boolean first=true; for(String token:tokens){ - if(!first) sb.append(","); + if(!first) sb.append(","); //$NON-NLS-1$ sb.append(token); first=false; } @@ -143,14 +143,14 @@ public class E4LifeCycle { */ public void openViewForFile(String name){ File file = new File(name); - MPart part = partService.createPart("com.minres.scviewer.e4.application.partdescriptor.waveformviewer"); + MPart part = partService.createPart("com.minres.scviewer.e4.application.partdescriptor.waveformviewer"); //$NON-NLS-1$ part.setLabel(file.getName()); - MPartStack partStack = (MPartStack)modelService.find("org.eclipse.editorss", app); + MPartStack partStack = (MPartStack)modelService.find("org.eclipse.editorss", app); //$NON-NLS-1$ partStack.getChildren().add(part); partService.showPart(part, PartState.ACTIVATE); IEclipseContext ctx=part.getContext(); - ctx.modify("input", file); - ctx.declareModifiable("input"); + ctx.modify("input", file); //$NON-NLS-1$ + ctx.declareModifiable("input"); //$NON-NLS-1$ } } } diff --git a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/Messages.java b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/Messages.java new file mode 100644 index 0000000..b431031 --- /dev/null +++ b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/Messages.java @@ -0,0 +1,66 @@ +package com.minres.scviewer.e4.application; + +import org.eclipse.osgi.util.NLS; + +public class Messages extends NLS { + private static final String BUNDLE_NAME = "com.minres.scviewer.e4.application.messages"; //$NON-NLS-1$ + public static String AboutDialog_0; + public static String AboutDialog_1; + public static String DesignBrowser_12; + public static String DesignBrowser_16; + public static String DesignBrowser_2; + public static String DesignBrowser_4; + public static String DesignBrowser_8; + public static String LoadingWaveformDb_0; + public static String LoadStoreSettingsHandler_2; + public static String LoadStoreSettingsHandler_3; + public static String OpenHandler_0; + public static String QuitHandler_0; + public static String QuitHandler_1; + public static String RelationTypeToolControl_0; + public static String RelationTypeToolControl_1; + public static String ResourceManager_0; + public static String SCViewerPreferencesPage_0; + public static String StatusBarControl_1; + public static String StatusBarControl_2; + public static String StatusBarControl_3; + public static String StatusBarControl_4; + public static String SWTResourceManager_0; + public static String TransactionDetails_0; + public static String TransactionDetails_1; + public static String TransactionDetails_10; + public static String TransactionDetails_11; + public static String TransactionDetails_12; + public static String TransactionDetails_13; + public static String TransactionDetails_16; + public static String TransactionDetails_19; + public static String TransactionDetails_2; + public static String TransactionDetails_20; + public static String TransactionDetails_21; + public static String TransactionDetails_3; + public static String TransactionDetails_4; + public static String WaveformPreferencesPage_1; + public static String WaveformViewer_15; + public static String WaveformViewer_16; + public static String WaveformViewer_17; + public static String WaveformViewer_18; + public static String WaveformViewer_19; + public static String WaveformViewer_20; + public static String WaveformViewer_21; + public static String WaveformViewer_37; + public static String WaveformViewer_38; + public static String WaveformViewer_39; + public static String WaveStatusBarControl_10; + public static String WaveStatusBarControl_12; + public static String WaveStatusBarControl_5; + public static String WaveStatusBarControl_6; + public static String WaveStatusBarControl_7; + public static String WaveStatusBarControl_8; + static { + // initialize resource bundle + NLS.initializeMessages(BUNDLE_NAME, Messages.class); + } + + private Messages() { + } +} diff --git a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/elements/NavigateContribution.java b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/elements/NavigateContribution.java index 4daebfa..cc61765 100644 --- a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/elements/NavigateContribution.java +++ b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/elements/NavigateContribution.java @@ -54,7 +54,7 @@ public class NavigateContribution { WaveformViewer waveformViewerPart = (WaveformViewer) part.getObject(); RelationType relationTypeFilter = waveformViewerPart.getRelationTypeFilter(); MCommand command = modelService.findElements(application, - "com.minres.scviewer.e4.application.command.setrelationtype", MCommand.class, null).get(0); + "com.minres.scviewer.e4.application.command.setrelationtype", MCommand.class, null).get(0); //$NON-NLS-1$ MCommandParameter commandParameter = command.getParameters().get(0); for(RelationType relationType:waveformViewerPart.getAllRelationTypes()){ // MDirectMenuItem dynamicItem = modelService.createModelElement(MDirectMenuItem.class); @@ -69,15 +69,15 @@ public class NavigateContribution { MParameter parameter=modelService.createModelElement(MParameter.class); parameter.setName(commandParameter.getElementId()); parameter.setValue(relationType.getName()); - parameter.setContributorURI("platform:/plugin/com.minres.scviewer.e4.application"); + parameter.setContributorURI("platform:/plugin/com.minres.scviewer.e4.application"); //$NON-NLS-1$ MHandledMenuItem handledMenuItem= modelService.createModelElement(MHandledMenuItem.class); handledMenuItem.setLabel(relationType.getName()); if(relationTypeFilter.equals(relationType)){ handledMenuItem.setEnabled(false); - handledMenuItem.setIconURI("platform:/plugin/com.minres.scviewer.e4.application/icons/tick.png"); + handledMenuItem.setIconURI("platform:/plugin/com.minres.scviewer.e4.application/icons/tick.png"); //$NON-NLS-1$ }else - handledMenuItem.setIconURI("platform:/plugin/com.minres.scviewer.e4.application/icons/empty.png"); - handledMenuItem.setContributorURI("platform:/plugin/com.minres.scviewer.e4.application"); + handledMenuItem.setIconURI("platform:/plugin/com.minres.scviewer.e4.application/icons/empty.png"); //$NON-NLS-1$ + handledMenuItem.setContributorURI("platform:/plugin/com.minres.scviewer.e4.application"); //$NON-NLS-1$ handledMenuItem.setCommand(command); handledMenuItem.getParameters().add(parameter); items.add(handledMenuItem); diff --git a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/elements/RelationTypeToolControl.java b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/elements/RelationTypeToolControl.java index 80c4e4a..808360b 100644 --- a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/elements/RelationTypeToolControl.java +++ b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/elements/RelationTypeToolControl.java @@ -31,6 +31,7 @@ import org.eclipse.swt.widgets.Composite; import com.minres.scviewer.database.ITx; import com.minres.scviewer.database.RelationType; +import com.minres.scviewer.e4.application.Messages; import com.minres.scviewer.e4.application.parts.PartListener; import com.minres.scviewer.e4.application.parts.WaveformViewer; @@ -49,7 +50,7 @@ public class RelationTypeToolControl extends PartListener implements ISelectionC WaveformViewer waveformViewerPart; /** The dummy. */ - RelationType dummy = RelationType.create("------------"); + RelationType dummy = RelationType.create(Messages.RelationTypeToolControl_0); /** * Instantiates a new relation type tool control. @@ -72,7 +73,7 @@ public class RelationTypeToolControl extends PartListener implements ISelectionC comboViewer = new ComboViewer(parent, SWT.NONE); Combo comboBox = comboViewer.getCombo(); comboBox.setBounds(0, 0, 26, 22); - comboBox.setText("Select"); + comboBox.setText(Messages.RelationTypeToolControl_1); comboViewer.setContentProvider(new ArrayContentProvider()); comboViewer.setInput(new RelationType[] {dummy}); comboViewer.setSelection(new StructuredSelection(dummy)); diff --git a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/AboutHandler.java b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/AboutHandler.java index 5bd6d4e..440b272 100644 --- a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/AboutHandler.java +++ b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/AboutHandler.java @@ -21,7 +21,7 @@ public class AboutHandler { @Execute public void execute(Shell shell, MApplication app, MWindow window, EModelService ms /*@Named("mdialog01.dialog.0") MDialog dialog*/) { - MDialog dialog = (MDialog) ms.find("com.minres.scviewer.e4.application.dialog.aboutscviewer", app); + MDialog dialog = (MDialog) ms.find("com.minres.scviewer.e4.application.dialog.aboutscviewer", app); //$NON-NLS-1$ dialog.setToBeRendered(true); dialog.setToBeRendered(false); } diff --git a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/AddWaveformHandler.java b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/AddWaveformHandler.java index 0e532cb..5d261ee 100644 --- a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/AddWaveformHandler.java +++ b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/AddWaveformHandler.java @@ -29,8 +29,8 @@ import com.minres.scviewer.e4.application.parts.DesignBrowser; public class AddWaveformHandler { - public final static String PARAM_WHERE_ID="com.minres.scviewer.e4.application.command.addwaveform.where"; - public final static String PARAM_ALL_ID="com.minres.scviewer.e4.application.command.addwaveform.all"; + public final static String PARAM_WHERE_ID="com.minres.scviewer.e4.application.command.addwaveform.where"; //$NON-NLS-1$ + public final static String PARAM_ALL_ID="com.minres.scviewer.e4.application.command.addwaveform.all"; //$NON-NLS-1$ @Inject @Optional DesignBrowser designBrowser; @@ -40,8 +40,8 @@ public class AddWaveformHandler { @Named(IServiceConstants.ACTIVE_SELECTION) @Optional IStructuredSelection selection) { if(designBrowser==null) designBrowser = getListPart( partService); if(designBrowser==null || designBrowser.getActiveWaveformViewerPart()==null) return false; - Boolean before = "before".equalsIgnoreCase(where); - if("true".equalsIgnoreCase(all)) + Boolean before = "before".equalsIgnoreCase(where); //$NON-NLS-1$ + if("true".equalsIgnoreCase(all)) //$NON-NLS-1$ return designBrowser.getFilteredChildren().length>0 && (!before || ((IStructuredSelection)designBrowser.getActiveWaveformViewerPart().getSelection()).size()>0); else @@ -57,7 +57,7 @@ public class AddWaveformHandler { if(designBrowser!=null && selection.size()>0){ List sel=selection.toList(); designBrowser.getActiveWaveformViewerPart().addStreamsToList(sel.toArray(new IWaveform[]{}), - "before".equalsIgnoreCase(where)); + "before".equalsIgnoreCase(where)); //$NON-NLS-1$ } } diff --git a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/LoadStoreSettingsHandler.java b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/LoadStoreSettingsHandler.java index a014098..e53617c 100644 --- a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/LoadStoreSettingsHandler.java +++ b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/LoadStoreSettingsHandler.java @@ -22,10 +22,11 @@ import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.FileDialog; import org.eclipse.swt.widgets.Shell; +import com.minres.scviewer.e4.application.Messages; import com.minres.scviewer.e4.application.parts.WaveformViewer; public class LoadStoreSettingsHandler { - static final String PARAMETER_ID="com.minres.scviewer.e4.application.commandparameter.loadStore"; + static final String PARAMETER_ID="com.minres.scviewer.e4.application.commandparameter.loadStore"; //$NON-NLS-1$ @CanExecute public boolean canExecute(EPartService partService) { @@ -37,10 +38,10 @@ public class LoadStoreSettingsHandler { @Execute public void execute(@Named(PARAMETER_ID) String param, Shell shell, MApplication app, EModelService modelService, EPartService partService){ - boolean load = "load".equals(param); + boolean load = "load".equals(param); //$NON-NLS-1$ FileDialog dialog = new FileDialog(shell, load?SWT.OPEN:SWT.SAVE); - dialog.setFilterExtensions (new String []{"*.scview"}); - if(!load) dialog.setFileName("SCViewer.scview"); + dialog.setFilterExtensions (new String []{Messages.LoadStoreSettingsHandler_2}); + if(!load) dialog.setFileName(Messages.LoadStoreSettingsHandler_3); String res = dialog.open(); MPart part = partService.getActivePart(); if(res!=null && part!=null){ diff --git a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/MoveWaveformHandler.java b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/MoveWaveformHandler.java index 71a7d79..d1337a3 100644 --- a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/MoveWaveformHandler.java +++ b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/MoveWaveformHandler.java @@ -26,7 +26,7 @@ import com.minres.scviewer.e4.application.parts.WaveformViewer; public class MoveWaveformHandler { - static final String PARAMETER_ID="com.minres.scviewer.e4.application.command.movewaveformupCommand.parameter.dir"; + static final String PARAMETER_ID="com.minres.scviewer.e4.application.command.movewaveformupCommand.parameter.dir"; //$NON-NLS-1$ @CanExecute public Boolean canExecute(ESelectionService selectionService){ @@ -43,9 +43,9 @@ public class MoveWaveformHandler { MPart part = partService.getActivePart(); Object obj = part.getObject(); if(obj instanceof WaveformViewer){ - if("up".equalsIgnoreCase(param)) + if("up".equalsIgnoreCase(param)) //$NON-NLS-1$ ((WaveformViewer)obj).moveSelected(-1); - else if("down".equalsIgnoreCase(param)) + else if("down".equalsIgnoreCase(param)) //$NON-NLS-1$ ((WaveformViewer)obj).moveSelected(1); } } diff --git a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/NavigateEvent.java b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/NavigateEvent.java index 8c2a220..81b1fe0 100644 --- a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/NavigateEvent.java +++ b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/NavigateEvent.java @@ -27,7 +27,7 @@ import com.minres.scviewer.e4.application.parts.WaveformViewer; public class NavigateEvent { - final static String PARAMTER_ID="com.minres.scviewer.e4.application.command.navigateEventCommand.parameter.dir"; + final static String PARAMTER_ID="com.minres.scviewer.e4.application.command.navigateEventCommand.parameter.dir"; //$NON-NLS-1$ @CanExecute public Boolean canExecute(ESelectionService selectionService){ @@ -46,9 +46,9 @@ public class NavigateEvent { MPart part = partService.getActivePart(); Object obj = part.getObject(); if(obj instanceof WaveformViewer){ - if("next".equalsIgnoreCase(param)) + if("next".equalsIgnoreCase(param)) //$NON-NLS-1$ ((WaveformViewer)obj).moveCursor(GotoDirection.NEXT); - else if("prev".equalsIgnoreCase(param)) + else if("prev".equalsIgnoreCase(param)) //$NON-NLS-1$ ((WaveformViewer)obj).moveCursor(GotoDirection.PREV); } } diff --git a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/NavigateTrans.java b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/NavigateTrans.java index 70eff98..8a2f75c 100644 --- a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/NavigateTrans.java +++ b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/NavigateTrans.java @@ -26,7 +26,7 @@ import com.minres.scviewer.e4.application.parts.WaveformViewer; public class NavigateTrans { - final static String PARAMTER_ID="com.minres.scviewer.e4.application.command.navigateTransCommand.parameter.dir"; + final static String PARAMTER_ID="com.minres.scviewer.e4.application.command.navigateTransCommand.parameter.dir"; //$NON-NLS-1$ @CanExecute public Boolean canExecute(ESelectionService selectionService){ @@ -43,9 +43,9 @@ public class NavigateTrans { MPart part = partService.getActivePart(); Object obj = part.getObject(); if(obj instanceof WaveformViewer){ - if("next".equalsIgnoreCase(param)) + if("next".equalsIgnoreCase(param)) //$NON-NLS-1$ ((WaveformViewer)obj).moveSelection(GotoDirection.NEXT); - else if("prev".equalsIgnoreCase(param)) + else if("prev".equalsIgnoreCase(param)) //$NON-NLS-1$ ((WaveformViewer)obj).moveSelection(GotoDirection.PREV); } } diff --git a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/OpenHandler.java b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/OpenHandler.java index 1f433bb..d9396f8 100644 --- a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/OpenHandler.java +++ b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/OpenHandler.java @@ -23,13 +23,15 @@ import org.eclipse.e4.ui.workbench.modeling.EPartService.PartState; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.FileDialog; import org.eclipse.swt.widgets.Shell; + +import com.minres.scviewer.e4.application.Messages; public class OpenHandler { @Execute public void execute(Shell shell, MApplication app, EModelService modelService, EPartService partService){ FileDialog dialog = new FileDialog(shell, SWT.OPEN | SWT.MULTI); // dialog.setFilterExtensions (new String []{"vcd", "txdb", "txlog"}); - dialog.setFilterExtensions (new String []{"*.vcd;*.txdb;*.txlog"}); + dialog.setFilterExtensions (new String []{Messages.OpenHandler_0}); dialog.open(); String path = dialog.getFilterPath(); for(String fileName: dialog.getFileNames()){ @@ -38,19 +40,19 @@ public class OpenHandler { // MPart part = MBasicFactory.INSTANCE.createPart(); // part.setLabel(fileName); // part.setContributionURI("bundleclass://com.minres.scviewer.e4.application/"+ WaveformViewerPart.class.getName()); - MPart part = partService .createPart("com.minres.scviewer.e4.application.partdescriptor.waveformviewer"); + MPart part = partService .createPart("com.minres.scviewer.e4.application.partdescriptor.waveformviewer"); //$NON-NLS-1$ part.setLabel(file.getName()); - MPartStack partStack = (MPartStack)modelService.find("org.eclipse.editorss", app); + MPartStack partStack = (MPartStack)modelService.find("org.eclipse.editorss", app); //$NON-NLS-1$ partStack.getChildren().add(part); partService.showPart(part, PartState.ACTIVATE); // Object o = part.getObject(); // if(o instanceof WaveformViewerPart) // ((WaveformViewerPart)o).setPartInput(file); IEclipseContext ctx=part.getContext(); - ctx.modify("input", file); - ctx.declareModifiable("input"); + ctx.modify("input", file); //$NON-NLS-1$ + ctx.declareModifiable("input"); //$NON-NLS-1$ } diff --git a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/QuitHandler.java b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/QuitHandler.java index d54a8b3..9c7a6f1 100644 --- a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/QuitHandler.java +++ b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/QuitHandler.java @@ -15,12 +15,14 @@ import org.eclipse.e4.ui.workbench.IWorkbench; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.swt.widgets.Shell; +import com.minres.scviewer.e4.application.Messages; + public class QuitHandler { @Execute public void execute(IWorkbench workbench, Shell shell){ - if (MessageDialog.openConfirm(shell, "Confirmation", - "Do you want to exit?")) { + if (MessageDialog.openConfirm(shell, Messages.QuitHandler_0, + Messages.QuitHandler_1)) { workbench.close(); } } diff --git a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/SetRelationTypeHandler.java b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/SetRelationTypeHandler.java index 968a34b..a1a263e 100644 --- a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/SetRelationTypeHandler.java +++ b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/SetRelationTypeHandler.java @@ -20,7 +20,7 @@ import org.eclipse.e4.ui.workbench.modeling.EPartService; import com.minres.scviewer.e4.application.parts.WaveformViewer; public class SetRelationTypeHandler { - final static String PARAMTER_ID="com.minres.scviewer.e4.application.commandparameter.relationName"; + final static String PARAMTER_ID="com.minres.scviewer.e4.application.commandparameter.relationName"; //$NON-NLS-1$ @Execute public void execute(@Named(PARAMTER_ID) String relationName, EPartService partService) { diff --git a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/ThemeSetHandler.java b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/ThemeSetHandler.java index af1d4d6..5abaa72 100644 --- a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/ThemeSetHandler.java +++ b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/ThemeSetHandler.java @@ -22,7 +22,7 @@ import org.eclipse.e4.ui.workbench.modeling.EPartService; */ @SuppressWarnings("restriction") public class ThemeSetHandler { - final static String PARAMTER_ID = "com.minres.scviewer.e4.application.command.theme.parameter.id"; + final static String PARAMTER_ID = "com.minres.scviewer.e4.application.command.theme.parameter.id"; //$NON-NLS-1$ @CanExecute public boolean canExecute(EPartService partService) { diff --git a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/ZoomHandler.java b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/ZoomHandler.java index 97dfcd1..2e2b495 100644 --- a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/ZoomHandler.java +++ b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/ZoomHandler.java @@ -22,7 +22,7 @@ import com.minres.scviewer.e4.application.parts.WaveformViewer; public class ZoomHandler { - final static String PARAMTER_ID="com.minres.scviewer.e4.application.command.zoomcommand.parameter.level"; + final static String PARAMTER_ID="com.minres.scviewer.e4.application.command.zoomcommand.parameter.level"; //$NON-NLS-1$ @CanExecute public boolean canExecute(EPartService partService) { @@ -36,11 +36,11 @@ public class ZoomHandler { if(obj instanceof WaveformViewer){ WaveformViewer waveformViewerPart = (WaveformViewer) obj; int zoomLevel = waveformViewerPart.getZoomLevel(); - if("in".equalsIgnoreCase(level)) + if("in".equalsIgnoreCase(level)) //$NON-NLS-1$ waveformViewerPart.setZoomLevel(zoomLevel-1); - else if("out".equalsIgnoreCase(level)) + else if("out".equalsIgnoreCase(level)) //$NON-NLS-1$ waveformViewerPart.setZoomLevel(zoomLevel+1); - else if("fit".equalsIgnoreCase(level)) + else if("fit".equalsIgnoreCase(level)) //$NON-NLS-1$ waveformViewerPart.setZoomFit(); } diff --git a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/internal/status/StatusBarControl.java b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/internal/status/StatusBarControl.java index 66609af..7f6b0d4 100644 --- a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/internal/status/StatusBarControl.java +++ b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/internal/status/StatusBarControl.java @@ -32,13 +32,15 @@ import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.ProgressBar; import org.osgi.service.prefs.PreferencesService; +import com.minres.scviewer.e4.application.Messages; + /** * The Class StatusBarControl. */ public class StatusBarControl { /** The Constant STATUS_UPDATE. */ - public static final String STATUS_UPDATE="StatusUpdate"; + public static final String STATUS_UPDATE="StatusUpdate"; //$NON-NLS-1$ /** The model service. */ @Inject EModelService modelService; @@ -194,7 +196,7 @@ public class StatusBarControl { progressBar.setMaximum(progressBar.getMaximum() + totalWork); } runningTasks++; - progressBar.setToolTipText("Currently running: " + runningTasks + "\nLast task: " + name); + progressBar.setToolTipText(Messages.StatusBarControl_1 + runningTasks + Messages.StatusBarControl_2 + name); } }); } @@ -266,9 +268,9 @@ public class StatusBarControl { public void run() { runningTasks--; if (runningTasks > 0){ // --- some tasks are still running --- - progressBar.setToolTipText("Currently running: " + runningTasks); + progressBar.setToolTipText(Messages.StatusBarControl_3 + runningTasks); } else { // --- all tasks are done (a reset of selection could also be done) --- - progressBar.setToolTipText("No background progress running."); + progressBar.setToolTipText(Messages.StatusBarControl_4); } } }); diff --git a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/internal/status/WaveStatusBarControl.java b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/internal/status/WaveStatusBarControl.java index 5ca6820..d857d70 100644 --- a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/internal/status/WaveStatusBarControl.java +++ b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/internal/status/WaveStatusBarControl.java @@ -27,22 +27,24 @@ import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; +import com.minres.scviewer.e4.application.Messages; + /** * The Class WaveStatusBarControl. */ public class WaveStatusBarControl extends StatusBarControl { /** The Constant ZOOM_LEVEL. */ - public static final String ZOOM_LEVEL="ZoomLevelUpdate"; + public static final String ZOOM_LEVEL="ZoomLevelUpdate"; //$NON-NLS-1$ /** The Constant CURSOR_TIME. */ - public static final String CURSOR_TIME="CursorPosUpdate"; + public static final String CURSOR_TIME="CursorPosUpdate"; //$NON-NLS-1$ /** The Constant MARKER_TIME. */ - public static final String MARKER_TIME="MarkerPosUpdate"; + public static final String MARKER_TIME="MarkerPosUpdate"; //$NON-NLS-1$ /** The Constant MARKER_DIFF. */ - public static final String MARKER_DIFF="MarlerDiffUpdate"; + public static final String MARKER_DIFF="MarlerDiffUpdate"; //$NON-NLS-1$ /** The model service. */ @Inject @@ -75,7 +77,7 @@ public class WaveStatusBarControl extends StatusBarControl { super(); this.labelString = labelString; this.width=width; - content=""; + content=""; //$NON-NLS-1$ } /* (non-Javadoc) @@ -124,10 +126,10 @@ public class WaveStatusBarControl extends StatusBarControl { @Inject public WaveStatusBarControl(UISynchronize sync) { super(sync); - cursorContribution = new TextContributionItem("C:", 80); - markerContribution = new TextContributionItem("M:", 80); - markerDiffContribution = new TextContributionItem("C-M:", 80); - zoomContribution = new TextContributionItem("Z:", 80); + cursorContribution = new TextContributionItem(Messages.WaveStatusBarControl_5, 80); + markerContribution = new TextContributionItem(Messages.WaveStatusBarControl_6, 80); + markerDiffContribution = new TextContributionItem(Messages.WaveStatusBarControl_7, 80); + zoomContribution = new TextContributionItem(Messages.WaveStatusBarControl_8, 80); manager.appendToGroup(StatusLineManager.BEGIN_GROUP,cursorContribution); manager.appendToGroup(StatusLineManager.BEGIN_GROUP,markerContribution); manager.appendToGroup(StatusLineManager.BEGIN_GROUP,markerDiffContribution); @@ -144,13 +146,13 @@ public class WaveStatusBarControl extends StatusBarControl { if(manager!=null && selection!=null){ switch(selection.size()){ case 0: - manager.setMessage(""); + manager.setMessage(""); //$NON-NLS-1$ break; case 1: - manager.setMessage(selection.getFirstElement().getClass().getSimpleName()+" selected"); + manager.setMessage(selection.getFirstElement().getClass().getSimpleName()+Messages.WaveStatusBarControl_10); break; default: - manager.setMessage(""+selection.size()+" Elements"); + manager.setMessage(""+selection.size()+Messages.WaveStatusBarControl_12); //$NON-NLS-1$ break; } } diff --git a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/messages.properties b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/messages.properties new file mode 100644 index 0000000..95c44b4 --- /dev/null +++ b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/messages.properties @@ -0,0 +1,52 @@ +AboutDialog_0=\nSCViewer - a SystemC waveform viewer\n\nVersion: 1.2\n +AboutDialog_1=\nCopyright (c) 2015,2016,2017 MINRES Technologies GmbH and others.\n\nAll rights reserved. MINRES and the MINRES logo are trademarks of MINRES Technologies GmbH, http://www.minres.com/. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html\n\nParts of the software are governed by the Apache License Version 2.0 available at http://www.apache.org/licenses/. These are namely org.apache.jdbm and org.sqlite JDBC driver\n\nSources code is hosted at GitHub: https://github.com/minres/SCViewer\n +DesignBrowser_12=Append all after +DesignBrowser_16=Insert all before +DesignBrowser_2=Enter text to filter waveforms +DesignBrowser_4=Append after +DesignBrowser_8=Insert before +LoadingWaveformDb_0=Database loading... +LoadStoreSettingsHandler_2=*.scview +LoadStoreSettingsHandler_3=SCViewer.scview +OpenHandler_0=*.vcd;*.txdb;*.txlog +QuitHandler_0=Confirmation +QuitHandler_1=Do you want to exit? +RelationTypeToolControl_0=------------ +RelationTypeToolControl_1=Select +ResourceManager_0=Wrong decorate corner +SCViewerPreferencesPage_0=Check for changed database +StatusBarControl_1=Currently running: +StatusBarControl_2=\nLast task: +StatusBarControl_3=Currently running: +StatusBarControl_4=No background progress running. +SWTResourceManager_0=Wrong decorate corner +TransactionDetails_0=Enter text to filter +TransactionDetails_1=Name +TransactionDetails_10=Properties +TransactionDetails_11=Attributes +TransactionDetails_12=Incoming relations +TransactionDetails_13=Outgoing relations +TransactionDetails_16=String +TransactionDetails_19=Start time +TransactionDetails_2=Type +TransactionDetails_20=Time +TransactionDetails_21=End time +TransactionDetails_3=Value +TransactionDetails_4=Relation +WaveformPreferencesPage_1=Color for +WaveformViewer_15=Database Load Job +WaveformViewer_16=Loading +WaveformViewer_17=Database re-load +WaveformViewer_18=Would you like to reload the database? +WaveformViewer_19=vcd +WaveformViewer_20=txdb +WaveformViewer_21=txlog +WaveformViewer_37=Database open +WaveformViewer_38=Would you like to open the adjacent database +WaveformViewer_39=\ as well? +WaveStatusBarControl_10=\ selected +WaveStatusBarControl_12=\ Elements +WaveStatusBarControl_5=C: +WaveStatusBarControl_6=M: +WaveStatusBarControl_7=C-M: +WaveStatusBarControl_8=Z: diff --git a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/AboutDialog.java b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/AboutDialog.java index acc569e..e33b483 100644 --- a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/AboutDialog.java +++ b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/AboutDialog.java @@ -40,24 +40,18 @@ import org.eclipse.swt.widgets.Shell; import org.eclipse.wb.swt.ResourceManager; import org.eclipse.wb.swt.SWTResourceManager; +import com.minres.scviewer.e4.application.Messages; + /** * The Class AboutDialog. */ public class AboutDialog extends Dialog { /** The product title. */ - private String productTitle= - "\nSCViewer - a SystemC waveform viewer\n\nVersion: 1.0\n"; + private String productTitle=Messages.AboutDialog_0; /** The copyright text. */ - private String copyrightText="\nCopyright (c) 2015 MINRES Technologies GmbH and others.\n"+ - "\n"+ - "All rights reserved. MINRES and the MINRES logo are trademarks of MINRES Technologies GmbH, http://www.minres.com/ . "+ - "This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 "+ - "which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html\n\n"+ - "Parts of the software are governed by the Apache License Version 2.0 available at http://www.apache.org/licenses/. "+ - "These are namely org.apache.jdbm and org.sqlite JDBC driver\n"+ - "\n\nSources code is hosted at GitHub: https://github.com/minres/SCViewer\n"; + private String copyrightText=Messages.AboutDialog_1; /** * Create the dialog. @@ -86,8 +80,8 @@ public class AboutDialog extends Dialog { composite.setLayout(new GridLayout(2, false)); final Color white=SWTResourceManager.getColor(SWT.COLOR_WHITE); - final Image scviewerLogo=ResourceManager.getPluginImage("com.minres.scviewer.e4.application", "icons/SCViewer_logo.png"); - final Image minresLogo=ResourceManager.getPluginImage("com.minres.scviewer.e4.application", "icons/Minres_logo.png"); + final Image scviewerLogo=ResourceManager.getPluginImage("com.minres.scviewer.e4.application", "icons/SCViewer_logo.png"); //$NON-NLS-1$ //$NON-NLS-2$ + final Image minresLogo=ResourceManager.getPluginImage("com.minres.scviewer.e4.application", "icons/Minres_logo.png"); //$NON-NLS-1$ //$NON-NLS-2$ Canvas canvas = new Canvas(composite,SWT.NO_REDRAW_RESIZE); GridData gd_canvas = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1); @@ -117,7 +111,7 @@ public class AboutDialog extends Dialog { styleRange.fontStyle = SWT.BOLD; styledText.setStyleRange(styleRange); ///^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/ - Pattern pattern = Pattern.compile("https?:\\/\\/([\\da-z\\.-]+)\\.([a-z\\.]{2,6})([\\/\\w\\.-]*)*\\/?"); + Pattern pattern = Pattern.compile("https?:\\/\\/([\\da-z\\.-]+)\\.([a-z\\.]{2,6})([\\/\\w\\.-]*)*\\/?"); //$NON-NLS-1$ // in case you would like to ignore case sensitivity, // you could use this statement: // Pattern pattern = Pattern.compile("\\s+", Pattern.CASE_INSENSITIVE); diff --git a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/DesignBrowser.java b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/DesignBrowser.java index 1c8cd09..87b7dea 100644 --- a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/DesignBrowser.java +++ b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/DesignBrowser.java @@ -68,6 +68,7 @@ import com.minres.scviewer.database.IHierNode; import com.minres.scviewer.database.ITx; import com.minres.scviewer.database.IWaveform; import com.minres.scviewer.database.IWaveformDb; +import com.minres.scviewer.e4.application.Messages; import com.minres.scviewer.e4.application.handlers.AddWaveformHandler; import com.minres.scviewer.e4.application.provider.TxDbContentProvider; import com.minres.scviewer.e4.application.provider.TxDbLabelProvider; @@ -79,7 +80,7 @@ import com.minres.scviewer.e4.application.provider.TxDbLabelProvider; public class DesignBrowser { /** The Constant POPUP_ID. */ - private static final String POPUP_ID="com.minres.scviewer.e4.application.parts.DesignBrowser.popupmenu"; + private static final String POPUP_ID="com.minres.scviewer.e4.application.parts.DesignBrowser.popupmenu"; //$NON-NLS-1$ /** The event broker. */ @Inject IEventBroker eventBroker; @@ -124,7 +125,7 @@ public class DesignBrowser { private PropertyChangeListener treeViewerPCL = new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { - if("CHILDS".equals(evt.getPropertyName())){ + if("CHILDS".equals(evt.getPropertyName())){ //$NON-NLS-1$ treeViewer.getTree().getDisplay().asyncExec(new Runnable() { @Override public void run() { @@ -215,7 +216,7 @@ public class DesignBrowser { parent.setLayout(new GridLayout(1, false)); nameFilter = new Text(parent, SWT.BORDER); - nameFilter.setMessage("Enter text to filter waveforms"); + nameFilter.setMessage(Messages.DesignBrowser_2); nameFilter.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent e) { @@ -237,7 +238,7 @@ public class DesignBrowser { @Override public void doubleClick(DoubleClickEvent event) { AddWaveformHandler myHandler = new AddWaveformHandler(); - Object result = runCommand(myHandler, CanExecute.class, "after", false); + Object result = runCommand(myHandler, CanExecute.class, "after", false); //$NON-NLS-1$ if(result!=null && (Boolean)result) ContextInjectionFactory.invoke(myHandler, Execute.class, eclipseCtx); } @@ -258,14 +259,14 @@ public class DesignBrowser { toolBar.setBounds(0, 0, 87, 20); appendItem = new ToolItem(toolBar, SWT.NONE); - appendItem.setToolTipText("Append after"); - appendItem.setImage(ResourceManager.getPluginImage("com.minres.scviewer.e4.application", "icons/append_wave.png")); + appendItem.setToolTipText(Messages.DesignBrowser_4); + appendItem.setImage(ResourceManager.getPluginImage("com.minres.scviewer.e4.application", "icons/append_wave.png")); //$NON-NLS-1$ //$NON-NLS-2$ appendItem.setEnabled(false); appendItem.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { AddWaveformHandler myHandler = new AddWaveformHandler(); - Object result = runCommand(myHandler, CanExecute.class, "after", false); + Object result = runCommand(myHandler, CanExecute.class, "after", false); //$NON-NLS-1$ if(result!=null && (Boolean)result) ContextInjectionFactory.invoke(myHandler, Execute.class, eclipseCtx); } @@ -273,14 +274,14 @@ public class DesignBrowser { }); insertItem = new ToolItem(toolBar, SWT.NONE); - insertItem.setToolTipText("Insert before"); - insertItem.setImage(ResourceManager.getPluginImage("com.minres.scviewer.e4.application", "icons/insert_wave.png")); + insertItem.setToolTipText(Messages.DesignBrowser_8); + insertItem.setImage(ResourceManager.getPluginImage("com.minres.scviewer.e4.application", "icons/insert_wave.png")); //$NON-NLS-1$ //$NON-NLS-2$ insertItem.setEnabled(false); insertItem.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { AddWaveformHandler myHandler = new AddWaveformHandler(); - Object result = runCommand(myHandler, CanExecute.class, "before", false); + Object result = runCommand(myHandler, CanExecute.class, "before", false); //$NON-NLS-1$ if(result!=null && (Boolean)result) ContextInjectionFactory.invoke(myHandler, Execute.class, eclipseCtx); } @@ -288,8 +289,8 @@ public class DesignBrowser { new ToolItem(toolBar, SWT.SEPARATOR); appendAllItem = new ToolItem(toolBar, SWT.NONE); - appendAllItem.setToolTipText("Append all after"); - appendAllItem.setImage(ResourceManager.getPluginImage("com.minres.scviewer.e4.application", "icons/append_all_waves.png")); + appendAllItem.setToolTipText(Messages.DesignBrowser_12); + appendAllItem.setImage(ResourceManager.getPluginImage("com.minres.scviewer.e4.application", "icons/append_all_waves.png")); //$NON-NLS-1$ //$NON-NLS-2$ appendAllItem.setEnabled(false); new ToolItem(toolBar, SWT.SEPARATOR); @@ -301,7 +302,7 @@ public class DesignBrowser { Object oldSel=selectionService.getSelection(); selectionService.setSelection(new StructuredSelection(all)); AddWaveformHandler myHandler = new AddWaveformHandler(); - Object result = runCommand(myHandler, CanExecute.class, "after", false); + Object result = runCommand(myHandler, CanExecute.class, "after", false); //$NON-NLS-1$ if(result!=null && (Boolean)result) ContextInjectionFactory.invoke(myHandler, Execute.class, eclipseCtx); selectionService.setSelection(oldSel); @@ -309,8 +310,8 @@ public class DesignBrowser { } }); insertAllItem = new ToolItem(toolBar, SWT.NONE); - insertAllItem.setToolTipText("Insert all before"); - insertAllItem.setImage(ResourceManager.getPluginImage("com.minres.scviewer.e4.application", "icons/insert_all_waves.png")); + insertAllItem.setToolTipText(Messages.DesignBrowser_16); + insertAllItem.setImage(ResourceManager.getPluginImage("com.minres.scviewer.e4.application", "icons/insert_all_waves.png")); //$NON-NLS-1$ //$NON-NLS-2$ insertAllItem.setEnabled(false); insertAllItem.addSelectionListener(new SelectionAdapter() { @Override @@ -320,7 +321,7 @@ public class DesignBrowser { Object oldSel=selectionService.getSelection(); selectionService.setSelection(new StructuredSelection(all)); AddWaveformHandler myHandler = new AddWaveformHandler(); - Object result = runCommand(myHandler, CanExecute.class, "before", false); + Object result = runCommand(myHandler, CanExecute.class, "before", false); //$NON-NLS-1$ if(result!=null && (Boolean)result) ContextInjectionFactory.invoke(myHandler, Execute.class, eclipseCtx); selectionService.setSelection(oldSel); @@ -400,13 +401,13 @@ public class DesignBrowser { if(txTableViewer!=null && !insertItem.isDisposed() && !appendItem.isDisposed() && !appendAllItem.isDisposed() && !insertAllItem.isDisposed()){ AddWaveformHandler myHandler = new AddWaveformHandler(); - Object result = runCommand(myHandler, CanExecute.class, "after", false); + Object result = runCommand(myHandler, CanExecute.class, "after", false); //$NON-NLS-1$ appendItem.setEnabled(result instanceof Boolean && (Boolean)result); - result = runCommand(myHandler, CanExecute.class, "after", true); + result = runCommand(myHandler, CanExecute.class, "after", true); //$NON-NLS-1$ appendAllItem.setEnabled(result instanceof Boolean && (Boolean)result); - result = runCommand(myHandler, CanExecute.class, "before", false); + result = runCommand(myHandler, CanExecute.class, "before", false); //$NON-NLS-1$ insertItem.setEnabled(result instanceof Boolean && (Boolean)result); - result = runCommand(myHandler, CanExecute.class, "before", true); + result = runCommand(myHandler, CanExecute.class, "before", true); //$NON-NLS-1$ insertAllItem.setEnabled(result instanceof Boolean && (Boolean)result); } } @@ -425,7 +426,7 @@ public class DesignBrowser { * @param s the new search text */ public void setSearchText(String s) { - this.searchString = ".*" + s + ".*"; + this.searchString = ".*" + s + ".*"; //$NON-NLS-1$ //$NON-NLS-2$ } /* (non-Javadoc) diff --git a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/LoadingWaveformDb.java b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/LoadingWaveformDb.java index 3893d08..d6e4fd6 100644 --- a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/LoadingWaveformDb.java +++ b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/LoadingWaveformDb.java @@ -10,10 +10,11 @@ import com.minres.scviewer.database.IWaveform; import com.minres.scviewer.database.IWaveformDb; import com.minres.scviewer.database.IWaveformEvent; import com.minres.scviewer.database.RelationType; +import com.minres.scviewer.e4.application.Messages; public class LoadingWaveformDb implements IWaveformDb { - private final String label = "Database loading..."; + private final String label = Messages.LoadingWaveformDb_0; @Override public void addPropertyChangeListener(PropertyChangeListener l) { diff --git a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/TransactionDetails.java b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/TransactionDetails.java index 2085398..939ecca 100644 --- a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/TransactionDetails.java +++ b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/TransactionDetails.java @@ -55,6 +55,7 @@ import org.eclipse.swt.widgets.Tree; import com.minres.scviewer.database.ITx; import com.minres.scviewer.database.ITxAttribute; import com.minres.scviewer.database.ITxRelation; +import com.minres.scviewer.e4.application.Messages; import com.minres.scviewer.e4.application.provider.TxPropertiesLabelProvider; /** @@ -107,7 +108,7 @@ public class TransactionDetails { parent.setLayout(new GridLayout(1, false)); nameFilter = new Text(parent, SWT.BORDER); - nameFilter.setMessage("Enter text to filter"); + nameFilter.setMessage(Messages.TransactionDetails_0); nameFilter.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent e) { @@ -133,7 +134,7 @@ public class TransactionDetails { tree.setLayoutData(new GridData(GridData.FILL_BOTH)); // Add the name column col1 = new TreeViewerColumn(treeViewer, SWT.NONE); - col1.getColumn().setText("Name"); + col1.getColumn().setText(Messages.TransactionDetails_1); col1.getColumn().setResizable(true); col1.setLabelProvider(new DelegatingStyledCellLabelProvider(new AttributeLabelProvider(AttributeLabelProvider.NAME))); col1.getColumn().addSelectionListener(new SelectionAdapter() { @@ -144,7 +145,7 @@ public class TransactionDetails { }); // Add the type column col2 = new TreeViewerColumn(treeViewer, SWT.NONE); - col2.getColumn().setText("Type"); + col2.getColumn().setText(Messages.TransactionDetails_2); col2.getColumn().setResizable(true); col2.setLabelProvider(new DelegatingStyledCellLabelProvider(new AttributeLabelProvider(AttributeLabelProvider.TYPE))); col2.getColumn().addSelectionListener(new SelectionAdapter() { @@ -155,7 +156,7 @@ public class TransactionDetails { }); // Add the value column col3 = new TreeViewerColumn(treeViewer, SWT.NONE); - col3.getColumn().setText("Value"); + col3.getColumn().setText(Messages.TransactionDetails_3); col3.getColumn().setResizable(true); col3.setLabelProvider(new DelegatingStyledCellLabelProvider(new AttributeLabelProvider(AttributeLabelProvider.VALUE))); col3.getColumn().addSelectionListener(new SelectionAdapter() { @@ -282,8 +283,8 @@ public class TransactionDetails { */ String txToString(ITx tx){ StringBuilder sb = new StringBuilder(); - sb.append("tx#").append(tx.getId()).append("[").append(timeToString(tx.getBeginTime())). - append(" - ").append(timeToString(tx.getEndTime())).append("]"); + sb.append("tx#").append(tx.getId()).append("[").append(timeToString(tx.getBeginTime())). //$NON-NLS-1$ //$NON-NLS-2$ + append(" - ").append(timeToString(tx.getEndTime())).append("]"); //$NON-NLS-1$ //$NON-NLS-2$ return sb.toString(); } @@ -369,7 +370,7 @@ public class TransactionDetails { * @param s the new search text */ public void setSearchText(String s) { - this.searchString = ".*" + s + ".*"; + this.searchString = ".*" + s + ".*"; //$NON-NLS-1$ //$NON-NLS-2$ } /* (non-Javadoc) @@ -427,12 +428,12 @@ PROPS, /** The attrs. */ */ public String toString(){ switch(type){ - case PROPS: return "Properties"; - case ATTRS: return "Attributes"; - case IN_REL: return "Incoming relations"; - case OUT_REL: return "Outgoing relations"; + case PROPS: return Messages.TransactionDetails_10; + case ATTRS: return Messages.TransactionDetails_11; + case IN_REL: return Messages.TransactionDetails_12; + case OUT_REL: return Messages.TransactionDetails_13; } - return ""; + return ""; //$NON-NLS-1$ } } @@ -476,10 +477,10 @@ PROPS, /** The attrs. */ TreeNode propertyHolder=(TreeNode) element; if(propertyHolder.type == Type.PROPS){ return new Object[][]{ - {"Name", "String", propertyHolder.element.getStream().getFullName()}, - {"Type", "String", propertyHolder.element.getGenerator().getName()}, - {"Start time", "Time", timeToString(propertyHolder.element.getBeginTime())}, - {"End time", "Time", timeToString(propertyHolder.element.getEndTime())} + {Messages.TransactionDetails_1, Messages.TransactionDetails_16, propertyHolder.element.getStream().getFullName()}, + {Messages.TransactionDetails_2, Messages.TransactionDetails_16, propertyHolder.element.getGenerator().getName()}, + {Messages.TransactionDetails_19, Messages.TransactionDetails_20, timeToString(propertyHolder.element.getBeginTime())}, + {Messages.TransactionDetails_21, Messages.TransactionDetails_20, timeToString(propertyHolder.element.getEndTime())} }; }else if(propertyHolder.type == Type.ATTRS) return propertyHolder.element.getAttributes().toArray(); @@ -561,7 +562,7 @@ PROPS, /** The attrs. */ ITxAttribute attribute = (ITxAttribute) element; return new StyledString(attribute.getName()); }else if (element instanceof ITxRelation) { - return new StyledString("Relation"); + return new StyledString(Messages.TransactionDetails_4); }else if(element instanceof Object[]){ Object[] elements = (Object[]) element; return new StyledString(elements[field].toString()); @@ -575,7 +576,7 @@ PROPS, /** The attrs. */ Object[] elements = (Object[]) element; return new StyledString(elements[field].toString()); }else - return new StyledString(""); + return new StyledString(""); //$NON-NLS-1$ default: if (element instanceof ITxAttribute) { ITxAttribute attribute = (ITxAttribute) element; @@ -586,7 +587,7 @@ PROPS, /** The attrs. */ } else if(element instanceof ITx){ return new StyledString(txToString((ITx) element)); }else - return new StyledString(""); + return new StyledString(""); //$NON-NLS-1$ } } } diff --git a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/WaveformViewer.java b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/WaveformViewer.java index ae99c02..b46b2c9 100644 --- a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/WaveformViewer.java +++ b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/WaveformViewer.java @@ -72,6 +72,7 @@ import com.minres.scviewer.database.ui.ICursor; import com.minres.scviewer.database.ui.IWaveformViewer; import com.minres.scviewer.database.ui.TrackEntry; import com.minres.scviewer.database.ui.WaveformColors; +import com.minres.scviewer.e4.application.Messages; import com.minres.scviewer.e4.application.internal.status.WaveStatusBarControl; import com.minres.scviewer.e4.application.internal.util.FileMonitor; import com.minres.scviewer.e4.application.internal.util.IFileChangeListener; @@ -86,25 +87,25 @@ import com.minres.scviewer.e4.application.preferences.PreferenceConstants; public class WaveformViewer implements IFileChangeListener, IPreferenceChangeListener { /** The Constant ACTIVE_WAVEFORMVIEW. */ - public static final String ACTIVE_WAVEFORMVIEW = "Active_Waveform_View"; + public static final String ACTIVE_WAVEFORMVIEW = "Active_Waveform_View"; //$NON-NLS-1$ /** The Constant ADD_WAVEFORM. */ - public static final String ADD_WAVEFORM = "AddWaveform"; + public static final String ADD_WAVEFORM = "AddWaveform"; //$NON-NLS-1$ /** The Constant DATABASE_FILE. */ - protected static final String DATABASE_FILE = "DATABASE_FILE"; + protected static final String DATABASE_FILE = "DATABASE_FILE"; //$NON-NLS-1$ /** The Constant SHOWN_WAVEFORM. */ - protected static final String SHOWN_WAVEFORM = "SHOWN_WAVEFORM"; + protected static final String SHOWN_WAVEFORM = "SHOWN_WAVEFORM"; //$NON-NLS-1$ /** The Constant SHOWN_CURSOR. */ - protected static final String SHOWN_CURSOR = "SHOWN_CURSOR"; + protected static final String SHOWN_CURSOR = "SHOWN_CURSOR"; //$NON-NLS-1$ /** The Constant ZOOM_LEVEL. */ - protected static final String ZOOM_LEVEL = "ZOOM_LEVEL"; + protected static final String ZOOM_LEVEL = "ZOOM_LEVEL"; //$NON-NLS-1$ /** The Constant BASE_LINE_TIME. */ - protected static final String BASE_LINE_TIME = "BASE_LINE_TIME"; + protected static final String BASE_LINE_TIME = "BASE_LINE_TIME"; //$NON-NLS-1$ /** The Constant FILE_CHECK_INTERVAL. */ protected static final long FILE_CHECK_INTERVAL = 60000; @@ -116,7 +117,7 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis public static final String ID = "com.minres.scviewer.ui.TxEditorPart"; //$NON-NLS-1$ /** The Constant WAVE_ACTION_ID. */ - public static final String WAVE_ACTION_ID = "com.minres.scviewer.ui.action.AddToWave"; + public static final String WAVE_ACTION_ID = "com.minres.scviewer.ui.action.AddToWave"; //$NON-NLS-1$ /** The factory. */ WaveformViewerFactory factory = new WaveformViewerFactory(); @@ -193,7 +194,7 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis database.addPropertyChangeListener(new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { - if ("WAVEFORMS".equals(evt.getPropertyName())) { + if ("WAVEFORMS".equals(evt.getPropertyName())) { //$NON-NLS-1$ myParent.getDisplay().syncExec(new Runnable() { @Override public void run() { @@ -236,8 +237,8 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis checkForUpdates = prefs.getBoolean(PreferenceConstants.DATABASE_RELOAD, true); filesToLoad = new ArrayList(); persistedState = part.getPersistedState(); - Integer files = persistedState.containsKey(DATABASE_FILE + "S") - ? Integer.parseInt(persistedState.get(DATABASE_FILE + "S")) : 0; + Integer files = persistedState.containsKey(DATABASE_FILE + "S") //$NON-NLS-1$ + ? Integer.parseInt(persistedState.get(DATABASE_FILE + "S")) : 0; //$NON-NLS-1$ for (int i = 0; i < files; i++) { filesToLoad.add(new File(persistedState.get(DATABASE_FILE + i))); } @@ -245,11 +246,11 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis loadDatabase(persistedState); eventBroker.post(WaveStatusBarControl.ZOOM_LEVEL, zoomLevel[waveformPane.getZoomLevel()]); menuService.registerContextMenu(waveformPane.getNameControl(), - "com.minres.scviewer.e4.application.popupmenu.namecontext"); + "com.minres.scviewer.e4.application.popupmenu.namecontext"); //$NON-NLS-1$ menuService.registerContextMenu(waveformPane.getValueControl(), - "com.minres.scviewer.e4.application.popupmenu.namecontext"); + "com.minres.scviewer.e4.application.popupmenu.namecontext"); //$NON-NLS-1$ menuService.registerContextMenu(waveformPane.getWaveformControl(), - "com.minres.scviewer.e4.application.popupmenu.wavecontext"); + "com.minres.scviewer.e4.application.popupmenu.wavecontext"); //$NON-NLS-1$ ePartService.addPartListener(new PartListener() { @Override public void partActivated(MPart part) { @@ -288,7 +289,7 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis DefaultValuesInitializer initializer = new DefaultValuesInitializer(); HashMap colorPref = new HashMap<>(); for (WaveformColors c : WaveformColors.values()) { - String prefValue = prefs.get(c.name() + "_COLOR", + String prefValue = prefs.get(c.name() + "_COLOR", //$NON-NLS-1$ StringConverter.asString(initializer.colors[c.ordinal()].getRGB())); RGB rgb = StringConverter.asRGB(prefValue); colorPref.put(c, rgb); @@ -303,7 +304,7 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis */ protected void loadDatabase(final Map state) { fileMonitor.removeFileChangeListener(this); - Job job = new Job("Database Load Job") { + Job job = new Job(Messages.WaveformViewer_15) { @Override protected IStatus run(IProgressMonitor monitor) { // convert to SubMonitor and set total number of work units @@ -311,7 +312,7 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis try { subMonitor.worked(1); for (File file : filesToLoad) { - subMonitor.setTaskName("Loading "+file.getName()); + subMonitor.setTaskName(Messages.WaveformViewer_16+file.getName()); database.load(file); database.addPropertyChangeListener(waveformPane); subMonitor.worked(1); @@ -358,8 +359,8 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis display.asyncExec(new Runnable() { @Override public void run() { - if (MessageDialog.openQuestion(display.getActiveShell(), "Database re-load", - "Would you like to reload the database?")) { + if (MessageDialog.openQuestion(display.getActiveShell(), Messages.WaveformViewer_17, + Messages.WaveformViewer_18)) { Map state = new HashMap<>(); saveWaveformViewerState(state); waveformPane.getStreamList().clear(); @@ -387,15 +388,15 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis filesToLoad.add(file); try { String ext = getFileExtension(file.getName()); - if ("vcd".equals(ext.toLowerCase())) { - if (askIfToLoad(new File(renameFileExtension(file.getCanonicalPath(), "txdb")))) { - filesToLoad.add(new File(renameFileExtension(file.getCanonicalPath(), "txdb"))); - } else if (askIfToLoad(new File(renameFileExtension(file.getCanonicalPath(), "txlog")))) { - filesToLoad.add(new File(renameFileExtension(file.getCanonicalPath(), "txlog"))); + if (Messages.WaveformViewer_19.equals(ext.toLowerCase())) { + if (askIfToLoad(new File(renameFileExtension(file.getCanonicalPath(), Messages.WaveformViewer_20)))) { + filesToLoad.add(new File(renameFileExtension(file.getCanonicalPath(), Messages.WaveformViewer_20))); + } else if (askIfToLoad(new File(renameFileExtension(file.getCanonicalPath(), Messages.WaveformViewer_21)))) { + filesToLoad.add(new File(renameFileExtension(file.getCanonicalPath(), Messages.WaveformViewer_21))); } - } else if ("txdb".equals(ext.toLowerCase()) || "txlog".equals(ext.toLowerCase())) { - if (askIfToLoad(new File(renameFileExtension(file.getCanonicalPath(), "vcd")))) { - filesToLoad.add(new File(renameFileExtension(file.getCanonicalPath(), "vcd"))); + } else if (Messages.WaveformViewer_20.equals(ext.toLowerCase()) || Messages.WaveformViewer_21.equals(ext.toLowerCase())) { + if (askIfToLoad(new File(renameFileExtension(file.getCanonicalPath(), Messages.WaveformViewer_19)))) { + filesToLoad.add(new File(renameFileExtension(file.getCanonicalPath(), Messages.WaveformViewer_19))); } } } catch (IOException e) { // silently ignore any error @@ -423,7 +424,7 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis public void saveState(MPart part) { // save changes Map persistedState = part.getPersistedState(); - persistedState.put(DATABASE_FILE + "S", Integer.toString(filesToLoad.size())); + persistedState.put(DATABASE_FILE + "S", Integer.toString(filesToLoad.size())); //$NON-NLS-1$ Integer index = 0; for (File file : filesToLoad) { persistedState.put(DATABASE_FILE + index, file.getAbsolutePath()); @@ -434,7 +435,7 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis public void saveState(String fileName){ Map persistedState = new HashMap<>(); - persistedState.put(DATABASE_FILE + "S", Integer.toString(filesToLoad.size())); + persistedState.put(DATABASE_FILE + "S", Integer.toString(filesToLoad.size())); //$NON-NLS-1$ Integer index = 0; for (File file : filesToLoad) { persistedState.put(DATABASE_FILE + index, file.getAbsolutePath()); @@ -445,7 +446,7 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis props.putAll(persistedState); try { FileOutputStream out = new FileOutputStream(fileName); - props.store(out, "Written by SCViewer"); + props.store(out, "Written by SCViewer"); //$NON-NLS-1$ out.close(); } catch (IOException e) { e.printStackTrace(); @@ -473,14 +474,14 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis */ protected void saveWaveformViewerState(Map persistedState) { Integer index; - persistedState.put(SHOWN_WAVEFORM + "S", Integer.toString(waveformPane.getStreamList().size())); + persistedState.put(SHOWN_WAVEFORM + "S", Integer.toString(waveformPane.getStreamList().size())); //$NON-NLS-1$ index = 0; for (TrackEntry trackEntry : waveformPane.getStreamList()) { persistedState.put(SHOWN_WAVEFORM + index, trackEntry.waveform.getFullName()); index++; } List cursors = waveformPane.getCursorList(); - persistedState.put(SHOWN_CURSOR + "S", Integer.toString(cursors.size())); + persistedState.put(SHOWN_CURSOR + "S", Integer.toString(cursors.size())); //$NON-NLS-1$ index = 0; for (ICursor cursor : cursors) { persistedState.put(SHOWN_CURSOR + index, Long.toString(cursor.getTime())); @@ -496,7 +497,7 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis * @param state the state */ protected void restoreWaveformViewerState(Map state) { - Integer waves = state.containsKey(SHOWN_WAVEFORM+"S") ? Integer.parseInt(state.get(SHOWN_WAVEFORM + "S")):0; + Integer waves = state.containsKey(SHOWN_WAVEFORM+"S") ? Integer.parseInt(state.get(SHOWN_WAVEFORM + "S")):0; //$NON-NLS-1$ //$NON-NLS-2$ List res = new LinkedList<>(); for (int i = 0; i < waves; i++) { IWaveform waveform = database.getStreamByName(state.get(SHOWN_WAVEFORM + i)); @@ -505,7 +506,7 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis } if (res.size() > 0) waveformPane.getStreamList().addAll(res); - Integer cursorLength = state.containsKey(SHOWN_CURSOR+"S")?Integer.parseInt(state.get(SHOWN_CURSOR + "S")):0; + Integer cursorLength = state.containsKey(SHOWN_CURSOR+"S")?Integer.parseInt(state.get(SHOWN_CURSOR + "S")):0; //$NON-NLS-1$ //$NON-NLS-2$ List cursors = waveformPane.getCursorList(); if (cursorLength == cursors.size()) { for (int i = 0; i < cursorLength; i++) { @@ -567,8 +568,8 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis * @return true, if successful */ protected boolean askIfToLoad(File txFile) { - if (txFile.exists() && MessageDialog.openQuestion(myParent.getDisplay().getActiveShell(), "Database open", - "Would you like to open the adjacent database " + txFile.getName() + " as well?")) { + if (txFile.exists() && MessageDialog.openQuestion(myParent.getDisplay().getActiveShell(), Messages.WaveformViewer_37, + Messages.WaveformViewer_38 + txFile.getName() + Messages.WaveformViewer_39)) { return true; } return false; @@ -584,10 +585,10 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis protected static String renameFileExtension(String source, String newExt) { String target; String currentExt = getFileExtension(source); - if (currentExt.equals("")) { - target = source + "." + newExt; + if (currentExt.equals("")) { //$NON-NLS-1$ + target = source + "." + newExt; //$NON-NLS-1$ } else { - target = source.replaceFirst(Pattern.quote("." + currentExt) + "$", Matcher.quoteReplacement("." + newExt)); + target = source.replaceFirst(Pattern.quote("." + currentExt) + "$", Matcher.quoteReplacement("." + newExt)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ } return target; } @@ -599,7 +600,7 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis * @return the file extension */ protected static String getFileExtension(String f) { - String ext = ""; + String ext = ""; //$NON-NLS-1$ int i = f.lastIndexOf('.'); if (i > 0 && i < f.length() - 1) { ext = f.substring(i + 1); diff --git a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/preferences/DefaultValuesInitializer.java b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/preferences/DefaultValuesInitializer.java index ee338b3..4cdcf2b 100644 --- a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/preferences/DefaultValuesInitializer.java +++ b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/preferences/DefaultValuesInitializer.java @@ -65,7 +65,7 @@ public class DefaultValuesInitializer extends AbstractPreferenceInitializer { store.setDefault(PreferenceConstants.DATABASE_RELOAD, true); for (WaveformColors c : WaveformColors.values()) { - store.setDefault(c.name()+"_COLOR", StringConverter.asString(colors[c.ordinal()].getRGB())); + store.setDefault(c.name()+"_COLOR", StringConverter.asString(colors[c.ordinal()].getRGB())); //$NON-NLS-1$ } } diff --git a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/preferences/PreferenceConstants.java b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/preferences/PreferenceConstants.java index e0b83b3..b9ed912 100644 --- a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/preferences/PreferenceConstants.java +++ b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/preferences/PreferenceConstants.java @@ -16,64 +16,64 @@ package com.minres.scviewer.e4.application.preferences; public class PreferenceConstants { /** The Constant PREFERENCES_SCOPE. */ - public static final String PREFERENCES_SCOPE="com.minres.scviewer.e4.application"; + public static final String PREFERENCES_SCOPE="com.minres.scviewer.e4.application"; //$NON-NLS-1$ /** The Constant DATABASE_RELOAD. */ - public static final String DATABASE_RELOAD="databaseReload"; + public static final String DATABASE_RELOAD="databaseReload"; //$NON-NLS-1$ /** The Constant LINE_COLOR. */ - public static final String LINE_COLOR="LINE_COLOR"; + public static final String LINE_COLOR="LINE_COLOR"; //$NON-NLS-1$ /** The Constant LINE_HIGHLITE_COLOR. */ - public static final String LINE_HIGHLITE_COLOR="LINE_HIGHLITE_COLOR"; + public static final String LINE_HIGHLITE_COLOR="LINE_HIGHLITE_COLOR"; //$NON-NLS-1$ /** The Constant TRACK_BG_EVEN_COLOR. */ - public static final String TRACK_BG_EVEN_COLOR="TRACK_BG_EVEN_COLOR"; + public static final String TRACK_BG_EVEN_COLOR="TRACK_BG_EVEN_COLOR"; //$NON-NLS-1$ /** The Constant TRACK_BG_ODD_COLOR. */ - public static final String TRACK_BG_ODD_COLOR="TRACK_BG_ODD_COLOR"; + public static final String TRACK_BG_ODD_COLOR="TRACK_BG_ODD_COLOR"; //$NON-NLS-1$ /** The Constant TRACK_BG_HIGHLITE_COLOR. */ - public static final String TRACK_BG_HIGHLITE_COLOR="TRACK_BG_HIGHLITE_COLOR"; + public static final String TRACK_BG_HIGHLITE_COLOR="TRACK_BG_HIGHLITE_COLOR"; //$NON-NLS-1$ /** The Constant TX_BG_COLOR. */ - public static final String TX_BG_COLOR="TX_BG_COLOR"; + public static final String TX_BG_COLOR="TX_BG_COLOR"; //$NON-NLS-1$ /** The Constant TX_BG_HIGHLITE_COLOR. */ - public static final String TX_BG_HIGHLITE_COLOR="TX_BG_HIGHLITE_COLOR"; + public static final String TX_BG_HIGHLITE_COLOR="TX_BG_HIGHLITE_COLOR"; //$NON-NLS-1$ /** The Constant TX_BORDER_COLOR. */ - public static final String TX_BORDER_COLOR="TX_BORDER_COLOR"; + public static final String TX_BORDER_COLOR="TX_BORDER_COLOR"; //$NON-NLS-1$ /** The Constant SIGNAL0_COLOR. */ - public static final String SIGNAL0_COLOR="SIGNAL0_COLOR"; + public static final String SIGNAL0_COLOR="SIGNAL0_COLOR"; //$NON-NLS-1$ /** The Constant SIGNAL1_COLOR. */ - public static final String SIGNAL1_COLOR="SIGNAL1_COLOR"; + public static final String SIGNAL1_COLOR="SIGNAL1_COLOR"; //$NON-NLS-1$ /** The Constant SIGNALZ_COLOR. */ - public static final String SIGNALZ_COLOR="SIGNALZ_COLOR"; + public static final String SIGNALZ_COLOR="SIGNALZ_COLOR"; //$NON-NLS-1$ /** The Constant SIGNALX_COLOR. */ - public static final String SIGNALX_COLOR="SIGNALX_COLOR"; + public static final String SIGNALX_COLOR="SIGNALX_COLOR"; //$NON-NLS-1$ /** The Constant SIGNAL_TEXT_COLOR. */ - public static final String SIGNAL_TEXT_COLOR="SIGNAL_TEXT_COLOR"; + public static final String SIGNAL_TEXT_COLOR="SIGNAL_TEXT_COLOR"; //$NON-NLS-1$ /** The Constant CURSOR_COLOR. */ - public static final String CURSOR_COLOR="CURSOR_COLOR"; + public static final String CURSOR_COLOR="CURSOR_COLOR"; //$NON-NLS-1$ /** The Constant CURSOR_DRAG_COLOR. */ - public static final String CURSOR_DRAG_COLOR="CURSOR_DRAG_COLOR"; + public static final String CURSOR_DRAG_COLOR="CURSOR_DRAG_COLOR"; //$NON-NLS-1$ /** The Constant CURSOR_TEXT_COLOR. */ - public static final String CURSOR_TEXT_COLOR="CURSOR_TEXT_COLOR"; + public static final String CURSOR_TEXT_COLOR="CURSOR_TEXT_COLOR"; //$NON-NLS-1$ /** The Constant MARKER_COLOR. */ - public static final String MARKER_COLOR="MARKER_COLOR"; + public static final String MARKER_COLOR="MARKER_COLOR"; //$NON-NLS-1$ /** The Constant MARKER_TEXT_COLOR. */ - public static final String MARKER_TEXT_COLOR="MARKER_TEXT_COLOR"; + public static final String MARKER_TEXT_COLOR="MARKER_TEXT_COLOR"; //$NON-NLS-1$ } diff --git a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/preferences/SCViewerPreferencesPage.java b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/preferences/SCViewerPreferencesPage.java index e559d2a..ef8f9ab 100644 --- a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/preferences/SCViewerPreferencesPage.java +++ b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/preferences/SCViewerPreferencesPage.java @@ -13,6 +13,8 @@ package com.minres.scviewer.e4.application.preferences; import org.eclipse.jface.preference.BooleanFieldEditor; import org.eclipse.jface.preference.FieldEditorPreferencePage; +import com.minres.scviewer.e4.application.Messages; + /** * The Class SCViewerPreferencesPage showing the SCViewer top preferences. @@ -32,7 +34,7 @@ public class SCViewerPreferencesPage extends FieldEditorPreferencePage { @Override protected void createFieldEditors() { - addField(new BooleanFieldEditor(PreferenceConstants.DATABASE_RELOAD, "Check for changed database", + addField(new BooleanFieldEditor(PreferenceConstants.DATABASE_RELOAD, Messages.SCViewerPreferencesPage_0, getFieldEditorParent())); } diff --git a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/preferences/WaveformPreferencesPage.java b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/preferences/WaveformPreferencesPage.java index 56d45d8..81cca09 100644 --- a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/preferences/WaveformPreferencesPage.java +++ b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/preferences/WaveformPreferencesPage.java @@ -14,6 +14,7 @@ import org.eclipse.jface.preference.ColorFieldEditor; import org.eclipse.jface.preference.FieldEditorPreferencePage; import com.minres.scviewer.database.ui.WaveformColors; +import com.minres.scviewer.e4.application.Messages; /** * The WaveformView preference page to show the colors to use. @@ -34,7 +35,7 @@ public class WaveformPreferencesPage extends FieldEditorPreferencePage { protected void createFieldEditors() { for (WaveformColors c : WaveformColors.values()) { - addField(new ColorFieldEditor(c.name() + "_COLOR", "Color for " + c.name().toLowerCase(), + addField(new ColorFieldEditor(c.name() + "_COLOR", Messages.WaveformPreferencesPage_1 + c.name().toLowerCase(), //$NON-NLS-1$ getFieldEditorParent())); } } diff --git a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/provider/TxDbLabelProvider.java b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/provider/TxDbLabelProvider.java index 349d9d5..eab365c 100644 --- a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/provider/TxDbLabelProvider.java +++ b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/provider/TxDbLabelProvider.java @@ -42,12 +42,12 @@ public class TxDbLabelProvider implements ILabelProvider { */ public TxDbLabelProvider() { super(); - loadinDatabase=ResourceManager.getPluginImage("com.minres.scviewer.e4.application", "icons/database_go.png"); - database=ResourceManager.getPluginImage("com.minres.scviewer.e4.application", "icons/database.png"); - stream=ResourceManager.getPluginImage("com.minres.scviewer.e4.application", "icons/stream.png"); - folder=ResourceManager.getPluginImage("com.minres.scviewer.e4.application", "icons/folder.png"); - signal=ResourceManager.getPluginImage("com.minres.scviewer.e4.application", "icons/signal.png"); - wave=ResourceManager.getPluginImage("com.minres.scviewer.e4.application", "icons/wave.png"); + loadinDatabase=ResourceManager.getPluginImage("com.minres.scviewer.e4.application", "icons/database_go.png"); //$NON-NLS-1$ //$NON-NLS-2$ + database=ResourceManager.getPluginImage("com.minres.scviewer.e4.application", "icons/database.png"); //$NON-NLS-1$ //$NON-NLS-2$ + stream=ResourceManager.getPluginImage("com.minres.scviewer.e4.application", "icons/stream.png"); //$NON-NLS-1$ //$NON-NLS-2$ + folder=ResourceManager.getPluginImage("com.minres.scviewer.e4.application", "icons/folder.png"); //$NON-NLS-1$ //$NON-NLS-2$ + signal=ResourceManager.getPluginImage("com.minres.scviewer.e4.application", "icons/signal.png"); //$NON-NLS-1$ //$NON-NLS-2$ + wave=ResourceManager.getPluginImage("com.minres.scviewer.e4.application", "icons/wave.png"); //$NON-NLS-1$ //$NON-NLS-2$ } /* (non-Javadoc) diff --git a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/provider/TxPropertiesLabelProvider.java b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/provider/TxPropertiesLabelProvider.java index ecf7533..b6f068b 100644 --- a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/provider/TxPropertiesLabelProvider.java +++ b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/provider/TxPropertiesLabelProvider.java @@ -80,7 +80,7 @@ public class TxPropertiesLabelProvider implements ITableLabelProvider { @Override public String getColumnText(Object element, int columnIndex) { ITxAttribute attribute = (ITxAttribute) element; - String text = ""; + String text = ""; //$NON-NLS-1$ switch (columnIndex) { case TransactionDetails.COLUMN_FIRST: text = attribute.getName(); diff --git a/com.minres.scviewer.e4.application/src/org/eclipse/wb/swt/ResourceManager.java b/com.minres.scviewer.e4.application/src/org/eclipse/wb/swt/ResourceManager.java index f42c09f..ddf492f 100644 --- a/com.minres.scviewer.e4.application/src/org/eclipse/wb/swt/ResourceManager.java +++ b/com.minres.scviewer.e4.application/src/org/eclipse/wb/swt/ResourceManager.java @@ -26,7 +26,9 @@ import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.graphics.Point; import org.eclipse.swt.graphics.Rectangle; -import org.osgi.framework.Bundle; +import org.osgi.framework.Bundle; + +import com.minres.scviewer.e4.application.Messages; /** * Utility class for managing OS resources associated with SWT/JFace controls such as colors, fonts, images, @@ -124,7 +126,7 @@ public class ResourceManager extends SWTResourceManager { */ public static Image decorateImage(final Image baseImage, final Image decorator, final int corner) { if (corner <= 0 || corner >= LAST_CORNER_KEY) { - throw new IllegalArgumentException("Wrong decorate corner"); + throw new IllegalArgumentException(Messages.ResourceManager_0); } Map> cornerDecoratedImageMap = m_decoratedImageMap[corner]; if (cornerDecoratedImageMap == null) { diff --git a/com.minres.scviewer.e4.application/src/org/eclipse/wb/swt/SWTResourceManager.java b/com.minres.scviewer.e4.application/src/org/eclipse/wb/swt/SWTResourceManager.java index 99d8452..4974bee 100644 --- a/com.minres.scviewer.e4.application/src/org/eclipse/wb/swt/SWTResourceManager.java +++ b/com.minres.scviewer.e4.application/src/org/eclipse/wb/swt/SWTResourceManager.java @@ -27,6 +27,8 @@ import org.eclipse.swt.graphics.ImageData; import org.eclipse.swt.graphics.RGB; import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.widgets.Display; + +import com.minres.scviewer.e4.application.Messages; /** * Utility class for managing OS resources associated with SWT controls such as colors, fonts, images, etc. @@ -232,7 +234,7 @@ public class SWTResourceManager { */ public static Image decorateImage(final Image baseImage, final Image decorator, final int corner) { if (corner <= 0 || corner >= LAST_CORNER_KEY) { - throw new IllegalArgumentException("Wrong decorate corner"); + throw new IllegalArgumentException(Messages.SWTResourceManager_0); } Map> cornerDecoratedImageMap = m_decoratedImageMap[corner]; if (cornerDecoratedImageMap == null) {