Class RibbonGroup

All Implemented Interfaces:
HasAttachHandlers, HasHandlers, EventListener, HasVisibility, IsWidget, LogicalStructure, HasClearHandlers, HasClickHandlers, HasDoubleClickHandlers, HasDragMoveHandlers, HasDragRepositionMoveHandlers, HasDragRepositionStartHandlers, HasDragRepositionStopHandlers, HasDragResizeMoveHandlers, HasDragResizeStartHandlers, HasDragResizeStopHandlers, HasDragStartHandlers, HasDragStopHandlers, HasDropHandlers, HasDropMoveHandlers, HasDropOutHandlers, HasDropOverHandlers, HasFocusChangedHandlers, HasHoverHandlers, HasHoverHiddenHandlers, HasKeyDownHandlers, HasKeyPressHandlers, HasMouseDownHandlers, HasMouseMoveHandlers, HasMouseOutHandlers, HasMouseOverHandlers, HasMouseStillDownHandlers, HasMouseUpHandlers, HasMouseWheelHandlers, HasMovedHandlers, HasParentMovedHandlers, HasResizedHandlers, HasRightMouseDownHandlers, HasRuleContextChangedHandlers, HasScrolledHandlers, HasShowContextMenuHandlers, HasVisibilityChangedHandlers, HasMembersChangedHandlers

public class RibbonGroup extends ToolStripGroup
A widget that groups RibbonButtonss for use in RibbonBars.
  • Constructor Details

    • RibbonGroup

      public RibbonGroup()
    • RibbonGroup

      public RibbonGroup(JavaScriptObject jsObj)
  • Method Details

    • getOrCreateRef

      public static RibbonGroup getOrCreateRef(JavaScriptObject jsObj)
    • changeAutoChildDefaults

      public static void changeAutoChildDefaults(String autoChildName, Canvas defaults)
      Changes the defaults for Canvas AutoChildren named autoChildName.
      Parameters:
      autoChildName - name of an AutoChild to customize the defaults for.
      defaults - Canvas defaults to apply. These defaults override any existing properties without destroying or wiping out non-overridden properties. For usage tips on this param, see SGWTProperties.
      See Also:
    • changeAutoChildDefaults

      public static void changeAutoChildDefaults(String autoChildName, FormItem defaults)
      Changes the defaults for FormItem AutoChildren named autoChildName.
      Parameters:
      autoChildName - name of an AutoChild to customize the defaults for.
      defaults - FormItem defaults to apply. These defaults override any existing properties without destroying or wiping out non-overridden properties. For usage tips on this param, see SGWTProperties.
      See Also:
    • create

      protected JavaScriptObject create()
      Overrides:
      create in class ToolStripGroup
    • setAutoSizeToTitle

      public RibbonGroup setAutoSizeToTitle(Boolean autoSizeToTitle) throws IllegalStateException
      By default, RibbonGroups are assigned a minimum width that allows the entire title to be visible. To prevent this behavior and have group-titles cut off when they're wider than the buttons they contain, set this attribute to false
      Parameters:
      autoSizeToTitle - New autoSizeToTitle value. Default value is true
      Returns:
      RibbonGroup instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getAutoSizeToTitle

      public Boolean getAutoSizeToTitle()
      By default, RibbonGroups are assigned a minimum width that allows the entire title to be visible. To prevent this behavior and have group-titles cut off when they're wider than the buttons they contain, set this attribute to false
      Returns:
      Current autoSizeToTitle value. Default value is true
    • getBody

      public HLayout getBody() throws IllegalStateException
      HLayout autoChild that manages multiple VLayouts containing controls.

      This component is an AutoChild named "body". For an overview of how to use and configure AutoChildren, see Using AutoChildren.

      Returns:
      Current body value. Default value is null
      Throws:
      IllegalStateException - if this widget has not yet been rendered.
    • setBodyConstructor

      public RibbonGroup setBodyConstructor(String bodyConstructor) throws IllegalStateException
      Smart GWT class for the body.

      Note : This is an advanced setting

      Parameters:
      bodyConstructor - New bodyConstructor value. Default value is "HLayout"
      Returns:
      RibbonGroup instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getBodyConstructor

      public String getBodyConstructor()
      Smart GWT class for the body.
      Returns:
      Current bodyConstructor value. Default value is "HLayout"
    • getColumnLayout

      public VLayout getColumnLayout()
      Note : This API is non-functional (always returns null) and exists only to make you aware that this MultiAutoChild exists. See Using AutoChildren for details.

      AutoChild VLayouts created automatically by groups. Each manages a single column of child controls in the group. Child controls that support rowSpan may specify it in order to occupy more than one row in a single column. See numRows for related information.

      Returns:
      null
    • setControls

      public RibbonGroup setControls(Canvas... controls)
      The array of controls to show in this group.

      If this method is called after the component has been drawn/initialized: Clears the array of controls and then adds the passed array to this group, creating new columns as necessary, according to each control's rowSpan attribute and the group's numRows attribute.
      Parameters:
      controls - an array of widgets to add to this group. Default value is null
      Returns:
      RibbonGroup instance, for chaining setter calls
    • getControls

      public Canvas[] getControls()
      The array of controls to show in this group.
      Returns:
      Current controls value. Default value is null
    • setEditProxyConstructor

      public RibbonGroup setEditProxyConstructor(String editProxyConstructor) throws IllegalStateException
      Default class used to construct the EditProxy for this component when the component is first placed into edit mode.
      Overrides:
      setEditProxyConstructor in class Layout
      Parameters:
      editProxyConstructor - New editProxyConstructor value. Default value is "RibbonGroupEditProxy"
      Returns:
      RibbonGroup instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getEditProxyConstructor

      public String getEditProxyConstructor()
      Default class used to construct the EditProxy for this component when the component is first placed into edit mode.
      Overrides:
      getEditProxyConstructor in class Layout
      Returns:
      Current editProxyConstructor value. Default value is "RibbonGroupEditProxy"
      See Also:
    • getLabel

      public Label getLabel() throws IllegalStateException
      AutoChild Label used to display the title text for this group.

      Can be customized via the standard com.smartgwt.client.types.AutoChild pattern, and various convenience APIs exist for configuring it after initial draw: see setShowTitle, setTitle, setTitleAlign, setTitleHeight, setTitleOrientation and setTitleStyle.

      This component is an AutoChild named "label". For an overview of how to use and configure AutoChildren, see Using AutoChildren.

      Returns:
      Current label value. Default value is null
      Throws:
      IllegalStateException - if this widget has not yet been rendered.
    • setLabelConstructor

      public RibbonGroup setLabelConstructor(String labelConstructor) throws IllegalStateException
      Smart GWT class for the title label AutoChild.

      Note : This is an advanced setting

      Parameters:
      labelConstructor - New labelConstructor value. Default value is "Label"
      Returns:
      RibbonGroup instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getLabelConstructor

      public String getLabelConstructor()
      Smart GWT class for the title label AutoChild.
      Returns:
      Current labelConstructor value. Default value is "Label"
    • getLabelLayout

      public HLayout getLabelLayout() throws IllegalStateException
      HLayout autoChild that houses the label in which the title text is displayed.

      This can be customized via the standard com.smartgwt.client.types.AutoChild pattern.

      This component is an AutoChild named "labelLayout". For an overview of how to use and configure AutoChildren, see Using AutoChildren.

      Returns:
      Current labelLayout value. Default value is null
      Throws:
      IllegalStateException - if this widget has not yet been rendered.
    • getNewControlDefaults

      public RibbonButton getNewControlDefaults()
      Note : This API is non-functional (always returns null) and exists only to make you aware that this MultiAutoChild exists. See Using AutoChildren for details.

      Properties used by createControl when creating new controls.

      Returns:
      null
    • setNumRows

      public RibbonGroup setNumRows(int numRows)
      The number of rows of controls to display in each column. Each control will take one row in a columnLayout by default, but those that support the feature may specify rowSpan to override that.

      Note that settings like this, which affect the group's layout, are not applied directly if changed at runtime - a call to reflowControls will force the group to reflow.

      Parameters:
      numRows - New numRows value. Default value is 1
      Returns:
      RibbonGroup instance, for chaining setter calls
    • getNumRows

      public int getNumRows()
      The number of rows of controls to display in each column. Each control will take one row in a columnLayout by default, but those that support the feature may specify rowSpan to override that.

      Note that settings like this, which affect the group's layout, are not applied directly if changed at runtime - a call to reflowControls will force the group to reflow.

      Returns:
      Current numRows value. Default value is 1
    • setRowHeight

      public RibbonGroup setRowHeight(int rowHeight)
      The height of rows in each column.
      Parameters:
      rowHeight - New rowHeight value. Default value is 26
      Returns:
      RibbonGroup instance, for chaining setter calls
    • getRowHeight

      public int getRowHeight()
      The height of rows in each column.
      Returns:
      Current rowHeight value. Default value is 26
    • setStyleName

      public void setStyleName(String styleName)
      CSS class applied to this RibbonGroup.
      Overrides:
      setStyleName in class Canvas
      Parameters:
      styleName - New styleName value. Default value is "ribbonGroup"
      See Also:
    • getStyleName

      public String getStyleName()
      CSS class applied to this RibbonGroup.
      Overrides:
      getStyleName in class Canvas
      Returns:
      Current styleName value. Default value is "ribbonGroup"
      See Also:
    • setTitle

      public void setTitle(String title)
      The title text to display in this group's title label.

      If this method is called after the component has been drawn/initialized: Sets the text to display in this group's title label after initial draw.
      Overrides:
      setTitle in class Canvas
      Parameters:
      title - The new title for this group. Default value is null
    • getTitle

      public String getTitle()
      The title text to display in this group's title label.
      Overrides:
      getTitle in class Canvas
      Returns:
      Current title value. Default value is null
    • setTitleAlign

      public RibbonGroup setTitleAlign(Alignment titleAlign)
      Controls the horizontal alignment of the group's title-text, within its label. Setting this attribute overrides the default specified by groupTitleAlign on the containing RibbonBar.

      If this method is called after the component has been drawn/initialized: This method forcibly sets the horizontal alignment of the title-text, within the title label, after initial draw.
      Parameters:
      titleAlign - the new alignment for the text, left or right. Default value is "center"
      Returns:
      RibbonGroup instance, for chaining setter calls
    • getTitleAlign

      public Alignment getTitleAlign()
      Controls the horizontal alignment of the group's title-text, within its label. Setting this attribute overrides the default specified by groupTitleAlign on the containing RibbonBar.
      Returns:
      Current titleAlign value. Default value is "center"
    • setTitleHeight

      public RibbonGroup setTitleHeight(int titleHeight)
      Controls the height of the title label in this group.

      If this method is called after the component has been drawn/initialized: This method forcibly sets the height of this group's title label after initial draw.
      Parameters:
      titleHeight - the new height for the title label. Default value is 18
      Returns:
      RibbonGroup instance, for chaining setter calls
    • getTitleHeight

      public int getTitleHeight()
      Controls the height of the title label in this group.
      Returns:
      Current titleHeight value. Default value is 18
    • setTitleOrientation

      public RibbonGroup setTitleOrientation(VerticalAlignment titleOrientation)
      Controls the vertical orientation of this group's title label. Setting this attribute overrides the default specified by groupTitleOrientation on the containing RibbonBar.

      If this method is called after the component has been drawn/initialized: This method forcibly sets the vertical orientation of this group's title label after initial draw.
      Parameters:
      titleOrientation - the new orientation for the title, either bottom or top. Default value is "top"
      Returns:
      RibbonGroup instance, for chaining setter calls
    • getTitleOrientation

      public VerticalAlignment getTitleOrientation()
      Controls the vertical orientation of this group's title label. Setting this attribute overrides the default specified by groupTitleOrientation on the containing RibbonBar.
      Returns:
      Current titleOrientation value. Default value is "top"
    • getTitleProperties

      public Label getTitleProperties() throws IllegalStateException
      Deprecated.
      set these properties directly via the label autoChild
      AutoChild properties for fine customization of the title label.

      This component is an AutoChild named "titleProperties". For an overview of how to use and configure AutoChildren, see Using AutoChildren.

      Returns:
      Current titleProperties value. Default value is null
      Throws:
      IllegalStateException - if this widget has not yet been rendered.
    • setTitleStyle

      public RibbonGroup setTitleStyle(String titleStyle)
      CSS class applied to the title label in this group.

      If this method is called after the component has been drawn/initialized: This method forcibly sets the CSS class name for this group's title label after initial draw.
      Parameters:
      titleStyle - the CSS class to apply to the title label. Default value is "ribbonGroupTitle"
      Returns:
      RibbonGroup instance, for chaining setter calls
      See Also:
    • getTitleStyle

      public String getTitleStyle()
      CSS class applied to the title label in this group.
      Returns:
      Current titleStyle value. Default value is "ribbonGroupTitle"
      See Also:
    • addControl

      public void addControl(Canvas control)
      Adds a control to this RibbonGroup, creating a new column as necessary, according to the control's rowSpan value and the group's numRows value.
      Parameters:
      control - a widget to add to this group
    • addControl

      public void addControl(Canvas control, Integer index)
      Adds a control to this RibbonGroup, creating a new column as necessary, according to the control's rowSpan value and the group's numRows value.
      Parameters:
      control - a widget to add to this group
      index - optional insertion index for this control
    • addControls

      public void addControls(Canvas... controls)
      Adds an array of controls to this group, creating new columns as necessary, according to each control's rowSpan value and the group's numRows value.
      Parameters:
      controls - an array of widgets to add to this group
    • createControl

      public void createControl(Canvas properties)
      Creates a new control and adds it to this RibbonGroup. The control is created using the autoChild system, according to the specified constructor and the passed properties are applied to it.
      Parameters:
      properties - properties to apply to the new control
    • createControl

      public void createControl(Canvas properties, Integer position)
      Creates a new control and adds it to this RibbonGroup. The control is created using the autoChild system, according to the specified constructor and the passed properties are applied to it.
      Parameters:
      properties - properties to apply to the new control
      position - the index at which to insert the new control
    • getControlColumn

      public Layout getControlColumn(Canvas control)
      Return the column widget that contains the passed control.
      Parameters:
      control - the control to find in this group
      Returns:
      the column widget containing the passed control
    • reflowControls

      public void reflowControls()
      Forces this group to reflow following changes to attributes that affect layout, like numRows.
    • removeControl

      public void removeControl(Canvas control)
      Removes a control from this RibbonGroup, destroying an existing column if this is the last widget in that column.
      Parameters:
      control - a widget to remove from this group
    • setShowTitle

      public void setShowTitle(boolean showTitle)
      This method forcibly shows or hides this group's title label after initial draw.
      Parameters:
      showTitle - should the title be shown or hidden?
    • setDefaultProperties

      public static void setDefaultProperties(RibbonGroup ribbonGroupProperties)
      Class level method to set the default properties of this class. If set, then all existing and subsequently created instances of this class will automatically have default properties corresponding to the properties set on the SmartGWT class instance passed to this function before its underlying SmartClient JS object was created. This is a powerful feature that eliminates the need for users to create a separate hierarchy of subclasses that only alter the default properties of this class. Can also be used for skinning / styling purposes.

      Note: This method is intended for setting default attributes only and will affect all instances of the underlying class (including those automatically generated in JavaScript). This method should not be used to apply standard EventHandlers or override methods for a class - use a custom subclass instead. Calling this method after instances have been created can result in undefined behavior, since it bypasses any setters and a class instance may have already examined a particular property and not be expecting any changes through this route.

      Parameters:
      ribbonGroupProperties - properties that should be used as new defaults when instances of this class are created
      See Also:
    • setLogicalStructure

      public LogicalStructureObject setLogicalStructure(RibbonGroupLogicalStructure s)
      Setter implementing the LogicalStructure interface, which supports Eclipse's logical structure debugging facility.
    • getLogicalStructure

      public LogicalStructureObject getLogicalStructure()
      Getter implementing the LogicalStructure interface, which supports Eclipse's logical structure debugging facility.
      Specified by:
      getLogicalStructure in interface LogicalStructure
      Overrides:
      getLogicalStructure in class ToolStripGroup