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
Fields inherited from class Widget
nativeZoom -
Constructor Summary
ConstructorsConstructorDescriptionScrolledPageBook(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.booleanTests if the page under the provided key is currently in the book.voidregisterPage(Object key, Control page) Registers a page under the privided key to be managed by the page book.voidremovePage(Object key) Removes the page under the provided key from the page book.voidremovePage(Object key, boolean showEmptyPage) Removes the page under the provided key from the page book.booleansetFocus()Sets focus on the current page if shown.voidShows a page with no children to be used if the desire is to not show any registered page.voidShows the page with the provided key and hides the page previously showing.Methods inherited from class SharedScrolledComposite
isDelayedReflow, layout, reflow, setBackground, setContent, setDelayedReflow, setExpandHorizontal, setExpandVertical, setFont, setForegroundMethods inherited from class ScrolledComposite
getAlwaysShowScrollBars, getContent, getExpandHorizontal, getExpandVertical, getMinHeight, getMinWidth, getOrigin, getShowFocusedControl, setAlwaysShowScrollBars, setLayout, setMinHeight, setMinSize, setMinSize, setMinWidth, setOrigin, setOrigin, setShowFocusedControl, showControlMethods inherited from class Composite
changed, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, setBackgroundMode, setLayoutDeferred, setTabList, toStringMethods inherited from class Scrollable
computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar, setScrollbarsModeMethods inherited from class 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, getData, 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, setAutoscalingMode, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setData, 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 Widget
addDisposeListener, addListener, addTypedListener, checkWidget, dispose, getData, getDisplay, getListeners, getStyle, getTypedListeners, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, removeListener, removeTypedListener, reskin, setDataMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface 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:
computeSizein classControl- Parameters:
wHint- the width hinthHint- the height hintchanged- iftrue, do not use cached values- Returns:
- the preferred size of the control.
- See Also:
-
hasPage
Tests if the page under the provided key is currently in the book.- Parameters:
key- the page key- Returns:
trueif page exists,falseotherwise.
-
createPage
-
getContainer
-
registerPage
-
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:
setFocusin classSharedScrolledComposite- Returns:
trueif the control got focus, andfalseif it was unable to.- See Also:
-
getCurrentPage
-