Class EditContext

java.lang.Object
xal.tools.data.EditContext

public class EditContext extends Object
EditContext manages dynamic data held in all associated tables.
Author:
tap
  • Field Details

    • GROUP_TAG

      public static final String GROUP_TAG
      tag for a table group within a data adaptor
      See Also:
    • messageCenter

      protected final MessageCenter messageCenter
      message center for dispatching events from this edit context
    • noticeProxy

      protected final EditContextListener noticeProxy
      proxy which forwards events from this edit context
  • Constructor Details

    • EditContext

      public EditContext()
      Constructor
  • Method Details

    • addEditContextListener

      public void addEditContextListener(EditContextListener listener)
      Add the listener to receive edit context events.
      Parameters:
      listener - the listener to receive edit context events from this context
    • removeEditContextListener

      public void removeEditContextListener(EditContextListener listener)
      Remove the listener from receiving edit context events.
      Parameters:
      listener - the listener to remove from receving edit context events from this context
    • importTablesFromContext

      public void importTablesFromContext(EditContext editContext, String group)
      Perform a deep copy of the specified table group from the specified edit context
    • importTablesFromDataAdaptor

      public void importTablesFromDataAdaptor(DataAdaptor docAdaptor, String tableGroup)
      Import the tables from the data adaptor and assign them to the specified group in this edit context.
    • writeGroupToDataAdaptor

      public void writeGroupToDataAdaptor(DataAdaptor docAdaptor, String group)
      Write all tables associated with the specified group to the specified data adaptor.
    • clear

      public void clear()
    • getTable

      public DataTable getTable(String name)
      Get the table associated with the specified table name.
    • getTableNames

      public Collection<String> getTableNames()
      Get the collection of all table names associated with this context.
    • getTables

      public Collection<DataTable> getTables()
      Get the collection of all tables in the edit context.
    • addTableToGroup

      public void addTableToGroup(DataTable newTable, String group)
      Add the table to the edit context.
    • addTablesToGroup

      public void addTablesToGroup(Collection<DataTable> newTables, String group)
      Add the tables to the edit context.
    • getTableGroups

      public Collection<String> getTableGroups()
      Get all table groups
    • getTablesForGroup

      public Collection<DataTable> getTablesForGroup(String group)
      Get all tables associated with the specified group
    • remove

      public void remove(DataTable aTable)
      Remove the table from the edit context.
    • records

      public Collection<GenericRecord> records(String tableName)
      Get all of the records from the table given by the table name.
    • records

      public <T> Collection<GenericRecord> records(String tableName, Map<String,T> bindings)
      Get the records from the table where the bindings map is valid.
    • records

      public <T> Collection<GenericRecord> records(DataTable table, Map<String,T> bindings)
      Get the records from the table where the bindings map is valid.
    • records

      public Collection<GenericRecord> records(String tableName, String key, Object value)
      Get the records from the table where the value for the specified key matches.
    • recordsForNode

      public Collection<GenericRecord> recordsForNode(String tableName, String nodeId)
      Get the records from the table associated with the node.
    • recordForNode

      public GenericRecord recordForNode(String tableName, String nodeId)
      Get a single record from the table associated with the node.