|
|||||||||||
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.Item | +--org.eclipse.swt.widgets.CoolItem
Safe: Instances of this class are selectable user interface
objects that represent the dynamically positionable
areas of a CoolBar
.
IMPORTANT: This class is not intended to be subclassed.
Field Summary | |
(package private) Control |
control
|
(package private) int |
id
|
(package private) boolean |
ideal
|
(package private) boolean |
minimum
|
(package private) CoolBar |
parent
|
Fields inherited from class org.eclipse.swt.widgets.Item |
image, text |
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 | |
CoolItem(CoolBar parent,
int style)
Enabled: Constructs a new instance of this class given its parent (which must be a CoolBar ) and a style value
describing its behavior and appearance. |
|
CoolItem(CoolBar parent,
int style,
int index)
Enabled: Constructs a new instance of this class given its parent (which must be a CoolBar ), a style value
describing its behavior and appearance, and the index
at which to place it in the items maintained by its parent. |
Method Summary | |
void |
addSelectionListener(SelectionListener listener)
Enabled: Adds the listener to the collection of listeners that will be notified when the control is selected, by sending it one of the messages defined in the SelectionListener
interface. |
protected void |
checkSubclass()
Checks that this class can be subclassed. |
Point |
computeSize(int wHint,
int hHint)
Enabled: Returns the preferred size of the receiver. |
Rectangle |
getBounds()
Enabled: Returns a rectangle describing the receiver's size and location relative to its parent. |
(package private) Rectangle |
getClientArea()
|
Control |
getControl()
Suppressed: Returns the control that is associated with the receiver. |
Display |
getDisplay()
Suppressed: |
Point |
getMinimumSize()
Enabled: Returns the minimum size that the cool item can be resized to using the cool item's gripper. |
CoolBar |
getParent()
Suppressed: Returns the receiver's parent, which must be a CoolBar . |
Point |
getPreferredSize()
Enabled: Returns a point describing the receiver's ideal size. |
Point |
getSize()
Enabled: Returns a point describing the receiver's size. |
(package private) boolean |
getWrap()
|
(package private) void |
releaseChild()
|
(package private) void |
releaseWidget()
|
void |
removeSelectionListener(SelectionListener listener)
Enabled: Removes the listener from the collection of listeners that will be notified when the control is selected. |
void |
setControl(Control control)
Enabled: Sets the control that is associated with the receiver to the argument. |
void |
setMinimumSize(int width,
int height)
Enabled: Sets the minimum size that the cool item can be resized to using the cool item's gripper, to the point specified by the arguments. |
void |
setMinimumSize(Point size)
Enabled: Sets the minimum size that the cool item can be resized to using the cool item's gripper, to the point specified by the argument. |
void |
setPreferredSize(int width,
int height)
Enabled: Sets the receiver's ideal size to the point specified by the arguments. |
void |
setPreferredSize(Point size)
Enabled: Sets the receiver's ideal size to the point specified by the argument. |
void |
setSize(int width,
int height)
Enabled: Sets the receiver's size to the point specified by the arguments. |
void |
setSize(Point size)
Enabled: Sets the receiver's size to the point specified by the argument. |
(package private) void |
setWrap(boolean wrap)
|
Methods inherited from class org.eclipse.swt.widgets.Item |
getImage, getNameText, getText, setImage, setText |
Methods inherited from class org.eclipse.swt.widgets.Widget |
addDisposeListener, addListener, checkBits, checkOrientation, checkParent, checkWidget, destroyWidget, dispose, error, filters, getData, getData, getName, getStyle, hooks, isDisposed, isListening, isValidSubclass, isValidThread, mbcsToWcs, mbcsToWcs, notifyListeners, postEvent, postEvent, releaseHandle, 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 |
CoolBar parent
Control control
int id
boolean ideal
boolean minimum
Constructor Detail |
public CoolItem(CoolBar parent, int style)
CoolBar
) and a style value
describing its behavior and appearance. The item is added
to the end of the items maintained by its parent.
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 composite control which will be the parent of the new instance (cannot be null)style
- the style of control to constructSWT.DROP_DOWN
,
Widget.checkSubclass()
,
Widget.getStyle()
public CoolItem(CoolBar parent, int style, int index)
CoolBar
), a style value
describing its behavior and appearance, and the index
at which to place it in the items maintained by its parent.
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 composite control which will be the parent of the new instance (cannot be null)style
- the style of control to constructindex
- the index at which to store the receiver in its parentSWT.DROP_DOWN
,
Widget.checkSubclass()
,
Widget.getStyle()
Method Detail |
public void addSelectionListener(SelectionListener listener)
SelectionListener
interface.
If widgetSelected
is called when the mouse is over
the drop-down arrow (or 'chevron') portion of the cool item,
the event object detail field contains the value SWT.ARROW
,
and the x and y fields in the event object represent the point at
the bottom left of the chevron, where the menu should be popped up.
widgetDefaultSelected
is not called.
listener
- the listener which should be notifiedSelectionListener
,
removeSelectionListener(org.eclipse.swt.events.SelectionListener)
,
SelectionEvent
protected void checkSubclass()
Widget
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.
checkSubclass
in class Item
public Point computeSize(int wHint, int hHint)
The preferred size of a CoolItem
is the size that
it would best be displayed at. The width hint and height hint arguments
allow the caller to ask the instance questions such as "Given a particular
width, how high does it need to be to show all of the contents?"
To indicate that the caller does not wish to constrain a particular
dimension, the constant SWT.DEFAULT
is passed for the hint.
wHint
- the width hint (can be SWT.DEFAULT
)hHint
- the height hint (can be SWT.DEFAULT
)
Layout
,
getBounds()
,
getSize()
,
Control.getBorderWidth()
,
Scrollable.computeTrim(int, int, int, int)
,
Scrollable.getClientArea()
public Rectangle getBounds()
Rectangle getClientArea()
public Control getControl()
public Display getDisplay()
getDisplay
in class Widget
public CoolBar getParent()
CoolBar
.
void releaseChild()
releaseChild
in class Widget
void releaseWidget()
releaseWidget
in class Item
public void setControl(Control control)
control
- the new control that will be contained by the receiverpublic Point getPreferredSize()
public void setPreferredSize(int width, int height)
width
- the new ideal width for the receiverheight
- the new ideal height for the receiverpublic void setPreferredSize(Point size)
size
- the new ideal size for the receiverpublic Point getSize()
public void setSize(int width, int height)
Note: Attempting to set the width or height of the receiver to a negative number will cause that value to be set to zero instead.
width
- the new width for the receiverheight
- the new height for the receiverpublic void setSize(Point size)
Note: Attempting to set the width or height of the receiver to a negative number will cause them to be set to zero instead.
size
- the new size for the receiverpublic Point getMinimumSize()
public void setMinimumSize(int width, int height)
width
- the minimum width of the cool item, in pixelsheight
- the minimum height of the cool item, in pixelspublic void setMinimumSize(Point size)
size
- a point representing the minimum width and height of the cool item, in pixelsboolean getWrap()
void setWrap(boolean wrap)
public void removeSelectionListener(SelectionListener listener)
listener
- the listener which should be notifiedSelectionListener
,
addSelectionListener(org.eclipse.swt.events.SelectionListener)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |