|
Eclipse Platform Release 3.2 |
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.Objectorg.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.Control
org.eclipse.swt.widgets.Scrollable
org.eclipse.swt.widgets.Composite
org.eclipse.ui.forms.widgets.OldForm
Form is a custom control that renders a title and an optional background
image above the body composite. It can be used alone when part of parents
that are scrolled. If scrolling is required, use ScrolledForm
instead because it has an instance of Form and adds scrolling
capability.
Form can have a title if set. If not set, title area will not be left empty - form body will be resized to fill the entire form. In addition, an optional title image can be set and is rendered to the left of the title.
Since 3.2, the form supports status messages. These messages can have various severity (error, warning, info or none). Message tray can be minimized and later restored by the user, but can only be closed programmatically.
Form can have a background image behind the title text. The image can be painted as-is, or tiled as many times as needed to fill the title area.
Form has a custom layout manager that is wrap-enabled. If a form is placed in a composite whose layout manager implements ILayoutExtension, the body of the worm will participate in wrapping as long as its layout manager implements ILayoutExtension as well.
Children of the form should typically be created using FormToolkit to match the appearance and behaviour. When creating children, use the form body as a parent by calling 'getBody()' on the form instance. Example:
FormToolkit toolkit = new FormToolkit(parent.getDisplay());
Form form = toolkit.createForm(parent);
formContent.setText("Sample form");
formContent.getBody().setLayout(new GridLayout());
toolkit.createButton(formContent.getBody(), "Checkbox", SWT.CHECK);
No layout manager has been set on the body. Clients are required to set the desired layout manager explicitly.
Although the class is not final, it should not be subclassed.
| Field Summary |
|---|
| Fields inherited from class org.eclipse.swt.widgets.Control |
|---|
handle |
| Constructor Summary | |
|---|---|
OldForm(Composite parent,
int style)
Creates the form content control as a child of the provided parent. |
|
| Method Summary | |
|---|---|
Point |
computeSize(int wHint,
int hHint,
boolean changed)
Fully delegates the size computation to the internal layout manager. |
Image |
getBackgroundImage()
Returns the optional background image of this form. |
int |
getBackgroundImageAlignment()
|
Composite |
getBody()
Returns the container that occupies the body of the form (the form area below the title). |
Image |
getImage()
Returns the title image that will be rendered to the left of the title. |
Color |
getSeparatorColor()
experimental - do not use yet TODO add javadoc |
String |
getText()
Returns the title text that will be rendered at the top of the form. |
IToolBarManager |
getToolBarManager()
Returns the tool bar manager that is used to manage tool items in the form's title area. |
boolean |
isBackgroundImageClipped()
|
boolean |
isBackgroundImageTiled()
TODO add javadoc |
boolean |
isBusy()
Tests if the form is in the 'busy' state. |
boolean |
isSeparatorVisible()
TODO add javadoc experimental - do not use yet |
void |
setBackground(Color bg)
Sets the background color of the form. |
void |
setBackgroundImage(Image backgroundImage)
Sets the optional background image to be rendered behind the title starting at the position 0,0. |
void |
setBackgroundImageAlignment(int backgroundImageAlignment)
|
void |
setBackgroundImageClipped(boolean backgroundImageClipped)
|
void |
setBackgroundImageTiled(boolean backgroundImageTiled)
TODO add javadoc |
void |
setBusy(boolean busy)
Sets the form's busy state. |
void |
setFont(Font font)
Sets the font of the header text. |
void |
setForeground(Color fg)
Sets the foreground color of the form. |
void |
setImage(Image image)
Sets the image to be rendered to the left of the title. |
void |
setLayout(Layout layout)
Prevents from changing the custom control layout. |
void |
setMenu(Menu menu)
Passes the menu to the form body. |
void |
setMessage(String message)
Sets the message for this form. |
void |
setMessage(String newMessage,
int newType)
Sets the message for this form with an indication of what type of message it is. |
void |
setSeparatorColor(Color separatorColor)
experimental - do not use yet TODO add javadoc |
void |
setSeparatorVisible(boolean addSeparator)
experimental - do not use yet TODO add javadoc |
void |
setText(String text)
Sets the text to be rendered at the top of the form above the body as a title. |
void |
setTextBackground(Color[] gradientColors,
int[] percents,
boolean vertical)
|
void |
updateToolBar()
Updates the local tool bar manager if used. |
| Methods inherited from class org.eclipse.swt.widgets.Composite |
|---|
changed, checkSubclass, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayoutDeferred, 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, getDisplay, getStyle, isDisposed, 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 |
| Constructor Detail |
public OldForm(Composite parent,
int style)
parent - the parent widget| Method Detail |
public void setMenu(Menu menu)
setMenu in class Controlmenu -
public final Point computeSize(int wHint,
int hHint,
boolean changed)
computeSize in class Compositepublic final void setLayout(Layout layout)
setLayout in class Compositelayout - the receiver's new layout or nullpublic String getText()
public Image getImage()
public void setForeground(Color fg)
setForeground in class Controlfg - the new color (or null)public void setBackground(Color bg)
setBackground in class Controlbg - the new color (or null)public void setFont(Font font)
setFont in class Controlfont - the new font (or null)public void setText(String text)
text - the title textpublic void setImage(Image image)
image - the title image or null to show no image.
public void setTextBackground(Color[] gradientColors,
int[] percents,
boolean vertical)
public Image getBackgroundImage()
getBackgroundImage in class Controlpublic void setBackgroundImage(Image backgroundImage)
setBackgroundImage in class ControlbackgroundImage - The backgroundImage to set.public IToolBarManager getToolBarManager()
public void updateToolBar()
public Composite getBody()
public boolean isBackgroundImageTiled()
public void setBackgroundImageTiled(boolean backgroundImageTiled)
backgroundImageTiled - The backgroundImageTiled to set.public int getBackgroundImageAlignment()
public void setBackgroundImageAlignment(int backgroundImageAlignment)
backgroundImageAlignment - The backgroundImageAlignment to set. TODO add javadocpublic boolean isBackgroundImageClipped()
public void setBackgroundImageClipped(boolean backgroundImageClipped)
backgroundImageClipped - The backgroundImageClipped to set.public boolean isSeparatorVisible()
true if the receiver is a visible separator,
false otherwisepublic void setSeparatorVisible(boolean addSeparator)
public Color getSeparatorColor()
public void setSeparatorColor(Color separatorColor)
public void setMessage(String message)
message - the message, or null to clear the message
public void setMessage(String newMessage,
int newType)
The valid message types are one of NONE,
INFORMATION,WARNING, or
ERROR.
newMessage - the message, or null to clear the messagenewType - the message typepublic boolean isBusy()
true if busy, false otherwise.public void setBusy(boolean busy)
busy - the form's busy state
|
Eclipse Platform Release 3.2 |
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2005. All rights reserved.