public class HorizontalPanel extends CellPanel implements HasAlignment, InsertPanel.ForIsWidget
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
HasHorizontalAlignment.AutoHorizontalAlignmentConstant, HasHorizontalAlignment.HorizontalAlignmentConstant
HasVerticalAlignment.VerticalAlignmentConstant
InsertPanel.ForIsWidget
HasWidgets.ForIsWidget
DEBUG_ID_PREFIX
ALIGN_CENTER, ALIGN_DEFAULT, ALIGN_JUSTIFY, ALIGN_LEFT, ALIGN_LOCALE_END, ALIGN_LOCALE_START, ALIGN_RIGHT
ALIGN_BOTTOM, ALIGN_MIDDLE, ALIGN_TOP
Constructor and Description |
---|
HorizontalPanel()
Creates an empty horizontal panel.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Widget w)
Adds a child widget.
|
HasHorizontalAlignment.HorizontalAlignmentConstant |
getHorizontalAlignment()
Gets the horizontal alignment.
|
HasVerticalAlignment.VerticalAlignmentConstant |
getVerticalAlignment()
Gets the vertical alignment.
|
void |
insert(IsWidget w,
int beforeIndex) |
void |
insert(Widget w,
int beforeIndex)
Inserts a child widget before the specified index.
|
protected void |
onEnsureDebugId(String baseID)
Affected Elements:
-# = the cell at the given index.
|
boolean |
remove(Widget w)
Removes a child widget.
|
void |
setHorizontalAlignment(HasHorizontalAlignment.HorizontalAlignmentConstant align)
Sets the default horizontal alignment to be used for widgets added to this
panel.
|
void |
setVerticalAlignment(HasVerticalAlignment.VerticalAlignmentConstant align)
Sets the default vertical alignment to be used for widgets added to this
panel.
|
getBody, getSpacing, getTable, setBorderWidth, setCellHeight, setCellHeight, setCellHorizontalAlignment, setCellHorizontalAlignment, setCellHorizontalAlignment, setCellHorizontalAlignment, setCellVerticalAlignment, setCellVerticalAlignment, setCellVerticalAlignment, setCellVerticalAlignment, setCellWidth, setCellWidth, setSpacing
add, add, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, getChildren, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, insert, insert, iterator, remove
add, adopt, clear, doAttachChildren, doDetachChildren, orphan, remove
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
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
add
getWidgetIndex
getWidget, getWidgetCount, getWidgetIndex, remove
public void add(Widget w)
Panel
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.
ComplexPanel.adjustIndex(Widget, int)
.Widget.removeFromParent()
on the
Widget.WidgetCollection
at the appropriate index.Panel.adopt(Widget)
to finalize the add as the
very last step.add
in interface HasWidgets
add
in interface InsertPanel
add
in class Panel
w
- the widget to be addedHasWidgets.add(Widget)
public HasHorizontalAlignment.HorizontalAlignmentConstant getHorizontalAlignment()
HasHorizontalAlignment
getHorizontalAlignment
in interface HasHorizontalAlignment
HasHorizontalAlignment.ALIGN_LEFT
,
HasHorizontalAlignment.ALIGN_CENTER
,
HasHorizontalAlignment.ALIGN_RIGHT
,
HasHorizontalAlignment.ALIGN_JUSTIFY
, or
null).public HasVerticalAlignment.VerticalAlignmentConstant getVerticalAlignment()
HasVerticalAlignment
getVerticalAlignment
in interface HasVerticalAlignment
public void insert(IsWidget w, int beforeIndex)
insert
in interface InsertPanel.ForIsWidget
public void insert(Widget w, int beforeIndex)
InsertPanel
insert
in interface InsertPanel
w
- the child widget to be insertedbeforeIndex
- the index before which it will be insertedpublic boolean remove(Widget w)
Panel
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.
false
if it is not.Panel.orphan(Widget)
first while the child
Widget is still attached.WidgetCollection
.remove
in interface HasWidgets
remove
in class ComplexPanel
w
- the widget to be removedtrue
if the child was presentpublic void setHorizontalAlignment(HasHorizontalAlignment.HorizontalAlignmentConstant align)
setHorizontalAlignment
in interface HasHorizontalAlignment
align
- the horizontal alignment (
HasHorizontalAlignment.ALIGN_LEFT
,
HasHorizontalAlignment.ALIGN_CENTER
,
HasHorizontalAlignment.ALIGN_RIGHT
,
HasHorizontalAlignment.ALIGN_JUSTIFY
,
HasHorizontalAlignment.ALIGN_LOCALE_START
, or
HasHorizontalAlignment.ALIGN_LOCALE_END
).HasHorizontalAlignment.setHorizontalAlignment(HasHorizontalAlignment.HorizontalAlignmentConstant)
public void setVerticalAlignment(HasVerticalAlignment.VerticalAlignmentConstant align)
setVerticalAlignment
in interface HasVerticalAlignment
align
- the vertical alignment (
HasVerticalAlignment.ALIGN_TOP
,
HasVerticalAlignment.ALIGN_MIDDLE
, or
HasVerticalAlignment.ALIGN_BOTTOM
).HasVerticalAlignment.setVerticalAlignment(HasVerticalAlignment.VerticalAlignmentConstant)
protected void onEnsureDebugId(String baseID)
onEnsureDebugId
in class UIObject
baseID
- the base ID used by the main elementUIObject.onEnsureDebugId(String)
Copyright © 2018. All rights reserved.