public class SimpleDock extends StyledComposite
The first and the last widgets are packed (get just minimal needed space) against their side, the center gets the remaining size between.
EMPTY_ELEMENT_ARRAY
Constructor and Description |
---|
SimpleDock()
Creates a horizontal simple dock composite.
|
SimpleDock(boolean horizontal)
Creates a simple dock composite specifying its orientation.
|
Modifier and Type | Method and Description |
---|---|
Widget |
getCenter()
Gets the center widget of this composite.
|
Widget |
getFirst()
Gets the first widget of this composite.
|
Widget |
getLast()
Gets the last widget of this composite.
|
void |
remove(Widget widget)
Removes the specified widget from the list of children of this composite.
|
void |
removeAllWidgets()
Removes all the widgets from the list of children of this composite.
|
void |
removeCenter()
Removes the center widget of this simple dock.
|
void |
removeFirst()
Removes the first widget of this simple dock.
|
void |
removeLast()
Removes the last widget of this simple dock.
|
protected void |
setBoundsContent(Rectangle bounds)
Sets the bounds of this widget by taking into account the border, margin and padding specified in the style.
|
void |
setCenter(Widget widget)
Sets the center widget of this composite.
|
void |
setFirst(Widget widget)
Sets the first widget of this composite.
|
void |
setHorizontal(boolean horizontal)
Sets the composite orientation: horizontal or vertical.
|
void |
setLast(Widget widget)
Sets the last widget of this composite.
|
Rectangle |
validateContent(Style style,
Rectangle bounds)
Gets the content size of the renderable without the border, margin and padding specified in the style.
|
add, addClassSelector, contains, gainFocus, getAttribute, getChild, getChildrenCount, getChildrenElements, getParentElement, getStyle, hasClassSelector, isInState, isTransparent, lostFocus, mergeStyle, removeAllClassSelectors, removeClassSelector, removeInstanceStyle, render, renderContent, setBounds, setClassSelectors, setEnabled, updateStyle, updateStyleOnly, validate
getFocus, getFocusIndex, getNext, getWidget, getWidgetAt, getWidgets, getWidgetsCount, handleEvent, hideNotify, iterator, requestFocus, requestFocus, requestFocusFrom, showNotify
getAbsoluteX, getAbsoluteX, getAbsoluteY, getAbsoluteY, getEventHandler, getHeight, getPanel, getParent, getPreferredHeight, getPreferredWidth, getRelativeX, getRelativeY, getWidth, getX, getY, hasFocus, invalidate, isEnabled, isShown, isValid, isVisible, repaint, repaint, revalidate, revalidateSubTree, setEventHandler, setLocation, setPreferredSize, setSize, setVisible
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getEventHandler, getHeight, getWidth, getX, getY, handleEvent, hideNotify, isShown, repaint, repaint, setEventHandler, showNotify
public SimpleDock()
public SimpleDock(boolean horizontal)
horizontal
- true
to set the composite horizontal, false
to set the composite vertical.public void setHorizontal(boolean horizontal)
horizontal
- true
to set the composite horizontal, false
to set the composite vertical.public void setFirst(Widget widget)
widget
- the widget to add.java.lang.NullPointerException
- if the given widget is null
.java.lang.IllegalArgumentException
- if the given widget or one of its children is already connected to a panel.StyledComposite.add(Widget)
@Nullable public Widget getFirst()
public void setLast(Widget widget)
widget
- the widget to add.java.lang.NullPointerException
- if the given widget is null
.java.lang.IllegalArgumentException
- if the given widget or one of its children is already connected to a panel.StyledComposite.add(Widget)
@Nullable public Widget getLast()
public void setCenter(Widget widget)
widget
- the widget to add.java.lang.NullPointerException
- if the given widget is null
.java.lang.IllegalArgumentException
- if the given widget or one of its children is already connected to a panel.StyledComposite.add(Widget)
@Nullable public Widget getCenter()
public void remove(Widget widget)
Composite
If the composite is on a panel hierarchy, it is invalidated.
If the widget is not in the list of children of the composite, nothing is done.
remove
in class Composite
widget
- the widget to removeWidget.invalidate()
public void removeFirst()
remove(Widget)
public void removeLast()
remove(Widget)
public void removeCenter()
remove(Widget)
public void removeAllWidgets()
Composite
If the composite is on a panel hierarchy, it is invalidated.
removeAllWidgets
in class Composite
Widget.invalidate()
public Rectangle validateContent(Style style, Rectangle bounds)
StyledComposite
Lays out the children of this composite.
validateContent
in interface StyledRenderable
validateContent
in class StyledComposite
style
- the style to use.bounds
- the bounds available for the content. A width or a height equals to MWT.NONE
means no
constraint on this dimension.protected void setBoundsContent(Rectangle bounds)
StyledComposite
setBoundsContent
in class StyledComposite
bounds
- the bounds available for the content.