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 Details

    • SnapTableView

      public SnapTableView()
  • Method Details

    • getQueryTemplate

      public Query getQueryTemplate()
      Returns the query used to build actual query (may contain parameter names instead of values).
    • setQueryTemplate

      public void setQueryTemplate(Query aQuery)
      Sets the query used to build actual query (may contain parameter names instead of values).
    • createQuery

      protected Query createQuery()
      Creates the default query, substituting parameter values if it contains parameter keys.
      Overrides:
      createQuery in class DataTableView
    • getParameterCount

      public int getParameterCount()
      Return the number of parameters.
    • getParameter

      public Property getParameter(int anIndex)
      Return the individual parameter.
    • getParameters

      public List<Property> getParameters()
      Returns the list of parameters.
    • setParameters

      public void setParameters(List<Property> theParameters)
      Sets a list of parameters.
    • addParameter

      public void addParameter(Property aParameter)
      Adds a parameter.
    • removeParameter

      public Property removeParameter(int anIndex)
      Removes a parameter at given index.
    • removeParameter

      public int removeParameter(Property aParameter)
      Removes a given parameter from parameters list.
    • getParameter

      public Property getParameter(String aName)
      Returns the named parameter.
    • getParameterValue

      public Object getParameterValue(String aName)
      Returns the current parameter value for given parameter name.
    • setParameterValue

      public void setParameterValue(String aName, Object aValue)
      Sets the current parameter value for given parameter name.
    • getViewEntity

      public Entity getViewEntity()
      Returns the view entity.
    • createViewEntity

      protected Entity createViewEntity()
      Returns the view entity - a modified version of the underlying table entity to include query relation + properties.
    • getQueryEntity

      public Entity getQueryEntity()
      Returns the query entity.
    • createQueryEntity

      protected Entity createQueryEntity()
      Returns the query parameters entity.
    • createRow

      public SnapRow createRow()
      Creates a new row.
    • addRow

      protected void addRow(Row aRow)
      Override to clear filtered rows.
      Overrides:
      addRow in class DataTableView
    • removeRow

      protected void removeRow(Row aRow)
      Override to clear filtered rows.
      Overrides:
      removeRow in class DataTableView
    • getFilter

      public String getFilter()
      Returns the filter string.
    • setFilter

      public void setFilter(String aString)
      Sets the filter string.
    • getFilteredRows

      public List<Row> getFilteredRows()
      Returns the list of filtered rows.
    • refresh

      public void refresh()
      Reloads rows.
      Overrides:
      refresh in class DataTableView
    • propertyChange

      public void propertyChange(PropertyChangeEvent anEvent)
      Catches changes to condition and properties and forwards on.
      Specified by:
      propertyChange in interface PropertyChangeListener
    • addPropertyChangeListener

      public void addPropertyChangeListener(PropertyChangeListener aLstnr)
      Add a property change listener.
    • removePropertyChangeListener

      public void removePropertyChangeListener(PropertyChangeListener aLstnr)
      Remove a property change listener.
    • firePropertyChange

      protected void firePropertyChange(String aPropName, Object anOldVal, Object aNewVal, int anIndex)
      Fires a property change.
    • firePropertyChange

      protected void firePropertyChange(PropertyChangeEvent anEvent)
      Fires a property change.
    • getJSONKeys

      public List<String> getJSONKeys()
      RMJSONArchiver.GetKeys method.
      Specified by:
      getJSONKeys in interface RMJSONArchiver.GetKeys
    • toString

      public String toString()
      Standard toString implementation.
      Overrides:
      toString in class Object