Class AbstractOptionProperties

java.lang.Object
org.jppf.ui.options.AbstractOptionProperties
All Implemented Interfaces:
Serializable, OptionProperties
Direct Known Subclasses:
AbstractOptionElement

public abstract class AbstractOptionProperties extends Object implements OptionProperties
Default abstract implementation of the OptionElement interface.
Author:
Laurent Cohen
See Also:
  • Field Details

    • label

      protected String label
      The label or title displayed with the UI component.
    • name

      protected String name
      The name of this option element.
    • toolTipText

      protected String toolTipText
      The tooltip text displayed with the UI component.
    • UIComponent

      protected transient JComponent UIComponent
      Get the UI component for this option element.
    • iconPath

      protected String iconPath
      Path to an eventual icon displayed in the button.
    • scrollable

      protected boolean scrollable
      Determines whether this page should be enclosed within a scroll pane.
    • horizontalScrollbar

      protected boolean horizontalScrollbar
      Whether the scroll pane can have a horizontal scrollbar (if scrollable is true).
    • verticalScrollbar

      protected boolean verticalScrollbar
      Whether the scroll pane can have a vertical scrollbar (if scrollable is true).
    • bordered

      protected boolean bordered
      Determines whether this option has a border around it.
    • scripts

      Scripts used by this option or its children.
    • initializer

      protected ValueChangeListener initializer
      The action to fire immediately after the page is built, allowing to perform initializations before the page is displayed and used.
    • finalizer

      protected ValueChangeListener finalizer
      The action to fire immediately when the page is disposed.
    • mouseListener

      protected MouseListener mouseListener
      A Java or scripted mouse click listener.
    • eventsEnabled

      protected boolean eventsEnabled
      Determines whether firing events is enabled or not.
    • layoutConstraints

      protected String layoutConstraints
      Mig layout constraints for the entire layout.
    • componentConstraints

      protected String componentConstraints
      Mig layout constraints for a component.
    • detachable

      protected boolean detachable
      Determines whether this component can be detached to a different view.
  • Constructor Details

    • AbstractOptionProperties

      protected AbstractOptionProperties()
      Constructor provided as a convenience to facilitate the creation of option elements through reflexion.
  • Method Details

    • createUI

      public abstract void createUI()
      Create the UI components for this option.
    • getLabel

      public String getLabel()
      Get the label displayed with the UI component.
      Specified by:
      getLabel in interface OptionProperties
      Returns:
      the label as a string.
    • setLabel

      public void setLabel(String label)
      Set the label displayed with the UI component.
      Parameters:
      label - the label as a string.
    • getName

      public String getName()
      Get the name of this option.
      Specified by:
      getName in interface OptionProperties
      Returns:
      the name as a string.
    • setName

      public void setName(String name)
      Set the name of this option.
      Parameters:
      name - the name as a string.
    • getUIComponent

      public JComponent getUIComponent()
      Get the UI component for this option.
      Specified by:
      getUIComponent in interface OptionProperties
      Returns:
      a JComponent instance.
    • setUIComponent

      public void setUIComponent(JComponent component)
      Set the UI component for this option.
      Parameters:
      component - a JComponent instance.
    • getToolTipText

      public String getToolTipText()
      Get the tooltip text displayed with the UI component.
      Specified by:
      getToolTipText in interface OptionProperties
      Returns:
      the tooltip as a string.
    • setToolTipText

      public void setToolTipText(String tooltip)
      Set the tooltip text displayed with the UI component.
      Parameters:
      tooltip - the tooltip as a string.
    • isScrollable

      public boolean isScrollable()
      Determine whether this page should be enclosed within a scroll pane.
      Specified by:
      isScrollable in interface OptionProperties
      Returns:
      true if the page is to be enclosed in a scroll page, false otherwise.
    • setScrollable

      public void setScrollable(boolean scrollable)
      Determine whether this page should be enclosed within a scroll pane.
      Parameters:
      scrollable - true if the page is to be enclosed in a scroll pane, false otherwise.
    • isBordered

      public boolean isBordered()
      Determine whether this page has a border around it.
      Specified by:
      isBordered in interface OptionProperties
      Returns:
      true if the page has a border, false otherwise.
      See Also:
    • setBordered

      public void setBordered(boolean bordered)
      Determine whether this page has a border around it.
      Parameters:
      bordered - true if the page has a border, false otherwise.
    • getScripts

      Get the scripts used by this option or its children.
      Specified by:
      getScripts in interface OptionProperties
      Returns:
      a list of ScriptDescriptor instances.
    • getInitializer

      public ValueChangeListener getInitializer()
      Get the initializer for this option.
      Specified by:
      getInitializer in interface OptionProperties
      Returns:
      a ValueChangeListener instance.
    • setInitializer

      public void setInitializer(ValueChangeListener initializer)
      Set the initializer for this option.
      Parameters:
      initializer - a ValueChangeListener instance.
    • getFinalizer

      public ValueChangeListener getFinalizer()
      Get the finalizer for this option.
      Specified by:
      getFinalizer in interface OptionProperties
      Returns:
      a ValueChangeListener instance.
    • setFinalizer

      public void setFinalizer(ValueChangeListener finalizer)
      Set the finalizer for this option.
      Parameters:
      finalizer - a ValueChangeListener instance.
    • getIconPath

      public String getIconPath()
      Get the path to an eventual icon displayed in the button.
      Specified by:
      getIconPath in interface OptionProperties
      Returns:
      the path as a string.
    • setIconPath

      public void setIconPath(String iconPath)
      Set the path to an eventual icon displayed in the button.
      Parameters:
      iconPath - the path as a string.
    • isEventsEnabled

      public boolean isEventsEnabled()
      Determine whether the events firing in this option and/or its children are enabled.
      Specified by:
      isEventsEnabled in interface OptionProperties
      Returns:
      enabled true if the events are enabled, false otherwise.
    • setEventsEnabled

      public void setEventsEnabled(boolean enabled)
      Enable or disable the events firing in this option and/or its children.
      Specified by:
      setEventsEnabled in interface OptionProperties
      Parameters:
      enabled - true to enable the events, false to disable them.
    • getLayoutConstraints

      public String getLayoutConstraints()
      Get the Mig layout constraints for the entire layout.
      Specified by:
      getLayoutConstraints in interface OptionProperties
      Returns:
      the constraints as a string.
    • setLayoutConstraints

      public void setLayoutConstraints(String layoutConstraints)
      Set the Mig layout constraints for the entire layout.
      Specified by:
      setLayoutConstraints in interface OptionProperties
      Parameters:
      layoutConstraints - - the constraints as a string.
    • getComponentConstraints

      public String getComponentConstraints()
      Get the Mig layout constraints for a component.
      Specified by:
      getComponentConstraints in interface OptionProperties
      Returns:
      the constraints as a string.
    • setComponentConstraints

      public void setComponentConstraints(String componentConstraints)
      Set the Mig layout constraints for a component.
      Specified by:
      setComponentConstraints in interface OptionProperties
      Parameters:
      componentConstraints - - the constraints as a string.
    • setEditable

      public void setEditable(boolean editable)
      Description copied from interface: OptionProperties
      Enable or disable this option.
      Specified by:
      setEditable in interface OptionProperties
      Parameters:
      editable - true to make this option editable, false otherwise.
    • isDetachable

      public boolean isDetachable()
      Description copied from interface: OptionProperties
      Determines whether this component can be detached to a different view.
      Specified by:
      isDetachable in interface OptionProperties
      Returns:
      true if this component can be detached, false otherwise.
    • setDetachable

      public void setDetachable(boolean detachable)
      Specify whether this component can be detached to a different view.
      Parameters:
      detachable - true if this component can be detached, false otherwise.
    • getMouseListener

      public MouseListener getMouseListener()
      Description copied from interface: OptionProperties
      Get the Java or scripted mouse click listener.
      Specified by:
      getMouseListener in interface OptionProperties
      Returns:
      a MouseListener instance.
    • setMouseListener

      public void setMouseListener(MouseListener mouseListener)
      Description copied from interface: OptionProperties
      Set the Java or scripted mouse click listener.
      Specified by:
      setMouseListener in interface OptionProperties
      Parameters:
      mouseListener - a MouseListener instance.
    • isHorizontalScrollbar

      public boolean isHorizontalScrollbar()
      Determine whether the scroll pane can have a horizontal scrollbar (if scrollable is true).
      Returns:
      true if the scroll pane can have a horizontal scroll bar, false otherwise.
    • setHorizontalScrollbar

      public void setHorizontalScrollbar(boolean horizontalScrollbar)
      Specify whether the scroll pane can have a horizontal scrollbar (if scrollable is true).
      Parameters:
      horizontalScrollbar - true if the scroll pane can have a horizontal scroll bar, false otherwise.
    • isVerticalScrollbar

      public boolean isVerticalScrollbar()
      Determine whether the scroll pane can have a vertical scrollbar (if scrollable is true).
      Returns:
      true if the scroll pane can have a vertical scroll bar, false otherwise.
    • setVerticalScrollbar

      public void setVerticalScrollbar(boolean verticalScrollbar)
      Specify whether the scroll pane can have a vertical scrollbar (if scrollable is true).
      Parameters:
      verticalScrollbar - true if the scroll pane can have a vertical scroll bar, false otherwise.
    • createScrollPane

      protected JScrollPane createScrollPane(JComponent comp)
      Create a JScrollPane for the specified view, based on the scroll pane policies.
      Parameters:
      comp - the view for which to create the scroll pane.
      Returns:
      JScrollPane instance.