Class SharedScrolledComposite
- All Implemented Interfaces:
Drawable
- Direct Known Subclasses:
ScrolledForm,ScrolledFormText,ScrolledPageBook
- Since:
- 3.0
-
Field Summary
Fields inherited from class org.eclipse.swt.widgets.Widget
nativeZoom -
Constructor Summary
ConstructorsConstructorDescriptionSharedScrolledComposite(Composite parent, int style) Creates the new instance. -
Method Summary
Modifier and TypeMethodDescriptionbooleanTests if the control uses delayed reflow.voidlayout(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.voidreflow(boolean flushCache) Recomputes the body layout and the scroll bars.voidsetBackground(Color bg) Sets the background of the control and its content.voidsetContent(Control content) Overrides 'super' to pass the proper colors and fontvoidsetDelayedReflow(boolean delayedReflow) Sets the delayed reflow feature.voidsetExpandHorizontal(boolean expand) Configure the ScrolledComposite to resize the content object to be as wide as the ScrolledComposite when the width of the ScrolledComposite is greater than the minimum width specified in setMinWidth.voidsetExpandVertical(boolean expand) Configure the ScrolledComposite to resize the content object to be as tall as the ScrolledComposite when the height of the ScrolledComposite is greater than the minimum height specified in setMinHeight.booleansetFocus()If content is set, transfers focus to the content.voidSets the font of the form.voidsetForeground(Color fg) Sets the foreground of the control and its content.Methods 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, getBackgroundImage, 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, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setLayoutData, setLocation, setLocation, setMenu, 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
-
SharedScrolledComposite
Creates the new instance.- Parameters:
parent- the parent compositestyle- the style to use
-
-
Method Details
-
setForeground
Sets the foreground of the control and its content.- Overrides:
setForegroundin classControl- Parameters:
fg- the new foreground color
-
setBackground
Sets the background of the control and its content.- Overrides:
setBackgroundin classControl- Parameters:
bg- the new background color
-
setFont
Sets the font of the form. This font will be used to render the title text. It will not affect the body. -
setContent
Overrides 'super' to pass the proper colors and font- Overrides:
setContentin classScrolledComposite- Parameters:
content- the control to be displayed in the content area
-
setFocus
public boolean setFocus()If content is set, transfers focus to the content. -
layout
public void layout(boolean changed) Description copied from class:CompositeIf the receiver has a layout, asks the layout to lay out (that is, set the size and location of) the receiver's children. If the argument istruethe layout must not rely on any information it has cached about the immediate children. If it isfalsethe layout may (potentially) optimize the work it is doing by assuming that none of the receiver's children has changed state since the last layout. If the receiver does not have a layout, do nothing.It is normally more efficient to invoke
Control.requestLayout()on every control which has changed in the layout than it is to invoke this method on the layout itself. Clients are encouraged to useControl.requestLayout()where possible instead of calling this method.If a child is resized as a result of a call to layout, the resize event will invoke the layout of the child. The layout will cascade down through all child widgets in the receiver's widget tree until a child is encountered that does not resize. Note that a layout due to a resize will not flush any cached information (same as
layout(false)).Note: Layout is different from painting. If a child is moved or resized such that an area in the parent is exposed, then the parent will paint. If no child is affected, the parent will not paint.
-
setExpandHorizontal
public void setExpandHorizontal(boolean expand) Description copied from class:ScrolledCompositeConfigure the ScrolledComposite to resize the content object to be as wide as the ScrolledComposite when the width of the ScrolledComposite is greater than the minimum width specified in setMinWidth. If the ScrolledComposite is less than the minimum width, the content will not be resized and instead the horizontal scroll bar will be used to view the entire width. If expand is false, this behaviour is turned off. By default, this behaviour is turned off.- Overrides:
setExpandHorizontalin classScrolledComposite- Parameters:
expand- true to expand the content control to fill available horizontal space
-
setExpandVertical
public void setExpandVertical(boolean expand) Description copied from class:ScrolledCompositeConfigure the ScrolledComposite to resize the content object to be as tall as the ScrolledComposite when the height of the ScrolledComposite is greater than the minimum height specified in setMinHeight. If the ScrolledComposite is less than the minimum height, the content will not be resized and instead the vertical scroll bar will be used to view the entire height. If expand is false, this behaviour is turned off. By default, this behaviour is turned off.- Overrides:
setExpandVerticalin classScrolledComposite- Parameters:
expand- true to expand the content control to fill available vertical space
-
reflow
public void reflow(boolean flushCache) Recomputes the body layout and the scroll bars. The method should be used when changes somewhere in the form body invalidate the current layout and/or scroll bars.- Parameters:
flushCache- iftrue, drop the cached data
-
isDelayedReflow
public boolean isDelayedReflow()Tests if the control uses delayed reflow.- Returns:
trueif reflow requests will be delayed,falseotherwise.
-
setDelayedReflow
public void setDelayedReflow(boolean delayedReflow) Sets the delayed reflow feature. When used, it will schedule a reflow on resize requests and reject subsequent reflows until the scheduled one is performed.- Parameters:
delayedReflow- The delayedReflow to set.
-