Search in sources :

Example 6 with ZapTable

use of org.zaproxy.zap.view.ZapTable in project zaproxy by zaproxy.

the class SpiderPanel method getAddedNodesTable.

private JXTable getAddedNodesTable() {
    if (addedNodesTable == null) {
        // Create the table with a default, empty TableModel and the proper settings
        addedNodesTable = new ZapTable(EMPTY_URLS_NO_FLAGS_TABLE_MODEL);
        addedNodesTable.setColumnSelectionAllowed(false);
        addedNodesTable.setCellSelectionEnabled(false);
        addedNodesTable.setRowSelectionAllowed(true);
        addedNodesTable.setAutoCreateRowSorter(true);
        addedNodesTable.setAutoCreateColumnsFromModel(false);
        addedNodesTable.getColumnExt(0).setCellRenderer(new DefaultTableRenderer(new MappedValue(StringValues.EMPTY, IconValues.NONE), JLabel.CENTER));
        addedNodesTable.getColumnExt(0).setHighlighters(new ProcessedCellItemIconHighlighter(0));
        addedNodesTable.getColumnModel().getColumn(0).setMinWidth(80);
        // processed
        addedNodesTable.getColumnModel().getColumn(0).setPreferredWidth(90);
        addedNodesTable.getColumnModel().getColumn(1).setMinWidth(60);
        // method
        addedNodesTable.getColumnModel().getColumn(1).setPreferredWidth(70);
        // name
        addedNodesTable.getColumnModel().getColumn(2).setMinWidth(400);
        addedNodesTable.getColumnModel().getColumn(2).setPreferredWidth(1000);
        addedNodesTable.setName(ADDED_NODES_CONTAINER_NAME);
        addedNodesTable.setDoubleBuffered(true);
        addedNodesTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
        addedNodesTable.setComponentPopupMenu(new JPopupMenu() {

            private static final long serialVersionUID = 6608291059686282641L;

            @Override
            public void show(Component invoker, int x, int y) {
                View.getSingleton().getPopupMenu().show(invoker, x, y);
            }
        });
    }
    return addedNodesTable;
}
Also used : ZapTable(org.zaproxy.zap.view.ZapTable) MappedValue(org.jdesktop.swingx.renderer.MappedValue) Component(java.awt.Component) DefaultTableRenderer(org.jdesktop.swingx.renderer.DefaultTableRenderer) JPopupMenu(javax.swing.JPopupMenu)

Aggregations

ZapTable (org.zaproxy.zap.view.ZapTable)6 Component (java.awt.Component)2 JPopupMenu (javax.swing.JPopupMenu)2 DefaultTableRenderer (org.jdesktop.swingx.renderer.DefaultTableRenderer)2 MappedValue (org.jdesktop.swingx.renderer.MappedValue)2 BorderLayout (java.awt.BorderLayout)1 Dimension (java.awt.Dimension)1 KeyAdapter (java.awt.event.KeyAdapter)1 KeyEvent (java.awt.event.KeyEvent)1 MouseAdapter (java.awt.event.MouseAdapter)1 MouseEvent (java.awt.event.MouseEvent)1 ImageIcon (javax.swing.ImageIcon)1 JButton (javax.swing.JButton)1 JPanel (javax.swing.JPanel)1 JScrollPane (javax.swing.JScrollPane)1 JTable (javax.swing.JTable)1 JToolBar (javax.swing.JToolBar)1 ListSelectionEvent (javax.swing.event.ListSelectionEvent)1 ListSelectionListener (javax.swing.event.ListSelectionListener)1 JXPanel (org.jdesktop.swingx.JXPanel)1