public class ExpandBar extends Composite
The item children that may be added to instances of this class
must be of type ExpandItem
.
IMPORTANT: This class is not intended to be subclassed.
ExpandItem
,
ExpandEvent
,
ExpandListener
,
ExpandAdapter
,
ExpandBar snippets,
SWT Example: ControlExample,
Sample code and further informationConstructor and Description |
---|
ExpandBar(Composite parent,
int style)
Constructs a new instance of this class given its parent
and a style value describing its behavior and appearance.
|
Modifier and Type | Method and Description |
---|---|
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. |
protected void |
checkSubclass()
Checks that this class can be subclassed.
|
ExpandItem |
getItem(int index)
Returns the item at the given, zero-relative index in the
receiver.
|
int |
getItemCount()
Returns the number of items contained in the receiver.
|
ExpandItem[] |
getItems()
Returns an array of
ExpandItem s which are the items
in the receiver. |
int |
getSpacing()
Returns the receiver's spacing.
|
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.
|
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.
|
void |
setFont(Font font)
Sets the font that the receiver will use to paint textual information
to the font specified by the argument, or to the default font for that
kind of control if the argument is null.
|
void |
setSpacing(int spacing)
Sets the receiver's spacing.
|
changed, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList
computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar
addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, computeSize, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, getTextDirection, getToolTipText, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isAutoScalable, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, requestLayout, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString
public ExpandBar(Composite 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 constructIllegalArgumentException
- SWTException
- SWT.V_SCROLL
,
Widget.checkSubclass()
,
Widget.getStyle()
public void addExpandListener(ExpandListener listener)
ExpandListener
interface.listener
- the listener which should be notifiedIllegalArgumentException
- SWTException
- ExpandListener
,
removeExpandListener(org.eclipse.swt.events.ExpandListener)
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 Composite
public ExpandItem getItem(int index)
index
- the index of the item to returnIllegalArgumentException
- SWTException
- public int getItemCount()
SWTException
- public ExpandItem[] getItems()
ExpandItem
s 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.
SWTException
- public int getSpacing()
SWTException
- public int indexOf(ExpandItem item)
item
- the search itemIllegalArgumentException
- SWTException
- public void removeExpandListener(ExpandListener listener)
listener
- the listener which should no longer be notifiedIllegalArgumentException
- SWTException
- ExpandListener
,
addExpandListener(org.eclipse.swt.events.ExpandListener)
public void setFont(Font font)
Control
public void setSpacing(int spacing)
spacing
- the spacing around each itemSWTException
- Copyright © 2017. All Rights Reserved.