|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.eclipse.swt.widgets.Widget | +--org.eclipse.swt.widgets.Control | +--org.eclipse.swt.widgets.Scrollable | +--org.eclipse.swt.widgets.List
Safe: Instances of this class represent a selectable user interface object that displays a list of strings and issues notificiation when a string selected. A list may be single or multi select.
Note: Only one of SINGLE and MULTI may be specified.
IMPORTANT: This class is not intended to be subclassed.
Field Summary | |
(package private) static org.eclipse.swt.internal.win32.TCHAR |
ListClass
|
(package private) static int |
ListProc
|
Fields inherited from class org.eclipse.swt.widgets.Scrollable |
horizontalBar, verticalBar |
Fields inherited from class org.eclipse.swt.widgets.Control |
ACCENTS, accessible, background, drawCount, foreground, handle, hCursor, layoutData, menu, parent, toolTipText |
Fields inherited from class org.eclipse.swt.widgets.Widget |
CANVAS, COMCTL32_MAJOR, COMCTL32_MINOR, data, DEFAULT_HEIGHT, DEFAULT_WIDTH, DISABLED, DISPOSED, eventTable, HIDDEN, keys, MAJOR, MINOR, Mnemonic, state, style, values |
Constructor Summary | |
List(Composite parent,
int style)
Enabled: Constructs a new instance of this class given its parent and a style value describing its behavior and appearance. |
Method Summary | |
void |
add(String string)
Enabled: Adds the argument to the end of the receiver's list. |
void |
add(String string,
int index)
Enabled: Adds the argument to the receiver's list at the given zero-relative index. |
void |
addSelectionListener(SelectionListener listener)
Enabled: Adds the listener to the collection of listeners who will be notified when the receiver's selection changes, by sending it one of the messages defined in the SelectionListener
interface. |
(package private) int |
callWindowProc(int msg,
int wParam,
int lParam)
|
(package private) static int |
checkStyle(int style)
|
Point |
computeSize(int wHint,
int hHint,
boolean changed)
Enabled: |
(package private) int |
defaultBackground()
|
void |
deselect(int index)
Enabled: Deselects the item at the given zero-relative index in the receiver. |
void |
deselect(int[] indices)
Enabled: Deselects the items at the given zero-relative indices in the receiver. |
void |
deselect(int start,
int end)
Enabled: Deselects the items at the given zero-relative indices in the receiver. |
void |
deselectAll()
Enabled: Deselects all selected items in the receiver. |
int |
getFocusIndex()
Enabled: Returns the zero-relative index of the item which is currently has the focus in the receiver, or -1 if no item is has focus. |
String |
getItem(int index)
Enabled: Returns the item at the given, zero-relative index in the receiver. |
int |
getItemCount()
Enabled: Returns the number of items contained in the receiver. |
int |
getItemHeight()
Enabled: Returns the height of the area which would be used to display one of the items in the tree. |
String[] |
getItems()
Enabled: Returns an array of String s which are the items
in the receiver. |
String[] |
getSelection()
Enabled: Returns an array of String s that are currently
selected in the receiver. |
int |
getSelectionCount()
Enabled: Returns the number of selected items contained in the receiver. |
int |
getSelectionIndex()
Enabled: Returns the zero-relative index of the item which is currently selected in the receiver, or -1 if no item is selected. |
int[] |
getSelectionIndices()
Enabled: Returns the zero-relative indices of the items which are currently selected in the receiver. |
int |
getTopIndex()
Enabled: Returns the zero-relative index of the item which is currently at the top of the receiver. |
int |
indexOf(String string)
Enabled: Gets the index of an item. |
int |
indexOf(String string,
int start)
Enabled: Searches the receiver's list starting at the given, zero-relative index until an item is found that is equal to the argument, and returns the index of that item. |
boolean |
isSelected(int index)
Enabled: Returns true if the item is selected,
and false otherwise. |
void |
remove(int index)
Enabled: Removes the item from the receiver at the given zero-relative index. |
void |
remove(int[] indices)
Enabled: Removes the items from the receiver at the given zero-relative indices. |
void |
remove(int start,
int end)
Enabled: Removes the items from the receiver which are between the given zero-relative start and end indices (inclusive). |
void |
remove(String string)
Enabled: Searches the receiver's list starting at the first item until an item is found that is equal to the argument, and removes that item from the list. |
void |
removeAll()
Enabled: Removes all of the items from the receiver. |
void |
removeSelectionListener(SelectionListener listener)
Enabled: Removes the listener from the collection of listeners who will be notified when the receiver's selection changes. |
void |
select(int index)
Enabled: Selects the item at the given zero-relative index in the receiver's list. |
void |
select(int[] indices)
Enabled: Selects the items at the given zero-relative indices in the receiver. |
(package private) void |
select(int[] indices,
boolean scroll)
|
(package private) void |
select(int index,
boolean scroll)
|
void |
select(int start,
int end)
Enabled: Selects the items at the given zero-relative indices in the receiver. |
(package private) void |
select(int start,
int end,
boolean scroll)
|
void |
selectAll()
Enabled: Selects all the items in the receiver. |
(package private) void |
setBounds(int x,
int y,
int width,
int height,
int flags)
|
(package private) void |
setFocusIndex(int index)
|
void |
setFont(Font font)
Enabled: |
void |
setItem(int index,
String string)
Enabled: Sets the text of the item in the receiver's list at the given zero-relative index to the string argument. |
void |
setItems(String[] items)
Enabled: Sets the receiver's items to be the given array of items. |
(package private) void |
setScrollWidth()
|
(package private) void |
setScrollWidth(int newWidth,
boolean grow)
|
(package private) void |
setScrollWidth(org.eclipse.swt.internal.win32.TCHAR buffer,
boolean grow)
|
void |
setSelection(int index)
Enabled: Selects the item at the given zero-relative index in the receiver. |
void |
setSelection(int[] indices)
Enabled: Selects the items at the given zero-relative indices in the receiver. |
void |
setSelection(int start,
int end)
Enabled: Selects the items at the given zero-relative indices in the receiver. |
void |
setSelection(String[] items)
Enabled: Sets the receiver's selection to be the given array of items. |
void |
setTopIndex(int index)
Enabled: Sets the zero-relative index of the item which is currently at the top of the receiver. |
void |
showSelection()
Enabled: Shows the selection. |
(package private) int |
widgetStyle()
|
(package private) org.eclipse.swt.internal.win32.TCHAR |
windowClass()
|
(package private) int |
windowProc()
|
(package private) org.eclipse.swt.internal.win32.LRESULT |
wmCommandChild(int wParam,
int lParam)
|
Methods inherited from class org.eclipse.swt.widgets.Scrollable |
computeTrim, createScrollBar, createWidget, getClientArea, getHorizontalBar, getVerticalBar, releaseWidget, widgetExtStyle, WM_HSCROLL, WM_MOUSEWHEEL, WM_SIZE, WM_VSCROLL, wmScroll |
Methods inherited from class org.eclipse.swt.widgets.Widget |
addDisposeListener, addListener, checkBits, checkParent, checkSubclass, checkWidget, dispose, error, filters, getData, getData, getName, getNameText, getStyle, hooks, isListening, isValidSubclass, isValidThread, mbcsToWcs, mbcsToWcs, notifyListeners, postEvent, postEvent, releaseChild, releaseResources, removeDisposeListener, removeListener, removeListener, sendEvent, sendEvent, sendEvent, sendEvent, setData, setData, setInputState, setKeyState, toString, wcsToMbcs, wcsToMbcs |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
static final int ListProc
static final org.eclipse.swt.internal.win32.TCHAR ListClass
Constructor Detail |
public List(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 constructSWT.SINGLE
,
SWT.MULTI
,
Widget.checkSubclass()
,
Widget.getStyle()
Method Detail |
public void add(String string)
string
- the new itemadd(String,int)
public void add(String string, int index)
Note: To add an item at the end of the list, use the
result of calling getItemCount()
as the
index or use add(String)
.
string
- the new itemindex
- the index for the itemadd(String)
public void addSelectionListener(SelectionListener listener)
SelectionListener
interface.
widgetSelected
is called when the selection changes.
widgetDefaultSelected
is typically called when an item is double-clicked.
listener
- the listener which should be notifiedSelectionListener
,
removeSelectionListener(org.eclipse.swt.events.SelectionListener)
,
SelectionEvent
int callWindowProc(int msg, int wParam, int lParam)
callWindowProc
in class Scrollable
static int checkStyle(int style)
public Point computeSize(int wHint, int hHint, boolean changed)
computeSize
in class Control
wHint
- the width hint (can be SWT.DEFAULT
)hHint
- the height hint (can be SWT.DEFAULT
)changed
- true
if the control's contents have changed, and false
otherwise
Layout
,
Control.getBorderWidth()
,
Control.getBounds()
,
Control.getSize()
,
Control.pack()
,
"computeTrim, getClientArea for controls that implement them"int defaultBackground()
defaultBackground
in class Control
public void deselect(int[] indices)
indices
- the array of indices for the items to deselectpublic void deselect(int index)
index
- the index of the item to deselectpublic void deselect(int start, int end)
start
- the start index of the items to deselectend
- the end index of the items to deselectpublic void deselectAll()
public int getFocusIndex()
public String getItem(int index)
index
- the index of the item to return
public int getItemCount()
public int getItemHeight()
public String[] getItems()
String
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.
public String[] getSelection()
String
s that are currently
selected in the receiver. An empty array indicates that no
items are selected.
Note: This is not the actual structure used by the receiver to maintain its selection, so modifying the array will not affect the receiver.
public int getSelectionCount()
public int getSelectionIndex()
public int[] getSelectionIndices()
Note: This is not the actual structure used by the receiver to maintain its selection, so modifying the array will not affect the receiver.
public int getTopIndex()
public int indexOf(String string)
The list is searched starting at 0 until an item is found that is equal to the search item. If no item is found, -1 is returned. Indexing is zero based.
string
- the search item
public int indexOf(String string, int start)
string
- the search item
public boolean isSelected(int index)
true
if the item is selected,
and false
otherwise. Indices out of
range are ignored.
index
- the index of the item
public void remove(int[] indices)
indices
- the array of indices of the itemspublic void remove(int index)
index
- the index for the itempublic void remove(int start, int end)
start
- the start of the rangeend
- the end of the rangepublic void remove(String string)
string
- the item to removepublic void removeAll()
public void removeSelectionListener(SelectionListener listener)
listener
- the listener which should no longer be notifiedSelectionListener
,
addSelectionListener(org.eclipse.swt.events.SelectionListener)
public void select(int[] indices)
indices
- the array of indices for the items to selectvoid select(int[] indices, boolean scroll)
public void select(int index)
index
- the index of the item to selectvoid select(int index, boolean scroll)
public void select(int start, int end)
start
- the start of the rangeend
- the end of the rangevoid select(int start, int end, boolean scroll)
public void selectAll()
void setBounds(int x, int y, int width, int height, int flags)
setBounds
in class Control
void setFocusIndex(int index)
public void setFont(Font font)
setFont
in class Control
font
- the new font (or null)public void setItem(int index, String string)
remove
'ing the old item at the index, and then
add
'ing the new item at that index.
index
- the index for the itemstring
- the new text for the itempublic void setItems(String[] items)
items
- the array of itemsvoid setScrollWidth()
void setScrollWidth(org.eclipse.swt.internal.win32.TCHAR buffer, boolean grow)
void setScrollWidth(int newWidth, boolean grow)
public void setSelection(int[] indices)
indices
- the indices of the items to selectdeselectAll()
,
select(int[])
public void setSelection(String[] items)
items
- the array of itemsdeselectAll()
,
select(int)
public void setSelection(int index)
index
- the index of the item to selectdeselectAll()
,
select(int)
public void setSelection(int start, int end)
start
- the start index of the items to selectend
- the end index of the items to selectTable.deselectAll()
,
Table.select(int,int)
public void setTopIndex(int index)
index
- the index of the top itempublic void showSelection()
int widgetStyle()
widgetStyle
in class Scrollable
org.eclipse.swt.internal.win32.TCHAR windowClass()
windowClass
in class Scrollable
int windowProc()
windowProc
in class Scrollable
org.eclipse.swt.internal.win32.LRESULT wmCommandChild(int wParam, int lParam)
wmCommandChild
in class Control
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |