From af7f1056b0462c5e048829ba5852e3026725fb3d Mon Sep 17 00:00:00 2001 From: sseifert Date: Wed, 16 Mar 2016 22:05:25 +0100 Subject: [PATCH] add "open folder" action for instances --- AEMManager/AemActions.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/AEMManager/AemActions.cs b/AEMManager/AemActions.cs index 637a40c..2e6207a 100644 --- a/AEMManager/AemActions.cs +++ b/AEMManager/AemActions.cs @@ -53,6 +53,11 @@ public static void AddOpenMenuItems(Menu.MenuItemCollection pParent, AemInstance item.Click += new EventHandler(OpenFelixConsole); menuItems.Add(item); + item = new MenuItem(); + item.Text = "Open Folder"; + item.Click += new EventHandler(OpenFolder); + menuItems.Add(item); + if (pInstance.AemInstanceType == AemInstanceType.AEM54) { item = new MenuItem(); item.Text = "Open Servlet Engine Admin"; @@ -119,6 +124,20 @@ private static void OpenFelixConsole(object sender, EventArgs e) { OpenUrl(instance.UrlWithContextPath + "/system/console", instance); } + private static void OpenFolder(object sender, EventArgs e) { + AemInstance instance = Program.GetActionInstance(sender); + if (instance == null) { + return; + } + + string folder = instance.PathWithoutFilename; + if (!Directory.Exists(folder)) { + return; + } + mLog.Info("Open Folder: " + folder); + System.Diagnostics.Process.Start(folder); + } + private static void OpenServletEngineAdmin(object sender, EventArgs e) { AemInstance instance = Program.GetActionInstance(sender); if (instance == null) {