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;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.widgets.Shell;
-
import eu.etaxonomy.taxeditor.l10n.Messages;
import eu.etaxonomy.taxeditor.model.MessagingUtils;
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) {
});
}
- @SuppressWarnings("restriction")
private IStatus checkForUpdates(final IProvisioningAgent agent, final Shell shell, final UISynchronize sync,
IProgressMonitor monitor) {
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)
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) {
// 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;
}
-
}
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;
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.");
}
-
-
-
-
}
* 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;
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;
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
/**
- *
* @author n.hoffmann
* @created Nov 16, 2009
- * @version 1.0
*/
public class DescriptionElementSourceElement extends
AbstractOriginalSourceElement<DescriptionElementSource> implements
cdmFormFactory.createSelectionArbitrator(this);
}
- /** {@inheritDoc} */
@Override
public void createControls(ICdmFormElement formElement, int style) {
super.createControls(formElement, style);
if (getEntity() != null){
setEntity(entity);
}
-
}
-
- /** {@inheritDoc} */
@Override
public void setEntity(DescriptionElementSource entity) {
super.setEntity(entity);
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());
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) {
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