Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 85650 Details for
Bug 213586
Grid needs clear methods
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
Additions to Grid.java (the new clear methods)
Grid.txt (text/plain), 4.67 KB, created by
Chuck Mastrandrea
on 2007-12-20 08:45:59 EST
(
hide
)
Description:
Additions to Grid.java (the new clear methods)
Filename:
MIME Type:
Creator:
Chuck Mastrandrea
Created:
2007-12-20 08:45:59 EST
Size:
4.67 KB
patch
obsolete
> /** > * Clears the item at the given zero-relative index in the receiver. > * The text, icon and other attributes of the item are set to the default > * value. If the table was created with the <code>SWT.VIRTUAL</code> style, > * these attributes are requested again as needed. > * > * @param index the index of the item to clear > * > * @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> > * > * @see SWT#VIRTUAL > * @see SWT#SetData > */ > public void clear(int index) { > GridItem item = getItem(index); > if (item != null) { > item.clear(); > redraw(); > } > } > > /** > * Clears the items in the receiver which are between the given > * zero-relative start and end indices (inclusive). The text, icon > * and other attributes of the items are set to their default values. > * If the table was created with the <code>SWT.VIRTUAL</code> style, > * these attributes are requested again as needed. > * > * @param start the start index of the item to clear > * @param end the end index of the item to clear > * > * @exception IllegalArgumentException <ul> > * <li>ERROR_INVALID_RANGE - if either the start or end are 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> > * > * @see SWT#VIRTUAL > * @see SWT#SetData > */ > public void clear(int start, int end) { > checkWidget(); > if (start > end) return; > > int count = items.size(); > if (!(0 <= start && start <= end && end < count)) { > SWT.error(SWT.ERROR_INVALID_RANGE); > } > boolean cleared = false; > for (int i=start; i<=end; i++) { > GridItem item = (GridItem)items.get(i); > if (item != null) { > item.clear(); > cleared = true; > } > } > if (cleared) { > redraw(); > } > } > > /** > * Clears the items at the given zero-relative indices in the receiver. > * The text, icon and other attributes of the items are set to their default > * values. If the table was created with the <code>SWT.VIRTUAL</code> style, > * these attributes are requested again as needed. > * > * @param indices the array of indices of the items > * > * @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> > * <li>ERROR_NULL_ARGUMENT - if the indices array 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 SWT#VIRTUAL > * @see SWT#SetData > */ > public void clear(int [] indices) { > checkWidget(); > if (indices == null) > SWT.error(SWT.ERROR_NULL_ARGUMENT); > if (indices.length == 0) return; > > int count = items.size(); > for (int i=0; i<indices.length; i++) { > if (!(0 <= indices[i] && indices[i] < count)) { > SWT.error(SWT.ERROR_INVALID_RANGE); > } > } > boolean cleared = false; > for (int i=0; i<indices.length; i++) { > GridItem item = (GridItem)items.get(indices[i]); > if (item != null) { > item.clear(); > cleared = true; > } > } > if (cleared) { > redraw(); > } > } > > /** > * Clears all the items in the receiver. The text, icon and other > * attributes of the items are set to their default values. If the > * table was created with the <code>SWT.VIRTUAL</code> style, these > * attributes are requested again as needed. > * > * @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 SWT#VIRTUAL > * @see SWT#SetData > */ > public void clearAll() { > checkWidget(); > if (items.size() > 0) > clear(0, items.size()-1); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 213586
:
85650
|
85651
|
86104
|
86190
|
86204