[107428] Fix add/remove project wizard enablement and delete unused classes
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/TomcatRuntimeWizardFragment.java b/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/TomcatRuntimeWizardFragment.java
index 4bf8c3f..5f13289 100644
--- a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/TomcatRuntimeWizardFragment.java
+++ b/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/TomcatRuntimeWizardFragment.java
@@ -24,7 +24,7 @@
*/
public class TomcatRuntimeWizardFragment extends WizardFragment {
protected TomcatRuntimeComposite comp;
-
+
public TomcatRuntimeWizardFragment() {
// do nothing
}
@@ -32,14 +32,14 @@
public boolean hasComposite() {
return true;
}
-
+
public boolean isComplete() {
IRuntimeWorkingCopy runtime = (IRuntimeWorkingCopy) getTaskModel().getObject(TaskModel.TASK_RUNTIME);
if (runtime == null)
return false;
IStatus status = runtime.validate(null);
- return (status != null && status.getSeverity() != IStatus.ERROR);
+ return (status == null || status.getSeverity() != IStatus.ERROR);
}
/* (non-Javadoc)
diff --git a/plugins/org.eclipse.wst.server.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.wst.server.ui/META-INF/MANIFEST.MF
index 388a242..6da5e2b 100644
--- a/plugins/org.eclipse.wst.server.ui/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.wst.server.ui/META-INF/MANIFEST.MF
@@ -14,7 +14,6 @@
org.eclipse.wst.server.ui.internal.editor;x-internal:=true,
org.eclipse.wst.server.ui.internal.provisional;x-internal:=true,
org.eclipse.wst.server.ui.internal.view.servers;x-internal:=true,
- org.eclipse.wst.server.ui.internal.view.tree;x-internal:=true,
org.eclipse.wst.server.ui.internal.viewers;x-internal:=true,
org.eclipse.wst.server.ui.internal.wizard;x-internal:=true,
org.eclipse.wst.server.ui.internal.wizard.fragment;x-internal:=true,
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerTreeContentProvider.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerTreeContentProvider.java
deleted file mode 100644
index c1d42ff..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerTreeContentProvider.java
+++ /dev/null
@@ -1,294 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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;
-
-import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.wst.server.core.*;
-import org.eclipse.wst.server.ui.internal.view.tree.ModuleResourceAdapter;
-import org.eclipse.wst.server.ui.internal.view.tree.ServerElementAdapter;
-import org.eclipse.wst.server.ui.internal.view.tree.TextResourceAdapter;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.model.IWorkbenchAdapter;
-/**
- * Provides tree contents for objects that have the IWorkbenchAdapter
- * adapter registered.
- */
-public class ServerTreeContentProvider implements ITreeContentProvider {
- protected TreeViewer viewer;
-
- // listeners
- protected LifecycleListener listener;
- //protected IServerListener serverListener;
- protected IResourceChangeListener resourceChangeListener;
-
- class LifecycleListener implements IServerLifecycleListener {
- public void serverAdded(final IServer server) {
- //server.addServerListener(serverListener);
- Display.getDefault().syncExec(new Runnable() {
- public void run() {
- handleServerResourceAdded(server);
- }
- });
- }
- public void serverRemoved(final IServer server) {
- //server.removeServerListener(serverListener);
- Display.getDefault().syncExec(new Runnable() {
- public void run() {
- handleServerResourceRemoved(server);
- }
- });
- }
- public void serverChanged(final IServer server) {
- Display.getDefault().syncExec(new Runnable() {
- public void run() {
- handleServerResourceChanged(server);
- }
- });
- }
- }
-
- /**
- *
- */
- public ServerTreeContentProvider() {
- // add listeners
- addServerResourceListener();
- addServerListener();
- }
-
- public Object[] getServerTreeRoots(Object parent) {
- /*looseConfig = getLooseConfigurations();
- if (looseConfig.length == 0)
- return new Object[] { new TextResourceAdapter(parent, TextResourceAdapter.STYLE_SERVERS) };
- else*/
- return new Object[] { new TextResourceAdapter(parent, TextResourceAdapter.STYLE_SERVERS) };
- //new TextResourceAdapter(parent, TextResourceAdapter.STYLE_LOOSE_CONFIGURATIONS) };
- }
-
- /* (non-Javadoc)
- * Method declared on IContentProvider.
- */
- public void dispose() {
- // remove listeners
- /*IServer[] servers = ServerCore.getServers();
- if (servers != null) {
- int size = servers.length;
- for (int i = 0; i < size; i++)
- servers[i].removeServerListener(serverListener);
- }*/
-
- ServerCore.removeServerLifecycleListener(listener);
- }
-
- /**
- * Returns the implementation of IWorkbenchAdapter for the given
- * object. Returns null if the adapter is not defined or the
- * object is not adaptable.
- */
- protected IWorkbenchAdapter getAdapter(Object o) {
- if (!(o instanceof IAdaptable))
- return null;
-
- return (IWorkbenchAdapter)((IAdaptable)o).getAdapter(IWorkbenchAdapter.class);
- }
-
- /* (non-Javadoc)
- * Method declared on ITreeContentProvider.
- */
- public Object[] getChildren(Object element) {
- if (element instanceof TextResourceAdapter) {
- TextResourceAdapter adapter = (TextResourceAdapter) element;
- Object[] children = adapter.getChildren(null);
- if (children != null) {
- int size = children.length;
- for (int i = 0; i < size; i++) {
- if (children[i] instanceof ServerElementAdapter) {
- ServerElementAdapter adapter2 = (ServerElementAdapter) children[i];
- adapter2.setFlags((byte) 1);
- }
- }
- }
- return children;
- } else if (element instanceof ModuleResourceAdapter) {
- ModuleResourceAdapter adapter = (ModuleResourceAdapter) element;
- return adapter.getChildren(null);
- } else if (element instanceof ServerElementAdapter) {
- ServerElementAdapter adapter = (ServerElementAdapter) element;
- return adapter.getChildren();
- }
-
- IWorkbenchAdapter adapter = getAdapter(element);
- if (adapter != null)
- return adapter.getChildren(element);
-
- return new Object[0];
- }
-
- /* (non-Javadoc)
- * Method declared on IStructuredContentProvider.
- */
- public Object[] getElements(Object element) {
- return getChildren(element);
- }
-
- /* (non-Javadoc)
- * Method declared on ITreeContentProvider.
- */
- public Object getParent(Object element) {
- IWorkbenchAdapter adapter = getAdapter(element);
- if (adapter != null)
- return adapter.getParent(element);
-
- return null;
- }
-
- /* (non-Javadoc)
- * Method declared on ITreeContentProvider.
- */
- public boolean hasChildren(Object element) {
- return getChildren(element).length > 0;
- }
-
- /* (non-Javadoc)
- * Method declared on IContentProvider.
- */
- public void inputChanged(Viewer newViewer, Object oldInput, Object newInput) {
- if (newViewer instanceof TreeViewer)
- this.viewer = (TreeViewer) newViewer;
- }
-
- /**
- * Add listeners for resource changes.
- */
- private void addServerListener() {
- // add a listener for configuration child module changes
- /*serverListener = new IServerListener() {
- public void modulesChanged(final IServer server) {
- Display.getDefault().syncExec(new Runnable() {
- public void run() {
- handleServerModulesChanged(server);
- }
- });
- }
- };
-
- IServer[] servers = ServerCore.getServers();
- if (servers != null) {
- int size = servers.length;
- for (int i = 0; i < size; i++)
- servers[i].addServerListener(serverListener);
- }*/
- }
-
- /**
- * Add listeners for server resource changes.
- */
- private void addServerResourceListener() {
- // add a listener for resources being added or removed
- listener = new LifecycleListener();
- ServerCore.addServerLifecycleListener(listener);
- }
-
- /**
- * Updates a server in the tree.
- *
- * @param server2 a server
- */
- protected void handleServerModulesChanged(IServer server2) {
- if (viewer != null) {
- viewer.refresh(new ServerElementAdapter(null, server2));
- IServer[] servers = ServerCore.getServers();
- if (servers != null) {
- int size = servers.length;
- for (int i = 0; i < size; i++) {
- if (server2.equals(servers[i])) {
- viewer.refresh(new ServerElementAdapter(null, servers[i]));
- }
- }
- }
- }
- }
-
- /**
- * Handles the add of a new server resource.
- *
- * @param element
- */
- protected void handleServerResourceAdded(Object element) {
- //Trace.trace("add: " + element);
- if (viewer == null)
- return;
-
- ServerElementAdapter adapter = new ServerElementAdapter(null, element);
- adapter.setFlags((byte) 1);
- if (element instanceof IServer) {
- viewer.add(new TextResourceAdapter(null, TextResourceAdapter.STYLE_SERVERS), adapter);
- }
- }
-
- /**
- * Updates an element in the tree.
- *
- * @param element
- */
- protected void handleServerResourceChanged(Object element) {
- //Trace.trace("change: " + element);
- if (viewer == null)
- return;
-
- if (element instanceof IServer) {
- ServerElementAdapter adapter = new ServerElementAdapter(null, element);
- adapter.setFlags((byte) 1);
- viewer.refresh(adapter);
- }
- }
-
- /**
- * Handles the removal of a server resource.
- *
- * @param element
- */
- protected void handleServerResourceRemoved(Object element) {
- //Trace.trace("remove: " + element);
- if (viewer == null)
- return;
-
- TextResourceAdapter.deleted = element;
-
- if (element instanceof IServer) {
- //IServer server = (IServer) element;
- TextResourceAdapter adapter = new TextResourceAdapter(null, TextResourceAdapter.STYLE_SERVERS);
- viewer.refresh(adapter);
- /*IServerConfiguration configuration = Reference.getServerConfigurationByRef(server.getConfigurationRef());
-
- boolean used = false;
- Iterator iterator = ServerCore.getResourceManager().getServers().iterator();
- while (iterator.hasNext()) {
- IServer server2 = (IServer) iterator.next();
- if (!server.equals(server2)) {
- IServerConfiguration cfg = Reference.getServerConfigurationByRef(server2.getConfigurationRef());
- if (cfg != null && cfg.equals(configuration)) {
- used = true;
- }
- }
- }
- if (!used) {
- ServerLifecycleAdapter adapter2 = new ServerLifecycleAdapter(null, configuration);
- adapter2.setFlags((byte) 1);
- viewer.add(new TextResourceAdapter(null, TextResourceAdapter.STYLE_LOOSE_CONFIGURATIONS), adapter2);
- }*/
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/DeleteActionDelegate.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/DeleteActionDelegate.java
index 8ad4573..0835966 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/DeleteActionDelegate.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/DeleteActionDelegate.java
@@ -19,7 +19,6 @@
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.ui.internal.view.servers.DeleteAction;
-import org.eclipse.wst.server.ui.internal.view.tree.ServerElementAdapter;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkbenchWindowActionDelegate;
@@ -74,8 +73,6 @@
Object obj = iterator.next();
if (obj instanceof IServer)
list.add(obj);
- else if (obj instanceof ServerElementAdapter)
- list.add(((ServerElementAdapter) obj).getObject());
else {
action.setEnabled(false);
return;
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/tree/ServerTreeAction.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ServerAction.java
similarity index 76%
rename from plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/tree/ServerTreeAction.java
rename to plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ServerAction.java
index da4ef55..4500312 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/tree/ServerTreeAction.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ServerAction.java
@@ -8,26 +8,25 @@
* Contributors:
* IBM Corporation - Initial API and implementation
*******************************************************************************/
-package org.eclipse.wst.server.ui.internal.view.tree;
+package org.eclipse.wst.server.ui.internal.view.servers;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.wst.server.ui.internal.ServerTree;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.actions.SelectionProviderAction;
/**
*
*/
-public class ServerTreeAction extends SelectionProviderAction {
+public class ServerAction extends SelectionProviderAction {
protected Shell shell;
protected byte action;
- public ServerTreeAction(Shell shell, ISelectionProvider provider, String label, byte action) {
+ public ServerAction(Shell shell, ISelectionProvider provider, String label, byte action) {
super(provider, label);
this.shell = shell;
this.action = action;
- setEnabled(ServerTree.isActionEnabled(getSelection(), action));
+ setEnabled(ServerActionHelper.isActionEnabled(getSelection(), action));
}
/**
@@ -41,11 +40,11 @@
* @param selection the new selection
*/
public void selectionChanged(ISelection selection) {
- setEnabled(ServerTree.isActionEnabled(selection, action));
+ setEnabled(ServerActionHelper.isActionEnabled(selection, action));
}
public void selectionChanged(IStructuredSelection selection) {
- setEnabled(ServerTree.isActionEnabled(selection, action));
+ setEnabled(ServerActionHelper.isActionEnabled(selection, action));
}
/**
@@ -55,6 +54,6 @@
* or override <code>run(Event)</code> if they do.
*/
public void run() {
- ServerTree.performAction(shell, getSelection(), action);
+ ServerActionHelper.performAction(shell, getSelection(), action);
}
}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerTree.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ServerActionHelper.java
similarity index 62%
rename from plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerTree.java
rename to plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ServerActionHelper.java
index 0154199..d809716 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerTree.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ServerActionHelper.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM Corporation - Initial API and implementation
*******************************************************************************/
-package org.eclipse.wst.server.ui.internal;
+package org.eclipse.wst.server.ui.internal.view.servers;
import java.util.ArrayList;
import java.util.Iterator;
@@ -21,15 +21,14 @@
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.viewers.*;
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.actions.NewServerWizardAction;
-import org.eclipse.wst.server.ui.internal.view.servers.*;
-import org.eclipse.wst.server.ui.internal.view.tree.ServerElementAdapter;
-import org.eclipse.wst.server.ui.internal.view.tree.ServerTreeAction;
import org.eclipse.swt.widgets.Shell;
/**
*
*/
-public class ServerTree {
+public class ServerActionHelper {
/**
* Constants for actions
*/
@@ -37,7 +36,7 @@
public static final byte ACTION_DELETE = 1;
public static final byte ACTION_BOOKMARK = 2;
- private ServerTree() {
+ private ServerActionHelper() {
// do nothing
}
@@ -60,122 +59,6 @@
if (selection.isEmpty() || !(selection instanceof IStructuredSelection))
return;
-
- //IStructuredSelection sel = (IStructuredSelection) selection;
-
- //boolean singleSelect = (sel.size() == 1);
- //Object first = sel.getFirstElement();
-
- // open menu
- /*if (singleSelect && first instanceof ServerLifecycleAdapter) {
- ServerLifecycleAdapter adapter = (ServerLifecycleAdapter) first;
- IServerResource resource = adapter.getServerResource();
- menu.add(new OpenAction(resource));
- menu.add(new Separator());
- }
-
- // delete menu
- List list = new ArrayList();
- boolean canDelete = true;
- Iterator iterator2 = sel.iterator();
- while (iterator2.hasNext()) {
- Object obj = iterator2.next();
-
- if (obj instanceof ServerLifecycleAdapter)
- list.add(((ServerLifecycleAdapter) obj).getServerResource());
- else
- canDelete = false;
- }
- if (canDelete) {
- IServerResource[] res = new IServerResource[list.size()];
- list.toArray(res);
- menu.add(new DeleteAction(shell, res));
- }
-
- if (singleSelect && first instanceof IServerElementTag)
- menu.add(new Separator());
-
- if (singleSelect && first instanceof ServerLifecycleAdapter) {
- ServerLifecycleAdapter adapter = (ServerLifecycleAdapter) first;
- IServerResource resource = adapter.getServerResource();
-
- IServer server = null;
- if (resource instanceof IServer)
- server = (IServer) resource;
-
- // switch configuration menu
- if (server != null) {
- addServerActions(shell, menu, server);
-
- MenuManager menuManager = new MenuManager(Messages.actionSwitchConfiguration"));
- menuManager.add(new SwitchConfigurationAction(shell, Messages.viewNoConfiguration"), server, null));
-
- List configs = ServerUtil.getSupportedServerConfigurations(server);
- Iterator iterator = configs.iterator();
- while (iterator.hasNext()) {
- IServerConfiguration config = (IServerConfiguration) iterator.next();
- menuManager.add(new SwitchConfigurationAction(shell, ServerUtil.getName(config), server, config));
- }
-
- menu.add(menuManager);
- }
-
- if (server != null && server instanceof IModuleRestartable) {
- menu.add(new Separator());
-
- MenuManager restartProjectMenu = new MenuManager(Messages.actionRestartProject"));
-
- IModuleRestartable restartable = (IModuleRestartable) server;
-
- IServerConfiguration configuration = ServerUtil.getServerConfiguration(server);
- if (configuration != null) {
- Iterator iterator = ServerUtil.getAllContainedModules(configuration).iterator();
- while (iterator.hasNext()) {
- IModule module = (IModule) iterator.next();
- Action action = new RestartModuleAction(restartable, module);
- restartProjectMenu.add(action);
- }
- }
- if (restartProjectMenu.isEmpty())
- menu.add(new DisabledMenuManager(Messages.actionRestartProject")));
- else
- menu.add(restartProjectMenu);
- }
- }
- if (singleSelect && first instanceof ModuleResourceAdapter) {
- ModuleResourceAdapter adapter = (ModuleResourceAdapter) first;
- IServerConfiguration configuration = adapter.getServerConfiguration();
- IModule module = adapter.getModule();
-
- IModule[] modules = configuration.getModules();
- boolean found = false;
- if (modules != null && module != null) {
- int size = modules.length;
- for (int i = 0; i < size; i++) {
- if (module.equals(modules[i]) && configuration.canRemoveModule(module))
- found = true;
- }
- }
-
- if (found)
- menu.add(new ModifyConfigurationModulesAction(shell, configuration, module, false));
- }
-
- if (singleSelect && first instanceof ServerLifecycleAdapter) {
- ServerLifecycleAdapter adapter = (ServerLifecycleAdapter) first;
- IServerResource resource = adapter.getServerResource();
-
- IServer server = null;
- IServerConfiguration configuration = null;
- if (resource instanceof IServerConfiguration)
- configuration = (IServerConfiguration) resource;
- else if (resource instanceof IServer) {
- server = (IServer) resource;
- configuration = ServerUtil.getServerConfiguration(server);
- }
-
- ServerAction.addServerMenuItems(shell, menu, server, configuration);
- }*/
}
protected static void addServerActions(Shell shell, IMenuManager menu, IServer server) {
@@ -273,12 +156,7 @@
IStructuredSelection sel = (IStructuredSelection) selection;
if (action == ACTION_OPEN) {
- if (sel.size() != 1)
- return false;
-
- Object obj = sel.getFirstElement();
-
- return (obj instanceof ServerElementAdapter);
+ return false;
} else if (action == ACTION_DELETE) {
if (sel.size() == 0)
return false;
@@ -287,7 +165,7 @@
while (iterator.hasNext()) {
Object obj = iterator.next();
- if (!(obj instanceof ServerElementAdapter) && !(obj instanceof IServer))
+ if (!(obj instanceof IServer))
return false;
}
return true;
@@ -317,15 +195,6 @@
Action open = new OpenAction((IServer) obj);
open.run();
return true;
- } else if (obj instanceof ServerElementAdapter) {
- ServerElementAdapter adapter = (ServerElementAdapter) obj;
- Object element = adapter.getObject();
- if (element instanceof IServer) {
- Action open = new OpenAction((IServer) element);
- open.run();
- return true;
- }
- return false;
}
return false;
} else if (action == ACTION_DELETE) {
@@ -337,9 +206,7 @@
while (iterator.hasNext()) {
Object obj = iterator.next();
- if (obj instanceof ServerElementAdapter)
- list.add(((ServerElementAdapter) obj).getObject());
- else if (obj instanceof IServer)
+ if (obj instanceof IServer)
list.add(obj);
}
@@ -364,7 +231,7 @@
*/
public static IAction getAction(Shell shell, ISelectionProvider provider, byte action) {
if (action == ACTION_DELETE) {
- return new ServerTreeAction(shell, provider, Messages.actionDelete, ServerTree.ACTION_DELETE);
+ return new ServerAction(shell, provider, Messages.actionDelete, ServerActionHelper.ACTION_DELETE);
}
return null;
}
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ServerTableViewer.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ServerTableViewer.java
index 2358d6b..7310e62 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ServerTableViewer.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ServerTableViewer.java
@@ -20,9 +20,7 @@
import org.eclipse.wst.server.core.internal.IPublishListener;
import org.eclipse.wst.server.core.internal.PublishAdapter;
import org.eclipse.wst.server.core.internal.Server;
-import org.eclipse.wst.server.ui.internal.ServerTree;
import org.eclipse.wst.server.ui.internal.Trace;
-import org.eclipse.wst.server.ui.internal.view.tree.ServerTreeAction;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Tree;
@@ -234,7 +232,7 @@
addListeners();
IActionBars actionBars = view.getViewSite().getActionBars();
- actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), new ServerTreeAction(getControl().getShell(), this, "Delete it!", ServerTree.ACTION_DELETE));
+ actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), new ServerAction(getControl().getShell(), this, "Delete it!", ServerActionHelper.ACTION_DELETE));
// TODO: add default server listener
/*dsListener = new ISelectionListener() {
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ServersView.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ServersView.java
index dd36b8c..5e8361e 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ServersView.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ServersView.java
@@ -325,7 +325,7 @@
// new action
MenuManager newMenu = new MenuManager(Messages.actionNew);
- ServerTree.fillNewContextMenu(null, selection, newMenu);
+ ServerActionHelper.fillNewContextMenu(null, selection, newMenu);
menu.add(newMenu);
// open action
@@ -376,28 +376,10 @@
}
menu.add(new SwitchServerLocationAction(server));
}
-
+
if (server != null && module != null) {
menu.add(new Separator());
-
- /*MenuManager restartProjectMenu = new MenuManager(Messages.actionRestartProject"));
-
- if (server != null) {
- IModule[] modules = getAllContainedModules(server, null);
- if (modules != null) {
- int size = modules.length;
- for (int i = 0; i < size; i++) {
- Action action = new RestartModuleAction(server, modules[i]);
- restartProjectMenu.add(action);
- }
- }
- }
- if (restartProjectMenu.isEmpty())
- menu.add(new DisabledMenuManager(Messages.actionRestartProject")));
- else
- menu.add(restartProjectMenu);*/
- Action action = new RestartModuleAction(server, module);
- menu.add(action);
+ menu.add(new RestartModuleAction(server, module));
}
menu.add(new Separator());
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/tree/DisabledMenuManager.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/tree/DisabledMenuManager.java
deleted file mode 100644
index 905a4f8..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/tree/DisabledMenuManager.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.view.tree;
-
-import org.eclipse.jface.action.MenuManager;
-/**
- *
- */
-public class DisabledMenuManager extends MenuManager {
- public DisabledMenuManager(String label) {
- super(label);
- }
- public boolean isEnabled() {
- return false;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/tree/IServerElementTag.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/tree/IServerElementTag.java
deleted file mode 100644
index 10bc305..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/tree/IServerElementTag.java
+++ /dev/null
@@ -1,17 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.view.tree;
-/**
- * Tagging interface for identifying elements on a server tree.
- */
-public interface IServerElementTag {
- // marker
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/tree/ModuleResourceAdapter.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/tree/ModuleResourceAdapter.java
deleted file mode 100644
index 08b3744..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/tree/ModuleResourceAdapter.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.view.tree;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.internal.Server;
-import org.eclipse.wst.server.ui.ServerUICore;
-import org.eclipse.wst.server.ui.internal.ServerLabelProvider;
-import org.eclipse.ui.model.IWorkbenchAdapter;
-/**
- *
- */
-public class ModuleResourceAdapter implements IAdaptable, IWorkbenchAdapter, IServerElementTag {
- private static final Object[] NO_CHILDREN = new Object[0];
-
- protected IServer server;
- protected IModule module;
- protected Object parent;
-
- public ModuleResourceAdapter(Object parent, IServer server, IModule module) {
- super();
- this.parent = parent;
- this.server = server;
- this.module = module;
- }
-
- /*
- * @see IAdaptable#getAdapter(Class)
- */
- public Object getAdapter(Class adapter) {
- if (adapter.equals(IAdaptable.class))
- return this;
- else if (adapter.equals(IWorkbenchAdapter.class))
- return this;
- else
- return Platform.getAdapterManager().getAdapter(this, adapter);
- }
-
- /*
- * @see IWorkbenchAdapter#getChildren(Object)
- */
- public Object[] getChildren(Object o) {
- //IModule[] childModules = server.getChildModules(module, null);
- //if (childModules == null)
- return NO_CHILDREN;
-
- /*List child = new ArrayList();
- if (childModules != null) {
- int size = childModules.length;
- for (int i = 0; i < size; i++)
- child.add(new ModuleResourceAdapter(this, server, childModules[i]));
- }
-
- ModuleResourceAdapter[] adapters = new ModuleResourceAdapter[child.size()];
- child.toArray(adapters);
- return adapters;*/
- }
-
- /*
- * @see IWorkbenchAdapter#getImageDescriptor(Object)
- */
- public ImageDescriptor getImageDescriptor(Object object) {
- return ((ServerLabelProvider)ServerUICore.getLabelProvider()).getImageDescriptor(module);
- }
-
- /*
- * @see IWorkbenchAdapter#getLabel(Object)
- */
- public String getLabel(Object o) {
- if (module == null)
- return "";
-
- return module.getName();
- }
-
- /*
- * @see IWorkbenchAdapter#getParent(Object)
- */
- public Object getParent(Object o) {
- return parent;
- }
-
- public IModule getModules() {
- return module;
- }
-
- public IServer getServer() {
- return server;
- }
-
- public int hashCode() {
- int hash = 0;
- if (server != null) {
- IFile file = ((Server)server).getFile();
- if (file != null)
- hash = file.hashCode();
- }
- if (module != null)
- hash += module.hashCode();
- return hash;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/tree/ServerElementAdapter.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/tree/ServerElementAdapter.java
deleted file mode 100644
index 440cac1..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/tree/ServerElementAdapter.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.view.tree;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.internal.Server;
-import org.eclipse.wst.server.ui.ServerUICore;
-import org.eclipse.wst.server.ui.internal.ServerLabelProvider;
-import org.eclipse.ui.model.IWorkbenchAdapter;
-/**
- *
- */
-public class ServerElementAdapter implements IAdaptable, IWorkbenchAdapter, IServerElementTag {
- private static final Object[] NO_CHILDREN = new Object[0];
-
- protected Object resource;
- protected Object parent;
- protected byte flags;
-
- public ServerElementAdapter(Object parent, Object resource) {
- this.parent = parent;
- this.resource = resource;
- }
-
- public void setFlags(byte b) {
- flags = b;
- }
-
- public byte getFlags() {
- return flags;
- }
-
- /*
- * @see IAdaptable#getAdapter(Class)
- */
- public Object getAdapter(Class adapter) {
- if (adapter.equals(IAdaptable.class))
- return this;
- else if (adapter.equals(IWorkbenchAdapter.class))
- return this;
- /*else if (adapter.equals(IResource.class)) {
- IResourceManager rm = ServerCore.getResourceManager();
- return rm.getServerResourceLocation(resource);
- }*/
- else
- return Platform.getAdapterManager().getAdapter(this, adapter);
- }
-
- public Object[] getChildren(Object o) {
- return NO_CHILDREN;
- }
-
- /*
- * @see IWorkbenchAdapter#getChildren(Object)
- */
- public Object[] getChildren() {
- if (resource instanceof IServer) {
- IServer server = (IServer) resource;
-
- IModule[] modules = server.getModules();
- if (modules == null || modules.length == 0) {
- //return new Object[] { new TextResourceAdapter(this, TextResourceAdapter.STYLE_NO_MODULES)};
- return NO_CHILDREN;
- }
- int size = modules.length;
- Object[] obj = new Object[size];
- for (int i = 0; i < size; i++)
- obj[i] = new ModuleResourceAdapter(this, server, modules[i]);
-
- return obj;
- }/* else if (resource instanceof IServerConfiguration) {
- IServerConfiguration configuration = (IServerConfiguration) resource;
-
- List list = new ArrayList();
-
- // add modules
- IModule[] modules = server.getModules();
- if (modules == null || modules.length == 0) {
- //list.add(new TextResourceAdapter(this, TextResourceAdapter.STYLE_NO_MODULES));
- } else {
- int size = modules.length;
- for (int i = 0; i < size; i++)
- list.add(new ModuleResourceAdapter(this, configuration, modules[i]));
- }
-
- Object[] obj = new Object[list.size()];
- list.toArray(obj);
- return obj;
- }*/
- return NO_CHILDREN;
- }
-
- /*
- * @see IWorkbenchAdapter#getImageDescriptor(Object)
- */
- public ImageDescriptor getImageDescriptor(Object object) {
- /*try {
- IServerResourceFactory factory = ServerUtil.getServerResourceFactory(resource);
- String icon = factory.getConfigurationElement().getAttribute("icon");
- URL url = factory.getConfigurationElement().getDeclaringExtension().getDeclaringPluginDescriptor().getInstallURL();
- return ImageDescriptor.createFromURL(new URL(url, icon));
- } catch (Exception e) {
- Trace.trace("Error getting image descriptor", e);
- }*/
- return ((ServerLabelProvider)ServerUICore.getLabelProvider()).getImageDescriptor(resource);
- }
-
- /*
- * @see IWorkbenchAdapter#getLabel(Object)
- */
- public String getLabel(Object o) {
- return ServerUICore.getLabelProvider().getText(resource);
- }
-
- /*
- * @see IWorkbenchAdapter#getParent(Object)
- */
- public Object getParent(Object o) {
- return parent;
- }
-
- public Object getObject() {
- return resource;
- }
-
- protected IFile getFile() {
- if (resource instanceof IServer)
- return ((Server) resource).getFile();
- return null;
- }
-
- public boolean equals(Object obj) {
- if (!(obj instanceof ServerElementAdapter))
- return false;
-
- ServerElementAdapter adapter = (ServerElementAdapter) obj;
- IFile file1 = getFile();
- IFile file2 = adapter.getFile();
- return ((file1 == null && file2 == null)) ||
- (file1 != null && file1.equals(file2));
- }
-
- public int hashCode() {
- return getFile().hashCode();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/tree/ServerRootAdapter.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/tree/ServerRootAdapter.java
deleted file mode 100644
index f26f5d4..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/tree/ServerRootAdapter.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.view.tree;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.model.IWorkbenchAdapter;
-/**
- *
- */
-public class ServerRootAdapter implements IAdaptable, IWorkbenchAdapter {
- protected Object[] children;
-
- public ServerRootAdapter() {
- // do nothing
- }
-
- public void setChildren(Object[] obj) {
- children = obj;
- }
-
- /*
- * @see IAdaptable#getAdapter(Class)
- */
- public Object getAdapter(Class adapter) {
- if (adapter.equals(IAdaptable.class))
- return this;
- else if (adapter.equals(IWorkbenchAdapter.class))
- return this;
- else
- return Platform.getAdapterManager().getAdapter(this, adapter);
- }
-
- /*
- * @see IWorkbenchAdapter#getChildren(Object)
- */
- public Object[] getChildren(Object o) {
- return children;
- }
-
- /*
- * @see IWorkbenchAdapter#getImageDescriptor(Object)
- */
- public ImageDescriptor getImageDescriptor(Object object) {
- return null;
- }
-
- /*
- * @see IWorkbenchAdapter#getLabel(Object)
- */
- public String getLabel(Object o) {
- return "Server Root";
- }
-
- /*
- * @see IWorkbenchAdapter#getParent(Object)
- */
- public Object getParent(Object o) {
- return null;
- }
-
- public boolean equals(Object obj) {
- if (!(obj instanceof ServerRootAdapter))
- return false;
-
- ServerRootAdapter adapter = (ServerRootAdapter) obj;
- return (adapter.children.equals(children));
- }
-
- public int hashCode() {
- return 0;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/tree/SwitchConfigurationAction.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/tree/SwitchConfigurationAction.java
deleted file mode 100644
index acf1cb7..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/tree/SwitchConfigurationAction.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.view.tree;
-
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.dialogs.ProgressMonitorDialog;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.IServerWorkingCopy;
-import org.eclipse.wst.server.ui.ServerUICore;
-import org.eclipse.wst.server.ui.internal.*;
-import org.eclipse.swt.widgets.Shell;
-/**
- * Action to add or remove configuration to/from a server.
- */
-public class SwitchConfigurationAction extends Action {
- protected IServer server;
- protected IFolder config;
- protected Shell shell;
- protected IStatus status;
-
- /**
- * SwitchConfigurationAction constructor.
- *
- * @param shell a shell
- * @param label a label
- * @param server a server
- * @param config a server configuration
- */
- public SwitchConfigurationAction(Shell shell, String label, IServer server, IFolder config) {
- super(label);
- this.shell = shell;
- this.server = server;
- this.config = config;
-
- IFolder tempConfig = server.getServerConfiguration();
- if ((tempConfig == null && config == null) || (tempConfig != null && tempConfig.equals(config)))
- setChecked(true);
-
- if (config == null)
- setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_SERVER_CONFIGURATION_NONE));
- else
- setImageDescriptor(((ServerLabelProvider)ServerUICore.getLabelProvider()).getImageDescriptor(config));
-
- if (server.getServerState() != IServer.STATE_STOPPED)
- setEnabled(false);
- }
-
- public void run() {
- IFolder tempConfig = server.getServerConfiguration();
- if ((tempConfig == null && config == null) || (tempConfig != null && tempConfig.equals(config)))
- return;
-
- if (!EclipseUtil.validateEdit(shell, server))
- return;
-
- IRunnableWithProgress runnable = new IRunnableWithProgress() {
- public void run(IProgressMonitor monitor) {
- try {
- monitor = ProgressUtil.getMonitorFor(monitor);
- IServerWorkingCopy workingCopy = server.createWorkingCopy();
- workingCopy.setServerConfiguration(config);
- workingCopy.save(false, monitor);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not save configuration", e);
- }
- }
- };
-
- try {
- ProgressMonitorDialog dialog = new ProgressMonitorDialog(shell);
- dialog.run(true, true, runnable);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error switching server configuration", e);
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/tree/TextResourceAdapter.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/tree/TextResourceAdapter.java
deleted file mode 100644
index 449a9e5..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/tree/TextResourceAdapter.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.view.tree;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.wst.server.core.ServerCore;
-import org.eclipse.wst.server.ui.internal.ImageResource;
-import org.eclipse.wst.server.ui.internal.Messages;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.ui.model.IWorkbenchAdapter;
-/**
- *
- */
-public class TextResourceAdapter implements IAdaptable, IWorkbenchAdapter, IServerElementTag {
- protected Object parent;
- protected byte thisStyle;
-
- public static Object deleted;
-
- public final static byte STYLE_SERVERS = 0;
- public final static byte STYLE_NO_MODULES = 4;
- public final static byte STYLE_NO_SERVERS = 5;
-
- public TextResourceAdapter(Object parent, byte thisStyle) {
- this.parent = parent;
- this.thisStyle = thisStyle;
- }
-
- public byte getStyle() {
- return thisStyle;
- }
-
- public void setStyle(byte b) {
- thisStyle = b;
- }
-
- /*
- * @see IAdaptable#getAdapter(Class)
- */
- public Object getAdapter(Class adapter) {
- if (adapter.equals(IAdaptable.class))
- return this;
- else if (adapter.equals(IWorkbenchAdapter.class))
- return this;
- else
- return Platform.getAdapterManager().getAdapter(this, adapter);
- }
-
- /*
- * @see IWorkbenchAdapter#getChildren(Object)
- */
- public Object[] getChildren(Object o) {
- if (thisStyle == STYLE_NO_MODULES || thisStyle == STYLE_NO_SERVERS)
- return new Object[0];
- /*else if (thisStyle == STYLE_SERVERS_AND_CONFIGURATIONS)
- return new Object[] {
- new TextResourceAdapter(this, STYLE_SERVERS),
- new TextResourceAdapter(this, STYLE_CONFIGURATIONS)
- };*/
-
- Object[] elements = null;
- if (thisStyle == STYLE_SERVERS)
- elements = ServerCore.getServers();
-
- List list = new ArrayList();
- if (elements != null) {
- int size = elements.length;
- for (int i = 0; i < size; i++) {
- if (elements[i] != deleted)
- list.add(new ServerElementAdapter(this, elements[i]));
- }
- }
- return list.toArray();
- }
-
- /*
- * @see IWorkbenchAdapter#getImageDescriptor(Object)
- */
- public ImageDescriptor getImageDescriptor(Object object) {
- if (thisStyle == STYLE_SERVERS)
- return null;
- //else if (thisStyle == STYLE_SERVERS_AND_CONFIGURATIONS)
- // return ServerImageResource.getImageDescriptor(ServerImageResource.IMG_SERVER_PROJECT);
- //else if (thisStyle == STYLE_NO_CONFIGURATION)
- // return ServerImageResource.getImageDescriptor(ServerImageResource.IMG_SERVER_CONFIGURATION_NONE);
- else if (thisStyle == STYLE_NO_MODULES) {
- ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages();
- return sharedImages.getImageDescriptor(IDE.SharedImages.IMG_OBJ_PROJECT);
- }
- else if (thisStyle == STYLE_NO_SERVERS)
- return ImageResource.getImageDescriptor(ImageResource.IMG_SERVER_CONFIGURATION_MISSING);
- else
- return null;
- }
-
- /*
- * @see IWorkbenchAdapter#getLabel(Object)
- */
- public String getLabel(Object o) {
- if (thisStyle == STYLE_SERVERS)
- return Messages.viewServers;
- //else if (thisStyle == STYLE_SERVERS_AND_CONFIGURATIONS)
- // return "Server Info";
- //else if (thisStyle == STYLE_NO_CONFIGURATION)
- // return "No configuration";
- else if (thisStyle == STYLE_NO_MODULES)
- return Messages.viewNoModules;
- //else if (thisStyle == STYLE_NO_SERVERS)
- // return Messages.viewConfigurationUnused;
- else
- return "n/a";
- }
-
- /*
- * @see IWorkbenchAdapter#getParent(Object)
- */
- public Object getParent(Object o) {
- return parent;
- }
-
- public boolean equals(Object obj) {
- if (!(obj instanceof TextResourceAdapter))
- return false;
-
- TextResourceAdapter adapter = (TextResourceAdapter) obj;
- return (adapter.getStyle() == thisStyle);
- }
-
- public int hashCode() {
- return thisStyle;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/ImportServerConfigurationWizard.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/ImportServerConfigurationWizard.java
deleted file mode 100644
index f14da00..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/ImportServerConfigurationWizard.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.wizard;
-
-import org.eclipse.wst.server.ui.internal.Messages;
-import org.eclipse.wst.server.ui.internal.wizard.page.ImportConfigurationWizardPage;
-import org.eclipse.wst.server.ui.internal.wizard.page.WizardUtil;
-import org.eclipse.ui.IImportWizard;
-/**
- * A wizard to import existing server configurations.
- */
-public class ImportServerConfigurationWizard extends AbstractWizard implements IImportWizard {
- protected ImportConfigurationWizardPage page;
-
- /**
- * ImportServerConfiguration constructor comment.
- */
- public ImportServerConfigurationWizard() {
- super();
- setWindowTitle(Messages.wizImportConfigurationWizardTitle);
- }
-
- public void addPages() {
- page = new ImportConfigurationWizardPage();
- page.setDefaultContainer(WizardUtil.getSelectionContainer(selection));
- addPage(page);
- }
-
- public boolean performFinish() {
- return page.performFinish();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/TaskWizardPage.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/TaskWizardPage.java
index 26c64b8..02658ff 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/TaskWizardPage.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/TaskWizardPage.java
@@ -57,23 +57,31 @@
}
public boolean isPageComplete() {
+ //if (isEmptyError)
+ // return false;
try {
if (!fragment.isComplete())
return false;
} catch (Exception e) {
return false;
}
- if (isEmptyError)
- return false;
- return (getMessage() == null || getMessageType() != ERROR);
+ //return (getMessage() == null || getMessageType() != ERROR);
+ return true;
}
public boolean canFlipToNextPage() {
if (getNextPage() == null)
return false;
- if (isEmptyError)
+ //if (isEmptyError)
+ // return false;
+ try {
+ if (!fragment.isComplete())
+ return false;
+ } catch (Exception e) {
return false;
- return (getMessage() == null || getMessageType() != ERROR);
+ }
+ return true;
+ //return (getMessage() == null || getMessageType() != ERROR);
}
public void setVisible(boolean visible) {
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/fragment/ModifyModulesWizardFragment.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/fragment/ModifyModulesWizardFragment.java
index 2a04e4d..594974f 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/fragment/ModifyModulesWizardFragment.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/fragment/ModifyModulesWizardFragment.java
@@ -113,7 +113,7 @@
taskModel.putObject(TaskModel.TASK_MODULES, moduleList);
}
}
-
+
public void performFinish(IProgressMonitor monitor) throws CoreException {
if (comp != null)
WizardTaskUtil.modifyModules(comp.getModulesToAdd(), comp.getModulesToRemove(), getTaskModel(), monitor);
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/ImportConfigurationWizardPage.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/ImportConfigurationWizardPage.java
deleted file mode 100644
index 734cc0f..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/ImportConfigurationWizardPage.java
+++ /dev/null
@@ -1,541 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.wizard.page;
-/*import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.*;
-import org.eclipse.jface.dialogs.Dialog;*/
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.jface.wizard.WizardPage;
-/*import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.FocusAdapter;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;*/
-import org.eclipse.swt.widgets.Composite;
-/*import org.eclipse.swt.widgets.DirectoryDialog;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.server.core.internal.ServerPlugin;
-import org.eclipse.wst.server.ui.ServerUICore;*/
-import org.eclipse.wst.server.ui.internal.*;
-/**
- * Wizard page to import a configuration.
- */
-public class ImportConfigurationWizardPage extends WizardPage {
- /*
- //protected IServerConfigurationType selectedConfigType;
- //protected IServerConfigurationWorkingCopy configuration;
- protected Combo serverProject;
- protected Button create;
- protected Text name;
- protected Text filename;
- //protected ServerConfigurationTypeComposite configTypeComposite;
- private Label description;
- protected Button browse;
- private IContainer defaultContainer;
-
- private String[] validationErrors = new String[5];
- private static final int INVALID_NAME = 0;
- private static final int INVALID_FOLDER = 1;
- private static final int INVALID_TYPE = 2;
- private static final int INVALID_FILENAME = 3;
- private static final int INVALID_IMPORT = 4;
-
- protected LoadThread thread;
- protected boolean threadDone;*/
-
- /*class LoadThread extends Thread {
- final int DELAY = 800;
- String filename2;
- IFile file;
- public void run() {
- boolean b = true;
- while (b) {
- try {
- sleep(DELAY);
- b = false;
- thread = null;
- } catch (InterruptedException ie) {
- // ignore
- }
- }
- try {
- performLoadConfiguration(file, filename2);
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- validatePage(INVALID_IMPORT);
- }
- });
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error importing configuration", e);
- }
- threadDone = true;
- }
- }*/
-
- /**
- * ImportConfigurationWizardPage constructor comment.
- */
- public ImportConfigurationWizardPage() {
- super("import configuration");
-
- setTitle(Messages.wizImportConfigurationTitle);
- setDescription(Messages.wizImportConfigurationDescription);
- setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_WIZBAN_IMPORT_SERVER_CONFIGURATION));
- }
-
- /**
- * Creates the UI part of the page. Subclasses must reimplement
- * this method to provide their own graphical page content.
- *
- * @param parent a parent composite
- */
- public void createControl(Composite parent) {
- initializeDialogUnits(parent);
- }
- /*
- Composite composite = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 3;
- layout.horizontalSpacing = convertHorizontalDLUsToPixels(4);
- layout.verticalSpacing = convertVerticalDLUsToPixels(4);
- layout.marginWidth = convertHorizontalDLUsToPixels(5);
- layout.marginHeight = convertVerticalDLUsToPixels(5);
- composite.setLayout(layout);
- GridData data = new GridData(GridData.FILL_BOTH);
- data.widthHint = convertHorizontalDLUsToPixels(500);
- data.heightHint = convertVerticalDLUsToPixels(470);
- WorkbenchHelp.setHelp(composite, ContextIds.IMPORT_CONFIGURATION_WIZARD);
-
- new Label(composite, SWT.NONE).setText(Messages.serverEditorOverviewServerConfigurationName"));
-
- name = new Text(composite, SWT.BORDER);
- data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 2;
- name.setLayoutData(data);
- name.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent me) {
- validateName();
- validatePage(INVALID_NAME);
- }
- });
- name.addFocusListener(new FocusAdapter() {
- public void focusGained(FocusEvent e) {
- validatePage(INVALID_NAME);
- }
- });
- WorkbenchHelp.setHelp(name, ContextIds.IMPORT_CONFIGURATION_NAME);
-
- // choose a server project
- new Label(composite, SWT.NONE).setText(Messages.wizFolder"));
- serverProject = new Combo(composite, SWT.BORDER);
- data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 2;
- serverProject.setLayoutData(data);
- if (defaultContainer != null)
- serverProject.setText(WizardUtil.getContainerText(defaultContainer));
- else if (serverProject.getItemCount() == 0)
- serverProject.setText(ServerPlugin.getResource("%defaultServerProjectName", ""));
-
- serverProject.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent me) {
- validateName();
- validateFolder();
- validatePage(INVALID_FOLDER);
- }
- });
- serverProject.addFocusListener(new FocusAdapter() {
- public void focusGained(FocusEvent e) {
- validatePage(INVALID_FOLDER);
- }
- });
- WorkbenchHelp.setHelp(serverProject, ContextIds.IMPORT_CONFIGURATION_FOLDER);
-
- configTypeComposite = new ServerConfigurationTypeComposite(composite, SWT.NONE, new ServerConfigurationTypeComposite.ServerConfigurationTypeSelectionListener() {
- public void configurationTypeSelected(IServerConfigurationType type) {
- handleFactorySelection(type);
- validateName();
- validatePage(INVALID_TYPE);
- }
- });
- data = new GridData(GridData.FILL_HORIZONTAL);
- data.heightHint = 130;
- data.horizontalSpan = 3;
- configTypeComposite.setLayoutData(data);
- WorkbenchHelp.setHelp(configTypeComposite, ContextIds.IMPORT_CONFIGURATION_FACTORY);
-
- Label label = new Label(composite, SWT.NONE);
- label.setText(Messages.wizDescription"));
- data = new GridData(GridData.VERTICAL_ALIGN_BEGINNING);
- label.setLayoutData(data);
-
- description = new Label(composite, SWT.WRAP);
- description.setText("");
- data = new GridData(GridData.FILL_HORIZONTAL);
- data.heightHint = 58;
- data.horizontalSpan = 2;
- description.setLayoutData(data);
-
- label = new Label(composite, SWT.NONE);
- label.setText(Messages.wizImportConfigurationLocation"));
-
- filename = new Text(composite, SWT.BORDER);
- data = new GridData(GridData.FILL_HORIZONTAL);
- data.widthHint = 300;
- filename.setLayoutData(data);
- filename.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent me) {
- handleFileSelection();
- validatePage(INVALID_TYPE);
- }
- });
- WorkbenchHelp.setHelp(filename, ContextIds.IMPORT_CONFIGURATION_LOCATION);
-
- browse = SWTUtil.createButton(composite, Messages.wizBrowse"));
- browse.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent se) {
- if (selectedConfigType == null)
- return;
- String[] filter = selectedConfigType.getImportFilterExtensions();
- if (filter != null) {
- int size = filter.length;
- String[] s = new String[size];
- for (int i = 0; i < size; i++) {
- if (!filter[i].startsWith("*."))
- s[i] = "*." + filter[i];
- else
- s[i] = filter[i];
- }
- FileDialog dialog = new FileDialog(getShell());
- dialog.setText(Messages.wizImportConfigurationFile"));
- dialog.setFilterPath(filename.getText());
- dialog.setFilterExtensions(s);
- String selectedFile = dialog.open();
- if (selectedFile != null)
- filename.setText(selectedFile);
- } else {
- DirectoryDialog dialog = new DirectoryDialog(getShell());
- dialog.setMessage(Messages.wizImportConfigurationDirectory"));
- dialog.setFilterPath(filename.getText());
- String selectedDirectory = dialog.open();
- if (selectedDirectory != null)
- filename.setText(selectedDirectory);
- }
- }
- });
- browse.setEnabled(false);
- data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- //data.widthHint = 75;
- data.heightHint = 22;
- browse.setLayoutData(data);
- WorkbenchHelp.setHelp(browse, ContextIds.IMPORT_CONFIGURATION_LOCATION_BROWSE);
-
- //fillFactoryTree();
- validationErrors[INVALID_TYPE] = "";
- validationErrors[INVALID_FILENAME] = "";
-
- ServerUIPreferences sp = (ServerUIPreferences) ServerUICore.getPreferences();
- if (sp.getImportLocation() != null) {
- filename.setText(sp.getImportLocation());
- handleFileSelection();
- validatePage(INVALID_TYPE);
- }
-
- setControl(composite);
- Dialog.applyDialogFont(composite);
- }*/
-
- /*protected void loadConfiguration() {
- if (thread != null) {
- try {
- thread.interrupt();
- thread.filename2 = filename.getText();
- IFile file = null;
- String theName = name.getText();
- if (theName != null && !theName.endsWith(IServerConfiguration.FILE_EXTENSION))
- theName += "." + IServerConfiguration.FILE_EXTENSION;
- String projectName = serverProject.getText();
- if (!"metadata".equals(projectName))
- file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(projectName).append(theName));
- thread.file = file;
- } catch (Exception e) {
- // ignore
- }
- } else {
- // try to avoid multiple threads
- if (!threadDone) {
- try {
- Thread.sleep(200);
- } catch (Exception e) {
- // ignore
- }
- }
- if (validationErrors[INVALID_TYPE] != null || validationErrors[INVALID_FILENAME] != null)
- return;
- thread = new LoadThread();
- thread.filename2 = filename.getText();
- IFile file = null;
- String theName = name.getText();
- if (theName != null && !theName.endsWith(IServerConfiguration.FILE_EXTENSION))
- theName += "." + IServerConfiguration.FILE_EXTENSION;
- String projectName = serverProject.getText();
- if (!"metadata".equals(projectName))
- file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(projectName).append(theName));
- thread.file = file;
- getContainer().updateButtons();
- threadDone = false;
- thread.start();
- }
- }*/
-
- /**
- * Handle the server factory selection.
- */
- /*protected void handleFactorySelection(IServerConfigurationType type) {
- validationErrors[INVALID_IMPORT] = null;
- configuration = null;
- selectedConfigType = type;
-
- validationErrors[INVALID_TYPE] = null;
-
- if (selectedConfigType == null) {
- browse.setEnabled(false);
- description.setText("");
- return;
- }
-
- try {
- String text = selectedConfigType.getDescription();
- if (text == null)
- text = "";
- description.setText(text);
- browse.setEnabled(true);
-
- loadConfiguration();
- } catch (Exception e) {
- validationErrors[INVALID_TYPE] = Messages.wizErrorImport");
- Trace.trace(Trace.SEVERE, "Could not import from " + filename.getText(), e);
- }
- }
-
- protected void handleFileSelection() {
- validationErrors[INVALID_IMPORT] = null;
- String text = filename.getText();
- if (text == null || text.length() == 0)
- validationErrors[INVALID_FILENAME] = "";
- else {
- validationErrors[INVALID_FILENAME] = null;
- loadConfiguration();
- }
- }
-
- protected void performLoadConfiguration(IFile file, String filename2) {
- try {
- try {
- configuration = selectedConfigType.importFromPath(null, file, new Path(filename2), new NullProgressMonitor());
- if (configuration == null)
- validationErrors[INVALID_IMPORT] = Messages.wizErrorImport");
- else
- validationErrors[INVALID_IMPORT] = null;
- } catch (CoreException ce) {
- IStatus status = ce.getStatus();
- if (status != null && status.getMessage() != null && status.getMessage().length() > 1)
- validationErrors[INVALID_IMPORT] = ce.getStatus().getMessage();
- else
- validationErrors[INVALID_IMPORT] = Messages.wizErrorImport");
- }
- } catch (Exception e) {
- validationErrors[INVALID_IMPORT] = Messages.wizErrorImport");
- Trace.trace(Trace.SEVERE, "Could not import from " + filename, e);
- }
- }*/
-
- /**
- * Return true if this page is complete.
- * @return boolean
- */
- /*public boolean isPageComplete() {
- // check for validation first
- for (int i = 0; i < validationErrors.length; i++) {
- if (validationErrors[i] != null)
- return false;
- }
-
- if (configuration == null)
- return false;
-
- if (thread != null)
- return false;
-
- // otherwise, defer to superclass
- return super.isPageComplete();
- }*/
-
- /**
- * Finish the wizard by saving the configuration into
- * the selected folder.
- * @return boolean
- */
- public boolean performFinish() {
- return true;
- }
- /*
- if (configuration == null)
- return false;
-
- ServerUIPreferences sp = (ServerUIPreferences) ServerUICore.getPreferences();
- sp.setImportLocation(filename.getText());
-
- try {
- final String theName = name.getText();
- IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- saveConfiguration(configuration, theName, new NullProgressMonitor());
- }
- };
-
- getWizard().getContainer().run(true, true, new WorkspaceRunnableAdapter(runnable));
-
- return true;
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error saving imported configuration", e);
- return false;
- }
- }*/
-
- /**
- * Save the element to the given file name.
- * @param element org.eclipse.wst.server.core.IServer
- * @param name java.lang.String
- * @param org.eclipse.core.runtime.IProgressMonitor monitor
- */
- /*protected void saveConfiguration(IServerConfigurationWorkingCopy config, String theName, IProgressMonitor monitor) throws CoreException {
- // save the element
- try {
- IFile file = config.getFile();
- if (file != null && !file.getProject().exists()) {
- IProject project = file.getProject();
- EclipseUtil.createNewServerProject(getShell(), project.getName(), null, monitor);
- }
- config.setName(theName);
- config.save(false, monitor);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error saving created element", e);
- throw new CoreException(new Status(IStatus.ERROR, ServerUIPlugin.PLUGIN_ID, 0, "Could not create server project", null));
- }
- }*/
-
- /**
- * Sets the default container.
- *
- * @param container
- */
- public void setDefaultContainer(IContainer container) {
- //defaultContainer = container;
- }
-
- /*public void setVisible(boolean visible) {
- super.setVisible(visible);
-
- if (visible) {
- // force the focus to initially validate the fields
- validateName();
- validateFolder();
- handleFactorySelection(null);
- validatePage(INVALID_NAME);
-
- name.forceFocus();
- }
- }*/
-
- /**
- * Validates the folder.
- */
- /*protected void validateFolder() {
- String text = serverProject.getText();
- if (text == null || text.length() == 0) {
- validationErrors[INVALID_FOLDER] = "";
- return;
- }
-
- validationErrors[INVALID_FOLDER] = WizardUtil.validateContainer(text);
- }*/
-
- /**
- * Validates the name.
- */
- /*protected void validateName() {
- String text = name.getText();
- if (text == null || text.length() == 0) {
- validationErrors[INVALID_NAME] = "";
- return;
- }
-
- IStatus status = ResourcesPlugin.getWorkspace().validateName(text, IResource.FILE);
- if (status.isOK())
- status = ResourcesPlugin.getWorkspace().validateName(text, IResource.FOLDER);
-
- if (!status.isOK())
- validationErrors[INVALID_NAME] = status.getMessage();
- else {
- // check if file exists
- String fileName = text;
- if (selectedConfigType != null) {
- String ext = IServerConfiguration.FILE_EXTENSION;
- if (ext != null && !fileName.endsWith("." + ext))
- fileName += "." + ext;
- }
-
- IContainer container = WizardUtil.findContainer(serverProject.getText());
- if (container != null && container.getLocation().append(fileName).toFile().exists()) {
- validationErrors[INVALID_NAME] = Messages.wizErrorResourceAlreadyExists");
- } else
- validationErrors[INVALID_NAME] = null;
- }
- }*/
-
- /**
- * Display the correct error message and enable/disable
- * the Finish or Next button.
- * @param x the current control (error message gets precedence)
- */
- /*protected void validatePage(int x) {
- if (x >= 0 && validationErrors[x] != null && validationErrors[x].length() > 0) {
- setErrorMessage(validationErrors[x]);
- getContainer().updateButtons();
- return;
- }
- int size = validationErrors.length;
- for (int i = 0; i < size; i++) {
- if (validationErrors[i] != null && validationErrors[i].length() > 0) {
- setErrorMessage(validationErrors[i]);
- getContainer().updateButtons();
- return;
- }
- }
- setErrorMessage(null);
- getContainer().updateButtons();
- }*/
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/ModifyModulesComposite.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/ModifyModulesComposite.java
index f9a6dce..bf441c9 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/ModifyModulesComposite.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/ModifyModulesComposite.java
@@ -611,14 +611,6 @@
wizard.update();
}
- /**
- * Return true if this page is complete.
- * @return boolean
- */
- public boolean isPageComplete() {
- return true;
- }
-
public List getModulesToRemove() {
List list = new ArrayList();
Iterator iterator = originalModules.iterator();