Class Splitbar

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
Direct Known Subclasses:
Snapbar

public class Splitbar extends StretchImg
Resize bar for use in Layouts, based on the StretchImg class. As with the ImgSplitbar class, widgets of this class can be displayed as a resize-bar for widgets in Layouts where showResizeBar is set to true. Provides a different appearance from the ImgSplitbar class.

To specify the resizeBar class for some layout, use the Layout.resizeBarClass property.

On mobile devices, you may find that you need to increase the breadth of the bar to make interacting with it easier (e.g. dragging or tapping). For Layout resize bars, this can be done by setting Layout.resizeBarSize.

See Also:
  • Constructor Details

    • Splitbar

      public Splitbar()
    • Splitbar

      public Splitbar(JavaScriptObject jsObj)
  • Method Details

    • getOrCreateRef

      public static Splitbar 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 StretchImg
    • setCanCollapse

      public Splitbar setCanCollapse(boolean canCollapse)
      If this property is true, a click on the Splitbar will collapse its target, hiding it and shifting the Splitbar and other members of the layout across to fill the newly available space. If the target is already hidden a click will expand it again (showing it at its normal size).

      Note that on touch devices, to enable collapsing/uncollapsing the target in response to a tap, canCollapseOnTap must be set to true.

      Parameters:
      canCollapse - New canCollapse value. Default value is true
      Returns:
      Splitbar instance, for chaining setter calls
    • getCanCollapse

      public boolean getCanCollapse()
      If this property is true, a click on the Splitbar will collapse its target, hiding it and shifting the Splitbar and other members of the layout across to fill the newly available space. If the target is already hidden a click will expand it again (showing it at its normal size).

      Note that on touch devices, to enable collapsing/uncollapsing the target in response to a tap, canCollapseOnTap must be set to true.

      Returns:
      Current canCollapse value. Default value is true
    • setCanCollapseOnTap

      public Splitbar setCanCollapseOnTap(boolean canCollapseOnTap)
      If canCollapse is true, should a tap result in collapsing/uncollapsing the target?
      Parameters:
      canCollapseOnTap - New canCollapseOnTap value. Default value is true
      Returns:
      Splitbar instance, for chaining setter calls
    • getCanCollapseOnTap

      public boolean getCanCollapseOnTap()
      If canCollapse is true, should a tap result in collapsing/uncollapsing the target?
      Returns:
      Current canCollapseOnTap value. Default value is true
    • setCanDrag

      public Splitbar setCanDrag(Boolean canDrag)
      canDrag set to true to allow dragging of the split bar. Dragging the Splitbar will resize it's target
      Overrides:
      setCanDrag in class Canvas
      Parameters:
      canDrag - New canDrag value. Default value is true
      Returns:
      Splitbar instance, for chaining setter calls
      See Also:
    • getCanDrag

      public Boolean getCanDrag()
      canDrag set to true to allow dragging of the split bar. Dragging the Splitbar will resize it's target
      Overrides:
      getCanDrag in class Canvas
      Returns:
      Current canDrag value. Default value is true
      See Also:
    • setCursor

      public Splitbar setCursor(Cursor cursor)
      Splitbars' cursors are set at init time based on whether they are to be used for vertical or horizontal resize. To customize the cursor for this class, modify vResizeCursor or hResizeCursor rather than this property.
      Overrides:
      setCursor in class Canvas
      Parameters:
      cursor - New cursor value. Default value is "hand"
      Returns:
      Splitbar instance, for chaining setter calls
      See Also:
    • getCursor

      public Cursor getCursor()
      Splitbars' cursors are set at init time based on whether they are to be used for vertical or horizontal resize. To customize the cursor for this class, modify vResizeCursor or hResizeCursor rather than this property.
      Overrides:
      getCursor in class Canvas
      Returns:
      Current cursor value. Default value is "hand"
      See Also:
    • setGripBreadth

      public Splitbar setGripBreadth(Integer gripBreadth) throws IllegalStateException
      Grip breadth in pixels (the short icon axis, parallel to the Layout direction).

      If unset, grip will assume the natural breadth of image.

      Parameters:
      gripBreadth - New gripBreadth value. Default value is null
      Returns:
      Splitbar instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getGripBreadth

      public Integer getGripBreadth()
      Grip breadth in pixels (the short icon axis, parallel to the Layout direction).

      If unset, grip will assume the natural breadth of image.

      Returns:
      Current gripBreadth value. Default value is null
    • setGripImgSuffix

      public Splitbar setGripImgSuffix(String gripImgSuffix) throws IllegalStateException
      Suffix used the 'grip' image if StretchImg.showGrip is true.

      Note : This is an advanced setting

      Overrides:
      setGripImgSuffix in class StretchImg
      Parameters:
      gripImgSuffix - New gripImgSuffix value. Default value is "grip"
      Returns:
      Splitbar instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getGripImgSuffix

      public String getGripImgSuffix()
      Suffix used the 'grip' image if StretchImg.showGrip is true.
      Overrides:
      getGripImgSuffix in class StretchImg
      Returns:
      Current gripImgSuffix value. Default value is "grip"
    • setGripLength

      public Splitbar setGripLength(Integer gripLength) throws IllegalStateException
      Grip length in pixels (the long icon axis, perpendicular to the Layout direction).

      If unset, grip will assume the natural length of image.

      Parameters:
      gripLength - New gripLength value. Default value is null
      Returns:
      Splitbar instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getGripLength

      public Integer getGripLength()
      Grip length in pixels (the long icon axis, perpendicular to the Layout direction).

      If unset, grip will assume the natural length of image.

      Returns:
      Current gripLength value. Default value is null
    • setHResizeCursor

      public Splitbar setHResizeCursor(Cursor hResizeCursor) throws IllegalStateException
      Cursor to display if this Splitbar is to be used for horizontal resize of widgets.
      Parameters:
      hResizeCursor - New hResizeCursor value. Default value is "col-resize"
      Returns:
      Splitbar instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getHResizeCursor

      public Cursor getHResizeCursor()
      Cursor to display if this Splitbar is to be used for horizontal resize of widgets.
      Returns:
      Current hResizeCursor value. Default value is "col-resize"
    • setHSrc

      public Splitbar setHSrc(String hSrc) throws IllegalStateException
      Base URL for the image if StretchImg.vertical is false and StretchImg.src is unset.
      Overrides:
      setHSrc in class StretchImg
      Parameters:
      hSrc - New hSrc value. Default value is null
      Returns:
      Splitbar instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getHSrc

      public String getHSrc()
      Base URL for the image if StretchImg.vertical is false and StretchImg.src is unset.
      Overrides:
      getHSrc in class StretchImg
      Returns:
      Current hSrc value. Default value is null
      See Also:
    • setInvertClosedGripIfTargetAfter

      public Splitbar setInvertClosedGripIfTargetAfter(boolean invertClosedGripIfTargetAfter)
      If showClosedGrip is true, and targetAfter is true should we show the "closed" state for the grip when the target is visible (rather than when it is hidden).

      This property is useful for the case where the grip media is a simple directional arrow. The same image can be used for expanded state on one side of the bar or collapsed state on the other.

      Note : This is an advanced setting

      Parameters:
      invertClosedGripIfTargetAfter - New invertClosedGripIfTargetAfter value. Default value is true
      Returns:
      Splitbar instance, for chaining setter calls
    • getInvertClosedGripIfTargetAfter

      public boolean getInvertClosedGripIfTargetAfter()
      If showClosedGrip is true, and targetAfter is true should we show the "closed" state for the grip when the target is visible (rather than when it is hidden).

      This property is useful for the case where the grip media is a simple directional arrow. The same image can be used for expanded state on one side of the bar or collapsed state on the other.

      Returns:
      Current invertClosedGripIfTargetAfter value. Default value is true
    • setShowClosedGrip

      public Splitbar setShowClosedGrip(Boolean showClosedGrip) throws IllegalStateException
      If showGrip is true, this property determines whether the grip image displayed should show the "Closed" state when the target is hidden. Note that if invertClosedGripIfTargetAfter is true, we may show the "closed" state when the target is visible, rather than when it is hidden.

      Note : This is an advanced setting

      Parameters:
      showClosedGrip - New showClosedGrip value. Default value is null
      Returns:
      Splitbar instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getShowClosedGrip

      public Boolean getShowClosedGrip()
      If showGrip is true, this property determines whether the grip image displayed should show the "Closed" state when the target is hidden. Note that if invertClosedGripIfTargetAfter is true, we may show the "closed" state when the target is visible, rather than when it is hidden.
      Returns:
      Current showClosedGrip value. Default value is null
    • setShowDownGrip

      public Splitbar setShowDownGrip(Boolean showDownGrip) throws IllegalStateException
      If StretchImg.showGrip is true, this property determines whether to show the 'Down' state on the grip image when the user mousedown's on this widget. Has no effect if StatefulCanvas.showDown is false.

      Note : This is an advanced setting

      Overrides:
      setShowDownGrip in class StretchImg
      Parameters:
      showDownGrip - New showDownGrip value. Default value is null
      Returns:
      Splitbar instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getShowDownGrip

      public Boolean getShowDownGrip()
      If StretchImg.showGrip is true, this property determines whether to show the 'Down' state on the grip image when the user mousedown's on this widget. Has no effect if StatefulCanvas.showDown is false.
      Overrides:
      getShowDownGrip in class StretchImg
      Returns:
      Current showDownGrip value. Default value is null
    • setShowGrip

      public Splitbar setShowGrip(Boolean showGrip) throws IllegalStateException
      Should we show a "grip" image floating above the center of this widget?

      Note : This is an advanced setting

      Overrides:
      setShowGrip in class StretchImg
      Parameters:
      showGrip - New showGrip value. Default value is null
      Returns:
      Splitbar instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getShowGrip

      public Boolean getShowGrip()
      Should we show a "grip" image floating above the center of this widget?
      Overrides:
      getShowGrip in class StretchImg
      Returns:
      Current showGrip value. Default value is null
    • setShowRollOverGrip

      public Splitbar setShowRollOverGrip(Boolean showRollOverGrip) throws IllegalStateException
      If StretchImg.showGrip is true, this property determines whether to show the 'Over' state on the grip image when the user rolls over on this widget. Has no effect if StatefulCanvas.showRollOver is false.

      Note : This is an advanced setting

      Overrides:
      setShowRollOverGrip in class StretchImg
      Parameters:
      showRollOverGrip - New showRollOverGrip value. Default value is null
      Returns:
      Splitbar instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getShowRollOverGrip

      public Boolean getShowRollOverGrip()
      If StretchImg.showGrip is true, this property determines whether to show the 'Over' state on the grip image when the user rolls over on this widget. Has no effect if StatefulCanvas.showRollOver is false.
      Overrides:
      getShowRollOverGrip in class StretchImg
      Returns:
      Current showRollOverGrip value. Default value is null
    • setSrc

      public Splitbar setSrc(String src) throws IllegalStateException
      The base URL for the image.

      The State for the component will be combined with this URL using the same approach as described in Img.src. Then the image segment name as specified by each StretchItem is added.

      For example, for a stretchImg in "Over" state with a src of "button.png" and a segment name of "stretch", the resulting URL would be "button_Over_stretch.png".

      Overrides:
      setSrc in class StretchImg
      Parameters:
      src - New src value. Default value is null
      Returns:
      Splitbar instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getSrc

      public String getSrc()
      The base URL for the image.

      The State for the component will be combined with this URL using the same approach as described in Img.src. Then the image segment name as specified by each StretchItem is added.

      For example, for a stretchImg in "Over" state with a src of "button.png" and a segment name of "stretch", the resulting URL would be "button_Over_stretch.png".

      Overrides:
      getSrc in class StretchImg
      Returns:
      Current src value. Default value is null
      See Also:
    • getTarget

      public Canvas getTarget() throws IllegalStateException
      When a Splitbar is created by a layout, the target property of the Splitbar will be a pointer to the member for which it is acting as a resizeBar. The Splitbar will be positioned next to its target, and will resize it on drag completion.

      See Layout.resizeBarClass, Canvas.showResizeBar and Canvas.resizeBarTarget for details on configuring the resize bars shown in Layouts.

      Note : This method should be called only after the widget has been rendered.

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

      public Splitbar setTargetAfter(Boolean targetAfter)
      Is the target being shown before or after the bar? This property is automatically populated for splitbars created by a layout.

      Note : This is an advanced setting

      Parameters:
      targetAfter - New targetAfter value. Default value is null
      Returns:
      Splitbar instance, for chaining setter calls
      See Also:
    • getTargetAfter

      public Boolean getTargetAfter()
      Is the target being shown before or after the bar? This property is automatically populated for splitbars created by a layout.
      Returns:
      Current targetAfter value. Default value is null
      See Also:
    • getVertical

      public Boolean getVertical() throws IllegalStateException
      Is this split bar vertically orientated?
      When a Splitbar is created by a layout to be the resizeBar for some member of the layout, the vertical property will be set to true if the layout is horizontal, meaning this resizeBar will be taller than it is wide, and will allow horizontal resizing of the member.

      Note : This method should be called only after the widget has been rendered.

      Overrides:
      getVertical in class StretchImg
      Returns:
      Current vertical value. Default value is null
      Throws:
      IllegalStateException - if this widget has not yet been rendered.
      See Also:
    • setVResizeCursor

      public Splitbar setVResizeCursor(Cursor vResizeCursor) throws IllegalStateException
      Cursor to display if this Splitbar is to be used for vertical resize of widgets.
      Parameters:
      vResizeCursor - New vResizeCursor value. Default value is "row-resize"
      Returns:
      Splitbar instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getVResizeCursor

      public Cursor getVResizeCursor()
      Cursor to display if this Splitbar is to be used for vertical resize of widgets.
      Returns:
      Current vResizeCursor value. Default value is "row-resize"
    • setVSrc

      public Splitbar setVSrc(String vSrc) throws IllegalStateException
      Base URL for the image if StretchImg.vertical is true and StretchImg.src is unset.
      Overrides:
      setVSrc in class StretchImg
      Parameters:
      vSrc - New vSrc value. Default value is null
      Returns:
      Splitbar instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getVSrc

      public String getVSrc()
      Base URL for the image if StretchImg.vertical is true and StretchImg.src is unset.
      Overrides:
      getVSrc in class StretchImg
      Returns:
      Current vSrc value. Default value is null
      See Also:
    • setDefaultProperties

      public static void setDefaultProperties(Splitbar splitbarProperties)
      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:
      splitbarProperties - properties that should be used as new defaults when instances of this class are created
      See Also:
    • setLogicalStructure

      public LogicalStructureObject setLogicalStructure(SplitbarLogicalStructure 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 StretchImg