I18n for Specimen Editor
authorPatrick Plitzner <p.plitzner@bgbm.org>
Wed, 9 Sep 2015 09:57:35 +0000 (11:57 +0200)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Wed, 9 Sep 2015 11:22:50 +0000 (13:22 +0200)
eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/messages.properties [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/messages_de.properties [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/Messages.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/DerivateDragListener.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/DerivateView.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/contextMenu/CreateDerivateContextMenu.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/contextMenu/SingleReadSequenceContextMenu.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/UriWithLabelElement.java

diff --git a/eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/messages.properties b/eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/messages.properties
new file mode 100644 (file)
index 0000000..5eafb02
--- /dev/null
@@ -0,0 +1,19 @@
+CreateDerivateContextMenu_ADD=Add...
+CreateDerivateContextMenu_DNA_SAMPLE=DNA Sample
+CreateDerivateContextMenu_MEDIA=Media...
+CreateDerivateContextMenu_MEDIA_EXISTING=Media Specimen with existing media
+CreateDerivateContextMenu_MEDIA_SPECIMEN=Media Specimen
+CreateDerivateContextMenu_NO_CHILD_DERIVATE=No child derivatives
+CreateDerivateContextMenu_SEQUENCE=Consensus Sequence
+CreateDerivateContextMenu_SINGLE_READ=Single Read
+CreateDerivateContextMenu_SPECIMEN=Specimen
+CreateDerivateContextMenu_TISSUE_SAMPLE=Tissue Sample
+
+SingleReadSequenceContextMenu_REMOVE_FROM_SEQUENCE=Remove from this Sequence
+SingleReadSequenceContextMenu_REUSE_FOR_SEQUENCE=Reuse for other Sequence
+SingleReadSequenceContextMenu_REUSE_SINGLE_READ_HERE=Reuse SingleRead here
+
+DerivateView_DERIVATIVE_EDITOR=Derivative Editor
+DerivateView_SAVING_HIERARCHY=Saving hierarchy
+DerivateView_UNSAVED_CHANGES=View has unsaved changes
+DerivateView_YOU_NEED_TO_SAVE=You need to save before performing this action
diff --git a/eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/messages_de.properties b/eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/messages_de.properties
new file mode 100644 (file)
index 0000000..ca3ff7f
--- /dev/null
@@ -0,0 +1,19 @@
+CreateDerivateContextMenu_ADD=Hinzufügen...
+CreateDerivateContextMenu_DNA_SAMPLE=DNA Sample
+CreateDerivateContextMenu_MEDIA=Media...
+CreateDerivateContextMenu_MEDIA_EXISTING=Media Specimen mit vorhandender Mediadatei
+CreateDerivateContextMenu_MEDIA_SPECIMEN=Media Specimen
+CreateDerivateContextMenu_NO_CHILD_DERIVATE=Keine Kind-Derivate
+CreateDerivateContextMenu_SEQUENCE=Konsensussequenz
+CreateDerivateContextMenu_SINGLE_READ=Single Read
+CreateDerivateContextMenu_SPECIMEN=Beleg
+CreateDerivateContextMenu_TISSUE_SAMPLE=Gewebeprobe
+
+SingleReadSequenceContextMenu_REMOVE_FROM_SEQUENCE=Von Sequenz entfernen
+SingleReadSequenceContextMenu_REUSE_FOR_SEQUENCE=Für andere Sequenz verwenden
+SingleReadSequenceContextMenu_REUSE_SINGLE_READ_HERE=SingleRead hier verwenden
+
+DerivateView_DERIVATIVE_EDITOR=Derivate Editor
+DerivateView_SAVING_HIERARCHY=Speichere Hierarie
+DerivateView_UNSAVED_CHANGES=Ungepeicherte Änderungen
+DerivateView_YOU_NEED_TO_SAVE=Sie müssen speichern, um diese Aktion auszuführen
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/Messages.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/Messages.java
new file mode 100644 (file)
index 0000000..0d822ab
--- /dev/null
@@ -0,0 +1,45 @@
+// $Id$
+/**
+ * Copyright (C) 2015 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
+package eu.etaxonomy.taxeditor.editor;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * @author pplitzner
+ * @date 09.09.2015
+ *
+ */
+public class Messages extends NLS {
+    private static final String BUNDLE_NAME = "OSGI-INF/l10n/messages"; //$NON-NLS-1$
+    public static String CreateDerivateContextMenu_ADD;
+    public static String CreateDerivateContextMenu_DNA_SAMPLE;
+    public static String CreateDerivateContextMenu_MEDIA;
+    public static String CreateDerivateContextMenu_MEDIA_EXISTING;
+    public static String CreateDerivateContextMenu_MEDIA_SPECIMEN;
+    public static String CreateDerivateContextMenu_NO_CHILD_DERIVATE;
+    public static String CreateDerivateContextMenu_SEQUENCE;
+    public static String CreateDerivateContextMenu_SINGLE_READ;
+    public static String CreateDerivateContextMenu_SPECIMEN;
+    public static String CreateDerivateContextMenu_TISSUE_SAMPLE;
+    public static String DerivateView_DERIVATIVE_EDITOR;
+    public static String DerivateView_SAVING_HIERARCHY;
+    public static String DerivateView_UNSAVED_CHANGES;
+    public static String DerivateView_YOU_NEED_TO_SAVE;
+    public static String SingleReadSequenceContextMenu_REMOVE_FROM_SEQUENCE;
+    public static String SingleReadSequenceContextMenu_REUSE_FOR_SEQUENCE;
+    public static String SingleReadSequenceContextMenu_REUSE_SINGLE_READ_HERE;
+    static {
+        // initialize resource bundle
+        NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+    }
+
+    private Messages() {
+    }
+}
index c597eca6c8d21910272feb68ca94b23a994d7b54..e96e5badff0627d016287900d2a1a63a0dc9a7e2 100644 (file)
@@ -33,9 +33,6 @@ public class DerivateDragListener extends DragSourceAdapter{
         this.derivateView = derivateView;
     }
 
         this.derivateView = derivateView;
     }
 
-    /* (non-Javadoc)
-     * @see org.eclipse.swt.dnd.DragSourceAdapter#dragSetData(org.eclipse.swt.dnd.DragSourceEvent)
-     */
     @Override
     public void dragSetData(DragSourceEvent event) {
         if (LocalSelectionTransfer.getTransfer().isSupportedType(event.dataType)) {
     @Override
     public void dragSetData(DragSourceEvent event) {
         if (LocalSelectionTransfer.getTransfer().isSupportedType(event.dataType)) {
@@ -44,14 +41,11 @@ public class DerivateDragListener extends DragSourceAdapter{
         }
     }
 
         }
     }
 
-    /* (non-Javadoc)
-     * @see org.eclipse.swt.dnd.DragSourceAdapter#dragStart(org.eclipse.swt.dnd.DragSourceEvent)
-     */
     @Override
     public void dragStart(DragSourceEvent event) {
         if(derivateView.isDirty()){
             event.doit = false;
     @Override
     public void dragStart(DragSourceEvent event) {
         if(derivateView.isDirty()){
             event.doit = false;
-            MessagingUtils.warningDialog("View has unsaved changes", this, "You need to save before performing this action");
+            MessagingUtils.warningDialog(DerivateView.VIEW_HAS_UNSAVED_CHANGES, this, DerivateView.YOU_NEED_TO_SAVE_BEFORE_PERFORMING_THIS_ACTION);
             return;
         }
         ISelection selection = derivateView.getViewer().getSelection();
             return;
         }
         ISelection selection = derivateView.getViewer().getSelection();
index c805c6f165e7a4d70d2fd3c172b7b67a8a8e2606..d7fcc56f8d710cd59e31b4c7d2f0a926a006b217 100644 (file)
@@ -39,6 +39,7 @@ import eu.etaxonomy.cdm.model.molecular.Sequence;
 import eu.etaxonomy.cdm.model.molecular.SingleRead;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
 import eu.etaxonomy.cdm.model.molecular.SingleRead;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
+import eu.etaxonomy.taxeditor.editor.Messages;
 import eu.etaxonomy.taxeditor.model.IDirtyMarkable;
 import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
 import eu.etaxonomy.taxeditor.model.IPartContentHasFactualData;
 import eu.etaxonomy.taxeditor.model.IDirtyMarkable;
 import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
 import eu.etaxonomy.taxeditor.model.IPartContentHasFactualData;
@@ -57,7 +58,10 @@ public class DerivateView extends EditorPart implements IPartContentHasFactualDa
         IConversationEnabled, IPartContentHasDetails, IPartContentHasSupplementalData, IPartContentHasMedia,
         ISelectionChangedListener, IPostOperationEnabled {
 
         IConversationEnabled, IPartContentHasDetails, IPartContentHasSupplementalData, IPartContentHasMedia,
         ISelectionChangedListener, IPostOperationEnabled {
 
-    public static final String ID = "eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView";
+    public static final String ID = "eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView"; //$NON-NLS-1$
+
+    public static final String YOU_NEED_TO_SAVE_BEFORE_PERFORMING_THIS_ACTION = Messages.DerivateView_YOU_NEED_TO_SAVE;
+    public static final String VIEW_HAS_UNSAVED_CHANGES = Messages.DerivateView_UNSAVED_CHANGES;
 
        private ConversationHolder conversation;
 
 
        private ConversationHolder conversation;
 
@@ -122,10 +126,10 @@ public class DerivateView extends EditorPart implements IPartContentHasFactualDa
 
     @Override
     public void doSave(IProgressMonitor monitor) {
 
     @Override
     public void doSave(IProgressMonitor monitor) {
-        String taskName = "Saving hierarchy";
+        String taskName = Messages.DerivateView_SAVING_HIERARCHY;
         if(getEditorInput() instanceof DerivateViewEditorInput){
             DerivateViewEditorInput derivateViewEditorInput = (DerivateViewEditorInput) getEditorInput();
         if(getEditorInput() instanceof DerivateViewEditorInput){
             DerivateViewEditorInput derivateViewEditorInput = (DerivateViewEditorInput) getEditorInput();
-            taskName += " "+derivateViewEditorInput.getName();
+            taskName += " "+derivateViewEditorInput.getName(); //$NON-NLS-1$
         }
         monitor.beginTask(taskName, 3);
         if (!conversation.isBound()) {
         }
         monitor.beginTask(taskName, 3);
         if (!conversation.isBound()) {
@@ -154,7 +158,7 @@ public class DerivateView extends EditorPart implements IPartContentHasFactualDa
             DerivateViewEditorInput derivateViewEditorInput = (DerivateViewEditorInput) getEditorInput();
             return derivateViewEditorInput.getName();
         }
             DerivateViewEditorInput derivateViewEditorInput = (DerivateViewEditorInput) getEditorInput();
             return derivateViewEditorInput.getName();
         }
-        return "Derivative Editor";
+        return Messages.DerivateView_DERIVATIVE_EDITOR;
     }
 
     @Override
     }
 
     @Override
index e62783ae4bed2908fa2688196f9c3a1e83b496f7..fdc4901b257487aad0a8a603b452920f2b7cfa96 100644 (file)
@@ -26,6 +26,7 @@ import eu.etaxonomy.cdm.model.occurrence.MediaSpecimen;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.editor.Messages;
 import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
@@ -37,6 +38,13 @@ import eu.etaxonomy.taxeditor.ui.dialog.selection.MediaSelectionDialog;
  */
 public class CreateDerivateContextMenu extends CompoundContributionItem {
 
  */
 public class CreateDerivateContextMenu extends CompoundContributionItem {
 
+    private static final String SINGLE_READ = Messages.CreateDerivateContextMenu_SINGLE_READ;
+    private static final String CONSENSUS_SEQUENCE = Messages.CreateDerivateContextMenu_SEQUENCE;
+    private static final String MEDIA_SPECIMEN = Messages.CreateDerivateContextMenu_MEDIA_SPECIMEN;
+    private static final String DNA_SAMPLE = Messages.CreateDerivateContextMenu_DNA_SAMPLE;
+    private static final String TISSUE_SAMPLE = Messages.CreateDerivateContextMenu_TISSUE_SAMPLE;
+    private static final String SPECIMEN = Messages.CreateDerivateContextMenu_SPECIMEN;
+
     @Override
     protected IContributionItem[] getContributionItems() {
         IContributionItem[] contributionItems = new IContributionItem[] {
     @Override
     protected IContributionItem[] getContributionItems() {
         IContributionItem[] contributionItems = new IContributionItem[] {
@@ -44,7 +52,7 @@ public class CreateDerivateContextMenu extends CompoundContributionItem {
                     @Override
                     public void fill(Menu menu, int index) {
                         MenuItem addItem = new MenuItem(menu, SWT.CASCADE);
                     @Override
                     public void fill(Menu menu, int index) {
                         MenuItem addItem = new MenuItem(menu, SWT.CASCADE);
-                        addItem.setText("Add...");
+                        addItem.setText(Messages.CreateDerivateContextMenu_ADD);
                         Menu addMenu = new Menu(menu);
                         addItem.setMenu(addMenu);
                         final IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
                         Menu addMenu = new Menu(menu);
                         addItem.setMenu(addMenu);
                         final IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
@@ -53,37 +61,37 @@ public class CreateDerivateContextMenu extends CompoundContributionItem {
                         if(selectedTreeNode!=null){
                             //context menu for FieldUnit
                             if(selectedTreeNode.getValue() instanceof FieldUnit){
                         if(selectedTreeNode!=null){
                             //context menu for FieldUnit
                             if(selectedTreeNode.getValue() instanceof FieldUnit){
-                                createMenuItem(addMenu, "Specimen", selectedTreeNode, DerivedUnit.class, SpecimenOrObservationType.PreservedSpecimen, DerivationEventType.GATHERING_IN_SITU());
+                                createMenuItem(addMenu, SPECIMEN, selectedTreeNode, DerivedUnit.class, SpecimenOrObservationType.PreservedSpecimen, DerivationEventType.GATHERING_IN_SITU());
                                 new MenuItem(addMenu, SWT.SEPARATOR);
                                 new MenuItem(addMenu, SWT.SEPARATOR);
-                                createMenuItem(addMenu, "Tissue Sample", selectedTreeNode, DnaSample.class, SpecimenOrObservationType.TissueSample, DerivationEventType.PREPARATION());
-                                createMenuItem(addMenu, "DNA Sample", selectedTreeNode, DnaSample.class, SpecimenOrObservationType.DnaSample, DerivationEventType.DNA_EXTRACTION());
-                                createMenuItem(addMenu, "Media Specimen", selectedTreeNode, MediaSpecimen.class, SpecimenOrObservationType.Media, DerivationEventType.ACCESSIONING());
+                                createMenuItem(addMenu, TISSUE_SAMPLE, selectedTreeNode, DnaSample.class, SpecimenOrObservationType.TissueSample, DerivationEventType.PREPARATION());
+                                createMenuItem(addMenu, DNA_SAMPLE, selectedTreeNode, DnaSample.class, SpecimenOrObservationType.DnaSample, DerivationEventType.DNA_EXTRACTION());
+                                createMenuItem(addMenu, MEDIA_SPECIMEN, selectedTreeNode, MediaSpecimen.class, SpecimenOrObservationType.Media, DerivationEventType.ACCESSIONING());
                             }
                             //context menu for Specimen
                             else if(selectedTreeNode.getValue() instanceof DerivedUnit && ((DerivedUnit)selectedTreeNode.getValue()).getRecordBasis()==SpecimenOrObservationType.PreservedSpecimen){
 
                             }
                             //context menu for Specimen
                             else if(selectedTreeNode.getValue() instanceof DerivedUnit && ((DerivedUnit)selectedTreeNode.getValue()).getRecordBasis()==SpecimenOrObservationType.PreservedSpecimen){
 
-                                createMenuItem(addMenu, "Tissue Sample", selectedTreeNode, DnaSample.class, SpecimenOrObservationType.TissueSample, DerivationEventType.PREPARATION());
-                                createMenuItem(addMenu, "DNA Sample", selectedTreeNode, DnaSample.class, SpecimenOrObservationType.DnaSample, DerivationEventType.DNA_EXTRACTION());
-                                createMenuItem(addMenu, "Media Specimen", selectedTreeNode, MediaSpecimen.class, SpecimenOrObservationType.Media, DerivationEventType.ACCESSIONING());
+                                createMenuItem(addMenu, TISSUE_SAMPLE, selectedTreeNode, DnaSample.class, SpecimenOrObservationType.TissueSample, DerivationEventType.PREPARATION());
+                                createMenuItem(addMenu, DNA_SAMPLE, selectedTreeNode, DnaSample.class, SpecimenOrObservationType.DnaSample, DerivationEventType.DNA_EXTRACTION());
+                                createMenuItem(addMenu, MEDIA_SPECIMEN, selectedTreeNode, MediaSpecimen.class, SpecimenOrObservationType.Media, DerivationEventType.ACCESSIONING());
                             }
                             //context menu for TissueSample
                             else if(selectedTreeNode.getValue() instanceof DnaSample && ((DnaSample)selectedTreeNode.getValue()).getRecordBasis()==SpecimenOrObservationType.TissueSample){
                             }
                             //context menu for TissueSample
                             else if(selectedTreeNode.getValue() instanceof DnaSample && ((DnaSample)selectedTreeNode.getValue()).getRecordBasis()==SpecimenOrObservationType.TissueSample){
-                               createMenuItem(addMenu, "DnaSample", selectedTreeNode, DnaSample.class, SpecimenOrObservationType.DnaSample, DerivationEventType.DNA_EXTRACTION());
-                               createMenuItem(addMenu, "Media Specimen", selectedTreeNode, MediaSpecimen.class, SpecimenOrObservationType.Media, DerivationEventType.ACCESSIONING());
+                               createMenuItem(addMenu, DNA_SAMPLE, selectedTreeNode, DnaSample.class, SpecimenOrObservationType.DnaSample, DerivationEventType.DNA_EXTRACTION());
+                               createMenuItem(addMenu, MEDIA_SPECIMEN, selectedTreeNode, MediaSpecimen.class, SpecimenOrObservationType.Media, DerivationEventType.ACCESSIONING());
                             }
                             //context menu for DnaSample
                             else if(selectedTreeNode.getValue() instanceof DnaSample && ((DnaSample)selectedTreeNode.getValue()).getRecordBasis()==SpecimenOrObservationType.DnaSample){
                             }
                             //context menu for DnaSample
                             else if(selectedTreeNode.getValue() instanceof DnaSample && ((DnaSample)selectedTreeNode.getValue()).getRecordBasis()==SpecimenOrObservationType.DnaSample){
-                                createMenuItem(addMenu, "Consensus Sequence", selectedTreeNode, Sequence.class, null, null);
-                                createMenuItem(addMenu, "Media Specimen", selectedTreeNode, MediaSpecimen.class, SpecimenOrObservationType.Media, DerivationEventType.ACCESSIONING());
+                                createMenuItem(addMenu, CONSENSUS_SEQUENCE, selectedTreeNode, Sequence.class, null, null);
+                                createMenuItem(addMenu, MEDIA_SPECIMEN, selectedTreeNode, MediaSpecimen.class, SpecimenOrObservationType.Media, DerivationEventType.ACCESSIONING());
                             }
                             //context menu for Sequence
                             else if(selectedTreeNode.getValue() instanceof Sequence){
                             }
                             //context menu for Sequence
                             else if(selectedTreeNode.getValue() instanceof Sequence){
-                                createMenuItem(addMenu, "Single Read", selectedTreeNode, SingleRead.class, null, null);
+                                createMenuItem(addMenu, SINGLE_READ, selectedTreeNode, SingleRead.class, null, null);
                             }
                             //default
                             else{
                                 MenuItem menuItem = new MenuItem(addMenu, SWT.NONE);
                             }
                             //default
                             else{
                                 MenuItem menuItem = new MenuItem(addMenu, SWT.NONE);
-                                menuItem.setText("No child derivates");
+                                menuItem.setText(Messages.CreateDerivateContextMenu_NO_CHILD_DERIVATE);
                                 menuItem.setEnabled(false);
                             }
                         }
                                 menuItem.setEnabled(false);
                             }
                         }
@@ -99,7 +107,7 @@ public class CreateDerivateContextMenu extends CompoundContributionItem {
         if(specimenType!=null && specimenType.equals(SpecimenOrObservationType.Media)){
             //media submenu
             MenuItem mediaItem = new MenuItem(menu, SWT.CASCADE);
         if(specimenType!=null && specimenType.equals(SpecimenOrObservationType.Media)){
             //media submenu
             MenuItem mediaItem = new MenuItem(menu, SWT.CASCADE);
-            mediaItem.setText("Media...");
+            mediaItem.setText(Messages.CreateDerivateContextMenu_MEDIA);
             Menu mediaMenu = new Menu(menu);
             mediaItem.setMenu(mediaMenu);
 
             Menu mediaMenu = new Menu(menu);
             mediaItem.setMenu(mediaMenu);
 
@@ -110,7 +118,7 @@ public class CreateDerivateContextMenu extends CompoundContributionItem {
 
             //existing media menu
             MenuItem existingMediaItem = new MenuItem(mediaMenu, SWT.NONE);
 
             //existing media menu
             MenuItem existingMediaItem = new MenuItem(mediaMenu, SWT.NONE);
-            existingMediaItem.setText("Media Specimen with existing media");
+            existingMediaItem.setText(Messages.CreateDerivateContextMenu_MEDIA_EXISTING);
             existingMediaItem.addSelectionListener(new SelectionAdapter() {
                 @Override
                 public void widgetSelected(SelectionEvent e) {
             existingMediaItem.addSelectionListener(new SelectionAdapter() {
                 @Override
                 public void widgetSelected(SelectionEvent e) {
@@ -176,7 +184,7 @@ public class CreateDerivateContextMenu extends CompoundContributionItem {
             if(derivateView!=null){
                 if(derivateView.isDirty()){
                     e.doit = false;
             if(derivateView!=null){
                 if(derivateView.isDirty()){
                     e.doit = false;
-                    MessagingUtils.warningDialog("View has unsaved changes", this, "You need to save before performing this action");
+                    MessagingUtils.warningDialog(DerivateView.VIEW_HAS_UNSAVED_CHANGES, this, DerivateView.YOU_NEED_TO_SAVE_BEFORE_PERFORMING_THIS_ACTION);
                     return;
                 }
             }
                     return;
                 }
             }
index b3164a4586ad66bf81e18c829ad23aff663db6ef..92848bc39ba9b90f031a5c47fbf547e4fd1b817a 100644 (file)
@@ -19,6 +19,7 @@ import eu.etaxonomy.cdm.api.service.molecular.ISequenceService;
 import eu.etaxonomy.cdm.model.molecular.Sequence;
 import eu.etaxonomy.cdm.model.molecular.SingleRead;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.cdm.model.molecular.Sequence;
 import eu.etaxonomy.cdm.model.molecular.SingleRead;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.editor.Messages;
 import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.store.CdmStore;
@@ -35,9 +36,6 @@ public class SingleReadSequenceContextMenu extends CompoundContributionItem {
         ADD_TO_SEQUENCE
     }
 
         ADD_TO_SEQUENCE
     }
 
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.actions.CompoundContributionItem#getContributionItems()
-     */
     @Override
     protected IContributionItem[] getContributionItems() {
         IContributionItem[] contributionItems = new IContributionItem[] {
     @Override
     protected IContributionItem[] getContributionItems() {
         IContributionItem[] contributionItems = new IContributionItem[] {
@@ -54,17 +52,17 @@ public class SingleReadSequenceContextMenu extends CompoundContributionItem {
                             if(selectedTreeNode.getValue() instanceof Sequence
                                     && clipboardNode!=null && clipboardNode.getValue() instanceof SingleRead){
                                 MenuItem item = new MenuItem(menu, SWT.NONE);
                             if(selectedTreeNode.getValue() instanceof Sequence
                                     && clipboardNode!=null && clipboardNode.getValue() instanceof SingleRead){
                                 MenuItem item = new MenuItem(menu, SWT.NONE);
-                                item.setText("Reuse SingleRead here");
+                                item.setText(Messages.SingleReadSequenceContextMenu_REUSE_SINGLE_READ_HERE);
                                 item.addSelectionListener(new WidgetSelectionListener(CommandType.ADD_TO_SEQUENCE));
                             }
                             else if(selectedTreeNode.getValue() instanceof SingleRead){
                                 MenuItem item = new MenuItem(menu, SWT.NONE);
                                 item.addSelectionListener(new WidgetSelectionListener(CommandType.ADD_TO_SEQUENCE));
                             }
                             else if(selectedTreeNode.getValue() instanceof SingleRead){
                                 MenuItem item = new MenuItem(menu, SWT.NONE);
-                                item.setText("Reuse for other Sequence");
+                                item.setText(Messages.SingleReadSequenceContextMenu_REUSE_FOR_SEQUENCE);
                                 item.addSelectionListener(new WidgetSelectionListener(CommandType.COPY_TO_CLIPBOARD));
                                 if(activeEditor instanceof DerivateView
                                         && ((DerivateView) activeEditor).getMultiLinkSingleReads().contains(selectedTreeNode.getValue())){
                                     MenuItem unlinkItem = new MenuItem(menu, SWT.NONE);
                                 item.addSelectionListener(new WidgetSelectionListener(CommandType.COPY_TO_CLIPBOARD));
                                 if(activeEditor instanceof DerivateView
                                         && ((DerivateView) activeEditor).getMultiLinkSingleReads().contains(selectedTreeNode.getValue())){
                                     MenuItem unlinkItem = new MenuItem(menu, SWT.NONE);
-                                    unlinkItem.setText("Remove from this Sequence");
+                                    unlinkItem.setText(Messages.SingleReadSequenceContextMenu_REMOVE_FROM_SEQUENCE);
                                     unlinkItem.addSelectionListener(new WidgetSelectionListener(CommandType.REMOVE_FROM_SEQUENCE));
                                 }
                             }
                                     unlinkItem.addSelectionListener(new WidgetSelectionListener(CommandType.REMOVE_FROM_SEQUENCE));
                                 }
                             }
@@ -87,9 +85,6 @@ public class SingleReadSequenceContextMenu extends CompoundContributionItem {
             this.commandType = commandType;
         }
 
             this.commandType = commandType;
         }
 
-        /* (non-Javadoc)
-         * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
-         */
         @Override
         public void widgetSelected(SelectionEvent e) {
             IEditorPart activeEditor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
         @Override
         public void widgetSelected(SelectionEvent e) {
             IEditorPart activeEditor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
@@ -100,7 +95,7 @@ public class SingleReadSequenceContextMenu extends CompoundContributionItem {
             switch (commandType) {
             case REMOVE_FROM_SEQUENCE:
                 if(activeEditor.isDirty()){
             switch (commandType) {
             case REMOVE_FROM_SEQUENCE:
                 if(activeEditor.isDirty()){
-                    MessagingUtils.warningDialog("View has unsaved changes", this, "You need to save before performing this action");
+                    MessagingUtils.warningDialog(DerivateView.VIEW_HAS_UNSAVED_CHANGES, this, DerivateView.YOU_NEED_TO_SAVE_BEFORE_PERFORMING_THIS_ACTION);
                     return;
                 }
                 if(selectedTreeNode!=null && selectedTreeNode.getParent()!=null &&
                     return;
                 }
                 if(selectedTreeNode!=null && selectedTreeNode.getParent()!=null &&
@@ -118,7 +113,7 @@ public class SingleReadSequenceContextMenu extends CompoundContributionItem {
                 break;
             case ADD_TO_SEQUENCE:
                 if(activeEditor.isDirty()){
                 break;
             case ADD_TO_SEQUENCE:
                 if(activeEditor.isDirty()){
-                    MessagingUtils.warningDialog("View has unsaved changes", this, "You need to save before performing this action");
+                    MessagingUtils.warningDialog(DerivateView.VIEW_HAS_UNSAVED_CHANGES, this, DerivateView.YOU_NEED_TO_SAVE_BEFORE_PERFORMING_THIS_ACTION);
                     return;
                 }
                 if(clipBoardTreeNode!=null && clipBoardTreeNode.getValue() instanceof SingleRead
                     return;
                 }
                 if(clipBoardTreeNode!=null && clipBoardTreeNode.getValue() instanceof SingleRead
index 1c39870fe93ccd9d53970220541f63d7eb6e4267..b9d6300ecb985131e868427f47e5c4db8bf4a330 100644 (file)
@@ -113,7 +113,7 @@ public class UriWithLabelElement extends TextWithLabelElement {
         } catch (Exception e) {
             labelException.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT));
             labelException.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
         } catch (Exception e) {
             labelException.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT));
             labelException.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
-            labelException.setText(Messages.UriWithLabelElement_URL_NOT_SAVED+e.getMessage());
+            labelException.setText(Messages.UriWithLabelElement_URL_NOT_SAVED+e.getLocalizedMessage());
             return null;
         }
        }
             return null;
         }
        }