Search in sources :

Example 1 with HttpPanelView

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

the class HttpPanelComponentViewsManager method enableViews.

private void enableViews() {
    Iterator<Entry<String, HttpPanelView>> it = views.entrySet().iterator();
    while (it.hasNext()) {
        HttpPanelView view = it.next().getValue();
        ViewItem viewItem = viewItems.get(view.getName());
        if (!view.isEnabled(message)) {
            if (enabledViews.contains(viewItem)) {
                disableView(viewItem);
            }
        } else if (!enabledViews.contains(viewItem)) {
            enableView(viewItem);
        }
    }
}
Also used : HttpPanelView(org.zaproxy.zap.extension.httppanel.view.HttpPanelView) SearchableHttpPanelView(org.zaproxy.zap.extension.search.SearchableHttpPanelView) Entry(java.util.Map.Entry)

Example 2 with HttpPanelView

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

the class HttpPanelComponentViewsManager method findSearchableView.

private SearchableHttpPanelView findSearchableView() {
    SearchableHttpPanelView searchableView = null;
    Iterator<HttpPanelView> it = views.values().iterator();
    while (it.hasNext()) {
        HttpPanelView view = it.next();
        if (view.isEnabled(message)) {
            if (view instanceof SearchableHttpPanelView) {
                searchableView = (SearchableHttpPanelView) view;
                break;
            }
        }
    }
    return searchableView;
}
Also used : HttpPanelView(org.zaproxy.zap.extension.httppanel.view.HttpPanelView) SearchableHttpPanelView(org.zaproxy.zap.extension.search.SearchableHttpPanelView) SearchableHttpPanelView(org.zaproxy.zap.extension.search.SearchableHttpPanelView)

Example 3 with HttpPanelView

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

the class SelectMessageLocationsPanel method removeView.

@Override
public void removeView(String componentName, String viewName, Object options) {
    for (Iterator<HttpPanelView> it = views.iterator(); it.hasNext(); ) {
        HttpPanelView httpPanelView = it.next();
        if (viewName.equals(httpPanelView.getName())) {
            ((MessageLocationProducer) httpPanelView).removeFocusListener(focusListeners);
            it.remove();
            break;
        }
    }
    super.removeView(componentName, viewName, options);
}
Also used : HttpPanelView(org.zaproxy.zap.extension.httppanel.view.HttpPanelView)

Example 4 with HttpPanelView

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

the class AbstractMessageLocationsPanel method createMessagePanelEventListener.

protected MessagePanelEventListener createMessagePanelEventListener() {
    return new MessagePanelEventListener() {

        @Override
        public void componentChanged(ComponentChangedEvent event) {
            for (T entry : getModel().getElements()) {
                MessageLocationHighlight highlight = entry.getHighlight();
                if (highlight != null) {
                    MessageLocationHighlight highlightReference = selectMessageLocationsPanel.highlight(entry.getLocation(), highlight);
                    entry.setHighlightReference(highlightReference);
                }
            }
        }

        @Override
        public void viewSelected(MessageViewSelectedEvent event) {
            HttpPanelView view = event.getCurrentView();
            if (view instanceof MessageLocationHighlighter) {
                MessageLocationHighlighter highlighter = (MessageLocationHighlighter) view;
                for (T entry : getModel().getElements()) {
                    MessageLocationHighlight highlight = entry.getHighlight();
                    if (highlight != null) {
                        MessageLocationHighlight highlightReference = highlighter.highlight(entry.getLocation(), highlight);
                        entry.setHighlightReference(highlightReference);
                    }
                }
            } else {
                for (T entry : getModel().getElements()) {
                    entry.setHighlightReference(null);
                }
            }
        }
    };
}
Also used : HttpPanelView(org.zaproxy.zap.extension.httppanel.view.HttpPanelView) MessageViewSelectedEvent(org.zaproxy.zap.extension.httppanel.MessageViewSelectedEvent) MessagePanelEventListener(org.zaproxy.zap.extension.httppanel.MessagePanelEventListener) ComponentChangedEvent(org.zaproxy.zap.extension.httppanel.ComponentChangedEvent)

Example 5 with HttpPanelView

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

the class HttpPanelComponentViewsManager method removeView.

public void removeView(String viewName) {
    HttpPanelView view = views.get(viewName);
    if (view == null) {
        return;
    }
    views.remove(viewName);
    panelViews.remove(view.getPane());
    ViewItem viewItem = viewItems.get(viewName);
    if (enabledViews.contains(viewItem)) {
        disableView(viewItem);
    }
    viewItems.remove(view.getName());
    if (viewName.equals(currentView.getName())) {
        if (enabledViews.size() > 0) {
            switchView(enabledViews.get(0).getConfigName());
        } else {
            currentView = null;
        }
    }
}
Also used : HttpPanelView(org.zaproxy.zap.extension.httppanel.view.HttpPanelView) SearchableHttpPanelView(org.zaproxy.zap.extension.search.SearchableHttpPanelView)

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