Search in sources :

Example 1 with RegexWizard

use of com.att.aro.ui.view.menu.tools.RegexWizard in project VideoOptimzer by attdevsupport.

the class VideoRequestPanel method getRequestListPanel.

private JPanel getRequestListPanel() {
    if (requestListPanel == null) {
        requestListPanel = new JPanel();
        requestListPanel.setLayout(new BorderLayout());
        getDummyData();
        requestListTable = new DataTable<HttpRequestResponseInfo>();
        requestListPanel.setName(ResourceBundleHelper.getMessageString("video.tab.requests.tableName"));
        DataTablePopupMenu popupMenu = (DataTablePopupMenu) requestListTable.getPopup();
        popupMenu.initialize();
        videoRequestTableModel.setData(requestURL);
        requestListTable.setModel(videoRequestTableModel);
        JTableHeader header = requestListTable.getTableHeader();
        requestListTable.setGridColor(Color.LIGHT_GRAY);
        int width = requestListTable.getParent() != null ? requestListTable.getParent().getWidth() : 1000;
        width = requestPanel.getWidth();
        requestListTable.getColumnModel().getColumn(0).setPreferredWidth(width);
        requestListTable.getColumnModel().getColumn(0).setCellRenderer(new WordWrapRenderer());
        requestListPanel.add(header, BorderLayout.NORTH);
        requestListPanel.add(requestListTable, BorderLayout.CENTER);
        requestListTable.addMouseListener(new MouseAdapter() {

            public void mouseClicked(MouseEvent event) {
                if (event.getClickCount() == 2) {
                    int row = requestListTable.getSelectedRow();
                    HttpRequestResponseInfo request = requestURL.get(row);
                    requestListTable.getColumnModel().getColumn(0).setCellRenderer(new WordWrapRenderer(row));
                    if (ResourceBundleHelper.getMessageString("videotab.videorequest.table.url").equals(requestListTable.getColumnName(requestListTable.getSelectedColumn()))) {
                        RegexWizard regexWizard = RegexWizard.getInstance(aroView.getJFrame());
                        regexWizard.setRequest(request);
                        regexWizard.setVisible(true);
                    }
                }
            }
        });
    }
    return requestListPanel;
}
Also used : JPanel(javax.swing.JPanel) MouseEvent(java.awt.event.MouseEvent) BorderLayout(java.awt.BorderLayout) HttpRequestResponseInfo(com.att.aro.core.packetanalysis.pojo.HttpRequestResponseInfo) DataTablePopupMenu(com.att.aro.ui.model.DataTablePopupMenu) MouseAdapter(java.awt.event.MouseAdapter) JTableHeader(javax.swing.table.JTableHeader) RegexWizard(com.att.aro.ui.view.menu.tools.RegexWizard)

Aggregations

HttpRequestResponseInfo (com.att.aro.core.packetanalysis.pojo.HttpRequestResponseInfo)1 DataTablePopupMenu (com.att.aro.ui.model.DataTablePopupMenu)1 RegexWizard (com.att.aro.ui.view.menu.tools.RegexWizard)1 BorderLayout (java.awt.BorderLayout)1 MouseAdapter (java.awt.event.MouseAdapter)1 MouseEvent (java.awt.event.MouseEvent)1 JPanel (javax.swing.JPanel)1 JTableHeader (javax.swing.table.JTableHeader)1