Class WPanel

    • Constructor Detail

      • WPanel

        public WPanel​(WPanel.Type type)
        Creates a WPanel of the specified type.
        Parameters:
        type - the type of panel to create.
    • Method Detail

      • setDefaultSubmitButton

        public void setDefaultSubmitButton​(WButton defaultSubmitButton)
        Sets the button that should be submitted when the user hits enter key and cursor is inside this panel.
        Parameters:
        defaultSubmitButton - the default submit button.
      • getDefaultSubmitButton

        public WButton getDefaultSubmitButton()
        Returns:
        The button that will be submitted if the user hits the enter key when the cursor is in this field.
      • getType

        public WPanel.Type getType()
        Returns:
        the panel type.
      • setType

        public void setType​(WPanel.Type type)
        Sets the panel type.
        Parameters:
        type - the default panel type.
      • getMode

        public WPanel.PanelMode getMode()
        Returns:
        this WPanel's mode of operation
      • setMode

        public void setMode​(WPanel.PanelMode mode)
        Sets this WPanel's mode of operation.
        Parameters:
        mode - the mode of operation.
      • 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.
      • getAccessKey

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

        public void setTitleText​(String title,
                                 Serializable... args)
        Sets the panel title.
        Parameters:
        title - the panel title to set, using MessageFormat syntax.
        args - optional arguments for the message format string.
      • getTitleText

        public String getTitleText()
        Returns:
        the panel title.
      • setMargin

        public void setMargin​(Margin margin)
        Set the margin for the component, or null for no margin.
        Specified by:
        setMargin in interface Marginable
        Parameters:
        margin - the margin for the component
      • getMargin

        public Margin getMargin()
        Get the margin for the component, or null if not set.
        Specified by:
        getMargin in interface Marginable
        Returns:
        the margin for the component, or null if not set
      • setLayout

        public void setLayout​(LayoutManager layout)
        Sets the panel layout manager.
        Parameters:
        layout - the panel layout manager.
      • getLayout

        public LayoutManager getLayout()
        Returns:
        the panel layout manager.
      • add

        public void add​(WComponent component,
                        Serializable... constraints)

        Adds the given component as a child of this component. The constraints are made available to the LayoutManager if it requires them.

        Parameters:
        component - the component to add.
        constraints - the layout constraints
      • add

        public void add​(WComponent component,
                        Serializable constraints)

        Adds the given component as a child of this component. The constraints are made available to the LayoutManager if it requires them.

        Parameters:
        component - the component to add.
        constraints - the layout constraints
      • remove

        public void remove​(WComponent aChild)
        Removes the given component from this component's list of children. This method has been overriden to remove any associated layout constraints.
        Specified by:
        remove in interface MutableContainer
        Overrides:
        remove in class WContainer
        Parameters:
        aChild - the child component to remove
      • toString

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

        public Serializable getLayoutConstraints​(WComponent child)
        Retrieves the layout constraints for the given component, if they have been set.
        Parameters:
        child - the child component to retrieve the constraints for.
        Returns:
        the layout constraints for the given child, if set.
      • getComponentModel

        protected WPanel.PanelModel 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 WBeanComponent
        Returns:
        the effective component model
      • getOrCreateComponentModel

        protected WPanel.PanelModel 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 WBeanComponent
        Returns:
        the model for this component