diff options
author | Felipe Heidrich <fheidric> | 2006-02-03 20:31:09 +0000 |
---|---|---|
committer | Felipe Heidrich <fheidric> | 2006-02-03 20:31:09 +0000 |
commit | 54cfe427071787940266c7f272ed3ab167a5d704 (patch) | |
tree | 3bc5ef99013cd9a79208fee383570c35644c9c85 /bundles/org.eclipse.swt/Eclipse SWT | |
parent | 6186c749553eb4a46519da6cb65cbb92a7dc4f6d (diff) | |
download | eclipse.platform.swt-54cfe427071787940266c7f272ed3ab167a5d704.tar.gz eclipse.platform.swt-54cfe427071787940266c7f272ed3ab167a5d704.tar.xz eclipse.platform.swt-54cfe427071787940266c7f272ed3ab167a5d704.zip |
*** empty log message ***
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ExpandBar.java | 120 |
1 files changed, 118 insertions, 2 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ExpandBar.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ExpandBar.java index d936533f84..8cb79b3099 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ExpandBar.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ExpandBar.java @@ -79,6 +79,25 @@ public ExpandBar (Composite parent, int style) { super (parent, checkStyle (style)); } +/** + * 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 <code>ExpandListener</code> + * interface. + * + * @param listener the listener which should be notified + * + * @exception IllegalArgumentException <ul> + * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> + * </ul> + * @exception SWTException <ul> + * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> + * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> + * </ul> + * + * @see ExpandListener + * @see #removeExpandListener + */ public void addExpandListener (ExpandListener listener) { checkWidget (); if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); @@ -207,17 +226,58 @@ Control findThemeControl () { return this; } +/** + * Returns the item at the given, zero-relative index in the + * receiver. Throws an exception if the index is out of range. + * + * @param index the index of the item to return + * @return the item at the given index + * + * @exception IllegalArgumentException <ul> + * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li> + * </ul> + * @exception SWTException <ul> + * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> + * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> + * </ul> + */ public ExpandItem getItem (int index) { checkWidget (); if (!(0 <= index && index < itemCount)) error (SWT.ERROR_INVALID_RANGE); return items [index]; } -public int getItemCount() { - checkWidget(); +/** + * Returns the number of items contained in the receiver. + * + * @return the number of items + * + * @exception SWTException <ul> + * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> + * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> + * </ul> + */ +public int getItemCount () { + checkWidget (); return itemCount; } +/** + * Returns an array of <code>ExpandItem</code>s which are the items + * in the receiver. + * <p> + * 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. + * </p> + * + * @return the items in the receiver + * + * @exception SWTException <ul> + * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> + * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> + * </ul> + */ public ExpandItem [] getItems () { checkWidget (); ExpandItem [] result = new ExpandItem [itemCount]; @@ -225,11 +285,39 @@ public ExpandItem [] getItems () { return result; } +/** + * Returns the receiver's spacing. + * + * @return the spacing + * + * @exception SWTException <ul> + * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> + * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> + * </ul> + */ public int getSpacing () { checkWidget (); return spacing; } +/** + * 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. + * + * @param item the search item + * @return the index of the item + * + * @exception IllegalArgumentException <ul> + * <li>ERROR_NULL_ARGUMENT - if the item is null</li> + * <li>ERROR_INVALID_ARGUMENT - if the item has been disposed</li> + * </ul> + * @exception SWTException <ul> + * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> + * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> + * </ul> + */ public int indexOf (ExpandItem item) { checkWidget (); if (item == null) error (SWT.ERROR_NULL_ARGUMENT); @@ -257,6 +345,23 @@ void layoutItems (int index, boolean setScrollbar) { if (setScrollbar) setScrollbar (); } +/** + * Removes the listener from the collection of listeners who will + * be notified when items in the receiver are expanded or collapsed.. + * + * @param listener the listener which should no longer be notified + * + * @exception IllegalArgumentException <ul> + * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> + * </ul> + * @exception SWTException <ul> + * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> + * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> + * </ul> + * + * @see ExapndListener + * @see #addExpandListener + */ public void removeExpandListener (ExpandListener listener) { checkWidget (); if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); @@ -292,6 +397,17 @@ void setScrollbar () { OS.SetScrollInfo (handle, OS.SB_VERT, info, true); } +/** + * Sets the receiver's spacing, spacing specifies the number of pixel allocated around + * each item. + * + * @return the spacing + * + * @exception SWTException <ul> + * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> + * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> + * </ul> + */ public void setSpacing (int spacing) { checkWidget (); if (spacing < 0) return; |