|
org.eclipse.ui.forms.widgets
Class SharedScrolledComposite
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.ScrolledComposite
org.eclipse.ui.forms.widgets.SharedScrolledComposite
-
All Implemented Interfaces:
-
Drawable
-
Direct Known Subclasses:
-
ScrolledForm,
ScrolledFormText,
ScrolledPageBook
-
public abstract class SharedScrolledComposite
- extends
ScrolledComposite
This class is used to provide common scrolling services to a number of
controls in the toolkit. Classes that extend it are not required to implement
any method.
-
Since:
- 3.0
Fields inherited from class org.eclipse.swt.widgets.
Control
|
handle
|
Method Summary
|
boolean
|
isDelayedReflow
()
Tests if the control uses delayed reflow. |
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
|
reflow
(boolean flushCache)
Recomputes the body layout and the scroll bars. |
void
|
setBackground
(
Color bg)
Sets the background of the control and its content. |
void
|
setContent
(
Control content)
Overrides 'super' to pass the proper colors and font |
void
|
setDelayedReflow
(boolean delayedReflow)
Sets the delayed reflow feature. |
void
|
setExpandHorizontal
(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. |
void
|
setExpandVertical
(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. |
boolean
|
setFocus
()
If content is set, transfers focus to the content. |
void
|
setFont
(
Font font)
Sets the font of the form. |
void
|
setForeground
(
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,
showControl
|
Methods inherited from class org.eclipse.swt.widgets.
Composite
|
changed,
checkSubclass,
computeSize,
getBackgroundMode,
getChildren,
getLayout,
getLayoutDeferred,
getTabList,
isLayoutDeferred,
layout,
layout,
layout,
setBackgroundMode,
setLayoutDeferred,
setTabList
|
Methods inherited from class org.eclipse.swt.widgets.
Control
|
addControlListener,
addDragDetectListener,
addFocusListener,
addHelpListener,
addKeyListener,
addMenuDetectListener,
addMouseListener,
addMouseMoveListener,
addMouseTrackListener,
addMouseWheelListener,
addPaintListener,
addTraverseListener,
computeSize,
dragDetect,
dragDetect,
forceFocus,
getAccessible,
getBackground,
getBackgroundImage,
getBorderWidth,
getBounds,
getCursor,
getDragDetect,
getEnabled,
getFont,
getForeground,
getLayoutData,
getLocation,
getMenu,
getMonitor,
getParent,
getRegion,
getShell,
getSize,
getToolTipText,
getVisible,
internal_dispose_GC,
internal_new_GC,
isEnabled,
isFocusControl,
isReparentable,
isVisible,
moveAbove,
moveBelow,
pack,
pack,
print,
redraw,
redraw,
removeControlListener,
removeDragDetectListener,
removeFocusListener,
removeHelpListener,
removeKeyListener,
removeMenuDetectListener,
removeMouseListener,
removeMouseMoveListener,
removeMouseTrackListener,
removeMouseWheelListener,
removePaintListener,
removeTraverseListener,
setBackgroundImage,
setBounds,
setBounds,
setCapture,
setCursor,
setDragDetect,
setEnabled,
setLayoutData,
setLocation,
setLocation,
setMenu,
setParent,
setRedraw,
setRegion,
setSize,
setSize,
setToolTipText,
setVisible,
toControl,
toControl,
toDisplay,
toDisplay,
traverse,
update
|
Methods inherited from class org.eclipse.swt.widgets.
Widget
|
addDisposeListener,
addListener,
checkWidget,
dispose,
getData,
getData,
getDisplay,
getListeners,
getStyle,
isDisposed,
isListening,
notifyListeners,
removeDisposeListener,
removeListener,
removeListener,
setData,
setData,
toString
|
SharedScrolledComposite
public SharedScrolledComposite(
Composite parent,
int style)
- Creates the new instance.
-
Parameters:
-
parent - the parent composite -
style - the style to use
setForeground
public void setForeground(
Color fg)
- Sets the foreground of the control and its content.
-
-
Overrides:
-
setForeground
in class
Control
-
-
Parameters:
-
fg - the new foreground color
setBackground
public void setBackground(
Color bg)
- Sets the background of the control and its content.
-
-
Overrides:
-
setBackground
in class
Control
-
-
Parameters:
-
bg - the new background color
setFont
public void setFont(
Font font)
- Sets the font of the form. This font will be used to render the title
text. It will not affect the body.
-
-
Overrides:
-
setFont
in class
Control
-
-
Parameters:
-
font - the new font (or null)
setContent
public void setContent(
Control content)
- Overrides 'super' to pass the proper colors and font
-
-
Overrides:
-
setContent
in class
ScrolledComposite
-
-
Parameters:
-
content - the control to be displayed in the content area
setFocus
public boolean setFocus()
- If content is set, transfers focus to the content.
-
-
Overrides:
-
setFocus
in class
Composite
-
-
Returns:
-
true if the control got focus, and false if it was unable to. -
See Also:
-
Control.forceFocus()
layout
public void layout(boolean changed)
-
Description copied from class:
Composite
- If 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 is
true the layout must not rely
on any information it has cached about the immediate children. If it
is false the 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.
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.
-
-
Overrides:
-
layout
in class
Composite
-
-
Parameters:
-
changed - true if the layout must flush its caches, and false otherwise
setExpandHorizontal
public void setExpandHorizontal(boolean expand)
-
Description copied from class:
ScrolledComposite
- 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. 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:
-
setExpandHorizontal
in class
ScrolledComposite
-
-
Parameters:
-
expand - true to expand the content control to fill available horizontal space
setExpandVertical
public void setExpandVertical(boolean expand)
-
Description copied from class:
ScrolledComposite
- 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. 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:
-
setExpandVertical
in class
ScrolledComposite
-
-
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 - if true , drop the cached data
isDelayedReflow
public boolean isDelayedReflow()
- Tests if the control uses delayed reflow.
-
-
Returns:
-
true if reflow requests will
be delayed, false otherwise.
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.
Guidelines for using Eclipse APIs.
Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.
|
|