org.eclipse.swt.widgets
Class Composite

java.lang.Object
  |
  +--org.eclipse.swt.widgets.Widget
        |
        +--org.eclipse.swt.widgets.Control
              |
              +--org.eclipse.swt.widgets.Scrollable
                    |
                    +--org.eclipse.swt.widgets.Composite
All Implemented Interfaces:
Drawable
Direct Known Subclasses:
Canvas, CCombo, Combo, CoolBar, CTabFolder, Group, SashForm, ScrolledComposite, TabFolder, Table, TableTree, ToolBar, Tree, ViewForm

public class Composite
extends Scrollable

Safe:


Field Summary
(package private)  int font
           
(package private)  Layout layout
           
(package private)  org.eclipse.swt.internal.win32.WINDOWPOS[] lpwp
           
(package private)  Control[] tabList
           
 
Fields inherited from class org.eclipse.swt.widgets.Scrollable
horizontalBar, verticalBar
 
Fields inherited from class org.eclipse.swt.widgets.Control
ACCENTS, accessible, background, drawCount, foreground, handle, hCursor, layoutData, menu, parent, toolTipText
 
Fields inherited from class org.eclipse.swt.widgets.Widget
CANVAS, COMCTL32_MAJOR, COMCTL32_MINOR, data, DEFAULT_HEIGHT, DEFAULT_WIDTH, DISABLED, DISPOSED, eventTable, HIDDEN, keys, MAJOR, MINOR, Mnemonic, state, style, values
 
Constructor Summary
(package private) Composite()
          Prevents uninitialized instances from being created outside the package.
  Composite(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
(package private)  Control[] _getChildren()
           
(package private)  Control[] _getTabList()
           
protected  void checkSubclass()
          Checks that this class can be subclassed.
 Point computeSize(int wHint, int hHint, boolean changed)
          Enabled:
(package private)  Control[] computeTabList()
           
(package private)  void createHandle()
           
 Control[] getChildren()
          Enabled: Returns an array containing the receiver's children.
(package private)  int getChildrenCount()
           
 Layout getLayout()
          Enabled: Returns layout which is associated with the receiver, or null if one has not been set.
 Control[] getTabList()
          Enabled: Gets the last specified tabbing order for the control.
(package private)  boolean hooksKeys()
           
 void layout()
          Enabled: If the receiver has a layout, asks the layout to lay out (that is, set the size and location of) the receiver's children.
 void layout(boolean changed)
          Enabled: If the receiver has a layout, asks the layout to lay out (that is, set the size and location of) the receiver's children.
(package private)  Point minimumSize()
           
 void moveAbove(Control above, Control optBelow)
          Added: If 'self' is the parent of both 'above' and 'optBelow', then does an 'above.moveAbove(optBelow)'
 void moveBelow(Control below, Control optAbove)
          Added: If 'self' is the parent of both 'below' and 'optAbove', then does an 'below.moveBelow(optAbove)'
(package private)  void releaseChildren()
           
(package private)  void releaseWidget()
           
(package private)  void resizeChildren()
           
(package private)  boolean resizeChildren(boolean defer, org.eclipse.swt.internal.win32.WINDOWPOS[] pwp)
           
 boolean setFocus()
          Suppressed:
 void setLayout(Layout layout)
          Enabled: Sets the layout which is associated with the receiver to be the argument which may be null.
(package private)  void setResizeChildren(boolean resize)
           
(package private)  boolean setTabGroupFocus()
           
(package private)  boolean setTabItemFocus()
           
 void setTabList(Control[] tabList)
          Enabled: Sets the tabbing order for the specified controls to match the order that they occur in the argument list.
(package private)  String toolTipText(org.eclipse.swt.internal.win32.NMTTDISPINFO hdr)
           
(package private)  boolean translateMnemonic(char key)
           
(package private)  void updateFont(Font oldFont, Font newFont)
           
(package private)  int widgetStyle()
           
(package private)  org.eclipse.swt.internal.win32.LRESULT WM_ERASEBKGND(int wParam, int lParam)
           
(package private)  org.eclipse.swt.internal.win32.LRESULT WM_GETDLGCODE(int wParam, int lParam)
           
(package private)  org.eclipse.swt.internal.win32.LRESULT WM_GETFONT(int wParam, int lParam)
           
(package private)  org.eclipse.swt.internal.win32.LRESULT WM_LBUTTONDOWN(int wParam, int lParam)
           
(package private)  org.eclipse.swt.internal.win32.LRESULT WM_NOTIFY(int wParam, int lParam)
           
(package private)  org.eclipse.swt.internal.win32.LRESULT WM_PAINT(int wParam, int lParam)
           
(package private)  org.eclipse.swt.internal.win32.LRESULT WM_SETFONT(int wParam, int lParam)
           
(package private)  org.eclipse.swt.internal.win32.LRESULT WM_SIZE(int wParam, int lParam)
           
(package private)  org.eclipse.swt.internal.win32.LRESULT WM_SYSCOLORCHANGE(int wParam, int lParam)
           
(package private)  org.eclipse.swt.internal.win32.LRESULT WM_SYSCOMMAND(int wParam, int lParam)
           
 
Methods inherited from class org.eclipse.swt.widgets.Scrollable
callWindowProc, computeTrim, createScrollBar, createWidget, getClientArea, getHorizontalBar, getVerticalBar, widgetExtStyle, windowClass, windowProc, WM_HSCROLL, WM_MOUSEWHEEL, WM_VSCROLL, wmScroll
 
Methods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addFocusListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, addTraverseListener, checkOrientation, computeSize, computeTabGroup, computeTabRoot, defaultBackground, defaultFont, defaultForeground, deregister, destroyWidget, drawBackground, drawBackground, findBrush, findCursor, findMnemonic, fixFocus, forceFocus, forceResize, getAccessible, getBackground, getBackgroundPixel, getBorderWidth, getBounds, getCodePage, getDisplay, getEnabled, getFont, getForeground, getForegroundPixel, getLayoutData, getLocation, getMenu, getParent, getPath, getShell, getSize, getToolTipText, getVisible, hasCursor, hasFocus, internal_dispose_GC, internal_new_GC, isActive, isDisposed, isEnabled, isFocusAncestor, isFocusControl, isReparentable, isShowing, isTabGroup, isTabItem, isVisible, menuShell, mnemonicHit, mnemonicMatch, moveAbove, moveBelow, new_Accessible, pack, pack, redraw, redraw, register, releaseHandle, removeControlListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removePaintListener, removeTraverseListener, sendKeyEvent, sendKeyEvent, sendMouseEvent, sendMouseEvent, setBackground, setBackgroundPixel, setBounds, setBounds, setBounds, setCapture, setCursor, setDefaultFont, setEnabled, setFont, setForeground, setForegroundPixel, setLayoutData, setLocation, setLocation, setMenu, setParent, setRadioFocus, setRadioSelection, setRedraw, setSavedFocus, setSize, setSize, setToolTipText, setVisible, sort, subclass, toControl, toControl, toDisplay, toDisplay, transferActive, transferFocus, translateAccelerator, translateMnemonic, translateTraversal, traverse, traverse, traverseEscape, traverseGroup, traverseItem, traverseMnemonic, traversePage, traverseReturn, unsubclass, update, update, windowProc, WM_ACTIVATE, WM_CHAR, WM_CLEAR, WM_CLOSE, WM_COMMAND, WM_CONTEXTMENU, WM_CTLCOLOR, WM_CUT, WM_DESTROY, WM_DRAWITEM, WM_ENDSESSION, WM_GETOBJECT, WM_HELP, WM_HOTKEY, WM_IME_CHAR, WM_IME_COMPOSITION, WM_INITMENUPOPUP, WM_KEYDOWN, WM_KEYUP, WM_KILLFOCUS, WM_LBUTTONDBLCLK, WM_LBUTTONUP, WM_MBUTTONDBLCLK, WM_MBUTTONDOWN, WM_MBUTTONUP, WM_MEASUREITEM, WM_MENUCHAR, WM_MENUSELECT, WM_MOUSEACTIVATE, WM_MOUSEHOVER, WM_MOUSELEAVE, WM_MOUSEMOVE, WM_MOVE, WM_NCACTIVATE, WM_NCCALCSIZE, WM_NCHITTEST, WM_PALETTECHANGED, WM_PASTE, WM_PRINTCLIENT, WM_QUERYENDSESSION, WM_QUERYNEWPALETTE, WM_QUERYOPEN, WM_RBUTTONDBLCLK, WM_RBUTTONDOWN, WM_RBUTTONUP, WM_SETCURSOR, WM_SETFOCUS, WM_SETREDRAW, WM_SETTINGCHANGE, WM_SHOWWINDOW, WM_SYSCHAR, WM_SYSKEYDOWN, WM_SYSKEYUP, WM_TIMER, WM_UNDO, WM_WINDOWPOSCHANGING, wmColorChild, wmCommandChild, wmDrawChild, wmMeasureChild, wmNotifyChild, wmScrollChild
 
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, checkBits, checkParent, checkWidget, dispose, error, filters, getData, getData, getName, getNameText, getStyle, hooks, isListening, isValidSubclass, isValidThread, mbcsToWcs, mbcsToWcs, notifyListeners, postEvent, postEvent, releaseChild, releaseResources, removeDisposeListener, removeListener, removeListener, sendEvent, sendEvent, sendEvent, sendEvent, setData, setData, setInputState, setKeyState, toString, wcsToMbcs, wcsToMbcs
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

layout

Layout layout

font

int font

lpwp

org.eclipse.swt.internal.win32.WINDOWPOS[] lpwp

tabList

Control[] tabList
Constructor Detail

Composite

Composite()
Prevents uninitialized instances from being created outside the package.


Composite

public Composite(Composite parent,
                 int style)
Enabled: 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
See Also:
SWT.NO_BACKGROUND, SWT.NO_FOCUS, SWT.NO_MERGE_PAINTS, SWT.NO_REDRAW_RESIZE, SWT.NO_RADIO_GROUP, Widget.getStyle()
Method Detail

_getChildren

Control[] _getChildren()

_getTabList

Control[] _getTabList()

checkSubclass

protected void checkSubclass()
Description copied from class: Widget
Checks that this class can be subclassed.

The SWT class library is intended to be subclassed only at specific, controlled points (most notably, Composite and Canvas when implementing new widgets). This method enforces this rule unless it is overridden.

IMPORTANT: By providing an implementation of this method that allows a subclass of a class which does not normally allow subclassing to be created, the implementer agrees to be fully responsible for the fact that any such subclass will likely fail between SWT releases and will be strongly platform specific. No support is provided for user-written classes which are implemented in this fashion.

The ability to subclass outside of the allowed SWT classes is intended purely to enable those not on the SWT development team to implement patches in order to get around specific limitations in advance of when those limitations can be addressed by the team. Subclassing should not be attempted without an intimate and detailed understanding of the hierarchy.

Overrides:
checkSubclass in class Widget

computeTabList

Control[] computeTabList()
Overrides:
computeTabList in class Control

computeSize

public Point computeSize(int wHint,
                         int hHint,
                         boolean changed)
Enabled:

Overrides:
computeSize in class Control
Parameters:
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
Returns:
the preferred size of the control.
See Also:
Layout, Control.getBorderWidth(), Control.getBounds(), Control.getSize(), Control.pack(), "computeTrim, getClientArea for controls that implement them"

createHandle

void createHandle()
Overrides:
createHandle in class Control

getChildren

public Control[] getChildren()
Enabled: Returns an array containing the receiver's children.

Note: This is not the actual structure used by the receiver to maintain its list of children, so modifying the array will not affect the receiver.

Returns:
an array of children

getChildrenCount

int getChildrenCount()

getLayout

public Layout getLayout()
Enabled: Returns layout which is associated with the receiver, or null if one has not been set.

Returns:
the receiver's layout or null

getTabList

public Control[] getTabList()
Enabled: Gets the last specified tabbing order for the control.

Returns:
tabList the ordered list of controls representing the tab order
See Also:
setTabList(org.eclipse.swt.widgets.Control[])

hooksKeys

boolean hooksKeys()

layout

public void layout()
Enabled: If the receiver has a layout, asks the layout to lay out (that is, set the size and location of) the receiver's children. If the receiver does not have a layout, do nothing.

This is equivalent to calling layout(true).


layout

public void layout(boolean changed)
Enabled: If the receiver has a layout, asks the layout to lay out (that is, set the size and location of) the receiver's children. If the the argument is true the layout must not rely on any cached information it is keeping about the children. If it is false the layout may (potentially) simplify the work it is doing by assuming that the state of the none of the receiver's children has changed since the last layout. If the receiver does not have a layout, do nothing.

Parameters:
changed - true if the layout must flush its caches, and false otherwise

minimumSize

Point minimumSize()

releaseChildren

void releaseChildren()

resizeChildren

void resizeChildren()

resizeChildren

boolean resizeChildren(boolean defer,
                       org.eclipse.swt.internal.win32.WINDOWPOS[] pwp)

releaseWidget

void releaseWidget()
Overrides:
releaseWidget in class Scrollable

setFocus

public boolean setFocus()
Suppressed:

Overrides:
setFocus in class Control
Returns:
true if the control got focus, and false if it was unable to.
See Also:
Control.forceFocus()

setLayout

public void setLayout(Layout layout)
Enabled: Sets the layout which is associated with the receiver to be the argument which may be null.

Parameters:
layout - the receiver's new layout or null

setTabList

public void setTabList(Control[] tabList)
Enabled: Sets the tabbing order for the specified controls to match the order that they occur in the argument list.

Parameters:
tabList - the ordered list of controls representing the tab order or null

setResizeChildren

void setResizeChildren(boolean resize)

setTabGroupFocus

boolean setTabGroupFocus()
Overrides:
setTabGroupFocus in class Control

setTabItemFocus

boolean setTabItemFocus()
Overrides:
setTabItemFocus in class Control

toolTipText

String toolTipText(org.eclipse.swt.internal.win32.NMTTDISPINFO hdr)

translateMnemonic

boolean translateMnemonic(char key)
Overrides:
translateMnemonic in class Control

updateFont

void updateFont(Font oldFont,
                Font newFont)
Overrides:
updateFont in class Control

widgetStyle

int widgetStyle()
Overrides:
widgetStyle in class Scrollable

WM_ERASEBKGND

org.eclipse.swt.internal.win32.LRESULT WM_ERASEBKGND(int wParam,
                                                     int lParam)
Overrides:
WM_ERASEBKGND in class Control

WM_GETDLGCODE

org.eclipse.swt.internal.win32.LRESULT WM_GETDLGCODE(int wParam,
                                                     int lParam)
Overrides:
WM_GETDLGCODE in class Control

WM_GETFONT

org.eclipse.swt.internal.win32.LRESULT WM_GETFONT(int wParam,
                                                  int lParam)
Overrides:
WM_GETFONT in class Control

WM_LBUTTONDOWN

org.eclipse.swt.internal.win32.LRESULT WM_LBUTTONDOWN(int wParam,
                                                      int lParam)
Overrides:
WM_LBUTTONDOWN in class Control

WM_NOTIFY

org.eclipse.swt.internal.win32.LRESULT WM_NOTIFY(int wParam,
                                                 int lParam)
Overrides:
WM_NOTIFY in class Control

WM_PAINT

org.eclipse.swt.internal.win32.LRESULT WM_PAINT(int wParam,
                                                int lParam)
Overrides:
WM_PAINT in class Control

WM_SETFONT

org.eclipse.swt.internal.win32.LRESULT WM_SETFONT(int wParam,
                                                  int lParam)
Overrides:
WM_SETFONT in class Control

WM_SIZE

org.eclipse.swt.internal.win32.LRESULT WM_SIZE(int wParam,
                                               int lParam)
Overrides:
WM_SIZE in class Scrollable

WM_SYSCOLORCHANGE

org.eclipse.swt.internal.win32.LRESULT WM_SYSCOLORCHANGE(int wParam,
                                                         int lParam)
Overrides:
WM_SYSCOLORCHANGE in class Control

WM_SYSCOMMAND

org.eclipse.swt.internal.win32.LRESULT WM_SYSCOMMAND(int wParam,
                                                     int lParam)
Overrides:
WM_SYSCOMMAND in class Control

moveAbove

public void moveAbove(Control above,
                      Control optBelow)
Added: If 'self' is the parent of both 'above' and 'optBelow', then does an 'above.moveAbove(optBelow)'


moveBelow

public void moveBelow(Control below,
                      Control optAbove)
Added: If 'self' is the parent of both 'below' and 'optAbove', then does an 'below.moveBelow(optAbove)'



comments?