-
- private final IDropTargetable target;
-
- /**
- * <p>Constructor for NameEditorDropTargetListener.</p>
- *
- * @param target a {@link eu.etaxonomy.taxeditor.editor.IDropTargetable} object.
- */
- public NameEditorDropTargetListener(IDropTargetable target){
- this.target = target;
- }
-
- /** {@inheritDoc} */
- @Override
- public void dragEnter(DropTargetEvent dropTargetEvent) {
- target.dragEntered();
-
-// if(! EditorUtil.getActiveMultiPageTaxonEditor().equals(editor.getMultiPageTaxonEditor())){
-// editor.getMultiPageTaxonEditor().setFocus();
-// }
- }
-
- /** {@inheritDoc} */
- @Override
- public void dragLeave(DropTargetEvent dropTargetEvent) {
- target.dragLeft();
- }
-
- /** {@inheritDoc} */
- @Override
- public void drop(DropTargetEvent dropTargetEvent) {
-
- TaxonBase taxonBase = getDroppedTaxonBase(dropTargetEvent);
-
- Assert.isNotNull(taxonBase);
-
- if(taxonBase.getHomotypicGroup().equals(getHomotypicalGroup())){
- // do nothing when dragged to the same group
- dropTargetEvent.detail = DND.DROP_NONE;
- return;
- }
-
- // Execute operations at end of drag event
- AbstractPostOperation operation = createOperation(taxonBase);
-
- // Execute operation if it has been initiated
- if (operation == null) {
- MessagingUtils.warn(getClass(), "User unsuccessfully tried to drop: " + taxonBase.getClass() +
- ". Target: " + target);
- dropTargetEvent.detail = DND.DROP_NONE;
- } else {
- EditorUtil.executeOperation(operation);
- }
- target.getEditor().getConversationHolder().commit();
+
+ private IDropTargetable target;
+
+
+ /**
+ * <p>Constructor for NameEditorDropTargetListener.</p>
+ *
+ * @param target a {@link eu.etaxonomy.taxeditor.editor.IDropTargetable} object.
+ */
+ public NameEditorDropTargetListener(IDropTargetable target){
+ this.target = target;
+ }
+
+ /** {@inheritDoc} */
+ public void dragEnter(DropTargetEvent dropTargetEvent) {
+ target.dragEntered();
+
+// if(! EditorUtil.getActiveMultiPageTaxonEditor().equals(editor.getMultiPageTaxonEditor())){
+// editor.getMultiPageTaxonEditor().setFocus();
+// }
+ }
+
+ /** {@inheritDoc} */
+ public void dragLeave(DropTargetEvent dropTargetEvent) {
+ target.dragLeft();
+ }
+
+ /** {@inheritDoc} */
+ public void drop(DropTargetEvent dropTargetEvent) {
+
+ TaxonBase taxonBase = getDroppedTaxonBase(dropTargetEvent);
+
+ Assert.isNotNull(taxonBase);
+
+ if(taxonBase.getHomotypicGroup().equals(getHomotypicalGroup())){
+ // do nothing when dragged to the same group
+ dropTargetEvent.detail = DND.DROP_NONE;
+ return;
+ }
+
+ // Execute operations at end of drag event
+ AbstractPostOperation operation = createOperation(taxonBase);
+
+ // Execute operation if it has been initiated
+ if (operation == null) {
+ MessagingUtils.warn(getClass(), "User unsuccessfully tried to drop: " + taxonBase.getClass() +
+ ". Target: " + target);
+ dropTargetEvent.detail = DND.DROP_NONE;
+ } else {
+ EditorUtil.executeOperation(operation);
+ }
+ target.getEditor().getConversationHolder().commit();