cleanup
authorAndreas Müller <a.mueller@bgbm.org>
Tue, 9 Jun 2020 22:19:07 +0000 (00:19 +0200)
committerAndreas Müller <a.mueller@bgbm.org>
Wed, 10 Jun 2020 10:48:09 +0000 (12:48 +0200)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/TermChooseWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/ContextManager.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/search/facet/term/TermSearch.java

index 44a072e09daba660386de9cf9f88d2a48e315933..e56809a2b58d916c1fe5e796db197bfdfb0e9e4b 100644 (file)
@@ -22,10 +22,8 @@ import eu.etaxonomy.taxeditor.view.search.facet.SearchComposite;
 import eu.etaxonomy.taxeditor.view.search.facet.term.TermSearchController;
 
 /**
- *
  * @author pplitzner
  * @since Feb 14, 2019
- *
  */
 public class TermChooseWizardPage extends WizardPage {
 
@@ -51,7 +49,4 @@ public class TermChooseWizardPage extends WizardPage {
            controller.getSelectedSearchResults().forEach(result->termDtos.add(result.getContent()));
            return termDtos;
        }
-
-
-
 }
index 7c84812afc6b9668c9ddb1671cf79f8bacddb6b5..73d3c84aa47f59a52581f048e5ee9440afd4288e 100644 (file)
@@ -26,6 +26,7 @@ import org.eclipse.ui.XMLMemento;
 import org.eclipse.ui.internal.Workbench;
 import org.springframework.remoting.RemoteAccessException;
 
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.IContextListener;
 import eu.etaxonomy.taxeditor.model.MementoHelper;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
@@ -36,11 +37,10 @@ import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
  *
  * @author n.hoffmann
  * @created Sep 30, 2010
- * @version 1.0
  */
 public class ContextManager implements IWorkbenchListener{
 
-    private final ListenerList contextListeners = new ListenerList();
+    private final ListenerList<IContextListener> contextListeners = new ListenerList<>();
 
     private IMemento memento;
 
@@ -53,20 +53,10 @@ public class ContextManager implements IWorkbenchListener{
         }
     }
 
-    /**
-     * <p>addContextListener</p>
-     *
-     * @param listener a {@link eu.etaxonomy.taxeditor.model.IContextListener} object.
-     */
     public void addContextListener(IContextListener listener){
         contextListeners.add(listener);
     }
 
-    /**
-     * <p>removeContextListener</p>
-     *
-     * @param listener a {@link eu.etaxonomy.taxeditor.model.IContextListener} object.
-     */
     public void removeContextListener(IContextListener listener) {
         contextListeners.remove(listener);
     }
@@ -80,19 +70,14 @@ public class ContextManager implements IWorkbenchListener{
             ((IContextListener) listener).contextStart(memento, monitor);
         }
     }
-    /**
-     * <p>notifyContextStart</p>
-     * @throws Throwable
-     */
+
     public void notifyContextStart() throws RemoteAccessException {
         MessagingUtils.info("Notifying context listeners, that the context has started.");
-        ProgressMonitorDialog dialog = new ProgressMonitorDialog(StoreUtil.getShell());
+        ProgressMonitorDialog dialog = new ProgressMonitorDialog(AbstractUtility.getShell());
 
         try {
             dialog.run(false, false, new IRunnableWithProgress() {
-                /* (non-Javadoc)
-                 * @see org.eclipse.jface.operation.IRunnableWithProgress#run(org.eclipse.core.runtime.IProgressMonitor)
-                 */
+
                 @Override
                 public void run(IProgressMonitor monitor)
                         throws InvocationTargetException, InterruptedException {
@@ -124,19 +109,13 @@ public class ContextManager implements IWorkbenchListener{
         }
     }
 
-
-    /**
-     *
-     */
     public void notifyContextRefresh() {
         MessagingUtils.info("Notifying context listeners, that the context needs to be refreshed.");
-        ProgressMonitorDialog dialog = new ProgressMonitorDialog(StoreUtil.getShell());
+        ProgressMonitorDialog dialog = new ProgressMonitorDialog(AbstractUtility.getShell());
 
         try {
             dialog.run(false, false, new IRunnableWithProgress() {
-                /* (non-Javadoc)
-                 * @see org.eclipse.jface.operation.IRunnableWithProgress#run(org.eclipse.core.runtime.IProgressMonitor)
-                 */
+
                 @Override
                 public void run(IProgressMonitor monitor)
                         throws InvocationTargetException, InterruptedException {
@@ -164,14 +143,9 @@ public class ContextManager implements IWorkbenchListener{
         }
     }
 
-    /**
-     * <p>notifyContextAboutToStop</p>
-     *
-     * @param monitor a {@link org.eclipse.core.runtime.IProgressMonitor} object.
-     */
     public void notifyContextAboutToStop(final IProgressMonitor monitor){
 
-        IProgressMonitor subMonitor = StoreUtil.getSubProgressMonitor(monitor, 1);
+        IProgressMonitor subMonitor = AbstractUtility.getSubProgressMonitor(monitor, 1);
 
         subMonitor.beginTask("Stoping context", contextListeners.size());
         // we are creating the memento here; even if the context is not stopped
@@ -185,14 +159,9 @@ public class ContextManager implements IWorkbenchListener{
         subMonitor.done();
     }
 
-    /**
-     * <p>notifyContextStop</p>
-     *
-     * @param monitor a {@link org.eclipse.core.runtime.IProgressMonitor} object.
-     */
     public void notifyContextStop(IProgressMonitor monitor) {
 
-        IProgressMonitor subMonitor = StoreUtil.getSubProgressMonitor(monitor, 1);
+        IProgressMonitor subMonitor = AbstractUtility.getSubProgressMonitor(monitor, 1);
 
         subMonitor.beginTask("Stoping context", contextListeners.size());
         MessagingUtils.info("Notifying context listeners, that the context has stopped.");
@@ -206,10 +175,6 @@ public class ContextManager implements IWorkbenchListener{
         subMonitor.done();
     }
 
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.IWorkbenchListener#preShutdown(org.eclipse.ui.IWorkbench, boolean)
-     */
-    /** {@inheritDoc} */
     @Override
     public boolean preShutdown(IWorkbench workbench, boolean forced) {
 
@@ -227,17 +192,10 @@ public class ContextManager implements IWorkbenchListener{
         return true;
     }
 
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.IWorkbenchListener#postShutdown(org.eclipse.ui.IWorkbench)
-     */
-    /** {@inheritDoc} */
     @Override
     public void postShutdown(IWorkbench workbench) {
-
-
     }
 
-
     private void readMemento(){
         try {
             memento = MementoHelper.readMementoFromFile(getStateFileForCurrentDatabase());
@@ -265,18 +223,12 @@ public class ContextManager implements IWorkbenchListener{
         } else {
             MessagingUtils.info("Not storing state data, because no DataSource present.");
         }
-
     }
 
     private boolean saveMemento(){
         return MementoHelper.saveMementoToFile(memento, getStateFileForCurrentDatabase()) != null;
     }
 
-    /**
-     * <p>getStateFileForCurrentDatabase</p>
-     *
-     * @return a {@link java.io.File} object.
-     */
     protected File getStateFileForCurrentDatabase() {
         if(CdmStore.getActiveCdmSource() == null){
             return null;
@@ -289,5 +241,4 @@ public class ContextManager implements IWorkbenchListener{
         path = path.append("editor_state_" + CdmStore.getActiveCdmSource().getName() + ".xml");
         return path.toFile();
     }
-
 }
index 8001df723fd06fe898624a88f02030ee695d74fe..2331e90c88226a6bd2db46f6536899f5f8095ff4 100644 (file)
@@ -19,7 +19,6 @@ import eu.etaxonomy.taxeditor.workbench.part.IEditorAreaPart;
 /**
  * @author pplitzner
  * @since Jan 22, 2019
- *
  */
 public class TermSearch implements IEditorAreaPart{