};
{
hideSafeAction = new Action("Hide safe vulnerability sinks (const params)", IAction.AS_CHECK_BOX) {
boolean hasFilter = false;
ViewerFilter filter = new ViewerFilter() {
public boolean select(Viewer viewer, Object parentElement, Object element) {
ViewMatch match = (ViewMatch) element;
return match.isError();
}
};
public void run() {
if (!hasFilter) {
viewer.addFilter(filter);
hasFilter = true;
} else {
viewer.removeFilter(filter);
hasFilter = false;
}
}
};
hideSafeAction.setImageDescriptor(JavaPluginImages.DESC_ELCL_FILTER);
// //////////
hideNoSourceAction = new Action("Hide vulnerability sinks without source", IAction.AS_CHECK_BOX) {
boolean hasFilter = false;
ViewerFilter filter = new ViewerFilter() {
public boolean select(Viewer viewer, Object parentElement, Object element) {
ViewMatch match = (ViewMatch) element;
return match.isSource();
}
};
public void run() {
if (!hasFilter) {
viewer.addFilter(filter);
hasFilter = true;
} else {
viewer.removeFilter(filter);
hasFilter = false;
}
}
};
hideSafeAction.setImageDescriptor(JavaPluginImages.DESC_ELCL_FILTER);
}
{
showSQLAction = new Action("Show SQL Injection vulnerabilities only", IAction.AS_CHECK_BOX) {
boolean hasFilter = false;
ViewerFilter filter = new ViewerFilter() {
public boolean select(Viewer viewer, Object parentElement, Object element) {
ViewMatch match = (ViewMatch) element;
return match.getCategory().equalsIgnoreCase("SQL Injection");
}
};
public void run() {
if (!hasFilter) {
viewer.addFilter(filter);
hasFilter = true;
} else {
viewer.removeFilter(filter);
hasFilter = false;
}
}
};
showSQLAction.setImageDescriptor(JavaPluginImages.DESC_ELCL_FILTER);
}
{
showXSSAction = new Action("Show Cross-site Scripting vulnerabilities only", IAction.AS_CHECK_BOX) {
boolean hasFilter = false;
ViewerFilter filter = new ViewerFilter() {
public boolean select(Viewer viewer, Object parentElement, Object element) {
ViewMatch match = (ViewMatch) element;
return match.getCategory().equalsIgnoreCase("Cross-site Scripting");
}
};
public void run() {
if (!hasFilter) {
viewer.addFilter(filter);
hasFilter = true;
} else {
viewer.removeFilter(filter);
hasFilter = false;
}
}
};
showXSSAction.setImageDescriptor(JavaPluginImages.DESC_ELCL_FILTER);
}
{
showPTAction = new Action("Show Path Traversal vulnerabilities only", IAction.AS_CHECK_BOX) {
boolean hasFilter = false;
ViewerFilter filter = new ViewerFilter() {
public boolean select(Viewer viewer, Object parentElement, Object element) {
ViewMatch match = (ViewMatch) element;
return match.getCategory().equalsIgnoreCase("Path Traversal");
}
};
public void run() {
if (!hasFilter) {
viewer.addFilter(filter);
hasFilter = true;
} else {
viewer.removeFilter(filter);
hasFilter = false;
}
}
};
showPTAction.setImageDescriptor(JavaPluginImages.DESC_ELCL_FILTER);
}
{
showHttpResponseAction = new Action("Show Http Response Splitting vulnerabilities only", IAction.AS_CHECK_BOX) {
boolean hasFilter = false;
ViewerFilter filter = new ViewerFilter() {
public boolean select(Viewer viewer, Object parentElement, Object element) {
ViewMatch match = (ViewMatch) element;
return match.getCategory().equalsIgnoreCase("HTTP Response Splitting");
}
};
public void run() {
if (!hasFilter) {
viewer.addFilter(filter);
hasFilter = true;
} else {
viewer.removeFilter(filter);
hasFilter = false;
}
}
};
showHttpResponseAction.setImageDescriptor(JavaPluginImages.DESC_ELCL_FILTER);
}
{
showCommandInjectionAction = new Action("Show Command Injection vulnerabilities only", IAction.AS_CHECK_BOX) {
boolean hasFilter = false;
ViewerFilter filter = new ViewerFilter() {
public boolean select(Viewer viewer, Object parentElement, Object element) {
ViewMatch match = (ViewMatch) element;
return match.getCategory().equalsIgnoreCase("Command Injection");
}
};
public void run() {
if (!hasFilter) {
viewer.addFilter(filter);
hasFilter = true;
} else {
viewer.removeFilter(filter);
hasFilter = false;
}
}
};
showCommandInjectionAction.setImageDescriptor(JavaPluginImages.DESC_ELCL_FILTER);
}
{
showLDAPAction = new Action("Show LDAP Injection vulnerabilities only", IAction.AS_CHECK_BOX) {
boolean hasFilter = false;
ViewerFilter filter = new ViewerFilter() {
public boolean select(Viewer viewer, Object parentElement, Object element) {
ViewMatch match = (ViewMatch) element;
return match.getCategory().equalsIgnoreCase("LDAP Injection");
}
};
public void run() {
if (!hasFilter) {
viewer.addFilter(filter);
hasFilter = true;
} else {
viewer.removeFilter(filter);
hasFilter = false;
}
}
};
showLDAPAction.setImageDescriptor(JavaPluginImages.DESC_ELCL_FILTER);
}
{
showXPathAction = new Action("Show XPath Injection vulnerabilities only", IAction.AS_CHECK_BOX) {
boolean hasFilter = false;
ViewerFilter filter = new ViewerFilter() {
public boolean select(Viewer viewer, Object parentElement, Object element) {
ViewMatch match = (ViewMatch) element;
return match.getCategory().equalsIgnoreCase("XPath Injection");
}
};
public void run() {
if (!hasFilter) {
viewer.addFilter(filter);
hasFilter = true;
} else {
viewer.removeFilter(filter);
hasFilter = false;
}
}
};
showXPathAction.setImageDescriptor(JavaPluginImages.DESC_ELCL_FILTER);
}
{
hideNoSourceAction = new Action("Hide vulnerability sinks without source code", IAction.AS_CHECK_BOX) {
boolean hasFilter = false;
ViewerFilter filter = new ViewerFilter() {
public boolean select(Viewer viewer, Object parentElement, Object element) {
ViewMatch match = (ViewMatch) element;
return match.isSource();
}
};