diff options
author | Carolyn MacLeod <carolyn> | 2006-05-03 19:22:00 +0000 |
---|---|---|
committer | Carolyn MacLeod <carolyn> | 2006-05-03 19:22:00 +0000 |
commit | 6668e3c7722f160d75069effdbbb9d5090a8d083 (patch) | |
tree | ba9bcfa0e7f649535afaca4b6a35e25510717b64 /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandBar.java | |
parent | 54f158c7143d66ca199d192cc0151756b4f1e693 (diff) | |
download | eclipse.platform.swt-6668e3c7722f160d75069effdbbb9d5090a8d083.tar.gz eclipse.platform.swt-6668e3c7722f160d75069effdbbb9d5090a8d083.tar.xz eclipse.platform.swt-6668e3c7722f160d75069effdbbb9d5090a8d083.zip |
Javadoc basher output for 3.2RC3
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandBar.java')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandBar.java | 165 |
1 files changed, 165 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandBar.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandBar.java index 861ea59739..bf57ea4dbe 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandBar.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandBar.java @@ -15,6 +15,30 @@ import org.eclipse.swt.internal.gtk.*; import org.eclipse.swt.events.*; import org.eclipse.swt.graphics.*; +/** + * Instances of this class support the layout of selectable + * expand bar items. + * <p> + * The item children that may be added to instances of this class + * must be of type <code>ExpandItem</code>. + * </p><p> + * <dl> + * <dt><b>Styles:</b></dt> + * <dd>V_SCROLL</dd> + * <dt><b>Events:</b></dt> + * <dd>Expand, Collapse</dd> + * </dl> + * </p><p> + * IMPORTANT: This class is <em>not</em> intended to be subclassed. + * </p> + * + * @see ExpandItem + * @see ExpandEvent + * @see ExpandListener + * @see ExpandAdapter + * + * @since 3.2 + */ public class ExpandBar extends Composite { ExpandItem [] items; ExpandItem lastFocus; @@ -22,10 +46,56 @@ public class ExpandBar extends Composite { int spacing; int yCurrentScroll; +/** + * Constructs a new instance of this class given its parent + * and a style value describing its behavior and appearance. + * <p> + * The style value is either one of the style constants defined in + * class <code>SWT</code> which is applicable to instances of this + * class, or must be built by <em>bitwise OR</em>'ing together + * (that is, using the <code>int</code> "|" operator) two or more + * of those <code>SWT</code> style constants. The class description + * lists the style constants that are applicable to the class. + * Style bits are also inherited from superclasses. + * </p> + * + * @param parent a composite control which will be the parent of the new instance (cannot be null) + * @param style the style of control to construct + * + * @exception IllegalArgumentException <ul> + * <li>ERROR_NULL_ARGUMENT - if the parent is null</li> + * </ul> + * @exception SWTException <ul> + * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li> + * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li> + * </ul> + * + * @see Widget#checkSubclass + * @see Widget#getStyle + */ public ExpandBar (Composite parent, int style) { super (parent, 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 +277,58 @@ GdkColor getForegroundColor () { return super.getForegroundColor (); } +/** + * 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]; } +/** + * 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,6 +336,16 @@ 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; @@ -368,6 +489,24 @@ int /*long*/ gtk_key_press_event (int /*long*/ widget, int /*long*/ event) { return super.gtk_key_press_event (widget, event); } +/** + * 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); @@ -416,6 +555,23 @@ void releaseChildren (boolean destroy) { super.releaseChildren (destroy); } +/** + * 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 ExpandListener + * @see #addExpandListener + */ public void removeExpandListener (ExpandListener listener) { checkWidget (); if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); @@ -502,6 +658,15 @@ void setScrollbar () { } } +/** + * Sets the receiver's spacing. Spacing specifies the number of pixels allocated around + * each item. + * + * @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; |