Revision 1afe3ed2
Added by Ben Stöver over 8 years ago
eu.etaxonomy.taxeditor.molecular/src/main/java/eu/etaxonomy/taxeditor/molecular/handler/AlignmentEditorCopyHandler.java | ||
---|---|---|
9 | 9 |
import info.bioinfweb.libralign.model.tokenset.AbstractTokenSet; |
10 | 10 |
|
11 | 11 |
import org.eclipse.core.commands.ExecutionEvent; |
12 |
import org.eclipse.swt.dnd.Clipboard; |
|
13 | 12 |
import org.eclipse.swt.dnd.TextTransfer; |
14 | 13 |
import org.eclipse.swt.dnd.Transfer; |
15 |
import org.eclipse.swt.widgets.Display; |
|
16 | 14 |
import org.eclipse.ui.commands.IElementUpdater; |
17 | 15 |
import org.eclipse.ui.menus.UIElement; |
18 | 16 |
|
... | ... | |
28 | 26 |
* nothing will be copied, even if nucleotides are currently selected. |
29 | 27 |
* <p> |
30 | 28 |
* If the selection contains parts of multiple sequence, these are separated by the line separator |
31 |
* if the current operating system.
|
|
29 |
* of the current operating system.
|
|
32 | 30 |
* |
33 | 31 |
* @author Ben Stöver |
34 | 32 |
* @date 25.08.2015 |
eu.etaxonomy.taxeditor.molecular/src/main/java/eu/etaxonomy/taxeditor/molecular/handler/AlignmentEditorCutHandler.java | ||
---|---|---|
9 | 9 |
|
10 | 10 |
|
11 | 11 |
|
12 |
/** |
|
13 |
* Handler that cuts the currently selected nucleotides from an alignment editor to the clipboard. |
|
14 |
* <p> |
|
15 |
* The cut contents either come from the single reads or the consensus sequence alignment area, |
|
16 |
* depending on which component currently has the focus. If none of these components has the focus, |
|
17 |
* nothing will be cut, even if nucleotides are currently selected. |
|
18 |
* <p> |
|
19 |
* If the selection contains parts of multiple sequence, these are separated by the line separator |
|
20 |
* of the current operating system. |
|
21 |
* |
|
22 |
* @author Ben Stöver |
|
23 |
* @date 25.08.2015 |
|
24 |
*/ |
|
12 | 25 |
public class AlignmentEditorCutHandler extends AlignmentEditorCopyHandler { |
13 | 26 |
@Override |
14 | 27 |
protected void doExecute2(ExecutionEvent event, AlignmentEditor editor, AlignmentArea focusedArea) { |
15 | 28 |
super.doExecute2(event, editor, focusedArea); // Copy selected contents. |
16 |
focusedArea.getActionProvider().deleteForward(); // Delete selection. Direction does not matter, if selection is not empty.
|
|
29 |
focusedArea.getActionProvider().deleteSelection();
|
|
17 | 30 |
} |
18 | 31 |
} |
Also available in: Unified diff
JavaDoc extended.
Different LibrAlign model action used in AlignmentEditorCutHandler.