Class ParameterChoiceTable

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JTable
com.jidesoft.grid.JideTable
com.jidesoft.grid.ContextSensitiveTable
com.jidesoft.grid.NavigableTable
com.jidesoft.grid.CellStyleTable
com.jidesoft.grid.CellSpanTable
com.jidesoft.grid.CategorizedTable
com.jidesoft.grid.SortableTable
com.inductiveautomation.ignition.designer.db.namedquery.ParameterChoiceTable
All Implemented Interfaces:
com.jidesoft.grid.IndexChangeListener, com.jidesoft.grid.SortListener, com.jidesoft.grid.TableAdapter, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, CellEditorListener, ListSelectionListener, RowSorterListener, TableColumnModelListener, TableModelListener, Scrollable

public class ParameterChoiceTable extends com.jidesoft.grid.SortableTable
Table used to fill in a NamedQuery's parameters with a value. Classes which use this can register a ChangeListener to find out when the table model changes.
See Also:
  • Field Details

  • Constructor Details

    • ParameterChoiceTable

      public ParameterChoiceTable()
    • ParameterChoiceTable

      public ParameterChoiceTable(boolean manualMode)
  • Method Details

    • addEmptyRow

      public int addEmptyRow()
      Adds an empty row to the table for manual entry. Returns the index of the new row.
    • removeSelectedRows

      public void removeSelectedRows()
      Removes the selected row(s) from the table.
    • addManualModeToolbar

      public boolean addManualModeToolbar(JPanel buttonBar)
      Adds the manual mode toolbar (add/remove buttons) to the provided button bar panel. This method should only be called when the table is in manual mode. If not in manual mode, this method does nothing.
      Parameters:
      buttonBar - The button bar panel to add the toolbar to
    • setParams

      @Deprecated public void setParams(@Nullable Map<String,Object> params)
      Deprecated.
    • setParams

      public void setParams(@Nullable String path, @Nullable Map<String,Object> params)
      This method does not directly update the table. Instead, it caches values to use when the table is updated. However, if the table is already in manual mode, it will immediately populate the table from the cached values.
      Parameters:
      params - is a map of id/value pairs for parameters. May be null.
    • update

      @Deprecated public void update(NamedQuery query)
      Deprecated.
    • update

      public void update(@Nullable String path, @Nullable NamedQuery query)
      Updates the parameter table based on the parameters in the named query passed in. We'll try to use existing values where they exist, falling back to cached values if we need to, falling back to an empty string if all else fails.
      Parameters:
      path - is the path to the query
      query - is an updated named query.
    • setFullParameterData

      public void setFullParameterData(Map<String,ParameterChoiceTable.ParameterData> parameterData)
      Sets full parameter data including type, name, datatype, and value for manual mode. This is used when restoring parameter configuration from JSON.
      Parameters:
      parameterData - a map where the key is the parameter name and the value is a ParameterData record containing type, name, datatype, and value
    • getParams

      public Map<String,Object> getParams()
      Gets the parameters currently displayed in the table and returns them as a hashmap.
      Returns:
      hashmap of parameter names (string) and values (object)
    • getFullParameterData

      public Map<String,ParameterChoiceTable.ParameterData> getFullParameterData()
      Gets full parameter data including type, name, datatype, and value for all parameters in the table.
      Returns:
      a map where the key is the parameter name and the value is a ParameterData record containing type, name, datatype, and value
    • prepareEditor

      public Component prepareEditor(@NonNull TableCellEditor editor, int row, int column)
      Overrides:
      prepareEditor in class com.jidesoft.grid.CellSpanTable
    • getCellRenderer

      public TableCellRenderer getCellRenderer(int row, int column)
      Overrides:
      getCellRenderer in class com.jidesoft.grid.CellSpanTable
    • getCellEditor

      public TableCellEditor getCellEditor(int row, int column)
      Overrides:
      getCellEditor in class com.jidesoft.grid.CellSpanTable
    • addChangeListener

      public void addChangeListener(ChangeListener listener)
      Adds a ChangeListener that will be notified when the table model changes.
      Parameters:
      listener - Not null.
    • removeChangeListener

      public void removeChangeListener(ChangeListener listener)
      Removes a previously added ChangeListener. No effect if the listener was not already added
      Parameters:
      listener - Not null.
    • fireStateChanged

      protected void fireStateChanged()
      Tell all the listeners who care that something important changed.