Class SourceEditor.ActiveSourcesModel

    • Constructor Detail

      • ActiveSourcesModel

        public ActiveSourcesModel​(javax.swing.DefaultListSelectionModel selectionModel)
        Constructs a new ActiveSourcesModel.
        Parameters:
        selectionModel - selection model
    • Method Detail

      • getColumnCount

        public int getColumnCount()
        Specified by:
        getColumnCount in interface javax.swing.table.TableModel
      • getRowCount

        public int getRowCount()
        Description copied from interface: ReorderableTableModel
        Returns the number of rows in the list/table.
        Specified by:
        getRowCount in interface ReorderableTableModel<SourceEntry>
        Specified by:
        getRowCount in interface javax.swing.table.TableModel
        Returns:
        the number of rows in the list/table
        See Also:
        ListModel.getSize(), TableModel.getRowCount()
      • getValueAt

        public java.lang.Object getValueAt​(int rowIndex,
                                           int columnIndex)
        Specified by:
        getValueAt in interface javax.swing.table.TableModel
      • isCellEditable

        public boolean isCellEditable​(int rowIndex,
                                      int columnIndex)
        Specified by:
        isCellEditable in interface javax.swing.table.TableModel
        Overrides:
        isCellEditable in class javax.swing.table.AbstractTableModel
      • getColumnClass

        public java.lang.Class<?> getColumnClass​(int column)
        Specified by:
        getColumnClass in interface javax.swing.table.TableModel
        Overrides:
        getColumnClass in class javax.swing.table.AbstractTableModel
      • setValueAt

        public void setValueAt​(java.lang.Object aValue,
                               int row,
                               int column)
        Specified by:
        setValueAt in interface javax.swing.table.TableModel
        Overrides:
        setValueAt in class javax.swing.table.AbstractTableModel
      • setActiveSources

        public void setActiveSources​(java.util.Collection<? extends SourceEntry> sources)
        Sets active sources.
        Parameters:
        sources - active sources
      • addSource

        public void addSource​(SourceEntry entry)
        Adds an active source.
        Parameters:
        entry - source to add
      • removeSelected

        public void removeSelected()
        Removes the selected sources.
      • removeIdxs

        public void removeIdxs​(java.util.Collection<java.lang.Integer> idxs)
        Removes the sources at given indexes.
        Parameters:
        idxs - indexes to remove
      • getSources

        public java.util.List<SourceEntrygetSources()
        Returns the active sources.
        Returns:
        the active sources