diff --git a/plugin/OSGI-INF/l10n/bundle.properties b/plugin/OSGI-INF/l10n/bundle.properties
index 89d64d5a..70baa4be 100644
--- a/plugin/OSGI-INF/l10n/bundle.properties
+++ b/plugin/OSGI-INF/l10n/bundle.properties
@@ -6,11 +6,50 @@ category.name=Snyk
view.name=Snyk Results
toolView.name=Snyk
page.name=Snyk
+
command.name=Run
command.label=Snyk Test
command.label.0=Snyk Test Project
+command.stopScan=Stop Scan
+command.clearCache=Clear Cache
+command.openSnykPreferences=Open Snyk Preferences
+command.criticalSeverity=Critical Severity
+command.highSeverity=High Severity
+command.mediumSeverity=Medium Severity
+command.lowSeverity=Low Severity
+command.openSource=Open Source
+command.codeSecurity=Code Security
+command.codeQuality=Code Quality
+command.infrastructureAsCode=Infrastructure as Code
+command.collapseTree=Collapse Tree
+command.expandTree=Expand Tree
+command.allIssues=All Issues
+command.netNewIssues=Net New Issues
+command.openIssues=Open Issues
+command.ignoredIssues=Ignored Issues
+
+tooltip.scan=Scan
+tooltip.stopScan=Stop Scan
+tooltip.collapseAll=Collapse all tree nodes
+tooltip.expandAll=Expand all tree nodes
+tooltip.emptyScanResults=Empty Scan Results Cache
+tooltip.criticalSeverity=Critical Severity
+tooltip.highSeverity=High Severity
+tooltip.mediumSeverity=Medium Severity
+tooltip.lowSeverity=Low Severity
+tooltip.openPreferences=Open Snyk Preferences
+tooltip.enableOSS=Enable/disable OSS scans
+tooltip.enableCodeSecurity=Enable/disable Code scans
+tooltip.enableCodeQuality=Enable/disable Code scans
+tooltip.enableIAC=Enable/disable IAC scans
+tooltip.hideIgnored=Hide Ignored
+tooltip.showIgnored=Show Ignored
+tooltip.showAllIssues=Show All Issues
+tooltip.showNetNewIssues=Show Only Net New Issues
scanWorkspace.name=snykWorkspaceScan
scanWorkspace.label=Snyk Test Workspace
snyk.trust.dialog.warning.text=When scanning project files for vulnerabilities, Snyk may automatically execute code such as invoking the package manager to get dependency information.
You should only scan projects you trust.
+
+
diff --git a/plugin/plugin.xml b/plugin/plugin.xml
index c76da4d0..54b3fa9a 100644
--- a/plugin/plugin.xml
+++ b/plugin/plugin.xml
@@ -65,90 +65,90 @@
name="%scanWorkspace.name">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ defaultHandler="io.snyk.eclipse.plugin.views.snyktoolview.handlers.StopScanHandler"
+ id="io.snyk.eclipse.plugin.commands.snykStopScan"
+ name="%command.stopScan">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ locationURI="toolbar:io.snyk.eclipse.plugin.views.snyktoolview">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -494,14 +482,4 @@
name="SnykWizard">
-
-
-
-
-
-
diff --git a/plugin/src/main/java/io/snyk/eclipse/plugin/utils/SnykIcons.java b/plugin/src/main/java/io/snyk/eclipse/plugin/utils/SnykIcons.java
new file mode 100644
index 00000000..d61018fb
--- /dev/null
+++ b/plugin/src/main/java/io/snyk/eclipse/plugin/utils/SnykIcons.java
@@ -0,0 +1,24 @@
+package io.snyk.eclipse.plugin.utils;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+
+import io.snyk.eclipse.plugin.Activator;
+
+public class SnykIcons {
+ public static final ImageDescriptor CODE = Activator.getImageDescriptor("/icons/code.png");
+ public static final ImageDescriptor CODE_DISABLED = Activator.getImageDescriptor("/icons/code_disabled.png");
+
+ public static final ImageDescriptor OSS = Activator.getImageDescriptor("/icons/oss.png");
+ public static final ImageDescriptor OSS_DISABLED = Activator.getImageDescriptor("/icons/oss_disabled.png");
+
+ public static final ImageDescriptor IAC = Activator.getImageDescriptor("/icons/iac.png");
+ public static final ImageDescriptor IAC_DISABLED = Activator.getImageDescriptor("/icons/iac_disabled.png");
+
+ public static final ImageDescriptor SEVERITY_CRITICAL = Activator
+ .getImageDescriptor("/icons/severity-critical.png");
+ public static final ImageDescriptor SEVERITY_HIGH = Activator.getImageDescriptor("/icons/severity-high.png");
+ public static final ImageDescriptor SEVERITY_MEDIUM = Activator.getImageDescriptor("/icons/severity-medium.png");
+ public static final ImageDescriptor SEVERITY_LOW = Activator.getImageDescriptor("/icons/severity-low.png");
+
+ public static final ImageDescriptor ENABLED = Activator.getImageDescriptor("/icons/enabled.png");
+}
diff --git a/plugin/src/main/java/io/snyk/eclipse/plugin/views/snyktoolview/BaseTreeNode.java b/plugin/src/main/java/io/snyk/eclipse/plugin/views/snyktoolview/BaseTreeNode.java
index 2ca7f8e1..396bcd5c 100644
--- a/plugin/src/main/java/io/snyk/eclipse/plugin/views/snyktoolview/BaseTreeNode.java
+++ b/plugin/src/main/java/io/snyk/eclipse/plugin/views/snyktoolview/BaseTreeNode.java
@@ -50,11 +50,11 @@ public ImageDescriptor getImageDescriptor() {
public String getText() {
return this.text;
}
-
+
public void setText(String text) {
this.text = text;
}
-
+
@Override
public String toString() {
return this.value.toString();
diff --git a/plugin/src/main/java/io/snyk/eclipse/plugin/views/snyktoolview/ISnykToolView.java b/plugin/src/main/java/io/snyk/eclipse/plugin/views/snyktoolview/ISnykToolView.java
index a25c6d6e..257aa5db 100644
--- a/plugin/src/main/java/io/snyk/eclipse/plugin/views/snyktoolview/ISnykToolView.java
+++ b/plugin/src/main/java/io/snyk/eclipse/plugin/views/snyktoolview/ISnykToolView.java
@@ -1,6 +1,7 @@
package io.snyk.eclipse.plugin.views.snyktoolview;
import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.TreeViewer;
/**
* This interface captures the externally used methods with the tool window.
@@ -12,7 +13,7 @@ public interface ISnykToolView {
String NO_FIXABLE_ISSUES = "There are no issues automatically fixable.";
String IGNORED_ISSUES_FILTERED_BUT_AVAILABLE = "Adjust your Issue View Options to see ignored issues.";
String OPEN_ISSUES_FILTERED_BUT_AVAILABLE = "Adjust your Issue View Options to open issues.";
-
+
String NODE_TEXT_SCANNING = "Scanning...";
String NODE_TEXT_NO_ISSUES_FOUND = "No issues found";
String NODE_TEXT_EROR = "An error occurred";
@@ -63,18 +64,17 @@ public interface ISnykToolView {
* @return
*/
abstract BaseTreeNode getProductNode(String product);
-
+
/**
* Resets a product node
*/
abstract void resetNode(BaseTreeNode node);
-
/**
* Refreshes the tree display
*/
abstract void refreshTree();
-
+
/**
* Returns the tree root
*
@@ -82,8 +82,17 @@ public interface ISnykToolView {
*/
abstract BaseTreeNode getRoot();
+ /**
+ * Clears all nodes in the tree
+ *
+ * @return
+ */
+ abstract void clearTree();
+
static String getPlural(long count) {
return count > 1 ? "s" : "";
}
-
+
+ abstract TreeViewer getTreeViewer();
+
}
diff --git a/plugin/src/main/java/io/snyk/eclipse/plugin/views/snyktoolview/ProductTreeNode.java b/plugin/src/main/java/io/snyk/eclipse/plugin/views/snyktoolview/ProductTreeNode.java
index 3c2ba510..7a01a66d 100644
--- a/plugin/src/main/java/io/snyk/eclipse/plugin/views/snyktoolview/ProductTreeNode.java
+++ b/plugin/src/main/java/io/snyk/eclipse/plugin/views/snyktoolview/ProductTreeNode.java
@@ -1,54 +1,46 @@
package io.snyk.eclipse.plugin.views.snyktoolview;
-import org.eclipse.jface.resource.ImageDescriptor;
-
-import io.snyk.eclipse.plugin.Activator;
import io.snyk.eclipse.plugin.domain.ProductConstants;
+import io.snyk.eclipse.plugin.utils.SnykIcons;
+
+public class ProductTreeNode extends BaseTreeNode {
-public class ProductTreeNode extends BaseTreeNode {
- public static final ImageDescriptor OSS = Activator.getImageDescriptor("/icons/oss.png");
- public static final ImageDescriptor CODE = Activator.getImageDescriptor("/icons/code.png");
- public static final ImageDescriptor IAC = Activator.getImageDescriptor("/icons/iac.png");
-
private String product;
public ProductTreeNode(Object value) {
super(value);
this.setProduct(value.toString());
-
+
switch (value.toString()) {
case ProductConstants.DISPLAYED_OSS:
- setImageDescriptor(OSS);
+ setImageDescriptor(SnykIcons.OSS);
break;
case ProductConstants.DISPLAYED_IAC:
- setImageDescriptor(IAC);
+ setImageDescriptor(SnykIcons.IAC);
break;
case ProductConstants.DISPLAYED_CODE_QUALITY:
- setImageDescriptor(CODE);
+ setImageDescriptor(SnykIcons.CODE);
break;
case ProductConstants.DISPLAYED_CODE_SECURITY:
- setImageDescriptor(CODE);
+ setImageDescriptor(SnykIcons.CODE);
break;
}
}
-
-
@Override
public void setText(String text) {
this.setValue(text);
}
-
-
@Override
public void setValue(Object value) {
- if (!(value instanceof String)) throw new IllegalArgumentException("value of product node must be a string");
+ if (!(value instanceof String))
+ throw new IllegalArgumentException("value of product node must be a string");
var cleanedValue = removePrefix(value.toString());
-
+
// we don't want to override the product text
if (!cleanedValue.isBlank()) {
- cleanedValue = product + " - " + cleanedValue;
+ cleanedValue = product + " - " + cleanedValue;
} else {
cleanedValue = product;
}
@@ -68,14 +60,10 @@ public void reset() {
this.setValue(product);
}
-
-
public String getProduct() {
return product;
}
-
-
public void setProduct(String product) {
this.product = product;
}
diff --git a/plugin/src/main/java/io/snyk/eclipse/plugin/views/snyktoolview/RootNode.java b/plugin/src/main/java/io/snyk/eclipse/plugin/views/snyktoolview/RootNode.java
index efcba8aa..03b63743 100644
--- a/plugin/src/main/java/io/snyk/eclipse/plugin/views/snyktoolview/RootNode.java
+++ b/plugin/src/main/java/io/snyk/eclipse/plugin/views/snyktoolview/RootNode.java
@@ -19,7 +19,8 @@ public RootNode() {
codeQualityRootNode = new ProductTreeNode(DISPLAYED_CODE_QUALITY);
iacRootNode = new ProductTreeNode(DISPLAYED_IAC);
- BaseTreeNode[] children = new BaseTreeNode[] { ossRootNode, codeSecurityRootNode, codeQualityRootNode, iacRootNode, };
+ BaseTreeNode[] children = new BaseTreeNode[] { ossRootNode, codeSecurityRootNode, codeQualityRootNode,
+ iacRootNode, };
setChildren(children);
}
}
diff --git a/plugin/src/main/java/io/snyk/eclipse/plugin/views/snyktoolview/SnykToolView.java b/plugin/src/main/java/io/snyk/eclipse/plugin/views/snyktoolview/SnykToolView.java
index ffa95122..b65bf713 100644
--- a/plugin/src/main/java/io/snyk/eclipse/plugin/views/snyktoolview/SnykToolView.java
+++ b/plugin/src/main/java/io/snyk/eclipse/plugin/views/snyktoolview/SnykToolView.java
@@ -6,7 +6,6 @@
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.preference.PreferenceDialog;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
@@ -25,7 +24,6 @@
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.PreferencesUtil;
import org.eclipse.ui.part.ViewPart;
import org.osgi.framework.Bundle;
@@ -96,8 +94,6 @@ public void selectionChanged(SelectionChangedEvent event) {
}
}
});
-
- makeActions();
}
private void registerTreeContextMeny(Composite parent) {
@@ -142,27 +138,6 @@ private void initBrowserText() {
+ "
\n" + snykWarningText + "