com.dlsc.flexgantt.command.eventline
Class DefaultCreateEventlineObjectCommand

java.lang.Object
  extended by com.dlsc.flexgantt.command.AbstractCommand
      extended by com.dlsc.flexgantt.command.eventline.DefaultCreateEventlineObjectCommand
All Implemented Interfaces:
ICommand, java.io.Serializable

public class DefaultCreateEventlineObjectCommand
extends AbstractCommand

A command that is used to create an eventline object and add it to an eventline model. This command can only be used in situations where the model is an instance of DefaultEventlineModel.

Since:
1.0
Author:
Dirk Lemmermann
See Also:
DefaultEventlineModel.addEventlineObject(IEventlineObject), IEventlineObject, IEditEventlineObjectPolicy.getCreateCommand(com.dlsc.flexgantt.model.eventline.IEventlineModel, com.dlsc.flexgantt.model.ITimeSpan), Serialized Form

Constructor Summary
DefaultCreateEventlineObjectCommand(DefaultEventlineModel model, ITimeSpan span)
          Constructs a new command.
 
Method Summary
protected  DefaultEventlineObject createEventlineObject()
          Constructs and returns a new eventline object.
 void executeCommand(IProgressMonitor monitor)
          Executes the command.
 DefaultEventlineObject getEventlineObject()
          Returns the eventline object that was created.
 DefaultEventlineModel getModel()
          Returns the model of which the eventline object is a member.
 ITimeSpan getTimeSpan()
          Returns the time span that will be assigned to the newly created eventline object.
 void setEventlineObjectName(java.lang.String name)
          Specifies a name that will be used for the eventline object.
 void setTimeSpan(ITimeSpan span)
          Specifies the time span that will be assigned to the newly created eventline object.
 void undoCommand(IProgressMonitor monitor)
          Undos the command.
 
Methods inherited from class com.dlsc.flexgantt.command.AbstractCommand
getName, isRedoable, isRelevant, isUndoable, redoCommand
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultCreateEventlineObjectCommand

public DefaultCreateEventlineObjectCommand(DefaultEventlineModel model,
                                           ITimeSpan span)
Constructs a new command.

Parameters:
model - the model of which the object is a member
span - the time span that will be initially assigned to the new eventline object
Since:
1.0
Method Detail

executeCommand

public void executeCommand(IProgressMonitor monitor)
Description copied from interface: ICommand
Executes the command.

Parameters:
monitor - a progress monitor

undoCommand

public void undoCommand(IProgressMonitor monitor)
Description copied from interface: ICommand
Undos the command.

Parameters:
monitor - a progress monitor

createEventlineObject

protected DefaultEventlineObject createEventlineObject()
Constructs and returns a new eventline object. The default implementation of this method returns an instance of DefaultEventlineObject.

Returns:
the new eventline object
Since:
1.0

getEventlineObject

public DefaultEventlineObject getEventlineObject()
Returns the eventline object that was created.

Returns:
the new eventline object
Since:
1.0

getModel

public DefaultEventlineModel getModel()
Returns the model of which the eventline object is a member.

Returns:
the data source to which the eventline object belongs
Since:
1.0

getTimeSpan

public ITimeSpan getTimeSpan()
Returns the time span that will be assigned to the newly created eventline object.

Returns:
the time span for the new eventline object
Since:
1.0

setTimeSpan

public void setTimeSpan(ITimeSpan span)
Specifies the time span that will be assigned to the newly created eventline object.

Parameters:
span - the time span for the new eventline object
Since:
1.0

setEventlineObjectName

public void setEventlineObjectName(java.lang.String name)
Specifies a name that will be used for the eventline object.

Parameters:
name - the name of the eventline object
Since:
1.0