Eclipse Remote Application Platform

org.eclipse.swt.custom
Class CBanner

java.lang.Object
  extended by org.eclipse.swt.widgets.Widget
      extended by org.eclipse.swt.widgets.Control
          extended by org.eclipse.swt.widgets.Scrollable
              extended by org.eclipse.swt.widgets.Composite
                  extended by org.eclipse.swt.custom.CBanner
All Implemented Interfaces:
Adaptable, Drawable

public class CBanner
extends Composite

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

Constructor Summary
CBanner(Composite parent, int style)
          Constructs a new instance of this class given its parent and a style value describing its behavior and appearance.
 
Method Summary
 Control getBottom()
          Returns the Control that appears on the bottom side of the banner.
 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").
 Control getLeft()
          Returns the Control that appears on the left side of the banner.
 Control getRight()
          Returns the Control that appears on the right side of the banner.
 Point getRightMinimumSize()
          Returns the minimum size of the control that appears on the right of the banner.
 int getRightWidth()
          Returns the width of the control that appears on the right of the banner.
 boolean getSimple()
          Returns true if the CBanner is rendered with a simple, traditional shape.
 void setBottom(Control control)
          Set the control that appears on the bottom side of the banner.
 void setLayout(Layout layout)
          Sets the layout which is associated with the receiver to be the argument which may be null.
 void setLeft(Control control)
          Set the control that appears on the left side of the banner.
 void setRight(Control control)
          Set the control that appears on the right side of the banner.
 void setRightMinimumSize(Point size)
          Set the minimum height of the control that appears on the right side of the banner.
 void setRightWidth(int width)
          Set the width of the control that appears on the right side of the banner.
 void setSimple(boolean simple)
          Sets the shape that the CBanner will use to render itself.
 
Methods inherited from class org.eclipse.swt.widgets.Composite
changed, computeSize, getAdapter, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayoutDeferred, setTabList
 
Methods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getHorizontalBar, getVerticalBar
 
Methods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addTouchListener, addTraverseListener, computeSize, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getShell, getSize, getToolTipText, getTouchEnabled, getVisible, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeTouchListener, removeTraverseListener, setBackground, setBackgroundImage, setBounds, setBounds, setCursor, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setSize, setSize, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, update
 
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, checkSubclass, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CBanner

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 - a widget which will be the parent of the new instance (cannot be null)
style - the style of widget to construct
Throws:
java.lang.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

getBottom

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

getClientArea

public Rectangle getClientArea()
Description copied from class: Scrollable
Returns a rectangle which describes the area of the receiver which is capable of displaying data (that is, not covered by the "trimmings").

Overrides:
getClientArea in class Scrollable
Returns:
the client area
See Also:
Scrollable.computeTrim(int, int, int, int)

getLeft

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

getRight

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

getRightMinimumSize

public Point 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

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

getSimple

public boolean getSimple()
Returns true if the CBanner is rendered with a simple, traditional shape.

Returns:
true if the Cbanner is rendered with a simple shape

setBottom

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

setLayout

public void setLayout(Layout layout)
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:
setLayout in class Composite
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

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

setRight

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

setRightMinimumSize

public void setRightMinimumSize(Point size)
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

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

setSimple

public void setSimple(boolean simple)
Sets the shape that the CBanner will use to render itself.

Parameters:
simple - true if 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

Eclipse Remote Application Platform

Copyright (c) EclipseSource and others 2002, 2012. All rights reserved.