- rename IDirtyMarkableSelectionProvider to IDirtyMarkable
[taxeditor.git] / eu.etaxonomy.taxeditor.editor / src / main / java / eu / etaxonomy / taxeditor / editor / key / polytomous / PolytomousKeyListEditor.java
index 5ef5246d8239befe0ff06b5ddb3f86e8d4ef97b5..ceae45d69d43fd57c6ea825e9928e868b7ac14f8 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
  * Copyright (C) 2007 EDIT
- * European Distributed Institute of Taxonomy 
+ * European Distributed Institute of Taxonomy
  * http://www.e-taxonomy.eu
- * 
+ *
  * The contents of this file are subject to the Mozilla Public License Version 1.1
  * See LICENSE.TXT at the top of this package for the full license terms.
  */
@@ -45,7 +45,7 @@ import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.key.KeyEditor;
-import eu.etaxonomy.taxeditor.model.IDirtyMarkableSelectionProvider;
+import eu.etaxonomy.taxeditor.model.IDirtyMarkable;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 
 /**
@@ -54,13 +54,13 @@ import eu.etaxonomy.taxeditor.model.MessagingUtils;
  * @version 1.0
  */
 public class PolytomousKeyListEditor extends EditorPart implements
-               IConversationEnabled, IDirtyMarkableSelectionProvider,
+               IConversationEnabled, IDirtyMarkable,
                IPolytomousKeyEditorPage {
 
        private class LinkListener extends MouseAdapter {
                /*
                 * (non-Javadoc)
-                * 
+                *
                 * @see
                 * org.eclipse.swt.events.MouseAdapter#mouseUp(org.eclipse.swt.events
                 * .MouseEvent)
@@ -76,12 +76,12 @@ public class PolytomousKeyListEditor extends EditorPart implements
                        int selectedColumn = getSelectedColumn(table, point);
                        PolytomousKeyNode node = (PolytomousKeyNode) getTableItem(
                         table, point).getData();
-                
-                       if (selectedColumn == 4) {              
+
+                       if (selectedColumn == 4) {
                            PolytomousKeyNode linkData = getItemLinkData(node);
                            if (linkData != null) {
                                viewer.setSelection(new StructuredSelection(linkData), true);
-                           } 
+                           }
                        }
                        if (selectedColumn == 5) {
                            Taxon taxon = getItemTaxon(node);
@@ -121,7 +121,7 @@ public class PolytomousKeyListEditor extends EditorPart implements
                        return node.getChildren().isEmpty() ? null : node
                                        .getChildAt(0);
                }
-               
+
              /**
          * @return
          */
@@ -142,7 +142,7 @@ public class PolytomousKeyListEditor extends EditorPart implements
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see
         * eu.etaxonomy.cdm.persistence.hibernate.ICdmPostDataChangeObserver#update
         * (eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap)
@@ -154,7 +154,7 @@ public class PolytomousKeyListEditor extends EditorPart implements
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see
         * eu.etaxonomy.cdm.api.conversation.IConversationEnabled#getConversationHolder
         * ()
@@ -167,7 +167,7 @@ public class PolytomousKeyListEditor extends EditorPart implements
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see org.eclipse.ui.part.EditorPart#doSave(org.eclipse.core.runtime.
         * IProgressMonitor)
         */
@@ -178,7 +178,7 @@ public class PolytomousKeyListEditor extends EditorPart implements
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see org.eclipse.ui.part.EditorPart#doSaveAs()
         */
        @Override
@@ -187,7 +187,7 @@ public class PolytomousKeyListEditor extends EditorPart implements
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see org.eclipse.ui.part.EditorPart#init(org.eclipse.ui.IEditorSite,
         * org.eclipse.ui.IEditorInput)
         */
@@ -200,7 +200,7 @@ public class PolytomousKeyListEditor extends EditorPart implements
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see org.eclipse.ui.part.EditorPart#isDirty()
         */
        @Override
@@ -210,7 +210,7 @@ public class PolytomousKeyListEditor extends EditorPart implements
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see org.eclipse.ui.part.EditorPart#isSaveAsAllowed()
         */
        @Override
@@ -220,7 +220,7 @@ public class PolytomousKeyListEditor extends EditorPart implements
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see
         * org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets
         * .Composite)
@@ -257,10 +257,10 @@ public class PolytomousKeyListEditor extends EditorPart implements
            if (viewer != null && viewer.getTable() != null) {
                return viewer.getTable().getItemCount();
            }
-           
+
            return 0;
        }
-       
+
        public PolytomousKey getViewerInputKey() {
            return (PolytomousKey) viewer.getInput();
        }
@@ -296,7 +296,7 @@ public class PolytomousKeyListEditor extends EditorPart implements
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see org.eclipse.ui.part.WorkbenchPart#setFocus()
         */
        @Override
@@ -306,7 +306,7 @@ public class PolytomousKeyListEditor extends EditorPart implements
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see
         * eu.etaxonomy.taxeditor.model.IDirtyMarkableSelectionProvider#changed(
         * java.lang.Object)
@@ -327,9 +327,17 @@ public class PolytomousKeyListEditor extends EditorPart implements
 
        }
 
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.model.IDirtyMarkableSelectionProvider#forceDirty()
+     */
+    @Override
+    public void forceDirty() {
+        changed(null);
+    }
+
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see
         * eu.etaxonomy.taxeditor.operation.IPostOperationEnabled#postOperation(
         * eu.etaxonomy.cdm.model.common.CdmBase)
@@ -349,7 +357,7 @@ public class PolytomousKeyListEditor extends EditorPart implements
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see eu.etaxonomy.taxeditor.operation.IPostOperationEnabled#onComplete()
         */
        @Override