cleanup
authorAndreas Müller <a.mueller@bgbm.org>
Tue, 21 Dec 2021 20:37:25 +0000 (21:37 +0100)
committerAndreas Müller <a.mueller@bgbm.org>
Tue, 21 Dec 2021 20:37:25 +0000 (21:37 +0100)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/update/UpdateHandler.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/CollectorSelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/DescriptionElementSourceElement.java

index a39f6a7de3e28ec238a9f5d75633467c2a1b15dc..b9664ecf4654afc801fe8b06080b574788519352 100644 (file)
@@ -11,8 +11,8 @@
 package eu.etaxonomy.taxeditor.handler.update;
 
 import java.net.URI;
-import org.apache.log4j.Logger;
 
+import org.apache.log4j.Logger;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
@@ -29,7 +29,6 @@ import org.eclipse.equinox.p2.operations.UpdateOperation;
 import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.swt.widgets.Shell;
 
-
 import eu.etaxonomy.taxeditor.l10n.Messages;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 
@@ -44,24 +43,21 @@ public class UpdateHandler {
     private Logger logger = Logger.getLogger(getClass());
 
     private UpdateOperation operation;
-    
-    
 
     @Execute
     public void execute(final IProvisioningAgent agent, final Shell shell, final UISynchronize sync,
             final IWorkbench workbench) {
-       
+
         Job checkUpdateJob = new Job(Messages.UpdateHandler_CHECK_UPDATE_JOB) {
             @Override
             protected IStatus run(final IProgressMonitor monitor) {
-               
+
                 return checkForUpdates(agent, shell, sync, monitor);
             }
         };
 
         checkUpdateJob.schedule();
 
-
         checkUpdateJob.addJobChangeListener(new JobChangeAdapter() {
             @Override
             public void done(IJobChangeEvent event) {
@@ -96,7 +92,6 @@ public class UpdateHandler {
         });
     }
 
-    @SuppressWarnings("restriction")
        private IStatus checkForUpdates(final IProvisioningAgent agent, final Shell shell, final UISynchronize sync,
             IProgressMonitor monitor) {
 
@@ -104,8 +99,8 @@ public class UpdateHandler {
         final ProvisioningSession session = new ProvisioningSession(agent);
         logger.info("Try to get updates" + System.currentTimeMillis());
         try{
-               operation = new UpdateOperation(session);               
-               configureUpdate(operation);       
+               operation = new UpdateOperation(session);
+               configureUpdate(operation);
                // check for updates, this causes I/O
                final IStatus status = operation.resolveModal(monitor);
                // failed to find updates (inform user and exit)
@@ -119,14 +114,10 @@ public class UpdateHandler {
                logger.warn( e.getStackTrace().toString());
                return Status.CANCEL_STATUS;
         }
-        
-        
-        
+
         return Status.OK_STATUS;
     }
-    
-   
-   
+
     private void configureProvisioningJob(ProvisioningJob provisioningJob, final Shell shell, final UISynchronize sync,
             final IWorkbench workbench) {
 
@@ -169,10 +160,9 @@ public class UpdateHandler {
         // set location of artifact and metadata repo
         operation.getProvisioningContext().setArtifactRepositories(new URI[] { uri });
         operation.getProvisioningContext().setMetadataRepositories(new URI[] { uri });
-        
+
         //if local plugin is installed, then check for updates
         //operation.getProvisioningContext().setExtraInstallableUnits(extraIUs);
         return operation;
     }
-
 }
index 0a78f3a5c1440528812a402f7803aedfcc2811db..23b001e4594d01ff0f46fddcbe8b4f5bf10cd6be 100755 (executable)
@@ -18,7 +18,6 @@ import eu.etaxonomy.cdm.api.service.dto.IdentifiedEntityDTO;
 import eu.etaxonomy.cdm.model.agent.AgentBase;
 import eu.etaxonomy.cdm.model.agent.Person;
 import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
-import eu.etaxonomy.cdm.model.common.IIdentifiableEntity;
 import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
 import eu.etaxonomy.cdm.persistence.dto.TeamOrPersonUuidAndTitleCache;
 import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
@@ -97,22 +96,19 @@ public class CollectorSelectionDialog extends AgentSelectionDialog<AgentBase<?>>
 
         model = CdmStore.getService(IAgentService.class).getUuidAndTitleCacheWithCollectorTitleCache(clazz, limitOfInitialElements, pattern);
     }
-    
-    protected String getTitle(AgentBase cdmObject) {
+
+    @Override
+    protected String getTitle(AgentBase<?> cdmObject) {
                if(cdmObject == null){
                        return "";
                }
 
                if (cdmObject instanceof TeamOrPersonBase) {
-                       return ((TeamOrPersonBase) cdmObject).getCollectorTitleCache();
+                       return ((TeamOrPersonBase<?>) cdmObject).getCollectorTitleCache();
                }
 
                throw new IllegalArgumentException("Generic method only" +
                                " supports cdmObject of type TeamOrPersonBase." +
                                " Please implement specific method in subclass.");
        }
-    
-   
-
-
 }
index beb86153eaafa4aa7a15c4c958f96adb371f710e..d483c263b2ada058d107ec20e3fb4017fde55941 100644 (file)
@@ -6,7 +6,6 @@
  * 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.
  */
-
 package eu.etaxonomy.taxeditor.ui.section.description;
 
 import org.eclipse.swt.SWT;
@@ -21,7 +20,6 @@ import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
-import eu.etaxonomy.taxeditor.ui.element.IEnableableFormElement;
 import eu.etaxonomy.taxeditor.ui.element.IEntityElement;
 import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
 import eu.etaxonomy.taxeditor.ui.section.common.ExternalLinksSection;
@@ -29,10 +27,8 @@ import eu.etaxonomy.taxeditor.ui.section.supplemental.AbstractOriginalSourceElem
 import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
 
 /**
- *
  * @author n.hoffmann
  * @created Nov 16, 2009
- * @version 1.0
  */
 public class DescriptionElementSourceElement extends
                AbstractOriginalSourceElement<DescriptionElementSource> implements
@@ -48,7 +44,6 @@ public class DescriptionElementSourceElement extends
                cdmFormFactory.createSelectionArbitrator(this);
        }
 
-       /** {@inheritDoc} */
        @Override
        public void createControls(ICdmFormElement formElement, int style) {
                super.createControls(formElement, style);
@@ -62,11 +57,8 @@ public class DescriptionElementSourceElement extends
         if (getEntity() != null){
                setEntity(entity);
         }
-   
        }
 
-
-       /** {@inheritDoc} */
        @Override
        public void setEntity(DescriptionElementSource entity) {
                super.setEntity(entity);
@@ -77,7 +69,7 @@ public class DescriptionElementSourceElement extends
                        if (PreferencesUtil.getBooleanValue(PreferencePredicate.ShowNamespaceInSource.getKey())){
                            text_idNamespace.setText(entity.getIdNamespace());
                        }
-       
+
                        selection_reference.setEntity(entity.getCitation());
                        text_referenceDetail.setText(entity.getCitationMicroReference());
                        text_originaleNameString.setText(entity.getOriginalNameString());
@@ -85,16 +77,11 @@ public class DescriptionElementSourceElement extends
                        combo_origsourcetype.setSelection(entity.getType());
                        externalLinks.setEntity(entity);
                }
-               
        }
 
-       /** {@inheritDoc} */
        @Override
-       public void setSelected(boolean selected) {
-
-       }
+       public void setSelected(boolean selected) {}
 
-       /** {@inheritDoc} */
        @Override
        public void handleEvent(Object eventSource) {
                if (eventSource == text_idInSource) {
@@ -115,16 +102,11 @@ public class DescriptionElementSourceElement extends
                else if(eventSource == combo_origsourcetype){
                    getEntity().setType(combo_origsourcetype.getSelection());
                }
-
        }
-       
+
        @Override
        public void setEnabled(boolean enabled) {
                super.setEnabled(enabled);
                externalLinks.setEnabled(isEnabled);
-               
        }
-
-       
-
-}
+}
\ No newline at end of file