de.cau.cs.kieler.ksbase.ui.utils
Class AbstractCutCopyPasteCommandFactory

java.lang.Object
  extended by de.cau.cs.kieler.ksbase.ui.utils.AbstractCutCopyPasteCommandFactory
All Implemented Interfaces:
ICutCopyPasteCommandFactory
Direct Known Subclasses:
KEGCutCopyPasteCommandFactory, SyncchartsCutCopyPasteCommandFactory

public abstract class AbstractCutCopyPasteCommandFactory
extends Object
implements ICutCopyPasteCommandFactory

Creates the cut, copy and paste commands from ksbase.

Rating yellow
(2010-06-15) msp, cmot

Constructor Summary
AbstractCutCopyPasteCommandFactory()
           
 
Method Summary
 ICommand buildCopyCommand(org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramWorkbenchPart part, List<EObject> selection)
          Build a new copy command.
 ICommand buildCutCommand(org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramWorkbenchPart part, List<EObject> selection)
          Build a new cut command.
 ICommand buildPasteCommand(org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramWorkbenchPart part, List<EObject> selection)
          Build a new paste command.
protected abstract  org.osgi.framework.Bundle getBundle()
          Getter for the bundle of the plugin where the file is located.
protected abstract  String getFile()
          Getter for the transformation file.
protected abstract  List<String> getModel()
          Get the path to the model package.
protected abstract  Class<?>[] getTypes()
          Get a list of all types that can be copied or pasted.
protected  void performPostOperationActions(IProgressMonitor monitor)
          Perform actions after the operation has finished.
protected  void performPreOperationActions(IProgressMonitor monitor)
          Perform actions before the operation has started.
protected  void refreshEditPolicies(IEditorPart editorPart)
          Refresh the edit policies.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractCutCopyPasteCommandFactory

public AbstractCutCopyPasteCommandFactory()
Method Detail

buildCopyCommand

public ICommand buildCopyCommand(org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramWorkbenchPart part,
                                 List<EObject> selection)
Build a new copy command.

Specified by:
buildCopyCommand in interface ICutCopyPasteCommandFactory
Parameters:
part - the editor
selection - the selection
Returns:
the command

buildCutCommand

public ICommand buildCutCommand(org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramWorkbenchPart part,
                                List<EObject> selection)
Build a new cut command.

Specified by:
buildCutCommand in interface ICutCopyPasteCommandFactory
Parameters:
part - the editor
selection - the selection
Returns:
the command

buildPasteCommand

public ICommand buildPasteCommand(org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramWorkbenchPart part,
                                  List<EObject> selection)
Build a new paste command.

Specified by:
buildPasteCommand in interface ICutCopyPasteCommandFactory
Parameters:
part - the editor
selection - the selection
Returns:
the command

getFile

protected abstract String getFile()
Getter for the transformation file. e.g.: /transformations/feature.ext

Returns:
the file

getBundle

protected abstract org.osgi.framework.Bundle getBundle()
Getter for the bundle of the plugin where the file is located.

Returns:
the bundle

getTypes

protected abstract Class<?>[] getTypes()
Get a list of all types that can be copied or pasted.

Returns:
the list of types

getModel

protected abstract List<String> getModel()
Get the path to the model package. e.g.: de.cau.cs.kieler.synccharts.SyncchartsPackage

Returns:
the model package

performPreOperationActions

protected void performPreOperationActions(IProgressMonitor monitor)
Perform actions before the operation has started.

Parameters:
monitor - a progress monitor

performPostOperationActions

protected void performPostOperationActions(IProgressMonitor monitor)
Perform actions after the operation has finished.

Parameters:
monitor - a progress monitor

refreshEditPolicies

protected void refreshEditPolicies(IEditorPart editorPart)
Refresh the edit policies.

Parameters:
editorPart - the editor