* 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.editor.key.polytomous.e4;
import java.util.List;
import eu.etaxonomy.taxeditor.workbench.part.IE4SavablePart;
/**
- *
* @author pplitzner
* @since Sep 28, 2017
- *
*/
public class PolytomousKeyListEditorE4 implements
IConversationEnabled, IDirtyMarkable, IPartContentHasDetails, IPartContentHasSupplementalData,
int selectedColumn = getSelectedColumn(table, point);
- if (table == null || point == null ){
+ if (table == null){
return;
}
this.input = input;
PolytomousKey key = input.getKey();
- key = HibernateProxyHelper.deproxy(key, PolytomousKey.class);
- key.setRoot(HibernateProxyHelper.deproxy(key.getRoot(), PolytomousKeyNode.class));
+ key = HibernateProxyHelper.deproxy(key);
+ key.setRoot(HibernateProxyHelper.deproxy(key.getRoot()));
thisPart.setLabel(key.getTitleCache());
viewer.setInput(input);
}
dirty.setDirty(true);
viewer.refresh();
-
}
@Override
/**
* @author k.luther
* @date 17.11.2016
- *
*/
public class InsertNewNodeHandlerE4 extends CdmHandlerE4{
private PolytomousKeyNode parentNode ;
-
public InsertNewNodeHandlerE4() {
super(PolytomousKeyEditorLabels.INSERT_NODE_POLYTOMOUS_KEY_NODE_LABEL);
}
}
@Override
- public void onComplete() {
- }
+ public void onComplete() {}
@CanExecute
public boolean canExecute(@Named(IServiceConstants.ACTIVE_SELECTION)IStructuredSelection selection,
return true;
}
- /**
- * {@inheritDoc}
- */
@Override
protected Object getTrigger() {
return this;
}
-
-}
+}
\ No newline at end of file
/**
- *
- */
+* Copyright (C) 2015 EDIT
+* 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.
+*/
package eu.etaxonomy.taxeditor.editor.key.polytomous.operation;
import org.eclipse.core.commands.ExecutionException;
/**
* @author n.hoffmann
- *
*/
public class CreateNodeOperation extends AbstractPostTaxonOperation {
this.parentNode = parentNode;
}
- /* (non-Javadoc)
- * @see org.eclipse.core.commands.operations.AbstractOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
- */
@Override
public IStatus execute(IProgressMonitor monitor, IAdaptable info)
throws ExecutionException {
return postExecute(childNode);
}
- /* (non-Javadoc)
- * @see org.eclipse.core.commands.operations.AbstractOperation#redo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
- */
@Override
public IStatus redo(IProgressMonitor monitor, IAdaptable info)
throws ExecutionException {
- // TODO Auto-generated method stub
return null;
}
- /* (non-Javadoc)
- * @see org.eclipse.core.commands.operations.AbstractOperation#undo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
- */
@Override
public IStatus undo(IProgressMonitor monitor, IAdaptable info)
throws ExecutionException {
- // TODO Auto-generated method stub
return null;
}
-
-}
+}
\ No newline at end of file
import eu.etaxonomy.cdm.model.common.CdmBase;
import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
import eu.etaxonomy.taxeditor.editor.l10n.Messages;
-import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
import eu.etaxonomy.taxeditor.operation.CdmDefaultOperation;
+import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
/**
* @author k.luther
* @date 17.11.2016
- *
*/
public class InsertPolytomousKeyNodeOperation extends CdmDefaultOperation {
- private final PolytomousKeyNode parentNode;
-
private final static String LABEL = Messages.InsertPolytomousKeyNodeOperation_INSERT_KEY;
- /**
- *
- */
- protected IPostOperationEnabled postOperationEnabled;
+ private final PolytomousKeyNode parentNode;
+
+ protected IPostOperationEnabled postOperationEnabled;
- /**
- * @param label
- * @param action
- * @param source
- * @param async
- */
public InsertPolytomousKeyNodeOperation(Object source,
boolean async,
PolytomousKeyNode parentNode, IPostOperationEnabled postOperationEnabled) {
this.postOperationEnabled = postOperationEnabled;
}
- /**
- * {@inheritDoc}
- */
@Override
protected CdmBase doSimpleExecute(IProgressMonitor monitor, IAdaptable info) throws Exception {
PolytomousKeyNode childNode = PolytomousKeyNode.NewInstance();
List<PolytomousKeyNode> newChildren = parentNode.getChildren();
- List<PolytomousKeyNode> copy = new ArrayList<PolytomousKeyNode>();
+ List<PolytomousKeyNode> copy = new ArrayList<>();
for (PolytomousKeyNode node: newChildren) {
copy.add(node);
}
this.postOperationEnabled.postOperation(childNode);
return childNode;
}
-
-}
+}
\ No newline at end of file
/**
* @author cmathew
* @date 21 Jul 2015
- *
*/
public abstract class CdmDefaultOperation extends CdmOperation {
public CdmDefaultOperation(String label, Action action, Object source, boolean async) {
super(label, action, source, async);
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.operation.RemotingCdmOperation#doExecute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
- */
+
@Override
protected boolean doExecute(IProgressMonitor monitor, IAdaptable info) {
try {
if(success && cdmEntity != null) {
fireDataChangeEvent(cdmEntity);
}
-
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.operation.RemotingCdmOperation#onComplete(boolean)
- */
+
@Override
protected IStatus onComplete(boolean success) {
return Status.OK_STATUS;
}
-
-}
+}
\ No newline at end of file
/**
* @author cmathew
* @date 16 Jun 2015
- *
*/
public abstract class CdmOperation extends AbstractOperation {
private final Object source;
private final Action action;
private final boolean async;
- protected Class entityType;
+ protected Class<?> entityType;
public CdmOperation(String label, Action action, Object source, boolean async) {
super(label);
this.async = async;
}
- /* (non-Javadoc)
- * @see org.eclipse.core.commands.operations.AbstractOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
- */
@Override
public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
}
}
- /* (non-Javadoc)
- * @see org.eclipse.core.commands.operations.AbstractOperation#redo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
- */
@Override
public IStatus redo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- // TODO Auto-generated method stub
return null;
}
- /* (non-Javadoc)
- * @see org.eclipse.core.commands.operations.AbstractOperation#undo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
- */
@Override
public IStatus undo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- // TODO Auto-generated method stub
return null;
}
-
-}
+}
\ No newline at end of file
Status[] childStatus = new Status[exceptions.size()];
int count = 0;
- Set<String> messages = new HashSet<String>();
+ Set<String> messages = new HashSet<>();
for(Exception ex : exceptions) {
Status status = new Status(statusFlag,
"unknown",