Package org.owasp.webscarab.model

Examples of org.owasp.webscarab.model.ConversationID


            Object o = getValue(_where);
            if (_where.equals("URL") && o instanceof HttpUrl) {
                HttpUrl url = (HttpUrl) o;
                fragments = _model.getUrlFragmentKeys(url, _type);
            } else if (_where.equals("CONVERSATION") && o instanceof ConversationID) {
                ConversationID id = (ConversationID) o;
                fragments = _model.getConversationFragmentKeys(id, _type);
            }
            // translate fragment keys into actual fragments
            for (int i=0; i<fragments.length; i++) {
                fragments[i] = _model.getFragment(fragments[i]);
View Full Code Here


    /**
     * constructs a JFrame around the ConversationPanel
     * @return the frame
     */
    public JFrame inFrame() {
        ConversationID selected = getSelectedConversation();
        if (selected != null) {
            return inFrame("WebScarab - conversation " + selected);
        }
        return inFrame(null);
    }
View Full Code Here

        add(conversationSplitPane, java.awt.BorderLayout.CENTER);

    }// </editor-fold>//GEN-END:initComponents
   
    private void conversationComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_conversationComboBoxActionPerformed
        ConversationID id = (ConversationID) conversationComboBox.getSelectedItem();
        if (id == null) {
            setRequest(null, false);
            setResponse(null, false);
            if (_frame != null)
                _frame.setTitle("WebScarab - no conversation selected");
View Full Code Here

                    System.exit(0);
                }
            });
           
            frame.setVisible(true);
            cp.setSelectedConversation(new ConversationID(1));
        } catch (org.owasp.webscarab.model.StoreException se) {
            se.printStackTrace();
            System.exit(0);
        }
    }
View Full Code Here

    }
   
    public void actionPerformed(ActionEvent e) {
        Object o = getValue("CONVERSATION");
        if (o == null || ! (o instanceof ConversationID)) return;
        ConversationID id = (ConversationID) o;
        String tag = _model.getConversationProperty(id, "TAG");
        tag = JOptionPane.showInputDialog(parent, "Tag the conversation", tag == null ? "" : tag);
        _model.setConversationProperty(id, "TAG", tag);
    }
View Full Code Here

    }
   
    public void actionPerformed(ActionEvent e) {
        Object o = getValue("CONVERSATION");
        if (o == null || ! (o instanceof ConversationID)) return;
        ConversationID id = (ConversationID) o;
        ConversationPanel cp = new ConversationPanel(_model);
        cp.setSelectedConversation(id);
        JFrame frame = cp.inFrame();
        frame.setVisible(true);
        frame.toFront();
View Full Code Here

    }
   
    public java.awt.Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
        //Get the selected index. (The index param isn't
        //always valid, so just use the value.)
        ConversationID id = (ConversationID) value;
       
        if (isSelected) {
            setBackground(list.getSelectionBackground());
            setForeground(list.getSelectionForeground());
        } else {
            setBackground(list.getBackground());
            setForeground(list.getForeground());
        }
       
        if (id == null) {
            setText("");
            return this;
        }
        if (_conversationModel == null) {
            setText(id.toString());
            return this;
        }
        StringBuffer text = new StringBuffer();
        text.append(id).append(" - ");
        text.append(_conversationModel.getRequestMethod(id)).append(" ");
View Full Code Here

                _logger.info("Selection changed");
                if (e.getValueIsAdjusting()) return;
                int row = conversationTable.getSelectedRow();
                TableModel tm = conversationTable.getModel();
                if (row >-1) {
                    ConversationID id = (ConversationID) tm.getValueAt(row, 0); // UGLY hack! FIXME!!!!
                    _showAction.putValue("CONVERSATION", id);
                    _logger.info("Conversation " + id + " selected");
                } else {
                    _showAction.putValue("CONVERSATION", null);
                }
View Full Code Here

   
        baseComboBox.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                Object o = baseComboBox.getSelectedItem();
                if (o instanceof ConversationID) {
                    ConversationID id = (ConversationID) o;
                    ConversationModel cModel = _model.getConversationModel();
                    Response response = cModel.getResponse(id);
                    String cType = response.getHeader("Content-Type");
                    if (cType == null || !cType.startsWith("text")) {
                        JOptionPane.showMessageDialog(ComparePanel.this, "Selected conversation is not text", "Error", JOptionPane.ERROR_MESSAGE);
                        return;
                    }
                    byte[] content = response.getContent();
                    if (content == null || content.length == 0) {
                        JOptionPane.showMessageDialog(ComparePanel.this, "Selected conversation has no content", "Error", JOptionPane.ERROR_MESSAGE);
                        return;
                    }
                    _compare.setBaseConversation(null, id);
                    _base = new String(content);
                }
            }
        });
       
        conversationTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
            public void valueChanged(ListSelectionEvent evt) {
                int selected = conversationTable.getSelectedRow();
                _diffPanel.clear();
                if (selected == -1) {
                    return;
                }
                selected = _conversationSorter.modelIndex(selected);
                ConversationModel cmodel = _model.getComparisonModel();
               
                ConversationID id = cmodel.getConversationAt(selected);
                Response response = cmodel.getResponse(id);
                String contentType = response.getHeader("Content-Type");
                if (contentType == null || !contentType.startsWith("text")) {
                    JOptionPane.showMessageDialog(ComparePanel.this, "Selected conversation is not text", "Error", JOptionPane.ERROR_MESSAGE);
                    return;
View Full Code Here

        conversationTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
            public void valueChanged(ListSelectionEvent e) {
                if (e.getValueIsAdjusting()) return;
                int row = conversationTable.getSelectedRow();
                TableModel tm = conversationTable.getModel();
                ConversationID id = null;
                if (row >-1)
                    id = (ConversationID) tm.getValueAt(row, 0); // UGLY hack! FIXME!!!!
                synchronized (_conversationActions) {
                    for (int i=0; i<_conversationActions.size(); i++) {
                        Action action = (Action) _conversationActions.get(i);
View Full Code Here

TOP

Related Classes of org.owasp.webscarab.model.ConversationID

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.