|
Eclipse Platform 2.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.eclipse.swt.widgets.Widget | +--org.eclipse.swt.widgets.Control | +--org.eclipse.swt.widgets.Scrollable | +--org.eclipse.swt.widgets.Composite | +--org.eclipse.swt.custom.SashForm
The SashForm lays out its children in a Row or Column arrangement (as specified by the orientation) and places a Sash between the children. One child may be maximized to occupy the entire size of the SashForm. The relative sizes of the children may be specfied using weights.
Field Summary | |
int |
SASH_WIDTH
|
Fields inherited from class org.eclipse.swt.widgets.Control |
handle |
Constructor Summary | |
SashForm(Composite parent,
int style)
Constructs a new instance of this class given its parent and a style value describing its behavior and appearance. |
Method Summary | |
Point |
computeSize(int wHint,
int hHint,
boolean changed)
Returns the preferred size of the receiver. |
Control |
getMaximizedControl()
Answer the control that currently is maximized in the SashForm. |
int |
getOrientation()
Returns SWT.HORIZONTAL if the controls in the SashForm are laid out side by side or SWT.VERTICAL if the controls in the SashForm are laid out top to bottom. |
int[] |
getWeights()
Answer the relative weight of each child in the SashForm. |
void |
layout(boolean changed)
If the receiver has a layout, asks the layout to lay out (that is, set the size and location of) the receiver's children. |
void |
setLayout(Layout layout)
Sets the layout which is associated with the receiver to be the argument which may be null. |
void |
setMaximizedControl(Control control)
Specify the control that should take up the entire client area of the SashForm. |
void |
setOrientation(int orientation)
If orientation is SWT.HORIZONTAL, lay the controls in the SashForm out side by side. |
void |
setWeights(int[] weights)
Specify the relative weight of each child in the SashForm. |
Methods inherited from class org.eclipse.swt.widgets.Composite |
checkSubclass, getChildren, getLayout, getTabList, layout, setFocus, setTabList |
Methods inherited from class org.eclipse.swt.widgets.Scrollable |
computeTrim, getClientArea, getHorizontalBar, getVerticalBar |
Methods inherited from class org.eclipse.swt.widgets.Widget |
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getStyle, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public int SASH_WIDTH
Constructor Detail |
public SashForm(Composite parent, int style)
The style value is either one of the style constants defined in
class SWT
which is applicable to instances of this
class, or must be built by bitwise OR'ing together
(that is, using the int
"|" operator) two or more
of those SWT
style constants. The class description
lists the style constants that are applicable to the class.
Style bits are also inherited from superclasses.
parent
- a widget which will be the parent of the new instance (cannot be null)style
- the style of widget to construct
IllegalArgumentException
- SWTException
- SWT.HORIZONTAL
,
SWT.VERTICAL
,
Widget.getStyle()
Method Detail |
public Point computeSize(int wHint, int hHint, boolean changed)
Control
The preferred size of a control is the size that it would
best be displayed at. The width hint and height hint arguments
allow the caller to ask a control questions such as "Given a particular
width, how high does the control need to be to show all of the contents?"
To indicate that the caller does not wish to constrain a particular
dimension, the constant SWT.DEFAULT
is passed for the hint.
If the changed flag is true
, it indicates that the receiver's
contents have changed, therefore any caches that a layout manager
containing the control may have been keeping need to be flushed. When the
control is resized, the changed flag will be false
, so layout
manager caches can be retained.
computeSize
in class Composite
wHint
- the width hint (can be SWT.DEFAULT
)hHint
- the height hint (can be SWT.DEFAULT
)changed
- true
if the control's contents have changed, and false
otherwise
Layout
,
Control.getBorderWidth()
,
Control.getBounds()
,
Control.getSize()
,
Control.pack()
,
"computeTrim, getClientArea for controls that implement them"public int getOrientation()
public Control getMaximizedControl()
public int[] getWeights()
SWTException
- public void layout(boolean changed)
Composite
true
the layout must not rely
on any cached information it is keeping about the children. If it
is false
the layout may (potentially) simplify the
work it is doing by assuming that the state of the none of the
receiver's children has changed since the last layout.
If the receiver does not have a layout, do nothing.
layout
in class Composite
changed
- true
if the layout must flush its caches, and false
otherwisepublic void setOrientation(int orientation)
orientation
- SWT.HORIZONTAL or SWT.VERTICAL
SWTException
- public void setLayout(Layout layout)
Composite
setLayout
in class Composite
layout
- the receiver's new layout or nullpublic void setMaximizedControl(Control control)
control
- the control to be maximized or null
SWTException
- public void setWeights(int[] weights)
weights
- the relative weight of each child
SWTException
-
|
Eclipse Platform 2.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |