Class FlowSetupTableModel

    • Constructor Detail

      • FlowSetupTableModel

        public FlowSetupTableModel​(FlowSetupManager manager)
        Initializes the model.
        Parameters:
        manager - the underlying setups
    • Method Detail

      • getColumnCount

        public int getColumnCount()
        Returns the number of columns. 1. Name 2. Desc/File 3. Headless 4. Running 5. OnFinish 6. OnError 7. Error
        Specified by:
        getColumnCount in interface TableModel
        Returns:
        always 7
      • getRowCount

        public int getRowCount()
        Returns the number of setups in the model.
        Specified by:
        getRowCount in interface TableModel
        Returns:
        the number of setups
      • isCellEditable

        public boolean isCellEditable​(int rowIndex,
                                      int columnIndex)
        Returns whether a cell can be edited.
        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:
        true if the cell can be edited
      • getValueAt

        public Object getValueAt​(int rowIndex,
                                 int columnIndex)
        Returns the cell value at the specified location.
        Specified by:
        getValueAt in interface TableModel
        Parameters:
        rowIndex - the row of the cell
        columnIndex - the column of the cell
        Returns:
        the value at the position
      • 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
      • indexOf

        public int indexOf​(FlowSetup setup)
        Returns the index of the given flow setup.
        Parameters:
        setup - the setup to look for
        Returns:
        the index, -1 if not found
      • getSetup

        public FlowSetup getSetup​(int row)
        Returns a copy of the setup at the specified location.
        Parameters:
        row - the row of the setup
        Returns:
        the setup
      • setSetup

        public void setSetup​(int row,
                             FlowSetup setup)
        Sets the setup at the specified location.
        Parameters:
        row - the row of the setup
        setup - the setup
      • addSetup

        public void addSetup​(FlowSetup setup)
        Adds a shallow copy of the setup.
        Parameters:
        setup - the setup to add
      • insertSetup

        public void insertSetup​(int row,
                                FlowSetup setup)
        Inserts a shallow copy of the setup at the specified location.
        Parameters:
        row - the row of the setup
        setup - the setup to add
      • removeSetup

        public void removeSetup​(int row)
        Removes the setup at the specified location.
        Parameters:
        row - the row of the setup
      • clearSetups

        public void clearSetups()
        Removes all setups.
      • swap

        protected void swap​(int firstIndex,
                            int secondIndex)
        Swaps the two rows.
        Specified by:
        swap in class AbstractMoveableTableModel
        Parameters:
        firstIndex - the index of the first row
        secondIndex - the index of the second row