Search in sources :

Example 6 with HttpPanelView

use of org.zaproxy.zap.extension.httppanel.view.HttpPanelView in project zaproxy by zaproxy.

the class HttpPanelComponentViewsManager method switchView.

private void switchView(final String name) {
    if (this.currentView != null && this.currentView.getCaptionName().equals(name)) {
        currentView.setSelected(true);
        if (owner != null) {
            owner.fireMessageViewChangedEvent(currentView, currentView);
        }
        return;
    }
    HttpPanelView view = views.get(name);
    if (view == null) {
        logger.info("No view found with name: " + name);
        return;
    }
    HttpPanelView previousView = currentView;
    if (this.currentView != null) {
        this.currentView.setSelected(false);
        this.currentView.getModel().clear();
    }
    this.currentView = view;
    comboBoxModel.setSelectedItem(viewItems.get(name));
    this.currentView.getModel().setMessage(message);
    ((CardLayout) panelViews.getLayout()).show(panelViews, name);
    this.currentView.setSelected(true);
    if (owner != null) {
        owner.fireMessageViewChangedEvent(previousView, currentView);
    }
}
Also used : HttpPanelView(org.zaproxy.zap.extension.httppanel.view.HttpPanelView) SearchableHttpPanelView(org.zaproxy.zap.extension.search.SearchableHttpPanelView) CardLayout(java.awt.CardLayout)

Aggregations

HttpPanelView (org.zaproxy.zap.extension.httppanel.view.HttpPanelView)6 SearchableHttpPanelView (org.zaproxy.zap.extension.search.SearchableHttpPanelView)4 CardLayout (java.awt.CardLayout)1 Entry (java.util.Map.Entry)1 ComponentChangedEvent (org.zaproxy.zap.extension.httppanel.ComponentChangedEvent)1 MessagePanelEventListener (org.zaproxy.zap.extension.httppanel.MessagePanelEventListener)1 MessageViewSelectedEvent (org.zaproxy.zap.extension.httppanel.MessageViewSelectedEvent)1