From d26d0de1515e0ce30950e4039557ea700e364e23 Mon Sep 17 00:00:00 2001 From: Thorben Groos Date: Tue, 19 Jun 2018 10:07:25 +0200 Subject: [PATCH] Added an entry for the keystore in the algorithm dropdown menu. --- org.jcryptool.core/META-INF/MANIFEST.MF | 3 ++- .../core/ApplicationActionBarAdvisor.java | 27 ++++++++++++++++++- .../src/org/jcryptool/core/Messages.java | 2 ++ .../org/jcryptool/core/messages.properties | 1 + .../org/jcryptool/core/messages_de.properties | 1 + 5 files changed, 32 insertions(+), 2 deletions(-) diff --git a/org.jcryptool.core/META-INF/MANIFEST.MF b/org.jcryptool.core/META-INF/MANIFEST.MF index 273a6a1768..7d5960c8f6 100644 --- a/org.jcryptool.core/META-INF/MANIFEST.MF +++ b/org.jcryptool.core/META-INF/MANIFEST.MF @@ -21,5 +21,6 @@ Export-Package: org.jcryptool.core, Import-Package: org.jcryptool.core.logging.utils, org.jcryptool.core.operations, org.jcryptool.core.util.constants, - org.jcryptool.core.util.directories + org.jcryptool.core.util.directories, + org.jcryptool.crypto.keystore.commands Automatic-Module-Name: org.jcryptool.core diff --git a/org.jcryptool.core/src/org/jcryptool/core/ApplicationActionBarAdvisor.java b/org.jcryptool.core/src/org/jcryptool/core/ApplicationActionBarAdvisor.java index 4d1d46fb3c..b8bd514971 100644 --- a/org.jcryptool.core/src/org/jcryptool/core/ApplicationActionBarAdvisor.java +++ b/org.jcryptool.core/src/org/jcryptool/core/ApplicationActionBarAdvisor.java @@ -17,11 +17,15 @@ import org.eclipse.core.commands.Command; import org.eclipse.core.commands.CommandManager; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; import org.eclipse.core.commands.IHandler; import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.IExtensionPoint; import org.eclipse.core.runtime.Platform; +import org.eclipse.jface.action.Action; import org.eclipse.jface.action.GroupMarker; +import org.eclipse.jface.action.IAction; import org.eclipse.jface.action.IContributionItem; import org.eclipse.jface.action.ICoolBarManager; import org.eclipse.jface.action.IMenuManager; @@ -44,8 +48,10 @@ import org.eclipse.ui.menus.CommandContributionItemParameter; import org.eclipse.ui.services.IServiceLocator; import org.jcryptool.core.actions.ShowPluginViewHandler; +import org.jcryptool.core.logging.utils.LogUtil; import org.jcryptool.core.operations.CommandInfo; import org.jcryptool.core.operations.OperationsPlugin; +import org.jcryptool.crypto.keystore.commands.OpenKeystoreHandler; /** *

@@ -393,7 +399,26 @@ public int compare(String id1, String id2) { } menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS)); - + + //This is the keystore entry in the algorithm drop down menu + IAction openKeystoreAction = new Action() { + @Override + public void run() { + try { + new OpenKeystoreHandler().execute(new ExecutionEvent()); + } catch (ExecutionException e) { + LogUtil.logError(e.getMessage()); + } + super.run(); + } + + @Override + public String getText() { + return Messages.ApplicationActionBarAdvisor_Keystore; + } + + }; + menu.add(openKeystoreAction); return menu; } diff --git a/org.jcryptool.core/src/org/jcryptool/core/Messages.java b/org.jcryptool.core/src/org/jcryptool/core/Messages.java index 6ce67b0b49..173137e16c 100644 --- a/org.jcryptool.core/src/org/jcryptool/core/Messages.java +++ b/org.jcryptool.core/src/org/jcryptool/core/Messages.java @@ -28,6 +28,8 @@ public class Messages extends NLS { public static String ApplicationActionBarAdvisor_5; + public static String ApplicationActionBarAdvisor_Keystore; + public static String ApplicationWorkbenchAdvisor_4; public static String applicationActionBarAdvisor_Menu_Algorithms; diff --git a/org.jcryptool.core/src/org/jcryptool/core/messages.properties b/org.jcryptool.core/src/org/jcryptool/core/messages.properties index 172f4bd5ff..6535d43609 100644 --- a/org.jcryptool.core/src/org/jcryptool/core/messages.properties +++ b/org.jcryptool.core/src/org/jcryptool/core/messages.properties @@ -2,6 +2,7 @@ ApplicationActionBarAdvisor_0=Analysis ApplicationActionBarAdvisor_1=Open with ApplicationActionBarAdvisor_2=Visuals ApplicationActionBarAdvisor_5=Games +ApplicationActionBarAdvisor_Keystore=Keystore ApplicationWorkbenchAdvisor_4=unsaved applicationActionBarAdvisor_Menu_Algorithms=Algorithms applicationActionBarAdvisor_Menu_Algorithms_Asymmetric=Asymmetric diff --git a/org.jcryptool.core/src/org/jcryptool/core/messages_de.properties b/org.jcryptool.core/src/org/jcryptool/core/messages_de.properties index 1a283d2682..f22ae307b7 100644 --- a/org.jcryptool.core/src/org/jcryptool/core/messages_de.properties +++ b/org.jcryptool.core/src/org/jcryptool/core/messages_de.properties @@ -2,6 +2,7 @@ ApplicationActionBarAdvisor_0=Analysen ApplicationActionBarAdvisor_1=\u00d6ffnen mit ApplicationActionBarAdvisor_2=Visualisierungen ApplicationActionBarAdvisor_5=Spiele +ApplicationActionBarAdvisor_Keystore=Schl\u00fcsselspeicher ApplicationWorkbenchAdvisor_4=unbenannt applicationActionBarAdvisor_Menu_Algorithms=Algorithmen applicationActionBarAdvisor_Menu_Algorithms_Asymmetric=Asymmetrisch