Searches the receiver's items in the order they are currently
being displayed, 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.

Constructor Detail

CoolBar

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 - a composite control which will be the parent of the new instance (cannot be null)

Method Detail

checkSubclass

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.

computeSize

The preferred size of a control is the size that it would
best be displayed at. The width hint and height hint arguments
allow the caller to ask a control questions such as "Given a particular
width, how high does the control 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.

If the changed flag is true, it indicates that the receiver's
contents have changed, therefore any caches that a layout manager
containing the control may have been keeping need to be flushed. When the
control is resized, the changed flag will be false, so layout
manager caches can be retained.

ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver

Since:

2.0

getWrapIndices

public int[] getWrapIndices()

Returns an array of ints that describe the zero-relative
indices of any item(s) in the receiver that will begin on
a new row. The 0th visible item always begins the first row,
therefore it does not count as a wrap index.

Returns:

an array containing the receiver's wrap indices, or an empty array if all items are in one row

indexOf

Searches the receiver's items in the order they are currently
being displayed, 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 - the search item

Returns:

the visual order index of the search item, or -1 if the item is not found

setItemLayout

Sets the receiver's item order, wrap indices, and item sizes
all at once. This method is typically used to restore the
displayed state of the receiver to a previously stored state.

The item order is the order in which the items in the receiver
should be displayed, given in terms of the zero-relative ordering
of when the items were added.

The wrap indices are the indices of all item(s) in the receiver
that will begin on a new row. The indices are given in the order
specified by the item order. The 0th item always begins the first
row, therefore it does not count as a wrap index. If wrap indices
is null or empty, the items will be placed on one line.

The sizes are specified in an array of points whose x and y
coordinates describe the new widths and heights (respectively)
of the receiver's items in the order specified by the item order.

Parameters:

itemOrder - an array of indices that describe the new order to display the items in

wrapIndices - an array of wrap indices, or null

sizes - an array containing the new sizes for each of the receiver's items in visual order

ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver

Since:

2.0

setWrapIndices

public void setWrapIndices(int[] indices)

Sets the indices of all item(s) in the receiver that will
begin on a new row. The indices are given in the order in
which they are currently being displayed. The 0th item
always begins the first row, therefore it does not count
as a wrap index. If indices is null or empty, the items
will be placed on one line.