public class ScrolledForm extends SharedScrolledComposite
Children of the form should typically be created using FormToolkit to match the appearance and behaviour. When creating children, use a form body as a parent by calling 'getBody()' on the form instance. Example:
FormToolkit toolkit = new FormToolkit(parent.getDisplay()); ScrolledForm form = toolkit.createScrolledForm(parent); form.setText("Sample form"); form.getBody().setLayout(new GridLayout()); toolkit.createButton(form.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 is not expected to be be extended.
Constructor and Description |
---|
ScrolledForm(Composite parent) |
ScrolledForm(Composite parent,
int style)
Creates the form control as a child of the provided parent.
|
Modifier and Type | Method and Description |
---|---|
Image |
getBackgroundImage()
Returns the optional background image of this form.
|
Composite |
getBody()
Returns the container that occupies the body of the form (the form area
below the title).
|
Form |
getForm()
Returns the instance of the form owned by the scrolled form.
|
Image |
getImage()
Returns the title image that will be rendered to the left of the title.
|
String |
getMessage() |
IMessageManager |
getMessageManager()
Returns the message manager that will keep track of messages in this
form.
|
int |
getMessageType() |
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.
|
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 |
setBusy(boolean busy)
Sets the form's busy state.
|
void |
setContent(Control c)
The form sets the content widget.
|
void |
setForeground(Color fg)
Sets the foreground color of the form.
|
void |
setHeadClient(Control headClient)
Sets the optional head client.
|
void |
setImage(Image image)
Sets the image to be rendered to the left of the title.
|
void |
setMenu(Menu menu)
Passes the menu to the body.
|
void |
setMessage(String newMessage,
int newType)
Sets the form message.
|
void |
setMessage(String newMessage,
int newType,
IMessage[] messages)
Sets the form message.
|
void |
setText(String text)
Sets the text to be rendered at the top of the form above the body as a
title.
|
void |
updateToolBar()
Updates the local tool bar manager if used.
|
isDelayedReflow, layout, reflow, setDelayedReflow, setExpandHorizontal, setExpandVertical, setFocus, setFont
getAlwaysShowScrollBars, getContent, getExpandHorizontal, getExpandVertical, getMinHeight, getMinWidth, getOrigin, getShowFocusedControl, setAlwaysShowScrollBars, setLayout, setMinHeight, setMinSize, setMinSize, setMinWidth, setOrigin, setOrigin, setShowFocusedControl, showControl
changed, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, setBackgroundMode, setLayoutDeferred, setTabList
computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar
addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, computeSize, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, getTextDirection, getToolTipText, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, requestLayout, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setLayoutData, setLocation, setLocation, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
isAutoScalable
public ScrolledForm(Composite parent)
public ScrolledForm(Composite parent, int style)
parent
- the parent widgetpublic void setMenu(Menu menu)
public String getText()
public Image getImage()
public void setForeground(Color fg)
setForeground
in class SharedScrolledComposite
fg
- the new foreground colorpublic void setBackground(Color bg)
setBackground
in class SharedScrolledComposite
bg
- the new background colorpublic final void setContent(Control c)
setContent
in class SharedScrolledComposite
c
- the control to be displayed in the content areapublic void setText(String text)
Note: Mnemonics are indicated by an '&' that causes the next character to be the mnemonic. Mnemonics are not applicable in the case of the form title but need to be taken into account due to the usage of the underlying widget that renders mnemonics in the title area. The mnemonic indicator character '&' can be escaped by doubling it in the string, causing a single '&' to be displayed.
text
- the title textpublic void setImage(Image image)
image
- the title image or null
for no image.public Image getBackgroundImage()
getBackgroundImage
in class Control
public void setBackgroundImage(Image backgroundImage)
setBackgroundImage
in class Control
backgroundImage
- The backgroundImage to set.public IToolBarManager getToolBarManager()
public void updateToolBar()
public Composite getBody()
public Form getForm()
public void setBusy(boolean busy)
busy
- the form's busy stateForm.setBusy(boolean)
public void setHeadClient(Control headClient)
headClient
- the optional child of the headForm.setHeadClient(Control)
public void setMessage(String newMessage, int newType, IMessage[] messages)
newMessage
- the message text or null
to reset.newType
- as defined in
IMessageProvider
.messages
- an optional array of children that itemize individual
messages or null
for a simple message.Form.setMessage(String, int)
public void setMessage(String newMessage, int newType)
newMessage
- the message text or null
to reset.newType
- as defined in
IMessageProvider
.public String getMessage()
public int getMessageType()
public IMessageManager getMessageManager()
Copyright (c) 2000, 2018 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.