|
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.ViewForm
Instances of this class implement a Composite that lays out three children horizontally and allows programmatic control of layout and border parameters. ViewForm is used in the workbench to implement a view's label/menu/toolbar local bar.
Note that although this class is a subclass of Composite
,
it does not make sense to set a layout on it.
IMPORTANT: This class is not intended to be subclassed.
Field Summary | |
static RGB |
borderInsideRGB
Color of innermost line of drop shadow border. |
static RGB |
borderMiddleRGB
Color of middle line of drop shadow border. |
static RGB |
borderOutsideRGB
Color of outermost line of drop shadow border. |
int |
marginHeight
marginHeight specifies the number of pixels of vertical margin that will be placed along the top and bottom edges of the form. |
int |
marginWidth
marginWidth specifies the number of pixels of horizontal margin that will be placed along the left and right edges of the form. |
Fields inherited from class org.eclipse.swt.widgets.Control |
handle |
Constructor Summary | |
ViewForm(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. |
Rectangle |
computeTrim(int x,
int y,
int width,
int height)
Given a desired client area for the receiver (as described by the arguments), returns the bounding rectangle which would be required to produce that client area. |
Rectangle |
getClientArea()
Returns a rectangle which describes the area of the receiver which is capable of displaying data (that is, not covered by the "trimmings"). |
Control |
getContent()
Returns the content area. |
Control |
getTopCenter()
Returns Control that appears in the top center of the pane. |
Control |
getTopLeft()
Returns the Control that appears in the top left corner of the pane. |
Control |
getTopRight()
Returns the control in the top right corner of the pane. |
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 |
setBorderVisible(boolean show)
Specify whether the border should be displayed or not. |
void |
setContent(Control content)
Sets the content. |
void |
setFont(Font f)
Set the widget font. |
void |
setLayout(Layout layout)
Sets the layout which is associated with the receiver to be the argument which may be null. |
void |
setTopCenter(Control topCenter)
Set the control that appears in the top center of the pane. |
void |
setTopCenterSeparate(boolean show)
If true, the topCenter will always appear on a separate line by itself, otherwise the topCenter will appear in the top row if there is room and will be moved to the second row if required. |
void |
setTopLeft(Control c)
Set the control that appears in the top left corner of the pane. |
void |
setTopRight(Control c)
Set the control that appears in the top right corner of the pane. |
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 |
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 marginWidth
public int marginHeight
public static RGB borderInsideRGB
public static RGB borderMiddleRGB
public static RGB borderOutsideRGB
Constructor Detail |
public ViewForm(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.BORDER
,
SWT.FLAT
,
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 Rectangle computeTrim(int x, int y, int width, int height)
Scrollable
In other words, it returns a rectangle such that, if the receiver's bounds were set to that rectangle, the area of the receiver which is capable of displaying data (that is, not covered by the "trimmings") would be the rectangle described by the arguments (relative to the receiver's parent).
computeTrim
in class Scrollable
Scrollable.getClientArea()
public Rectangle getClientArea()
Scrollable
getClientArea
in class Scrollable
Scrollable.computeTrim(int, int, int, int)
public Control getContent()
public Control getTopCenter()
public Control getTopLeft()
public Control getTopRight()
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 setContent(Control content)
SWTException
- public void setFont(Font f)
setFont
in class Control
f
- the new font (or null)public void setLayout(Layout layout)
Note : ViewForm does not use a layout class to size and position its children.
setLayout
in class Composite
layout
- the receiver's new layout or null
SWTException
- public void setTopCenter(Control topCenter)
SWTException
- public void setTopLeft(Control c)
c
- the control to be displayed in the top left corner or null
SWTException
- public void setTopRight(Control c)
c
- the control to be displayed in the top right corner or null
SWTException
- public void setBorderVisible(boolean show)
show
- true if the border should be displayed
SWTException
- public void setTopCenterSeparate(boolean show)
show
- true if the topCenter will always appear on a separate line by itself
SWTException
-
|
Eclipse Platform 2.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |