|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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.CTabFolder
Safe:
Field Summary | |
private ToolBar |
arrowBar
|
private Image |
arrowLeftImage
|
private Image |
arrowRightImage
|
(package private) Color |
background
|
(package private) Image |
backgroundImage
|
private int |
borderBottom
|
private Color |
borderColor1
|
private Color |
borderColor2
|
private Color |
borderColor3
|
static RGB |
borderInsideRGB
Enabled: Color of innermost line of drop shadow border. |
private int |
borderLeft
|
static RGB |
borderMiddleRGB
Enabled: Color of middle line of drop shadow border. |
static RGB |
borderOutsideRGB
Enabled: Color of outermost line of drop shadow border. |
private int |
borderRight
|
private int |
borderTop
|
(package private) ToolBar |
closeBar
|
private Image |
closeImage
|
private static int |
DEFAULT_HEIGHT
|
private static int |
DEFAULT_WIDTH
|
(package private) boolean |
fixedTabHeight
|
(package private) Color[] |
gradientColors
|
(package private) int[] |
gradientPercents
|
private ToolBar |
inactiveCloseBar
|
private CTabItem |
inactiveItem
|
private boolean |
inDispose
|
(package private) int |
insertionIndex
|
private CTabItem[] |
items
|
private Label |
label
|
int |
marginHeight
Enabled: marginHeight specifies the number of pixels of vertical margin that will be placed along the top and bottom edges of the form. |
int |
marginWidth
Enabled: marginWidth specifies the number of pixels of horizontal margin that will be placed along the left and right edges of the form. |
int |
MIN_TAB_WIDTH
Enabled: |
private Font |
oldFont
|
private Point |
oldSize
|
(package private) boolean |
onBottom
|
private int |
selectedIndex
|
(package private) Color |
selectionForeground
|
(package private) boolean |
showBorders
|
(package private) boolean |
showClose
|
private boolean |
showToolTip
|
(package private) int |
tabHeight
|
private CTabFolderListener[] |
tabListeners
|
private Shell |
tip
|
private CTabItem |
toolTipItem
|
private Control |
topRight
|
(package private) int |
topTabIndex
|
(package private) int |
xClient
|
(package private) int |
yClient
|
Fields inherited from class org.eclipse.swt.widgets.Composite |
|
Fields inherited from class org.eclipse.swt.widgets.Scrollable |
|
Fields inherited from class org.eclipse.swt.widgets.Control |
handle |
Fields inherited from class org.eclipse.swt.widgets.Widget |
|
Constructor Summary | |
CTabFolder(Composite parent,
int style)
Enabled: Constructs a new instance of this class given its parent and a style value describing its behavior and appearance. |
Method Summary | |
void |
addCTabFolderListener(CTabFolderListener listener)
Enabled: Adds the listener to the collection of listeners who will be notified when a tab item is closed. |
void |
addSelectionListener(SelectionListener listener)
Enabled: Adds the listener to receive events. |
private static int |
checkStyle(int style)
|
private void |
closeNotify(CTabItem item,
int time)
|
Point |
computeSize(int wHint,
int hHint,
boolean changed)
Enabled: |
Rectangle |
computeTrim(int x,
int y,
int width,
int height)
Enabled: |
private boolean |
correctLastItem()
|
private void |
createArrowBar()
|
private void |
createCloseBar()
|
(package private) void |
createItem(CTabItem item,
int index)
Create the specified item at 'index'. |
(package private) void |
destroyItem(CTabItem item)
Destroy the specified item. |
private void |
drawBorder(GC gc)
Draw a border around the receiver. |
Rectangle |
getClientArea()
Enabled: |
CTabItem |
getItem(int index)
Enabled: Return the tab that is located at the specified index. |
CTabItem |
getItem(Point pt)
Enabled: Gets the item at a point in the widget. |
int |
getItemCount()
Enabled: Return the number of tabs in the folder. |
CTabItem[] |
getItems()
Enabled: Return the tab items. |
private int |
getLastItem()
|
(package private) char |
getMnemonic(String string)
|
CTabItem |
getSelection()
Enabled: Return the selected tab item, or an empty array if there is no selection. |
int |
getSelectionIndex()
Enabled: Return the index of the selected tab item, or -1 if there is no selection. |
int |
getTabHeight()
Enabled: Returns the height of the tab |
private Rectangle |
getToolSpace()
|
Control |
getTopRight()
Suppressed: Returns the control in the top right corner of the tab folder. |
int |
indexOf(CTabItem item)
Enabled: Return the index of the specified tab or -1 if the tab is not in the receiver. |
private void |
initAccessible()
|
private void |
onDispose()
Dispose the items of the receiver |
private void |
onFocus(Event e)
|
private void |
onKeyDown(Event e)
|
private boolean |
onMnemonic(Event event)
|
private void |
onMouseDoubleClick(Event event)
|
private void |
onMouseDown(Event event)
A mouse button was pressed down. |
private void |
onMouseExit(Event event)
|
private void |
onMouseHover(Event event)
|
private void |
onMouseMove(Event event)
|
private boolean |
onPageTraversal(Event event)
|
private void |
onPaint(Event event)
Paint the receiver. |
private void |
onResize()
The widget was resized. |
private void |
onTraverse(Event event)
|
private void |
redrawTabArea(int index)
|
void |
removeCTabFolderListener(CTabFolderListener listener)
Enabled: Removes the listener. |
void |
removeSelectionListener(SelectionListener listener)
Enabled: Removes the listener. |
(package private) void |
resetTabSize(boolean checkHeight)
|
private Image |
scaleImage(Image image,
int oldSize,
int newSize)
|
private boolean |
scroll_leftVisible()
Answer true if not all tabs can be visible in the receive thus requiring the scroll buttons to be visible. |
private boolean |
scroll_rightVisible()
Answer true if not all tabs can be visible in the receive thus requiring the scroll buttons to be visible. |
private void |
scroll_scrollLeft()
Scroll the tab items to the left. |
private void |
scroll_scrollRight()
Scroll the tab items to the right. |
void |
setBackground(Color color)
Enabled: |
void |
setBorderVisible(boolean show)
Enabled: Toggle the visibility of the border |
private void |
setButtonBounds()
|
void |
setFont(Font font)
Enabled: |
void |
setInsertMark(CTabItem item,
boolean after)
Enabled: Display an insert marker before or after the specified tab item. |
void |
setInsertMark(int index,
boolean after)
Enabled: Display an insert marker before or after the specified tab item. |
(package private) boolean |
setItemBounds()
Layout the items and store the client area size. |
private boolean |
setItemLocation()
|
private void |
setLastItem(int index)
|
void |
setSelection(CTabItem item)
Enabled: Set the selection to the tab at the specified item. |
void |
setSelection(int index)
Enabled: Set the selection to the tab at the specified index. |
private void |
setSelection(int index,
boolean notify)
Set the selection to the tab at the specified index. |
void |
setSelectionBackground(Color[] colors,
int[] percents)
Enabled: Specify a gradient of colours to be draw in the background of the selected tab. |
void |
setSelectionBackground(Image image)
Enabled: Set the image to be drawn in the background of the selected tab. |
void |
setSelectionForeground(Color color)
Enabled: Set the foreground color of the selected tab. |
void |
setTabHeight(int height)
Enabled: Specify a fixed height for the tab items. |
void |
setTopRight(Control control)
Suppressed: Set the control that appears in the top right corner of the tab folder. |
void |
showItem(CTabItem item)
Enabled: Shows the item. |
void |
showSelection()
Enabled: Shows the selection. |
private void |
showToolTip(int x,
int y)
|
private void |
updateArrowBar()
|
private void |
updateCloseBar()
|
Methods inherited from class org.eclipse.swt.widgets.Composite |
checkSubclass, getChildren, getLayout, getTabList, layout, layout, moveAbove, moveBelow, setFocus, setLayout, setTabList |
Methods inherited from class org.eclipse.swt.widgets.Scrollable |
getHorizontalBar, getVerticalBar |
Methods inherited from class org.eclipse.swt.widgets.Widget |
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getStyle, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public int marginWidth
public int marginHeight
public static RGB borderInsideRGB
public static RGB borderMiddleRGB
public static RGB borderOutsideRGB
public int MIN_TAB_WIDTH
int xClient
int yClient
boolean onBottom
boolean fixedTabHeight
int tabHeight
private CTabItem[] items
private int selectedIndex
int topTabIndex
private CTabFolderListener[] tabListeners
Image backgroundImage
Color[] gradientColors
int[] gradientPercents
Color selectionForeground
Color background
private static final int DEFAULT_WIDTH
private static final int DEFAULT_HEIGHT
private ToolBar arrowBar
private Image arrowLeftImage
private Image arrowRightImage
private Control topRight
boolean showClose
private Image closeImage
ToolBar closeBar
private ToolBar inactiveCloseBar
private CTabItem inactiveItem
boolean showBorders
private int borderBottom
private int borderLeft
private int borderRight
private int borderTop
private Color borderColor1
private Color borderColor2
private Color borderColor3
private boolean inDispose
private Point oldSize
private Font oldFont
int insertionIndex
private Shell tip
private Label label
private boolean showToolTip
private CTabItem toolTipItem
Constructor Detail |
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 constructSWT.TOP
,
SWT.BOTTOM
,
SWT.FLAT
,
Widget.getStyle()
Method Detail |
private static int checkStyle(int style)
public void addSelectionListener(SelectionListener listener)
listener
- the listenerpublic void addCTabFolderListener(CTabFolderListener listener)
listener
- the listener which should be notifiedCTabFolderListener
,
removeCTabFolderListener(org.eclipse.swt.custom.CTabFolderListener)
private void closeNotify(CTabItem item, int time)
public Point computeSize(int wHint, int hHint, boolean changed)
computeSize
in class Composite
wHint
- 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
otherwise
Layout
,
Control.getBorderWidth()
,
Control.getBounds()
,
Control.getSize()
,
Control.pack()
,
"computeTrim, getClientArea for controls that implement them"public Rectangle computeTrim(int x, int y, int width, int height)
computeTrim
in class Scrollable
Scrollable.getClientArea()
void createItem(CTabItem item, int index)
private void createArrowBar()
private void createCloseBar()
void destroyItem(CTabItem item)
private void onKeyDown(Event e)
private void onDispose()
private void onFocus(Event e)
private void drawBorder(GC gc)
public Rectangle getClientArea()
getClientArea
in class Scrollable
Scrollable.computeTrim(int, int, int, int)
public int getTabHeight()
public CTabItem getItem(int index)
public CTabItem getItem(Point pt)
public int getItemCount()
public CTabItem[] getItems()
private int getLastItem()
public CTabItem getSelection()
public int getSelectionIndex()
private Rectangle getToolSpace()
public Control getTopRight()
public int indexOf(CTabItem item)
private void initAccessible()
private void setButtonBounds()
private boolean setItemLocation()
private void setLastItem(int index)
boolean setItemBounds()
private boolean onMnemonic(Event event)
private void onPaint(Event event)
private void redrawTabArea(int index)
public void removeSelectionListener(SelectionListener listener)
listener
- the listenerpublic void removeCTabFolderListener(CTabFolderListener listener)
listener
- the listenerprivate void onResize()
public void setBackground(Color color)
setBackground
in class Control
color
- the new color (or null)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.public void setSelectionBackground(Image image)
image
- the image to be drawn in the backgroundpublic void setBorderVisible(boolean show)
show
- true if the border should be displayedpublic void setFont(Font font)
setFont
in class Control
font
- the new font (or null)public void setSelectionForeground(Color color)
color
- the color of the text displayed in the selected tabpublic 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 itempublic void setInsertMark(int index, boolean after)
after
- true if the mark should be displayed after the specified itempublic void setSelection(int index)
index
- the index of the tab item to be selectedpublic void setTopRight(Control control)
control
- the control to be displayed in the top right corner or nullpublic void showItem(CTabItem item)
item
- the item to be shownshowSelection()
public void showSelection()
showItem(CTabItem)
char getMnemonic(String string)
public void setSelection(CTabItem item)
private void setSelection(int index, boolean notify)
private Image scaleImage(Image image, int oldSize, int newSize)
private void updateCloseBar()
private void updateArrowBar()
private void onMouseDoubleClick(Event event)
private void onMouseDown(Event event)
private void onMouseExit(Event event)
private void onMouseHover(Event event)
private void showToolTip(int x, int y)
private void onMouseMove(Event event)
private void onTraverse(Event event)
private boolean onPageTraversal(Event event)
private boolean scroll_leftVisible()
private boolean scroll_rightVisible()
private void scroll_scrollLeft()
private void scroll_scrollRight()
private boolean correctLastItem()
public void setTabHeight(int height)
height
- the pixel value of the height or 0void resetTabSize(boolean checkHeight)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |