*/
public class CreateNodeOperation extends AbstractPostTaxonOperation {
- PolytomousKeyNode parentNode;
+ private PolytomousKeyNode parentNode;
private PolytomousKeyNode childNode;
public CreateNodeOperation(String label,
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 cmathew
* @date 21 Jul 2015
- *
*/
public class CreatePolytomousKeyNodeOperation extends CdmDefaultOperation {
+ private final static String LABEL = Messages.RemotingCreatePolytomousKeyNodeOperation_CREATE_KEY;
+
private final PolytomousKeyNode parentNode;
private PolytomousKeyNode childNode;
- /**
- *
- */
- protected IPostOperationEnabled postOperationEnabled;
+ private IPostOperationEnabled postOperationEnabled;
public PolytomousKeyNode getChildNode() {
return childNode;
}
- private final static String LABEL = Messages.RemotingCreatePolytomousKeyNodeOperation_CREATE_KEY;
-
public CreatePolytomousKeyNodeOperation(Object source,
boolean async,
PolytomousKeyNode parentNode, IPostOperationEnabled postOperationEnabled){
this.postOperationEnabled = postOperationEnabled;
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.operation.RemotingCdmSimpleOperation#doSimpleExecute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
- */
@Override
protected CdmBase doSimpleExecute(IProgressMonitor monitor, IAdaptable info) throws Exception {
- childNode = PolytomousKeyNode.NewInstance();
- parentNode.addChild(childNode);
- if (postOperationEnabled.postOperation(childNode)){
- return childNode;
- }else {
- return null;
- }
+ childNode = PolytomousKeyNode.NewInstance();
+ parentNode.addChild(childNode);
+ if (postOperationEnabled.postOperation(childNode)){
+ return childNode;
+ } else {
+ return null;
+ }
}
-
-
-
-
-
-
-}
+}
\ No newline at end of file
/**
- *
- */
+* Copyright (C) 2016 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 DeleteNodeOperation extends AbstractPostOperation<PolytomousKeyNode> {
- private final PolytomousKeyNode parent;
private final PolytomousKeyNode node;
private final boolean deleteChildren;
public DeleteNodeOperation(String label, IUndoContext undoContext,
PolytomousKeyNode node, IPostOperationEnabled postOperationEnabled, boolean deleteChildren) {
super(label, undoContext, node, postOperationEnabled);
- HibernateProxyHelper.deproxy(node, PolytomousKeyNode.class);
+ HibernateProxyHelper.deproxy(node);
this.node = node;
- this.parent = node.getParent();
this.deleteChildren = deleteChildren;
}
- /*
- * (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(null);
}
- /*
- * (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 {
return execute(monitor, info);
}
- /*
- * (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
+/**
+* Copyright (C) 2016 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;
/**
* Operation responsible for refreshing node numbers of the Polytomous Key Nodes.
* The refresh is performed on the entire Key starting from the root.
- *
- * @author c.mathew
*
+ * @author c.mathew
*/
public class RefreshNodeNumberingOperation extends AbstractPostTaxonOperation {
- PolytomousKeyNode node;
- private PolytomousKeyNode childNode;
-
+ private PolytomousKeyNode node;
+
public RefreshNodeNumberingOperation(String label,
- IUndoContext undoContext,
- PolytomousKeyNode node,
+ IUndoContext undoContext,
+ PolytomousKeyNode node,
IPostOperationEnabled postOperationEnabled) {
super(label, undoContext, postOperationEnabled);
this.node = node;
}
-
- /* (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 {
- node.refreshNodeNumbering();
+ node.refreshNodeNumbering();
return postExecute(node);
}
- /* (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
return elementUuid;
}
-
/**
* This method will try to call the post operation on a possibly registered
* IPostOperationEnabled implementor. Objects that were affected by the operation