Package com.google.gwt.user.client.ui
Class SplitPanel
- java.lang.Object
-
- com.google.gwt.user.client.ui.UIObject
-
- com.google.gwt.user.client.ui.Widget
-
- com.google.gwt.user.client.ui.Panel
-
- com.google.gwt.user.client.ui.SplitPanel
-
- All Implemented Interfaces:
HasAttachHandlers
,HasHandlers
,EventListener
,HasVisibility
,HasWidgets
,HasWidgets.ForIsWidget
,IsWidget
,java.lang.Iterable<Widget>
- Direct Known Subclasses:
HorizontalSplitPanel
,VerticalSplitPanel
@Deprecated abstract class SplitPanel extends Panel
Deprecated.UseSplitLayoutPanel
instead, but understand that it is not a drop in replacement for this class. It requires standards mode, and is most easily used under aRootLayoutPanel
(as opposed to aRootPanel
Abstract base class forHorizontalSplitPanel
andVerticalSplitPanel
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
-
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasWidgets
HasWidgets.ForIsWidget
-
-
Field Summary
-
Fields inherited from class com.google.gwt.user.client.ui.Widget
eventsToSink
-
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX, MISSING_ELEMENT_ERROR, SETELEMENT_TWICE_ERROR
-
-
Constructor Summary
Constructors Constructor Description SplitPanel(Element mainElem, Element splitElem, Element headElem, Element tailElem)
Deprecated.Initializes the split panel.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
add(Widget w)
Deprecated.Adds a child widget.(package private) static void
addAbsolutePositoning(Element elem)
Deprecated.Sets an elements positioning to absolute.(package private) static void
addClipping(Element elem)
Deprecated.Adds clipping to an element.(package private) static void
addScrolling(Element elem)
Deprecated.Adds as-needed scrolling to an element.(package private) static void
expandToFitParentUsingCssOffsets(Element elem)
Deprecated.Sizes and element to consume the full area of its parent using the CSS properties left, right, top, and bottom.(package private) static void
expandToFitParentUsingPercentages(Element elem)
Deprecated.Sizes an element to consume the full areas of its parent using 100% width and height.protected Element
getElement(int index)
Deprecated.Gets the content element for the given index.(package private) static int
getOffsetHeight(Element elem)
Deprecated.Returns the offsetHeight element property.(package private) static int
getOffsetWidth(Element elem)
Deprecated.Returns the offsetWidth element property.protected Element
getSplitElement()
Deprecated.Gets the element that is acting as the splitter.protected Widget
getWidget(int index)
Deprecated.Gets one of the contained widgets.boolean
isResizing()
Deprecated.Indicates whether the split panel is being resized.java.util.Iterator<Widget>
iterator()
Deprecated.Gets an iterator for the contained widgets.void
onBrowserEvent(Event event)
Deprecated.Fired whenever a browser event is received.protected void
onEnsureDebugId(java.lang.String baseID)
Deprecated.Affected Elements: -splitter = the container containing the splitter element.(package private) abstract void
onSplitterResize(int x, int y)
Deprecated.Called on each mouse drag event as the user is dragging the splitter.(package private) abstract void
onSplitterResizeStarted(int x, int y)
Deprecated.Called when the user starts dragging the splitter.(package private) static Element
preventBoxStyles(Element elem)
Deprecated.Adds zero or none CSS values for padding, margin and border to prevent stylesheet overrides.boolean
remove(Widget widget)
Deprecated.Removes a child widget.(package private) static void
setBottom(Element elem, java.lang.String size)
Deprecated.Convenience method to set bottom offset of an element.(package private) static void
setClassname(Element elem, java.lang.String className)
Deprecated.Sets the elements css class name.(package private) static void
setHeight(Element elem, java.lang.String height)
Deprecated.Convenience method to set the height of an element.(package private) static void
setLeft(Element elem, java.lang.String left)
Deprecated.Convenience method to set the left offset of an element.(package private) static void
setRight(Element elem, java.lang.String right)
Deprecated.Convenience method to set the right offset of an element.abstract void
setSplitPosition(java.lang.String size)
Deprecated.Moves the position of the splitter.(package private) static void
setTop(Element elem, java.lang.String top)
Deprecated.Convenience method to set the top offset of an element.protected void
setWidget(int index, Widget w)
Deprecated.Sets one of the contained widgets.(package private) static void
setWidth(Element elem, java.lang.String width)
Deprecated.Convenience method to set the width of an element.-
Methods inherited from class com.google.gwt.user.client.ui.Panel
add, adopt, clear, doAttachChildren, doDetachChildren, orphan, remove
-
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, ensureHandlers, fireEvent, getHandlerCount, getHandlerManager, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onDetach, onLoad, onUnload, removeFromParent, replaceElement, setLayoutData, setParent, sinkEvents, unsinkEvents
-
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString
-
-
-
-
Constructor Detail
-
SplitPanel
SplitPanel(Element mainElem, Element splitElem, Element headElem, Element tailElem)
Deprecated.Initializes the split panel.- Parameters:
mainElem
- the root element for the split panelsplitElem
- the element that acts as the splitterheadElem
- the element to contain the top or left most widgettailElem
- the element to contain the bottom or right most widget
-
-
Method Detail
-
addAbsolutePositoning
static void addAbsolutePositoning(Element elem)
Deprecated.Sets an elements positioning to absolute.- Parameters:
elem
- the element
-
addClipping
static final void addClipping(Element elem)
Deprecated.Adds clipping to an element.- Parameters:
elem
- the element
-
addScrolling
static final void addScrolling(Element elem)
Deprecated.Adds as-needed scrolling to an element.- Parameters:
elem
- the element
-
expandToFitParentUsingCssOffsets
static final void expandToFitParentUsingCssOffsets(Element elem)
Deprecated.Sizes and element to consume the full area of its parent using the CSS properties left, right, top, and bottom. This method is used for all browsers except IE6/7.- Parameters:
elem
- the element
-
expandToFitParentUsingPercentages
static final void expandToFitParentUsingPercentages(Element elem)
Deprecated.Sizes an element to consume the full areas of its parent using 100% width and height. This method is used on IE6/7 where CSS offsets don't work reliably.- Parameters:
elem
- the element
-
getOffsetHeight
static final int getOffsetHeight(Element elem)
Deprecated.Returns the offsetHeight element property.- Parameters:
elem
- the element- Returns:
- the offsetHeight property
-
getOffsetWidth
static final int getOffsetWidth(Element elem)
Deprecated.Returns the offsetWidth element property.- Parameters:
elem
- the element- Returns:
- the offsetWidth property
-
preventBoxStyles
static final Element preventBoxStyles(Element elem)
Deprecated.Adds zero or none CSS values for padding, margin and border to prevent stylesheet overrides. Returns the element for convenience to support builder pattern.- Parameters:
elem
- the element- Returns:
- the element
-
setBottom
static void setBottom(Element elem, java.lang.String size)
Deprecated.Convenience method to set bottom offset of an element.- Parameters:
elem
- the elementsize
- a CSS length value for bottom
-
setClassname
static final void setClassname(Element elem, java.lang.String className)
Deprecated.Sets the elements css class name.- Parameters:
elem
- the elementclassName
- the class name
-
setHeight
static final void setHeight(Element elem, java.lang.String height)
Deprecated.Convenience method to set the height of an element.- Parameters:
elem
- the elementheight
- a CSS length value for the height
-
setLeft
static final void setLeft(Element elem, java.lang.String left)
Deprecated.Convenience method to set the left offset of an element.- Parameters:
elem
- the elementleft
- a CSS length value for left
-
setRight
static final void setRight(Element elem, java.lang.String right)
Deprecated.Convenience method to set the right offset of an element.- Parameters:
elem
- the elementright
- a CSS length value for right
-
setTop
static final void setTop(Element elem, java.lang.String top)
Deprecated.Convenience method to set the top offset of an element.- Parameters:
elem
- the elementtop
- a CSS length value for top
-
setWidth
static final void setWidth(Element elem, java.lang.String width)
Deprecated.Convenience method to set the width of an element.- Parameters:
elem
- the elementwidth
- a CSS length value for the width
-
add
public void add(Widget w)
Deprecated.Description copied from class:Panel
Adds a child widget.How to Override this Method
There are several important things that must take place in the correct order to properly add or insert a Widget to a Panel. Not all of these steps will be relevant to every Panel, but all of the steps must be considered.
- Validate: Perform any sanity checks to ensure the Panel can accept a new Widget. Examples: checking for a valid index on insertion; checking that the Panel is not full if there is a max capacity.
- Adjust for Reinsertion: Some Panels need to handle the case
where the Widget is already a child of this Panel. Example: when performing
a reinsert, the index might need to be adjusted to account for the Widget's
removal. See
ComplexPanel.adjustIndex(Widget, int)
. - Detach Child: Remove the Widget from its existing parent, if
any. Most Panels will simply call
Widget.removeFromParent()
on the Widget. - Logical Attach: Any state variables of the Panel should be
updated to reflect the addition of the new Widget. Example: the Widget is
added to the Panel's
WidgetCollection
at the appropriate index. - Physical Attach: The Widget's Element must be physically attached to the Panel's Element, either directly or indirectly.
- Adopt: Call
Panel.adopt(Widget)
to finalize the add as the very last step.
- Specified by:
add
in interfaceHasWidgets
- Overrides:
add
in classPanel
- Parameters:
w
- the widget to be added- See Also:
HasWidgets.add(Widget)
-
isResizing
public boolean isResizing()
Deprecated.Indicates whether the split panel is being resized.- Returns:
true
if the user is dragging the splitter,false
otherwise
-
iterator
public java.util.Iterator<Widget> iterator()
Deprecated.Description copied from interface:HasWidgets
Gets an iterator for the contained widgets. This iterator is required to implementIterator.remove()
.
-
onBrowserEvent
public void onBrowserEvent(Event event)
Deprecated.Description copied from interface:EventListener
Fired whenever a browser event is received.- Specified by:
onBrowserEvent
in interfaceEventListener
- Overrides:
onBrowserEvent
in classWidget
- Parameters:
event
- the event received
-
remove
public boolean remove(Widget widget)
Deprecated.Description copied from class:Panel
Removes a child widget.How to Override this Method
There are several important things that must take place in the correct order to properly remove a Widget from a Panel. Not all of these steps will be relevant to every Panel, but all of the steps must be considered.
- Validate: Make sure this Panel is actually the parent of the
child Widget; return
false
if it is not. - Orphan: Call
Panel.orphan(Widget)
first while the child Widget is still attached. - Physical Detach: Adjust the DOM to account for the removal of the child Widget. The Widget's Element must be physically removed from the DOM.
- Logical Detach: Update the Panel's state variables to reflect
the removal of the child Widget. Example: the Widget is removed from the
Panel's
WidgetCollection
.
- Specified by:
remove
in interfaceHasWidgets
- Specified by:
remove
in classPanel
- Parameters:
widget
- the widget to be removed- Returns:
true
if the child was present
- Validate: Make sure this Panel is actually the parent of the
child Widget; return
-
setSplitPosition
public abstract void setSplitPosition(java.lang.String size)
Deprecated.Moves the position of the splitter.- Parameters:
size
- the new size of the left region in CSS units (e.g. "10px", "1em")
-
getElement
protected Element getElement(int index)
Deprecated.Gets the content element for the given index.- Parameters:
index
- the index of the element, only 0 and 1 are valid.- Returns:
- the element
-
getSplitElement
protected Element getSplitElement()
Deprecated.Gets the element that is acting as the splitter.- Returns:
- the element
-
getWidget
protected Widget getWidget(int index)
Deprecated.Gets one of the contained widgets.- Parameters:
index
- the index of the widget, only 0 and 1 are valid.- Returns:
- the widget
-
onEnsureDebugId
protected void onEnsureDebugId(java.lang.String baseID)
Deprecated.Affected Elements:- -splitter = the container containing the splitter element.
- Overrides:
onEnsureDebugId
in classUIObject
- Parameters:
baseID
- the base ID used by the main element- See Also:
UIObject.onEnsureDebugId(String)
-
setWidget
protected final void setWidget(int index, Widget w)
Deprecated.Sets one of the contained widgets.- Parameters:
index
- the index, only 0 and 1 are validw
- the widget
-
onSplitterResize
abstract void onSplitterResize(int x, int y)
Deprecated.Called on each mouse drag event as the user is dragging the splitter.- Parameters:
x
- the x coordinate of the mouse relative to the panel's extenty
- the y coordinate of the mosue relative to the panel's extent
-
onSplitterResizeStarted
abstract void onSplitterResizeStarted(int x, int y)
Deprecated.Called when the user starts dragging the splitter.- Parameters:
x
- the x coordinate of the mouse relative to the panel's extenty
- the y coordinate of the mouse relative to the panel's extent
-
-