com.dlsc.flexgantt.util

## Class LabelTypeSupport

- java.lang.Object
- - com.dlsc.flexgantt.util.LabelTypeSupport

-     public class LabelTypeSupport
      extends Object

  A utiliy class used to lookup labels for an object (timeline objects, relationships) for various purposes. The Gantt chart displays names for these objects in different situations: as a tooltip, during drag and drop operations, in the statusbar. Instead of definining several setter methods for each of these object types the functionlity was moved into this helper class. This is a very similar approach to `PropertyChangeSupport`.
  Since:
    2.0
  Author:
    Dirk Lemmermann

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `LabelTypeSupport()` Constructs a new label type support class.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getLabel(LabelType type)` Returns the label for the given type.
    `void` | `setLabel(String label, LabelType type)` Sets a new label for the given label type.

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

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

- - ### Constructor Detail

    - #### LabelTypeSupport

          public LabelTypeSupport()

      Constructs a new label type support class.
      Since:
        2.0

  - ### Method Detail

    - #### setLabel

          public void setLabel(String label,
                               LabelType type)

      Sets a new label for the given label type. The `LabelType` enumerator specifies the context in which the label gets used: tooltip, popup, status bar.
      Parameters:
        `label` - the new label used for the given label type
        `type` - the label type designating where the label will be used
      Since:
        2.0

    - #### getLabel

          public String getLabel(LabelType type)

      Returns the label for the given type. This method returns the label for `LabelType.NAME` for the status, the tooltip, or the drag info title, unless they specify their own label.
      Parameters:
        `type` - the label type for which a label is needed
      Returns:
        the label for the given type
      Since:
        2.0

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