use of org.zaproxy.zap.extension.httppanel.MessageViewSelectedEvent 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);
}
}
}
};
}
Aggregations