| |
|
| java.lang.Object net.refractions.udig.ui.FeatureTableControl
FeatureTableControl | public class FeatureTableControl implements ISelectionProvider(Code) | | A TreeViewer control for viewing a table of Feature attributes.
The object is used by using a FeatureCollection. In this case the control hangs on to a reference
to the FeatureCollection and populates the table entries directory from it. This method results
in a single page containing all features.
If the FeatureCollection implements the
IAdaptable interface and adapts to
ICellModifier then the table is editable. The
ICellModifier is used to modify the
features. The Column properties passed to the
ICellModifier are the attribute name of the
attribute being modified.
If the FeatureCollection implements the
IAdaptable interface and adapts to
CellEditor[] then the cell editors will be used to edit the cells. This is optional for
editing. By default a
TextCellEditor is used for editing most cells, and an
AttributeValidator is used to validate the new values. The first column is for the fid
column and will not be used since FIDS are assigned by the datastore and can not be modified. The
number of Items the array (this is the same for the cell editor validators and cell editor
listeners) must be either the number of attributes in the feature type or the number of
attributes + 1 (one for the FID column). If the number of editors it Attributes+1 then the first
element in the array will not be used as it is assumed to be a placeholder for the fid column.
If the FeatureCollection implements the
IAdaptable interface and adapts to
ICellEditorValidator[] then the validators will be used to validate the cells.
If the FeatureCollection implements the
IAdaptable interface and adapts to
ICellEditorListener[] then the listeners will be added to the
CellEditor s.
author: jdeolive author: jeichar since: 0.3 |
Method Summary | |
public void | addLoadingListener(IFeatureTableLoadingListener listener) | public void | addSelectionChangedListener(ISelectionChangedListener listener) | public void | assertInternallyConsistent() Checks all the lists, caches, content providers, etc... | public void | clear() | public void | createTableControl(Composite parent) Creates the table control. | protected void | createTableViewer(Composite parent) Creates the table control itself. | public FeatureCollection | deleteSelection() Removes the selected features (the features selected by the owning
FeatureTableControl ). | public void | dispose() | public Control | getControl() Returns the control representing the table control. | public FeatureCollection | getFeatures() | public int | getPageSize() Returns the number of features viewed in the table per page. | public ISelection | getSelection() | public int | getSelectionCount() | FeatureTableSelectionProvider | getSelectionProvider() | public TableViewer | getViewer() | public void | message(String text, Color background, Color foreground) Displays a message. | public void | message(String text) Displays a message. | protected void | notifyLoadingListeners(LoadingEvent event) | public void | promoteSelection() Sorts the table so that the selection is at the top of the table.
It does not last. | public void | remove(IFeatureTableLoadingListener listener) | public void | removeSelectionChangedListener(ISelectionChangedListener listener) | public void | select(String text, String[] attributes, boolean selectAll) select the features found that has the text. | public void | setFeatures(FeatureCollection features) | public void | setFocus() Does nothing. | public void | setMenuManager(MenuManager contextMenu) Sets the context Menu used by the table view. | public void | setPageSize(int resPerPage) Sets the number of features viewed in the table per page. | public void | setSelection(ISelection newSelection) | public void | setSelection(StructuredSelection selection, boolean reveal) | public void | sort(Comparator<Feature> comparator, int dir, TableColumn sortColumn) Sorts the features in the tableView.
Parameters: comparator - comparator to use for the sorting. Parameters: dir - the direction to set the column SWT.UP or SWT.DOWN. | void | sort(boolean refreshTable) Resorts the table using the last comparator. | public void | update() Updates the table control with the current set of features. | public void | update(FeatureCollection features2) Updates the features that have the same feature ID to match the new feature or adds the features if they are not part of the
current collection. |
CACHING_WARNING | final public static String CACHING_WARNING(Code) | | Key for indicating whether the warning should be displayed. false if the warning is displayed
|
ERROR_COLUMN_PROPERTY | final public static Object ERROR_COLUMN_PROPERTY(Code) | | |
FEATURE_ID_COLUMN_PROPERTY | final public static String FEATURE_ID_COLUMN_PROPERTY(Code) | | |
features | FeatureCollection features(Code) | | |
FeatureTableControl | public FeatureTableControl()(Code) | | Construct FeatureTableControl .
Must call setFeatures before use.
|
FeatureTableControl | public FeatureTableControl(Composite parent, FeatureCollection features)(Code) | | Construct a FeatureTableControl .
Parameters: monitorProvider - a provider that will provider progress monitors for displaying loadinginformation. Parameters: fReader - The FeatureReader that returns the actual features. Parameters: resPerPage - Results per page to be shown in the table. |
FeatureTableControl | public FeatureTableControl(IProvider<IProgressMonitor> monitorProvider)(Code) | | Construct FeatureTableControl .
Must call setFeatures before use.
Parameters: monitorProvider - a provider that will provider progress monitors for displaying loadinginformation. |
FeatureTableControl | public FeatureTableControl(IProvider<IProgressMonitor> monitorProvider, Composite parent, FeatureCollection features)(Code) | | Construct a FeatureTableControl .
Parameters: monitorProvider - a provider that will provider progress monitors for displaying loadinginformation. Parameters: fReader - The FeatureReader that returns the actual features. Parameters: resPerPage - Results per page to be shown in the table. |
addSelectionChangedListener | public void addSelectionChangedListener(ISelectionChangedListener listener)(Code) | | |
assertInternallyConsistent | public void assertInternallyConsistent()(Code) | | Checks all the lists, caches, content providers, etc... are consistent with each other.
This is an expensive method so should be called with care. A test is a good example.
|
clear | public void clear()(Code) | | Don't display nothing :-)
|
createTableControl | public void createTableControl(Composite parent)(Code) | | Creates the table control.
Parameters: parent - The to be parent of the control. |
createTableViewer | protected void createTableViewer(Composite parent)(Code) | | Creates the table control itself.
Parameters: parent - |
dispose | public void dispose()(Code) | | |
getControl | public Control getControl()(Code) | | Returns the control representing the table control.
The internal table viewer control. |
getFeatures | public FeatureCollection getFeatures()(Code) | | Contents of the current page of features
|
getPageSize | public int getPageSize()(Code) | | Returns the number of features viewed in the table per page.
positive integer. |
getSelection | public ISelection getSelection()(Code) | | Returns a selection with a single FidFilter indicating the features selected
|
getSelectionCount | public int getSelectionCount()(Code) | | |
getViewer | public TableViewer getViewer()(Code) | | |
message | public void message(String text, Color background, Color foreground)(Code) | | Displays a message. If text == null or "" then the message is hidden and tableViewer is shown again.
Parameters: text - message to display Parameters: background - color of the background of the text widget. If null the default color is used Parameters: foreground - color of the foreground of the text widget. If null the default color is used |
message | public void message(String text)(Code) | | Displays a message. If text == null or "" then the message is hidden and tableViewer is shown again.
Parameters: text - message to display |
promoteSelection | public void promoteSelection()(Code) | | Sorts the table so that the selection is at the top of the table.
It does not last. The next selection will not be at the top.
|
removeSelectionChangedListener | public void removeSelectionChangedListener(ISelectionChangedListener listener)(Code) | | |
select | public void select(String text, String[] attributes, boolean selectAll) throws PatternSyntaxException(Code) | | select the features found that has the text. Only the attributes indicated are searched.
If
FeatureTableControl.ALL is selected then all attributes will be searched
Parameters: text - text to search for it will first be assumed that it is a reg ex expression Parameters: attributes - the attributes to search. See FeatureTableControl.ALL Parameters: selectAll - if true all matched features will be selected otherwise just the first feature |
setFeatures | public void setFeatures(FeatureCollection features)(Code) | | Set up for a single page of content
|
setFocus | public void setFocus()(Code) | | Does nothing.
See Also: org.eclipse.ui.IWorkbenchPart.setFocus |
setMenuManager | public void setMenuManager(MenuManager contextMenu)(Code) | | Sets the context Menu used by the table view. Not menu is used for the message box.
Parameters: contextMenu - menu manager used for creating the menu. |
setPageSize | public void setPageSize(int resPerPage)(Code) | | Sets the number of features viewed in the table per page.
Parameters: resPerPage - positive integer. |
setSelection | public void setSelection(ISelection newSelection)(Code) | | Useable selections are:
selection of features, FIDS and Filters/Queries that adapt to a FeatureSource
|
setSelection | public void setSelection(StructuredSelection selection, boolean reveal)(Code) | | |
sort | public void sort(Comparator<Feature> comparator, int dir, TableColumn sortColumn)(Code) | | Sorts the features in the tableView.
Parameters: comparator - comparator to use for the sorting. Parameters: dir - the direction to set the column SWT.UP or SWT.DOWN. If SWT.UP then the table item with index 0 is at the top of the table otherwise it is at the bottom of the table. Parameters: sortColumn - the column that is being sorted |
sort | void sort(boolean refreshTable)(Code) | | Resorts the table using the last comparator. This is useful for cases where features have been added to the table
Parameters: refreshTable - |
update | public void update()(Code) | | Updates the table control with the current set of features.
This method will ensure that the column information gets updated
|
update | public void update(FeatureCollection features2)(Code) | | Updates the features that have the same feature ID to match the new feature or adds the features if they are not part of the
current collection.
Parameters: features2 - the feature collection that contains the modified or new features. |
|
|
|