new GridBagConstraints(0, 0, 1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, insetsZero, 0, 0));
bucketsPanel.add(bucketActionButton,
new GridBagConstraints(1, 0, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, insetsZero, 0, 0));
bucketTableModel = new BucketTableModel();
bucketTableModelSorter = new TableSorter(bucketTableModel);
bucketsTable = new JTable(bucketTableModelSorter);
bucketTableModelSorter.setTableHeader(bucketsTable.getTableHeader());
bucketsTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
bucketsTable.getSelectionModel().addListSelectionListener(this);
bucketsTable.setShowHorizontalLines(true);
bucketsTable.setShowVerticalLines(true);
bucketsTable.addMouseListener(new ContextMenuListener());
bucketsPanel.add(new JScrollPane(bucketsTable),
new GridBagConstraints(0, 1, 2, 1, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, insetsZero, 0, 0));
bucketsPanel.add(new JLabel(" "),
new GridBagConstraints(0, 2, 2, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, insetsDefault, 0, 0));
// Filter panel.
filterObjectsPanel = new JPanel(new GridBagLayout());
filterObjectsPrefix = new JTextField();
filterObjectsPrefix.setToolTipText("Only show objects with this prefix");
filterObjectsPrefix.addActionListener(this);
filterObjectsPrefix.setActionCommand("RefreshObjects");
filterObjectsDelimiter = new JComboBox(new String[] {"", "/", "?", "\\"});
filterObjectsDelimiter.setEditable(true);
filterObjectsDelimiter.setToolTipText("Object name delimiter");
filterObjectsDelimiter.addActionListener(this);
filterObjectsDelimiter.setActionCommand("RefreshObjects");
filterObjectsPanel.add(new JHtmlLabel("Prefix:", this),
new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, insetsZero, 0, 0));
filterObjectsPanel.add(filterObjectsPrefix,
new GridBagConstraints(1, 0, 1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0));
filterObjectsPanel.add(new JHtmlLabel("Delimiter:", this),
new GridBagConstraints(2, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, insetsDefault, 0, 0));
filterObjectsPanel.add(filterObjectsDelimiter,
new GridBagConstraints(3, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, insetsZero, 0, 0));
filterObjectsPanel.setVisible(false);
// Objects panel.
JPanel objectsPanel = new JPanel(new GridBagLayout());
int row = 0;
filterObjectsCheckBox = new JCheckBox("Filter objects");
filterObjectsCheckBox.addActionListener(this);
filterObjectsCheckBox.setToolTipText("Check this option to filter the objects listed");
objectsPanel.add(new JHtmlLabel("<html><b>Objects</b></html>", this),
new GridBagConstraints(0, row, 1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, insetsZero, 0, 0));
objectsPanel.add(filterObjectsCheckBox,
new GridBagConstraints(1, row, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, insetsZero, 0, 0));
JButton objectActionButton = new JButton();
objectActionButton.setToolTipText("Object actions menu");
guiUtils.applyIcon(objectActionButton, "/images/nuvola/16x16/actions/misc.png");
objectActionButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
JButton sourceButton = (JButton) e.getSource();
objectActionMenu.show(sourceButton, 0, sourceButton.getHeight());
}
});
objectsPanel.add(objectActionButton,
new GridBagConstraints(2, row, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, insetsZero, 0, 0));
objectsPanel.add(filterObjectsPanel,
new GridBagConstraints(0, ++row, 3, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, insetsZero, 0, 0));
objectsTable = new JTable();
objectTableModel = new ObjectTableModel();
objectTableModelSorter = new TableSorter(objectTableModel);
objectTableModelSorter.setTableHeader(objectsTable.getTableHeader());
objectsTable.setModel(objectTableModelSorter);
objectsTable.setDefaultRenderer(Long.class, new DefaultTableCellRenderer() {
private static final long serialVersionUID = 301092191828910402L;