Author: rob.stryker(a)jboss.com
Date: 2011-12-02 00:44:36 -0500 (Fri, 02 Dec 2011)
New Revision: 36864
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/AbstractOpenBrowserServerAction.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/ShowInJMXConsoleActionProvider.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JMXProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/ShowInWebManagementActionProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/ShowInWelcomePageActionProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml
Log:
JBIDE-6828 - cleanup and enhancement
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JMXProvider.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JMXProvider.java 2011-12-02
03:50:02 UTC (rev 36863)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JMXProvider.java 2011-12-02
05:44:36 UTC (rev 36864)
@@ -38,6 +38,8 @@
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.ui.internal.view.servers.AbstractServerAction;
import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
+import org.jboss.ide.eclipse.as.core.util.ServerConverter;
+import org.jboss.ide.eclipse.as.core.util.ServerUtil;
import org.jboss.ide.eclipse.as.ui.JBossServerUISharedImages;
import org.jboss.tools.jmx.core.ExtensionManager;
import org.jboss.tools.jmx.core.IConnectionWrapper;
@@ -84,8 +86,11 @@
IContributionItem quick =
menu.find("org.eclipse.ui.navigate.showInQuickMenu"); //$NON-NLS-1$
if( quick != null && selection != null && selection.toArray().length
== 1 ) {
if( selection.getFirstElement() instanceof IServer ) {
- if( menu instanceof MenuManager ) {
- ((MenuManager)quick).add(showInJMXViewAction);
+ IServer server = (IServer)selection.getFirstElement();
+ if( ServerConverter.getJBossServer(server) != null &&
!ServerUtil.isJBoss7(server)) {
+ if( menu instanceof MenuManager ) {
+ ((MenuManager)quick).add(showInJMXViewAction);
+ }
}
}
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java 2011-12-02
03:50:02 UTC (rev 36863)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java 2011-12-02
05:44:36 UTC (rev 36864)
@@ -222,6 +222,7 @@
public static String ExploreUtils_Action_Text;
public static String ExploreUtils_Description;
+ public static String ShowInJMXConsole_Action_Text;
public static String ShowInWebManagementConsole_Action_Text;
public static String ShowInWelcomePage_Action_Text;
public static String ShowInAction_Error;
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties 2011-12-02
03:50:02 UTC (rev 36863)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties 2011-12-02
05:44:36 UTC (rev 36864)
@@ -197,6 +197,7 @@
ExploreUtils_Action_Text=Explore
ExploreUtils_Description=Explore deploy directory
+ShowInJMXConsole_Action_Text=JMX Management Console
ShowInWebManagementConsole_Action_Text=Web Management Console
ShowInWelcomePage_Action_Text=Welcome (Root) Page
ShowInAction_Error="Could not show \"{0}\""
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/AbstractOpenBrowserServerAction.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/AbstractOpenBrowserServerAction.java
(rev 0)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/AbstractOpenBrowserServerAction.java 2011-12-02
05:44:36 UTC (rev 36864)
@@ -0,0 +1,116 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.ui.views.server.extensions;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.navigator.CommonActionProvider;
+import org.eclipse.ui.navigator.ICommonActionExtensionSite;
+import org.eclipse.ui.navigator.ICommonViewerSite;
+import org.eclipse.ui.navigator.ICommonViewerWorkbenchSite;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.ui.internal.view.servers.AbstractServerAction;
+import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
+import org.jboss.ide.eclipse.as.core.util.ServerConverter;
+import org.jboss.ide.eclipse.as.ui.JBossServerUIPlugin;
+import org.jboss.ide.eclipse.as.ui.Messages;
+import org.jboss.tools.common.ui.BrowserUtil;
+
+public abstract class AbstractOpenBrowserServerAction extends CommonActionProvider {
+
+ private ICommonActionExtensionSite actionSite;
+ private OpenBrowserAction openURLAction;
+
+
+ protected abstract String getActionText();
+ protected abstract boolean accepts(IServer server);
+ protected abstract String getURL(IServer server) throws CoreException;
+
+ protected boolean shouldAddAction() {
+ ICommonViewerSite site = actionSite.getViewSite();
+ IStructuredSelection selection = null;
+ if (site instanceof ICommonViewerWorkbenchSite) {
+ ICommonViewerWorkbenchSite wsSite = (ICommonViewerWorkbenchSite) site;
+ selection = (IStructuredSelection) wsSite.getSelectionProvider()
+ .getSelection();
+ }
+ return shouldAddForSelection(selection);
+ }
+
+ protected boolean shouldAddForSelection(IStructuredSelection sel) {
+ IServer server = getSingleServer(sel);
+ if( server != null ) {
+ JBossServer jbs = ServerConverter.getJBossServer(server);
+ if( jbs != null )
+ return true;
+ }
+ return false;
+ }
+
+ protected IServer getSingleServer(IStructuredSelection sel) {
+ if( sel.size() == 1 && sel.getFirstElement() instanceof IServer )
+ return (IServer)sel.getFirstElement();
+ return null;
+ }
+
+ public void init(ICommonActionExtensionSite site) {
+ super.init(site);
+ this.actionSite = site;
+ createActions(site);
+ }
+
+ protected void createActions(ICommonActionExtensionSite site) {
+ ICommonViewerWorkbenchSite commonViewerWorkbenchSite =
+ CommonActionProviderUtils.getCommonViewerWorkbenchSite(site);
+ if (commonViewerWorkbenchSite != null) {
+ openURLAction =
+ new OpenBrowserAction(commonViewerWorkbenchSite.getSelectionProvider());
+ }
+ }
+
+ public void fillContextMenu(IMenuManager menu) {
+ if( shouldAddAction())
+ CommonActionProviderUtils.addToShowInQuickSubMenu(openURLAction, menu, actionSite);
+ }
+
+ private class OpenBrowserAction extends AbstractServerAction {
+ public OpenBrowserAction(ISelectionProvider sp) {
+ super(sp, getActionText());
+ }
+
+ public boolean accept(IServer server) {
+ return accepts(server);
+ }
+
+ public void perform(IServer server) {
+ try {
+ String consoleUrl = getURL(server);
+ BrowserUtil.checkedCreateInternalBrowser(
+ consoleUrl, server.getName(), JBossServerUIPlugin.PLUGIN_ID,
+ JBossServerUIPlugin.getDefault().getLog());
+ } catch (CoreException e) {
+ IStatus status = new Status(IStatus.ERROR, JBossServerUIPlugin.PLUGIN_ID,
e.getMessage(), e);
+ JBossServerUIPlugin.log(status);
+ ErrorDialog.openError(
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()
+ , Messages.ShowInAction_Error_Title
+ , NLS.bind(Messages.ShowInAction_Error, getActionText()), status);
+ }
+ }
+ }
+}
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/ShowInJMXConsoleActionProvider.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/ShowInJMXConsoleActionProvider.java
(rev 0)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/ShowInJMXConsoleActionProvider.java 2011-12-02
05:44:36 UTC (rev 36864)
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.ui.views.server.extensions;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.wst.server.core.IServer;
+import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
+import org.jboss.ide.eclipse.as.core.util.ServerConverter;
+import org.jboss.ide.eclipse.as.core.util.ServerUtil;
+import org.jboss.ide.eclipse.as.ui.Messages;
+
+import com.ibm.icu.text.MessageFormat;
+
+public class ShowInJMXConsoleActionProvider extends AbstractOpenBrowserServerAction {
+ private static final String CONSOLE_URL_PATTERN =
"http://{0}:{1}/jmx-console"; //$NON-NLS-1$
+ protected String getActionText() {
+ return Messages.ShowInJMXConsole_Action_Text;
+ }
+ protected boolean shouldAddForSelection(IStructuredSelection sel) {
+ IServer server = getSingleServer(sel);
+ if( server != null ) {
+ JBossServer jbs = ServerConverter.getJBossServer(server);
+ if( jbs != null ) {
+ // TODO fix this so anything BELOW 7 works
+ // need new util methods
+ return !ServerUtil.isJBoss7(server);
+ }
+ }
+ return false;
+ }
+
+ protected boolean accepts(IServer server) {
+ return server.getServerState() == IServer.STATE_STARTED;
+ }
+ protected String getURL(IServer server) throws CoreException {
+ JBossServer jbossServer = ServerUtil.checkedGetServerAdapter(server,
JBossServer.class);
+ String host = jbossServer.getHost();
+ int webPort = jbossServer.getJBossWebPort();
+ String consoleUrl = MessageFormat.format(CONSOLE_URL_PATTERN, host,
String.valueOf(webPort));
+ return consoleUrl;
+ }
+}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/ShowInWebManagementActionProvider.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/ShowInWebManagementActionProvider.java 2011-12-02
03:50:02 UTC (rev 36863)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/ShowInWebManagementActionProvider.java 2011-12-02
05:44:36 UTC (rev 36864)
@@ -1,82 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.ide.eclipse.as.ui.views.server.extensions;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.navigator.CommonActionProvider;
-import org.eclipse.ui.navigator.ICommonActionExtensionSite;
-import org.eclipse.ui.navigator.ICommonViewerWorkbenchSite;
import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.ui.internal.view.servers.AbstractServerAction;
import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
import org.jboss.ide.eclipse.as.core.util.ServerUtil;
-import org.jboss.ide.eclipse.as.ui.JBossServerUIPlugin;
-import org.jboss.ide.eclipse.as.ui.JBossServerUISharedImages;
import org.jboss.ide.eclipse.as.ui.Messages;
-import org.jboss.tools.common.ui.BrowserUtil;
import com.ibm.icu.text.MessageFormat;
-public class ShowInWebManagementActionProvider extends CommonActionProvider {
+public class ShowInWebManagementActionProvider extends AbstractOpenBrowserServerAction {
private static final String CONSOLE_URL_PATTERN = "http://{0}:{1}/console";
-
- private ICommonActionExtensionSite actionSite;
- private OpenWebManagementConsoleAction openWebManagementConsoleAction;
-
- public void init(ICommonActionExtensionSite site) {
- super.init(site);
- this.actionSite = site;
- createActions(site);
+ protected String getActionText() {
+ return Messages.ShowInWebManagementConsole_Action_Text;
}
-
- protected void createActions(ICommonActionExtensionSite site) {
- ICommonViewerWorkbenchSite commonViewerWorkbenchSite =
- CommonActionProviderUtils.getCommonViewerWorkbenchSite(site);
- if (commonViewerWorkbenchSite != null) {
- openWebManagementConsoleAction =
- new
OpenWebManagementConsoleAction(commonViewerWorkbenchSite.getSelectionProvider());
- }
+ protected boolean accepts(IServer server) {
+ return (ServerUtil.isJBoss7(server)
+ && server.getServerState() == IServer.STATE_STARTED);
}
-
- public void fillContextMenu(IMenuManager menu) {
- CommonActionProviderUtils.addToShowInQuickSubMenu(openWebManagementConsoleAction, menu,
actionSite);
+ protected String getURL(IServer server) throws CoreException {
+ JBossServer jbossServer = ServerUtil.checkedGetServerAdapter(server,
JBossServer.class);
+ String host = jbossServer.getHost();
+ int webPort = jbossServer.getJBossWebPort();
+ String consoleUrl = MessageFormat.format(CONSOLE_URL_PATTERN, host,
String.valueOf(webPort));
+ return consoleUrl;
}
- private static class OpenWebManagementConsoleAction extends AbstractServerAction {
- public OpenWebManagementConsoleAction(ISelectionProvider sp) {
- super(sp, Messages.ShowInWebManagementConsole_Action_Text);
- setImageDescriptor(JBossServerUISharedImages.getImageDescriptor(JBossServerUISharedImages.CONSOLE));
- }
-
- public boolean accept(IServer server) {
- return (ServerUtil.isJBoss7(server)
- && server.getServerState() == IServer.STATE_STARTED);
- }
-
- public void perform(IServer server) {
- JBossServer jbossServer;
- try {
- jbossServer = ServerUtil.checkedGetServerAdapter(server, JBossServer.class);
- String host = jbossServer.getHost();
- int webPort = jbossServer.getJBossWebPort();
- String consoleUrl = MessageFormat.format(CONSOLE_URL_PATTERN, host,
String.valueOf(webPort));
- BrowserUtil.checkedCreateInternalBrowser(
- consoleUrl, server.getName(), JBossServerUIPlugin.PLUGIN_ID,
JBossServerUIPlugin.getDefault()
- .getLog());
- } catch (CoreException e) {
- IStatus status = new Status(IStatus.ERROR, JBossServerUIPlugin.PLUGIN_ID,
e.getMessage(), e);
- JBossServerUIPlugin.log(status);
- ErrorDialog.openError(
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()
- , Messages.ShowInAction_Error_Title
- , NLS.bind(Messages.ShowInAction_Error,
Messages.ShowInWebManagementConsole_Action_Text), status);
- }
- }
- }
+// setImageDescriptor(JBossServerUISharedImages.getImageDescriptor(JBossServerUISharedImages.CONSOLE));
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/ShowInWelcomePageActionProvider.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/ShowInWelcomePageActionProvider.java 2011-12-02
03:50:02 UTC (rev 36863)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/ShowInWelcomePageActionProvider.java 2011-12-02
05:44:36 UTC (rev 36864)
@@ -1,79 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.ide.eclipse.as.ui.views.server.extensions;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.navigator.CommonActionProvider;
-import org.eclipse.ui.navigator.ICommonActionExtensionSite;
-import org.eclipse.ui.navigator.ICommonViewerWorkbenchSite;
import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.ui.internal.view.servers.AbstractServerAction;
import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
import org.jboss.ide.eclipse.as.core.util.ServerUtil;
-import org.jboss.ide.eclipse.as.ui.JBossServerUIPlugin;
import org.jboss.ide.eclipse.as.ui.Messages;
-import org.jboss.tools.common.ui.BrowserUtil;
import com.ibm.icu.text.MessageFormat;
-public class ShowInWelcomePageActionProvider extends CommonActionProvider {
+public class ShowInWelcomePageActionProvider extends AbstractOpenBrowserServerAction {
- private static final String WELCOME_PAGE_URL_PATTERN = "http://{0}:{1}/";
//$NON-NLS-1$
-
- private ICommonActionExtensionSite actionSite;
- private OpenWelcomePageAction openWelcomePageAction;
-
- public void init(ICommonActionExtensionSite site) {
- super.init(site);
- this.actionSite = site;
- createActions(site);
+ private static String WELCOME_PAGE_URL_PATTERN = "http://{0}:{1}/";
//$NON-NLS-1$
+ protected String getActionText() {
+ return Messages.ShowInWelcomePage_Action_Text;
}
-
- protected void createActions(ICommonActionExtensionSite site) {
- ICommonViewerWorkbenchSite commonViewerWorkbenchSite =
- CommonActionProviderUtils.getCommonViewerWorkbenchSite(site);
- if (commonViewerWorkbenchSite != null) {
- openWelcomePageAction =
- new OpenWelcomePageAction(commonViewerWorkbenchSite.getSelectionProvider());
- }
+
+ protected boolean accepts(IServer server) {
+ return server.getServerState() == IServer.STATE_STARTED;
}
-
- public void fillContextMenu(IMenuManager menu) {
- CommonActionProviderUtils.addToShowInQuickSubMenu(openWelcomePageAction, menu,
actionSite);
+
+ protected String getURL(IServer server) throws CoreException {
+ JBossServer jbossServer = ServerUtil.checkedGetServerAdapter(server,
JBossServer.class);
+ String host = jbossServer.getHost();
+ int webPort = jbossServer.getJBossWebPort();
+ String consoleUrl = MessageFormat.format(WELCOME_PAGE_URL_PATTERN, host,
String.valueOf(webPort));
+ return consoleUrl;
}
- private static class OpenWelcomePageAction extends AbstractServerAction {
- public OpenWelcomePageAction(ISelectionProvider sp) {
- super(sp, Messages.ShowInWelcomePage_Action_Text);
- }
-
- public boolean accept(IServer server) {
- return (ServerUtil.isJBoss7(server)
- && server.getServerState() == IServer.STATE_STARTED);
- }
-
- public void perform(IServer server) {
- try {
- JBossServer jbossServer = ServerUtil.checkedGetServerAdapter(server,
JBossServer.class);
- String host = jbossServer.getHost();
- int webPort = jbossServer.getJBossWebPort();
- String consoleUrl = MessageFormat.format(WELCOME_PAGE_URL_PATTERN, host,
String.valueOf(webPort));
- BrowserUtil.checkedCreateInternalBrowser(
- consoleUrl, server.getName(), JBossServerUIPlugin.PLUGIN_ID,
JBossServerUIPlugin.getDefault()
- .getLog());
- } catch (CoreException e) {
- IStatus status = new Status(IStatus.ERROR, JBossServerUIPlugin.PLUGIN_ID,
e.getMessage(), e);
- JBossServerUIPlugin.log(status);
- ErrorDialog.openError(
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()
- , Messages.ShowInAction_Error_Title
- , NLS.bind(Messages.ShowInAction_Error, Messages.ShowInWelcomePage_Action_Text),
status);
- }
- }
- }
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml 2011-12-02 03:50:02 UTC (rev
36863)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml 2011-12-02 05:44:36 UTC (rev
36864)
@@ -366,8 +366,8 @@
</enablement>
</actionProvider>
<actionProvider
-
class="org.jboss.ide.eclipse.as.ui.views.server.extensions.ServerLogActionProvider"
- id="org.jboss.ide.eclipse.as.ui.extensions.serverLog">
+
class="org.jboss.ide.eclipse.as.ui.views.server.extensions.ShowInJMXConsoleActionProvider"
+ id="org.jboss.ide.eclipse.as.ui.extensions.jmxConsole.showIn">
<enablement>
<instanceof
value="org.eclipse.wst.server.core.IServer">
@@ -392,6 +392,15 @@
</instanceof>
</enablement>
</actionProvider>
+ <actionProvider
+
class="org.jboss.ide.eclipse.as.ui.views.server.extensions.ServerLogActionProvider"
+ id="org.jboss.ide.eclipse.as.ui.extensions.serverLog">
+ <enablement>
+ <instanceof
+ value="org.eclipse.wst.server.core.IServer">
+ </instanceof>
+ </enablement>
+ </actionProvider>
</extension>
@@ -416,6 +425,8 @@
<actionExtension
pattern="org.jboss.tools.as.wst.server.ui.ServersView.ExploreActionProvider"/>
<actionExtension
+
pattern="org.jboss.ide.eclipse.as.ui.extensions.jmxConsole.showIn"/>
+ <actionExtension
pattern="org.jboss.ide.eclipse.as.ui.extensions.managementConsole"/>
<actionExtension
pattern="org.jboss.ide.eclipse.as.ui.extensions.welcomePage"/>