Class PlaceholderManagementPanel.PlaceholderTableModel

    • Field Detail

      • m_ReadOnly

        protected boolean m_ReadOnly
        whether the model is readonly.
      • m_Modified

        protected boolean m_Modified
        whether the values got modified.
      • m_Values

        protected Map<String,​String> m_Values
        the key - actual value relation.
      • m_Keys

        protected List<String> m_Keys
        the sorted list of keys.
    • Constructor Detail

      • PlaceholderTableModel

        public PlaceholderTableModel​(boolean system)
        Initializes the model with the global placeholders.
        Parameters:
        system - whether to display system ones or user-defined ones
      • PlaceholderTableModel

        public PlaceholderTableModel​(Properties props,
                                     boolean system)
        Initializes the model with the specified properties.
        Parameters:
        props - the properties to display
        system - whether to display system ones or user-defined ones
    • Method Detail

      • getColumnCount

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

        public int getRowCount()
        Returns the number of rows in the model.
        Returns:
        the number of placeholders
      • getValueAt

        public Object getValueAt​(int rowIndex,
                                 int columnIndex)
        Returns the cell value.
        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
      • setModified

        public void setModified​(boolean value)
        Sets the modified state.
        Parameters:
        value - the modified state
      • isModified

        public boolean isModified()
        Returns modified state.
        Returns:
        the modified state
      • remove

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

        public void add​(String key,
                        String value)
        Adds the placeholder (key-value pair) to the model.
        Parameters:
        key - the key of the placeholder
        value - the corresponding value
      • getProperties

        public Properties getProperties()
        Returns the data as props structure.
        Returns:
        the generated properties
      • getArray

        public BaseString[] getArray()
        Returns the data as BaseString array.
        Returns:
        the generated array