Class ScrolledForm
- All Implemented Interfaces:
Drawable
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.
- Since:
- 3.0
- Restriction:
- This class is not intended to be subclassed by clients.
-
Field Summary
Fields inherited from class org.eclipse.swt.widgets.Widget
nativeZoom -
Constructor Summary
ConstructorsConstructorDescriptionScrolledForm(Composite parent) ScrolledForm(Composite parent, int style) Creates the form control as a child of the provided parent. -
Method Summary
Modifier and TypeMethodDescriptionReturns the optional background image of this form.getBody()Returns the container that occupies the body of the form (the form area below the title).getForm()Returns the instance of the form owned by the scrolled form.getImage()Returns the title image that will be rendered to the left of the title.Returns the message manager that will keep track of messages in this form.intgetText()Returns the title text that will be rendered at the top of the form.Returns the tool bar manager that is used to manage tool items in the form's title area.voidsetBackground(Color bg) Sets the background color of the form.voidsetBackgroundImage(Image backgroundImage) Sets the optional background image to be rendered behind the title starting at the position 0,0.voidsetBusy(boolean busy) Sets the form's busy state.final voidThe form sets the content widget.voidsetForeground(Color fg) Sets the foreground color of the form.voidsetHeadClient(Control headClient) Sets the optional head client.voidSets the image to be rendered to the left of the title.voidPasses the menu to the body.voidsetMessage(String newMessage, int newType) Sets the form message.voidsetMessage(String newMessage, int newType, IMessage[] messages) Sets the form message.voidSets the text to be rendered at the top of the form above the body as a title.voidUpdates the local tool bar manager if used.Methods inherited from class org.eclipse.ui.forms.widgets.SharedScrolledComposite
isDelayedReflow, layout, reflow, setDelayedReflow, setExpandHorizontal, setExpandVertical, setFocus, setFontMethods inherited from class org.eclipse.swt.custom.ScrolledComposite
getAlwaysShowScrollBars, getContent, getExpandHorizontal, getExpandVertical, getMinHeight, getMinWidth, getOrigin, getShowFocusedControl, setAlwaysShowScrollBars, setLayout, setMinHeight, setMinSize, setMinSize, setMinWidth, setOrigin, setOrigin, setShowFocusedControl, showControlMethods inherited from class org.eclipse.swt.widgets.Composite
changed, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, setBackgroundMode, setLayoutDeferred, setTabList, toStringMethods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar, setScrollbarsModeMethods inherited from class org.eclipse.swt.widgets.Control
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, updateMethods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, addTypedListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, getTypedListeners, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, removeListener, removeTypedListener, reskin, setData, setDataMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.swt.graphics.Drawable
isAutoScalable
-
Constructor Details
-
ScrolledForm
-
ScrolledForm
Creates the form control as a child of the provided parent.- Parameters:
parent- the parent widget
-
-
Method Details
-
setMenu
Passes the menu to the body. -
getText
Returns the title text that will be rendered at the top of the form.- Returns:
- the title text
-
getImage
Returns the title image that will be rendered to the left of the title.- Returns:
- the title image
-
setForeground
Sets the foreground color of the form. This color will also be used for the body.- Overrides:
setForegroundin classSharedScrolledComposite- Parameters:
fg- the new foreground color
-
setBackground
Sets the background color of the form. This color will also be used for the body.- Overrides:
setBackgroundin classSharedScrolledComposite- Parameters:
bg- the new background color
-
setContent
The form sets the content widget. This method should not be called by classes that instantiate this widget.- Overrides:
setContentin classSharedScrolledComposite- Parameters:
c- the control to be displayed in the content area
-
setText
Sets the text to be rendered at the top of the form above the body as a title.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.
- Parameters:
text- the title text
-
setImage
Sets the image to be rendered to the left of the title.- Parameters:
image- the title image ornullfor no image.
-
getBackgroundImage
Returns the optional background image of this form. The image is rendered starting at the position 0,0 and is painted behind the title.- Overrides:
getBackgroundImagein classControl- Returns:
- Returns the background image.
-
setBackgroundImage
Sets the optional background image to be rendered behind the title starting at the position 0,0.- Overrides:
setBackgroundImagein classControl- Parameters:
backgroundImage- The backgroundImage to set.
-
getToolBarManager
Returns the tool bar manager that is used to manage tool items in the form's title area.- Returns:
- form tool bar manager
-
updateToolBar
public void updateToolBar()Updates the local tool bar manager if used. Does nothing if local tool bar manager has not been created yet. -
getBody
Returns the container that occupies the body of the form (the form area below the title). Use this container as a parent for the controls that should be in the form. No layout manager has been set on the form body.- Returns:
- Returns the body of the form.
-
getForm
Returns the instance of the form owned by the scrolled form.- Returns:
- the form instance
-
setBusy
public void setBusy(boolean busy) Sets the form's busy state. Busy form will display 'busy' animation in the area of the title image.- Parameters:
busy- the form's busy state- Since:
- 3.3
- See Also:
-
setHeadClient
Sets the optional head client.- Parameters:
headClient- the optional child of the head- Since:
- 3.3
- See Also:
-
setMessage
Sets the form message.- Parameters:
newMessage- the message text ornullto reset.newType- as defined inIMessageProvider.messages- an optional array of children that itemize individual messages ornullfor a simple message.- Since:
- 3.3
- See Also:
-
setMessage
Sets the form message.- Parameters:
newMessage- the message text ornullto reset.newType- as defined inIMessageProvider.- Since:
- 3.3
-
getMessage
-
getMessageType
public int getMessageType() -
getMessageManager
Returns the message manager that will keep track of messages in this form.- Returns:
- the message manager instance
- Since:
- org.eclipse.ui.forms 3.4
-