Class ToolbarItem

All Implemented Interfaces:
HasHandlers, HasBlurHandlers, HasCanEditChangedHandlers, HasChangedHandlers, HasChangeHandlers, HasClickHandlers, HasDoubleClickHandlers, HasEditorEnterHandlers, HasEditorExitHandlers, HasFocusHandlers, HasIconClickHandlers, HasIconKeyPressHandlers, HasItemHoverHandlers, HasKeyDownHandlers, HasKeyPressHandlers, HasKeyUpHandlers, HasPendingStatusChangedHandlers, HasPickerIconClickHandlers, HasReadOnlyDisplayChangedHandlers, HasShowContextMenuHandlers, HasShowValueHandlers, HasTitleClickHandlers, HasTitleDoubleClickHandlers, HasTitleHoverHandlers, HasValueHoverHandlers, HasValueIconClickHandlers

public class ToolbarItem extends CanvasItem
Set of horizontally arranged buttons.
  • Constructor Details

    • ToolbarItem

      public ToolbarItem()
    • ToolbarItem

      public ToolbarItem(JavaScriptObject jsObj)
    • ToolbarItem

      public ToolbarItem(String name)
    • ToolbarItem

      public ToolbarItem(String name, String title)
  • Method Details

    • getOrCreateRef

      public static ToolbarItem 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:
    • changePickerIconDefaults

      public static void changePickerIconDefaults(FormItemIcon defaults)
    • setButtonAutoFit

      public ToolbarItem setButtonAutoFit(Boolean buttonAutoFit)
      Default Button.autoFit for buttons - true by default. Note that autoFit:true buttons will fit to their title regardless of specified width.

      Note : This is an advanced setting

      Parameters:
      buttonAutoFit - New buttonAutoFit value. Default value is true
      Returns:
      ToolbarItem instance, for chaining setter calls
    • getButtonAutoFit

      public Boolean getButtonAutoFit()
      Default Button.autoFit for buttons - true by default. Note that autoFit:true buttons will fit to their title regardless of specified width.
      Returns:
      Current buttonAutoFit value. Default value is true
    • setButtonBaseStyle

      public ToolbarItem setButtonBaseStyle(String buttonBaseStyle)
      If specified this baseStyle will be applied to the buttons in this toolbar.
      Parameters:
      buttonBaseStyle - New buttonBaseStyle value. Default value is null
      Returns:
      ToolbarItem instance, for chaining setter calls
      See Also:
    • getButtonBaseStyle

      public String getButtonBaseStyle()
      If specified this baseStyle will be applied to the buttons in this toolbar.
      Returns:
      Current buttonBaseStyle value. Default value is null
      See Also:
    • setButtons

      public ToolbarItem setButtons(StatefulCanvas... buttons)
      List of buttons for the toolbar. Each button should be specified as a simple JS object with properties to apply to the button to be displayed. Note that any click stringMethod applied to the button will be passed 2 parameters: form and item.
      Parameters:
      buttons - New buttons value. Default value is null
      Returns:
      ToolbarItem instance, for chaining setter calls
      See Also:
    • setButtonSpace

      public ToolbarItem setButtonSpace(int buttonSpace)
      Space between the buttons of this toolbar. Configures the Layout.membersMargin property on the created canvas.
      Parameters:
      buttonSpace - New buttonSpace value. Default value is 4
      Returns:
      ToolbarItem instance, for chaining setter calls
      See Also:
    • getButtonSpace

      public int getButtonSpace()
      Space between the buttons of this toolbar. Configures the Layout.membersMargin property on the created canvas.
      Returns:
      Current buttonSpace value. Default value is 4
      See Also:
    • getCanvas

      public Canvas getCanvas()
      This item is an autoChild generated Canvas displayed by the ToolbarItem and is an instance of Toolbar by default.

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

      Overrides:
      getCanvas in class CanvasItem
      Returns:
      Current canvas value. Default value is null
    • setCanvasConstructor

      public ToolbarItem setCanvasConstructor(String canvasConstructor)
      Constructor class for this toolbarItem's canvas.

      Note : This is an advanced setting

      Parameters:
      canvasConstructor - New canvasConstructor value. Default value is Toolbar
      Returns:
      ToolbarItem instance, for chaining setter calls
    • getCanvasConstructor

      public String getCanvasConstructor()
      Constructor class for this toolbarItem's canvas.
      Returns:
      Current canvasConstructor value. Default value is Toolbar
    • setCreateButtonsOnInit

      public ToolbarItem setCreateButtonsOnInit(Boolean createButtonsOnInit)
      If set to true, causes the toolbar created by this item to create its child buttons during initialization, instead of waiting until draw().

      See the corresponding Toolbar attribute for more information.

      Parameters:
      createButtonsOnInit - New createButtonsOnInit value. Default value is null
      Returns:
      ToolbarItem instance, for chaining setter calls
    • getCreateButtonsOnInit

      public Boolean getCreateButtonsOnInit()
      If set to true, causes the toolbar created by this item to create its child buttons during initialization, instead of waiting until draw().

      See the corresponding Toolbar attribute for more information.

      Returns:
      Current createButtonsOnInit value. Default value is null
    • setEditProxyConstructor

      public ToolbarItem setEditProxyConstructor(String editProxyConstructor)
      Default class used to construct the EditProxy for this component when the component is first placed into edit mode.
      Overrides:
      setEditProxyConstructor in class FormItem
      Parameters:
      editProxyConstructor - New editProxyConstructor value. Default value is "ToolbarItemEditProxy"
      Returns:
      ToolbarItem instance, for chaining setter calls
      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 FormItem
      Returns:
      Current editProxyConstructor value. Default value is "ToolbarItemEditProxy"
      See Also:
    • setEndRow

      public ToolbarItem setEndRow(Boolean endRow)
      these items are in a row by themselves by default
      Overrides:
      setEndRow in class FormItem
      Parameters:
      endRow - New endRow value. Default value is true
      Returns:
      ToolbarItem instance, for chaining setter calls
      See Also:
    • getEndRow

      public Boolean getEndRow()
      these items are in a row by themselves by default
      Overrides:
      getEndRow in class FormItem
      Returns:
      Current endRow value. Default value is true
      See Also:
    • setShowTitle

      public ToolbarItem setShowTitle(Boolean showTitle)
      Don't show a title for toolbars
      Overrides:
      setShowTitle in class FormItem
      Parameters:
      showTitle - New showTitle value. Default value is false
      Returns:
      ToolbarItem instance, for chaining setter calls
      See Also:
    • getShowTitle

      public Boolean getShowTitle()
      Don't show a title for toolbars
      Overrides:
      getShowTitle in class FormItem
      Returns:
      Current showTitle value. Default value is false
      See Also:
    • setStartRow

      public ToolbarItem setStartRow(Boolean startRow)
      these items are in a row by themselves by default
      Overrides:
      setStartRow in class FormItem
      Parameters:
      startRow - New startRow value. Default value is true
      Returns:
      ToolbarItem instance, for chaining setter calls
      See Also:
    • getStartRow

      public Boolean getStartRow()
      these items are in a row by themselves by default
      Overrides:
      getStartRow in class FormItem
      Returns:
      Current startRow value. Default value is true
      See Also:
    • setVertical

      public ToolbarItem setVertical(Boolean vertical)
      Should the toolbar stack its buttons vertically or horizontally?

      Note : This is an advanced setting

      Parameters:
      vertical - New vertical value. Default value is false
      Returns:
      ToolbarItem instance, for chaining setter calls
    • getVertical

      public Boolean getVertical()
      Should the toolbar stack its buttons vertically or horizontally?
      Returns:
      Current vertical value. Default value is false
    • setDefaultProperties

      public static void setDefaultProperties(ToolbarItem toolbarItemProperties)
      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 of the class instance passed to this function. 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:
      toolbarItemProperties - properties that should be used as new defaults when instances of this class are created
      See Also: