Close conversation when closing DerivateSearchView
authorPatrick Plitzner <p.plitzner@bgbm.org>
Mon, 7 Sep 2015 11:19:47 +0000 (13:19 +0200)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Mon, 7 Sep 2015 11:21:31 +0000 (13:21 +0200)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/derivateSearch/DerivateSearchView.java

index 9f950fa3fbffe21c7aedfb871b02b86ab3cd00b1..93c229adfd2e2cfda5114ab9c7f341b36b3aa86b 100644 (file)
@@ -39,9 +39,6 @@ public class DerivateSearchView extends ViewPart implements IContextListener {
         CdmStore.getContextManager().addContextListener(this);
     }
 
         CdmStore.getContextManager().addContextListener(this);
     }
 
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
-     */
     @Override
     public void createPartControl(Composite parent) {
         derivateSearchCompositeController = new DerivateSearchCompositeController(parent, this);
     @Override
     public void createPartControl(Composite parent) {
         derivateSearchCompositeController = new DerivateSearchCompositeController(parent, this);
@@ -56,9 +53,6 @@ public class DerivateSearchView extends ViewPart implements IContextListener {
         control.setMenu(menu);
     }
 
         control.setMenu(menu);
     }
 
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.part.WorkbenchPart#setFocus()
-     */
     @Override
     public void setFocus() {
         derivateSearchCompositeController.setFocus();
     @Override
     public void setFocus() {
         derivateSearchCompositeController.setFocus();
@@ -68,33 +62,21 @@ public class DerivateSearchView extends ViewPart implements IContextListener {
         }
     }
 
         }
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.model.IContextListener#contextAboutToStop(org.eclipse.ui.IMemento, org.eclipse.core.runtime.IProgressMonitor)
-     */
     @Override
     public void contextAboutToStop(IMemento memento, IProgressMonitor monitor) {
     }
 
     @Override
     public void contextAboutToStop(IMemento memento, IProgressMonitor monitor) {
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.model.IContextListener#contextStop(org.eclipse.ui.IMemento, org.eclipse.core.runtime.IProgressMonitor)
-     */
     @Override
     public void contextStop(IMemento memento, IProgressMonitor monitor) {
         derivateSearchCompositeController.setEnabled(false);
         derivateSearchCompositeController.reset();
     }
 
     @Override
     public void contextStop(IMemento memento, IProgressMonitor monitor) {
         derivateSearchCompositeController.setEnabled(false);
         derivateSearchCompositeController.reset();
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.model.IContextListener#contextStart(org.eclipse.ui.IMemento, org.eclipse.core.runtime.IProgressMonitor)
-     */
     @Override
     public void contextStart(IMemento memento, IProgressMonitor monitor) {
         derivateSearchCompositeController.setEnabled(true);
     }
 
     @Override
     public void contextStart(IMemento memento, IProgressMonitor monitor) {
         derivateSearchCompositeController.setEnabled(true);
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.model.IContextListener#contextRefresh(org.eclipse.core.runtime.IProgressMonitor)
-     */
     @Override
     public void contextRefresh(IProgressMonitor monitor) {
         initConversation();
     @Override
     public void contextRefresh(IProgressMonitor monitor) {
         initConversation();
@@ -107,20 +89,24 @@ public class DerivateSearchView extends ViewPart implements IContextListener {
         }
     }
 
         }
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.model.IContextListener#workbenchShutdown(org.eclipse.ui.IMemento, org.eclipse.core.runtime.IProgressMonitor)
-     */
     @Override
     public void workbenchShutdown(IMemento memento, IProgressMonitor monitor) {
     }
 
     @Override
     public void workbenchShutdown(IMemento memento, IProgressMonitor monitor) {
     }
 
-    /**
-     * @return the conversationHolder
-     */
     public ConversationHolder getConversationHolder() {
         if(CdmStore.isActive() && conversationHolder==null){
             initConversation();
         }
         return conversationHolder;
     }
     public ConversationHolder getConversationHolder() {
         if(CdmStore.isActive() && conversationHolder==null){
             initConversation();
         }
         return conversationHolder;
     }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void dispose() {
+        if(conversationHolder!=null){
+            conversationHolder.close();
+        }
+    }
 }
 }