use of org.zaproxy.zap.extension.history.HistoryFilterPlusDialog in project zaproxy by zaproxy.
the class SiteMapPanel method showFilterPlusDialog.
private void showFilterPlusDialog() {
HistoryFilterPlusDialog dialog = getFilterPlusDialog();
dialog.setModal(true);
try {
dialog.setAllTags(Model.getSingleton().getDb().getTableTag().getAllTags());
} catch (DatabaseException e) {
log.error(e.getMessage(), e);
}
int exit = dialog.showDialog();
SiteTreeFilter filter = new SiteTreeFilter(dialog.getFilter());
filter.setInScope(this.getScopeButton().isSelected());
if (exit != JOptionPane.CANCEL_OPTION) {
setFilter();
}
}
use of org.zaproxy.zap.extension.history.HistoryFilterPlusDialog in project zaproxy by zaproxy.
the class SiteMapPanel method getFilterPlusDialog.
private HistoryFilterPlusDialog getFilterPlusDialog() {
if (filterPlusDialog == null) {
filterPlusDialog = new HistoryFilterPlusDialog(getView().getMainFrame(), true);
// Override the title as we're reusing the history filter dialog
filterPlusDialog.setTitle(Constant.messages.getString("sites.filter.title"));
}
return filterPlusDialog;
}
use of org.zaproxy.zap.extension.history.HistoryFilterPlusDialog in project zaproxy by zaproxy.
the class ExtensionHistory method showFilterPlusDialog.
protected int showFilterPlusDialog() {
HistoryFilterPlusDialog dialog = getFilterPlusDialog();
dialog.setModal(true);
try {
dialog.setAllTags(getModel().getDb().getTableTag().getAllTags());
} catch (DatabaseException e) {
logger.error(e.getMessage(), e);
}
int exit = dialog.showDialog();
// cancel, state unchanged
int result = 0;
HistoryFilter historyFilter = dialog.getFilter();
if (exit == JOptionPane.OK_OPTION) {
searchHistory(historyFilter);
logPanel.setFilterStatus(historyFilter);
// applied
result = 1;
} else if (exit == JOptionPane.NO_OPTION) {
searchHistory(historyFilter);
logPanel.setFilterStatus(historyFilter);
// reset
result = -1;
}
return result;
}
use of org.zaproxy.zap.extension.history.HistoryFilterPlusDialog in project zaproxy by zaproxy.
the class ExtensionHistory method addHistory.
public void addHistory(HistoryReference historyRef) {
if (Constant.isLowMemoryOptionSet()) {
return;
}
try {
synchronized (historyTableModel) {
if (isHistoryTypeToShow(historyRef.getHistoryType())) {
final String uri = historyRef.getURI().toString();
if (this.showJustInScope && !getModel().getSession().isInScope(uri)) {
// Not in scope
addToMap(historyRef);
return;
} else if (linkWithSitesTree && linkWithSitesTreeBaseUri != null && !uri.startsWith(linkWithSitesTreeBaseUri)) {
// Not under the selected node
addToMap(historyRef);
return;
}
if (getView() != null) {
// Dont do this in daemon mode
HistoryFilterPlusDialog dialog = getFilterPlusDialog();
HistoryFilter historyFilter = dialog.getFilter();
if (historyFilter != null && !historyFilter.matches(historyRef)) {
// Not in filter
addToMap(historyRef);
return;
}
addHistoryInEventQueue(historyRef);
}
}
}
} catch (final Exception e) {
logger.error(e.getMessage(), e);
}
}
Aggregations