Fix dependencies and model update
[taxeditor.git] / eu.etaxonomy.taxeditor.molecular / src / main / java / eu / etaxonomy / taxeditor / molecular / handler / AlignmentEditorPasteHandler.java
index ca037657c263cad3c1c493b9e643d16fe4de7128..590aab56cda513d4684b25da531f4949cf16aea3 100644 (file)
@@ -1,16 +1,16 @@
 package eu.etaxonomy.taxeditor.molecular.handler;\r
 \r
 \r
-import java.util.ArrayList;\r
-import java.util.List;\r
-import java.util.Map;\r
-import java.util.Scanner;\r
-\r
 import info.bioinfweb.libralign.alignmentarea.AlignmentArea;\r
 import info.bioinfweb.libralign.alignmentarea.order.SequenceOrder;\r
 import info.bioinfweb.libralign.alignmentarea.selection.SelectionModel;\r
 import info.bioinfweb.libralign.model.AlignmentModel;\r
-import info.bioinfweb.libralign.model.AlignmentModelUtils;\r
+import info.bioinfweb.libralign.model.utils.AlignmentModelUtils;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+import java.util.Map;\r
+import java.util.Scanner;\r
 \r
 import org.eclipse.core.commands.ExecutionEvent;\r
 import org.eclipse.jface.dialogs.MessageDialog;\r
@@ -25,7 +25,7 @@ import eu.etaxonomy.taxeditor.molecular.editor.AlignmentEditor;
 \r
 /**\r
  * Handler that pastes the current contents of the clipboard into an active instance of {@link AlignmentEditor}.\r
- * \r
+ *\r
  * @author Ben Stöver\r
  * @date 26.08.2015\r
  */\r
@@ -35,12 +35,12 @@ public class AlignmentEditorPasteHandler extends AbstractFocusedAlignmentAreaHan
                area.getActionProvider().elongateSequence(sequenceID, area.getSelection().getCursorColumn());\r
 \r
                AlignmentModel<Object> alignmentModel = (AlignmentModel<Object>)area.getAlignmentModel();\r
-               alignmentModel.insertTokensAt(sequenceID, area.getSelection().getCursorColumn(), \r
+               alignmentModel.insertTokensAt(sequenceID, area.getSelection().getCursorColumn(),\r
                                AlignmentModelUtils.charSequenceToTokenList(content, alignmentModel.getTokenSet(),\r
                                                true, alignmentModel.getTokenSet().getGapToken()));\r
        }\r
-       \r
-       \r
+\r
+\r
        @Override\r
        protected void doExecute2(ExecutionEvent event, AlignmentEditor editor, AlignmentArea focusedArea) {\r
                SelectionModel selection = focusedArea.getSelection();\r
@@ -59,7 +59,7 @@ public class AlignmentEditorPasteHandler extends AbstractFocusedAlignmentAreaHan
                        finally {\r
                                scanner.close();\r
                        }\r
-                       \r
+\r
                        if (!lines.isEmpty()) { //TODO Can lines be empty? (Can an empty string "" be copied to the clipboard?)\r
                                if (selection.getCursorHeight() == 1) {  // If the consensus sequence is focused, this is the only possible case.\r
                                        int sequenceID = focusedArea.getSequenceOrder().idByIndex(selection.getCursorRow());\r
@@ -67,16 +67,16 @@ public class AlignmentEditorPasteHandler extends AbstractFocusedAlignmentAreaHan
                                                pasteString(focusedArea, sequenceID, lines.get(0));\r
                                        }\r
                                        else {\r
-                                               MessageDialog dialog = new MessageDialog(HandlerUtil.getActiveWorkbenchWindow(event).getShell(),  //TODO Can the window be null? \r
+                                               MessageDialog dialog = new MessageDialog(HandlerUtil.getActiveWorkbenchWindow(event).getShell(),  //TODO Can the window be null?\r
                                                                "Pasting multiple lines", null,\r
-                                                               "The text to be pasted contains mutlitple lines (" + lines.size() + \r
-                                                               ") although the current cursor height is one. What do you want to do?", \r
-                                                               MessageDialog.QUESTION, \r
-                                                               new String[]{"Ingnore line breaks and paste as one sequence", \r
-                                                                               "Only paste the first line from the clipboard", "Cancel"}, \r
+                                                               "The text to be pasted contains mutlitple lines (" + lines.size() +\r
+                                                               ") although the current cursor height is one. What do you want to do?",\r
+                                                               MessageDialog.QUESTION,\r
+                                                               new String[]{"Ingnore line breaks and paste as one sequence",\r
+                                                                               "Only paste the first line from the clipboard", "Cancel"},\r
                                                                0);\r
                                                //TODO Does the dialog have to be disposed in some way?\r
-                                               \r
+\r
                                                switch (dialog.open()) {\r
                                                        case 0:  // Paste all lines in one sequence.\r
                                                                pasteString(focusedArea, sequenceID, clipboardText);\r
@@ -96,10 +96,10 @@ public class AlignmentEditorPasteHandler extends AbstractFocusedAlignmentAreaHan
                                        }\r
                                        else {\r
                                                MessageDialog.openError(HandlerUtil.getActiveWorkbenchWindow(event).getShell(),  //TODO Can the window be null?\r
-                                                               "Unable to paste multiple lines", \r
-                                                               "The current cursor height (" + selection.getCursorHeight() + \r
-                                                               ") does not match the number of lines to be pasted (" + lines.size() + ")." + \r
-                                                               System.getProperty("line.separator") + System.getProperty("line.separator") + \r
+                                                               "Unable to paste multiple lines",\r
+                                                               "The current cursor height (" + selection.getCursorHeight() +\r
+                                                               ") does not match the number of lines to be pasted (" + lines.size() + ")." +\r
+                                                               System.getProperty("line.separator") + System.getProperty("line.separator") +\r
                                                                "You can either change the cursor height accordingly or set the cursor height to one "\r
                                                                + "allowing you to paste all lines from the clipboad into one sequence.");\r
                                        }\r