canonicalGranteeTable = new GranteeTable(canonicalGranteeTableModel); JButton removeCanonical = new JButton(); removeCanonical.setToolTipText("Remove the selected Canonical User grantee"); emailGranteeTable = new GranteeTable(emailGranteeTableModel); JButton removeEmail = new JButton(); removeEmail.setToolTipText("Remove the selected Email Address grantee"); groupGranteeTable = new GranteeTable(groupGranteeTableModel); JButton removeGroup = new JButton(); removeGroup.setToolTipText("Remove the selected Group grantee");
canonicalGranteeTable = new GranteeTable(canonicalGranteeTableModel); JButton removeCanonical = new JButton(); removeCanonical.setToolTipText("Remove the selected Canonical User grantee"); emailGranteeTable = new GranteeTable(emailGranteeTableModel); JButton removeEmail = new JButton(); removeEmail.setToolTipText("Remove the selected Email Address grantee"); groupGranteeTable = new GranteeTable(groupGranteeTableModel); JButton removeGroup = new JButton(); removeGroup.setToolTipText("Remove the selected Group grantee");
public GranteeTable(GranteeTableModel granteeTableModel) { super(); sorter = new TableSorter(granteeTableModel); this.setModel(sorter); sorter.setTableHeader(this.getTableHeader()); getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION); getSelectionModel().addListSelectionListener(this); DefaultCellEditor groupCellEditor = new DefaultCellEditor(groupGranteeComboBox); groupCellEditor.setClickCountToStart(2); setDefaultEditor(GroupGrantee.class, groupCellEditor); setDefaultRenderer(GroupGrantee.class, new DefaultTableCellRenderer() { private static final long serialVersionUID = 4938391147702620699L; @Override public Component getTableCellRendererComponent(JTable arg0, Object value, boolean arg2, boolean arg3, int arg4, int arg5) { if (value == null) { return null; } GroupGrantee groupGrantee = (GroupGrantee) value; return super.getTableCellRendererComponent(arg0, groupGrantee.getIdentifier(), arg2, arg3, arg4, arg5); } }); DefaultCellEditor permissionCellEditor = new DefaultCellEditor(permissionComboBox); permissionCellEditor.setClickCountToStart(2); setDefaultEditor(Permission.class, permissionCellEditor); }
public GranteeTable(GranteeTableModel granteeTableModel) { super(); sorter = new TableSorter(granteeTableModel); this.setModel(sorter); sorter.setTableHeader(this.getTableHeader()); getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION); getSelectionModel().addListSelectionListener(this); DefaultCellEditor groupCellEditor = new DefaultCellEditor(groupGranteeComboBox); groupCellEditor.setClickCountToStart(2); setDefaultEditor(GroupGrantee.class, groupCellEditor); setDefaultRenderer(GroupGrantee.class, new DefaultTableCellRenderer() { private static final long serialVersionUID = 4938391147702620699L; @Override public Component getTableCellRendererComponent(JTable arg0, Object value, boolean arg2, boolean arg3, int arg4, int arg5) { if (value == null) { return null; } GroupGrantee groupGrantee = (GroupGrantee) value; return super.getTableCellRendererComponent(arg0, groupGrantee.getIdentifier(), arg2, arg3, arg4, arg5); } }); DefaultCellEditor permissionCellEditor = new DefaultCellEditor(permissionComboBox); permissionCellEditor.setClickCountToStart(2); setDefaultEditor(Permission.class, permissionCellEditor); }