Author: rob.stryker(a)jboss.com
Date: 2011-08-05 03:38:39 -0400 (Fri, 05 Aug 2011)
New Revision: 33622
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/xpl/ExploreActionProvider.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/ModuleActionProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/xpl/ServerActionProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml
Log:
JBIDE-9132 - explore command cleanup
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/ModuleActionProvider.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/ModuleActionProvider.java 2011-08-05
05:11:27 UTC (rev 33621)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/ModuleActionProvider.java 2011-08-05
07:38:39 UTC (rev 33622)
@@ -1,11 +1,9 @@
package org.jboss.ide.eclipse.as.ui.views.server.extensions;
-import java.io.File;
import java.util.ArrayList;
import java.util.Iterator;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IContributionItem;
@@ -26,18 +24,14 @@
import org.eclipse.wst.server.core.ServerUtil;
import org.eclipse.wst.server.core.internal.PublishServerJob;
import org.eclipse.wst.server.core.internal.Server;
+import org.eclipse.wst.server.ui.internal.cnf.ServerActionProvider;
import org.eclipse.wst.server.ui.internal.view.servers.ModuleServer;
-import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
import org.jboss.ide.eclipse.as.core.util.ModuleUtil;
-import org.jboss.ide.eclipse.as.core.util.ServerConverter;
import org.jboss.ide.eclipse.as.ui.JBossServerUISharedImages;
import org.jboss.ide.eclipse.as.ui.Messages;
-import org.jboss.ide.eclipse.as.ui.actions.ExploreUtils;
-import org.jboss.tools.as.wst.server.ui.xpl.ServerActionProvider;
public class ModuleActionProvider extends CommonActionProvider {
private Action deleteModuleAction, fullPublishModuleAction,
incrementalPublishModuleAction;
- private Action exploreAction;
private ModuleServer[] selection;
private ICommonActionExtensionSite actionSite;
@@ -78,17 +72,6 @@
deleteModuleAction.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_DELETE);
menu.insertBefore(ServerActionProvider.CONTROL_MODULE_SECTION_END_SEPARATOR,
deleteModuleAction);
}
- if (selection.size() == 1) {
- ModuleServer moduleServer = (ModuleServer) selection.getFirstElement();
- IServer server = moduleServer.getServer();
- if (ExploreUtils.canExplore(server)) {
- if (getDeployPath() != null) {
- menu.insertBefore(ServerActionProvider.CONTROL_MODULE_SECTION_END_SEPARATOR,
exploreAction);
- boolean exists = getDeployPath().toFile().exists();
- exploreAction.setEnabled(exists);
- }
- }
- }
}
}
@@ -133,20 +116,6 @@
incrementalPublishModuleAction.setDescription(Messages.PublishModuleDescription);
incrementalPublishModuleAction.setImageDescriptor(JBossServerUISharedImages.getImageDescriptor(JBossServerUISharedImages.PUBLISH_IMAGE));
- exploreAction = new Action() {
- public void run() {
- IPath path = getDeployPath();
- if (path != null) {
- File file = path.toFile();
- if (file.exists()) {
- ExploreUtils.explore(file.getAbsolutePath());
- }
- }
- }
- };
- exploreAction.setText(ExploreUtils.EXPLORE);
- exploreAction.setDescription(ExploreUtils.EXPLORE_DESCRIPTION);
- exploreAction.setImageDescriptor(JBossServerUISharedImages.getImageDescriptor(JBossServerUISharedImages.EXPLORE_IMAGE));
}
protected void actionPublish(int type) {
@@ -192,13 +161,4 @@
t.start();
}
}
-
- private IPath getDeployPath() {
- ModuleServer ms = selection[0];
- IModule[] module = ms.module;
- IDeployableServer deployableServer = ServerConverter.getDeployableServer(ms.server);
- if( deployableServer != null )
- return ExploreUtils.getDeployPath(deployableServer, module);
- return null;
- }
}
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/xpl/ExploreActionProvider.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/xpl/ExploreActionProvider.java
(rev 0)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/xpl/ExploreActionProvider.java 2011-08-05
07:38:39 UTC (rev 33622)
@@ -0,0 +1,145 @@
+/*******************************************************************************
+ * Copyright (c) 2010 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.tools.as.wst.server.ui.xpl;
+
+import java.io.File;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.navigator.CommonActionProvider;
+import org.eclipse.ui.navigator.CommonViewer;
+import org.eclipse.ui.navigator.ICommonActionExtensionSite;
+import org.eclipse.ui.navigator.ICommonViewerSite;
+import org.eclipse.ui.navigator.ICommonViewerWorkbenchSite;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.ui.internal.cnf.ServerActionProvider;
+import org.eclipse.wst.server.ui.internal.view.servers.ModuleServer;
+import org.jboss.ide.eclipse.as.core.publishers.LocalPublishMethod;
+import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
+import org.jboss.ide.eclipse.as.core.util.ServerConverter;
+import org.jboss.ide.eclipse.as.ui.JBossServerUISharedImages;
+import org.jboss.ide.eclipse.as.ui.actions.ExploreUtils;
+public class ExploreActionProvider extends CommonActionProvider {
+ private ICommonActionExtensionSite actionSite;
+ private CommonViewer cv;
+ public ExploreActionProvider() {
+ super();
+ }
+
+ private Action exploreAction;
+
+ public void init(ICommonActionExtensionSite aSite) {
+ super.init(aSite);
+ this.actionSite = aSite;
+ ICommonViewerSite site = aSite.getViewSite();
+ if( site instanceof ICommonViewerWorkbenchSite ) {
+ StructuredViewer v = aSite.getStructuredViewer();
+ if( v instanceof CommonViewer ) {
+ cv = (CommonViewer)v;
+ ICommonViewerWorkbenchSite wsSite = (ICommonViewerWorkbenchSite)site;
+ createActions(cv, wsSite.getSelectionProvider());
+ }
+ }
+ }
+ public void createActions(CommonViewer tableViewer, ISelectionProvider provider) {
+ Shell shell = tableViewer.getTree().getShell();
+ exploreAction = new Action() {
+ public void run() {
+ runExplore();
+ }
+ };
+ exploreAction.setText(ExploreUtils.EXPLORE);
+ exploreAction.setDescription(ExploreUtils.EXPLORE_DESCRIPTION);
+ exploreAction.setImageDescriptor(JBossServerUISharedImages.getImageDescriptor(JBossServerUISharedImages.EXPLORE_IMAGE));
+ }
+
+ private void runExplore() {
+ if( getModuleServer() != null )
+ runExploreModuleServer();
+ else
+ runExploreServer();
+ }
+
+ public void fillContextMenu(IMenuManager menu) {
+ boolean enabled = false;
+ if( getModuleServer() != null )
+ menu.insertBefore(ServerActionProvider.CONTROL_MODULE_SECTION_END_SEPARATOR,
exploreAction);
+ else
+ menu.insertBefore(ServerActionProvider.SERVER_ETC_SECTION_END_SEPARATOR,
exploreAction);
+ if( getServer() != null ) {
+ String mode = getServer().getAttribute(IDeployableServer.SERVER_MODE,
LocalPublishMethod.LOCAL_PUBLISH_METHOD);
+ if( LocalPublishMethod.LOCAL_PUBLISH_METHOD.equals(mode)) {
+ enabled = true;
+ }
+ }
+ exploreAction.setEnabled(enabled);
+ }
+
+ public void runExploreServer() {
+ String deployDirectory = ExploreUtils.getDeployDirectory(getServer());
+ if (deployDirectory != null && deployDirectory.length() > 0) {
+ ExploreUtils.explore(deployDirectory);
+ }
+ }
+
+ public void runExploreModuleServer() {
+ IPath path = getModuleDeployPath();
+ if (path != null) {
+ File file = path.toFile();
+ if (file.exists()) {
+ ExploreUtils.explore(file.getAbsolutePath());
+ }
+ }
+ }
+ private IPath getModuleDeployPath() {
+ ModuleServer ms = getModuleServer();
+ IModule[] module = ms.module;
+ IDeployableServer deployableServer = ServerConverter.getDeployableServer(ms.server);
+ if( deployableServer != null )
+ return ExploreUtils.getDeployPath(deployableServer, module);
+ return null;
+ }
+
+ public IServer getServer() {
+ Object o = getSelection();
+ if (o instanceof IServer)
+ return ((IServer)o);
+ if( o instanceof ModuleServer)
+ return ((ModuleServer) o).server;
+ return null;
+ }
+
+ public ModuleServer getModuleServer() {
+ Object o = getSelection();
+ if( o instanceof ModuleServer)
+ return ((ModuleServer) o);
+ return null;
+ }
+
+ protected Object getSelection() {
+ ICommonViewerSite site = actionSite.getViewSite();
+ IStructuredSelection selection = null;
+ if (site instanceof ICommonViewerWorkbenchSite) {
+ ICommonViewerWorkbenchSite wsSite = (ICommonViewerWorkbenchSite) site;
+ selection = (IStructuredSelection) wsSite.getSelectionProvider()
+ .getSelection();
+ Object first = selection.getFirstElement();
+ return first;
+ }
+ return null;
+ }
+}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/xpl/ServerActionProvider.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/xpl/ServerActionProvider.java 2011-08-05
05:11:27 UTC (rev 33621)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/xpl/ServerActionProvider.java 2011-08-05
07:38:39 UTC (rev 33622)
@@ -11,321 +11,10 @@
*******************************************************************************/
package org.jboss.tools.as.wst.server.ui.xpl;
-import java.util.Iterator;
-
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IContributionManager;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.bindings.TriggerSequence;
-import org.eclipse.jface.viewers.IOpenListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.OpenEvent;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.swt.dnd.Clipboard;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.ActionFactory;
-import org.eclipse.ui.keys.IBindingService;
import org.eclipse.ui.navigator.CommonActionProvider;
-import org.eclipse.ui.navigator.CommonViewer;
-import org.eclipse.ui.navigator.ICommonActionExtensionSite;
-import org.eclipse.ui.navigator.ICommonViewerSite;
-import org.eclipse.ui.navigator.ICommonViewerWorkbenchSite;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.ServerPort;
-import org.eclipse.wst.server.core.model.ServerDelegate;
-import org.eclipse.wst.server.ui.internal.Messages;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-import org.eclipse.wst.server.ui.internal.actions.NewServerWizardAction;
-import org.eclipse.wst.server.ui.internal.view.servers.CopyAction;
-import org.eclipse.wst.server.ui.internal.view.servers.DeleteAction;
-import org.eclipse.wst.server.ui.internal.view.servers.ModuleServer;
-import org.eclipse.wst.server.ui.internal.view.servers.ModuleSloshAction;
-import org.eclipse.wst.server.ui.internal.view.servers.MonitorServerPortAction;
-import org.eclipse.wst.server.ui.internal.view.servers.OpenAction;
-import org.eclipse.wst.server.ui.internal.view.servers.PasteAction;
-import org.eclipse.wst.server.ui.internal.view.servers.PropertiesAction;
-import org.eclipse.wst.server.ui.internal.view.servers.PublishAction;
-import org.eclipse.wst.server.ui.internal.view.servers.RemoveModuleAction;
-import org.eclipse.wst.server.ui.internal.view.servers.RenameAction;
-import org.eclipse.wst.server.ui.internal.view.servers.RestartModuleAction;
-import org.eclipse.wst.server.ui.internal.view.servers.ShowInConsoleAction;
-import org.eclipse.wst.server.ui.internal.view.servers.ShowInDebugAction;
-import org.eclipse.wst.server.ui.internal.view.servers.StartAction;
-import org.eclipse.wst.server.ui.internal.view.servers.StartModuleAction;
-import org.eclipse.wst.server.ui.internal.view.servers.StopAction;
-import org.eclipse.wst.server.ui.internal.view.servers.StopModuleAction;
/**
* @deprecated
*/
public class ServerActionProvider extends CommonActionProvider {
- public static final String NEW_MENU_ID =
"org.jboss.tools.as.wst.server.ui.internal.cnf.newMenuId"; //$NON-NLS-1$
- public static final String SHOW_IN_MENU_ID =
"org.jboss.tools.as.wst.server.ui.internal.cnf.showInMenuId"; //$NON-NLS-1$
- public static final String TOP_SECTION_START_SEPARATOR =
"org.jboss.tools.as.wst.server.ui.internal.cnf.topSectionStart"; //$NON-NLS-1$
- public static final String TOP_SECTION_END_SEPARATOR =
"org.jboss.tools.as.wst.server.ui.internal.cnf.topSectionEnd"; //$NON-NLS-1$
- public static final String EDIT_SECTION_START_SEPARATOR =
"org.jboss.tools.as.wst.server.ui.internal.cnfeditSectionStart"; //$NON-NLS-1$
- public static final String EDIT_SECTION_END_SEPARATOR =
"org.jboss.tools.as.wst.server.ui.internal.cnf.editSectionEnd"; //$NON-NLS-1$
- public static final String CONTROL_SERVER_SECTION_START_SEPARATOR =
"org.jboss.tools.as.wst.server.ui.internal.cnf.controlServerSectionStart";
//$NON-NLS-1$
- public static final String CONTROL_SERVER_SECTION_END_SEPARATOR =
"org.jboss.tools.as.wst.server.ui.internal.cnf.controlServerSectionEnd";
//$NON-NLS-1$
- public static final String SERVER_ERATA_SECTION_START_SEPARATOR =
"org.jboss.tools.as.wst.server.ui.internal.cnf.serverErataSectionStart";
//$NON-NLS-1$
- public static final String SERVER_ERATA_SECTION_END_SEPARATOR =
"org.jboss.tools.as.wst.server.ui.internal.cnf.serverErataSectionEnd";
//$NON-NLS-1$
- public static final String CONTROL_MODULE_SECTION_START_SEPARATOR =
"org.jboss.tools.as.wst.server.ui.internal.cnf.controlModuleSectionStart";
//$NON-NLS-1$
- public static final String CONTROL_MODULE_SECTION_END_SEPARATOR =
"org.jboss.tools.as.wst.server.ui.internal.cnf.controlModuleSectionEnd";
//$NON-NLS-1$
-
- private ICommonActionExtensionSite actionSite;
- private Clipboard clipboard;
- public ServerActionProvider() {
- super();
- }
-
- public void init(ICommonActionExtensionSite aSite) {
- super.init(aSite);
- this.actionSite = aSite;
- ICommonViewerSite site = aSite.getViewSite();
- if( site instanceof ICommonViewerWorkbenchSite ) {
- StructuredViewer v = aSite.getStructuredViewer();
- if( v instanceof CommonViewer ) {
- CommonViewer cv = (CommonViewer)v;
- ICommonViewerWorkbenchSite wsSite = (ICommonViewerWorkbenchSite)site;
- addListeners(cv);
- makeServerActions(cv, wsSite.getSelectionProvider());
- }
- }
- }
-
-
- // actions on a server
- protected Action[] actions;
- protected Action actionModifyModules;
- protected Action openAction, showInConsoleAction, showInDebugAction, propertiesAction,
monitorPropertiesAction;
- protected Action copyAction, pasteAction, deleteAction, renameAction;
- protected Action noneAction = new Action(Messages.dialogMonitorNone) {
- // dummy action
- };
-
- private void addListeners(CommonViewer tableViewer) {
- tableViewer.addOpenListener(new IOpenListener() {
- public void open(OpenEvent event) {
- try {
- IStructuredSelection sel = (IStructuredSelection) event.getSelection();
- Object data = sel.getFirstElement();
- if (!(data instanceof IServer))
- return;
- IServer server = (IServer) data;
- ServerUIPlugin.editServer(server);
- } catch (Exception e) {
- //Trace.trace(Trace.STRING_SEVERE,
org.jboss.ide.eclipse.as.ui.Messages.ServerActionProvider_CouldNotOpenServerError, e);
- }
- }
- });
- }
-
- private void makeServerActions(CommonViewer tableViewer, ISelectionProvider provider) {
- clipboard = new Clipboard(tableViewer.getTree().getDisplay());
- Shell shell = tableViewer.getTree().getShell();
-
- actions = new Action[5];
- // create the start actions
- actions[0] = new StartAction(shell, provider, ILaunchManager.DEBUG_MODE);
- actions[1] = new StartAction(shell, provider, ILaunchManager.RUN_MODE);
- actions[2] = new StartAction(shell, provider, ILaunchManager.PROFILE_MODE);
-
- // create the stop action
- actions[3] = new StopAction(shell, provider);
-
- // create the publish actions
- actions[4] = new PublishAction(shell, provider);
- //actions[5] = new ExploreAction(shell,provider);
-
- // create the open action
- openAction = new OpenAction(provider);
-
-// // create copy, paste, and delete actions
- pasteAction = new PasteAction(shell, provider, clipboard);
- copyAction = new CopyAction(provider, clipboard, pasteAction);
- deleteAction = new DeleteAction(shell, provider);
- renameAction = new RenameAction(shell, tableViewer, provider);
-
- // create the other actions
- actionModifyModules = new ModuleSloshAction(shell, provider);
- showInConsoleAction = new ShowInConsoleAction(provider);
- showInDebugAction = new ShowInDebugAction(provider);
-
- // create the properties action
- propertiesAction = new PropertiesAction(shell, provider);
- monitorPropertiesAction = new PropertiesAction(shell,
"org.eclipse.wst.server.ui.properties.monitor", provider); //$NON-NLS-1$
- }
-
- public void fillActionBars(IActionBars actionBars) {
- actionBars.setGlobalActionHandler("org.eclipse.wst.server.debug",
actions[0]); //$NON-NLS-1$
- actionBars.setGlobalActionHandler("org.eclipse.wst.server.run", actions[1]);
//$NON-NLS-1$
- actionBars.setGlobalActionHandler("org.eclipse.wst.server.stop", actions[3]);
//$NON-NLS-1$
- actionBars.setGlobalActionHandler("org.eclipse.wst.server.publish",
actions[4]); //$NON-NLS-1$
- actionBars.setGlobalActionHandler("org.eclipse.ui.navigator.Open",
openAction); //$NON-NLS-1$
- actionBars.setGlobalActionHandler(ActionFactory.PROPERTIES.getId(), propertiesAction);
- actionBars.updateActionBars();
- actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(), copyAction);
- actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(), pasteAction);
- actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), deleteAction);
- actionBars.setGlobalActionHandler(ActionFactory.RENAME.getId(), renameAction);
-
- IContributionManager cm = actionBars.getToolBarManager();
- cm.removeAll();
-
- for (int i = 0; i < actions.length - 1; i++)
- cm.add(actions[i]);
- }
-
- public void fillContextMenu(IMenuManager menu) {
- ICommonViewerSite site = actionSite.getViewSite();
- IStructuredSelection selection = null;
- Shell shell = actionSite.getViewSite().getShell();
- if( site instanceof ICommonViewerWorkbenchSite ) {
- ICommonViewerWorkbenchSite wsSite = (ICommonViewerWorkbenchSite)site;
- selection = (IStructuredSelection) wsSite.getSelectionProvider().getSelection();
- }
-
- IServer server = null;
- IModule[] module = null;
- if (selection != null && !selection.isEmpty()) {
- Iterator iterator = selection.iterator();
- Object obj = iterator.next();
- if (obj instanceof IServer)
- server = (IServer) obj;
- if (obj instanceof ModuleServer) {
- ModuleServer ms = (ModuleServer) obj;
- server = ms.server;
- module = ms.module;
- }
- if (iterator.hasNext()) {
- server = null;
- module = null;
- }
- }
-
- menu.add(invisibleSeparator(TOP_SECTION_START_SEPARATOR));
- addTopSection(menu, server, module);
- menu.add(invisibleSeparator(TOP_SECTION_END_SEPARATOR));
- menu.add(new Separator());
-
- if (server != null && module == null) {
- menu.add(invisibleSeparator(EDIT_SECTION_START_SEPARATOR));
- menu.add(copyAction);
- menu.add(pasteAction);
- menu.add(deleteAction);
- menu.add(renameAction);
- menu.add(invisibleSeparator(EDIT_SECTION_END_SEPARATOR));
-
- menu.add(new Separator());
-
- menu.add(invisibleSeparator(CONTROL_SERVER_SECTION_START_SEPARATOR));
- for (int i = 0; i < actions.length; i++)
- menu.add(actions[i]);
- menu.add(invisibleSeparator(CONTROL_SERVER_SECTION_END_SEPARATOR));
-
- menu.add(new Separator());
-
- menu.add(invisibleSeparator(SERVER_ERATA_SECTION_START_SEPARATOR));
- menu.add(actionModifyModules);
- addMonitor(server, menu, shell);
- menu.add(invisibleSeparator(SERVER_ERATA_SECTION_END_SEPARATOR));
- menu.add(new Separator());
- menu.add(propertiesAction);
-
- } else if (server != null && module != null) {
-
- menu.add(invisibleSeparator(CONTROL_MODULE_SECTION_START_SEPARATOR));
- menu.add(new StartModuleAction(server, module));
- menu.add(new StopModuleAction(server, module));
- menu.add(new RestartModuleAction(server, module));
- if(module.length == 1) {
- menu.add(new RemoveModuleAction(shell, server, module[0]));
- }
- menu.add(invisibleSeparator(CONTROL_MODULE_SECTION_END_SEPARATOR));
- }
-
- menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
- menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS+"-end"));
//$NON-NLS-1$
- }
-
- protected void addTopSection(IMenuManager menu, IServer server, IModule[] module) {
- MenuManager newMenu = new MenuManager(Messages.actionNew, NEW_MENU_ID);
- IAction newServerAction = new NewServerWizardAction();
- newServerAction.setText(Messages.actionNewServer);
- newMenu.add(newServerAction);
- menu.add(newMenu);
-
- // open action
- if (server != null && module == null) {
- menu.add(openAction);
-
- String text = Messages.actionShowIn;
- final IWorkbench workbench = PlatformUI.getWorkbench();
- final IBindingService bindingService = (IBindingService) workbench
- .getAdapter(IBindingService.class);
- final TriggerSequence[] activeBindings = bindingService
- .getActiveBindingsFor("org.eclipse.ui.navigate.showInQuickMenu");
//$NON-NLS-1$
- if (activeBindings.length > 0) {
- text += "\t" + activeBindings[0].format(); //$NON-NLS-1$
- }
-
- MenuManager showInMenu = new MenuManager(text,
"org.eclipse.ui.navigate.showInQuickMenu"); //$NON-NLS-1$
- showInMenu.add(showInConsoleAction);
- showInMenu.add(showInDebugAction);
- menu.add(showInMenu);
- }
- }
-
- protected void addMonitor(IServer server, IMenuManager menu, Shell shell) {
-
- if (server.getServerType() != null) {
- final MenuManager menuManager = new MenuManager(Messages.actionMonitor);
-
- final IServer server2 = server;
- final Shell shell2 = shell;
- menuManager.addMenuListener(new IMenuListener() {
- public void menuAboutToShow(IMenuManager manager) {
- menuManager.removeAll();
- if (server2.getAdapter(ServerDelegate.class) != null) {
- ServerPort[] ports = server2.getServerPorts(null);
- if (ports != null) {
- int size = ports.length;
- for (int i = 0; i < size; i++) {
- if (!ports[i].isAdvanced())
- menuManager.add(new MonitorServerPortAction(shell2, server2, ports[i]));
- }
- }
- }
-
- if (menuManager.isEmpty())
- menuManager.add(noneAction);
-
- menuManager.add(new Separator());
- menuManager.add(monitorPropertiesAction);
- }
- });
-
- // add an initial menu item so that the menu appears correctly
- noneAction.setEnabled(false);
- menuManager.add(noneAction);
- menu.add(menuManager);
- }
- }
-
-
- private Separator invisibleSeparator(String s) {
- Separator sep = new Separator(s);
- sep.setVisible(false);
- return sep;
- }
+ // Deprecated class
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml 2011-08-05 05:11:27 UTC (rev
33621)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml 2011-08-05 07:38:39 UTC (rev
33622)
@@ -299,62 +299,7 @@
</view>
</extension>
- <extension
- point="org.eclipse.ui.navigator.navigatorContent">
- <navigatorContent
- activeByDefault="true"
-
contentProvider="org.jboss.tools.as.wst.server.ui.xpl.ServerContentProvider"
- icon="$nl$/icons/cview16/servers_view.gif"
- id="org.jboss.tools.as.wst.server.ui.ServersView.content.root"
-
labelProvider="org.jboss.tools.as.wst.server.ui.xpl.ServerLabelProvider"
- name="%NavigatorContent_ServersViewDefaultContent"
- priority="highest">
- <triggerPoints>
- <instanceof
- value="java.lang.Object">
- </instanceof>
- </triggerPoints>
- <possibleChildren>
- <instanceof
- value="java.lang.Object">
- </instanceof></possibleChildren>
- <actionProvider
- class="org.jboss.tools.as.wst.server.ui.xpl.ServerActionProvider"
-
id="org.jboss.tools.as.wst.server.ui.ServersView.ServerActionProvider"
- priority="highest">
- <enablement>
- <or>
- <instanceof
- value="org.eclipse.wst.server.core.IServer">
- </instanceof>
- <instanceof
-
value="org.eclipse.wst.server.ui.internal.view.servers.ModuleServer">
- </instanceof>
- <instanceof
- value="org.eclipse.core.resources.IWorkspaceRoot">
- </instanceof>
- <adapt
- type="java.util.Collection">
- <count
- value="0">
- </count>
- </adapt>
- </or>
- </enablement>
- </actionProvider>
- <dropAssistant
-
class="org.jboss.tools.as.wst.server.ui.xpl.ServersViewDropAdapterAssistant"
-
id="org.jboss.tools.as.wst.server.ui.ServersView.DropAssistant">
- <possibleDropTargets>
- <instanceof
- value="org.eclipse.wst.server.core.IServer">
- </instanceof></possibleDropTargets>
- </dropAssistant>
- </navigatorContent>
- </extension>
-
<!-- Extensions to new Server View -->
-
<extension
point="org.eclipse.ui.navigator.navigatorContent">
<navigatorContent
@@ -407,6 +352,21 @@
</enablement>
</actionProvider>
<actionProvider
+
class="org.jboss.tools.as.wst.server.ui.xpl.ExploreActionProvider"
+
id="org.jboss.tools.as.wst.server.ui.ServersView.ExploreActionProvider"
+ priority="highest">
+ <enablement>
+ <or>
+ <instanceof
+ value="org.eclipse.wst.server.core.IServer">
+ </instanceof>
+ <instanceof
+
value="org.eclipse.wst.server.ui.internal.view.servers.ModuleServer">
+ </instanceof>
+ </or>
+ </enablement>
+ </actionProvider>
+ <actionProvider
class="org.jboss.ide.eclipse.as.ui.views.server.extensions.ServerLogActionProvider"
id="org.jboss.ide.eclipse.as.ui.extensions.serverLog">
<enablement>
@@ -436,6 +396,8 @@
pattern="org.jboss.ide.eclipse.as.ui.extensions.modules"/>
<actionExtension
pattern="org.jboss.ide.eclipse.as.ui.extensions.serverLog"/>
+ <actionExtension
+
pattern="org.jboss.tools.as.wst.server.ui.ServersView.ExploreActionProvider"/>
</includes>
</viewerActionBinding>
</extension>
@@ -488,6 +450,8 @@
typeIds="%AllJBossServerTypes">
</runtimeLocator>
</extension>
+
+ <!--
<extension point="org.eclipse.ui.popupMenus">
<objectContribution
adaptable="true"
@@ -512,4 +476,5 @@
</action>
</objectContribution>
</extension>
+-->
</plugin>