public class TabFolder extends Composite
The item children that may be added to instances of this class
must be of type TabItem.
Control children are created and then set into a
tab item using TabItem#setControl.
Note that although this class is a subclass of Composite,
it does not make sense to set a layout on it.
Note: Only one of the styles TOP and BOTTOM may be specified.
IMPORTANT: This class is not intended to be subclassed.
| Modifier and Type | Field and Description |
|---|---|
(package private) boolean |
createdAsRTL |
(package private) static int |
ID_UPDOWN |
(package private) ImageList |
imageList |
(package private) TabItem[] |
items |
(package private) static TCHAR |
TabFolderClass |
(package private) static int |
TabFolderProc |
backgroundMode, layout, layoutCount, lpwp, tabListhorizontalBar, verticalBaraccessible, background, backgroundImage, cursor, drawCount, font, foreground, handle, layoutData, menu, parent, region, toolTipTextCANVAS, data, DEFAULT_HEIGHT, DEFAULT_WIDTH, DISABLED, display, DISPOSE_SENT, DISPOSED, DRAG_DETECT, DRAW_BACKGROUND, eventTable, FOREIGN_HANDLE, HIDDEN, IGNORE_WM_CHANGEUISTATE, KEYED_DATA, LAYOUT_CHANGED, LAYOUT_CHILD, LAYOUT_NEEDED, MAJOR, MINOR, MOVE_DEFERRED, MOVE_OCCURRED, PARENT_BACKGROUND, RELEASED, RESIZE_DEFERRED, RESIZE_OCCURRED, SKIN_NEEDED, state, style, THEME_BACKGROUND, TRACK_MOUSE| Constructor and Description |
|---|
TabFolder(Composite parent,
int style)
Constructs a new instance of this class given its parent
and a style value describing its behavior and appearance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addSelectionListener(SelectionListener listener)
Adds the listener to the collection of listeners who will
be notified when the user changes the receiver's selection, by sending
it one of the messages defined in the
SelectionListener
interface. |
(package private) int |
callWindowProc(int hwnd,
int msg,
int wParam,
int lParam) |
(package private) static int |
checkStyle(int style) |
protected void |
checkSubclass()
Checks that this class can be subclassed.
|
Point |
computeSize(int wHint,
int hHint,
boolean changed)
Returns the preferred size of the receiver.
|
Rectangle |
computeTrim(int x,
int y,
int width,
int height)
Given a desired client area for the receiver
(as described by the arguments), returns the bounding
rectangle which would be required to produce that client
area.
|
(package private) void |
createHandle() |
(package private) void |
createItem(TabItem item,
int index) |
(package private) void |
createWidget() |
(package private) void |
destroyItem(TabItem item) |
(package private) void |
drawThemeBackground(int hDC,
int hwnd,
RECT rect) |
(package private) Control |
findThemeControl() |
Rectangle |
getClientArea()
Returns a rectangle which describes the area of the
receiver which is capable of displaying data (that is,
not covered by the "trimmings").
|
TabItem |
getItem(int index)
Returns the item at the given, zero-relative index in the
receiver.
|
TabItem |
getItem(Point point)
Returns the tab item at the given point in the receiver
or null if no such item exists.
|
int |
getItemCount()
Returns the number of items contained in the receiver.
|
TabItem[] |
getItems()
Returns an array of
TabItems which are the items
in the receiver. |
TabItem[] |
getSelection()
Returns an array of
TabItems that are currently
selected in the receiver. |
int |
getSelectionIndex()
Returns the zero-relative index of the item which is currently
selected in the receiver, or -1 if no item is selected.
|
(package private) int |
imageIndex(Image image) |
int |
indexOf(TabItem item)
Searches the receiver's list starting at the first item
(index 0) until an item is found that is equal to the
argument, and returns the index of that item.
|
(package private) Point |
minimumSize(int wHint,
int hHint,
boolean flushCache) |
(package private) boolean |
mnemonicHit(char key) |
(package private) boolean |
mnemonicMatch(char key) |
(package private) void |
releaseChildren(boolean destroy) |
(package private) void |
releaseWidget() |
(package private) void |
removeControl(Control control) |
void |
removeSelectionListener(SelectionListener listener)
Removes the listener from the collection of listeners who will
be notified when the user changes the receiver's selection.
|
(package private) void |
reskinChildren(int flags) |
void |
setFont(Font font)
Sets the font that the receiver will use to paint textual information
to the font specified by the argument, or to the default font for that
kind of control if the argument is null.
|
void |
setSelection(int index)
Selects the item at the given zero-relative index in the receiver.
|
(package private) void |
setSelection(int index,
boolean notify) |
void |
setSelection(TabItem item)
Sets the receiver's selection to the given item.
|
void |
setSelection(TabItem[] items)
Sets the receiver's selection to be the given array of items.
|
(package private) java.lang.String |
toolTipText(NMTTDISPINFO hdr) |
(package private) boolean |
traversePage(boolean next) |
(package private) void |
updateOrientation() |
(package private) int |
widgetStyle() |
(package private) TCHAR |
windowClass() |
(package private) int |
windowProc() |
(package private) LRESULT |
WM_GETDLGCODE(int wParam,
int lParam) |
(package private) LRESULT |
WM_GETOBJECT(int wParam,
int lParam) |
(package private) LRESULT |
WM_KEYDOWN(int wParam,
int lParam) |
(package private) LRESULT |
WM_MOUSELEAVE(int wParam,
int lParam) |
(package private) LRESULT |
WM_NCHITTEST(int wParam,
int lParam) |
(package private) LRESULT |
WM_NOTIFY(int wParam,
int lParam) |
(package private) LRESULT |
WM_PARENTNOTIFY(int wParam,
int lParam) |
(package private) LRESULT |
WM_SIZE(int wParam,
int lParam) |
(package private) LRESULT |
WM_WINDOWPOSCHANGING(int wParam,
int lParam) |
(package private) LRESULT |
wmNotifyChild(NMHDR hdr,
int wParam,
int lParam) |
_getChildren, _getTabList, changed, checkBuffered, checkComposited, computeTabList, copyArea, drawBackground, findDeferredControl, findMenus, fixChildren, fixTabList, getBackgroundMode, getChildren, getChildrenCount, getLayout, getLayoutDeferred, getTabList, hooksKeys, isLayoutDeferred, layout, layout, layout, layout, layout, markLayout, redrawChildren, releaseParent, resizeChildren, resizeChildren, resizeEmbeddedHandle, sendResize, setBackgroundMode, setBounds, setFocus, setLayout, setLayoutDeferred, setResizeChildren, setTabGroupFocus, setTabList, translateMnemonic, translateTraversal, updateBackgroundColor, updateBackgroundImage, updateBackgroundMode, updateFont, updateLayout, updateLayout, updateUIState, WM_ERASEBKGND, WM_GETFONT, WM_LBUTTONDOWN, WM_PAINT, WM_PRINTCLIENT, WM_SETFONT, WM_SYSCOLORCHANGE, WM_SYSCOMMAND, WM_UPDATEUISTATE, wmNCPaint, wmNotifycreateScrollBar, destroyScrollBar, getHorizontalBar, getScrollbarsMode, getVerticalBar, scrolledHandle, widgetExtStyle, WM_HSCROLL, WM_MOUSEWHEEL, WM_VSCROLL, wmScroll, wmScrollWheeladdControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, binarySearch, borderHandle, checkBackground, checkBorder, checkGesture, checkHandle, checkMirrored, computeSize, computeTabGroup, computeTabRoot, defaultBackground, defaultFont, defaultForeground, deregister, destroyWidget, dragDetect, dragDetect, dragDetect, drawBackground, drawBackground, drawBackground, drawImageBackground, enableDrag, enableWidget, fillBackground, fillImageBackground, fillThemeBackground, findBackgroundControl, findBrush, findCursor, findImageControl, findMnemonic, fixFocus, forceFocus, forceResize, getAccessible, getBackground, getBackgroundImage, getBackgroundPixel, getBorderWidth, getBounds, getClipboardText, getCodePage, getCursor, getDragDetect, getDrawing, getEnabled, getFont, getForeground, getForegroundPixel, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getPath, getRegion, getShell, getSize, getToolTipText, getTouchEnabled, getVisible, hasCursor, hasFocus, internal_dispose_GC, internal_new_GC, isActive, isEnabled, isFocusAncestor, isFocusControl, isReparentable, isShowing, isTabGroup, isTabItem, isVisible, mapEvent, menuShell, moveAbove, moveBelow, new_Accessible, new_GC, pack, pack, print, printWidget, redraw, redraw, redraw, register, releaseHandle, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, sendFocusEvent, sendGestureEvent, sendMove, sendTouchEvent, setBackground, setBackground, setBackgroundImage, setBackgroundImage, setBackgroundPixel, setBounds, setBounds, setBounds, setCapture, setCursor, setCursor, setDefaultFont, setDragDetect, setEnabled, setForeground, setForegroundPixel, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRadioFocus, setRadioSelection, setRedraw, setRegion, setSavedFocus, setSize, setSize, setTabItemFocus, setToolTipText, setToolTipText, setTouchEnabled, setVisible, showWidget, sort, subclass, toControl, toControl, toDisplay, toDisplay, topHandle, translateAccelerator, translateMnemonic, traverse, traverse, traverse, traverse, traverse, traverseEscape, traverseGroup, traverseItem, traverseMnemonic, traverseReturn, unsubclass, update, update, updateImages, widgetCreateStruct, widgetParent, windowProc, WM_ACTIVATE, WM_CAPTURECHANGED, WM_CHANGEUISTATE, WM_CHAR, WM_CLEAR, WM_CLOSE, WM_COMMAND, WM_CONTEXTMENU, WM_CTLCOLOR, WM_CUT, WM_DESTROY, WM_DRAWITEM, WM_ENDSESSION, WM_ENTERIDLE, WM_GESTURE, WM_GETMINMAXINFO, WM_HELP, WM_HOTKEY, WM_IME_CHAR, WM_IME_COMPOSITION_START, WM_IME_COMPOSITION, WM_IME_ENDCOMPOSITION, WM_INITMENUPOPUP, WM_INPUTLANGCHANGE, WM_KEYUP, WM_KILLFOCUS, WM_LBUTTONDBLCLK, WM_LBUTTONUP, WM_MBUTTONDBLCLK, WM_MBUTTONDOWN, WM_MBUTTONUP, WM_MEASUREITEM, WM_MENUCHAR, WM_MENUSELECT, WM_MOUSEACTIVATE, WM_MOUSEHOVER, WM_MOUSEHWHEEL, WM_MOUSEMOVE, WM_MOVE, WM_NCACTIVATE, WM_NCCALCSIZE, WM_NCLBUTTONDOWN, WM_NCPAINT, WM_PALETTECHANGED, WM_PASTE, WM_PRINT, WM_QUERYENDSESSION, WM_QUERYNEWPALETTE, WM_QUERYOPEN, WM_RBUTTONDBLCLK, WM_RBUTTONDOWN, WM_RBUTTONUP, WM_SETCURSOR, WM_SETFOCUS, WM_SETREDRAW, WM_SETTINGCHANGE, WM_SHOWWINDOW, WM_SYSCHAR, WM_SYSKEYDOWN, WM_SYSKEYUP, WM_TABLET_FLICK, WM_TIMER, WM_TOUCH, WM_UNDO, WM_UNINITMENUPOPUP, WM_WINDOWPOSCHANGED, WM_XBUTTONDBLCLK, WM_XBUTTONDOWN, WM_XBUTTONUP, wmColorChild, wmCommandChild, wmDrawChild, wmMeasureChild, wmScrollChild_addListener, addDisposeListener, addListener, checkBits, checkOpened, checkOrientation, checkParent, checkWidget, DeferWindowPos, dispose, dragDetect, error, filters, findItem, fixMnemonic, fixMnemonic, getData, getData, getDisplay, getListeners, getName, getNameText, getStyle, hooks, isDisposed, isListening, isValidSubclass, isValidThread, notifyListeners, postEvent, postEvent, release, removeDisposeListener, removeListener, removeListener, reskin, reskinWidget, sendDragEvent, sendDragEvent, sendEvent, sendEvent, sendEvent, sendEvent, sendKeyEvent, sendKeyEvent, sendMouseEvent, sendMouseEvent, sendMouseWheelEvent, sendSelectionEvent, sendSelectionEvent, setData, setData, setInputState, setKeyState, setLocationMask, SetWindowPos, showMenu, showMenu, toString, updateMenuLocation, wmCaptureChanged, wmChar, wmContextMenu, wmIMEChar, wmKeyDown, wmKeyUp, wmKillFocus, wmLButtonDblClk, wmLButtonDown, wmLButtonUp, wmMButtonDblClk, wmMButtonDown, wmMButtonUp, wmMouseHover, wmMouseHWheel, wmMouseLeave, wmMouseMove, wmMouseWheel, wmPaint, wmPrint, wmRButtonDblClk, wmRButtonDown, wmRButtonUp, wmSetFocus, wmSysChar, wmSysKeyDown, wmSysKeyUp, wmXButtonDblClk, wmXButtonDown, wmXButtonUpTabItem[] items
ImageList imageList
static final int TabFolderProc
static final TCHAR TabFolderClass
boolean createdAsRTL
static final int ID_UPDOWN
public TabFolder(Composite parent, int style)
The style value is either one of the style constants defined in
class SWT which is applicable to instances of this
class, or must be built by bitwise OR'ing together
(that is, using the int "|" operator) two or more
of those SWT style constants. The class description
lists the style constants that are applicable to the class.
Style bits are also inherited from superclasses.
parent - a composite control which will be the parent of the new instance (cannot be null)style - the style of control to constructjava.lang.IllegalArgumentException - SWTException - SWT,
SWT.TOP,
SWT.BOTTOM,
Widget.checkSubclass(),
Widget.getStyle()public void addSelectionListener(SelectionListener listener)
SelectionListener
interface.
When widgetSelected is called, the item field of the event object is valid.
widgetDefaultSelected is not called.
listener - the listener which should be notified when the user changes the receiver's selectionjava.lang.IllegalArgumentException - SWTException - SelectionListener,
removeSelectionListener(org.eclipse.swt.events.SelectionListener),
SelectionEventint callWindowProc(int hwnd,
int msg,
int wParam,
int lParam)
callWindowProc in class Scrollablestatic int checkStyle(int style)
protected void checkSubclass()
Widget
The SWT class library is intended to be subclassed
only at specific, controlled points (most notably,
Composite and Canvas when
implementing new widgets). This method enforces this
rule unless it is overridden.
IMPORTANT: By providing an implementation of this method that allows a subclass of a class which does not normally allow subclassing to be created, the implementer agrees to be fully responsible for the fact that any such subclass will likely fail between SWT releases and will be strongly platform specific. No support is provided for user-written classes which are implemented in this fashion.
The ability to subclass outside of the allowed SWT classes is intended purely to enable those not on the SWT development team to implement patches in order to get around specific limitations in advance of when those limitations can be addressed by the team. Subclassing should not be attempted without an intimate and detailed understanding of the hierarchy.
checkSubclass in class Compositepublic Point computeSize(int wHint, int hHint, boolean changed)
Control
The preferred size of a control is the size that it would
best be displayed at. The width hint and height hint arguments
allow the caller to ask a control questions such as "Given a particular
width, how high does the control need to be to show all of the contents?"
To indicate that the caller does not wish to constrain a particular
dimension, the constant SWT.DEFAULT is passed for the hint.
If the changed flag is true, it indicates that the receiver's
contents have changed, therefore any caches that a layout manager
containing the control may have been keeping need to be flushed. When the
control is resized, the changed flag will be false, so layout
manager caches can be retained.
computeSize in class CompositewHint - the width hint (can be SWT.DEFAULT)hHint - the height hint (can be SWT.DEFAULT)changed - true if the control's contents have changed, and false otherwiseLayout,
Control.getBorderWidth(),
Control.getBounds(),
Control.getSize(),
Control.pack(boolean),
"computeTrim, getClientArea for controls that implement them"public Rectangle computeTrim(int x, int y, int width, int height)
ScrollableIn other words, it returns a rectangle such that, if the receiver's bounds were set to that rectangle, the area of the receiver which is capable of displaying data (that is, not covered by the "trimmings") would be the rectangle described by the arguments (relative to the receiver's parent).
computeTrim in class Scrollablex - the desired x coordinate of the client areay - the desired y coordinate of the client areawidth - the desired width of the client areaheight - the desired height of the client areaScrollable.getClientArea()void createItem(TabItem item, int index)
void createHandle()
createHandle in class Compositevoid createWidget()
createWidget in class Scrollablevoid destroyItem(TabItem item)
void drawThemeBackground(int hDC,
int hwnd,
RECT rect)
drawThemeBackground in class ControlControl findThemeControl()
findThemeControl in class Controlpublic Rectangle getClientArea()
ScrollablegetClientArea in class ScrollableScrollable.computeTrim(int, int, int, int)public TabItem getItem(int index)
index - the index of the item to returnjava.lang.IllegalArgumentException - SWTException - public TabItem getItem(Point point)
point - the point used to locate the itemjava.lang.IllegalArgumentException - SWTException - public int getItemCount()
SWTException - public TabItem[] getItems()
TabItems which are the items
in the receiver.
Note: This is not the actual structure used by the receiver to maintain its list of items, so modifying the array will not affect the receiver.
SWTException - public TabItem[] getSelection()
TabItems that are currently
selected in the receiver. An empty array indicates that no
items are selected.
Note: This is not the actual structure used by the receiver to maintain its selection, so modifying the array will not affect the receiver.
SWTException - public int getSelectionIndex()
SWTException - int imageIndex(Image image)
public int indexOf(TabItem item)
item - the search itemjava.lang.IllegalArgumentException - SWTException - Point minimumSize(int wHint, int hHint, boolean flushCache)
minimumSize in class Compositeboolean mnemonicHit(char key)
mnemonicHit in class Controlboolean mnemonicMatch(char key)
mnemonicMatch in class Controlvoid releaseChildren(boolean destroy)
releaseChildren in class Compositevoid releaseWidget()
releaseWidget in class Compositevoid removeControl(Control control)
removeControl in class Compositepublic void removeSelectionListener(SelectionListener listener)
listener - the listener which should no longer be notifiedjava.lang.IllegalArgumentException - SWTException - SelectionListener,
addSelectionListener(org.eclipse.swt.events.SelectionListener)void reskinChildren(int flags)
reskinChildren in class Compositepublic void setSelection(TabItem item)
item - the item to selectjava.lang.IllegalArgumentException - SWTException - public void setSelection(TabItem[] items)
items - the array of itemsjava.lang.IllegalArgumentException - SWTException - public void setFont(Font font)
Controlpublic void setSelection(int index)
index - the index of the item to selectSWTException - void setSelection(int index,
boolean notify)
java.lang.String toolTipText(NMTTDISPINFO hdr)
toolTipText in class Compositeboolean traversePage(boolean next)
traversePage in class Controlvoid updateOrientation()
updateOrientation in class Compositeint widgetStyle()
widgetStyle in class CompositeTCHAR windowClass()
windowClass in class Scrollableint windowProc()
windowProc in class ScrollableLRESULT WM_GETDLGCODE(int wParam, int lParam)
WM_GETDLGCODE in class CompositeLRESULT WM_GETOBJECT(int wParam, int lParam)
WM_GETOBJECT in class ControlLRESULT WM_KEYDOWN(int wParam, int lParam)
WM_KEYDOWN in class ControlLRESULT WM_MOUSELEAVE(int wParam, int lParam)
WM_MOUSELEAVE in class ControlLRESULT WM_NCHITTEST(int wParam, int lParam)
WM_NCHITTEST in class CompositeLRESULT WM_PARENTNOTIFY(int wParam, int lParam)
WM_PARENTNOTIFY in class CompositeLRESULT WM_WINDOWPOSCHANGING(int wParam, int lParam)
WM_WINDOWPOSCHANGING in class ControlLRESULT wmNotifyChild(NMHDR hdr, int wParam, int lParam)
wmNotifyChild in class Control