Project

General

Profile

« Previous | Next » 

Revision 9a0bf37d

Added by Ben Stöver almost 9 years ago

Icons for toggle insert left/right in pherogram added.

View differences:

.gitattributes
365 365
eu.etaxonomy.taxeditor.editor/icons/emblem-photos.png -text
366 366
eu.etaxonomy.taxeditor.editor/icons/leaf_detail.png -text
367 367
eu.etaxonomy.taxeditor.editor/icons/link_obj.gif -text
368
eu.etaxonomy.taxeditor.editor/icons/pherogram-insert-left-16x16.png -text
369
eu.etaxonomy.taxeditor.editor/icons/pherogram-insert-left-disabled-16x16.png -text
370
eu.etaxonomy.taxeditor.editor/icons/pherogram-insert-right-16x16.png -text
371
eu.etaxonomy.taxeditor.editor/icons/pherogram-insert-right-disabled-16x16.png -text
368 372
eu.etaxonomy.taxeditor.editor/icons/xper64.png -text
369 373
eu.etaxonomy.taxeditor.editor/lib/biojava3-alignment-3.0.7.jar -text
370 374
eu.etaxonomy.taxeditor.editor/lib/biojava3-core-3.0.7.jar -text
eu.etaxonomy.taxeditor.editor/plugin.xml
1018 1018
            </command>
1019 1019
            <command
1020 1020
                  commandId="eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor.toggleLeftRightInsertion"
1021
                  label="Toggle left/right insertion"
1021
                  disabledIcon="icons/pherogram-insert-left-disabled-16x16.png"
1022
                  icon="icons/pherogram-insert-left-16x16.png"
1023
                  label="Left"
1022 1024
                  style="push">
1023 1025
               <visibleWhen
1024 1026
                     checkEnabled="true">
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ToggleLeftRightInsertionHandler.java
15 15
import org.eclipse.core.commands.AbstractHandler;
16 16
import org.eclipse.core.commands.ExecutionEvent;
17 17
import org.eclipse.core.commands.ExecutionException;
18
import org.eclipse.jface.resource.ImageDescriptor;
18 19
import org.eclipse.ui.IEditorPart;
19 20
import org.eclipse.ui.commands.IElementUpdater;
20 21
import org.eclipse.ui.menus.UIElement;
21 22

  
22 23
import eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor;
23 24
import eu.etaxonomy.taxeditor.model.AbstractUtility;
25
import eu.etaxonomy.taxeditor.model.ImageResources;
24 26

  
25 27

  
26 28

  
......
34 36
	public static final String COMMAND_ID = 
35 37
			"eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor.toggleLeftRightInsertion";
36 38
	
39
	public static final String INSERT_LEFT_IMAGE = "pherogram-insert-left-16x16.png";
40
	public static final String INSERT_RIGHT_IMAGE = "pherogram-insert-right-16x16.png";
41
	public static final String INSERT_LEFT_IMAGE_DISABLED = "pherogram-insert-left-disabled-16x16.png";
42
	public static final String INSERT_RIGHT_IMAGE_DISABLED = "pherogram-insert-right-disabled-16x16.png";
43
	
44
	public static final ImageDescriptor INSERT_LEFT_IMAGE_DESCRIPTOR = 
45
			ImageResources.getImageDescriptor(INSERT_LEFT_IMAGE);
46
	public static final ImageDescriptor INSERT_RIGHT_IMAGE_DESCRIPTOR = 
47
			ImageResources.getImageDescriptor(INSERT_RIGHT_IMAGE);
48
	public static final ImageDescriptor INSERT_LEFT_IMAGE_DESCRIPTOR_DISABLED = 
49
			ImageResources.getImageDescriptor(INSERT_LEFT_IMAGE_DISABLED);
50
	public static final ImageDescriptor INSERT_RIGHT_IMAGE_DESCRIPTOR_DISABLED = 
51
			ImageResources.getImageDescriptor(INSERT_RIGHT_IMAGE_DISABLED);
52
	
37 53
	
38 54
	@Override
39 55
	public Object execute(ExecutionEvent event) throws ExecutionException {
......
49 65
	public void updateElement(UIElement element, @SuppressWarnings("rawtypes") Map parameters) {
50 66
        IEditorPart activeEditor = AbstractUtility.getActiveEditor();
51 67
		if (activeEditor instanceof AlignmentEditor) {
52
			//TODO Use icons instead.
53 68
			if (((AlignmentEditor)activeEditor).isInsertLeftInPherogram()) {
69
				element.setIcon(INSERT_LEFT_IMAGE_DESCRIPTOR);
70
				element.setDisabledIcon(INSERT_LEFT_IMAGE_DESCRIPTOR_DISABLED);
54 71
				element.setText(" Left ");
55 72
				element.setTooltip("Click to switch to insert new distorsions of the base call sequence right of future edits.");
56 73
			}
57 74
			else {
75
				element.setIcon(INSERT_RIGHT_IMAGE_DESCRIPTOR);
76
				element.setDisabledIcon(INSERT_RIGHT_IMAGE_DESCRIPTOR_DISABLED);
58 77
				element.setText("Right");
59 78
				element.setTooltip("Click to switch to insert new distorsions of the base call sequence left of future edits.");
60 79
			}
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/AlignmentEditor.java
125 125
    private final Map<Integer, SingleReadAlignment> cdmMap = new TreeMap<Integer, SingleReadAlignment>();  //TODO Move this to ContigSequenceDataProvider
126 126
    private boolean dirty = false;
127 127

  
128
    
128 129
    public AlignmentEditor() {
129
        conversationHolder = CdmStore.createConversation();
130
        conversationHolder = null; //CdmStore.createConversation();
130 131
    }
131 132

  
132 133

  

Also available in: Unified diff