com.dlsc.flexgantt.swing.layer.system

## Class DefaultActionProvider

- java.lang.Object
- - com.dlsc.flexgantt.swing.layer.system.DefaultActionProvider

- All Implemented Interfaces:
    IActionProvider

      public class DefaultActionProvider
      extends Object
      implements IActionProvider

  A default implementation of the IActionProvider interface used in combination with the action layer. This class provides a convenient way to register actions for a given timeline object type.
  Since:
    2.1
  Author:
    Dirk Lemmermann
  See Also:
    `ActionLayer.setActionProvider(IActionProvider)`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultActionProvider()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addAction(Class timelineObjectType, Action... action)` Adds a new action for the given type of timeline objects.
    `List<Action>` | `getTimelineObjectActions(LayerContainer lc, TimelineObjectPath path)` Returns the actions registered for the timeline object specified by the given timeline object path.
    `void` | `removeAction(Class timelineObjectType, Action... action)` Removes the action for the given timeline object type.
    `void` | `setActions(Class timelineObjectType, List<Action> actions)` Sets the given list of actions as the available quick actions for timeline objects of the given type.

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

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

- - ### Constructor Detail

    - #### DefaultActionProvider

          public DefaultActionProvider()

  - ### Method Detail

    - #### getTimelineObjectActions

          public List<Action> getTimelineObjectActions(LayerContainer lc,
                                                       TimelineObjectPath path)

      Returns the actions registered for the timeline object specified by the given timeline object path.
      Specified by:
        `getTimelineObjectActions` in interface `IActionProvider`
      Parameters:
        `lc` - the layer container where the action layer is used
        `path` - the path to the timeline object
      Returns:
        a list of actions to be displayed in the action layer
      Since:
        2.1

    - #### addAction

          public void addAction(Class timelineObjectType,
                                Action... action)

      Adds a new action for the given type of timeline objects.
      Parameters:
        `timelineObjectType` - the object type
        `action` - the action to add
      Since:
        2.1

    - #### setActions

          public void setActions(Class timelineObjectType,
                                 List<Action> actions)

      Sets the given list of actions as the available quick actions for timeline objects of the given type. Previously registered actions will be removed.
      Parameters:
        `timelineObjectType` - the type of timeline objects for which the given actions are available
        `actions` - the actions to register for the given timeline object
      Since:
        2.1

    - #### removeAction

          public void removeAction(Class timelineObjectType,
                                   Action... action)

      Removes the action for the given timeline object type.
      Parameters:
        `timelineObjectType` - the object type
        `action` - the action to remove
      Since:
        2.1

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