use of org.zaproxy.zap.extension.httppanel.component.HttpPanelComponentInterface in project zaproxy by zaproxy.
the class HttpPanel method removeComponent.
public void removeComponent(String componentName) {
synchronized (components) {
HttpPanelComponentInterface component = components.get(componentName);
if (component != null) {
if (component.isEnabled(message)) {
disableComponent(component);
}
if (enabledComponents.size() > 0) {
switchComponent(enabledComponents.get(0).getName());
} else {
switchEmptyComponent();
}
components.remove(componentName);
panelContent.remove(component.getMainPanel());
this.validate();
}
}
}
use of org.zaproxy.zap.extension.httppanel.component.HttpPanelComponentInterface in project zaproxy by zaproxy.
the class HttpPanel method highlightBody.
public void highlightBody(SearchMatch sm) {
if (currentComponent instanceof SearchableHttpPanelComponent) {
((SearchableHttpPanelComponent) currentComponent).highlightBody(sm);
} else {
HttpPanelComponentInterface component = findSearchablePanel();
if (component != null) {
switchComponent(component.getName());
((SearchableHttpPanelComponent) currentComponent).highlightBody(sm);
}
}
}
use of org.zaproxy.zap.extension.httppanel.component.HttpPanelComponentInterface in project zaproxy by zaproxy.
the class HttpPanel method setEnableViewSelect.
public void setEnableViewSelect(boolean enableViewSelect) {
if (isEnableViewSelect != enableViewSelect) {
isEnableViewSelect = enableViewSelect;
synchronized (components) {
Iterator<HttpPanelComponentInterface> it = components.values().iterator();
while (it.hasNext()) {
HttpPanelComponentInterface component = it.next();
component.setEnableViewSelect(enableViewSelect);
component.getButton().setEnabled(enableViewSelect);
}
}
}
}
use of org.zaproxy.zap.extension.httppanel.component.HttpPanelComponentInterface in project zaproxy by zaproxy.
the class HttpPanel method setMessage.
public void setMessage(Message msg) {
this.message = msg;
for (Iterator<Entry<String, HttpPanelComponentInterface>> it = components.entrySet().iterator(); it.hasNext(); ) {
HttpPanelComponentInterface component = it.next().getValue();
if (!component.isEnabled(message)) {
if (enabledComponents.contains(component)) {
disableComponent(component);
}
} else if (!enabledComponents.contains(component)) {
enableComponent(component);
}
}
if (enabledComponents.size() == 0) {
currentComponent = null;
switchEmptyComponent();
return;
}
boolean switchView = true;
if (currentComponent != null && enabledComponents.contains(components.get(currentComponent.getName()))) {
switchView = false;
}
this.validate();
if (switchView) {
switchComponent(enabledComponents.get(0).getName());
} else {
updateContent();
}
}
use of org.zaproxy.zap.extension.httppanel.component.HttpPanelComponentInterface in project zaproxy by zaproxy.
the class HttpPanel method highlightHeader.
public void highlightHeader(SearchMatch sm) {
if (currentComponent instanceof SearchableHttpPanelComponent) {
((SearchableHttpPanelComponent) currentComponent).highlightHeader(sm);
} else {
HttpPanelComponentInterface component = findSearchablePanel();
if (component != null) {
switchComponent(component.getName());
((SearchableHttpPanelComponent) currentComponent).highlightHeader(sm);
}
}
}
Aggregations