Class ToggleHyperlink

  • All Implemented Interfaces:
    Drawable
    Direct Known Subclasses:
    TreeNode, Twistie

    public abstract class ToggleHyperlink
    extends AbstractHyperlink
    A custom selectable control that can be used to control areas that can be expanded or collapsed.

    This is an abstract class. Subclasses are responsible for rendering the control using decoration and hover decoration color. Control should be rendered based on the current expansion state.

    Styles:
    None
    Since:
    3.0
    • Field Detail

      • innerWidth

        protected int innerWidth
      • innerHeight

        protected int innerHeight
      • hover

        protected boolean hover
    • Constructor Detail

      • ToggleHyperlink

        public ToggleHyperlink​(Composite parent,
                               int style)
        Creates a control in a provided composite.
        Parameters:
        parent - the parent
        style - the style
    • Method Detail

      • setDecorationColor

        public void setDecorationColor​(Color decorationColor)
        Sets the color of the decoration.
        Parameters:
        decorationColor -
      • getDecorationColor

        public Color getDecorationColor()
        Returns the color of the decoration.
        Returns:
        decoration color
      • setHoverDecorationColor

        public void setHoverDecorationColor​(Color hoverColor)
        Sets the hover color of decoration. Hover color will be used when mouse enters the decoration area.
        Parameters:
        hoverColor - the hover color to use
      • getHoverDecorationColor

        public Color getHoverDecorationColor()
        Returns the hover color of the decoration.
        Returns:
        the hover color of the decoration.
        Since:
        3.1
      • geHoverDecorationColor

        @Deprecated
        public Color geHoverDecorationColor()
        Deprecated.
        use getHoverDecorationColor
        Returns the hover color of the decoration.
        Returns:
        the hover color of the decoration.
        See Also:
        getHoverDecorationColor()
      • isExpanded

        public boolean isExpanded()
        Returns the expansion state of the toggle control. When toggle is in the normal (downward) state, the value is true . Collapsed control will return false .
        Returns:
        false if collapsed, true otherwise.
      • setExpanded

        public void setExpanded​(boolean expanded)
        Sets the expansion state of the twistie control
        Parameters:
        expanded - the expansion state