com.dlsc.flexgantt.command.eventline

## Class DefaultCreateEventlineObjectCommand

- java.lang.Object
- - com.dlsc.flexgantt.command.AbstractCommand
  - - com.dlsc.flexgantt.command.eventline.DefaultCreateEventlineObjectCommand

- All Implemented Interfaces:
    ICommand, 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
  Version:
    $Revision: 1.7 $
  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

    Constructors
    Constructor and Description
    `DefaultCreateEventlineObjectCommand(DefaultEventlineModel model, ITimeSpan span)` Constructs a new command.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `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(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, setName`

    - ### 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)
                              throws CommandException

      Description copied from interface: `ICommand`
      Executes the command.
      Parameters:
        `monitor` - a progress monitor
      Throws:
        `CommandException` - if anything during the execution of the command has gone wrong

    - #### undoCommand

          public void undoCommand(IProgressMonitor monitor)
                           throws CommandException

      Description copied from interface: `ICommand`
      Undos the command.
      Parameters:
        `monitor` - a progress monitor
      Throws:
        `CommandException` - if anything during the execution of the command has gone wrong

    - #### 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(String name)

      Specifies a name that will be used for the eventline object.
      Parameters:
        `name` - the name of the eventline object
      Since:
        1.0

Copyright © 2006–2020 Dirk Lemmermann Software & Consulting. All rights reserved.