diff --git a/checkmarx-ast-eclipse-plugin-tests/src/test/java/checkmarx/ast/eclipse/plugin/tests/ui/BaseUITest.java b/checkmarx-ast-eclipse-plugin-tests/src/test/java/checkmarx/ast/eclipse/plugin/tests/ui/BaseUITest.java index 7a078e9e..7c81f36b 100644 --- a/checkmarx-ast-eclipse-plugin-tests/src/test/java/checkmarx/ast/eclipse/plugin/tests/ui/BaseUITest.java +++ b/checkmarx-ast-eclipse-plugin-tests/src/test/java/checkmarx/ast/eclipse/plugin/tests/ui/BaseUITest.java @@ -20,9 +20,6 @@ public abstract class BaseUITest { protected static final String ITEM_CHECKMARX_AST = "Checkmarx AST"; protected static final String ITEM_CHECKMARX_AST_SCAN = "Checkmarx AST Scan"; - protected static final String LABEL_SERVER_URL = "Server Url:"; - protected static final String LABEL_TENANT = "Tenant:"; - protected static final String LABEL_AST_API_KEY = "AST API Key:"; protected static final String LABEL_SCAN_ID = "Scan Id:"; protected static final String COLUMN_TITLE = "Title"; diff --git a/checkmarx-ast-eclipse-plugin-tests/src/test/java/checkmarx/ast/eclipse/plugin/tests/ui/TestUI.java b/checkmarx-ast-eclipse-plugin-tests/src/test/java/checkmarx/ast/eclipse/plugin/tests/ui/TestUI.java index 589d1c4f..990d5001 100644 --- a/checkmarx-ast-eclipse-plugin-tests/src/test/java/checkmarx/ast/eclipse/plugin/tests/ui/TestUI.java +++ b/checkmarx-ast-eclipse-plugin-tests/src/test/java/checkmarx/ast/eclipse/plugin/tests/ui/TestUI.java @@ -9,7 +9,6 @@ import java.util.concurrent.TimeoutException; import java.util.stream.Collectors; -import org.eclipse.swtbot.eclipse.finder.waits.Conditions; import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner; import org.eclipse.swtbot.swt.finder.keyboard.Keystrokes; import org.eclipse.swtbot.swt.finder.widgets.SWTBotToolbarButton; @@ -28,7 +27,7 @@ public class TestUI extends BaseUITest { private static final String ERROR_SERVER_URL_NOT_SET = "Error: Checkmarx server URL is not set"; - private static final String INFO_SUCCESSFUL_CONNECTION = "Connection successfull !"; + private static final String INFO_SUCCESSFUL_CONNECTION = "Successfully authenticated to AST server!"; private static final String ASSERT_FILTER_ACTIONS_IN_TOOLBAR = "All filter actions must be in the tool bar"; private static final String ASSERT_GROUP_BY_ACTIONS_IN_TOOLBAR = "All group by actions must be in the tool bar"; @@ -43,7 +42,7 @@ public class TestUI extends BaseUITest { private static boolean _cxSettingsDefined = false; @Test - public void testSuccessfulConnetion() { + public void testSuccessfulConnetion() throws TimeoutException { testSuccessfulConnection(); } @@ -294,8 +293,10 @@ private List expandTreeUntilFirstEngineAndGetCurrentSeverities() { /** * Test successful connection + * + * @throws TimeoutException */ - private void testSuccessfulConnection() { + private void testSuccessfulConnection() throws TimeoutException { preventWidgetWasNullInCIEnvironment(); if(_cxSettingsDefined) return; @@ -306,18 +307,18 @@ private void testSuccessfulConnection() { _bot.sleep(1000); - _bot.textWithLabel(LABEL_SERVER_URL).setText(Environment.BASE_URL); - _bot.textWithLabel(LABEL_TENANT).setText(Environment.TENANT); - _bot.textWithLabel(LABEL_AST_API_KEY).setText(Environment.API_KEY); + _bot.textWithLabel(PluginConstants.PREFERENCES_SERVER_URL).setText(Environment.BASE_URL); + _bot.textWithLabel(PluginConstants.PREFERENCES_TENANT).setText(Environment.TENANT); + _bot.textWithLabel(PluginConstants.PREFERENCES_API_KEY).setText(Environment.API_KEY); _bot.button(BTN_APPLY).click(); _bot.button(BTN_TEST_CONNECTION).click(); - _bot.waitUntil(Conditions.shellIsActive(SHELL_AUTHENTICATION)); - - assertEquals(INFO_SUCCESSFUL_CONNECTION, _bot.label(INFO_SUCCESSFUL_CONNECTION).getText()); - _bot.button(BTN_OK).click(); + //Do waitUntil Method to get text from text(6) + waitForConnectionResponse(); + assertEquals(INFO_SUCCESSFUL_CONNECTION, _bot.text(6).getText()); + _bot.shell(ITEM_PREFERENCES).setFocus(); // Need to set focus to avoid failing in CI environment _bot.button(BTN_APPLY_AND_CLOSE).click(); @@ -372,9 +373,9 @@ private void clearCheckmarxCredentials() { _bot.shell(ITEM_PREFERENCES).activate(); _bot.tree().select(ITEM_CHECKMARX_AST); - _bot.textWithLabel(LABEL_SERVER_URL).setText(""); - _bot.textWithLabel(LABEL_TENANT).setText(""); - _bot.textWithLabel(LABEL_AST_API_KEY).setText(""); + _bot.textWithLabel(PluginConstants.PREFERENCES_SERVER_URL).setText(""); + _bot.textWithLabel(PluginConstants.PREFERENCES_TENANT).setText(""); + _bot.textWithLabel(PluginConstants.PREFERENCES_API_KEY).setText(""); _bot.button(BTN_APPLY).click(); _bot.button(BTN_APPLY_AND_CLOSE).click(); @@ -458,4 +459,27 @@ private static void waitUntilBranchComboIsEnabled() throws TimeoutException { throw new TimeoutException("Timeout after 5000ms. Branches' combobox must be enabled"); } } + + /** + * Wait while tree node equals to a a specific message. Fails after 10 retries + * + * @param nodeText + * @throws TimeoutException + */ + private static void waitForConnectionResponse() throws TimeoutException { + int retryIdx = 0; + + while (!_bot.text(6).getText().equals(INFO_SUCCESSFUL_CONNECTION)) { + if (retryIdx == 10) { + break; + } + + _bot.sleep(1000); + retryIdx++; + } + + if (retryIdx == 10) { + throw new TimeoutException("Connection validation timeout after 10000ms."); + } + } } diff --git a/checkmarx-ast-eclipse-plugin/.classpath b/checkmarx-ast-eclipse-plugin/.classpath index a5188568..02531096 100644 --- a/checkmarx-ast-eclipse-plugin/.classpath +++ b/checkmarx-ast-eclipse-plugin/.classpath @@ -1,6 +1,10 @@ - + + + + + @@ -9,7 +13,7 @@ - - + + diff --git a/checkmarx-ast-eclipse-plugin/META-INF/MANIFEST.MF b/checkmarx-ast-eclipse-plugin/META-INF/MANIFEST.MF index 00c49a6a..104909a3 100644 --- a/checkmarx-ast-eclipse-plugin/META-INF/MANIFEST.MF +++ b/checkmarx-ast-eclipse-plugin/META-INF/MANIFEST.MF @@ -22,5 +22,5 @@ Bundle-ClassPath: lib/slf4j-simple-1.7.5.jar, lib/jackson-core-2.12.4.jar, lib/jackson-databind-2.12.4.jar, lib/commons-lang3-3.12.0.jar, - lib/ast-cli-java-wrapper-1.0.18.jar, + lib/ast-cli-java-wrapper-1.0.22.jar, . diff --git a/checkmarx-ast-eclipse-plugin/build.properties b/checkmarx-ast-eclipse-plugin/build.properties index ed0b0d1c..d9981e73 100644 --- a/checkmarx-ast-eclipse-plugin/build.properties +++ b/checkmarx-ast-eclipse-plugin/build.properties @@ -9,6 +9,6 @@ bin.includes = plugin.xml,\ lib/jackson-core-2.12.4.jar,\ lib/jackson-databind-2.12.4.jar,\ lib/commons-lang3-3.12.0.jar,\ - lib/ast-cli-java-wrapper-1.0.18.jar,\ - . + .,\ + lib/ast-cli-java-wrapper-1.0.22.jar source.. = src/ diff --git a/checkmarx-ast-eclipse-plugin/icons/high_untoggle.png b/checkmarx-ast-eclipse-plugin/icons/high_untoggle.png new file mode 100644 index 00000000..b3091107 Binary files /dev/null and b/checkmarx-ast-eclipse-plugin/icons/high_untoggle.png differ diff --git a/checkmarx-ast-eclipse-plugin/icons/info_untoggle.png b/checkmarx-ast-eclipse-plugin/icons/info_untoggle.png new file mode 100644 index 00000000..b7614204 Binary files /dev/null and b/checkmarx-ast-eclipse-plugin/icons/info_untoggle.png differ diff --git a/checkmarx-ast-eclipse-plugin/icons/low_untoggle.png b/checkmarx-ast-eclipse-plugin/icons/low_untoggle.png new file mode 100644 index 00000000..90a8d3b0 Binary files /dev/null and b/checkmarx-ast-eclipse-plugin/icons/low_untoggle.png differ diff --git a/checkmarx-ast-eclipse-plugin/icons/medium_untoggle.png b/checkmarx-ast-eclipse-plugin/icons/medium_untoggle.png new file mode 100644 index 00000000..48afebe3 Binary files /dev/null and b/checkmarx-ast-eclipse-plugin/icons/medium_untoggle.png differ diff --git a/checkmarx-ast-eclipse-plugin/lib/ast-cli-java-wrapper-1.0.18.jar b/checkmarx-ast-eclipse-plugin/lib/ast-cli-java-wrapper-1.0.22.jar similarity index 60% rename from checkmarx-ast-eclipse-plugin/lib/ast-cli-java-wrapper-1.0.18.jar rename to checkmarx-ast-eclipse-plugin/lib/ast-cli-java-wrapper-1.0.22.jar index 351196ba..c13b4105 100644 Binary files a/checkmarx-ast-eclipse-plugin/lib/ast-cli-java-wrapper-1.0.18.jar and b/checkmarx-ast-eclipse-plugin/lib/ast-cli-java-wrapper-1.0.22.jar differ diff --git a/checkmarx-ast-eclipse-plugin/src/com/checkmarx/eclipse/properties/AuthButtonFieldEditor.java b/checkmarx-ast-eclipse-plugin/src/com/checkmarx/eclipse/properties/AuthButtonFieldEditor.java index 33dbec8a..b099dadc 100644 --- a/checkmarx-ast-eclipse-plugin/src/com/checkmarx/eclipse/properties/AuthButtonFieldEditor.java +++ b/checkmarx-ast-eclipse-plugin/src/com/checkmarx/eclipse/properties/AuthButtonFieldEditor.java @@ -1,41 +1,71 @@ package com.checkmarx.eclipse.properties; -import org.eclipse.jface.dialogs.MessageDialog; +import java.util.concurrent.CompletableFuture; +import java.util.function.Consumer; + import org.eclipse.jface.preference.StringButtonFieldEditor; +import org.eclipse.jface.preference.StringFieldEditor; +import org.eclipse.swt.custom.CLabel; import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Display; import com.checkmarx.eclipse.runner.Authenticator; +import com.checkmarx.eclipse.utils.CxLogger; +import com.checkmarx.eclipse.utils.PluginConstants; public class AuthButtonFieldEditor extends StringButtonFieldEditor { - protected AuthButtonFieldEditor(String name, String labelText, - Composite parent) { - super(name, labelText, parent); - setChangeButtonText("Test Connection"); + Consumer consumer; - } + private StringFieldEditor serverUrl; + private StringFieldEditor authUrl; + private StringFieldEditor tenant; + private StringFieldEditor apiKey; + private StringFieldEditor additionalParams; + private CLabel connectionLabel; - @Override - protected String changePressed() { + AuthButtonFieldEditor(String name, String labelText, Composite parent, StringFieldEditor serverUrl, + StringFieldEditor authUrl, StringFieldEditor tenant, StringFieldEditor apiKey, + StringFieldEditor additionalParams, CLabel connectionLabel) { + super(name, labelText, parent); + setChangeButtonText(labelText); + this.serverUrl = serverUrl; + this.authUrl = authUrl; + this.tenant = tenant; + this.apiKey = apiKey; + this.additionalParams = additionalParams; + this.connectionLabel = connectionLabel; + } - String result = Authenticator.INSTANCE.doAuthentication(); - if(!result.isEmpty()) - { - MessageDialog.openInformation(null, "Authentication", "Connection successfull !"); - } - else - { - MessageDialog.openInformation(null, "Authentication", "Please check your credentials!"); + @Override + protected String changePressed() { + connectionLabel.setText(PluginConstants.PREFERENCES_VALIDATING_STATE); + + String serverUrl_str = serverUrl.getStringValue(); + String authUrl_str = authUrl.getStringValue(); + String tenant_str = tenant.getStringValue(); + String apiKey_str = apiKey.getStringValue(); + String additionalParams_str = additionalParams.getStringValue(); + + CompletableFuture.supplyAsync(() -> { + try { + return Authenticator.INSTANCE.doAuthentication(serverUrl_str, authUrl_str, tenant_str, apiKey_str, + additionalParams_str); + } catch (Throwable t) { + CxLogger.error(PluginConstants.ERROR_AUTHENTICATING_AST, new Exception(t)); + return t.getMessage(); } - - return null; - } - - public void emptyTextfield() { - setStringValue(""); - Preferences.store(Preferences.API_KEY, ""); - } - - + }).thenAccept((result) -> Display.getDefault().syncExec(() -> connectionLabel.setText(result))); + + return null; + } + + public void emptyTextfield() { + setStringValue(""); + Preferences.store("", ""); + } + + void setValues() { + } } diff --git a/checkmarx-ast-eclipse-plugin/src/com/checkmarx/eclipse/properties/PreferencesPage.java b/checkmarx-ast-eclipse-plugin/src/com/checkmarx/eclipse/properties/PreferencesPage.java index a6c1630d..d67cdcf0 100644 --- a/checkmarx-ast-eclipse-plugin/src/com/checkmarx/eclipse/properties/PreferencesPage.java +++ b/checkmarx-ast-eclipse-plugin/src/com/checkmarx/eclipse/properties/PreferencesPage.java @@ -1,67 +1,132 @@ package com.checkmarx.eclipse.properties; -import org.eclipse.jface.preference.BooleanFieldEditor; +import java.util.concurrent.CompletableFuture; + import org.eclipse.jface.preference.FieldEditor; import org.eclipse.jface.preference.FieldEditorPreferencePage; import org.eclipse.jface.preference.StringFieldEditor; import org.eclipse.jface.util.PropertyChangeEvent; import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Text; import org.eclipse.ui.IWorkbench; import org.eclipse.ui.IWorkbenchPreferencePage; import com.checkmarx.eclipse.Activator; +import com.checkmarx.eclipse.runner.Authenticator; +import com.checkmarx.eclipse.utils.CxLogger; +import com.checkmarx.eclipse.utils.PluginConstants; public class PreferencesPage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage { - - private AuthButtonFieldEditor tokenField; public PreferencesPage() { super(GRID); Activator.getDefault().getPreferenceStore().addPropertyChangeListener(this::handlePropertyChange); } - + private void handlePropertyChange(PropertyChangeEvent event) { } - + @Override public void init(IWorkbench workbench) { - setPreferenceStore(Preferences.STORE); - setMessage("Checkmarx AST preferences"); - setDescription("- Please use 'Test Connection' to verify the credentials."); - + setPreferenceStore(Preferences.STORE); + setMessage("Checkmarx AST preferences"); } @Override protected void createFieldEditors() { - addField(new StringFieldEditor(Preferences.SERVER_URL, "Server Url:", getFieldEditorParent())); - addField(new StringFieldEditor(Preferences.AUTHENTICATION_URL, "Authentication Url:", getFieldEditorParent())); - - addField(new StringFieldEditor(Preferences.TENANT, "Tenant:", getFieldEditorParent())); - tokenField = new AuthButtonFieldEditor(Preferences.API_KEY, "AST API Key:", getFieldEditorParent()); - Text textControl = tokenField.getTextControl(getFieldEditorParent()); + Composite topComposite = new Composite(getFieldEditorParent(), SWT.NONE); + GridData topGridData = new GridData(); + topGridData.horizontalAlignment = GridData.FILL; + topGridData.verticalAlignment = GridData.FILL; + topGridData.grabExcessHorizontalSpace = true; + topComposite.setLayoutData(topGridData); + + getFieldEditorParent().setLayoutData(topGridData); + + GridLayout parentLayout = new GridLayout(); + parentLayout.numColumns = 1; + parentLayout.horizontalSpacing = 0; + parentLayout.verticalSpacing = 0; + parentLayout.marginHeight = 0; + parentLayout.marginWidth = 0; + topComposite.setLayout(parentLayout); + + StringFieldEditor serverUrl = new StringFieldEditor(Preferences.SERVER_URL, PluginConstants.PREFERENCES_SERVER_URL, topComposite); + addField(serverUrl); + + StringFieldEditor authUrl = new StringFieldEditor(Preferences.AUTHENTICATION_URL, PluginConstants.PREFERENCES_AUTH_URL, + topComposite); + addField(authUrl); + + StringFieldEditor tenant = new StringFieldEditor(Preferences.TENANT, PluginConstants.PREFERENCES_TENANT, topComposite); + addField(tenant); + + StringFieldEditor apiKey = new StringFieldEditor(Preferences.API_KEY, PluginConstants.PREFERENCES_API_KEY, topComposite); + addField(apiKey); + Text textControl = apiKey.getTextControl(topComposite); + + StringFieldEditor additionalParams = new StringFieldEditor(Preferences.ADDITIONAL_OPTIONS, + PluginConstants.PREFERENCES_ADDITIONAL_OPTIONS, topGridData.widthHint, 5, 0, topComposite); + addField(additionalParams); + //set the width for API Key text field - GridData gridData = new GridData(SWT.BEGINNING, SWT.CENTER, true, false); - gridData.widthHint = 300; // Some width - textControl.setLayoutData(gridData); - - addField(tokenField); - addField(space()); - addField(new StringFieldEditor(Preferences.ADDITIONAL_OPTIONS, "Additional Options:",50,5,0, getFieldEditorParent())); + GridData gridData = new GridData(SWT.BEGINNING, SWT.CENTER, true, false); + gridData.widthHint = 500; // Some width + gridData.grabExcessHorizontalSpace = false; + gridData.horizontalAlignment = GridData.FILL; + textControl.setLayoutData(gridData); + + addField(space()); + + Text connectionLabel = new Text(getFieldEditorParent(), SWT.MULTI | SWT.WRAP | SWT.READ_ONLY | SWT.V_SCROLL); + //Set layout for scroll area to fit to page + connectionLabel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); + + Button connectionButton = new Button(topComposite, SWT.PUSH); + connectionButton.setText(PluginConstants.PREFERENCES_TEST_CONNECTION); + connectionButton.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + + String serverUrl_str = serverUrl.getStringValue(); + String authUrl_str = authUrl.getStringValue(); + String tenant_str = tenant.getStringValue(); + String apiKey_str = apiKey.getStringValue(); + + String additionalParams_str = additionalParams.getStringValue(); + connectionButton.setEnabled(false); + connectionLabel.setText(PluginConstants.PREFERENCES_VALIDATING_STATE); + getFieldEditorParent().layout(); + CompletableFuture.supplyAsync(() -> { + try { + return Authenticator.INSTANCE.doAuthentication(serverUrl_str, authUrl_str, tenant_str, + apiKey_str, additionalParams_str); + } catch (Throwable t) { + CxLogger.error(PluginConstants.ERROR_AUTHENTICATING_AST, new Exception(t)); + return t.getMessage(); + } + }).thenAccept((result) -> Display.getDefault().syncExec(() -> { + connectionLabel.setText(result); + getFieldEditorParent().layout(); + connectionButton.setEnabled(true); + })); + } + }); } - + private FieldEditor space() { return new LabelFieldEditor("", getFieldEditorParent()); } - -// private FieldEditor label(String label) { -// return new LabelFieldEditor(label, getFieldEditorParent()); -// } - + public void persist() { super.performOk(); } diff --git a/checkmarx-ast-eclipse-plugin/src/com/checkmarx/eclipse/runner/Authenticator.java b/checkmarx-ast-eclipse-plugin/src/com/checkmarx/eclipse/runner/Authenticator.java index 839a81f3..f5ce1894 100644 --- a/checkmarx-ast-eclipse-plugin/src/com/checkmarx/eclipse/runner/Authenticator.java +++ b/checkmarx-ast-eclipse-plugin/src/com/checkmarx/eclipse/runner/Authenticator.java @@ -9,63 +9,34 @@ import com.checkmarx.ast.wrapper.CxConfig.InvalidCLIConfigException; import com.checkmarx.ast.wrapper.CxException; import com.checkmarx.ast.wrapper.CxWrapper; -import com.checkmarx.eclipse.properties.Preferences; +import com.checkmarx.eclipse.utils.CxLogger; +import com.checkmarx.eclipse.utils.PluginConstants; public class Authenticator { - public static final Authenticator INSTANCE = new Authenticator(); + + protected static final String AUTH_STATUS = "Authentication Status: "; -// private String pollCallback(String token) throws IOException, InterruptedException, AuthException, -// KeyManagementException, NoSuchAlgorithmException, KeyStoreException { -// -// -// for (int i = 0; i < 20; i++) { -// HttpResponse response = httpClient.execute(post); -// String responseJson = EntityUtils.toString(response.getEntity(), "UTF-8"); -// AuthResponse authResponse = objectMapper.readValue(responseJson, AuthResponse.class); -// if (authResponse.isOk()) { -// return authResponse.getApi(); -// } -// Thread.sleep(2000); -// } -// -// throw new AuthException("timeout, please try again"); -// -// } + public static final Authenticator INSTANCE = new Authenticator(); - public String doAuthentication() { + public String doAuthentication(String serverUrl, String authUrl, String tenant, String apiKey, + String additionalParams) { - CxConfig config = CxConfig.builder().baseUri(Preferences.getServerUrl()).tenant(Preferences.getTenant()).apiKey(Preferences.getApiKey()).additionalParameters(Preferences.getAdditionalOptions()).build(); + CxConfig config = CxConfig.builder().baseUri(serverUrl).baseAuthUri(authUrl).tenant(tenant).apiKey(apiKey) + .additionalParameters(additionalParams).build(); -// config.setBaseUri(Preferences.getServerUrl()); -// config.setTenant(Preferences.getTenant()); -// config.setApiKey(Preferences.getApiKey()); - Logger log = LoggerFactory.getLogger(Authenticator.class.getName()); CxWrapper wrapper; try { wrapper = new CxWrapper(config, log); String cxValidateOutput = wrapper.authValidate(); - - System.out.println("Authentication Status :" + cxValidateOutput); + CxLogger.info(AUTH_STATUS + cxValidateOutput); return cxValidateOutput; - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (InterruptedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (InvalidCLIConfigException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (CxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); + } catch (IOException | InterruptedException | InvalidCLIConfigException | CxException e) { + CxLogger.error(String.format(PluginConstants.ERROR_AUTHENTICATING_AST, e.getMessage()), e); + return e.getMessage(); } - return null; - - } } diff --git a/checkmarx-ast-eclipse-plugin/src/com/checkmarx/eclipse/utils/PluginConstants.java b/checkmarx-ast-eclipse-plugin/src/com/checkmarx/eclipse/utils/PluginConstants.java index 503b0ceb..ae1a1fa8 100644 --- a/checkmarx-ast-eclipse-plugin/src/com/checkmarx/eclipse/utils/PluginConstants.java +++ b/checkmarx-ast-eclipse-plugin/src/com/checkmarx/eclipse/utils/PluginConstants.java @@ -36,4 +36,14 @@ public class PluginConstants { public static final String TREE_PROVIDED_SCAN_ID_DOES_NOT_EXIST = "Provided scan id %s does not exist"; public static final String TREE_INVALID_SCAN_ID_FORMAT = "Invalid scan id format."; public static final String TREE_NO_RESULTS = "No results."; + + /******************************** PREFERENCES ********************************/ + public static final String PREFERENCES_SERVER_URL = "Server Url:"; + public static final String PREFERENCES_AUTH_URL = "Authentication Url:"; + public static final String PREFERENCES_TENANT = "Tenant:"; + public static final String PREFERENCES_API_KEY = "API key:"; + public static final String PREFERENCES_ADDITIONAL_OPTIONS = "Additional Options:"; + public static final String PREFERENCES_TEST_CONNECTION = "Test Connection"; + public static final String PREFERENCES_VALIDATING_STATE = "Validating..."; + } diff --git a/checkmarx-ast-eclipse-plugin/src/com/checkmarx/eclipse/views/CheckmarxView.java b/checkmarx-ast-eclipse-plugin/src/com/checkmarx/eclipse/views/CheckmarxView.java index 4a028bbf..f0602830 100644 --- a/checkmarx-ast-eclipse-plugin/src/com/checkmarx/eclipse/views/CheckmarxView.java +++ b/checkmarx-ast-eclipse-plugin/src/com/checkmarx/eclipse/views/CheckmarxView.java @@ -33,6 +33,7 @@ import org.eclipse.jgit.events.RefsChangedListener; import org.eclipse.jgit.lib.Repository; import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.CLabel; import org.eclipse.swt.graphics.Font; import org.eclipse.swt.graphics.FontData; import org.eclipse.swt.graphics.Image; @@ -77,7 +78,7 @@ import com.google.common.eventbus.Subscribe; public class CheckmarxView extends ViewPart { - + private static final String PROJECT_COMBO_VIEWER_TEXT = "Select a project"; private static final String SCAN_COMBO_VIEWER_TEXT = "Select a scan"; private static final String BRANCH_COMBO_VIEWER_TEXT = "Select a branch"; @@ -93,16 +94,18 @@ public class CheckmarxView extends ViewPart { */ public static final String ID = "com.checkmarx.eclipse.views.CheckmarxView"; - public static final Image CRITICAL_SEVERITY = Activator.getImageDescriptor("/icons/severity-critical.png").createImage(); + public static final Image CRITICAL_SEVERITY = Activator.getImageDescriptor("/icons/severity-critical.png") + .createImage(); - public static final Image HIGH_SEVERITY = Activator.getImageDescriptor("/icons/severity-high.png").createImage(); + public static final Image HIGH_SEVERITY = Activator.getImageDescriptor("/icons/high_untoggle.png").createImage(); - public static final Image MEDIUM_SEVERITY = Activator.getImageDescriptor("/icons/severity-medium.png").createImage(); + public static final Image MEDIUM_SEVERITY = Activator.getImageDescriptor("/icons/medium_untoggle.png") + .createImage(); - public static final Image LOW_SEVERITY = Activator.getImageDescriptor("/icons/severity-low.png").createImage(); + public static final Image LOW_SEVERITY = Activator.getImageDescriptor("/icons/low_untoggle.png").createImage(); + + public static final Image INFO_SEVERITY = Activator.getImageDescriptor("/icons/info_untoggle.png").createImage(); - public static final Image INFO_SEVERITY = Activator.getImageDescriptor("platform:/plugin/org.eclipse.ui/icons/full/obj16/info_tsk.png").createImage(); - private TreeViewer viewer; private ComboViewer scanIdComboViewer, projectComboViewer, branchComboViewer; private DisplayModel rootModel; @@ -116,13 +119,16 @@ public class CheckmarxView extends ViewPart { private Text attackVectorValueLinkText; private Composite topComposite; - private Composite resultInfoCompositePanel , attackVectorCompositePanel; + private Composite resultInfoCompositePanel, attackVectorCompositePanel; private Composite leftCompositePanel; - + + private CLabel titleLabel; + + private Label attackVectorLabel; private ToolBarActions toolBarActions; - + private EventBus pluginEventBus; - + private GlobalSettings globalSettings = new GlobalSettings(); private String currentProjectId = PluginConstants.EMPTY_STRING; @@ -136,7 +142,7 @@ public class CheckmarxView extends ViewPart { public CheckmarxView() { super(); - + rootModel = new DisplayModel.DisplayModelBuilder(PluginConstants.EMPTY_STRING).build(); globalSettings.loadSettings(); } @@ -200,7 +206,7 @@ public void run() { }); } } - + private void createContextMenu() { MenuManager menuManager = new MenuManager("#PopupMenu"); menuManager.setRemoveAllWhenShown(true); @@ -221,23 +227,19 @@ private void fillContextMenu(IMenuManager manager) { */ private void createToolbar() { IActionBars actionBars = getViewSite().getActionBars(); - IToolBarManager toolBarManager = actionBars.getToolBarManager(); - + IToolBarManager toolBarManager = actionBars.getToolBarManager(); + pluginEventBus = new EventBus(); pluginEventBus.register(this); - - toolBarActions = new ToolBarActions.ToolBarActionsBuilder() - .actionBars(actionBars) - .rootModel(rootModel) - .resultsTree(viewer) - .pluginEventBus(pluginEventBus) - .build(); - - for(Action action : toolBarActions.getToolBarActions()) { + + toolBarActions = new ToolBarActions.ToolBarActionsBuilder().actionBars(actionBars).rootModel(rootModel) + .resultsTree(viewer).pluginEventBus(pluginEventBus).build(); + + for (Action action : toolBarActions.getToolBarActions()) { toolBarManager.add(action); - + // Add divider - if(action.getId() != null && action.getId().equals(ActionName.INFO.name())) { + if (action.getId() != null && action.getId().equals(ActionName.INFO.name())) { toolBarManager.add(new Separator("\t")); } } @@ -256,13 +258,13 @@ private void createViewer(Composite parent) { parentLayout.marginHeight = 0; parentLayout.marginWidth = 0; parent.setLayout(parentLayout); - - //Top Bar Composite Panel + + // Top Bar Composite Panel topComposite = new Composite(parent, SWT.NONE); GridLayout topLayout = new GridLayout(); topLayout.numColumns = 3; topComposite.setLayout(topLayout); - + GridData topGridData = new GridData(); topGridData.horizontalAlignment = GridData.FILL; topGridData.verticalAlignment = GridData.FILL; @@ -271,10 +273,10 @@ private void createViewer(Composite parent) { createProjectListComboBox(topComposite); createBranchComboBox(topComposite); createScanIdComboBox(topComposite); - - //Bottom Panel + + // Bottom Panel Composite bottomComposite = new Composite(parent, SWT.BORDER); - + GridData bottomGridData = new GridData(); bottomGridData.horizontalAlignment = GridData.FILL; bottomGridData.verticalAlignment = GridData.FILL; @@ -283,23 +285,24 @@ private void createViewer(Composite parent) { bottomComposite.setLayout(new FillLayout(SWT.HORIZONTAL)); bottomComposite.setLayoutData(bottomGridData); - + leftCompositePanel = new Composite(bottomComposite, SWT.BORDER); - GridLayout leftCompositeLayout = new GridLayout(); + GridLayout leftCompositeLayout = new GridLayout(); leftCompositeLayout.numColumns = 1; GridData leftCompositePanelGridData = new GridData(); leftCompositePanelGridData.horizontalAlignment = GridData.BEGINNING; leftCompositePanelGridData.grabExcessVerticalSpace = true; leftCompositeLayout.marginWidth = 0; leftCompositeLayout.marginHeight = 0; - + leftCompositePanel.setLayoutData(leftCompositePanelGridData); - leftCompositePanel.setLayout(leftCompositeLayout); + leftCompositePanel.setLayout(leftCompositeLayout); - viewer = new TreeViewer(leftCompositePanel, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION ); + viewer = new TreeViewer(leftCompositePanel, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION); - //Display initial message - boolean gettingResults = globalSettings.getProjectId() != null && !globalSettings.getProjectId().isEmpty() && globalSettings.getScanId() != null && !globalSettings.getScanId().isEmpty(); + // Display initial message + boolean gettingResults = globalSettings.getProjectId() != null && !globalSettings.getProjectId().isEmpty() + && globalSettings.getScanId() != null && !globalSettings.getScanId().isEmpty(); boolean noProjectsAvailable = projectComboViewer.getCombo().getText().equals(NO_PROJECTS_AVAILABLE); String message = gettingResults && !noProjectsAvailable ? String.format(PluginConstants.RETRIEVING_RESULTS_FOR_SCAN, globalSettings.getScanId()) : PluginConstants.EMPTY_STRING; PluginUtils.showMessage(rootModel, viewer, message); @@ -335,6 +338,11 @@ private void createViewer(Composite parent) { resultInfoCompositePanel = new Composite(bottomComposite, SWT.BORDER); resultInfoCompositePanel.setLayout(new GridLayout(1, false)); + titleLabel = new CLabel(resultInfoCompositePanel, SWT.NONE); + titleLabel.setFont(boldFont); + titleLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1)); + titleLabel.setBottomMargin(30); + ; Label summaryLabel = new Label(resultInfoCompositePanel, SWT.NONE); summaryLabel.setFont(boldFont); summaryLabel.setText("Summary:"); @@ -344,7 +352,6 @@ private void createViewer(Composite parent) { summaryText.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1)); summaryText.setText("Not Available."); - Label descriptionLabel = new Label(resultInfoCompositePanel, SWT.NONE); descriptionLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1)); descriptionLabel.setFont(boldFont); @@ -356,24 +363,24 @@ private void createViewer(Composite parent) { // Section 3 attackVectorCompositePanel = new Composite(bottomComposite, SWT.BORDER); - + GridData attackVectorCompositePanelGridData = new GridData(); attackVectorCompositePanelGridData.horizontalAlignment = GridData.END; attackVectorCompositePanelGridData.grabExcessHorizontalSpace = true; attackVectorCompositePanelGridData.grabExcessVerticalSpace = true; - + attackVectorCompositePanel.setLayoutData(attackVectorCompositePanelGridData); - + attackVectorCompositePanel.setLayout(new RowLayout(SWT.VERTICAL)); - Label attackVectorLabel = new Label(attackVectorCompositePanel, SWT.NONE); + attackVectorLabel = new Label(attackVectorCompositePanel, SWT.NONE); attackVectorLabel.setFont(boldFont); - attackVectorLabel.setText("Attack Vector:"); - + resultInfoCompositePanel.setVisible(false); attackVectorCompositePanel.setVisible(false); + } - + private void createProjectListComboBox(Composite parent) { List projectList = DataProvider.getInstance().getProjects(); currentProjectId = globalSettings.getProjectId(); @@ -408,11 +415,13 @@ public void selectionChanged(SelectionChangedEvent event) { Project selectedProject = ((Project) selection.getFirstElement()); // Avoid non-sense trigger changed when opening the combo + if(selectedProject.getID().equals(currentProjectId)) { CxLogger.info(PluginConstants.INFO_CHANGE_PROJECT_EVENT_NOT_TRIGGERED); + return; - } - + } + onProjectChangePluginLoading(selectedProject.getID()); Display.getDefault().asyncExec(new Runnable() { @@ -436,10 +445,10 @@ public void run() { } } }); - + PluginUtils.setTextForComboViewer(projectComboViewer, currentProjectName); } - + /** * Update state variables and make plugin fields loading when project changes * @@ -472,15 +481,15 @@ private void onProjectChangePluginLoading(String projectId) { * @return */ private String getProjectFromId(List projects, String projectId) { - if(projects.isEmpty()) { + if (projects.isEmpty()) { return NO_PROJECTS_AVAILABLE; } - + Optional project = projects.stream().filter(p -> p.getID().equals(projectId)).findFirst(); - + return project.isPresent() ? project.get().getName() : PROJECT_COMBO_VIEWER_TEXT; } - + private void createBranchComboBox(Composite parent) { currentBranch = globalSettings.getBranch(); branchComboViewer = new ComboViewer(parent, SWT.DROP_DOWN); @@ -491,8 +500,8 @@ private void createBranchComboBox(Composite parent) { public String getText(Object element) { return element.toString(); } - }); - + }); + branchComboViewer.addSelectionChangedListener(new ISelectionChangedListener() { @Override public void selectionChanged(SelectionChangedEvent event) { @@ -500,10 +509,11 @@ public void selectionChanged(SelectionChangedEvent event) { if (selection.size() > 0) { String selectedBranch = ((String) selection.getFirstElement()); - + // Avoid non-sense trigger changed when opening the combo if(selectedBranch.equals(currentBranch) && !scansCleanedByProject) { CxLogger.info(PluginConstants.INFO_CHANGE_BRANCH_EVENT_NOT_TRIGGERED); + return; } @@ -566,37 +576,38 @@ private void onBranchChangePluginLoading(String branch) { private void createScanIdComboBox(Composite parent){ currentScanId = globalSettings.getScanId(); - scanIdComboViewer = new ComboViewer(parent, SWT.DROP_DOWN | SWT.SIMPLE); + scanIdComboViewer = new ComboViewer(parent, SWT.DROP_DOWN | SWT.SIMPLE); scanIdComboViewer.setContentProvider(ArrayContentProvider.getInstance()); - + scanIdComboViewer.setLabelProvider(new LabelProvider() { - @Override - public String getText(Object element) { - if (element instanceof Scan) { - Scan scan = (Scan) element; - return formatScanLabel(scan); - } - return super.getText(element); - } + @Override + public String getText(Object element) { + if (element instanceof Scan) { + Scan scan = (Scan) element; + return formatScanLabel(scan); + } + return super.getText(element); + } }); - + scanIdComboViewer.addSelectionChangedListener(new ISelectionChangedListener() { @Override public void selectionChanged(SelectionChangedEvent event) { IStructuredSelection selection = (IStructuredSelection) event.getSelection(); if (selection.size() > 0) { - + Scan selectedScan = ((Scan) selection.getFirstElement()); // Avoid non-sense trigger changed when opening the combo if(selectedScan.getID().equals(currentScanId) || alreadyRunning) { CxLogger.info(String.format(PluginConstants.INFO_CHANGE_SCAN_EVENT_NOT_TRIGGERED, alreadyRunning, selectedScan.getID().equals(currentScanId))); + return; } onScanChangePluginLoading(selectedScan.getID()); - + Display.getDefault().asyncExec(new Runnable() { public void run() { alreadyRunning = true; @@ -606,7 +617,7 @@ public void run() { } } }); - + PluginUtils.setTextForComboViewer(scanIdComboViewer, PluginConstants.COMBOBOX_SCAND_ID_PLACEHOLDER); if(!currentBranch.isEmpty()) { @@ -618,7 +629,7 @@ public void run() { String currentScanName = getScanNameFromId(scanList, currentScanId); currentScanIdFormmated = currentScanName; PluginUtils.setTextForComboViewer(scanIdComboViewer, currentScanName); - + Display.getDefault().asyncExec(new Runnable() { public void run() { alreadyRunning = true; @@ -627,19 +638,17 @@ public void run() { }); } } - + GridData gridData = new GridData(); gridData.widthHint = 450; scanIdComboViewer.getCombo().setLayoutData(gridData); - scanIdComboViewer.getCombo().addListener(SWT.DefaultSelection, new Listener() { public void handleEvent(Event event) { - toolBarActions.getScanResultsAction().run(); + toolBarActions.getScanResultsAction().run(); } }); } - /** * Update state variables and make plugin fields loading when scan changes * @@ -675,10 +684,10 @@ private String getScanNameFromId(List scans, String scanId) { } Optional scan = scans.stream().filter(s -> s.getID().equals(scanId)).findFirst(); - + return scan.isPresent() ? formatScanLabel(scan.get()) : SCAN_COMBO_VIEWER_TEXT; } - + /** * Formats scan's displayed label * @@ -686,19 +695,22 @@ private String getScanNameFromId(List scans, String scanId) { * @return */ private static String formatScanLabel(Scan scan) { + String updatedAtDate = PluginUtils.convertStringTimeStamp(scan.getUpdatedAt()); return String.format(FORMATTED_SCAN_LABEL, scan.getID(), updatedAtDate); + } - + /** - * Reverse selection - Populate project combobox and select a project id based on the chosen scan id + * Reverse selection - Populate project combobox and select a project id based + * on the chosen scan id */ private void setSelectionForProjectComboViewer() { // TODO: this validation shouldn't be needed after authentication panel developments. When the authentication is not set the user won't be able to perform a reverse selection List validationError = DataProvider.getInstance().validateAuthentication(); - if(!validationError.isEmpty()) { + if (!validationError.isEmpty()) { updateResultsTree(validationError); return; } @@ -761,7 +773,8 @@ public void run() { } /** - * Reverse selection - Populate branch combobox and select a branch based on the chosen scan id + * Reverse selection - Populate branch combobox and select a branch based on the + * chosen scan id */ private void setSelectionForBranchComboViewer(String branchName, String projectId) { currentBranches = DataProvider.getInstance().getBranchesForProject(projectId); @@ -770,9 +783,9 @@ private void setSelectionForBranchComboViewer(String branchName, String projectI branchComboViewer.setInput(currentBranches); String currentBranchName = currentBranches.stream().filter(branch -> branchName.equals(branch)).findAny().orElse(null); - + PluginUtils.setTextForComboViewer(branchComboViewer, currentBranchName); - + currentBranch = currentBranchName; GlobalSettings.storeInPreferences(GlobalSettings.PARAM_BRANCH, currentBranch); } else { @@ -811,7 +824,7 @@ private void setSelectionForScanIdComboViewer(String scanId, String branch) { scanIdComboViewer.setSelection(new StructuredSelection(currentScan != null ? currentScan : PluginConstants.EMPTY_STRING)); } - + private void configureTreeItemSelectionChangeEvent(TreeViewer viewer) { viewer.addSelectionChangedListener(new ISelectionChangedListener() { @@ -832,6 +845,8 @@ public void selectionChanged(SelectionChangedEvent event) { if (selectedItem.getSeverity() != null) { summaryString = summaryString + selectedItem.getSeverity() + " " + VERTICAL_SEPERATOR + " "; + titleLabel.setImage(findSeverityImage(selectedItem)); + titleLabel.setText(selectedItem.getName()); } if (selectedItem.getResult() != null) { @@ -865,7 +880,7 @@ private void updateAttackVectorForSelectedTreeItem(DisplayModel selectedItem) { attackVectorCompositePanel.setVisible(true); if (selectedItem.getType().equalsIgnoreCase(PluginConstants.SCA_DEPENDENCY)) { - + attackVectorLabel.setText("Attack Vector: "); List packageDataList = selectedItem.getResult().getData().getPackageData(); if (packageDataList != null && !packageDataList.isEmpty()) { @@ -890,10 +905,25 @@ private void updateAttackVectorForSelectedTreeItem(DisplayModel selectedItem) { } if (selectedItem.getType().equalsIgnoreCase(PluginConstants.KICS_INFRASTRUCTURE)) { + attackVectorLabel.setText("Location: "); + + Link fileNameValueLinkText = new Link(attackVectorCompositePanel, SWT.NONE); + String text = "" + selectedItem.getResult().getData().getFileName() + "[" + + selectedItem.getResult().getData().getLine() + "]" + ""; + fileNameValueLinkText.setText(text); + fileNameValueLinkText.addListener(SWT.Selection, new Listener() { + public void handleEvent(Event event) { + openTheSelectedFile(selectedItem.getResult().getData().getFileName(), + selectedItem.getResult().getData().getLine(), null); + } + }); + attackVectorCompositePanel.layout(); } if (selectedItem.getType().equalsIgnoreCase(PluginConstants.SAST)) { + attackVectorLabel.setText("Attack Vector: "); + String queryName = selectedItem.getResult().getData().getQueryName(); String groupName = selectedItem.getResult().getData().getGroup(); @@ -930,7 +960,7 @@ private void clearAttackVectorSection(Composite attackVectorCompositePanel) { child.dispose(); } } - + private void openTheSelectedFile(String fileName, Integer lineNumber, String markerDescription) { Path filePath = new Path(fileName); List filesFound = findFileInWorkspace(filePath.lastSegment()); @@ -955,7 +985,8 @@ private void openTheSelectedFile(String fileName, Integer lineNumber, String mar private List findFileInWorkspace(final String fileName) { final List foundFiles = new ArrayList(); try { - // visiting only resources proxy because we obtain the resource only when matching name, thus the workspace traversal is much faster + // visiting only resources proxy because we obtain the resource only when + // matching name, thus the workspace traversal is much faster ResourcesPlugin.getWorkspace().getRoot().accept(new IResourceProxyVisitor() { @Override public boolean visit(IResourceProxy resourceProxy) throws CoreException { @@ -1010,25 +1041,25 @@ private Image findSeverityImage(DisplayModel model) { return null; } - + @Subscribe private void listener(PluginListenerDefinition definition) { switch (definition.getListenerType()) { - case FILTER_CHANGED: - case GET_RESULTS: - updateResultsTree(definition.getResutls()); - break; - case CLEAN_AND_REFRESH: - clearAndRefreshPlugin(); - break; - case REVERSE_CALL: - setSelectionForProjectComboViewer(); - break; - default: - break; + case FILTER_CHANGED: + case GET_RESULTS: + updateResultsTree(definition.getResutls()); + break; + case CLEAN_AND_REFRESH: + clearAndRefreshPlugin(); + break; + case REVERSE_CALL: + setSelectionForProjectComboViewer(); + break; + default: + break; } } - + /** * Update results tree * @@ -1044,14 +1075,14 @@ private void updateResultsTree(List results) { PluginUtils.enableComboViewer(projectComboViewer, true); PluginUtils.enableComboViewer(branchComboViewer, true); alreadyRunning = false; - + if(results.isEmpty()) { PluginUtils.showMessage(rootModel, viewer, PluginConstants.TREE_NO_RESULTS); } PluginUtils.updateFiltersEnabledAndCheckedState(toolBarActions.getFilterActions()); } - + /** * Clear all plugin fields and reload projects */ @@ -1100,7 +1131,7 @@ public void run() { } }); } - + /** * Clears Scans' combobox */ @@ -1109,7 +1140,7 @@ private void clearScanIdComboViewer() { scanIdComboViewer.refresh(); PluginUtils.setTextForComboViewer(scanIdComboViewer, PluginConstants.COMBOBOX_SCAND_ID_PLACEHOLDER); } - + /** * Clears Branches' combobox */ @@ -1118,7 +1149,7 @@ private void clearBranchComboViewer() { branchComboViewer.refresh(); PluginUtils.setTextForComboViewer(branchComboViewer, BRANCH_COMBO_VIEWER_TEXT); } - + /** * Reloads Projects' combobox */ @@ -1127,7 +1158,7 @@ private void resetProjectComboViewer() { projectComboViewer.refresh(); PluginUtils.setTextForComboViewer(projectComboViewer, PROJECT_COMBO_VIEWER_TEXT); } - + /** * Reset filters */ @@ -1137,7 +1168,7 @@ private void resetFiltersState() { FilterState.resetFilters(); PluginUtils.updateFiltersEnabledAndCheckedState(toolBarActions.getFilterActions()); } - + /** * Turn projects' combobox loading and disabled */ @@ -1145,7 +1176,7 @@ private void loadingProjects() { PluginUtils.enableComboViewer(projectComboViewer, false); PluginUtils.setTextForComboViewer(projectComboViewer, LOADING_PROJECTS); } - + /** * Reset values for projects and branches combo */ diff --git a/checkmarx-ast-eclipse-plugin/src/com/checkmarx/eclipse/views/filters/ActionFilters.java b/checkmarx-ast-eclipse-plugin/src/com/checkmarx/eclipse/views/filters/ActionFilters.java index f78ecee3..c3468079 100644 --- a/checkmarx-ast-eclipse-plugin/src/com/checkmarx/eclipse/views/filters/ActionFilters.java +++ b/checkmarx-ast-eclipse-plugin/src/com/checkmarx/eclipse/views/filters/ActionFilters.java @@ -16,16 +16,16 @@ public class ActionFilters { private static final String ACTION_FILTER_HIGH_TOOLTIP = "High"; - private static final String ACTION_FILTER_HIGH_ICON_PATH = "/icons/severity-high.png"; + private static final String ACTION_FILTER_HIGH_ICON_PATH = "/icons/high_untoggle.png"; private static final String ACTION_FILTER_MEDIUM_TOOLTIP = "Medium"; - private static final String ACTION_FILTER_MEDIUM_ICON_PATH = "/icons/severity-medium.png"; + private static final String ACTION_FILTER_MEDIUM_ICON_PATH = "/icons/medium_untoggle.png"; private static final String ACTION_FILTER_LOW_TOOLTIP = "Low"; - private static final String ACTION_FILTER_LOW_ICON_PATH = "/icons/severity-low.png"; + private static final String ACTION_FILTER_LOW_ICON_PATH = "/icons/low_untoggle.png"; private static final String ACTION_FILTER_INFO_TOOLTIP = "Info"; - private static final String ACTION_FILTER_INFO_ICON_PATH = "platform:/plugin/org.eclipse.ui/icons/full/obj16/info_tsk.png"; + private static final String ACTION_FILTER_INFO_ICON_PATH = "/icons/info_untoggle.png"; private EventBus pluginEventBus;