Class VariableManagementPanel.VariableTableModel

    • Field Detail

      • m_ProgrammaticVars

        protected Set<String> m_ProgrammaticVars
        programmatic variables.
      • m_Values

        protected Map<String,​String> m_Values
        the name - actual value relation.
      • m_Names

        protected List<String> m_Names
        the sorted list of var names.
      • m_NamesUserOnly

        protected List<String> m_NamesUserOnly
        the sorted list of user-only var names.
      • m_Variables

        protected Variables m_Variables
        the underlying variables instance.
      • m_DisplayUserOnly

        protected boolean m_DisplayUserOnly
        whether to display user-only vars.
    • Constructor Detail

      • VariableTableModel

        public VariableTableModel​(Variables variables)
        Initializes the model with the global variables.
        Parameters:
        variables - the Variables instance to use
    • Method Detail

      • initialize

        protected void initialize()
        Initializes the model.
      • getVariables

        public Variables getVariables()
        Returns the underlying Variables instance.
        Returns:
        the variables
      • setDisplayUserOnly

        public void setDisplayUserOnly​(boolean value)
        Sets whether only user variables are displayed without the programmatic ones.
        Parameters:
        value - true if user-only
      • getDisplayUserOnly

        public boolean getDisplayUserOnly()
        Returns whether only user variables are displayed without the programmatic ones.
        Returns:
        true if user-only
      • getColumnCount

        public int getColumnCount()
        Returns the number of columns in the model.
        Specified by:
        getColumnCount in interface TableModel
        Returns:
        always 2
      • getRowCount

        public int getRowCount()
        Returns the number of rows in the model.
        Specified by:
        getRowCount in interface TableModel
        Returns:
        the number of variables
      • getVariableNameAt

        protected String getVariableNameAt​(int rowIndex)
        Returns the name at the specified row.
        Parameters:
        rowIndex - the row to get the variable name for
        Returns:
        the name
      • getValueAt

        public Object getValueAt​(int rowIndex,
                                 int columnIndex)
        Returns the cell value.
        Specified by:
        getValueAt in interface TableModel
        Parameters:
        rowIndex - the row of the cell
        columnIndex - the column of the cell
        Returns:
        the value
      • isCellEditable

        public boolean isCellEditable​(int rowIndex,
                                      int columnIndex)
        Checks whether the cell is editable.
        Specified by:
        isCellEditable in interface TableModel
        Overrides:
        isCellEditable in class AbstractTableModel
        Parameters:
        rowIndex - the row of the cell
        columnIndex - the column of the cell
        Returns:
        always true
      • setValueAt

        public void setValueAt​(Object value,
                               int rowIndex,
                               int columnIndex)
        Sets the value at the specified position.
        Specified by:
        setValueAt in interface TableModel
        Overrides:
        setValueAt in class AbstractTableModel
        Parameters:
        value - the value to set
        rowIndex - the row of the cell
        columnIndex - the column of the cell
      • remove

        public void remove​(int rowIndex)
        Removes the variable at the position.
        Parameters:
        rowIndex - the row to remove
      • add

        public void add​(String name,
                        String value)
        Adds the variable (name-value pair) to the model.
        Parameters:
        name - the name of the variable
        value - the corresponding value