com.dlsc.flexgantt.policy.eventline

## Class DefaultEditEventlineObjectPolicy

- java.lang.Object
- - com.dlsc.flexgantt.policy.AbstractPolicy
  - - com.dlsc.flexgantt.policy.eventline.DefaultEditEventlineObjectPolicy

- All Implemented Interfaces:
    IEditEventlineObjectPolicy, IPolicy

      public class DefaultEditEventlineObjectPolicy
      extends AbstractPolicy
      implements IEditEventlineObjectPolicy

  The default implementation of the `IEditEventlineObjectPolicy` works in combination with the `DefaultEventlineModel` and eventline objects that implement the `IEventlineObject` interface.
  Since:
    1.0
  Version:
    $Revision: 1.8 $
  Author:
    Dirk Lemmermann

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultEditEventlineObjectPolicy()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `ICommand` | `getChangeTimeSpanCommand(Object eventlineObject, IEventlineModel model, ITimeSpan span)` Returns a command object that will perform the actual change of the eventline object's time span.
    `ICommand` | `getCreateCommand(IEventlineModel model, ITimeSpan span)` Returns a command object that will perform the actual creating of a new eventline object.
    `ICommand` | `getDeleteCommand(Collection<Object> eventlineObjects, IEventlineModel model)` Returns a command object that will perform the actual deletion of the eventline objects.
    `boolean` | `isCreatable(IEventlineModel model, ITimeSpan span)` Decides whether an eventline object may be created for the given model and with the given time span.
    `boolean` | `isDeletable(Object eventlineObject, IEventlineModel model)` Decides whether the eventline object may be deleted.
    `boolean` | `isDurationChangeable(Object eventlineObject, IEventlineModel model)` Decides whether the duration of an eventline object may be edited / changed.
    `boolean` | `isStartTimeChangeable(Object eventlineObject, IEventlineModel model)` Decides whether the start time of an eventline object may be edited / changed.

    - ### Methods inherited from class com.dlsc.flexgantt.policy.AbstractPolicy

      `assertClass`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DefaultEditEventlineObjectPolicy

          public DefaultEditEventlineObjectPolicy()

  - ### Method Detail

    - #### isStartTimeChangeable

          public boolean isStartTimeChangeable(Object eventlineObject,
                                               IEventlineModel model)

      Description copied from interface: `IEditEventlineObjectPolicy`
      Decides whether the start time of an eventline object may be edited / changed.
      Specified by:
        `isStartTimeChangeable` in interface `IEditEventlineObjectPolicy`
      Parameters:
        `eventlineObject` - the eventline object that gets checked for its time span editing ability
        `model` - the data source of the eventline object
      Returns:
        TRUE if the start time of the eventline object may be edited

    - #### isDurationChangeable

          public boolean isDurationChangeable(Object eventlineObject,
                                              IEventlineModel model)

      Description copied from interface: `IEditEventlineObjectPolicy`
      Decides whether the duration of an eventline object may be edited / changed.
      Specified by:
        `isDurationChangeable` in interface `IEditEventlineObjectPolicy`
      Parameters:
        `eventlineObject` - the eventline object that gets checked for its time span editing ability
        `model` - the data source of the eventline object
      Returns:
        TRUE if the duration of the eventline object may be edited

    - #### isDeletable

          public boolean isDeletable(Object eventlineObject,
                                     IEventlineModel model)

      Description copied from interface: `IEditEventlineObjectPolicy`
      Decides whether the eventline object may be deleted.
      Specified by:
        `isDeletable` in interface `IEditEventlineObjectPolicy`
      Parameters:
        `eventlineObject` - the eventline object that gets checked
        `model` - the data source of the eventline object
      Returns:
        TRUE if the eventline object may be deleted

    - #### isCreatable

          public boolean isCreatable(IEventlineModel model,
                                     ITimeSpan span)

      Description copied from interface: `IEditEventlineObjectPolicy`
      Decides whether an eventline object may be created for the given model and with the given time span.
      Specified by:
        `isCreatable` in interface `IEditEventlineObjectPolicy`
      Parameters:
        `model` - the model to which the newly created object will be added
        `span` - the time span where the event object gets created
      Returns:
        TRUE if the eventline object may be deleted

    - #### getChangeTimeSpanCommand

          public ICommand getChangeTimeSpanCommand(Object eventlineObject,
                                                   IEventlineModel model,
                                                   ITimeSpan span)

      Description copied from interface: `IEditEventlineObjectPolicy`
      Returns a command object that will perform the actual change of the eventline object's time span.
      Specified by:
        `getChangeTimeSpanCommand` in interface `IEditEventlineObjectPolicy`
      Parameters:
        `eventlineObject` - the eventline object that gets checked for its editing ability
        `model` - the data source of the eventline object
        `span` - the new time span for the eventline object
      Returns:
        a command that will modify the eventline object's time span

    - #### getDeleteCommand

          public ICommand getDeleteCommand(Collection<Object> eventlineObjects,
                                           IEventlineModel model)

      Description copied from interface: `IEditEventlineObjectPolicy`
      Returns a command object that will perform the actual deletion of the eventline objects.
      Specified by:
        `getDeleteCommand` in interface `IEditEventlineObjectPolicy`
      Parameters:
        `eventlineObjects` - the eventline objects that get deleted
        `model` - the data source of the eventline object
      Returns:
        a command that will delete the eventline object

    - #### getCreateCommand

          public ICommand getCreateCommand(IEventlineModel model,
                                           ITimeSpan span)

      Description copied from interface: `IEditEventlineObjectPolicy`
      Returns a command object that will perform the actual creating of a new eventline object.
      Specified by:
        `getCreateCommand` in interface `IEditEventlineObjectPolicy`
      Parameters:
        `model` - the model to which the new object needs to be added
        `span` - the time span for the new eventline object
      Returns:
        a command that will create a new eventline object

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