Class CBanner
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.CBanner
- All Implemented Interfaces:
Drawable
Instances of this class implement a Composite that lays out its
children and allows programmatic control of the layout. It draws
a separator between the left and right children which can be dragged
to resize the right control.
CBanner is used in the workbench to layout the toolbar area and
perspective switching toolbar.
Note that although this class is a subclass of Composite,
it does not make sense to set a layout on it.
- Styles:
- NONE
- Events:
- (None)
IMPORTANT: This class is not intended to be subclassed.
- Since:
- 3.0
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static int(package private) Control(package private) int[](package private) int(package private) static final int(package private) int(package private) Rectangle(package private) int(package private) boolean(package private) Control(package private) Listener(package private) static final int(package private) static final int(package private) Cursor(package private) Control(package private) int(package private) int(package private) int(package private) int(package private) booleanFields inherited from class Composite
embeddedHandle -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static int[]bezier(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3, int count) (package private) static intcheckStyle(int style) Returns the Control that appears on the bottom side of the banner.Returns a rectangle which describes the area of the receiver which is capable of displaying data (that is, not covered by the "trimmings").getLeft()Returns the Control that appears on the left side of the banner.getRight()Returns the Control that appears on the right side of the banner.Returns the minimum size of the control that appears on the right of the banner.intReturns the width of the control that appears on the right of the banner.booleanReturnstrueif the CBanner is rendered with a simple, traditional shape.(package private) void(package private) voidonMouseDown(int x, int y) (package private) void(package private) voidonMouseMove(int x, int y) (package private) void(package private) void(package private) voidonResize()voidSet the control that appears on the bottom side of the banner.voidSets the layout which is associated with the receiver to be the argument which may be null.voidSet the control that appears on the left side of the banner.voidSet the control that appears on the right side of the banner.voidsetRightMinimumSize(Point size) Set the minimum height of the control that appears on the right side of the banner.voidsetRightWidth(int width) Set the width of the control that appears on the right side of the banner.voidsetSimple(boolean simple) Sets the shape that the CBanner will use to render itself.(package private) voidupdateCurve(int height) Methods inherited from class Composite
changed, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayoutDeferred, setTabList, toStringMethods inherited from class Scrollable
computeTrim, getHorizontalBar, getScrollbarsMode, getVerticalBar, setScrollbarsModeMethods inherited from class Control
addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, computeSize, 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, isAutoScalable, 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, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setFont, setForeground, 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, getData, getDisplay, getListeners, getStyle, getTypedListeners, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, removeListener, removeTypedListener, reskin, setData, setData
-
Field Details
-
left
Control left -
right
Control right -
bottom
Control bottom -
simple
boolean simple -
curve
int[] curve -
curveStart
int curveStart -
curveRect
Rectangle curveRect -
curve_width
int curve_width -
curve_indent
int curve_indent -
rightWidth
int rightWidth -
rightMinWidth
int rightMinWidth -
rightMinHeight
int rightMinHeight -
resizeCursor
Cursor resizeCursor -
dragging
boolean dragging -
rightDragDisplacement
int rightDragDisplacement -
listener
Listener listener -
OFFSCREEN
static final int OFFSCREEN- See Also:
-
BORDER_BOTTOM
static final int BORDER_BOTTOM- See Also:
-
BORDER_TOP
static final int BORDER_TOP- See Also:
-
BORDER_STRIPE
static final int BORDER_STRIPE- See Also:
-
CURVE_TAIL
static final int CURVE_TAIL- See Also:
-
BEZIER_RIGHT
static final int BEZIER_RIGHT- See Also:
-
BEZIER_LEFT
static final int BEZIER_LEFT- See Also:
-
MIN_LEFT
static final int MIN_LEFT- See Also:
-
BORDER1
static int BORDER1
-
-
Constructor Details
-
CBanner
Constructs a new instance of this class given its parent and a style value describing its behavior and appearance.The style value is either one of the style constants defined in class
SWTwhich is applicable to instances of this class, or must be built by bitwise OR'ing together (that is, using theint"|" operator) two or more of thoseSWTstyle constants. The class description lists the style constants that are applicable to the class. Style bits are also inherited from superclasses.- Parameters:
parent- a widget which will be the parent of the new instance (cannot be null)style- the style of widget to construct- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the parent is null
SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent
-
-
Method Details
-
bezier
static int[] bezier(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3, int count) -
checkStyle
static int checkStyle(int style) -
getBottom
Returns the Control that appears on the bottom side of the banner.- Returns:
- the control that appears on the bottom side of the banner or null
- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- Since:
- 3.0
-
getClientArea
Description copied from class:ScrollableReturns a rectangle which describes the area of the receiver which is capable of displaying data (that is, not covered by the "trimmings").- Overrides:
getClientAreain classScrollable- Returns:
- the client area
- See Also:
-
getLeft
Returns the Control that appears on the left side of the banner.- Returns:
- the control that appears on the left side of the banner or null
- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- Since:
- 3.0
-
getRight
Returns the Control that appears on the right side of the banner.- Returns:
- the control that appears on the right side of the banner or null
- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- Since:
- 3.0
-
getRightMinimumSize
Returns the minimum size of the control that appears on the right of the banner.- Returns:
- the minimum size of the control that appears on the right of the banner
- Since:
- 3.1
-
getRightWidth
public int getRightWidth()Returns the width of the control that appears on the right of the banner.- Returns:
- the width of the control that appears on the right of the banner
- Since:
- 3.0
-
getSimple
public boolean getSimple()Returnstrueif the CBanner is rendered with a simple, traditional shape.- Returns:
trueif the CBanner is rendered with a simple shape- Since:
- 3.0
-
onDispose
-
onMouseDown
void onMouseDown(int x, int y) -
onMouseExit
void onMouseExit() -
onMouseMove
void onMouseMove(int x, int y) -
onMouseUp
void onMouseUp() -
onPaint
-
onResize
void onResize() -
setBottom
Set the control that appears on the bottom side of the banner. The bottom control is optional. Setting the bottom control to null will remove it from the banner - however, the creator of the control must dispose of the control.- Parameters:
control- the control to be displayed on the bottom or null- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_INVALID_ARGUMENT - if the bottom control was not created as a child of the receiver
- Since:
- 3.0
-
setLayout
Sets the layout which is associated with the receiver to be the argument which may be null.Note: No Layout can be set on this Control because it already manages the size and position of its children.
- Overrides:
setLayoutin classComposite- Parameters:
layout- the receiver's new layout or null- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setLeft
Set the control that appears on the left side of the banner. The left control is optional. Setting the left control to null will remove it from the banner - however, the creator of the control must dispose of the control.- Parameters:
control- the control to be displayed on the left or null- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_INVALID_ARGUMENT - if the left control was not created as a child of the receiver
- Since:
- 3.0
-
setRight
Set the control that appears on the right side of the banner. The right control is optional. Setting the right control to null will remove it from the banner - however, the creator of the control must dispose of the control.- Parameters:
control- the control to be displayed on the right or null- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_INVALID_ARGUMENT - if the right control was not created as a child of the receiver
- Since:
- 3.0
-
setRightMinimumSize
Set the minimum height of the control that appears on the right side of the banner.- Parameters:
size- the minimum size of the control on the right- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_INVALID_ARGUMENT - if the size is null or the values of size are less than SWT.DEFAULT
- Since:
- 3.1
-
setRightWidth
public void setRightWidth(int width) Set the width of the control that appears on the right side of the banner.- Parameters:
width- the width of the control on the right- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_INVALID_ARGUMENT - if width is less than SWT.DEFAULT
- Since:
- 3.0
-
setSimple
public void setSimple(boolean simple) Sets the shape that the CBanner will use to render itself.- Parameters:
simple-trueif the CBanner should render itself in a simple, traditional style- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- Since:
- 3.0
-
updateCurve
void updateCurve(int height)
-