com.sencha.gxt.widget.core.client
Class SplitBar

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.sencha.gxt.widget.core.client.Component
              extended by com.sencha.gxt.widget.core.client.SplitBar
All Implemented Interfaces:
HasClickHandlers, HasDoubleClickHandlers, HasAttachHandlers, HasResizeHandlers, HasHandlers, EventListener, HasVisibility, IsWidget, BeforeHideEvent.HasBeforeHideHandlers, BeforeShowContextMenuEvent.HasBeforeShowContextMenuHandler, BeforeShowEvent.HasBeforeShowHandlers, BlurEvent.HasBlurHandlers, DisableEvent.HasDisableHandlers, EnableEvent.HasEnableHandlers, FocusEvent.HasFocusHandlers, HideEvent.HasHideHandlers, MoveEvent.HasMoveHandlers, SelectEvent.HasSelectHandlers, ShowContextMenuEvent.HasShowContextMenuHandler, ShowEvent.HasShowHandlers, SplitBarDragEvent.HasSplitBarDragHandlers, HasFocusSupport, HasItemId

public class SplitBar
extends Component
implements HasClickHandlers, HasDoubleClickHandlers, SplitBarDragEvent.HasSplitBarDragHandlers, SelectEvent.HasSelectHandlers

Creates a draggable splitter on the side of a widget.


Nested Class Summary
static interface SplitBar.SplitBarAppearance
           
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
 
Field Summary
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
SplitBar(SplitBar.SplitBarAppearance appearance, Style.LayoutRegion region, Component resizeWidget)
          Creates a new split bar with the specified appearance
SplitBar(Style.LayoutRegion region, Component target)
          Creates a split for bar for the specified layout region and target.
SplitBar(Style.LayoutRegion style, Component resizeWidget, Component container)
          Creates a new split bar.
 
Method Summary
 HandlerRegistration addClickHandler(ClickHandler handler)
           
 HandlerRegistration addDoubleClickHandler(DoubleClickHandler handler)
           
 HandlerRegistration addSelectHandler(SelectEvent.SelectHandler handler)
          Adds a SelectEvent.SelectHandler handler for SelectEvent events.
 HandlerRegistration addSplitBarDragHandler(SplitBarDragEvent.SplitBarDragHandler handler)
          Adds a SplitBarDragEvent.SplitBarDragHandler handler for SplitBarDragEvent events.
 void disableDragging()
          Prevents the split bar from being dragged.
 SplitBar.SplitBarAppearance getAppearance()
          Returns the split bar appearance.
 int getBarWidth()
          Returns the bar width.
 Component getContainer()
          Returns the container widget.
 Draggable getDraggable()
          Returns the split bar's draggable instance.
 int getHandleWidth()
          Returns the handle width.
 int getMaxSize()
          Returns the maximum size.
 int getMinSize()
           
 Component getTargetWidget()
          Returns the resize widget.
 int getXOffset()
          Returns the x offset.
 int getYOffset()
          Returns the y offset.
 boolean isAutoSize()
          Returns the auto size state.
 boolean isCollapsible()
          Return true if the mini-collapse tool is enabled.
 void onBrowserEvent(Event event)
           
 void release()
          Removes the split bar from the resize widget.
 void setAutoSize(boolean autoSize)
          True to update the size of the the resize widget after a drag operation using a proxy (defaults to true).
 void setBarWidth(int barWidth)
          Sets the width of drag proxy during resizing (defaults to 2).
 void setCollapsible(boolean collapsible)
          True to show a mini-collapse tool in the split bar (defaults to false).
 void setHandleWidth(int handleWidth)
          Sets the width of the drag handles (defaults to 5).
 void setMaxSize(int maxSize)
          Sets the maximum size of the resize widget (defaults to 2000).
 void setMinSize(int minSize)
          Sets he minimum size of the resize widget (defaults to 10).
 void setXOffset(int x)
          The amount of pixels the bar should be offset to the left (defaults to 0).
 void setYOffset(int y)
          Sets the amount of pixels the bar should be offset to the top (defaults to 0).
 void sync()
          Updates the spitbar's bounds to match the target widget.
 void updateMini(Style.Direction direction)
          Sets the visual style indicating the direction of the mini collapse tool.
 
Methods inherited from class com.sencha.gxt.widget.core.client.Component
addBeforeHideHandler, addBeforeShowContextMenuHandler, addBeforeShowHandler, addBlurHandler, addDisableHandler, addEnableHandler, addFocusHandler, addHideHandler, addMoveHandler, addResizeHandler, addShowContextMenuHandler, addShowHandler, addStyleOnOver, clearSizeCache, disable, disableEvents, enable, enableEvents, fireEvent, focus, getData, getElement, getFocusSupport, getHideMode, getId, getItemId, getOffsetHeight, getOffsetWidth, getShadow, getStateId, getToolTip, hide, hideToolTip, isAllowTextSelection, isAutoHeight, isAutoWidth, isDeferHeight, isEnabled, isRendered, isStateful, isVisible, isVisible, mask, mask, removeToolTip, setAllowTextSelection, setBorders, setBounds, setBounds, setContextMenu, setData, setDeferHeight, setEnabled, setHeight, setHeight, setHideMode, setId, setItemId, setPagePosition, setPixelSize, setPosition, setShadow, setSize, setStateful, setStateId, setTabIndex, setToolTip, setToolTipConfig, setVisible, setWidth, setWidth, show, sync, syncSize, unmask
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, getLayoutData, getParent, isAttached, removeFromParent, setLayoutData, sinkEvents
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, removeStyleDependentName, removeStyleName, setStyleDependentName, setStyleName, setStyleName, setStylePrimaryName, setTitle, setVisible, sinkBitlessEvent, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 

Constructor Detail

SplitBar

public SplitBar(Style.LayoutRegion region,
                Component target)
Creates a split for bar for the specified layout region and target.

Parameters:
region - the layout region
target - the split bar container

SplitBar

public SplitBar(Style.LayoutRegion style,
                Component resizeWidget,
                Component container)
Creates a new split bar.

Parameters:
style - the bar location
resizeWidget - the widget being resized
container - the widget the split bar proxy will be sized to

SplitBar

public SplitBar(SplitBar.SplitBarAppearance appearance,
                Style.LayoutRegion region,
                Component resizeWidget)
Creates a new split bar with the specified appearance

Parameters:
appearance - the split bar appearance
region - the bar location
resizeWidget - the widget being resized
Method Detail

addClickHandler

public HandlerRegistration addClickHandler(ClickHandler handler)
Specified by:
addClickHandler in interface HasClickHandlers

addDoubleClickHandler

public HandlerRegistration addDoubleClickHandler(DoubleClickHandler handler)
Specified by:
addDoubleClickHandler in interface HasDoubleClickHandlers

addSelectHandler

public HandlerRegistration addSelectHandler(SelectEvent.SelectHandler handler)
Description copied from interface: SelectEvent.HasSelectHandlers
Adds a SelectEvent.SelectHandler handler for SelectEvent events.

Specified by:
addSelectHandler in interface SelectEvent.HasSelectHandlers
Parameters:
handler - the handler
Returns:
the registration for the event

addSplitBarDragHandler

public HandlerRegistration addSplitBarDragHandler(SplitBarDragEvent.SplitBarDragHandler handler)
Description copied from interface: SplitBarDragEvent.HasSplitBarDragHandlers
Adds a SplitBarDragEvent.SplitBarDragHandler handler for SplitBarDragEvent events.

Specified by:
addSplitBarDragHandler in interface SplitBarDragEvent.HasSplitBarDragHandlers
Parameters:
handler - the handler
Returns:
the registration for the event

disableDragging

public void disableDragging()
Prevents the split bar from being dragged.


getAppearance

public SplitBar.SplitBarAppearance getAppearance()
Returns the split bar appearance.

Returns:
the split bar appearance

getBarWidth

public int getBarWidth()
Returns the bar width.

Returns:
the bar width

getContainer

public Component getContainer()
Returns the container widget.

Returns:
the container widget

getDraggable

public Draggable getDraggable()
Returns the split bar's draggable instance.

Returns:
the draggable instance

getHandleWidth

public int getHandleWidth()
Returns the handle width.

Returns:
the handle width

getMaxSize

public int getMaxSize()
Returns the maximum size.

Returns:
the max size

getMinSize

public int getMinSize()
Returns:
the minSize

getTargetWidget

public Component getTargetWidget()
Returns the resize widget.

Returns:
the resize widget

getXOffset

public int getXOffset()
Returns the x offset.

Returns:
the x offset value

getYOffset

public int getYOffset()
Returns the y offset.

Returns:
the y offset

isAutoSize

public boolean isAutoSize()
Returns the auto size state.

Returns:
true if auto size is enabled

isCollapsible

public boolean isCollapsible()
Return true if the mini-collapse tool is enabled.

Returns:
true if mini-collapse enabled

onBrowserEvent

public void onBrowserEvent(Event event)
Specified by:
onBrowserEvent in interface EventListener
Overrides:
onBrowserEvent in class Component

release

public void release()
Removes the split bar from the resize widget.


setAutoSize

public void setAutoSize(boolean autoSize)
True to update the size of the the resize widget after a drag operation using a proxy (defaults to true).

Parameters:
autoSize - the auto size state

setBarWidth

public void setBarWidth(int barWidth)
Sets the width of drag proxy during resizing (defaults to 2).

Parameters:
barWidth - the bar width

setCollapsible

public void setCollapsible(boolean collapsible)
True to show a mini-collapse tool in the split bar (defaults to false). When clicked, the collapse event is fired.

Parameters:
collapsible - true to add the mini-collapse tool

setHandleWidth

public void setHandleWidth(int handleWidth)
Sets the width of the drag handles (defaults to 5).

Parameters:
handleWidth - the handle width

setMaxSize

public void setMaxSize(int maxSize)
Sets the maximum size of the resize widget (defaults to 2000).

Parameters:
maxSize - the maximum size

setMinSize

public void setMinSize(int minSize)
Sets he minimum size of the resize widget (defaults to 10).

Parameters:
minSize - the minimum size

setXOffset

public void setXOffset(int x)
The amount of pixels the bar should be offset to the left (defaults to 0).

Parameters:
x - the xOffset to set

setYOffset

public void setYOffset(int y)
Sets the amount of pixels the bar should be offset to the top (defaults to 0).

Parameters:
y - the yOffset to set

sync

public void sync()
Updates the spitbar's bounds to match the target widget.


updateMini

public void updateMini(Style.Direction direction)
Sets the visual style indicating the direction of the mini collapse tool.

Parameters:
direction - the collapse direction


Copyright © 2012. All Rights Reserved.