|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.refractions.udig.ui.FeatureTableControl
public class FeatureTableControl
A TreeViewer control for viewing a table of SimpleFeature 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.
Field Summary | |
---|---|
static java.lang.String[] |
ALL
Indicates that all attribute types will be searched by the select method |
static java.lang.String |
CACHING_WARNING
Key for indicating whether the warning should be displayed. |
static java.lang.Object |
ERROR_COLUMN_PROPERTY
|
static java.lang.String |
FEATURE_ID_COLUMN_PROPERTY
|
static java.lang.Object |
LOADING
|
Constructor Summary | |
---|---|
FeatureTableControl()
Construct FeatureTableControl . |
|
FeatureTableControl(
Construct FeatureTableControl . |
|
FeatureTableControl(
Construct a FeatureTableControl . |
|
FeatureTableControl(Composite parent,
Construct a FeatureTableControl . |
Method Summary | |
---|---|
void |
addLoadingListener(IFeatureTableLoadingListener listener)
|
void |
addSelectionChangedListener(ISelectionChangedListener listener)
|
void |
assertInternallyConsistent()
Checks all the lists, caches, content providers, etc... |
void |
clear()
Don't display nothing :-) |
void |
createTableControl(Composite parent)
Creates the table control. |
protected void |
createTableViewer(Composite parent)
Creates the table control itself. |
|
deleteSelection()
Removes the selected features (the features selected by the owning FeatureTableControl ). |
void |
dispose()
|
Control |
getControl()
Returns the control representing the table control. |
|
getFeatures()
Contents of the current page of features |
int |
getPageSize()
Returns the number of features viewed in the table per page. |
ISelection |
getSelection()
Returns a selection with a single Id indicating the features selected |
int |
getSelectionCount()
|
TableViewer |
getViewer()
|
void |
message(java.lang.String text)
Displays a message. |
void |
message(java.lang.String text,
Color background,
Color foreground)
Displays a message. |
protected void |
notifyLoadingListeners(net.refractions.udig.ui.LoadingEvent event)
|
void |
promoteSelection()
Sorts the table so that the selection is at the top of the table. |
void |
remove(IFeatureTableLoadingListener listener)
|
void |
removeSelectionChangedListener(ISelectionChangedListener listener)
|
void |
select(java.util.Set<FeatureId> selection)
|
void |
select(java.lang.String cql,
boolean selectAll)
|
void |
select(java.lang.String text,
java.lang.String[] attributes,
boolean selectAll)
select the features found that has the text. |
void |
setFeatures(
Set up for a single page of content |
void |
setFocus()
Does nothing. |
void |
setMenuManager(MenuManager contextMenu)
Sets the context Menu used by the table view. |
void |
setPageSize(int resPerPage)
Sets the number of features viewed in the table per page. |
void |
setSelection(ISelection newSelection)
Useable selections are: selection of features, FIDS and Filters/Queries that adapt to a FeatureSource |
void |
setSelection(StructuredSelection selection,
boolean reveal)
|
void |
setSelectionColor(
|
boolean |
showWarning(Display display)
show the warning about loading features into memory. |
void |
sort(java.util.Comparator<SimpleFeature> comparator,
int dir,
TableColumn sortColumn)
Sorts the features in the tableView. |
void |
update()
Updates the table control with the current set of features. |
void |
update(
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String FEATURE_ID_COLUMN_PROPERTY
public static final java.lang.Object ERROR_COLUMN_PROPERTY
public static final java.lang.Object LOADING
public static final java.lang.String CACHING_WARNING
public static final java.lang.String[] ALL
select(String, String[], boolean)
Constructor Detail |
---|
public FeatureTableControl()
FeatureTableControl
.
Must call setFeatures before use.
public FeatureTableControl(Composite parent,features)
FeatureTableControl
.
monitorProvider
- a provider that will provider progress monitors for displaying loading
information.fReader
- The FeatureReader that returns the actual features.resPerPage
- Results per page to be shown in the table.public FeatureTableControl(monitorProvider)
FeatureTableControl
.
Must call setFeatures before use.
monitorProvider
- a provider that will provider progress monitors for displaying loading
information.public FeatureTableControl(monitorProvider, Composite parent, features)
FeatureTableControl
.
monitorProvider
- a provider that will provider progress monitors for displaying loading
information.fReader
- The FeatureReader that returns the actual features.resPerPage
- Results per page to be shown in the table.Method Detail |
---|
public void setPageSize(int resPerPage)
resPerPage
- positive integer.public int getPageSize()
public Control getControl()
public void dispose()
public void createTableControl(Composite parent)
parent
- The to be parent of the control.public boolean showWarning(Display display)
public void update()
This method will ensure that the column information gets updated
protected void createTableViewer(Composite parent)
parent
- public void setFocus()
org.eclipse.ui.IWorkbenchPart#setFocus()
publicgetFeatures()
public void setFeatures(features)
public void clear()
public void message(java.lang.String text, Color background, Color foreground)
text
- message to displaybackground
- color of the background of the text widget. If null the default color is usedforeground
- color of the foreground of the text widget. If null the default color is usedpublic void message(java.lang.String text)
text
- message to displaypublic ISelection getSelection()
public void addSelectionChangedListener(ISelectionChangedListener listener)
public void removeSelectionChangedListener(ISelectionChangedListener listener)
public void setSelection(ISelection newSelection)
public void promoteSelection()
public void sort(java.util.Comparator<SimpleFeature> comparator, int dir, TableColumn sortColumn)
comparator
- comparator to use for the sorting.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.sortColumn
- the column that is being sortedpublic TableViewer getViewer()
public void setSelection(StructuredSelection selection, boolean reveal)
public int getSelectionCount()
public void select(java.util.Set<FeatureId> selection)
public void select(java.lang.String cql, boolean selectAll) throws CQLException
CQLException
public void select(java.lang.String text, java.lang.String[] attributes, boolean selectAll) throws java.util.regex.PatternSyntaxException
ALL
is selected then all attributes will be searched
text
- text to search for it will first be assumed that it is a reg ex expressionattributes
- the attributes to search. See ALL
selectAll
- if true all matched features will be selected otherwise just the first feature
java.util.regex.PatternSyntaxException
public void addLoadingListener(IFeatureTableLoadingListener listener)
public void remove(IFeatureTableLoadingListener listener)
protected void notifyLoadingListeners(net.refractions.udig.ui.LoadingEvent event)
public void update(features2)
features2
- the feature collection that contains the modified or new features.public void assertInternallyConsistent()
publicdeleteSelection()
FeatureTableControl
).
setSelection(ISelection)
,
setSelection(StructuredSelection, boolean)
public void setMenuManager(MenuManager contextMenu)
contextMenu
- menu manager used for creating the menu.public void setSelectionColor(selectionColor)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |