Class UITabContainer

    • Field Detail

      • PN_OPEN_TAB

        protected static final java.lang.String PN_OPEN_TAB
        Property name: current open part.
        See Also:
        Constant Field Values

        protected static final Atom OPEN_TAB_ATOM
        Property atom: current open part.

        protected static final java.lang.String TABS_STYLES_NAME
        Name of the tabs styles.
        See Also:
        Constant Field Values

        protected static final Atom TABS_STYLES_ATOM
        Atom of the tabs styles.
    • Constructor Detail

      • UITabContainer

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

        public UITabContainer​(Atom propertyAtom)
        Creates the container with the specified name with a null value.
        propertyAtom - the property atom.
      • UITabContainer

        public UITabContainer​(Atom propertyAtom,
                              GProp<?>[] properties)
                       throws PropException
        Creates a Tab container with the specified name and properties.
        propertyAtom - the property atom.
        properties - the property array value for the container.
        PropException - when properties are not correctly defined.
    • Method Detail

      • clone

        public UITabContainer 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!

        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
        The atom of the selection property.
      • createTabsStyles

        protected Styles createTabsStyles()
        Creates the Tabs Styles container (can be overridden by Designer to create EditorStyles).
      • addPredefinedProps

        protected void addPredefinedProps()
                                   throws PropException
        Adds the predefined properties for this container. This method is called once just after construction of the property container and sometimes population of it.

        The method should add properties to create or get reference to using the maybeAddProp method. When the PropCnr instance is cloned, the method getPredefinedProps() is called in order for the subclass to be able to retrieve the new instances to these properties, if stored in instance variables.

        addPredefinedProps in class UIContainer
        PropException - for property exceptions.
      • mustHaveWidth

        public boolean mustHaveWidth()
        Does this component require a width?
        mustHaveWidth in class UIContainer
        true if the width must be defined and non-zero, false otherwise.
      • mustHaveHeight

        public boolean mustHaveHeight()
        Does this component require a height?
        mustHaveHeight in class UIContainer
        true if the height must be defined and non-zero, false otherwise.
      • mustHaveExplicitWidth

        public boolean mustHaveExplicitWidth()
        Does this component require an explicitly defined width?
        mustHaveExplicitWidth in class UIComp
        true if the width must be defined and non-zero, false otherwise.
      • mustHaveExplicitHeight

        public boolean mustHaveExplicitHeight()
        Does this component require an explicitly defined height?
        mustHaveExplicitHeight in class UIComp
        true if the height must be defined and non-zero, false otherwise.
      • hasImplicitAlignFillX

        public boolean hasImplicitAlignFillX()
        Returns if the component has implicit component horizontal fill.
        hasImplicitAlignFillX in class UIContainer
        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.
        hasImplicitAlignFillY in class UIContainer
        Always: true means component will always fill the space in Y.
      • canAlignX

        public boolean canAlignX()
        Returns if the component can be aligned left, right, center, or horizontal fill.
        canAlignX in class UIComp
        false, grid takes up entire width.
      • canAlignY

        public boolean canAlignY()
        Returns if the component can be aligned top, bottom, middle or vertical fill.
        canAlignY in class UIComp
        false, grid takes up entire height.
      • isContextMenuSupported

        public boolean isContextMenuSupported()
        Returns if the context menu is supported for this component or not.
        Specified by:
        isContextMenuSupported in interface IUIContextMenuOwner
        false as the Tab Container does not support context menus.
      • getGroupID

        public int getGroupID​(GroupNameProp groupName)
        Gets the unique ID for a group name.
        Specified by:
        getGroupID in interface IUIGroupSeparator
        groupName - The group name. Return The unique for the group name.
      • getSelectionType

        public int getSelectionType()
        Gets the selection type of the component.
        Specified by:
        getSelectionType in interface IUISelectionComp
        A value indicating the selection capability as the SELECTION_TYPE_* values define.
      • setSelection

        public java.lang.String setSelection​(int index,
                                             boolean isAnimated)
        Sets the selection as a single selected item at specified index.
        Specified by:
        setSelection in interface IUIAnimatedSingleIndexedSelectionComp
        index - The single item to select at index, -1 to clear the selection.
        isAnimated - The animation flag.
        null for success, otherwise an error message why the selection failed.
      • isSelected

        public boolean isSelected()
        Returns the selection of state of the component.

        For a multiple-selection capable component, this indicates any selection, i.e. true is returned as soon as at least one element is selected, false for none.

        The checkbox for example has two "selected states": checked and third state: in this case, true is returned for the third state as well as the checked state.

        Specified by:
        isSelected in interface IUISelectionComp
        true if the component is selected, false otherwise.
      • clearSelection

        public java.lang.String clearSelection()
        Clear the selection.
        Specified by:
        clearSelection in interface IUIIndexedSelectionComp
        Always "Accordion cannot clear selection".
      • setUIContainerFocus

        public java.lang.String setUIContainerFocus​(UIComp requestor,
                                                    boolean doAnimate)
        Sets the focus to the UI container and all its parents. This method is called when focus is to be set to a component, making it possible for containers such as accordion/swap/tab to change its main container into view.

        Subclasses must override this method to process it, but make sure to call super.setUIContainerFocus(requestor) first!

        Specified by:
        setUIContainerFocus in interface IUIComp
        setUIContainerFocus in class UIContainer
        requestor - The requestor is a child to this container.
        doAnimate - Flag to enable animation when selection is changed for e.g. accordion, swap or tab containers.
        null for success, otherwise an error message why it failed.
      • onPrepare

        protected void onPrepare​(ClassReference cr,
                                 java.util.List<java.lang.Throwable> errors)
        Called to resolve methods for the component from main "onPrepare" once the ClassReference has been found.

        Components should override this method to load it's required methods.

        onPrepare in class UIComp
        cr - The class reference with a valid reference.
        errors - The list of errors that is returned to the caller in case resolving fails.
      • getOnUISelectionMethod

        public java.lang.reflect.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
        The method, or null if none is registered.