Top Description Fields Constructors Methods
org.eclipse.swt.custom

public Class CBanner

extends Composite
Class Inheritance
Imports
org.eclipse.swt.*, org.eclipse.swt.graphics.*, org.eclipse.swt.widgets.*

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 Note

This class is not intended to be subclassed.

Since
3.0
See Also
Sample code and further information

Field Summary

Modifier and TypeField and Description
pack-priv static final int
pack-priv static final int
pack-priv static int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv Control
pack-priv int[]
pack-priv int
pack-priv static final int
pack-priv int
pack-priv Rectangle
pack-priv int
pack-priv boolean
pack-priv Control
pack-priv Listener
pack-priv static final int
pack-priv static final int
pack-priv Cursor
pack-priv Control
pack-priv int
pack-priv int
pack-priv int
pack-priv int
pack-priv boolean
Inherited from org.eclipse.swt.widgets.Composite:
embeddedHandle

Constructor Summary

AccessConstructor and Description
public
CBanner(Composite
a widget which will be the parent of the new instance (cannot be null)
parent
,
int
the style of widget to construct
style
)

Constructs a new instance of this class given its parent and a style value describing its behavior and appearance.

Method Summary

Modifier and TypeMethod and Description
pack-priv static int[]
bezier(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3, int count)

pack-priv static int
public Control

Returns:

the control that appears on the bottom side of the banner or null
getBottom
()

Returns the Control that appears on the bottom side of the banner.

public Rectangle
getClientArea()

Overrides org.eclipse.swt.widgets.Scrollable.getClientArea.

Returns a rectangle which describes the area of the receiver which is capable of displaying data (that is, not covered by the "trimmings").
public Control

Returns:

the control that appears on the left side of the banner or null
getLeft
()

Returns the Control that appears on the left side of the banner.

public Control

Returns:

the control that appears on the right side of the banner or null
getRight
()

Returns the Control that appears on the right side of the banner.

public Point

Returns:

the minimum size of the control that appears on the right of the banner
getRightMinimumSize
()

Returns the minimum size of the control that appears on the right of the banner.

public int

Returns:

the width of the control that appears on the right of the banner
getRightWidth
()

Returns the width of the control that appears on the right of the banner.

public boolean

Returns:

true if the CBanner is rendered with a simple shape
getSimple
()

Returns true if the CBanner is rendered with a simple, traditional shape.

pack-priv void
pack-priv void
onMouseDown(int x, int y)

pack-priv void
pack-priv void
onMouseMove(int x, int y)

pack-priv void
pack-priv void
onPaint(GC gc)

pack-priv void
public void
setBottom(Control
the control to be displayed on the bottom or null
control
)

Set the control that appears on the bottom side of the banner.

public void
setLayout(Layout
the receiver's new layout or null
layout
)

Overrides org.eclipse.swt.widgets.Composite.setLayout.

Sets the layout which is associated with the receiver to be the argument which may be null.
public void
setLeft(Control
the control to be displayed on the left or null
control
)

Set the control that appears on the left side of the banner.

public void
setRight(Control
the control to be displayed on the right or null
control
)

Set the control that appears on the right side of the banner.

public void
setRightMinimumSize(Point
the minimum size of the control on the right
size
)

Set the minimum height of the control that appears on the right side of the banner.

public void
setRightWidth(int
the width of the control on the right
width
)

Set the width of the control that appears on the right side of the banner.

public void
setSimple(boolean
true if the CBanner should render itself in a simple, traditional style
simple
)

Sets the shape that the CBanner will use to render itself.

pack-priv void
updateCurve(int height)

Inherited from org.eclipse.swt.widgets.Composite:
changedcheckSubclassdrawBackgroundgetBackgroundModegetChildrengetLayoutgetLayoutDeferredgetTabListisLayoutDeferredlayoutlayoutlayoutlayoutlayoutsetBackgroundModesetFocussetLayoutDeferredsetTabListtoString

Field Detail

BEZIER_LEFTback to summary
pack-priv static final int BEZIER_LEFT
BEZIER_RIGHTback to summary
pack-priv static final int BEZIER_RIGHT
BORDER1back to summary
pack-priv static int BORDER1
BORDER_BOTTOMback to summary
pack-priv static final int BORDER_BOTTOM
BORDER_STRIPEback to summary
pack-priv static final int BORDER_STRIPE
BORDER_TOPback to summary
pack-priv static final int BORDER_TOP
bottomback to summary
pack-priv Control bottom
curveback to summary
pack-priv int[] curve
curve_indentback to summary
pack-priv int curve_indent
CURVE_TAILback to summary
pack-priv static final int CURVE_TAIL
curve_widthback to summary
pack-priv int curve_width
curveRectback to summary
pack-priv Rectangle curveRect
curveStartback to summary
pack-priv int curveStart
draggingback to summary
pack-priv boolean dragging
leftback to summary
pack-priv Control left
listenerback to summary
pack-priv Listener listener
MIN_LEFTback to summary
pack-priv static final int MIN_LEFT
OFFSCREENback to summary
pack-priv static final int OFFSCREEN
resizeCursorback to summary
pack-priv Cursor resizeCursor
rightDragDisplacementback to summary
pack-priv int rightDragDisplacement
rightMinHeightback to summary
pack-priv int rightMinHeight
rightMinWidthback to summary
pack-priv int rightMinWidth
rightWidthback to summary
pack-priv int rightWidth
simpleback to summary
pack-priv boolean simple

Constructor Detail

CBannerback to summary
public CBanner(Composite parent, int style)

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 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.

Parameters
parent:Composite

a widget which will be the parent of the new instance (cannot be null)

style:int

the style of widget to construct

Exceptions
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 Detail

bezierback to summary
pack-priv static int[] bezier(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3, int count)
checkStyleback to summary
pack-priv static int checkStyle(int style)

Hides org.eclipse.swt.widgets.Composite.checkStyle.

getBottomback to summary
public Control getBottom()

Returns the Control that appears on the bottom side of the banner.

Returns:Control

the control that appears on the bottom side of the banner or null

Exceptions
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
getClientAreaback to summary
public Rectangle getClientArea()

Overrides org.eclipse.swt.widgets.Scrollable.getClientArea.

Doc from org.eclipse.swt.widgets.Scrollable.getClientArea.

Returns a rectangle which describes the area of the receiver which is capable of displaying data (that is, not covered by the "trimmings").

Returns:Rectangle

the client area

Annotations
@Override
getLeftback to summary
public Control getLeft()

Returns the Control that appears on the left side of the banner.

Returns:Control

the control that appears on the left side of the banner or null

Exceptions
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
getRightback to summary
public Control getRight()

Returns the Control that appears on the right side of the banner.

Returns:Control

the control that appears on the right side of the banner or null

Exceptions
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
getRightMinimumSizeback to summary
public Point getRightMinimumSize()

Returns the minimum size of the control that appears on the right of the banner.

Returns:Point

the minimum size of the control that appears on the right of the banner

Since
3.1
getRightWidthback to summary
public int getRightWidth()

Returns the width of the control that appears on the right of the banner.

Returns:int

the width of the control that appears on the right of the banner

Since
3.0
getSimpleback to summary
public boolean getSimple()

Returns true if the CBanner is rendered with a simple, traditional shape.

Returns:boolean

true if the CBanner is rendered with a simple shape

Since
3.0
onDisposeback to summary
pack-priv void onDispose(Event event)
onMouseDownback to summary
pack-priv void onMouseDown(int x, int y)
onMouseExitback to summary
pack-priv void onMouseExit()
onMouseMoveback to summary
pack-priv void onMouseMove(int x, int y)
onMouseUpback to summary
pack-priv void onMouseUp()
onPaintback to summary
pack-priv void onPaint(GC gc)
onResizeback to summary
pack-priv void onResize()
setBottomback to summary
public void setBottom(Control control)

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:Control

the control to be displayed on the bottom or null

Exceptions
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
setLayoutback to summary
public void setLayout(Layout layout)

Overrides org.eclipse.swt.widgets.Composite.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.

Parameters
layout:Layout

the receiver's new layout or null

Annotations
@Override
Exceptions
SWTException:
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
setLeftback to summary
public void setLeft(Control control)

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:Control

the control to be displayed on the left or null

Exceptions
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
setRightback to summary
public void setRight(Control control)

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:Control

the control to be displayed on the right or null

Exceptions
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
setRightMinimumSizeback to summary
public void setRightMinimumSize(Point size)

Set the minimum height of the control that appears on the right side of the banner.

Parameters
size:Point

the minimum size of the control on the right

Exceptions
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
setRightWidthback to summary
public void setRightWidth(int width)

Set the width of the control that appears on the right side of the banner.

Parameters
width:int

the width of the control on the right

Exceptions
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
setSimpleback to summary
public void setSimple(boolean simple)

Sets the shape that the CBanner will use to render itself.

Parameters
simple:boolean

true if the CBanner should render itself in a simple, traditional style

Exceptions
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
updateCurveback to summary
pack-priv void updateCurve(int height)