Class WTab

    • Constructor Detail

      • WTab

        protected WTab​(WComponent content,
                       String tabName,
                       WTabSet.TabMode mode,
                       char accessKey)
        Creates a new tab.
        Parameters:
        content - the tab content
        tabName - the tab label
        mode - the | tab mode.
        accessKey - the access key used to activate this tab
      • WTab

        protected WTab​(WComponent content,
                       WDecoratedLabel label,
                       WTabSet.TabMode mode,
                       char accessKey)
        Creates a new tab.
        Parameters:
        content - the tab content
        label - the tab label, which may contain rich content.
        mode - the | tab mode.
        accessKey - the access key used to activate this tab
    • Method Detail

      • isOpen

        public boolean isOpen()
        Indicates whether this tab is open in the given context.
        Returns:
        true if this tab is open in the given context, otherwise false.
      • getContent

        public WComponent getContent()
        Returns:
        the tab content.
      • setContent

        public void setContent​(WComponent content)
        Sets the tab content.
        Parameters:
        content - the tab content.
      • setMode

        public void setMode​(WTabSet.TabMode mode)
        Set the mode of operation for this tab. See #692.
        Parameters:
        mode - the tab mode.
      • getAccessKey

        public char getAccessKey()
        Specified by:
        getAccessKey in interface AccessKeyable
        Returns:
        the component's access key.
      • setAccessKey

        public void setAccessKey​(char accessKey)
        Description copied from interface: AccessKeyable
        Set the access key on the component.
        Specified by:
        setAccessKey in interface AccessKeyable
        Parameters:
        accessKey - the key that will form a keyboard shortcut to the component.
      • isDisabled

        public boolean isDisabled()
        Indicates whether the WTabSet is disabled in the given context.
        Specified by:
        isDisabled in interface Disableable
        Returns:
        true if the input is disabled, otherwise false.
      • setDisabled

        public void setDisabled​(boolean disabled)
        Sets whether the WTabSet is disabled.
        Specified by:
        setDisabled in interface Disableable
        Parameters:
        disabled - true to disable this tab, false to enable.
      • handleRequest

        public void handleRequest​(Request request)
        Subclasses should override this method in order to provide specific request handling logic. For example, a text field may set its value to the value of a request parameter.
        Specified by:
        handleRequest in interface WComponent
        Overrides:
        handleRequest in class AbstractWComponent
        Parameters:
        request - the request being responded to.
      • preparePaintComponent

        protected void preparePaintComponent​(Request request)
        Override preparePaintComponent in order to correct the visibility of the tab's content before it is rendered.
        Overrides:
        preparePaintComponent in class AbstractWComponent
        Parameters:
        request - the request being responded to.
      • getTabLabel

        public WDecoratedLabel getTabLabel()
        Returns:
        the tab label.
      • setText

        public void setText​(String text,
                            Serializable... args)
        A convenience method to set the body text of the decorated label.
        Parameters:
        text - the text to set, using MessageFormat syntax.
        args - optional arguments for the message format string.
      • toString

        public String toString()
        Description copied from class: AbstractWComponent
        Creates a String representation of this component; usually for debugging purposes.
        Overrides:
        toString in class AbstractWComponent
        Returns:
        a String representation of this component, for debugging purposes.
      • getComponentModel

        protected WTab.TabModel getComponentModel()
        Returns the effective component model for this component. Subclass may override this method to narrow the return type to their specific model type.
        Overrides:
        getComponentModel in class AbstractWComponent
        Returns:
        the effective component model
      • getOrCreateComponentModel

        protected WTab.TabModel getOrCreateComponentModel()
        Retrieves the model for this component so that it can be modified. If this method is called during request processing, and a session specific model does not yet exist, then a new model is created. Subclasses may override this method to narrow the return type to their specific model type.
        Overrides:
        getOrCreateComponentModel in class AbstractWComponent
        Returns:
        the model for this component