From 54cfe427071787940266c7f272ed3ab167a5d704 Mon Sep 17 00:00:00 2001 From: Felipe Heidrich Date: Fri, 3 Feb 2006 20:31:09 +0000 Subject: *** empty log message *** --- .../win32/org/eclipse/swt/widgets/ExpandBar.java | 120 ++++++++++++++++++++- 1 file changed, 118 insertions(+), 2 deletions(-) (limited to 'bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ExpandBar.java') 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 ExpandListener + * interface. + * + * @param listener the listener which should be notified + * + * @exception IllegalArgumentException + * @exception SWTException + * + * @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 + * @exception SWTException + */ 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 + */ +public int getItemCount () { + checkWidget (); return itemCount; } +/** + * 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. + *

+ * + * @return the items in the receiver + * + * @exception SWTException + */ 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 + */ 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 + * @exception SWTException + */ 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 + * @exception SWTException + * + * @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 + */ public void setSpacing (int spacing) { checkWidget (); if (spacing < 0) return; -- cgit