public PluginUpdateTableModel(List<PluginInfo> plugins) { this.plugins = new ArrayList<>(plugins); getInstallList(); }
public List<PluginInfo> getSelectedUpdateInfo() { if (tableModel != null){ return tableModel.getSelectedUpdateInfo(); } return Collections.emptyList(); }
public PluginInfo getCurrentUpdateInfo() { if (table != null && table.getSelectedRow() >= 0){ return tableModel.getUpdateInfoAt(table.getSelectedRow()); } return null; }
public Object getValueAt(int rowIndex, int columnIndex) { if (columnIndex == 0) { return getInstallList().get(rowIndex); final PluginInfo info = getUpdateInfoList().get(rowIndex); if (columnIndex == 1) { if (info.getPluginDescriptor() != null){
public Object getValueAt(int rowIndex, int columnIndex) { if (columnIndex == 0) { return getInstallList().get(rowIndex);
public Object getValueAt(int rowIndex, int columnIndex) { if (columnIndex == 0) { return getInstallList().get(rowIndex); final PluginInfo info = getUpdateInfoList().get(rowIndex); if (columnIndex == 1) { if (info.getPluginDescriptor() != null){
public void run() { tableModel = new PluginUpdateTableModel(provider); table = new JTable(tableModel); table.setBorder(BorderFactory.createEmptyBorder(12, 12, 12, 12)); table.setShowGrid(true); table.setRowMargin(1); table.setGridColor(Color.LIGHT_GRAY); table.setRowHeight(table.getRowHeight() + 5); table.setRowSelectionAllowed(true); table.setColumnSelectionAllowed(false); TableUtils.pack(table, true, false, 3); final JScrollPane tableSp = new JScrollPane(table); for (ListSelectionListener l : pendingListeners){ table.getSelectionModel().addListSelectionListener(l); } pendingListeners.clear(); SwingUtilities.invokeLater(new Runnable(){ public void run() { remove(waitLabel); add(tableSp, BorderLayout.CENTER); validate(); } }); } }, "Load plugin table contents");
private void handleTableShown(){ Thread t = new Thread(() -> { tableModel = new PluginUpdateTableModel(provider); table = new JTable(tableModel); table.setBorder(BorderFactory.createEmptyBorder(12, 12, 12, 12)); table.setShowGrid(true); table.setRowMargin(1); table.setGridColor(new Color(220, 220, 220)); table.setShowVerticalLines(false); table.setRowHeight(table.getRowHeight() + 5); table.setRowSelectionAllowed(true); table.setColumnSelectionAllowed(false); TableUtils.pack(table, true, false, 1); final JScrollPane tableSp = new JScrollPane(table); for (ListSelectionListener l : pendingListeners){ table.getSelectionModel().addListSelectionListener(l); } pendingListeners.clear(); SwingUtilities.invokeLater(new Runnable(){ public void run() { remove(waitLabel); add(tableSp, BorderLayout.CENTER); validate(); } }); }, "Load plugin table contents"); t.start(); }
public void run() { tableModel = new PluginUpdateTableModel(provider); table = new JTable(tableModel); table.setBorder(BorderFactory.createEmptyBorder(12, 12, 12, 12)); table.setShowGrid(true); table.setRowMargin(1); table.setGridColor(Color.LIGHT_GRAY); table.setRowHeight(table.getRowHeight() + 5); table.setRowSelectionAllowed(true); table.setColumnSelectionAllowed(false); TableUtils.pack(table, true, false, 3); final JScrollPane tableSp = new JScrollPane(table); for (ListSelectionListener l : pendingListeners){ table.getSelectionModel().addListSelectionListener(l); } pendingListeners.clear(); SwingUtilities.invokeLater(new Runnable(){ public void run() { remove(waitLabel); add(tableSp, BorderLayout.CENTER); validate(); } }); } }, "Load plugin table contents");
public PluginInfo getUpdateInfoAt(int index) { return getUpdateInfoList().get(index); }
public int getRowCount() { return getUpdateInfoList().size(); }
public PluginInfo getUpdateInfoAt(int index) { return getUpdateInfoList().get(index); }
public int getRowCount() { return getUpdateInfoList().size(); }
public PluginUpdateTableModel(PluginRegistry provider) { this.provider = provider; getInstallList(); }
public PluginUpdateTableModel(PluginRegistry provider) { this.provider = provider; getInstallList(); }
public List<Boolean> getInstallList(){ if (install == null){ install = new ArrayList<Boolean>(getUpdateInfoList().size()); for (PluginInfo info : getUpdateInfoList()) { install.add(provider.isSelected(info)); } } return install; }
public void setValueAt(Object aValue, int rowIndex, int columnIndex) { if (columnIndex == 0) { if (aValue instanceof Boolean) { getInstallList().set(rowIndex, (Boolean) aValue); } } } }
public void setValueAt(Object aValue, int rowIndex, int columnIndex) { if (columnIndex == 0) { if (aValue instanceof Boolean) { getInstallList().set(rowIndex, (Boolean) aValue); } } } }
public List<PluginInfo> getSelectedUpdateInfo() { List<PluginInfo> sel = new ArrayList<PluginInfo>(); int counter = 0; for (Boolean b : getInstallList()) { if (b) { sel.add(getUpdateInfoList().get(counter)); } counter++; } return sel; }
public List<PluginInfo> getSelectedUpdateInfo() { List<PluginInfo> sel = new ArrayList<PluginInfo>(); int counter = 0; for (Boolean b : getInstallList()) { if (b) { sel.add(getUpdateInfoList().get(counter)); } counter++; } return sel; }