| java.lang.Object org.eclipse.jface.viewers.Viewer org.eclipse.jface.viewers.ContentViewer org.eclipse.jface.viewers.StructuredViewer org.eclipse.jface.viewers.ColumnViewer org.eclipse.jface.viewers.AbstractTableViewer org.eclipse.jface.viewers.TableViewer org.eclipse.jface.viewers.CheckboxTableViewer
CheckboxTableViewer | public class CheckboxTableViewer extends TableViewer implements ICheckable(Code) | | A concrete viewer based on an SWT Table
control with checkboxes on each node.
This class is not intended to be subclassed outside the viewer framework.
It is designed to be instantiated with a pre-existing SWT table control and configured
with a domain-specific content provider, label provider, element filter (optional),
and element sorter (optional).
|
Constructor Summary | |
public | CheckboxTableViewer(Composite parent) Creates a table viewer on a newly-created table control under the given parent. | public | CheckboxTableViewer(Composite parent, int style) Creates a table viewer on a newly-created table control under the given parent.
The table control is created using the given SWT style bits, plus the
SWT.CHECK style bit.
The table has one column. | public | CheckboxTableViewer(Table table) Creates a table viewer on the given table control. |
Method Summary | |
public void | addCheckStateListener(ICheckStateListener listener) | protected static Table | createTable(Composite parent, int style) Creates a new table control with one column. | public boolean | getChecked(Object element) | public Object[] | getCheckedElements() Returns a list of elements corresponding to checked table items in this
viewer. | public boolean | getGrayed(Object element) Returns the grayed state of the given element. | public Object[] | getGrayedElements() Returns a list of elements corresponding to grayed nodes in this
viewer. | public void | handleSelect(SelectionEvent event) | public static CheckboxTableViewer | newCheckList(Composite parent, int style) Creates a table viewer on a newly-created table control under the given parent.
The table control is created using the given SWT style bits, plus the
SWT.CHECK style bit.
The table shows its contents in a single column, with no header.
The viewer has no input, no content provider, a default label provider,
no sorter, and no filters.
No TableColumn is added. | protected void | preservingSelection(Runnable updateCode) | public void | removeCheckStateListener(ICheckStateListener listener) | public void | setAllChecked(boolean state) Sets to the given value the checked state for all elements in this viewer. | public void | setAllGrayed(boolean state) Sets to the given value the grayed state for all elements in this viewer. | public boolean | setChecked(Object element, boolean state) | public void | setCheckedElements(Object[] elements) Sets which nodes are checked in this viewer. | public boolean | setGrayed(Object element, boolean state) Sets the grayed state for the given element in this viewer. | public void | setGrayedElements(Object[] elements) Sets which nodes are grayed in this viewer. |
CheckboxTableViewer | public CheckboxTableViewer(Composite parent)(Code) | | Creates a table viewer on a newly-created table control under the given parent.
The table control is created using the SWT style bits:
SWT.CHECK and SWT.BORDER .
The table has one column.
The viewer has no input, no content provider, a default label provider,
no sorter, and no filters.
This is equivalent to calling new CheckboxTableViewer(parent, SWT.BORDER) .
See that constructor for more details.
Parameters: parent - the parent control |
CheckboxTableViewer | public CheckboxTableViewer(Composite parent, int style)(Code) | | Creates a table viewer on a newly-created table control under the given parent.
The table control is created using the given SWT style bits, plus the
SWT.CHECK style bit.
The table has one column.
The viewer has no input, no content provider, a default label provider,
no sorter, and no filters.
This also adds a TableColumn for the single column,
and sets a TableLayout on the table which sizes the column to fill
the table for its initial sizing, but does nothing on subsequent resizes.
If the caller just needs to show a single column with no header,
it is preferable to use the newCheckList factory method instead,
since SWT properly handles the initial sizing and subsequent resizes in this case.
If the caller adds its own columns, uses Table.setHeadersVisible(true) ,
or needs to handle dynamic resizing of the table, it is recommended to
create the Table itself, specifying the SWT.CHECK style bit
(along with any other style bits needed), and use new CheckboxTableViewer(Table)
rather than this constructor.
Parameters: parent - the parent control Parameters: style - SWT style bits |
CheckboxTableViewer | public CheckboxTableViewer(Table table)(Code) | | Creates a table viewer on the given table control.
The SWT.CHECK style bit must be set on the given table control.
The viewer has no input, no content provider, a default label provider,
no sorter, and no filters.
Parameters: table - the table control |
createTable | protected static Table createTable(Composite parent, int style)(Code) | | Creates a new table control with one column.
Parameters: parent - the parent control Parameters: style - style bits a new table control |
getCheckedElements | public Object[] getCheckedElements()(Code) | | Returns a list of elements corresponding to checked table items in this
viewer.
This method is typically used when preserving the interesting
state of a viewer; setCheckedElements is used during the restore.
the array of checked elements See Also: CheckboxTableViewer.setCheckedElements |
getGrayed | public boolean getGrayed(Object element)(Code) | | Returns the grayed state of the given element.
Parameters: element - the element true if the element is grayed,and false if not grayed |
getGrayedElements | public Object[] getGrayedElements()(Code) | | Returns a list of elements corresponding to grayed nodes in this
viewer.
This method is typically used when preserving the interesting
state of a viewer; setGrayedElements is used during the restore.
the array of grayed elements See Also: CheckboxTableViewer.setGrayedElements |
handleSelect | public void handleSelect(SelectionEvent event)(Code) | | |
newCheckList | public static CheckboxTableViewer newCheckList(Composite parent, int style)(Code) | | Creates a table viewer on a newly-created table control under the given parent.
The table control is created using the given SWT style bits, plus the
SWT.CHECK style bit.
The table shows its contents in a single column, with no header.
The viewer has no input, no content provider, a default label provider,
no sorter, and no filters.
No TableColumn is added. SWT does not require a
TableColumn if showing only a single column with no header.
SWT correctly handles the initial sizing and subsequent resizes in this case.
Parameters: parent - the parent control Parameters: style - SWT style bits since: 2.0 CheckboxTableViewer |
preservingSelection | protected void preservingSelection(Runnable updateCode)(Code) | | |
setAllChecked | public void setAllChecked(boolean state)(Code) | | Sets to the given value the checked state for all elements in this viewer.
Does not fire events to check state listeners.
Parameters: state - true if the element should be checked,and false if it should be unchecked |
setAllGrayed | public void setAllGrayed(boolean state)(Code) | | Sets to the given value the grayed state for all elements in this viewer.
Parameters: state - true if the element should be grayed,and false if it should be ungrayed |
setChecked | public boolean setChecked(Object element, boolean state)(Code) | | |
setCheckedElements | public void setCheckedElements(Object[] elements)(Code) | | Sets which nodes are checked in this viewer.
The given list contains the elements that are to be checked;
all other nodes are to be unchecked.
Does not fire events to check state listeners.
This method is typically used when restoring the interesting
state of a viewer captured by an earlier call to getCheckedElements .
Parameters: elements - the list of checked elements (element type: Object ) See Also: CheckboxTableViewer.getCheckedElements |
setGrayed | public boolean setGrayed(Object element, boolean state)(Code) | | Sets the grayed state for the given element in this viewer.
Parameters: element - the element Parameters: state - true if the item should be grayed,and false if it should be ungrayed true if the element is visible and the graystate could be set, and false otherwise |
setGrayedElements | public void setGrayedElements(Object[] elements)(Code) | | Sets which nodes are grayed in this viewer.
The given list contains the elements that are to be grayed;
all other nodes are to be ungrayed.
This method is typically used when restoring the interesting
state of a viewer captured by an earlier call to getGrayedElements .
Parameters: elements - the array of grayed elements See Also: CheckboxTableViewer.getGrayedElements |
Methods inherited from org.eclipse.jface.viewers.StructuredViewer | public void addDoubleClickListener(IDoubleClickListener listener)(Code)(Java Doc) public void addDragSupport(int operations, Transfer[] transferTypes, DragSourceListener listener)(Code)(Java Doc) public void addDropSupport(int operations, Transfer[] transferTypes, DropTargetListener listener)(Code)(Java Doc) public void addFilter(ViewerFilter filter)(Code)(Java Doc) public void addOpenListener(IOpenListener listener)(Code)(Java Doc) public void addPostSelectionChangedListener(ISelectionChangedListener listener)(Code)(Java Doc) protected void assertContentProviderType(IContentProvider provider)(Code)(Java Doc) protected void assertElementsNotNull(Object[] elements)(Code)(Java Doc) protected void associate(Object element, Item item)(Code)(Java Doc) protected void buildLabel(ViewerLabel updateLabel, Object element)(Code)(Java Doc) void buildLabel(ViewerLabel updateLabel, Object element, IViewerLabelProvider labelProvider)(Code)(Java Doc) void buildLabel(ViewerLabel updateLabel, TreePath elementPath, ITreePathLabelProvider labelProvider)(Code)(Java Doc) void buildLabel(ViewerLabel updateLabel, Object element, ILabelProvider labelProvider)(Code)(Java Doc) protected void disassociate(Item item)(Code)(Java Doc) abstract protected Widget doFindInputItem(Object element)(Code)(Java Doc) abstract protected Widget doFindItem(Object element)(Code)(Java Doc) abstract protected void doUpdateItem(Widget item, Object element, boolean fullMap)(Code)(Java Doc) protected boolean equals(Object elementA, Object elementB)(Code)(Java Doc) protected Object[] filter(Object[] elements)(Code)(Java Doc) final protected Widget findItem(Object element)(Code)(Java Doc) final protected Widget[] findItems(Object element)(Code)(Java Doc) protected void fireDoubleClick(DoubleClickEvent event)(Code)(Java Doc) protected void fireOpen(OpenEvent event)(Code)(Java Doc) protected void firePostSelectionChanged(SelectionChangedEvent event)(Code)(Java Doc) protected ColorAndFontCollector getColorAndFontCollector()(Code)(Java Doc) public ViewerComparator getComparator()(Code)(Java Doc) public IElementComparer getComparer()(Code)(Java Doc) protected Object[] getFilteredChildren(Object parent)(Code)(Java Doc) public ViewerFilter[] getFilters()(Code)(Java Doc) protected Item getItem(int x, int y)(Code)(Java Doc) protected Object[] getRawChildren(Object parent)(Code)(Java Doc) protected Object getRoot()(Code)(Java Doc) public ISelection getSelection()(Code)(Java Doc) abstract protected List getSelectionFromWidget()(Code)(Java Doc) protected Object[] getSortedChildren(Object parent)(Code)(Java Doc) public ViewerSorter getSorter()(Code)(Java Doc) protected void handleDispose(DisposeEvent event)(Code)(Java Doc) protected void handleDoubleSelect(SelectionEvent event)(Code)(Java Doc) protected void handleInvalidSelection(ISelection invalidSelection, ISelection newSelection)(Code)(Java Doc) protected void handleLabelProviderChanged(LabelProviderChangedEvent event)(Code)(Java Doc) protected void handleOpen(SelectionEvent event)(Code)(Java Doc) protected void handlePostSelect(SelectionEvent e)(Code)(Java Doc) protected void handleSelect(SelectionEvent event)(Code)(Java Doc) protected boolean hasFilters()(Code)(Java Doc) protected void hookControl(Control control)(Code)(Java Doc) abstract protected void internalRefresh(Object element)(Code)(Java Doc) protected void internalRefresh(Object element, boolean updateLabels)(Code)(Java Doc) protected void internalUpdate(Widget widget, Object element, String[] properties)(Code)(Java Doc) protected void mapElement(Object element, Widget item)(Code)(Java Doc) protected boolean needsRefilter(Object element, String property)(Code)(Java Doc) CustomHashtable newHashtable(int capacity)(Code)(Java Doc) protected void preservingSelection(Runnable updateCode)(Code)(Java Doc) void preservingSelection(Runnable updateCode, boolean reveal)(Code)(Java Doc) public void refresh()(Code)(Java Doc) public void refresh(boolean updateLabels)(Code)(Java Doc) public void refresh(Object element)(Code)(Java Doc) public void refresh(Object element, boolean updateLabels)(Code)(Java Doc) final protected void refreshItem(Widget widget, Object element)(Code)(Java Doc) public void removeDoubleClickListener(IDoubleClickListener listener)(Code)(Java Doc) public void removeFilter(ViewerFilter filter)(Code)(Java Doc) public void removeOpenListener(IOpenListener listener)(Code)(Java Doc) public void removePostSelectionChangedListener(ISelectionChangedListener listener)(Code)(Java Doc) public void resetFilters()(Code)(Java Doc) abstract public void reveal(Object element)(Code)(Java Doc) public void setComparator(ViewerComparator comparator)(Code)(Java Doc) public void setComparer(IElementComparer comparer)(Code)(Java Doc) public void setContentProvider(IContentProvider provider)(Code)(Java Doc) public void setFilters(ViewerFilter[] filters)(Code)(Java Doc) final public void setInput(Object input)(Code)(Java Doc) public void setLabelProvider(IBaseLabelProvider labelProvider)(Code)(Java Doc) public void setSelection(ISelection selection, boolean reveal)(Code)(Java Doc) abstract protected void setSelectionToWidget(List l, boolean reveal)(Code)(Java Doc) protected void setSelectionToWidget(ISelection selection, boolean reveal)(Code)(Java Doc) public void setSorter(ViewerSorter sorter)(Code)(Java Doc) public void setUseHashlookup(boolean enable)(Code)(Java Doc) public Widget testFindItem(Object element)(Code)(Java Doc) public Widget[] testFindItems(Object element)(Code)(Java Doc) protected void unmapAllElements()(Code)(Java Doc) protected void unmapElement(Object element)(Code)(Java Doc) protected void unmapElement(Object element, Widget item)(Code)(Java Doc) public void update(Object[] elements, String[] properties)(Code)(Java Doc) public void update(Object element, String[] properties)(Code)(Java Doc) final protected void updateItem(Widget widget, Object element)(Code)(Java Doc) protected void updateSelection(ISelection selection)(Code)(Java Doc) protected boolean usingElementMap()(Code)(Java Doc)
|
Fields inherited from org.eclipse.jface.viewers.Viewer | final protected static String WIDGET_DATA_KEY(Code)(Java Doc)
|
|
|