public class CTabFolder extends Composite
The item children that may be added to instances of this class
must be of type CTabItem
.
Control
children are created and then set into a
tab item using CTabItem#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) static int |
BACKGROUND |
static RGB |
borderInsideRGB
Deprecated.
drop shadow border is no longer drawn in 3.0
|
static RGB |
borderMiddleRGB
Deprecated.
drop shadow border is no longer drawn in 3.0
|
static RGB |
borderOutsideRGB
Deprecated.
drop shadow border is no longer drawn in 3.0
|
(package private) boolean |
borderVisible |
(package private) int |
chevronCount |
(package private) Image |
chevronImage |
(package private) ToolItem |
chevronItem |
(package private) ToolBar |
chevronTb |
(package private) boolean |
chevronVisible |
(package private) int[] |
controlAlignments |
(package private) Image[] |
controlBkImages |
(package private) Rectangle[] |
controlRects |
(package private) Control[] |
controls |
(package private) static int |
DEFAULT_HEIGHT |
(package private) static int |
DEFAULT_WIDTH |
(package private) int |
firstIndex |
(package private) int |
fixedTabHeight |
(package private) CTabFolder2Listener[] |
folderListeners |
(package private) static int |
FOREGROUND |
(package private) Color[] |
gradientColors |
(package private) int[] |
gradientPercents |
(package private) boolean |
gradientVertical |
(package private) boolean |
hovering |
(package private) Rectangle |
hoverRect |
(package private) boolean |
hoverTb |
(package private) boolean |
hoverTimerRunning |
(package private) boolean |
ignoreResize |
(package private) boolean |
ignoreTraverse |
(package private) boolean |
inDispose |
(package private) CTabItem[] |
items |
(package private) Listener |
listener |
int |
marginHeight
marginHeight specifies the number of pixels of vertical margin
that will be placed along the top and bottom edges of the form.
|
int |
marginWidth
marginWidth specifies the number of pixels of horizontal margin
that will be placed along the left and right edges of the form.
|
(package private) Image |
maxImage |
(package private) boolean |
maximized |
(package private) ToolItem |
maxItem |
int |
MIN_TAB_WIDTH
Deprecated.
This field is no longer used. See setMinimumCharacters(int)
|
(package private) int |
minChars |
(package private) Image |
minImage |
(package private) boolean |
minimized |
(package private) ToolItem |
minItem |
(package private) ToolBar |
minMaxTb |
(package private) boolean |
mru |
(package private) Font |
oldFont |
(package private) Point |
oldSize |
(package private) boolean |
onBottom |
(package private) int[] |
priority |
(package private) CTabFolderRenderer |
renderer |
(package private) int |
selectedIndex |
(package private) static int |
SELECTION_BACKGROUND |
(package private) static int |
SELECTION_FOREGROUND |
(package private) Color |
selectionBackground |
(package private) Image |
selectionBgImage |
(package private) Color |
selectionForeground |
(package private) Color[] |
selectionGradientColors |
(package private) int[] |
selectionGradientPercents |
(package private) boolean |
selectionGradientVertical |
(package private) boolean |
showChevron |
(package private) boolean |
showClose |
(package private) boolean |
showMax |
(package private) Menu |
showMenu |
(package private) boolean |
showMin |
(package private) boolean |
showUnselectedClose |
(package private) boolean |
showUnselectedImage |
(package private) boolean |
simple |
(package private) boolean |
single |
(package private) static int |
SPACING |
(package private) int |
tabHeight |
(package private) CTabFolderListener[] |
tabListeners |
(package private) Control |
topRight |
(package private) int |
topRightAlignment |
Constructor and Description |
---|
CTabFolder(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 |
---|---|
(package private) char |
_findMnemonic(java.lang.String string) |
(package private) java.lang.String |
_getToolTip(int x,
int y) |
(package private) void |
_setToolTipText(int x,
int y) |
void |
addCTabFolder2Listener(CTabFolder2Listener listener)
Adds the listener to the collection of listeners who will
be notified when a tab item is closed, minimized, maximized,
restored, or to show the list of items that are not
currently visible.
|
void |
addCTabFolderListener(CTabFolderListener listener)
Deprecated.
use addCTabFolder2Listener(CTabFolder2Listener)
|
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) void |
addTabControl(Control control,
int flags)
Set a control that can appear to the left or to the right of the folder tabs.
|
(package private) void |
addTabControl(Control control,
int flags,
int index,
boolean update) |
(package private) static int |
checkStyle(Composite parent,
int style) |
(package private) Rectangle[] |
computeControlBounds(Point size,
boolean[][] position) |
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) Image |
createButtonImage(Display display,
int button) |
(package private) void |
createItem(CTabItem item,
int index) |
(package private) void |
destroyItem(CTabItem item) |
boolean |
getBorderVisible()
Returns
true if the receiver's border is visible. |
(package private) ToolBar |
getChevron() |
(package private) boolean |
getChevronVisible()
Returns
true if the chevron button
is visible when necessary. |
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").
|
(package private) int |
getControlHeight(Point ctrlSize) |
(package private) int |
getControlY(Point size,
Rectangle[] rects,
int borderBottom,
int borderTop,
int i) |
CTabItem |
getItem(int index)
Return the tab that is located at the specified index.
|
CTabItem |
getItem(Point pt)
Gets the item at a point in the widget.
|
int |
getItemCount()
Return the number of tabs in the folder.
|
CTabItem[] |
getItems()
Return the tab items.
|
(package private) int |
getLeftItemEdge(GC gc,
int part) |
boolean |
getMaximized()
Returns
true if the receiver is maximized. |
boolean |
getMaximizeVisible()
Returns
true if the maximize button
is visible. |
boolean |
getMinimized()
Returns
true if the receiver is minimized. |
boolean |
getMinimizeVisible()
Returns
true if the minimize button
is visible. |
int |
getMinimumCharacters()
Returns the number of characters that will
appear in a fully compressed tab.
|
boolean |
getMRUVisible()
Returns
true if the receiver displays most
recently used tabs and false otherwise. |
CTabFolderRenderer |
getRenderer()
Returns the receiver's renderer.
|
(package private) int |
getRightItemEdge(GC gc) |
CTabItem |
getSelection()
Return the selected tab item, or null if there is no selection.
|
Color |
getSelectionBackground()
Returns the receiver's selection background color.
|
Color |
getSelectionForeground()
Returns the receiver's selection foreground color.
|
int |
getSelectionIndex()
Return the index of the selected tab item, or -1 if there
is no selection.
|
boolean |
getSimple()
Returns
true if the CTabFolder is rendered
with a simple, traditional shape. |
boolean |
getSingle()
Returns
true if the CTabFolder only displays the selected tab
and false if the CTabFolder displays multiple tabs. |
int |
getStyle()
Returns the receiver's style information.
|
int |
getTabHeight()
Returns the height of the tab
|
int |
getTabPosition()
Returns the position of the tab.
|
Control |
getTopRight()
Returns the control in the top right corner of the tab folder.
|
int |
getTopRightAlignment()
Returns the alignment of the top right control.
|
boolean |
getUnselectedCloseVisible()
Returns
true if the close button appears
when the user hovers over an unselected tabs. |
boolean |
getUnselectedImageVisible()
Returns
true if an image appears
in unselected tabs. |
(package private) int |
getWrappedHeight(Point size) |
int |
indexOf(CTabItem item)
Return the index of the specified tab or -1 if the tab is not
in the receiver.
|
(package private) void |
init(int style) |
(package private) void |
initAccessible() |
(package private) void |
initAccessibleChevronTb() |
(package private) void |
initAccessibleMinMaxTb() |
(package private) void |
onDispose(Event event) |
(package private) void |
onDragDetect(Event event) |
(package private) void |
onFocus(Event event) |
(package private) void |
onKeyDown(Event event) |
(package private) boolean |
onMnemonic(Event event,
boolean doit) |
(package private) void |
onMouse(Event event) |
(package private) void |
onMouseDoubleClick(Event event) |
(package private) void |
onPageTraversal(Event event) |
(package private) void |
onPaint(Event event) |
(package private) void |
onResize(Event event) |
(package private) void |
onSelection(Event event) |
(package private) void |
onTraverse(Event event) |
(package private) void |
redrawTabs() |
void |
removeCTabFolder2Listener(CTabFolder2Listener listener)
Removes the listener.
|
void |
removeCTabFolderListener(CTabFolderListener listener)
Deprecated.
see removeCTabFolderCloseListener(CTabFolderListener)
|
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 |
removeTabControl(Control control)
Removes the control from the list of tab controls.
|
(package private) void |
removeTabControl(Control control,
boolean update) |
void |
reskin(int flags)
Marks the widget to be skinned.
|
void |
setBackground(Color color)
Sets the receiver's background color to the color specified
by the argument, or to the default system color for the control
if the argument is null.
|
void |
setBackground(Color[] colors,
int[] percents)
Specify a gradient of colors to be drawn in the background of the unselected tabs.
|
void |
setBackground(Color[] colors,
int[] percents,
boolean vertical)
Specify a gradient of colors to be drawn in the background of the unselected tab.
|
void |
setBackgroundImage(Image image)
Sets the receiver's background image to the image specified
by the argument, or to the default system color for the control
if the argument is null.
|
void |
setBorderVisible(boolean show)
Toggle the visibility of the border
|
(package private) void |
setButtonBounds(GC gc) |
(package private) void |
setChevronVisible(boolean visible)
Sets whether a chevron is shown when there are more items to be displayed.
|
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 |
setForeground(Color color)
Sets the receiver's foreground color to the color specified
by the argument, or to the default system color for the control
if the argument is null.
|
void |
setInsertMark(CTabItem item,
boolean after)
Display an insert marker before or after the specified tab item.
|
void |
setInsertMark(int index,
boolean after)
Display an insert marker before or after the specified tab item.
|
(package private) boolean |
setItemLocation(GC gc) |
(package private) void |
setItemOrder(int[] indices)
Reorder the items of the receiver.
|
(package private) boolean |
setItemSize(GC gc) |
void |
setLayout(Layout layout)
Sets the layout which is associated with the receiver to be
the argument which may be null.
|
void |
setMaximized(boolean maximize)
Sets the maximized state of the receiver.
|
void |
setMaximizeVisible(boolean visible)
Marks the receiver's maximize button as visible if the argument is
true ,
and marks it invisible otherwise. |
void |
setMinimized(boolean minimize)
Sets the minimized state of the receiver.
|
void |
setMinimizeVisible(boolean visible)
Marks the receiver's minimize button as visible if the argument is
true ,
and marks it invisible otherwise. |
void |
setMinimumCharacters(int count)
Sets the minimum number of characters that will
be displayed in a fully compressed tab.
|
void |
setMRUVisible(boolean show)
When there is not enough horizontal space to show all the tabs,
by default, tabs are shown sequentially from left to right in
order of their index.
|
void |
setRenderer(CTabFolderRenderer renderer)
Sets the renderer which is associated with the receiver to be
the argument which may be null.
|
void |
setSelection(CTabItem item)
Set the selection to the tab at the specified item.
|
void |
setSelection(int index)
Set the selection to the tab at the specified index.
|
(package private) void |
setSelection(int index,
boolean notify) |
void |
setSelectionBackground(Color color)
Sets the receiver's selection background color to the color specified
by the argument, or to the default system color for the control
if the argument is null.
|
void |
setSelectionBackground(Color[] colors,
int[] percents)
Specify a gradient of colours to be draw in the background of the selected tab.
|
void |
setSelectionBackground(Color[] colors,
int[] percents,
boolean vertical)
Specify a gradient of colours to be draw in the background of the selected tab.
|
void |
setSelectionBackground(Image image)
Set the image to be drawn in the background of the selected tab.
|
void |
setSelectionForeground(Color color)
Set the foreground color of the selected tab.
|
(package private) void |
setSelectionHighlightGradientColor(Color start) |
void |
setSimple(boolean simple)
Sets the shape that the CTabFolder will use to render itself.
|
void |
setSingle(boolean single)
Sets the number of tabs that the CTabFolder should display
|
void |
setTabHeight(int height)
Specify a fixed height for the tab items.
|
void |
setTabPosition(int position)
Specify whether the tabs should appear along the top of the folder
or along the bottom of the folder.
|
void |
setTopRight(Control control)
Set the control that appears in the top right corner of the tab folder.
|
void |
setTopRight(Control control,
int alignment)
Set the control that appears in the top right corner of the tab folder.
|
void |
setUnselectedCloseVisible(boolean visible)
Specify whether the close button appears
when the user hovers over an unselected tabs.
|
void |
setUnselectedImageVisible(boolean visible)
Specify whether the image appears on unselected tabs.
|
void |
showItem(CTabItem item)
Shows the item.
|
(package private) void |
showList(Rectangle rect) |
void |
showSelection()
Shows the selection.
|
(package private) java.lang.String |
stripMnemonic(java.lang.String string) |
(package private) void |
updateBkImages() |
(package private) boolean |
updateItems() |
(package private) boolean |
updateItems(int showIndex) |
(package private) boolean |
updateTabHeight(boolean force) |
changed, checkSubclass, computeSize, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayoutDeferred, setTabList
getHorizontalBar, getScrollbarsMode, getVerticalBar
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, 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, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString
public int marginWidth
public int marginHeight
public int MIN_TAB_WIDTH
public static RGB borderInsideRGB
public static RGB borderMiddleRGB
public static RGB borderOutsideRGB
boolean onBottom
boolean single
boolean simple
int fixedTabHeight
int tabHeight
int minChars
boolean borderVisible
CTabFolderRenderer renderer
CTabItem[] items
int firstIndex
int selectedIndex
int[] priority
boolean mru
Listener listener
boolean ignoreTraverse
CTabFolder2Listener[] folderListeners
CTabFolderListener[] tabListeners
Image selectionBgImage
Color[] selectionGradientColors
int[] selectionGradientPercents
boolean selectionGradientVertical
Color selectionForeground
Color selectionBackground
Color[] gradientColors
int[] gradientPercents
boolean gradientVertical
boolean showUnselectedImage
boolean showClose
boolean showUnselectedClose
boolean showMin
boolean minimized
boolean showMax
boolean maximized
ToolBar minMaxTb
ToolItem maxItem
ToolItem minItem
Image maxImage
Image minImage
boolean hoverTb
Rectangle hoverRect
boolean hovering
boolean hoverTimerRunning
boolean showChevron
Menu showMenu
ToolBar chevronTb
ToolItem chevronItem
Image chevronImage
int chevronCount
boolean chevronVisible
Control topRight
int topRightAlignment
boolean ignoreResize
Control[] controls
int[] controlAlignments
Rectangle[] controlRects
Image[] controlBkImages
boolean inDispose
Point oldSize
Font oldFont
static final int DEFAULT_WIDTH
static final int DEFAULT_HEIGHT
static final int SELECTION_FOREGROUND
static final int SELECTION_BACKGROUND
static final int FOREGROUND
static final int BACKGROUND
static final int SPACING
public CTabFolder(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 widget which will be the parent of the new instance (cannot be null)style
- the style of widget to constructjava.lang.IllegalArgumentException
- SWTException
- SWT.TOP
,
SWT.BOTTOM
,
SWT.FLAT
,
SWT.BORDER
,
SWT.SINGLE
,
SWT.MULTI
,
getStyle()
void init(int style)
static int checkStyle(Composite parent, int style)
public void addCTabFolder2Listener(CTabFolder2Listener listener)
listener
- the listener which should be notifiedjava.lang.IllegalArgumentException
- SWTException
- CTabFolder2Listener
,
removeCTabFolder2Listener(CTabFolder2Listener)
public void addCTabFolderListener(CTabFolderListener listener)
listener
- the listener which should be notifiedjava.lang.IllegalArgumentException
- SWTException
- CTabFolderListener
,
removeCTabFolderListener(CTabFolderListener)
public void addSelectionListener(SelectionListener listener)
SelectionListener
interface.
widgetSelected
is called when the user changes the selected tab.
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)
,
SelectionEvent
int getControlHeight(Point ctrlSize)
public Rectangle computeTrim(int x, int y, int width, int height)
Scrollable
In 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 Scrollable
x
- 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(CTabItem item, int index)
void destroyItem(CTabItem item)
public boolean getBorderVisible()
true
if the receiver's border is visible.SWTException
- ToolBar getChevron()
boolean getChevronVisible()
true
if the chevron button
is visible when necessary.SWTException
- public Rectangle getClientArea()
Scrollable
getClientArea
in class Scrollable
Scrollable.computeTrim(int, int, int, int)
public CTabItem getItem(int index)
index
- the index of the tab itemjava.lang.IllegalArgumentException
- SWTException
- public CTabItem getItem(Point pt)
pt
- the point in coordinates relative to the CTabFolderSWTException
- public int getItemCount()
SWTException
- public CTabItem[] getItems()
SWTException
- int getLeftItemEdge(GC gc, int part)
char _findMnemonic(java.lang.String string)
java.lang.String stripMnemonic(java.lang.String string)
public boolean getMinimized()
true
if the receiver is minimized.SWTException
- public boolean getMinimizeVisible()
true
if the minimize button
is visible.SWTException
- public int getMinimumCharacters()
public boolean getMaximized()
true
if the receiver is maximized.
SWTException
- public boolean getMaximizeVisible()
true
if the maximize button
is visible.SWTException
- public boolean getMRUVisible()
true
if the receiver displays most
recently used tabs and false
otherwise.
When there is not enough horizontal space to show all the tabs, by default, tabs are shown sequentially from left to right in order of their index. When the MRU visibility is turned on, the tabs that are visible will be the tabs most recently selected. Tabs will still maintain their left to right order based on index but only the most recently selected tabs are visible.
For example, consider a CTabFolder that contains "Tab 1", "Tab 2", "Tab 3" and "Tab 4" (in order by index). The user selects "Tab 1" and then "Tab 3". If the CTabFolder is now compressed so that only two tabs are visible, by default, "Tab 2" and "Tab 3" will be shown ("Tab 3" since it is currently selected and "Tab 2" because it is the previous item in index order). If MRU visibility is enabled, the two visible tabs will be "Tab 1" and "Tab 3" (in that order from left to right).
SWTException
- public CTabFolderRenderer getRenderer()
SWTException
- setRenderer(CTabFolderRenderer)
,
CTabFolderRenderer
int getRightItemEdge(GC gc)
public CTabItem getSelection()
SWTException
- public Color getSelectionBackground()
SWTException
- public Color getSelectionForeground()
SWTException
- public int getSelectionIndex()
SWTException
- public boolean getSimple()
true
if the CTabFolder is rendered
with a simple, traditional shape.true
if the CTabFolder is rendered with a simple shapepublic boolean getSingle()
true
if the CTabFolder only displays the selected tab
and false
if the CTabFolder displays multiple tabs.true
if the CTabFolder only displays the selected tab and false
if the CTabFolder displays multiple tabspublic int getStyle()
Widget
Note that the value which is returned by this method may
not match the value which was provided to the constructor
when the receiver was created. This can occur when the underlying
operating system does not support a particular combination of
requested styles. For example, if the platform widget used to
implement a particular SWT widget always has scroll bars, the
result of calling this method would always have the
SWT.H_SCROLL
and SWT.V_SCROLL
bits set.
public int getTabHeight()
SWTException
- public int getTabPosition()
SWTException
- public Control getTopRight()
SWTException
- public int getTopRightAlignment()
SWT.RIGHT
or SWT.FILL
SWTException
- public boolean getUnselectedCloseVisible()
true
if the close button appears
when the user hovers over an unselected tabs.true
if the close button appears on unselected tabspublic boolean getUnselectedImageVisible()
true
if an image appears
in unselected tabs.true
if an image appears in unselected tabspublic int indexOf(CTabItem item)
item
- the tab item for which the index is requiredjava.lang.IllegalArgumentException
- SWTException
- void initAccessible()
void initAccessibleMinMaxTb()
void initAccessibleChevronTb()
void onKeyDown(Event event)
void onDispose(Event event)
void onDragDetect(Event event)
void onFocus(Event event)
boolean onMnemonic(Event event, boolean doit)
void onMouseDoubleClick(Event event)
void onMouse(Event event)
void onPageTraversal(Event event)
void onPaint(Event event)
void onResize(Event event)
void onSelection(Event event)
void onTraverse(Event event)
void redrawTabs()
public void removeCTabFolder2Listener(CTabFolder2Listener listener)
listener
- the listener which should no longer be notifiedjava.lang.IllegalArgumentException
- SWTException
- addCTabFolder2Listener(CTabFolder2Listener)
public void removeCTabFolderListener(CTabFolderListener listener)
listener
- the listener which should no longer be notifiedjava.lang.IllegalArgumentException
- SWTException
- public void removeSelectionListener(SelectionListener listener)
listener
- the listener which should no longer be notifiedjava.lang.IllegalArgumentException
- SWTException
- SelectionListener
,
addSelectionListener(org.eclipse.swt.events.SelectionListener)
public void reskin(int flags)
Widget
The skin event is sent to the receiver's display when appropriate (usually before the next event
is handled). Widgets are automatically marked for skinning upon creation as well as when its skin
id or class changes. The skin id and/or class can be changed by calling Display.setData(String, Object)
with the keys SWT.SKIN_ID and/or SWT.SKIN_CLASS. Once the skin event is sent to a widget, it
will not be sent again unless reskin(int)
is called on the widget or on an ancestor
while specifying the SWT.ALL
flag.
The parameter flags
may be either:
public void setBackground(Color color)
Control
Note: This operation is a hint and may be overridden by the platform. For example, on Windows the background of a Button cannot be changed.
setBackground
in class Control
color
- the new color (or null)public void setBackground(Color[] colors, int[] percents)
cfolder.setBackground(new Color[]{display.getSystemColor(SWT.COLOR_DARK_BLUE), display.getSystemColor(SWT.COLOR_BLUE), display.getSystemColor(SWT.COLOR_WHITE), display.getSystemColor(SWT.COLOR_WHITE)}, new int[] {25, 50, 100});
colors
- an array of Color that specifies the colors to appear in the gradient
in order of appearance left to right. The value null
clears the
background gradient. The value null
can be used inside the array of
Color to specify the background color.percents
- an array of integers between 0 and 100 specifying the percent of the width
of the widget at which the color should change. The size of the percents
array must be one less than the size of the colors
array.SWTException
- public void setBackground(Color[] colors, int[] percents, boolean vertical)
cfolder.setBackground(new Color[]{display.getSystemColor(SWT.COLOR_DARK_BLUE), display.getSystemColor(SWT.COLOR_BLUE), display.getSystemColor(SWT.COLOR_WHITE), display.getSystemColor(SWT.COLOR_WHITE)}, new int[] {25, 50, 100}, true);
colors
- an array of Color that specifies the colors to appear in the gradient
in order of appearance left to right. The value null
clears the
background gradient. The value null
can be used inside the array of
Color to specify the background color.percents
- an array of integers between 0 and 100 specifying the percent of the width
of the widget at which the color should change. The size of the percents
array must be one less than the size of the colors
array.vertical
- indicate the direction of the gradient. True
is vertical and false
is horizontal.SWTException
- public void setBackgroundImage(Image image)
Control
Note: This operation is a hint and may be overridden by the platform. For example, on Windows the background of a Button cannot be changed.
setBackgroundImage
in class Control
image
- the new image (or null)public void setBorderVisible(boolean show)
show
- true if the border should be displayedSWTException
- void setButtonBounds(GC gc)
public void setFont(Font font)
Control
public void setForeground(Color color)
Control
Note: This operation is a hint and may be overridden by the platform.
setForeground
in class Control
color
- the new color (or null)public void setInsertMark(CTabItem item, boolean after)
item
- the item with which the mark is associated or nullafter
- true if the mark should be displayed after the specified itemSWTException
- public void setInsertMark(int index, boolean after)
index
- the index of the item with which the mark is associated or nullafter
- true if the mark should be displayed after the specified itemIllegalArgumentException
- SWTException
- boolean setItemLocation(GC gc)
void setItemOrder(int[] indices)
indices
- an array containing the new indices for all itemsjava.lang.IllegalArgumentException
- SWTException
- boolean setItemSize(GC gc)
public void setMaximizeVisible(boolean visible)
true
,
and marks it invisible otherwise.visible
- the new visibility stateSWTException
- public void setLayout(Layout layout)
Note: No Layout can be set on this Control because it already manages the size and position of its children.
setLayout
in class Composite
layout
- the receiver's new layout or nullSWTException
- public void setMaximized(boolean maximize)
maximize
- the new maximized stateSWTException
- public void setMinimizeVisible(boolean visible)
true
,
and marks it invisible otherwise.visible
- the new visibility stateSWTException
- public void setMinimized(boolean minimize)
minimize
- the new minimized stateSWTException
- public void setMinimumCharacters(int count)
count
- the minimum number of characters that will be displayed in a fully compressed tabSWTException
- public void setMRUVisible(boolean show)
For example, consider a CTabFolder that contains "Tab 1", "Tab 2", "Tab 3" and "Tab 4" (in order by index). The user selects "Tab 1" and then "Tab 3". If the CTabFolder is now compressed so that only two tabs are visible, by default, "Tab 2" and "Tab 3" will be shown ("Tab 3" since it is currently selected and "Tab 2" because it is the previous item in index order). If MRU visibility is enabled, the two visible tabs will be "Tab 1" and "Tab 3" (in that order from left to right).
show
- the new visibility stateSWTException
- public void setRenderer(CTabFolderRenderer renderer)
renderer
- a new rendererSWTException
- CTabFolderRenderer
public void setSelection(CTabItem item)
item
- the tab item to be selectedjava.lang.IllegalArgumentException
- SWTException
- public void setSelection(int index)
index
- the index of the tab item to be selectedSWTException
- void setSelection(int index, boolean notify)
public void setSelectionBackground(Color color)
color
- the new color (or null)java.lang.IllegalArgumentException
- SWTException
- public void setSelectionBackground(Color[] colors, int[] percents)
cfolder.setBackground(new Color[]{display.getSystemColor(SWT.COLOR_DARK_BLUE), display.getSystemColor(SWT.COLOR_BLUE), display.getSystemColor(SWT.COLOR_WHITE), display.getSystemColor(SWT.COLOR_WHITE)}, new int[] {25, 50, 100});
colors
- an array of Color that specifies the colors to appear in the gradient
in order of appearance left to right. The value null
clears the
background gradient. The value null
can be used inside the array of
Color to specify the background color.percents
- an array of integers between 0 and 100 specifying the percent of the width
of the widget at which the color should change. The size of the percents array must be one
less than the size of the colors array.SWTException
- public void setSelectionBackground(Color[] colors, int[] percents, boolean vertical)
cfolder.setBackground(new Color[]{display.getSystemColor(SWT.COLOR_DARK_BLUE), display.getSystemColor(SWT.COLOR_BLUE), display.getSystemColor(SWT.COLOR_WHITE), display.getSystemColor(SWT.COLOR_WHITE)}, new int[] {25, 50, 100}, true);
colors
- an array of Color that specifies the colors to appear in the gradient
in order of appearance left to right. The value null
clears the
background gradient. The value null
can be used inside the array of
Color to specify the background color.percents
- an array of integers between 0 and 100 specifying the percent of the width
of the widget at which the color should change. The size of the percents array must be one
less than the size of the colors array.vertical
- indicate the direction of the gradient. True is vertical and false is horizontal.SWTException
- void setSelectionHighlightGradientColor(Color start)
public void setSelectionBackground(Image image)
image
- the image to be drawn in the backgroundSWTException
- public void setSelectionForeground(Color color)
color
- the color of the text displayed in the selected tabSWTException
- public void setSimple(boolean simple)
simple
- true
if the CTabFolder should render itself in a simple, traditional styleSWTException
- public void setSingle(boolean single)
single
- true
if only the selected tab should be displayed otherwise, multiple tabs will be shown.SWTException
- public void setTabHeight(int height)
height
- the pixel value of the height or -1SWTException
- public void setTabPosition(int position)
position
- SWT.TOP
for tabs along the top or SWT.BOTTOM
for tabs along the bottomSWTException
- public void setTopRight(Control control)
control
- the control to be displayed in the top right corner or nullSWTException
- public void setTopRight(Control control, int alignment)
The alignment parameter sets the layout of the control in the tab area.
SWT.RIGHT
will cause the control to be positioned on the far
right of the folder and it will have its default size. SWT.FILL
will size the control to fill all the available space to the right of the
last tab. If there is no available space, the control will not be visible.
control
- the control to be displayed in the top right corner or nullalignment
- SWT.RIGHT
or SWT.FILL
SWTException
- public void setUnselectedCloseVisible(boolean visible)
visible
- true
makes the close button appearSWTException
- public void setUnselectedImageVisible(boolean visible)
visible
- true
makes the image appearSWTException
- public void showItem(CTabItem item)
item
- the item to be shownjava.lang.IllegalArgumentException
- SWTException
- showSelection()
void showList(Rectangle rect)
public void showSelection()
SWTException
- showItem(CTabItem)
void _setToolTipText(int x, int y)
boolean updateItems()
boolean updateItems(int showIndex)
boolean updateTabHeight(boolean force)
void updateBkImages()
java.lang.String _getToolTip(int x, int y)
void addTabControl(Control control, int flags)
The flags parameter sets the layout of the control in the tab area.
SWT.LEAD
will cause the control to be positioned on the left
of the tabs. SWT.TRAIL
will cause the control to be positioned on
the far right of the folder and it will have its default size. SWT.TRAIL
can be combined with SWT.FILL
to fill all the available space to the
right of the last tab. SWT.WRAP
can also be added to SWT.TRAIL
only to cause a control to wrap if there is not enough space to display it in its
entirety.
control
- the control to be displayed in the top right corner or nullflags
- valid combinations are:
SWTException
- void addTabControl(Control control, int flags, int index, boolean update)
void removeTabControl(Control control)
control
- the control to be removedSWTException
- void removeTabControl(Control control, boolean update)
int getWrappedHeight(Point size)
void setChevronVisible(boolean visible)
java.lang.IllegalArgumentException
- SWTException
-