Class UITitlePane

All Implemented Interfaces:
EventListener, IFocusComp, IMessageBox, IComponent, ICustomDataProvider, IGProp<GProp<?>[]>, IPropCnr, IUIComp, IUIContainer, IUIContextMenuOwner, IUIFocusComp, IUIBooleanSelectionComp, IUISelectionComp, IUIHTMLTextComponent, IUITextComponent, IVSComponentListener, IVSComponentState, IVSFieldListener, IVSGenericComponentListener, Cloneable
Direct Known Subclasses:
EUITitlePane

public class UITitlePane extends UIContainer implements IUIHTMLTextComponent, IUIBooleanSelectionComp
Title panel UI container optionally collapsable.
Author:
Christopher Mindus
  • Field Details

    • PN_SELECTED

      public static final String PN_SELECTED
      Property name: selected BoolProp.
      See Also:
    • SELECTED_ATOM

      public static final Atom SELECTED_ATOM
      Property atom: selected BoolProp.
  • Constructor Details

    • UITitlePane

      public UITitlePane()
      Creates the container without name with a null value.
    • UITitlePane

      public UITitlePane(Atom propertyAtom)
      Creates the container with the specified name with a null value.
      Parameters:
      propertyAtom - the property atom.
    • UITitlePane

      public UITitlePane(Atom propertyAtom, GProp<?>[] properties) throws PropException
      Creates the container with the specified name and properties.
      Parameters:
      propertyAtom - the property atom.
      properties - the property array value for the UIPanel.
      Throws:
      PropException - when properties are not correctly defined.
  • Method Details

    • clone

      public UITitlePane clone()
      Creates a clone out of this property. The cloning is overridden by the subclasses in order to handle cloning of its class variables appropriately.

      Cloning is used for "virtualization" of a property tree in the server. Client property classes will therefore throw CloneNotSupportedException.

      Once a tree has been cloned, the change-flag is reset, and the create-flag is set. All listeners are also removed! The new cloned property is an orphan, i.e. has no parent set. All children properties are also (deep) cloned.

      Note that the cloning process is done WITHOUT thread synchronization for performance reasons, thus no modifications should be done to the tree!

      Overrides:
      clone in class UIContainer
    • getSelectionPropAtom

      public Atom getSelectionPropAtom()
      Returns the selection property atom for verification of selection changes.

      This method is used by the framework in UIComp to fire selection events when the property value changes.

      Specified by:
      getSelectionPropAtom in interface IUISelectionComp
      Returns:
      The atom of the selection property.
    • getSelectionListenerHandler

      public GenericListener<IUISelectionListener> getSelectionListenerHandler(boolean doCreate)
      Returns the generic selection listener.
      Specified by:
      getSelectionListenerHandler in interface IUISelectionComp
      Parameters:
      doCreate - Create the listener handler if it doesn't exist, false not to.
      Returns:
      The selection listener handler, or null if not created.
    • getDeviceType

      public final int getDeviceType()
      Gets the device type: -1=mobile, 0=both, 1=desktop.
      Specified by:
      getDeviceType in interface IUIComp
      Overrides:
      getDeviceType in class UIContainer
    • isMobileContextMenuSupported

      public boolean isMobileContextMenuSupported()
      Returns if the component can show the context menu in mobile mode.
      Specified by:
      isMobileContextMenuSupported in interface IUIContextMenuOwner
      Overrides:
      isMobileContextMenuSupported in class UIContainer
      Returns:
      Title pane component supports context menus for mobile.
    • hasImplicitAlignFillX

      public boolean hasImplicitAlignFillX()
      Returns if the component has implicit component horizontal fill.
      Overrides:
      hasImplicitAlignFillX in class UIContainer
      Returns:
      Always true: true means component will always fill the space in X.
    • hasImplicitAlignFillY

      public boolean hasImplicitAlignFillY()
      Returns if the component has implicit component vertical fill.
      Overrides:
      hasImplicitAlignFillY in class UIContainer
      Returns:
      Always: true means component will always fill the space in Y.
    • getSelectionType

      public int getSelectionType()
      Gets the selection type of the component.

      Note: selection state for the title pane is the same as the opened or unfolded container.

      Specified by:
      getSelectionType in interface IUISelectionComp
      Returns:
      A value indicating the selection capability as the SELECTION_TYPE_* values define.
    • isSelected

      public boolean isSelected()
      Returns the selection state.
      Specified by:
      isSelected in interface IUIBooleanSelectionComp
      Specified by:
      isSelected in interface IUISelectionComp
      Returns:
      true if selected, false if unselected.
    • isUnselected

      public boolean isUnselected()
      Returns if the selection is not set.

      Note: selection state for the title pane is the same as the opened or unfolded container.

      Specified by:
      isUnselected in interface IUIBooleanSelectionComp
      Returns:
      true if unselected, false if selected.
    • isON

      public boolean isON()
      Returns if the selection is "on".

      Note: selection state for the title pane is the same as the opened or unfolded container.

      Specified by:
      isON in interface IUIBooleanSelectionComp
      Returns:
      true if on, false if off.
    • isOFF

      public boolean isOFF()
      Returns if the selection is "off".

      Note: selection state for the title pane is the same as the opened or unfolded container.

      Specified by:
      isOFF in interface IUIBooleanSelectionComp
      Returns:
      true if off, false if on.
    • setSelection

      public boolean setSelection(boolean isSelected)
      Sets the selection.

      Note: selection state for the title pane is the same as the opened or unfolded container.

      Specified by:
      setSelection in interface IUIBooleanSelectionComp
      Parameters:
      isSelected - The selected state.
      Returns:
      true if state is changed, false for no change.
    • getSelection

      public BooleanSelection getSelection()
      Gets the current selection of the component.

      Note: selection state for the title pane is the same as the opened or unfolded container.

      Specified by:
      getSelection in interface IUISelectionComp
      Returns:
      The current selection of the component.
    • onPrepare

      protected void onPrepare(IAppOwner appOwner, IModuleOwner moduleOwner, boolean isPostCall, List<Throwable> errors) throws PropException
      Called when the application is being prepared. The order of onPrepare calls is always parent first, the children. The method is called twice, first time with isPostCall set to false, then a second time with true.
      Overrides:
      onPrepare in class UIComp
      Parameters:
      appOwner - The application owner.
      moduleOwner - The Module owner.
      isPostCall - Flag indicating this is a post-call.
      errors - A list of errors that occurred but did not cause an abort.
      Throws:
      PropException - For property errors during the application preparation to need to abort.
    • getOnUISelectionMethod

      public Method getOnUISelectionMethod()
      Returns the method to use for onUISelection notifications that is attached to this selection component. The method name is not important, but must have the annotation and signature:

      @OnUISelection(name = "some/property")
      public void onUISelection(UISelectionEvent event)

      Specified by:
      getOnUISelectionMethod in interface IUISelectionComp
      Returns:
      The method, or null if none is registered.