Package org.eclipse.graphiti.ui.features
Class AbstractDrillDownFeature
- java.lang.Object
-
- org.eclipse.graphiti.features.impl.AbstractFeature
-
- org.eclipse.graphiti.features.custom.AbstractCustomFeature
-
- org.eclipse.graphiti.ui.features.AbstractDrillDownFeature
-
- All Implemented Interfaces:
ICustomFeature
,IFeature
,IFeatureProviderHolder
,IDescription
,IName
public abstract class AbstractDrillDownFeature extends AbstractCustomFeature
The Class AbstractDrillDownFeature.
-
-
Constructor Summary
Constructors Constructor Description AbstractDrillDownFeature(IFeatureProvider fp)
Creates a newAbstractDrillDownFeature
.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
canExecute(ICustomContext context)
Can execute.void
execute(ICustomContext context)
Execute.protected java.lang.String
getDiagramEditorId(Diagram diagram)
Returns the editor id of the diagram editor to open by defaultDiagramEditor.DIAGRAM_EDITOR_ID
.protected abstract java.util.Collection<Diagram>
getDiagrams()
Returns all diagrams which are considered for navigation.protected java.util.Collection<Diagram>
getLinkedDiagrams(PictogramElement pe)
Returns a list of all diagrams, which are connected to the given pictogram element.java.lang.String
getName()
Gets the name.protected org.eclipse.emf.transaction.TransactionalEditingDomain
getTransActionalEditingDomainForNewDiagram()
boolean
hasDoneChanges()
Is queried by the framework after a feature has been executed to find out if this feature should appear in the undo stack of e.g.protected void
openDiagramEditor(Diagram diagram)
Opens the diagram editor for the drill down.-
Methods inherited from class org.eclipse.graphiti.features.custom.AbstractCustomFeature
canExecute, execute, getDescription, getImageId, isAvailable
-
Methods inherited from class org.eclipse.graphiti.features.impl.AbstractFeature
addGraphicalRepresentation, canUndo, getAllBusinessObjectsForPictogramElement, getBusinessObjectForPictogramElement, getDiagram, getDiagramBehavior, getFeatureProvider, getProgressCallback, getUserDecision, layoutPictogramElement, link, link, manageColor, manageColor, manageDefaultFont, manageFont, manageFont, setProgressCallback, toString, updatePictogramElement
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.graphiti.features.IFeatureProviderHolder
getFeatureProvider
-
-
-
-
Constructor Detail
-
AbstractDrillDownFeature
public AbstractDrillDownFeature(IFeatureProvider fp)
Creates a newAbstractDrillDownFeature
.- Parameters:
fp
- the feature provider
-
-
Method Detail
-
getName
public java.lang.String getName()
Description copied from interface:IName
Gets the name.- Specified by:
getName
in interfaceIName
- Overrides:
getName
in classAbstractFeature
- Returns:
- the name
-
execute
public void execute(ICustomContext context)
Description copied from interface:ICustomFeature
Execute.- Parameters:
context
- the context
-
openDiagramEditor
protected void openDiagramEditor(Diagram diagram)
Opens the diagram editor for the drill down. Users can override this method in order to open different editors, open editors in different windows or do completely different stuff for the drill down.- Parameters:
diagram
- the diagram for which the editor will be opened.
-
getDiagramEditorId
protected java.lang.String getDiagramEditorId(Diagram diagram)
Returns the editor id of the diagram editor to open by defaultDiagramEditor.DIAGRAM_EDITOR_ID
. Users can override and return a different editor id, must be the id of a subclass ofDiagramEditor
.- Parameters:
diagram
- the diagram for which the editor will be opened- Returns:
- the editor id of the diagram editor to open
-
canExecute
public boolean canExecute(ICustomContext context)
Description copied from interface:ICustomFeature
Can execute.- Specified by:
canExecute
in interfaceICustomFeature
- Overrides:
canExecute
in classAbstractCustomFeature
- Parameters:
context
- the context- Returns:
- true, if successful
-
hasDoneChanges
public boolean hasDoneChanges()
Description copied from interface:IFeature
Is queried by the framework after a feature has been executed to find out if this feature should appear in the undo stack of e.g. an editor. By default all features should appear there (see implementation inAbstractFeature
), but features may decide to override this behavior. Note that this is a dynamic attribute of the feature that is queried each time after the feature has been executed.IMPORTANT NOTE: The implementor of the feature is responsible for correctly implementing this method! It might lead to inconsistencies in the command stack if this method returns
false
although the feature did changes.- Specified by:
hasDoneChanges
in interfaceIFeature
- Overrides:
hasDoneChanges
in classAbstractFeature
- Returns:
true
if the feature should appear in the undo stack,false
otherwise
-
getLinkedDiagrams
protected java.util.Collection<Diagram> getLinkedDiagrams(PictogramElement pe)
Returns a list of all diagrams, which are connected to the given pictogram element. This means, that the diagrams and the pictogram element have at least one linked business object in common.- Parameters:
pe
- The pictogram element for which to return the connected diagrams.- Returns:
- A list of all diagrams, which are connected to the given pictogram element.
-
getDiagrams
protected abstract java.util.Collection<Diagram> getDiagrams()
Returns all diagrams which are considered for navigation.- Returns:
- the diagrams
-
getTransActionalEditingDomainForNewDiagram
protected org.eclipse.emf.transaction.TransactionalEditingDomain getTransActionalEditingDomainForNewDiagram()
-
-