Icons for toggle insert left/right in pherogram added.
authorb.stoever <b.stoever@localhost>
Sun, 12 Apr 2015 19:46:47 +0000 (19:46 +0000)
committerb.stoever <b.stoever@localhost>
Sun, 12 Apr 2015 19:46:47 +0000 (19:46 +0000)
.gitattributes
eu.etaxonomy.taxeditor.editor/icons/pherogram-insert-left-16x16.png [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/icons/pherogram-insert-left-disabled-16x16.png [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/icons/pherogram-insert-right-16x16.png [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/icons/pherogram-insert-right-disabled-16x16.png [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/plugin.xml
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ToggleLeftRightInsertionHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/AlignmentEditor.java

index e1e611d3d399c7c94b2b982f927ac954bc0b60a8..f3f5fbba04d14c1d836371a0c5d051fcad8961ee 100644 (file)
@@ -365,6 +365,10 @@ eu.etaxonomy.taxeditor.editor/icons/edit_16x16.gif -text
 eu.etaxonomy.taxeditor.editor/icons/emblem-photos.png -text
 eu.etaxonomy.taxeditor.editor/icons/leaf_detail.png -text
 eu.etaxonomy.taxeditor.editor/icons/link_obj.gif -text
+eu.etaxonomy.taxeditor.editor/icons/pherogram-insert-left-16x16.png -text
+eu.etaxonomy.taxeditor.editor/icons/pherogram-insert-left-disabled-16x16.png -text
+eu.etaxonomy.taxeditor.editor/icons/pherogram-insert-right-16x16.png -text
+eu.etaxonomy.taxeditor.editor/icons/pherogram-insert-right-disabled-16x16.png -text
 eu.etaxonomy.taxeditor.editor/icons/xper64.png -text
 eu.etaxonomy.taxeditor.editor/lib/biojava3-alignment-3.0.7.jar -text
 eu.etaxonomy.taxeditor.editor/lib/biojava3-core-3.0.7.jar -text
diff --git a/eu.etaxonomy.taxeditor.editor/icons/pherogram-insert-left-16x16.png b/eu.etaxonomy.taxeditor.editor/icons/pherogram-insert-left-16x16.png
new file mode 100644 (file)
index 0000000..d36e479
Binary files /dev/null and b/eu.etaxonomy.taxeditor.editor/icons/pherogram-insert-left-16x16.png differ
diff --git a/eu.etaxonomy.taxeditor.editor/icons/pherogram-insert-left-disabled-16x16.png b/eu.etaxonomy.taxeditor.editor/icons/pherogram-insert-left-disabled-16x16.png
new file mode 100644 (file)
index 0000000..b7a23fa
Binary files /dev/null and b/eu.etaxonomy.taxeditor.editor/icons/pherogram-insert-left-disabled-16x16.png differ
diff --git a/eu.etaxonomy.taxeditor.editor/icons/pherogram-insert-right-16x16.png b/eu.etaxonomy.taxeditor.editor/icons/pherogram-insert-right-16x16.png
new file mode 100644 (file)
index 0000000..4d10fb1
Binary files /dev/null and b/eu.etaxonomy.taxeditor.editor/icons/pherogram-insert-right-16x16.png differ
diff --git a/eu.etaxonomy.taxeditor.editor/icons/pherogram-insert-right-disabled-16x16.png b/eu.etaxonomy.taxeditor.editor/icons/pherogram-insert-right-disabled-16x16.png
new file mode 100644 (file)
index 0000000..3f9fa7c
Binary files /dev/null and b/eu.etaxonomy.taxeditor.editor/icons/pherogram-insert-right-disabled-16x16.png differ
index 9c398be754c0b4ca8125ac9de555399e92a7312e..16021314a73e4757f8aeb29cfe0a1f3a88f131b3 100644 (file)
             </command>
             <command
                   commandId="eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor.toggleLeftRightInsertion"
-                  label="Toggle left/right insertion"
+                  disabledIcon="icons/pherogram-insert-left-disabled-16x16.png"
+                  icon="icons/pherogram-insert-left-16x16.png"
+                  label="Left"
                   style="push">
                <visibleWhen
                      checkEnabled="true">
index d64f7513348d3fdc82de58fddaf86581cc36509b..0c10adb81f80359f2730c177183237eb763f7748 100644 (file)
@@ -15,12 +15,14 @@ import java.util.Map;
 import org.eclipse.core.commands.AbstractHandler;\r
 import org.eclipse.core.commands.ExecutionEvent;\r
 import org.eclipse.core.commands.ExecutionException;\r
+import org.eclipse.jface.resource.ImageDescriptor;\r
 import org.eclipse.ui.IEditorPart;\r
 import org.eclipse.ui.commands.IElementUpdater;\r
 import org.eclipse.ui.menus.UIElement;\r
 \r
 import eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor;\r
 import eu.etaxonomy.taxeditor.model.AbstractUtility;\r
+import eu.etaxonomy.taxeditor.model.ImageResources;\r
 \r
 \r
 \r
@@ -34,6 +36,20 @@ public class ToggleLeftRightInsertionHandler extends AbstractHandler implements
        public static final String COMMAND_ID = \r
                        "eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor.toggleLeftRightInsertion";\r
        \r
+       public static final String INSERT_LEFT_IMAGE = "pherogram-insert-left-16x16.png";\r
+       public static final String INSERT_RIGHT_IMAGE = "pherogram-insert-right-16x16.png";\r
+       public static final String INSERT_LEFT_IMAGE_DISABLED = "pherogram-insert-left-disabled-16x16.png";\r
+       public static final String INSERT_RIGHT_IMAGE_DISABLED = "pherogram-insert-right-disabled-16x16.png";\r
+       \r
+       public static final ImageDescriptor INSERT_LEFT_IMAGE_DESCRIPTOR = \r
+                       ImageResources.getImageDescriptor(INSERT_LEFT_IMAGE);\r
+       public static final ImageDescriptor INSERT_RIGHT_IMAGE_DESCRIPTOR = \r
+                       ImageResources.getImageDescriptor(INSERT_RIGHT_IMAGE);\r
+       public static final ImageDescriptor INSERT_LEFT_IMAGE_DESCRIPTOR_DISABLED = \r
+                       ImageResources.getImageDescriptor(INSERT_LEFT_IMAGE_DISABLED);\r
+       public static final ImageDescriptor INSERT_RIGHT_IMAGE_DESCRIPTOR_DISABLED = \r
+                       ImageResources.getImageDescriptor(INSERT_RIGHT_IMAGE_DISABLED);\r
+       \r
        \r
        @Override\r
        public Object execute(ExecutionEvent event) throws ExecutionException {\r
@@ -49,12 +65,15 @@ public class ToggleLeftRightInsertionHandler extends AbstractHandler implements
        public void updateElement(UIElement element, @SuppressWarnings("rawtypes") Map parameters) {\r
         IEditorPart activeEditor = AbstractUtility.getActiveEditor();\r
                if (activeEditor instanceof AlignmentEditor) {\r
-                       //TODO Use icons instead.\r
                        if (((AlignmentEditor)activeEditor).isInsertLeftInPherogram()) {\r
+                               element.setIcon(INSERT_LEFT_IMAGE_DESCRIPTOR);\r
+                               element.setDisabledIcon(INSERT_LEFT_IMAGE_DESCRIPTOR_DISABLED);\r
                                element.setText(" Left ");\r
                                element.setTooltip("Click to switch to insert new distorsions of the base call sequence right of future edits.");\r
                        }\r
                        else {\r
+                               element.setIcon(INSERT_RIGHT_IMAGE_DESCRIPTOR);\r
+                               element.setDisabledIcon(INSERT_RIGHT_IMAGE_DESCRIPTOR_DISABLED);\r
                                element.setText("Right");\r
                                element.setTooltip("Click to switch to insert new distorsions of the base call sequence left of future edits.");\r
                        }\r
index d78d0559adf73c359838854a4a859545e57c6427..9add0c797bb4dc7595ca7f0b239eb534ca52a1e1 100644 (file)
@@ -125,8 +125,9 @@ public class AlignmentEditor extends EditorPart {
     private final Map<Integer, SingleReadAlignment> cdmMap = new TreeMap<Integer, SingleReadAlignment>();  //TODO Move this to ContigSequenceDataProvider
     private boolean dirty = false;
 
+    
     public AlignmentEditor() {
-        conversationHolder = CdmStore.createConversation();
+        conversationHolder = null; //CdmStore.createConversation();
     }