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

public Class ExpandItem

extends Item
Class Inheritance
Imports
org.eclipse.swt.*, org.eclipse.swt.graphics.*, org.eclipse.swt.internal.*, org.eclipse.swt.internal.gtk.*, org.eclipse.swt.internal.gtk3.*, org.eclipse.swt.internal.gtk4.*

Instances of this class represent a selectable user interface object that represents a expandable item in a expand bar.
Styles:
(none)
Events:
(none)

Important Note

This class is not intended to be subclassed.

Since
3.2
See Also
ExpandBar, Sample code and further information

Field Summary

Modifier and TypeField and Description
pack-priv long
pack-priv long
pack-priv Control
pack-priv int
pack-priv long
pack-priv long
pack-priv ExpandBar
pack-priv int
Inherited from org.eclipse.swt.widgets.Item:
ELLIPSISimagetextTEXT_LIMIT

Constructor Summary

AccessConstructor and Description
public
ExpandItem(ExpandBar
a composite control which will be the parent of the new instance (cannot be null)
parent
,
int
the style of control to construct
style
)

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

public
ExpandItem(ExpandBar
a composite control which will be the parent of the new instance (cannot be null)
parent
,
int
the style of control to construct
style
,
int
the zero-relative index to store the receiver in its parent
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.

Method Summary

Modifier and TypeMethod and Description
protected void
checkSubclass()

Overrides org.eclipse.swt.widgets.Item.checkSubclass.

Checks that this class can be subclassed.
pack-priv void
pack-priv void
pack-priv void
pack-priv void
pack-priv long
dpiChanged(long object, long arg0)

Overrides org.eclipse.swt.widgets.Widget.dpiChanged.

public Control

Returns:

the control
getControl
()

Returns the control that is shown when the item is expanded.

public boolean

Returns:

the expanded state
getExpanded
()

Returns true if the receiver is expanded, and false otherwise.

public int

Returns:

the height of the header
getHeaderHeight
()

Returns the height of the receiver's header

pack-priv int
public int

Returns:

the height
getHeight
()

Gets the height of the receiver.

public ExpandBar

Returns:

the receiver's parent
getParent
()

Returns the receiver's parent, which must be a ExpandBar.

pack-priv long
pack-priv long
pack-priv long
pack-priv long
pack-priv long
pack-priv boolean
pack-priv void
pack-priv void
pack-priv void
pack-priv void
pack-priv void
pack-priv void
public void
setControl(Control
the new control (or null)
control
)

Sets the control that is shown when the item is expanded.

public void
setExpanded(boolean
the new expanded state
expanded
)

Sets the expanded state of the receiver.

pack-priv boolean
pack-priv void
setFontDescription(long font)

pack-priv void
public void
setHeight(int
the new height
height
)

Sets the height of the receiver.

pack-priv void
setHeightInPixels(int height)

public void
setImage(Image
the image to display on the receiver (may be null)
image
)

Overrides org.eclipse.swt.widgets.Item.setImage.

Sets the receiver's image to the argument, which may be null indicating that no image should be displayed.
pack-priv void
public void
setText(String
the new text
string
)

Overrides org.eclipse.swt.widgets.Item.setText.

Sets the receiver's text.
pack-priv void
showWidget(int index)

pack-priv long
windowProc(long handle, long user_data)

Overrides org.eclipse.swt.widgets.Widget.windowProc.

Inherited from org.eclipse.swt.widgets.Item:
getImagegetNameTextgetTextupdateTextDirection

Field Detail

boxHandleback to summary
pack-priv long boxHandle
clientHandleback to summary
pack-priv long clientHandle
controlback to summary
pack-priv Control control
heightback to summary
pack-priv int height
imageHandleback to summary
pack-priv long imageHandle
labelHandleback to summary
pack-priv long labelHandle
parentback to summary
pack-priv ExpandBar parent
widthback to summary
pack-priv int width

Constructor Detail

ExpandItemback to summary
public ExpandItem(ExpandBar 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:ExpandBar

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

style:int

the style of control 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
  • ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass
See Also
Widget#checkSubclass, Widget#getStyle
ExpandItemback to summary
public 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.

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

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

style:int

the style of control to construct

index:int

the zero-relative index to store the receiver in its parent

Exceptions
IllegalArgumentException:
  • ERROR_NULL_ARGUMENT - if the parent is null
  • ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the parent (inclusive)
SWTException:
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent
  • ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass
See Also
Widget#checkSubclass, Widget#getStyle

Method Detail

checkSubclassback to summary
protected void checkSubclass()

Overrides org.eclipse.swt.widgets.Item.checkSubclass.

Doc from org.eclipse.swt.widgets.Widget.checkSubclass.

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 Note

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.

Annotations
@Override
createHandleback to summary
pack-priv void createHandle(int index)

Overrides org.eclipse.swt.widgets.Widget.createHandle.

Annotations
@Override
createWidgetback to summary
pack-priv void createWidget(int index)

Overrides org.eclipse.swt.widgets.Widget.createWidget.

Annotations
@Override
deregisterback to summary
pack-priv void deregister()

Overrides org.eclipse.swt.widgets.Widget.deregister.

Annotations
@Override
destroyWidgetback to summary
pack-priv void destroyWidget()

Overrides org.eclipse.swt.widgets.Widget.destroyWidget.

Annotations
@Override
dpiChangedback to summary
pack-priv long dpiChanged(long object, long arg0)

Overrides org.eclipse.swt.widgets.Widget.dpiChanged.

Annotations
@Override
getControlback to summary
public Control getControl()

Returns the control that is shown when the item is expanded. If no control has been set, return null.

Returns:Control

the control

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
getExpandedback to summary
public boolean getExpanded()

Returns true if the receiver is expanded, and false otherwise.

Returns:boolean

the expanded state

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
getHeaderHeightback to summary
public int getHeaderHeight()

Returns the height of the receiver's header

Returns:int

the height of the header

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
getHeaderHeightInPixelsback to summary
pack-priv int getHeaderHeightInPixels()
getHeightback to summary
public int getHeight()

Gets the height of the receiver.

Returns:int

the height

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
getParentback to summary
public ExpandBar getParent()

Returns the receiver's parent, which must be a ExpandBar.

Returns:ExpandBar

the receiver's parent

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
gtk_activateback to summary
pack-priv long gtk_activate(long widget)

Overrides org.eclipse.swt.widgets.Widget.gtk_activate.

Annotations
@Override
gtk_button_press_eventback to summary
pack-priv long gtk_button_press_event(long widget, long event)

Overrides org.eclipse.swt.widgets.Widget.gtk_button_press_event.

Annotations
@Override
gtk_enter_notify_eventback to summary
pack-priv long gtk_enter_notify_event(long widget, long event)

Overrides org.eclipse.swt.widgets.Widget.gtk_enter_notify_event.

Annotations
@Override
gtk_focus_out_eventback to summary
pack-priv long gtk_focus_out_event(long widget, long event)

Overrides org.eclipse.swt.widgets.Widget.gtk_focus_out_event.

Annotations
@Override
gtk_size_allocateback to summary
pack-priv long gtk_size_allocate(long widget, long allocation)

Overrides org.eclipse.swt.widgets.Widget.gtk_size_allocate.

Annotations
@Override
hasFocusback to summary
pack-priv boolean hasFocus()
hookEventsback to summary
pack-priv void hookEvents()

Overrides org.eclipse.swt.widgets.Widget.hookEvents.

Annotations
@Override
registerback to summary
pack-priv void register()

Overrides org.eclipse.swt.widgets.Widget.register.

Annotations
@Override
releaseback to summary
pack-priv void release(boolean destroy)

Overrides org.eclipse.swt.widgets.Widget.release.

Annotations
@Override
releaseHandleback to summary
pack-priv void releaseHandle()

Overrides org.eclipse.swt.widgets.Widget.releaseHandle.

Annotations
@Override
releaseWidgetback to summary
pack-priv void releaseWidget()

Overrides org.eclipse.swt.widgets.Item.releaseWidget.

Annotations
@Override
resizeControlback to summary
pack-priv void resizeControl()
setControlback to summary
public void setControl(Control control)

Sets the control that is shown when the item is expanded.

Parameters
control:Control

the new control (or null)

Exceptions
IllegalArgumentException:
  • ERROR_INVALID_ARGUMENT - if the control has been disposed
  • ERROR_INVALID_PARENT - if the control is not in the same widget tree
SWTException:
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
setExpandedback to summary
public void setExpanded(boolean expanded)

Sets the expanded state of the receiver.

Parameters
expanded:boolean

the new expanded state

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
setFocusback to summary
pack-priv boolean setFocus()
setFontDescriptionback to summary
pack-priv void setFontDescription(long font)
setForegroundRGBAback to summary
pack-priv void setForegroundRGBA(GdkRGBA rgba)
setHeightback to summary
public void setHeight(int height)

Sets the height of the receiver. This is height of the item when it is expanded, excluding the height of the header.

Parameters
height:int

the new height

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
setHeightInPixelsback to summary
pack-priv void setHeightInPixels(int height)
setImageback to summary
public void setImage(Image image)

Overrides org.eclipse.swt.widgets.Item.setImage.

Doc from org.eclipse.swt.widgets.Item.setImage.

Sets the receiver's image to the argument, which may be null indicating that no image should be displayed.

Parameters
image:Image

the image to display on the receiver (may be null)

Annotations
@Override
setOrientationback to summary
pack-priv void setOrientation(boolean create)

Overrides org.eclipse.swt.widgets.Widget.setOrientation.

Annotations
@Override
setTextback to summary
public void setText(String string)

Overrides org.eclipse.swt.widgets.Item.setText.

Doc from org.eclipse.swt.widgets.Item.setText.

Sets the receiver's text.

Note

If control characters like '\n', '\t' etc. are used in the string, then the behavior is platform dependent.

Parameters
string:String

the new text

Annotations
@Override
showWidgetback to summary
pack-priv void showWidget(int index)
windowProcback to summary
pack-priv long windowProc(long handle, long user_data)

Overrides org.eclipse.swt.widgets.Widget.windowProc.

Annotations
@Override