public class ExpandItem extends Item
IMPORTANT: This class is not intended to be subclassed.
ExpandBar
,
Sample code and further informationModifier and Type | Field and Description |
---|---|
(package private) static int |
BORDER |
(package private) static int |
CHEVRON_SIZE |
(package private) Control |
control |
(package private) boolean |
expanded |
(package private) int |
height |
(package private) boolean |
hover |
(package private) int |
imageHeight |
(package private) int |
imageWidth |
(package private) ExpandBar |
parent |
(package private) static int |
TEXT_INSET |
(package private) int |
width |
(package private) int |
x |
(package private) int |
y |
CANVAS, data, DEFAULT_HEIGHT, DEFAULT_WIDTH, DISABLED, display, DISPOSE_SENT, DISPOSED, DRAG_DETECT, DRAW_BACKGROUND, eventTable, FOREIGN_HANDLE, HIDDEN, IGNORE_WM_CHANGEUISTATE, KEYED_DATA, LAYOUT_CHANGED, LAYOUT_CHILD, LAYOUT_NEEDED, MAJOR, MINOR, MOVE_DEFERRED, MOVE_OCCURRED, PARENT_BACKGROUND, RELEASED, RESIZE_DEFERRED, RESIZE_OCCURRED, SKIN_NEEDED, state, style, THEME_BACKGROUND, TRACK_MOUSE
Constructor and Description |
---|
ExpandItem(ExpandBar parent,
int style)
Constructs a new instance of this class given its parent
and a style value describing its behavior and appearance.
|
ExpandItem(ExpandBar parent,
int style,
int index)
Constructs a new instance of this class given its parent, a
style value describing its behavior and appearance, and the index
at which to place it in the items maintained by its parent.
|
Modifier and Type | Method and Description |
---|---|
(package private) static ExpandBar |
checkNull(ExpandBar control) |
(package private) void |
destroyWidget()
Destroys the widget in the operating system and releases
the widget's handle.
|
private void |
drawChevron(int hDC,
RECT rect) |
(package private) void |
drawItem(GC gc,
int hTheme,
RECT clipRect,
boolean drawFocus) |
Control |
getControl()
Returns the control that is shown when the item is expanded.
|
boolean |
getExpanded()
Returns
true if the receiver is expanded,
and false otherwise. |
int |
getHeaderHeight()
Returns the height of the receiver's header
|
int |
getHeight()
Gets the height of the receiver.
|
ExpandBar |
getParent()
Returns the receiver's parent, which must be a
ExpandBar . |
(package private) int |
getPreferredWidth(int hTheme,
int hDC) |
(package private) boolean |
isHover(int x,
int y) |
(package private) void |
redraw(boolean all) |
(package private) void |
releaseHandle() |
(package private) void |
releaseWidget() |
(package private) void |
setBounds(int x,
int y,
int width,
int height,
boolean move,
boolean size) |
void |
setControl(Control control)
Sets the control that is shown when the item is expanded.
|
void |
setExpanded(boolean expanded)
Sets the expanded state of the receiver.
|
void |
setHeight(int height)
Sets the height of the receiver.
|
void |
setImage(Image image)
Sets the receiver's image to the argument, which may be
null indicating that no image should be displayed.
|
void |
setText(java.lang.String string)
Sets the receiver's text.
|
checkSubclass, getImage, getNameText, getText
_addListener, addDisposeListener, addListener, callWindowProc, checkBits, checkOpened, checkOrientation, checkParent, checkWidget, DeferWindowPos, dispose, dragDetect, error, filters, findItem, fixMnemonic, fixMnemonic, getData, getData, getDisplay, getListeners, getMenu, getName, getStyle, hooks, isDisposed, isListening, isValidSubclass, isValidThread, mapEvent, new_GC, notifyListeners, postEvent, postEvent, release, releaseChildren, releaseParent, removeDisposeListener, removeListener, removeListener, reskin, reskinChildren, reskinWidget, sendDragEvent, sendDragEvent, sendEvent, sendEvent, sendEvent, sendEvent, sendFocusEvent, sendKeyEvent, sendKeyEvent, sendMouseEvent, sendMouseEvent, sendMouseWheelEvent, sendSelectionEvent, sendSelectionEvent, setData, setData, setInputState, setKeyState, setLocationMask, setTabGroupFocus, setTabItemFocus, SetWindowPos, showMenu, showMenu, toString, updateMenuLocation, wmCaptureChanged, wmChar, wmContextMenu, wmIMEChar, wmKeyDown, wmKeyUp, wmKillFocus, wmLButtonDblClk, wmLButtonDown, wmLButtonUp, wmMButtonDblClk, wmMButtonDown, wmMButtonUp, wmMouseHover, wmMouseHWheel, wmMouseLeave, wmMouseMove, wmMouseWheel, wmNCPaint, wmPaint, wmPrint, wmRButtonDblClk, wmRButtonDown, wmRButtonUp, wmSetFocus, wmSysChar, wmSysKeyDown, wmSysKeyUp, wmXButtonDblClk, wmXButtonDown, wmXButtonUp
ExpandBar parent
Control control
boolean expanded
boolean hover
int x
int y
int width
int height
int imageHeight
int imageWidth
static final int TEXT_INSET
static final int BORDER
static final int CHEVRON_SIZE
public ExpandItem(ExpandBar parent, int style)
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 constructjava.lang.IllegalArgumentException
- SWTException
- Widget.checkSubclass()
,
Widget.getStyle()
public ExpandItem(ExpandBar parent, int style, int index)
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 zero-relative index to store the receiver in its parentjava.lang.IllegalArgumentException
- SWTException
- Widget.checkSubclass()
,
Widget.getStyle()
private void drawChevron(int hDC, RECT rect)
void destroyWidget()
Widget
When a widget is destroyed in the operating system, its
descendants are also destroyed by the operating system.
This means that it is only necessary to call destroyWidget
on the root of the widget tree.
This method is called after releaseWidget()
.
See also releaseChild()
, releaseWidget()
and releaseHandle()
.
destroyWidget
in class Widget
Widget.dispose()
public Control getControl()
null
.SWTException
- public boolean getExpanded()
true
if the receiver is expanded,
and false otherwise.SWTException
- public int getHeaderHeight()
SWTException
- public int getHeight()
SWTException
- public ExpandBar getParent()
ExpandBar
.SWTException
- int getPreferredWidth(int hTheme, int hDC)
boolean isHover(int x, int y)
void redraw(boolean all)
void releaseHandle()
releaseHandle
in class Widget
void releaseWidget()
releaseWidget
in class Item
void setBounds(int x, int y, int width, int height, boolean move, boolean size)
public void setControl(Control control)
control
- the new control (or null)java.lang.IllegalArgumentException
- SWTException
- public void setExpanded(boolean expanded)
expanded
- the new expanded stateSWTException
- public void setHeight(int height)
height
- the new heightSWTException
- public void setImage(Image image)
Item