- added experimental key binding for 'a' for the AlignmentEditor
authorPatric Plitzner <p.plitzner@bgbm.org>
Tue, 14 Oct 2014 14:14:59 +0000 (14:14 +0000)
committerPatric Plitzner <p.plitzner@bgbm.org>
Tue, 14 Oct 2014 14:14:59 +0000 (14:14 +0000)
.gitattributes
eu.etaxonomy.taxeditor.application/plugin_customization.ini
eu.etaxonomy.taxeditor.editor/plugin.xml
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/AddAHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/AlignmentEditor.java

index e26e8837047dbfab99519e5bda3987a1ec6ec5a1..d53d4168cb45644d87a5f4f0216fb93f4513a28b 100644 (file)
@@ -386,6 +386,7 @@ eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/Viewer
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/group/authority/CdmAuthorityEditor.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/group/authority/CdmAuthorityEditorInput.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/group/authority/handler/EditCdmAuthoritiesHandler.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/AddAHandler.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/EditNewTaxonHandler.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenAlignmentEditor.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenChecklistEditorHandler.java -text
index d97cc21c8167c7c2b4a36a9ba7765c4874539578..7369371009b25e33919f838a7be15cc08c851164 100644 (file)
@@ -1,4 +1,5 @@
 org.eclipse.ui/SHOW_PROGRESS_ON_STARTUP = true
 org.eclipse.ui/SHOW_TRADITIONAL_STYLE_TABS=false
 org.eclipse.ui/DOCK_PERSPECTIVE_BAR=top-right
-org.eclipse.ui/SHOW_TEXT_ON_PERSPECTIVE_BAR=true
\ No newline at end of file
+org.eclipse.ui/SHOW_TEXT_ON_PERSPECTIVE_BAR=true
+org.eclipse.ui/KEY_CONFIGURATION_ID=eu.etaxonomy.taxeditor.bindings.scheme.default
\ No newline at end of file
index 5ac42f04eae6039484627739a02a3e0ba7f65551..839b58f519ff0c1fd18b73368ba695d8e546f3a6 100644 (file)
             class="eu.etaxonomy.taxeditor.editor.handler.OpenChecklistEditorHandler"
             commandId="eu.etaxonomy.taxeditor.editor.handler.OpenChecklistEditorHandler">
       </handler>
+      <handler
+            class="eu.etaxonomy.taxeditor.editor.handler.AddAHandler"
+            commandId="eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor.addA">
+         <activeWhen>
+            <with
+                  variable="activePartId">
+               <equals
+                     value="eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor">
+               </equals>
+            </with>
+         </activeWhen>
+      </handler>
    </extension>
    <extension
          name="%extension.name"
             id="eu.etaxonomy.taxeditor.editor.handler.OpenAlignmentEditor"
             name="Open Alignment Editor">
       </command>
+      <command
+            id="eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor.addA"
+            name="Add A">
+      </command>
 
    </extension>
    <extension
             id="eu.etaxonomy.taxeditor.bindings.scheme.default"
             name="%scheme.name">
       </scheme>
+      <key
+            commandId="eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor.addA"
+            schemeId="eu.etaxonomy.taxeditor.bindings.scheme.default"
+            sequence="A">
+      </key>
    </extension>
     <extension
          point="org.eclipse.ui.importWizards">
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/AddAHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/AddAHandler.java
new file mode 100644 (file)
index 0000000..bed8204
--- /dev/null
@@ -0,0 +1,30 @@
+package eu.etaxonomy.taxeditor.editor.handler;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.ui.IEditorPart;
+
+import eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
+
+
+public class AddAHandler extends AbstractHandler{
+
+    /* (non-Javadoc)
+     * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+     */
+    @Override
+    public Object execute(ExecutionEvent event) throws ExecutionException {
+        IEditorPart activeEditor = AbstractUtility.getActiveEditor();
+        if(activeEditor instanceof AlignmentEditor){
+            AlignmentEditor alignmentEditor = (AlignmentEditor) activeEditor;
+//            alignmentEditor.getAlignmentArea().getSelection()
+        }
+        MessagingUtils.informationDialog("Added A", "Added A");
+        return null;
+    }
+
+
+}
index 18af38236c7a351d8da16463e3d8e5cb91b156fe..e1dc26aaac89425df9fe9eabf4cb36eab516f020 100644 (file)
@@ -10,8 +10,6 @@
 package eu.etaxonomy.taxeditor.editor.molecular;
 
 
-import java.io.File;
-
 import info.bioinfweb.commons.bio.biojava3.alignment.SimpleAlignment;
 import info.bioinfweb.commons.bio.biojava3.alignment.template.Alignment;
 import info.bioinfweb.commons.bio.biojava3.core.sequence.compound.AlignmentAmbiguityNucleotideCompoundSet;
@@ -25,6 +23,8 @@ import info.bioinfweb.libralign.pherogram.ReverseComplementPherogramProvider;
 import info.bioinfweb.libralign.sequenceprovider.implementations.BioJavaSequenceDataProvider;
 import info.bioinfweb.libralign.sequenceprovider.tokenset.BioJavaTokenSet;
 
+import java.io.File;
+
 import org.biojava.bio.chromatogram.ChromatogramFactory;
 import org.biojava3.core.sequence.DNASequence;
 import org.biojava3.core.sequence.compound.NucleotideCompound;
@@ -43,14 +43,14 @@ import org.eclipse.ui.part.EditorPart;
  * a consensus sequence.
  * <p>
  * The contained GUI components used to edit the alignment come from <a href="http://bioinfweb.info/LibrAlign/">LibrAlign</a>.
- * 
+ *
  * @author pplitzner
  * @author Ben Stöver
  * @date 04.08.2014
  */
 public class AlignmentEditor extends EditorPart {
     public static final String ID = "eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor";
-    
+
     private AlignmentArea alignmentArea;
 
 
@@ -62,33 +62,33 @@ public class AlignmentEditor extends EditorPart {
 //                     BioJavaPherogramProvider pherogramProvider = new BioJavaPherogramProvider(ChromatogramFactory.create(
 //                                     new File("D:\\Users\\BenStoever\\Documents\\Studium\\Projekte\\Promotion\\EDITor\\Quelltexte\\LibrAlign branch\\Repository\\eu.etaxonomy.taxeditor.editor\\src\\main\\resources\\TestPherogram_qualityScore.scf")));
                    //TODO Replace this absolute path with a path working with every workspace location.
-                       
-                       Alignment<DNASequence, NucleotideCompound> alignment = 
+
+                       Alignment<DNASequence, NucleotideCompound> alignment =
                                        new SimpleAlignment<DNASequence, NucleotideCompound>();
                        alignment.add("Read 1", new DNASequence("TAAGATACAACAAGGTTTCGGGCA-CCTTATCCACGCAGTAAGGGGATCAGAGGTTTTTCTCTCATTCATGTATCGTGGATCAGTAAGGCAATTTTGCTACCCTGTCTGCTCTTTCTAGCATTTTACTAATGCCCCAGAAATTAGGAATAAAGATTTTATATGAAAGAAAGGGCGAATTAATTCATAAGGGACTGGTATCCATTCTTATTTGATTTGATACATTGTATCCATTAACATTACATTGGCGAATTGGGCGAAGGTGCGGAAAGAGAGGGATTCGAACCCTCGGTAAACAAAAGTCTACATAGCAGTTCCAATGCTACGCCTTGAACCACTCGGCCACCTCTCCTACATAAGGATTTTGGTCCCAAACCAAAAAGAGGGAGTTGTTCAAATTAGATTCTTAGGTAGGTCCGGACAACGAATTCAAATGAATAAGGTAAGGGGACATCCCCCCTCCCTCCCCTTTGTTTTTTTCTTTATTTGGTTAGGGCGGGGGACTCGACTCTTATTGAATTTTCATATGTATCACAGCTCGAAACGAAAGAACTCGTGGGGGGGTCGTTTCCTTTTTGGATCTTGAACGACTAGGTTCAAGAGATGAGAGAATTCAGGATACCCACAAGAAAGACTAATCCAATCCATAACGATGTACCAGAAAAGACAATATTTTTATTACCTGACCA"));
                        alignment.add("Read 2", new DNASequence("TAAGATACAACAAGGTTTCGGGCAACCTTATCCACGCAGTAAGGGGATCAGAGGTTTTTCTCTCATTCATGTATCGTGGATCAGTAAGGCAATTTTGCTACCCTGTCTGCTCTTTCTAGCATTTTACTAATGCCCCAGAAATTAGGAATAAAGATTTTATATGAAAGAAAGGGCGAATTAATTCATAAGGGACTGGTATCCATTCTTATTTGATTTGATACATTGTATCCATTAACATTACATTGGCGAATTGGGCGAAGGTGCGGAAAGAGAGGGATTCGAACCCTCGGTAAACAAAAGTCTACATAGCAGTTCCAATGCTACGCCTTGAACCACTCGGCCACCTCTCCTACATAAGGATTTTGGTCCCAAACCAAAAAGAGGGAGTTGTTCAAATTAGATTCTTAGGTAGGTCCGGACAACGAATTCAAATGAATAAGGTAAGGGGACATCCCCCCTCCCTCCCCTTTGTTTTTTTCTTTATTTGGTTAGGGCGGGGGACTCGACTCTTATTGAATTTTCATATGTATCACAGCTCGAAACGAAAGAACTCGTGGGGGGGTCGTTTCCTTTTTGGATCTTGAACGACTAGGTTCAAGAGATGAGAGAATTCAGGATACCCACAAGAAAGACTAATCCAATCCATAACGATGTACCAGAAAAGACAATATTTTTATTACCTGACCA"));
                        //alignment.add("Consensus edit 1", new DNASequence("TAAGATACAACAAGGTTTCGGGCAACCTTATCCACGCAGTAAGGGGATCAGAGGTTTTTCTCTCATTCATGTATCGTGGATCAGTAAGGCAATTTTGCTACCCTGTCTGCTCTTTCTAGCATTTTACTAATGCCCCAGAAATTAGGAATAAAGATTTTATATGAAAGAAAGGGCGAATTAATTCATAAGGGACTGGTATCCATTCTTATTTGATTTGATACATTGTATCCATTAACATTACATTGGCGAATTGGGCGAAGGTGCGGAAAGAGAGGGATTCGAACCCTCGGTAAACAAAAGTCTACATAGCAGTTCCAATGCTACGCCTTGAACCACTCGGCCACCTCTCCTACATAAGGATTTTGGTCCCAAACCAAAAAGAGGGAGTTGTTCAAATTAGATTCTTAGGTAGGTCCGGACAACGAATTCAAATGAATAAGGTAAGGGGACATCCCCCCTCCCTCCCCTTTGTTTTTTTCTTTATTTGGTTAGGGCGGGGGACTCGACTCTTATTGAATTTTCATATGTATCACAGCTCGAAACGAAAGAACTCGTGGGGGGGTCGTTTCCTTTTTGGATCTTGAACGACTAGGTTCAAGAGATGAGAGAATTCAGGATACCCACAAGAAAGACTAATCCAATCCATAACGATGTACCAGAAAAGACAATATTTTTATTACCTGACCA"));
-                       
+
 //                     StringBuffer seqBuffer = new StringBuffer(pherogramProvider.getSequenceLength());
 //                     for (int i = 1; i <= pherogramProvider.getSequenceLength(); i++) {
 //                             seqBuffer.append(pherogramProvider.getBaseCall(i).getUpperedBase());
 //                     }
-//                     alignment.add("Sequence 4", new DNASequence("-----" + seqBuffer.substring(0, 38) + 
-//                                     seqBuffer.substring(39, 49) + "--" + seqBuffer.substring(49)));  // One A is deleted for shift change specified below. 
-                       
-                       BioJavaSequenceDataProvider<DNASequence, NucleotideCompound> sequenceProvider = 
+//                     alignment.add("Sequence 4", new DNASequence("-----" + seqBuffer.substring(0, 38) +
+//                                     seqBuffer.substring(39, 49) + "--" + seqBuffer.substring(49)));  // One A is deleted for shift change specified below.
+
+                       BioJavaSequenceDataProvider<DNASequence, NucleotideCompound> sequenceProvider =
                                        new BioJavaSequenceDataProvider<DNASequence, NucleotideCompound>(
                                                        new BioJavaTokenSet<NucleotideCompound>(
                                                                        AlignmentAmbiguityNucleotideCompoundSet.getAlignmentAmbiguityNucleotideCompoundSet()),
                                                        alignment);
-                       
+
                        AlignmentArea result = new AlignmentArea();
                        result.getContentArea().setSequenceProvider(sequenceProvider, false);
                        SequenceIndexArea sequenceIndexArea = new SequenceIndexArea(result.getContentArea());
                        //sequenceIndexArea.setFirstIndex(5);
                        //sequenceIndexArea.setHeight(25);
                        result.getContentArea().getDataAreas().getTopAreas().add(sequenceIndexArea);
-                       
+
 //                     PherogramArea pherogramArea = new PherogramArea(result, pherogramProvider);
 //                     pherogramArea.setFirstSeqPos(34 + 5);
 //                     pherogramArea.setLeftCutPosition(34);
@@ -98,7 +98,7 @@ public class AlignmentEditor extends EditorPart {
 //                     result.getDataAreas().getSequenceAreas(sequenceProvider.sequenceIDByName("Sequence 4")).add(pherogramArea);
 
                        PherogramProvider pherogramProvider = new BioJavaPherogramProvider(ChromatogramFactory.create(
-                                   new File("D:\\Users\\BenStoever\\Documents\\Studium\\Projekte\\Promotion\\EDITor\\Quelltexte\\LibrAlign branch\\Repository\\eu.etaxonomy.taxeditor.editor\\src\\main\\resources\\AlignmentTestData\\JR430_JR-P01.ab1")));
+                                   new File("/home/pplitzner/svn/LibrAlign/taxeditor/eu.etaxonomy.taxeditor.editor/src/main/resources/AlignmentTestData/JR430_JR-P01.ab1")));
                        PherogramArea pherogramArea = new PherogramArea(result.getContentArea(), pherogramProvider);
                        pherogramArea.setFirstSeqPos(1);
                        pherogramArea.setLeftCutPosition(13);
@@ -108,7 +108,7 @@ public class AlignmentEditor extends EditorPart {
                        result.getContentArea().getDataAreas().getSequenceAreas(sequenceProvider.sequenceIDByName("Read 1")).add(pherogramArea);
 
                        pherogramProvider = new ReverseComplementPherogramProvider(new BioJavaPherogramProvider(ChromatogramFactory.create(
-                               new File("D:\\Users\\BenStoever\\Documents\\Studium\\Projekte\\Promotion\\EDITor\\Quelltexte\\LibrAlign branch\\Repository\\eu.etaxonomy.taxeditor.editor\\src\\main\\resources\\AlignmentTestData\\JR444_JR-P05.ab1"))));
+                               new File("/home/pplitzner/svn/LibrAlign/taxeditor/eu.etaxonomy.taxeditor.editor/src/main/resources/AlignmentTestData/JR444_JR-P05.ab1"))));
                        pherogramArea = new PherogramArea(result.getContentArea(), pherogramProvider);
                        pherogramArea.setFirstSeqPos(1);
                        pherogramArea.setLeftCutPosition(267);
@@ -116,26 +116,26 @@ public class AlignmentEditor extends EditorPart {
                        pherogramArea.setVerticalScale(20 * pherogramArea.getVerticalScale());
                        result.getContentArea().getDataAreas().getSequenceAreas(sequenceProvider.sequenceIDByName("Read 2")).add(pherogramArea);
 
-                       
+
                    result.getContentArea().getDataAreas().getBottomAreas().add(new ConsensusSequenceArea(result.getContentArea()));
                        return result;
                }
                catch (Exception e) {
                        throw new RuntimeException(e);
                }
-               
-//             Alignment<DNASequence, NucleotideCompound> alignment = 
+
+//             Alignment<DNASequence, NucleotideCompound> alignment =
 //                             new SimpleAlignment<DNASequence, NucleotideCompound>();
 //             alignment.add("Sequence 1", new DNASequence("ATCGTAGATCGTAGATCGTAGATCGTAGATCGTAGATCGTAGATCGTAG"));
 //             alignment.add("Sequence 2", new DNASequence("AT-GTTG"));
 //             alignment.add("Sequence 3", new DNASequence("AT-GTAG"));
-//             
-//             BioJavaSequenceDataProvider<DNASequence, NucleotideCompound> sequenceProvider = 
+//
+//             BioJavaSequenceDataProvider<DNASequence, NucleotideCompound> sequenceProvider =
 //                             new BioJavaSequenceDataProvider<DNASequence, NucleotideCompound>(
 //                                             new BioJavaTokenSet<NucleotideCompound>(
 //                                                             AlignmentAmbiguityNucleotideCompoundSet.getAlignmentAmbiguityNucleotideCompoundSet()),
 //                                             alignment);
-//             
+//
 //             AlignmentArea result = new AlignmentArea();
 //             result.setSequenceProvider(sequenceProvider, false);
 //             SequenceIndexArea sequenceIndexArea = new SequenceIndexArea(result);
@@ -145,8 +145,8 @@ public class AlignmentEditor extends EditorPart {
 //             result.getDataAreas().getBottomAreas().add(new ConsensusSequenceArea(result));
 //             return result;
        }
-       
-       
+
+
     /* (non-Javadoc)
      * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
      */
@@ -157,7 +157,7 @@ public class AlignmentEditor extends EditorPart {
                //getSite().setSelectionProvider(provider)
     }
 
-    
+
     /* (non-Javadoc)
      * @see org.eclipse.ui.part.EditorPart#doSave(org.eclipse.core.runtime.IProgressMonitor)
      */
@@ -167,7 +167,7 @@ public class AlignmentEditor extends EditorPart {
 
     }
 
-    
+
     /* (non-Javadoc)
      * @see org.eclipse.ui.part.EditorPart#doSaveAs()
      */
@@ -176,7 +176,7 @@ public class AlignmentEditor extends EditorPart {
         // TODO Auto-generated method stub
 
     }
-    
+
 
     /* (non-Javadoc)
      * @see org.eclipse.ui.part.EditorPart#init(org.eclipse.ui.IEditorSite, org.eclipse.ui.IEditorInput)
@@ -186,7 +186,7 @@ public class AlignmentEditor extends EditorPart {
         setSite(site);
         setInput(input);
     }
-    
+
 
     /* (non-Javadoc)
      * @see org.eclipse.ui.part.EditorPart#isDirty()
@@ -197,7 +197,7 @@ public class AlignmentEditor extends EditorPart {
         return false;
     }
 
-    
+
     /* (non-Javadoc)
      * @see org.eclipse.ui.part.EditorPart#isSaveAsAllowed()
      */
@@ -206,7 +206,7 @@ public class AlignmentEditor extends EditorPart {
         // TODO Auto-generated method stub
         return false;
     }
-    
+
 
     /* (non-Javadoc)
      * @see org.eclipse.ui.part.WorkbenchPart#setFocus()