Package org.eclipse.ui.forms.widgets
Class ScrolledPageBook
- All Implemented Interfaces:
Drawable
ScrolledPageBook is a class that is capable of stacking several composites
(pages), while showing one at a time. The content is scrolled if there is
not enough space to fit it in the client area.
- Since:
- 3.0
-
Field Summary
-
Constructor Summary
ConstructorDescriptionScrolledPageBook
(Composite parent) Creates a new instance in the provided parentScrolledPageBook
(Composite parent, int style) Creates a new instance in the provided parent and with the provided style. -
Method Summary
Modifier and TypeMethodDescriptioncomputeSize
(int wHint, int hHint, boolean changed) Removes the default size of the composite, allowing the control to shrink to the trim.createPage
(Object key) Creates a new page for the provided key.Returns the page book container.Returns the page currently showing.boolean
Tests if the page under the provided key is currently in the book.void
registerPage
(Object key, Control page) Registers a page under the privided key to be managed by the page book.void
removePage
(Object key) Removes the page under the provided key from the page book.void
removePage
(Object key, boolean showEmptyPage) Removes the page under the provided key from the page book.boolean
setFocus()
Sets focus on the current page if shown.void
Shows a page with no children to be used if the desire is to not show any registered page.void
Shows the page with the provided key and hides the page previously showing.Methods inherited from class org.eclipse.ui.forms.widgets.SharedScrolledComposite
isDelayedReflow, layout, reflow, setBackground, setContent, setDelayedReflow, setExpandHorizontal, setExpandVertical, setFont, setForeground
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, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, setBackgroundMode, setLayoutDeferred, setTabList, toString
Methods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar, setScrollbarsMode
Methods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, 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, update
Methods 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, removeTypedListener, reskin, setData, setData
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.eclipse.swt.graphics.Drawable
isAutoScalable
-
Constructor Details
-
ScrolledPageBook
Creates a new instance in the provided parent- Parameters:
parent
- the parent composite
-
ScrolledPageBook
Creates a new instance in the provided parent and with the provided style.- Parameters:
parent
- the control parentstyle
- the style to use
-
-
Method Details
-
computeSize
Removes the default size of the composite, allowing the control to shrink to the trim.- Overrides:
computeSize
in classControl
- Parameters:
wHint
- the width hinthHint
- the height hintchanged
- iftrue
, do not use cached values- Returns:
- the preferred size of the control.
- See Also:
-
Layout
Control.getBorderWidth()
Control.getBounds()
Control.getSize()
Control.pack(boolean)
- "computeTrim, getClientArea for controls that implement them"
-
hasPage
Tests if the page under the provided key is currently in the book.- Parameters:
key
- the page key- Returns:
true
if page exists,false
otherwise.
-
createPage
Creates a new page for the provided key. Use the returned composite to create children in it.- Parameters:
key
- the page key- Returns:
- the newly created page composite
-
getContainer
Returns the page book container.- Returns:
- the page book container
-
registerPage
Registers a page under the privided key to be managed by the page book. The page must be a direct child of the page book container.- Parameters:
key
- the page keypage
- the page composite to register- See Also:
-
removePage
Removes the page under the provided key from the page book. Does nothing if page with that key does not exist.- Parameters:
key
- the page key.
-
removePage
Removes the page under the provided key from the page book. Does nothing if page with that key does not exist.- Parameters:
key
- the page key.showEmptyPage
- iftrue
, shows the empty page after page removal.
-
showPage
Shows the page with the provided key and hides the page previously showing. Does nothing if the page with that key does not exist.- Parameters:
key
- the page key
-
showEmptyPage
public void showEmptyPage()Shows a page with no children to be used if the desire is to not show any registered page. -
setFocus
public boolean setFocus()Sets focus on the current page if shown.- Overrides:
setFocus
in classSharedScrolledComposite
- Returns:
true
if the control got focus, andfalse
if it was unable to.- See Also:
-
getCurrentPage
Returns the page currently showing.- Returns:
- the current page
-