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

public Class ExpandBar

extends Composite
Class Inheritance
Imports
org.eclipse.swt.*, org.eclipse.swt.events.*, 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 support the layout of selectable expand bar items.

The item children that may be added to instances of this class must be of type ExpandItem.

Styles:
V_SCROLL
Events:
Expand, Collapse

Important Note

This class is not intended to be subclassed.

Since
3.2
See Also
ExpandItem, ExpandEvent, ExpandListener, ExpandAdapter, ExpandBar snippets, SWT Example: ControlExample, Sample code and further information

Field Summary

Modifier and TypeField and Description
pack-priv int
pack-priv ExpandItem[]
pack-priv ExpandItem
pack-priv int
Inherited from org.eclipse.swt.widgets.Composite:
backgroundModechildrenLoweredembeddedHandlefixClipHandlefixClipMapimHandlelayoutlayoutCountNO_INPUT_METHODnoChildDrawingpopupChildsocketHandletabList

Constructor Summary

AccessConstructor and Description
public
ExpandBar(Composite
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.

Method Summary

Modifier and TypeMethod and Description
public void
addExpandListener(ExpandListener
the listener which should be notified
listener
)

Adds the listener to the collection of listeners who will be notified when an item in the receiver is expanded or collapsed by sending it one of the messages defined in the ExpandListener interface.

protected void
checkSubclass()

Overrides org.eclipse.swt.widgets.Composite.checkSubclass.

Checks that this class can be subclassed.
pack-priv Point
computeSizeInPixels(int wHint, int hHint, boolean changed)

Overrides org.eclipse.swt.widgets.Composite.computeSizeInPixels.

pack-priv void
pack-priv void
createItem(ExpandItem item, int style, int index)

pack-priv void
pack-priv void
pack-priv long
pack-priv boolean
public ExpandItem

Returns:

the item at the given index
getItem
(int
the index of the item to return
index
)

Returns the item at the given, zero-relative index in the receiver.

public int

Returns:

the number of items
getItemCount
()

Returns the number of items contained in the receiver.

public ExpandItem[]

Returns:

the items in the receiver
getItems
()

Returns an array of ExpandItems which are the items in the receiver.

public int

Returns:

the spacing
getSpacing
()

Returns the receiver's spacing.

pack-priv long
pack-priv long
pack-priv boolean
pack-priv void
public int

Returns:

the index of the item
indexOf
(ExpandItem
the search item
item
)

Searches the receiver's list starting at the first item (index 0) until an item is found that is equal to the argument, and returns the index of that item.

pack-priv void
pack-priv long
pack-priv void
public void
removeExpandListener(ExpandListener
the listener which should no longer be notified
listener
)

Removes the listener from the collection of listeners who will be notified when items in the receiver are expanded or collapsed.

pack-priv void
pack-priv void
pack-priv void
pack-priv void
public void
setSpacing(int
the spacing around each item
spacing
)

Sets the receiver's spacing.

pack-priv void
setSpacingInPixels(int spacing)

pack-priv void
pack-priv void
Inherited from org.eclipse.swt.widgets.Composite:
_getChildren_getTabListadjustChildClippingapplyThemeBackgroundchangedcheckBufferedcheckStylecheckSubwindowcomputeTabListconnectFixedHandleDrawcreateHandlederegisterdrawBackgrounddrawBackgroundInPixelsenableWidgetfindDeferredControlfindMenusfixChildrenfixClippingsfixModalfixParentGdkResourcefixStylefixTabListfixZOrderfocusHandlegetBackgroundModegetChildrengetChildrenCountgetClientAreaInPixelsgetLayoutgetLayoutDeferredgetTabListgtk4_key_press_eventgtk_button_press_eventgtk_drawgtk_focusgtk_focus_in_eventgtk_focus_out_eventgtk_mapgtk_realizegtk_scroll_childgtk_style_updatedhasBorderhooksKeysimHandleisLayoutDeferredisTabGrouplayoutlayoutlayoutlayoutlayoutmarkLayoutminimumSizemoveAbovemoveBelowmoveChildrenmustBeVisibleOnInitBoundsprintWidgetpropagateDrawredrawChildrenregisterreleaseHandlereleaseWidgetremoveControlresizeHandlesetBackgroundModesetBoundssetFocussetLayoutsetLayoutDeferredsetScrollBarVisiblesetTabGroupFocussetTabItemFocussetTabListshowWidgettoStringtranslateMnemonictranslateTraversaltraversalCodeupdateBackgroundModeupdateLayout

Field Detail

itemCountback to summary
pack-priv int itemCount
itemsback to summary
pack-priv ExpandItem[] items
lastFocusback to summary
pack-priv ExpandItem lastFocus
spacingback to summary
pack-priv int spacing

Constructor Detail

ExpandBarback to summary
public ExpandBar(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:Composite

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
SWT#V_SCROLL, Widget#checkSubclass, Widget#getStyle

Method Detail

addExpandListenerback to summary
public void addExpandListener(ExpandListener listener)

Adds the listener to the collection of listeners who will be notified when an item in the receiver is expanded or collapsed by sending it one of the messages defined in the ExpandListener interface.

Parameters
listener:ExpandListener

the listener which should be notified

Exceptions
IllegalArgumentException:
  • ERROR_NULL_ARGUMENT - if the listener is null
SWTException:
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
See Also
ExpandListener, removeExpandListener
checkSubclassback to summary
protected void checkSubclass()

Overrides org.eclipse.swt.widgets.Composite.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
computeSizeInPixelsback to summary
pack-priv Point computeSizeInPixels(int wHint, int hHint, boolean changed)

Overrides org.eclipse.swt.widgets.Composite.computeSizeInPixels.

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

Overrides org.eclipse.swt.widgets.Composite.createHandle.

Annotations
@Override
createItemback to summary
pack-priv void createItem(ExpandItem item, int style, int index)
createWidgetback to summary
pack-priv void createWidget(int index)

Overrides org.eclipse.swt.widgets.Scrollable.createWidget.

Annotations
@Override
destroyItemback to summary
pack-priv void destroyItem(ExpandItem item)
eventHandleback to summary
pack-priv long eventHandle()

Overrides org.eclipse.swt.widgets.Control.eventHandle.

Annotations
@Override
forceFocusback to summary
pack-priv boolean forceFocus(long focusHandle)

Overrides org.eclipse.swt.widgets.Composite.forceFocus.

Annotations
@Override
getItemback to summary
public ExpandItem getItem(int index)

Returns the item at the given, zero-relative index in the receiver. Throws an exception if the index is out of range.

Parameters
index:int

the index of the item to return

Returns:ExpandItem

the item at the given index

Exceptions
IllegalArgumentException:
  • ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)
SWTException:
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
getItemCountback to summary
public int getItemCount()

Returns the number of items contained in the receiver.

Returns:int

the number of items

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
getItemsback to summary
public ExpandItem[] getItems()

Returns an array of ExpandItems which are the items in the receiver.

Note

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

Returns:ExpandItem[]

the items in the receiver

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
getSpacingback to summary
public int getSpacing()

Returns the receiver's spacing.

Returns:int

the spacing

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_key_press_eventback to summary
pack-priv long gtk_key_press_event(long widget, long event)

Overrides org.eclipse.swt.widgets.Composite.gtk_key_press_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()

Overrides org.eclipse.swt.widgets.Control.hasFocus.

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

Overrides org.eclipse.swt.widgets.Composite.hookEvents.

Annotations
@Override
indexOfback to summary
public int indexOf(ExpandItem item)

Searches the receiver's list starting at the first item (index 0) until an item is found that is equal to the argument, and returns the index of that item. If no item is found, returns -1.

Parameters
item:ExpandItem

the search item

Returns:int

the index of the item

Exceptions
IllegalArgumentException:
  • ERROR_NULL_ARGUMENT - if the item is null
  • ERROR_INVALID_ARGUMENT - if the item has been disposed
SWTException:
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
layoutItemsback to summary
pack-priv void layoutItems()
parentingHandleback to summary
pack-priv long parentingHandle()

Overrides org.eclipse.swt.widgets.Composite.parentingHandle.

Annotations
@Override
releaseChildrenback to summary
pack-priv void releaseChildren(boolean destroy)

Overrides org.eclipse.swt.widgets.Composite.releaseChildren.

Annotations
@Override
removeExpandListenerback to summary
public void removeExpandListener(ExpandListener listener)

Removes the listener from the collection of listeners who will be notified when items in the receiver are expanded or collapsed.

Parameters
listener:ExpandListener

the listener which should no longer be notified

Exceptions
IllegalArgumentException:
  • ERROR_NULL_ARGUMENT - if the listener is null
SWTException:
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
See Also
ExpandListener, addExpandListener
reskinChildrenback to summary
pack-priv void reskinChildren(int flags)

Overrides org.eclipse.swt.widgets.Composite.reskinChildren.

Annotations
@Override
setFontDescriptionback to summary
pack-priv void setFontDescription(long font)

Overrides org.eclipse.swt.widgets.Control.setFontDescription.

Annotations
@Override
setForegroundGdkRGBAback to summary
pack-priv void setForegroundGdkRGBA(GdkRGBA rgba)

Overrides org.eclipse.swt.widgets.Control.setForegroundGdkRGBA.

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

Overrides org.eclipse.swt.widgets.Composite.setOrientation.

Annotations
@Override
setSpacingback to summary
public void setSpacing(int spacing)

Sets the receiver's spacing. Spacing specifies the number of points allocated around each item.

Parameters
spacing:int

the spacing around each item

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
setSpacingInPixelsback to summary
pack-priv void setSpacingInPixels(int spacing)
setWidgetBackgroundback to summary
pack-priv void setWidgetBackground()

Overrides org.eclipse.swt.widgets.Control.setWidgetBackground.

Annotations
@Override
updateScrollBarValueback to summary
pack-priv void updateScrollBarValue(ScrollBar bar)

Overrides org.eclipse.swt.widgets.Scrollable.updateScrollBarValue.

Annotations
@Override