Class SnapTableView
java.lang.Object
com.inductiveautomation.snap.web.DataTableView
com.inductiveautomation.snap.filedata.SnapTableView
- All Implemented Interfaces:
RMJSONArchiver.GetKeys
,PropertyChangeListener
,EventListener
public class SnapTableView
extends DataTableView
implements RMJSONArchiver.GetKeys, PropertyChangeListener
A class to represent a dataset generated from a table, a query and query parameters.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addParameter
(Property aParameter) Adds a parameter.void
Add a property change listener.protected void
Override to clear filtered rows.protected Query
Creates the default query, substituting parameter values if it contains parameter keys.protected Entity
Returns the query parameters entity.Creates a new row.protected Entity
Returns the view entity - a modified version of the underlying table entity to include query relation + properties.protected void
firePropertyChange
(PropertyChangeEvent anEvent) Fires a property change.protected void
firePropertyChange
(String aPropName, Object anOldVal, Object aNewVal, int anIndex) Fires a property change.Returns the filter string.Returns the list of filtered rows.RMJSONArchiver.GetKeys method.getParameter
(int anIndex) Return the individual parameter.getParameter
(String aName) Returns the named parameter.int
Return the number of parameters.Returns the list of parameters.getParameterValue
(String aName) Returns the current parameter value for given parameter name.Returns the query entity.Returns the query used to build actual query (may contain parameter names instead of values).Returns the view entity.void
propertyChange
(PropertyChangeEvent anEvent) Catches changes to condition and properties and forwards on.void
refresh()
Reloads rows.removeParameter
(int anIndex) Removes a parameter at given index.int
removeParameter
(Property aParameter) Removes a given parameter from parameters list.void
Remove a property change listener.protected void
Override to clear filtered rows.void
Sets the filter string.void
setParameters
(List<Property> theParameters) Sets a list of parameters.void
setParameterValue
(String aName, Object aValue) Sets the current parameter value for given parameter name.void
setQueryTemplate
(Query aQuery) Sets the query used to build actual query (may contain parameter names instead of values).toString()
Standard toString implementation.Methods inherited from class com.inductiveautomation.snap.web.DataTableView
getName, getQuery, getRows, getRowsImpl, getSite, getTable, getTableEntity, isRowsSet, setName, setQuery, setTable
-
Constructor Details
-
SnapTableView
public SnapTableView()
-
-
Method Details
-
getQueryTemplate
Returns the query used to build actual query (may contain parameter names instead of values). -
setQueryTemplate
Sets the query used to build actual query (may contain parameter names instead of values). -
createQuery
Creates the default query, substituting parameter values if it contains parameter keys.- Overrides:
createQuery
in classDataTableView
-
getParameterCount
public int getParameterCount()Return the number of parameters. -
getParameter
Return the individual parameter. -
getParameters
Returns the list of parameters. -
setParameters
Sets a list of parameters. -
addParameter
Adds a parameter. -
removeParameter
Removes a parameter at given index. -
removeParameter
Removes a given parameter from parameters list. -
getParameter
Returns the named parameter. -
getParameterValue
Returns the current parameter value for given parameter name. -
setParameterValue
Sets the current parameter value for given parameter name. -
getViewEntity
Returns the view entity. -
createViewEntity
Returns the view entity - a modified version of the underlying table entity to include query relation + properties. -
getQueryEntity
Returns the query entity. -
createQueryEntity
Returns the query parameters entity. -
createRow
Creates a new row. -
addRow
Override to clear filtered rows.- Overrides:
addRow
in classDataTableView
-
removeRow
Override to clear filtered rows.- Overrides:
removeRow
in classDataTableView
-
getFilter
Returns the filter string. -
setFilter
Sets the filter string. -
getFilteredRows
Returns the list of filtered rows. -
refresh
public void refresh()Reloads rows.- Overrides:
refresh
in classDataTableView
-
propertyChange
Catches changes to condition and properties and forwards on.- Specified by:
propertyChange
in interfacePropertyChangeListener
-
addPropertyChangeListener
Add a property change listener. -
removePropertyChangeListener
Remove a property change listener. -
firePropertyChange
Fires a property change. -
firePropertyChange
Fires a property change. -
getJSONKeys
RMJSONArchiver.GetKeys method.- Specified by:
getJSONKeys
in interfaceRMJSONArchiver.GetKeys
-
toString
Standard toString implementation.
-