[245013] Server View based on Common Navigator (final drop)
diff --git a/plugins/org.eclipse.wst.server.ui/plugin.properties b/plugins/org.eclipse.wst.server.ui/plugin.properties
index 8e77aa5..065f0bf 100644
--- a/plugins/org.eclipse.wst.server.ui/plugin.properties
+++ b/plugins/org.eclipse.wst.server.ui/plugin.properties
@@ -28,6 +28,7 @@
viewServers=Servers
viewServers_new=Servers (proposed)
+defaultProvider=Server and Module Provider
# --------------- Action Sets (toolbar icon groups) ---------------
diff --git a/plugins/org.eclipse.wst.server.ui/plugin.xml b/plugins/org.eclipse.wst.server.ui/plugin.xml
index 059204d..6e29477 100644
--- a/plugins/org.eclipse.wst.server.ui/plugin.xml
+++ b/plugins/org.eclipse.wst.server.ui/plugin.xml
@@ -39,21 +39,22 @@
icon="icons/cview16/servers_view.gif"/>
<view
- id="org.eclipse.wst.server.ui.ServersViewProposed"
- name="%viewServers_new"
- category="org.eclipse.wst.server.ui"
- class="org.eclipse.wst.server.ui.internal.view.servers.provisional.ServersView"
- icon="icons/cview16/servers_view.gif"/>
+ allowMultiple="false"
+ category="org.eclipse.wst.server.ui"
+ class="org.elcipse.wst.server.ui.internal.cnf.ServersView2"
+ icon="icons/cview16/servers_view.gif"
+ id="org.eclipse.wst.server.ui.ServersView2"
+ name="%viewServers_new"/>
</extension>
<extension
point="org.eclipse.ui.navigator.navigatorContent">
<navigatorContent
activeByDefault="true"
- contentProvider="org.eclipse.wst.server.ui.internal.view.servers.provisional.ServerContentProvider"
+ contentProvider="org.elcipse.wst.server.ui.internal.cnf.ServerContentProvider"
icon="icons/cview16/servers_view.gif"
id="org.eclipse.wst.server.ui.ServersView.content.root"
- labelProvider="org.eclipse.wst.server.ui.internal.view.servers.provisional.ServerLabelProvider"
- name="Servers View Default Content"
+ labelProvider="org.elcipse.wst.server.ui.internal.cnf.ServerLabelProvider"
+ name="%defaultProvider"
priority="normal">
<triggerPoints>
<instanceof
@@ -75,7 +76,7 @@
<extension
point="org.eclipse.ui.navigator.viewer">
<viewerContentBinding
- viewerId="org.eclipse.wst.server.ui.ServersViewProposed">
+ viewerId="org.eclipse.wst.server.ui.ServersView2">
<includes>
<contentExtension
isRoot="true"
@@ -91,7 +92,7 @@
<view
relative="org.eclipse.debug.ui.DebugView"
relationship="stack"
- id="org.eclipse.wst.server.ui.ServersView">
+ id="org.eclipse.wst.server.ui.ServersView2">
</view>
</perspectiveExtension>
</extension>
@@ -552,12 +553,13 @@
<extension
point="org.eclipse.ui.decorators">
<decorator
- class="org.eclipse.wst.server.ui.internal.view.servers.provisional.ServerDecorator"
+ class="org.elcipse.wst.server.ui.internal.cnf.ServerDecorator"
icon="icons/obj16/server.gif"
id="org.eclipse.wst.server.ui.navigatorDecorator"
label="Server State Decorator"
lightweight="true"
- location="BOTTOM_RIGHT">
+ location="BOTTOM_RIGHT"
+ state="true">
<enablement>
<or>
<objectClass
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/Messages.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/Messages.java
index 096ca85..55b7ce1 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/Messages.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/Messages.java
@@ -304,9 +304,11 @@
public static String viewStatusStarted2;
public static String viewStatusStopping4;
public static String viewStatusStopped2;
+ public static String viewStatusStarting;
public static String viewStatusStarting1;
public static String viewStatusStarting2;
public static String viewStatusStarting3;
+ public static String viewStatusStopping;
public static String viewStatusStopping1;
public static String viewStatusStopping2;
public static String viewStatusStopping3;
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/Messages.properties b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/Messages.properties
index 8ae242f..7ad8c23 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/Messages.properties
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/Messages.properties
@@ -156,10 +156,12 @@
viewStatusStartedProfile=Profiling
viewStatusStopped=Stopped
+viewStatusStarting=Starting
viewStatusStarting1=Starting.
viewStatusStarting2=Starting..
viewStatusStarting3=Starting...
+viewStatusStopping=Stopping
viewStatusStopping1=Stopping.
viewStatusStopping2=Stopping..
viewStatusStopping3=Stopping...
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/provisional/ConnectedUIDecorator.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/provisional/ConnectedUIDecorator.java
deleted file mode 100644
index 3a7d252..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/provisional/ConnectedUIDecorator.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * IBM Corporation - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.server.ui.internal.provisional;
-
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.jface.action.Action;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.ui.internal.ImageResource;
-import org.eclipse.wst.server.ui.internal.Messages;
-
-public class ConnectedUIDecorator extends UIDecorator {
- private static final String[] serverStateUnmanaged = new String[] {
- "",
- Messages.viewStatusStarting4,
- Messages.viewStatusStarted2,
- Messages.viewStatusStopping4,
- Messages.viewStatusStopped2};
-
- private static final String[] startingText = new String[] {
- Messages.viewStatusStarting1,
- Messages.viewStatusStarting2,
- Messages.viewStatusStarting3};
-
- private static final String[] stoppingText = new String[] {
- Messages.viewStatusStopping1,
- Messages.viewStatusStopping2,
- Messages.viewStatusStopping3};
-
- private static final Image[] startingImages = new Image[] {
- ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STARTING_1),
- ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STARTING_2),
- ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STARTING_3)
- };
-
- private static final Image[] stoppingImages = new Image[] {
- ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STOPPING_1),
- ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STOPPING_2),
- ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STOPPING_2)
- };
-
- /**
- * @see UIDecorator#getStateLabel(int, String, int)
- */
- public String getStateLabel(int state, String mode, int count) {
- if (state == IServer.STATE_UNKNOWN)
- return "";
- else if (state == IServer.STATE_STARTING)
- return startingText[count];
- else if (state == IServer.STATE_STOPPING)
- return stoppingText[count];
- else if (state == IServer.STATE_STARTED) {
- if (ILaunchManager.DEBUG_MODE.equals(mode))
- return Messages.viewStatusStartedDebug;
- else if (ILaunchManager.PROFILE_MODE.equals(mode))
- return Messages.viewStatusStartedProfile;
- else
- return Messages.viewStatusStarted;
- } else if (state == IServer.STATE_STOPPED)
- return Messages.viewStatusStopped;
-
- return serverStateUnmanaged[state];
- }
-
- /**
- * @see UIDecorator#getStateImage(int, String, int)
- */
- public Image getStateImage(int state, String mode, int count) {
- if (state == IServer.STATE_UNKNOWN)
- return null;
- else if (state == IServer.STATE_STARTING)
- return startingImages[count];
- else if (state == IServer.STATE_STOPPING)
- return stoppingImages[count];
- else if (state == IServer.STATE_STOPPED)
- return ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STOPPED);
- else { //if (state == IServer.STATE_STARTED) {
- //String mode = server.getMode();
- if (ILaunchManager.DEBUG_MODE.equals(mode))
- return ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STARTED_DEBUG);
- else if (ILaunchManager.PROFILE_MODE.equals(mode))
- return ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STARTED_PROFILE);
- else
- return ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STARTED);
- }
- }
-
- public boolean canRestart() {
- return false;
- }
-
- public void setupAction(Action action, int action2) {
- action.setToolTipText(Messages.actionStopToolTip2);
- action.setText(Messages.actionStop2);
- action.setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_ELCL_DISCONNECT));
- action.setHoverImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_CLCL_DISCONNECT));
- action.setDisabledImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_DLCL_DISCONNECT));
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/provisional/UIDecorator.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/provisional/UIDecorator.java
index de9952d..72820ca 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/provisional/UIDecorator.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/provisional/UIDecorator.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
+ * Copyright (c) 2005,2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,6 +11,7 @@
package org.eclipse.wst.server.ui.internal.provisional;
import org.eclipse.jface.action.Action;
+import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.graphics.Image;
import org.eclipse.wst.server.ui.internal.ImageResource;
import org.eclipse.wst.server.ui.internal.Messages;
@@ -37,6 +38,10 @@
* @return org.eclipse.jface.parts.IImage
*/
public abstract Image getStateImage(int state, String mode, int count);
+
+ public ImageDescriptor getStateImageDescriptor(int state, String mode, int count){
+ return null;
+ }
public String getModuleName() {
return "module";
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/provisional/UIDecoratorManager.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/provisional/UIDecoratorManager.java
index e55fdcf..abf2374 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/provisional/UIDecoratorManager.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/provisional/UIDecoratorManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
+ * Copyright (c) 2005,2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,11 +11,17 @@
package org.eclipse.wst.server.ui.internal.provisional;
import org.eclipse.wst.server.core.IServerType;
+import org.elcipse.wst.server.ui.internal.cnf.CNFManagedUIDecorator;
public class UIDecoratorManager {
protected static UIDecorator decorator = new ManagedUIDecorator();
+ protected static UIDecorator decorator2 = new CNFManagedUIDecorator();
public static UIDecorator getUIDecorator(IServerType serverType) {
return decorator;
}
+
+ public static UIDecorator getCNFUIDecorator(IServerType serverType) {
+ return decorator2;
+ }
}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/PasteAction.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/PasteAction.java
index c890066..5f31880 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/PasteAction.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/PasteAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007,2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -46,7 +46,6 @@
setActionDefinitionId(IWorkbenchActionDefinitionIds.PASTE);
this.clipboard = clipboard;
- //setEnabled(false);
}
/**
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/provisional/PublishedUIDecorator.java b/plugins/org.eclipse.wst.server.ui/serverui/org/elcipse/wst/server/ui/internal/cnf/CNFManagedUIDecorator.java
similarity index 60%
rename from plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/provisional/PublishedUIDecorator.java
rename to plugins/org.eclipse.wst.server.ui/serverui/org/elcipse/wst/server/ui/internal/cnf/CNFManagedUIDecorator.java
index b4f63b0..641c8e2 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/provisional/PublishedUIDecorator.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/elcipse/wst/server/ui/internal/cnf/CNFManagedUIDecorator.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
+ * Copyright (c) 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,31 +8,23 @@
* Contributors:
* IBM Corporation - Initial API and implementation
*******************************************************************************/
-package org.eclipse.wst.server.ui.internal.provisional;
+package org.elcipse.wst.server.ui.internal.cnf;
import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.graphics.Image;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.ui.internal.ImageResource;
import org.eclipse.wst.server.ui.internal.Messages;
+import org.eclipse.wst.server.ui.internal.provisional.UIDecorator;
-public class PublishedUIDecorator extends UIDecorator {
+public class CNFManagedUIDecorator extends UIDecorator {
private static final String[] serverStateUnmanaged = new String[] {
"",
Messages.viewStatusStarting4,
Messages.viewStatusStarted2,
Messages.viewStatusStopping4,
Messages.viewStatusStopped2};
-
- private static final String[] startingText = new String[] {
- Messages.viewStatusStarting1,
- Messages.viewStatusStarting2,
- Messages.viewStatusStarting3};
-
- private static final String[] stoppingText = new String[] {
- Messages.viewStatusStopping1,
- Messages.viewStatusStopping2,
- Messages.viewStatusStopping3};
private static final Image[] startingImages = new Image[] {
ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STARTING_1),
@@ -40,11 +32,24 @@
ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STARTING_3)
};
+ private static final ImageDescriptor[] startingImagesDescriptor = new ImageDescriptor[] {
+ ImageResource.getImageDescriptor(ImageResource.IMG_SERVER_STATE_STARTING_1),
+ ImageResource.getImageDescriptor(ImageResource.IMG_SERVER_STATE_STARTING_2),
+ ImageResource.getImageDescriptor(ImageResource.IMG_SERVER_STATE_STARTING_3)
+ };
+
private static final Image[] stoppingImages = new Image[] {
ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STOPPING_1),
ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STOPPING_2),
ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STOPPING_2)
};
+
+ private static final ImageDescriptor[] stoppingImagesDescriptor = new ImageDescriptor[] {
+ ImageResource.getImageDescriptor(ImageResource.IMG_SERVER_STATE_STOPPING_1),
+ ImageResource.getImageDescriptor(ImageResource.IMG_SERVER_STATE_STOPPING_2),
+ ImageResource.getImageDescriptor(ImageResource.IMG_SERVER_STATE_STOPPING_3)
+ };
+
/**
* @see UIDecorator#getStateLabel(int, String, int)
@@ -53,9 +58,9 @@
if (state == IServer.STATE_UNKNOWN)
return "";
else if (state == IServer.STATE_STARTING)
- return startingText[count];
+ return Messages.viewStatusStarting;
else if (state == IServer.STATE_STOPPING)
- return stoppingText[count];
+ return Messages.viewStatusStopping;
else if (state == IServer.STATE_STARTED) {
if (ILaunchManager.DEBUG_MODE.equals(mode))
return Messages.viewStatusStartedDebug;
@@ -91,12 +96,37 @@
return ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STARTED);
}
}
+
+ /**
+ * @see UIDecorator#getStateImage(int, String, int)
+ */
+ public ImageDescriptor getStateImageDescriptor(int state, String mode, int count) {
+ if (state == IServer.STATE_UNKNOWN)
+ return null;
+ else if (state == IServer.STATE_STARTING)
+ return startingImagesDescriptor[count];
+ else if (state == IServer.STATE_STOPPING)
+ return stoppingImagesDescriptor[count];
+ else if (state == IServer.STATE_STOPPED)
+ return ImageResource.getImageDescriptor(ImageResource.IMG_SERVER_STATE_STOPPED);
+ else { //if (state == IServer.STATE_STARTED) {
+ //String mode = server.getMode();
+ if (ILaunchManager.DEBUG_MODE.equals(mode))
+ return ImageResource.getImageDescriptor(ImageResource.IMG_SERVER_STATE_STARTED_DEBUG);
+ else if (ILaunchManager.PROFILE_MODE.equals(mode))
+ return ImageResource.getImageDescriptor(ImageResource.IMG_SERVER_STATE_STARTED_PROFILE);
+ else
+ return ImageResource.getImageDescriptor(ImageResource.IMG_SERVER_STATE_STARTED);
+ }
+ }
+
+
public String getModuleName() {
return "module";
}
public boolean canRestart() {
- return false;
+ return true;
}
}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/provisional/ServerActionProvider.java b/plugins/org.eclipse.wst.server.ui/serverui/org/elcipse/wst/server/ui/internal/cnf/ServerActionProvider.java
similarity index 87%
rename from plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/provisional/ServerActionProvider.java
rename to plugins/org.eclipse.wst.server.ui/serverui/org/elcipse/wst/server/ui/internal/cnf/ServerActionProvider.java
index 4247d90..982a1b4 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/provisional/ServerActionProvider.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/elcipse/wst/server/ui/internal/cnf/ServerActionProvider.java
@@ -1,4 +1,14 @@
-package org.eclipse.wst.server.ui.internal.view.servers.provisional;
+/*******************************************************************************
+ * Copyright (c) 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are 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:
+ * IBM Corporation - Initial API and implementation
+ *******************************************************************************/
+package org.elcipse.wst.server.ui.internal.cnf;
import java.util.Iterator;
@@ -38,25 +48,7 @@
import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
import org.eclipse.wst.server.ui.internal.Trace;
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.PublishCleanAction;
-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;
+import org.eclipse.wst.server.ui.internal.view.servers.*;
/**
* TODO Angel says: Not currently besing used this code was moved up to the ServersView to get similar support
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/provisional/ServerContentProvider.java b/plugins/org.eclipse.wst.server.ui/serverui/org/elcipse/wst/server/ui/internal/cnf/ServerContentProvider.java
similarity index 83%
rename from plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/provisional/ServerContentProvider.java
rename to plugins/org.eclipse.wst.server.ui/serverui/org/elcipse/wst/server/ui/internal/cnf/ServerContentProvider.java
index 748f483..c762480 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/provisional/ServerContentProvider.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/elcipse/wst/server/ui/internal/cnf/ServerContentProvider.java
@@ -1,26 +1,24 @@
-package org.eclipse.wst.server.ui.internal.view.servers.provisional;
+/*******************************************************************************
+ * Copyright (c) 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are 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:
+ * IBM Corporation - Initial API and implementation
+ *******************************************************************************/
+package org.elcipse.wst.server.ui.internal.cnf;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
+import java.util.*;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.*;
import org.eclipse.swt.widgets.Display;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IPublishListener;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.IServerLifecycleListener;
-import org.eclipse.wst.server.core.IServerListener;
-import org.eclipse.wst.server.core.ServerCore;
-import org.eclipse.wst.server.core.ServerEvent;
+import org.eclipse.wst.server.core.*;
import org.eclipse.wst.server.core.internal.Server;
import org.eclipse.wst.server.core.internal.UpdateServerJob;
import org.eclipse.wst.server.core.util.PublishAdapter;
@@ -41,9 +39,8 @@
protected boolean animationActive = false;
protected boolean stopAnimation = false;
protected boolean initialized = false;
-
-
- private StructuredViewer viewer;
+
+ protected StructuredViewer viewer;
public ServerContentProvider() {
addListeners();
@@ -144,7 +141,7 @@
}
}
}
-
+
// Listeners and refreshing the viewer
protected void addListeners() {
serverResourceListener = new IServerLifecycleListener() {
@@ -187,29 +184,7 @@
refreshServer(server, true);
int state = event.getState();
String id = server.getId();
- if (state == IServer.STATE_STARTING || state == IServer.STATE_STOPPING) {
- boolean startThread = false;
- synchronized (starting) {
- if (!starting.contains(id)) {
- if (starting.isEmpty())
- startThread = true;
- starting.add(id);
- }
- }
- if (startThread)
- startThread();
- } else {
- boolean stopThread = false;
- synchronized (starting) {
- if (starting.contains(id)) {
- starting.remove(id);
- if (starting.isEmpty())
- stopThread = true;
- }
- }
- if (stopThread)
- stopThread();
- }
+ animate(id, state);
} else
refreshServer(server);
} else if ((eventKind & ServerEvent.MODULE_CHANGE) != 0) {
@@ -232,6 +207,33 @@
}
}
+ protected void animate(String serverId, int state){
+ if (state == IServer.STATE_STARTING || state == IServer.STATE_STOPPING) {
+ boolean startThread = false;
+ synchronized (starting) {
+ if (!starting.contains(serverId)) {
+ if (starting.isEmpty())
+ startThread = true;
+ starting.add(serverId);
+ }
+ }
+ if (startThread){
+ startThread();
+ }
+ } else {
+ boolean stopThread = false;
+ synchronized (starting) {
+ if (starting.contains(serverId)) {
+ starting.remove(serverId);
+ if (starting.isEmpty())
+ stopThread = true;
+ }
+ }
+ if (stopThread)
+ stopThread();
+ }
+ }
+
protected void deferInitialization() {
Job job = new Job(Messages.jobInitializingServersView) {
public IStatus run(IProgressMonitor monitor) {
@@ -269,12 +271,13 @@
public void run() {
try {
if( viewer != null && !viewer.getControl().isDisposed()) {
+ // This will trigger some animation
viewer.refresh(server);
if( resetSelection ) {
ISelection sel = viewer.getSelection();
viewer.setSelection(sel);
}
- ServerDecorator.getDefault().redecorate(server);
+ //TODO: Angel says: This doesn't seem to be needed ServerDecorator.getDefault().redecorate(server);
}
} catch (Exception e) {
// ignore
@@ -294,6 +297,9 @@
}
+ /**
+ * Start the animation thread
+ */
protected void startThread() {
if (animationActive)
return;
@@ -304,6 +310,7 @@
final int SLEEP = 200;
final Runnable[] animator = new Runnable[1];
animator[0] = new Runnable() {
+ @SuppressWarnings("synthetic-access")
public void run() {
if (!stopAnimation) {
try {
@@ -313,13 +320,14 @@
size = starting.size();
servers = new String[size];
starting.toArray(servers);
+
}
for (int i = 0; i < size; i++) {
IServer server = ServerCore.findServer(servers[i]);
if (server != null ) {
ServerDecorator.animate();
- refreshServer(server);
+ viewer.update(server, new String[]{"ICON"});
}
}
} catch (Exception e) {
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/provisional/ServerDecorator.java b/plugins/org.eclipse.wst.server.ui/serverui/org/elcipse/wst/server/ui/internal/cnf/ServerDecorator.java
similarity index 79%
rename from plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/provisional/ServerDecorator.java
rename to plugins/org.eclipse.wst.server.ui/serverui/org/elcipse/wst/server/ui/internal/cnf/ServerDecorator.java
index edeaa45..f6894dd 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/provisional/ServerDecorator.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/elcipse/wst/server/ui/internal/cnf/ServerDecorator.java
@@ -1,11 +1,18 @@
-package org.eclipse.wst.server.ui.internal.view.servers.provisional;
+/*******************************************************************************
+ * Copyright (c) 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are 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:
+ * IBM Corporation - Initial API and implementation
+ *******************************************************************************/
+ package org.elcipse.wst.server.ui.internal.cnf;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.viewers.IDecoration;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILightweightLabelDecorator;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.LabelProviderChangedEvent;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.*;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.ISharedImages;
import org.eclipse.wst.server.core.IServer;
@@ -59,35 +66,23 @@
public void decorate(Object element, IDecoration decoration) {
if( element instanceof IServer ) {
- String state = getServerStateLabel((IServer)element);
- String status = getServerStatusLabel((IServer)element);
+ IServer server = (IServer)element;
+ String state = getServerStateLabel(server );
+ String status = getServerStatusLabel(server );
+
decoration.addSuffix(combine(state, status));
} else if( element instanceof ModuleServer ) {
- String state = getModuleStateText((ModuleServer)element);
- String status = getModuleStatusText((ModuleServer)element);
+ ModuleServer module = (ModuleServer)element;
+ String state = getModuleStateText(module);
+ String status = getModuleStatusText(module);
+
decoration.addSuffix(combine(state, status));
}
}
- protected String combine(String state, String status) {
- if(isEmpty(state) && isEmpty(status))
- return "";
- if( isEmpty(state))
- return " [" + status + "]";
- if( isEmpty(status))
- return " [" + state + "]";
- return " [" + state + ", " + status + "]";
- }
-
- protected boolean isEmpty(String s) {
- return (s == null || "".equals(s));
- }
-
public void redecorate(IServer server) {
fireLabelProviderChanged(new LabelProviderChangedEvent(this));
}
-
-
/*
* Utility methods
@@ -106,7 +101,7 @@
public static String getStateLabel(IServerType serverType, int state, String mode) {
return serverType == null ? null :
- UIDecoratorManager.getUIDecorator(serverType).getStateLabel(state, mode, count);
+ UIDecoratorManager.getCNFUIDecorator(serverType).getStateLabel(state, mode, count);
}
public static String getServerStatusLabel(IServer server) {
@@ -138,14 +133,14 @@
return syncState[i];
}
- public static Image getServerStateImage(IServer server) {
+ public static ImageDescriptor getServerStateImage(IServer server) {
return server == null ? null :
getStateImage(server.getServerType(), server.getServerState(), server.getMode());
}
- public static Image getStateImage(IServerType serverType, int state, String mode) {
+ public static ImageDescriptor getStateImage(IServerType serverType, int state, String mode) {
return serverType == null ? null :
- UIDecoratorManager.getUIDecorator(serverType).getStateImage(state, mode, getCount());
+ UIDecoratorManager.getCNFUIDecorator(serverType).getStateImageDescriptor(state, mode, getCount());
}
public static String getModuleText(ModuleServer ms ) {
@@ -193,4 +188,18 @@
}
return null;
}
+
+ protected String combine(String state, String status) {
+ if(isEmpty(state) && isEmpty(status))
+ return "";
+ if( isEmpty(state))
+ return " [" + status + "]";
+ if( isEmpty(status))
+ return " [" + state + "]";
+ return " [" + state + ", " + status + "]";
+ }
+
+ protected boolean isEmpty(String s) {
+ return (s == null || "".equals(s));
+ }
}
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/provisional/ServerLabelProvider.java b/plugins/org.eclipse.wst.server.ui/serverui/org/elcipse/wst/server/ui/internal/cnf/ServerLabelProvider.java
similarity index 78%
rename from plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/provisional/ServerLabelProvider.java
rename to plugins/org.eclipse.wst.server.ui/serverui/org/elcipse/wst/server/ui/internal/cnf/ServerLabelProvider.java
index d59d08b..da731a5 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/provisional/ServerLabelProvider.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/elcipse/wst/server/ui/internal/cnf/ServerLabelProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * Copyright (c) 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,8 +8,9 @@
* Contributors:
* IBM Corporation - Initial API and implementation
*******************************************************************************/
-package org.eclipse.wst.server.ui.internal.view.servers.provisional;
+package org.elcipse.wst.server.ui.internal.cnf;
+import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.swt.graphics.Image;
@@ -61,6 +62,12 @@
IServer server = (IServer) element;
if (server.getServerType() != null) {
image = ImageResource.getImage(server.getServerType().getId());
+ // TODO Angel says: Need to discuss about it
+ // Because we are now grabbing the ServerState the type will not show. It might be best to create a new icon for the state
+ ImageDescriptor imgDescriptor = ServerDecorator.getServerStateImage(server);
+ if (image != null){
+ image = imgDescriptor.createImage();
+ }
}
}
return image;
@@ -73,6 +80,12 @@
}
public boolean isLabelProperty(Object element, String property) {
- return false;
+ if (element instanceof IServer){
+ IServer server = (IServer)element;
+ if (property.equalsIgnoreCase("ICON")){
+ return true;
+ }
+ }
+ return true;
}
}
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/provisional/ServersView.java b/plugins/org.eclipse.wst.server.ui/serverui/org/elcipse/wst/server/ui/internal/cnf/ServersView2.java
similarity index 71%
rename from plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/provisional/ServersView.java
rename to plugins/org.eclipse.wst.server.ui/serverui/org/elcipse/wst/server/ui/internal/cnf/ServersView2.java
index 547b438..fa0304d 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/provisional/ServersView.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/elcipse/wst/server/ui/internal/cnf/ServersView2.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2008 IBM Corporation and others.
+ * Copyright (c) 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,7 +8,7 @@
* Contributors:
* IBM Corporation - Initial API and implementation
*******************************************************************************/
-package org.eclipse.wst.server.ui.internal.view.servers.provisional;
+package org.elcipse.wst.server.ui.internal.cnf;
import java.util.Iterator;
@@ -17,71 +17,31 @@
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
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.action.*;
import org.eclipse.jface.bindings.TriggerSequence;
-import org.eclipse.jface.viewers.IOpenListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.OpenEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.*;
import org.eclipse.swt.SWT;
import org.eclipse.swt.dnd.Clipboard;
import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.PlatformUI;
+import org.eclipse.swt.widgets.*;
+import org.eclipse.ui.*;
import org.eclipse.ui.actions.ActionFactory;
+import org.eclipse.ui.actions.ActionGroup;
import org.eclipse.ui.keys.IBindingService;
import org.eclipse.ui.navigator.CommonNavigator;
import org.eclipse.ui.navigator.CommonViewer;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.ServerCore;
-import org.eclipse.wst.server.core.ServerPort;
+import org.eclipse.ui.navigator.INavigatorViewerDescriptor;
+import org.eclipse.wst.server.core.*;
import org.eclipse.wst.server.core.internal.Server;
import org.eclipse.wst.server.core.internal.UpdateServerJob;
import org.eclipse.wst.server.core.model.ServerDelegate;
-import org.eclipse.wst.server.ui.internal.Messages;
-import org.eclipse.wst.server.ui.internal.ServerToolTip;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-import org.eclipse.wst.server.ui.internal.Trace;
+import org.eclipse.wst.server.ui.internal.*;
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.PublishCleanAction;
-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;
+import org.eclipse.wst.server.ui.internal.view.servers.*;
/**
* A view of servers, their modules, and status.
*/
-public class ServersView extends CommonNavigator {
+public class ServersView2 extends CommonNavigator {
protected CommonViewer tableViewer;
@@ -96,28 +56,33 @@
protected Action actionModifyModules;
protected Action openAction, showInConsoleAction, showInDebugAction, propertiesAction, monitorPropertiesAction;
protected Action copyAction, pasteAction, deleteAction, renameAction;
-
+
/**
* ServersView constructor comment.
*/
- public ServersView() {
+ public ServersView2() {
super();
}
@Override
public void createPartControl(Composite parent) {
- super.createPartControl(parent);
+ clipboard = new Clipboard(Display.getCurrent());
- clipboard = new Clipboard(getCommonViewer().getControl().getDisplay());
+ super.createPartControl(parent);
deferInitialization();
}
+ @Override
+ protected void updateTitle() {
+ // nothing to do
+ }
+
private void deferInitialization() {
TreeItem item = new TreeItem(getCommonViewer().getTree(), SWT.NONE);
item.setText(Messages.viewInitializing);
- initializeActions(getCommonViewer());
+ //initializeActions(getCommonViewer());
Job job = new Job(Messages.jobInitializingServersView) {
public IStatus run(IProgressMonitor monitor) {
@@ -125,10 +90,6 @@
int size = servers.length;
for (int i = 0; i < size; i++) {
((Server)servers[i]).getAllModules().iterator();
- /*while (iterator.hasNext()) {
- Module module = (Module) iterator.next();
- module.g
- }*/
}
@@ -154,24 +115,9 @@
// TODO Angel says: What to do here?
//tableViewer.initialize();
- // TODO Angel says: This probably shouldn't be here
+ // TODO Angel says: is this the best place for this?
tableViewer = getCommonViewer();
- 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.SEVERE, "Could not open server", e);
- }
- }
- });
-
MenuManager menuManager = new MenuManager("#PopupMenu");
menuManager.setRemoveAllWhenShown(true);
final Shell shell = tableViewer.getTree().getShell();
@@ -267,8 +213,7 @@
MenuManager showInMenu = new MenuManager(text);
showInMenu.add(showInConsoleAction);
showInMenu.add(showInDebugAction);
- //IActionBars actionBars = getViewSite().getActionBars();
- //actionBars.setGlobalActionHandler("group.show", showInMenu);
+
menu.add(showInMenu);
menu.add(new Separator());
} else
@@ -352,12 +297,67 @@
}
- /**
- * Initialize actions
- *
- * @param provider a selection provider
- */
- public void initializeActions(ISelectionProvider provider) {
+// /**
+// * Initialize actions
+// *
+// * @param provider a selection provider
+// */
+// public void initializeActions(ISelectionProvider provider) {
+// Shell shell = getSite().getShell();
+// IActionBars actionBars = getViewSite().getActionBars();
+//
+// actions = new Action[6];
+// // create the start actions
+// actions[0] = new StartAction(shell, provider, ILaunchManager.DEBUG_MODE);
+// actionBars.setGlobalActionHandler("org.eclipse.wst.server.debug", actions[0]);
+// actions[1] = new StartAction(shell, provider, ILaunchManager.RUN_MODE);
+// actionBars.setGlobalActionHandler("org.eclipse.wst.server.run", actions[1]);
+// actions[2] = new StartAction(shell, provider, ILaunchManager.PROFILE_MODE);
+//
+// // create the stop action
+// actions[3] = new StopAction(shell, provider);
+// actionBars.setGlobalActionHandler("org.eclipse.wst.server.stop", actions[3]);
+//
+// // create the publish actions
+// actions[4] = new PublishAction(shell, provider);
+// actionBars.setGlobalActionHandler("org.eclipse.wst.server.publish", actions[4]);
+// actions[5] = new PublishCleanAction(shell, provider);
+//
+// // create the open action
+// openAction = new OpenAction(provider);
+// actionBars.setGlobalActionHandler("org.eclipse.ui.navigator.Open", openAction);
+//
+// // 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, getCommonViewer(), provider);
+// actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(), copyAction);
+// actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(), pasteAction);
+// actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), deleteAction);
+// actionBars.setGlobalActionHandler(ActionFactory.RENAME.getId(), renameAction);
+//
+// // 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);
+// actionBars.setGlobalActionHandler(ActionFactory.PROPERTIES.getId(), propertiesAction);
+// monitorPropertiesAction = new PropertiesAction(shell, "org.eclipse.wst.server.ui.properties.monitor", provider);
+//
+// // add toolbar buttons
+// IContributionManager cm = actionBars.getToolBarManager();
+// for (int i = 0; i < actions.length - 1; i++)
+// cm.add(actions[i]);
+//
+// cm.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
+// }
+
+ @Override
+ protected ActionGroup createCommonActionGroup() {
+ CommonViewer provider = getCommonViewer();
Shell shell = getSite().getShell();
IActionBars actionBars = getViewSite().getActionBars();
@@ -408,6 +408,24 @@
cm.add(actions[i]);
cm.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
+
+ INavigatorViewerDescriptor viewDescriptor = getCommonViewer().getNavigatorContentService().getViewerDescriptor();
+
+ return super.createCommonActionGroup();
+ }
+
+ @Override
+ protected void handleDoubleClick(DoubleClickEvent anEvent) {
+ try {
+ IStructuredSelection sel = (IStructuredSelection) anEvent.getSelection();
+ Object data = sel.getFirstElement();
+ if (!(data instanceof IServer))
+ return;
+ IServer server = (IServer) data;
+ ServerUIPlugin.editServer(server);
+ } catch (Exception e) {
+ Trace.trace(Trace.SEVERE, "Could not open server", e);
+ }
}
}