use of org.jdesktop.swingx.JXTable in project zaproxy by zaproxy.
the class MultipleOptionsTablePanel method createTable.
protected JXTable createTable() {
JXTable table = new JXTable();
table.setColumnControlVisible(true);
table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
return table;
}
use of org.jdesktop.swingx.JXTable in project zaproxy by zaproxy.
the class ParamsPanel method getParamsTable.
protected JXTable getParamsTable() {
if (paramsTable == null) {
paramsTable = new JXTable(paramsModel);
paramsTable.setColumnSelectionAllowed(false);
paramsTable.setCellSelectionEnabled(false);
paramsTable.setRowSelectionAllowed(true);
paramsTable.setAutoCreateRowSorter(true);
paramsTable.setColumnControlVisible(true);
this.setParamsTableColumnSizes();
paramsTable.setName(PANEL_NAME);
paramsTable.setDoubleBuffered(true);
paramsTable.addMouseListener(new java.awt.event.MouseAdapter() {
@Override
public void mousePressed(java.awt.event.MouseEvent e) {
showPopupMenuIfTriggered(e);
}
@Override
public void mouseReleased(java.awt.event.MouseEvent e) {
showPopupMenuIfTriggered(e);
}
private void showPopupMenuIfTriggered(java.awt.event.MouseEvent e) {
if (e.isPopupTrigger()) {
// Select table item
int row = paramsTable.rowAtPoint(e.getPoint());
if (row < 0 || !paramsTable.getSelectionModel().isSelectedIndex(row)) {
paramsTable.getSelectionModel().clearSelection();
if (row >= 0) {
paramsTable.getSelectionModel().setSelectionInterval(row, row);
}
}
View.getSingleton().getPopupMenu().show(e.getComponent(), e.getX(), e.getY());
}
}
});
}
return paramsTable;
}
use of org.jdesktop.swingx.JXTable in project zaproxy by zaproxy.
the class BreakpointsPanel method getBreakpoints.
protected JXTable getBreakpoints() {
if (breakpointsTable == null) {
breakpointsTable = new JXTable(model);
breakpointsTable.setColumnSelectionAllowed(false);
breakpointsTable.setCellSelectionEnabled(false);
breakpointsTable.setRowSelectionAllowed(true);
breakpointsTable.setColumnControlVisible(true);
breakpointsTable.getColumnModel().getColumn(0).setPreferredWidth(restoreColumnWidth(BRK_TABLE, 100));
breakpointsTable.getColumnModel().getColumn(0).addPropertyChangeListener(new ColumnResizedListener(BRK_TABLE));
breakpointsTable.getColumnModel().getColumn(0).setMaxWidth(250);
breakpointsTable.getTableHeader().setReorderingAllowed(false);
breakpointsTable.setName(PANEL_NAME);
breakpointsTable.setDoubleBuffered(true);
breakpointsTable.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
breakpointsTable.addMouseListener(new java.awt.event.MouseAdapter() {
@Override
public void mousePressed(java.awt.event.MouseEvent e) {
showPopupMenuIfTriggered(e);
}
@Override
public void mouseReleased(java.awt.event.MouseEvent e) {
showPopupMenuIfTriggered(e);
}
private void showPopupMenuIfTriggered(java.awt.event.MouseEvent e) {
if (e.isPopupTrigger()) {
// Select table item
int row = breakpointsTable.rowAtPoint(e.getPoint());
if (row < 0 || !breakpointsTable.getSelectionModel().isSelectedIndex(row)) {
breakpointsTable.getSelectionModel().clearSelection();
if (row >= 0) {
breakpointsTable.getSelectionModel().setSelectionInterval(row, row);
}
}
View.getSingleton().getPopupMenu().show(e.getComponent(), e.getX(), e.getY());
}
}
@Override
public void mouseClicked(java.awt.event.MouseEvent e) {
if (SwingUtilities.isLeftMouseButton(e) && e.getClickCount() > 1) {
// Its a double click
extension.editUiSelectedBreakpoint();
}
}
});
}
return breakpointsTable;
}
Aggregations