You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by db...@apache.org on 2022/03/07 16:06:04 UTC

[netbeans] branch master updated: Adding Open Service Console action (#3674)

This is an automated email from the ASF dual-hosted git repository.

dbalek pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
     new 013691b  Adding Open Service Console action (#3674)
013691b is described below

commit 013691b04f0258ff1213c7c826df2389b84e84b6
Author: jhorvath <ja...@horvath.cz>
AuthorDate: Mon Mar 7 17:05:41 2022 +0100

    Adding Open Service Console action (#3674)
---
 .../oracle/{ => actions}/OpenServiceConsoleAction.java | 18 +++++++++---------
 .../org/netbeans/modules/nbcode/integration/layer.xml  |  1 +
 java/java.lsp.server/vscode/package.json               | 18 +++++++++++++++---
 3 files changed, 25 insertions(+), 12 deletions(-)

diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/OpenServiceConsoleAction.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/OpenServiceConsoleAction.java
similarity index 80%
rename from enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/OpenServiceConsoleAction.java
rename to enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/OpenServiceConsoleAction.java
index 2681960..8307a90 100644
--- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/OpenServiceConsoleAction.java
+++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/OpenServiceConsoleAction.java
@@ -16,19 +16,18 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.netbeans.modules.cloud.oracle;
+package org.netbeans.modules.cloud.oracle.actions;
 
 import org.netbeans.modules.cloud.oracle.items.DatabaseItem;
-import java.awt.Desktop;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
-import java.io.IOException;
-import java.net.URI;
-import java.net.URISyntaxException;
+import java.net.MalformedURLException;
+import java.net.URL;
 import org.openide.awt.ActionID;
 import org.openide.awt.ActionReference;
 import org.openide.awt.ActionReferences;
 import org.openide.awt.ActionRegistration;
+import org.openide.awt.HtmlBrowser.URLDisplayer;
 import org.openide.util.Exceptions;
 import org.openide.util.NbBundle.Messages;
 
@@ -42,7 +41,8 @@ import org.openide.util.NbBundle.Messages;
 @ActionReferences(value = {
     @ActionReference(path = "Cloud/Oracle/Databases/Actions", position = 260)
 })
-@Messages("CTL_OpenServiceConsoleAction=Open Service Console")
+@Messages({"CTL_OpenServiceConsoleAction=Open Service Console",
+        "MSG_ServiceConsole=Service Console URL: {0}"})
 public final class OpenServiceConsoleAction implements ActionListener {
 
     private final DatabaseItem context;
@@ -54,9 +54,9 @@ public final class OpenServiceConsoleAction implements ActionListener {
     @Override
     public void actionPerformed(ActionEvent ev) {
         try {
-            Desktop desk = Desktop.getDesktop();
-            desk.browse(new URI(context.getServiceUrl()));
-        } catch (URISyntaxException | IOException ex) {
+            URLDisplayer.getDefault().showURLExternal(
+                    new URL(context.getServiceUrl()));
+        } catch (MalformedURLException ex) {
             Exceptions.printStackTrace(ex);
         }
     }
diff --git a/java/java.lsp.server/nbcode/integration/src/org/netbeans/modules/nbcode/integration/layer.xml b/java/java.lsp.server/nbcode/integration/src/org/netbeans/modules/nbcode/integration/layer.xml
index 81f18f3..eecb444 100644
--- a/java/java.lsp.server/nbcode/integration/src/org/netbeans/modules/nbcode/integration/layer.xml
+++ b/java/java.lsp.server/nbcode/integration/src/org/netbeans/modules/nbcode/integration/layer.xml
@@ -37,6 +37,7 @@
                 <attr name="instanceCreate" methodvalue="org.netbeans.modules.java.lsp.server.explorer.NodeActionsProvider.forFile"/>
                 <attr name="action:org.netbeans.modules.cloud.oracle.actions.DownloadWalletAction" stringvalue="Tools"/>
                 <attr name="action:org.netbeans.modules.cloud.oracle.actions.CreateAutonomousDBAction" stringvalue="Tools"/>
+                <attr name="action:org.netbeans.modules.cloud.oracle.actions.OpenServiceConsoleAction" stringvalue="Tools"/>
             </file>
         </folder>
     </folder>
diff --git a/java/java.lsp.server/vscode/package.json b/java/java.lsp.server/vscode/package.json
index a972753..a3ac6bd 100644
--- a/java/java.lsp.server/vscode/package.json
+++ b/java/java.lsp.server/vscode/package.json
@@ -505,14 +505,18 @@
 				"title": "Run All Tests",
 				"category": "Test"
 			},
-                        {
+      {
 				"command": "nbls:Tools:org.netbeans.modules.cloud.oracle.actions.DownloadWalletAction",
 				"title": "Add DB Connection"
 			},
-                        {
+      {
 				"command": "nbls:Tools:org.netbeans.modules.cloud.oracle.actions.CreateAutonomousDBAction",
 				"title": "Create Autonomous Database"
-                        },
+			},
+      {
+				"command": "nbls:Tools:org.netbeans.modules.cloud.oracle.actions.OpenServiceConsoleAction",
+				"title": "Open Service Console"
+      },
 			{
 				"command": "java.db.set.env",
 				"title": "Set Database Environment Variables",
@@ -602,6 +606,10 @@
 					"when": "false"
 				},
 				{
+					"command": "nbls:Tools:org.netbeans.modules.cloud.oracle.actions.OpenServiceConsoleAction",
+					"when": "false"
+				},
+				{
 					"command": "java.workspace.configureRunSettings",
 					"when": "false"
 				}
@@ -686,6 +694,10 @@
 					"when": "viewItem =~ /class:oracle.items.DatabaseItem/"
 				},
 				{
+					"command": "nbls:Tools:org.netbeans.modules.cloud.oracle.actions.OpenServiceConsoleAction",
+					"when": "viewItem =~ /class:oracle.items.DatabaseItem/"
+				},
+				{
 					"command": "nbls:Tools:org.netbeans.modules.cloud.oracle.actions.CreateAutonomousDBAction",
 					"when": "viewItem =~ /class:oracle.items.CompartmentItem/"
 				},

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists