public class DefaultCreateRelationshipCommand extends AbstractCommand
IRelationshipPolicy.getCreateRelationshipCommand(TimelineObjectPath,
TimelineObjectPath, RelationshipType,
com.dlsc.flexgantt.model.gantt.IGanttChartModel)
,
Serialized FormConstructor and Description |
---|
DefaultCreateRelationshipCommand(TimelineObjectPath sourcePath,
TimelineObjectPath targetPath,
RelationshipType type,
DefaultGanttChartModel model)
Constructs a new command.
|
Modifier and Type | Method and Description |
---|---|
protected IRelationship |
createRelationship(TimelineObjectPath sourcePath,
TimelineObjectPath targetPath)
Creates the relationship object, which stores the source and the target
path.
|
void |
executeCommand(IProgressMonitor monitor)
Executes the command.
|
DefaultGanttChartModel |
getModel()
Returns the model for which the command creates / created a new
relationship object.
|
IRelationship |
getRelationship()
The relationship that was created by the command.
|
RelationshipType |
getRelationshipType()
Returns the type of relationship that the user wants to create (S-E, E-S,
S-S, E-E).
|
TimelineObjectPath |
getSourcePath()
The path to the timeline object that will be used as the source of the
relationship.
|
TimelineObjectPath |
getTargetPath()
The path to the timeline object that will be used as the target of the
relationship.
|
void |
undoCommand(IProgressMonitor monitor)
Undos the command.
|
getName, isRedoable, isRelevant, isUndoable, redoCommand, setName
public DefaultCreateRelationshipCommand(TimelineObjectPath sourcePath, TimelineObjectPath targetPath, RelationshipType type, DefaultGanttChartModel model)
sourcePath
- the path to the source timeline objecttargetPath
- the path to the target timeline objecttype
- the type of relationship that the user wants to create (start
to end, end to start, start to start, end to end)model
- the model for which to create the relationship objectpublic void executeCommand(IProgressMonitor monitor) throws CommandException
ICommand
monitor
- a progress monitorCommandException
- if anything during the execution of the command has gone
wrongpublic void undoCommand(IProgressMonitor monitor) throws CommandException
ICommand
monitor
- a progress monitorCommandException
- if anything during the execution of the command has gone
wrongpublic DefaultGanttChartModel getModel()
public IRelationship getRelationship()
public RelationshipType getRelationshipType()
public TimelineObjectPath getSourcePath()
public TimelineObjectPath getTargetPath()
protected IRelationship createRelationship(TimelineObjectPath sourcePath, TimelineObjectPath targetPath)
DefaultRelationship
. Subclasses can override this method to
create relationships of their own types.sourcePath
- the path to the source timeline objecttargetPath
- the path to the target timeline objectCopyright © 2006–2020 Dirk Lemmermann Software & Consulting. All rights reserved.