This commit was manufactured by cvs2svn to create tag 'v20050315'.
diff --git a/plugins/org.eclipse.jst.server.core/.classpath b/plugins/org.eclipse.jst.server.core/.classpath
deleted file mode 100644
index a74595e..0000000
--- a/plugins/org.eclipse.jst.server.core/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="sjavacore/"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/plugins/org.eclipse.jst.server.core/.cvsignore b/plugins/org.eclipse.jst.server.core/.cvsignore
deleted file mode 100644
index 8d1d585..0000000
--- a/plugins/org.eclipse.jst.server.core/.cvsignore
+++ /dev/null
@@ -1,5 +0,0 @@
-bin
-build.xml
-org.eclipse.jst.server.core_3.0.0.jar
-sjavacore.jar
-temp.folder
diff --git a/plugins/org.eclipse.jst.server.core/.options b/plugins/org.eclipse.jst.server.core/.options
deleted file mode 100644
index 7da2b54..0000000
--- a/plugins/org.eclipse.jst.server.core/.options
+++ /dev/null
@@ -1,4 +0,0 @@
-# Debugging options for the org.eclipse.jst.server.core plugin
-
-# Turn on general debugging
-org.eclipse.jst.server.core/debug=true
diff --git a/plugins/org.eclipse.jst.server.core/.project b/plugins/org.eclipse.jst.server.core/.project
deleted file mode 100644
index 7d5e17d..0000000
--- a/plugins/org.eclipse.jst.server.core/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jst.server.core</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/plugins/org.eclipse.jst.server.core/build.properties b/plugins/org.eclipse.jst.server.core/build.properties
deleted file mode 100644
index f87e0c4..0000000
--- a/plugins/org.eclipse.jst.server.core/build.properties
+++ /dev/null
@@ -1,19 +0,0 @@
-###############################################################################
-# Copyright (c) 2004 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
-###############################################################################
-bin.includes = plugin.xml,\
- *.jar,\
- plugin.properties,\
- sjavacore.jar
-jars.compile.order =
-src.includes = schema/,\
- build.properties
-output.sjavacore.jar = bin/
-source.sjavacore.jar = sjavacore/
diff --git a/plugins/org.eclipse.jst.server.core/plugin.properties b/plugins/org.eclipse.jst.server.core/plugin.properties
deleted file mode 100644
index 7039e4e..0000000
--- a/plugins/org.eclipse.jst.server.core/plugin.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-###############################################################################
-# Copyright (c) 2004, 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
-###############################################################################
-pluginName=Java Server Support
-providerName=Eclipse.org
-
-classpathContainerDescription=Server Classpath Container
-
-runtimeTypeName=J2EE Runtime Library
-runtimeTypeDescription=A runtime that represents a set of J2EE runtime libraries.
-
-errorLocation=Invalid location.
-errorJRE=Invalid JRE.
-
-moduleTypeJ2EEWebName=J2EE Web module
-moduleTypeJ2EEEJBName=J2EE EJB module
-moduleTypeJ2EEEARName=J2EE Enterprise application
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/plugin.xml b/plugins/org.eclipse.jst.server.core/plugin.xml
deleted file mode 100644
index 4808fd6..0000000
--- a/plugins/org.eclipse.jst.server.core/plugin.xml
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-
-<plugin id="org.eclipse.jst.server.core"
- name="%pluginName"
- version="1.0.0"
- provider-name="%providerName"
- class="org.eclipse.jst.server.core.internal.JavaServerPlugin">
-
- <requires>
- <import plugin="org.eclipse.core.resources"/>
- <import plugin="org.eclipse.debug.core"/>
- <import plugin="org.eclipse.wst.server.core"/>
- <import plugin="org.eclipse.jdt.core"/>
- <import plugin="org.eclipse.jdt.launching"/>
- <import plugin="org.eclipse.core.runtime"/>
- </requires>
-
- <runtime>
- <library name="sjavacore.jar">
- <export name="*"/>
- </library>
- </runtime>
-
- <extension point="org.eclipse.jdt.core.classpathContainerInitializer">
- <classpathContainerInitializer
- id="org.eclipse.jst.server.core.container"
- class="org.eclipse.jst.server.core.internal.RuntimeClasspathContainerInitializer"/>
- </extension>
-
- <extension point="org.eclipse.wst.server.core.moduleTypes">
- <moduleType
- id="j2ee.web"
- name="%moduleTypeJ2EEWebName"/>
- <moduleType
- id="j2ee.ejb"
- name="%moduleTypeJ2EEEJBName"/>
- <moduleType
- id="j2ee.ear"
- name="%moduleTypeJ2EEEARName"/>
- </extension>
-
- <extension point="org.eclipse.wst.server.core.runtimeTypes">
- <runtimeType
- id="org.eclipse.jst.server.core.runtimeType"
- name="%runtimeTypeName"
- description="%runtimeTypeDescription"
- class="org.eclipse.jst.server.core.internal.GenericRuntime">
- <moduleType
- types="j2ee"
- versions="*"/>
- <moduleType
- types="utility"
- versions="*"/>
- </runtimeType>
- </extension>
-
- <extension point="org.eclipse.wst.server.core.runtimeTargetHandlers">
- <runtimeTargetHandler
- id="org.eclipse.jst.server.core.runtimeTarget"
- runtimeTypeIds="org.eclipse.jst.server.core.runtimeType"
- class="org.eclipse.jst.server.core.internal.GenericRuntimeTargetHandler"/>
- </extension>
-
-</plugin>
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/ClasspathRuntimeTargetHandler.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/ClasspathRuntimeTargetHandler.java
deleted file mode 100644
index d81451c..0000000
--- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/ClasspathRuntimeTargetHandler.java
+++ /dev/null
@@ -1,513 +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.jst.server.core;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.*;
-import org.eclipse.jdt.core.IClasspathContainer;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.launching.JavaRuntime;
-import org.eclipse.jst.server.core.internal.IMemento;
-import org.eclipse.jst.server.core.internal.JavaServerPlugin;
-import org.eclipse.jst.server.core.internal.RuntimeClasspathContainer;
-import org.eclipse.jst.server.core.internal.Trace;
-import org.eclipse.jst.server.core.internal.XMLMemento;
-import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.model.RuntimeTargetHandlerDelegate;
-/**
- * A runtime target handler that supports changing the classpath of the
- * project by adding one or more classpath containers. Runtime providers
- * can extend this class and implement the abstract methods to provide
- * the correct build path for their runtime type.
- *
- * @since 1.0
- */
-public abstract class ClasspathRuntimeTargetHandler extends RuntimeTargetHandlerDelegate {
-
- class SourceAttachmentUpdate {
- String runtimeId;
- String id;
- IPath entry;
- IPath sourceAttachmentPath;
- IPath sourceAttachmentRootPath;
- }
-
- protected List sourceAttachments;
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.server.core.model.IRuntimeTargetDelegate#setRuntimeTarget(org.eclipse.core.resources.IProject, org.eclipse.wst.server.core.IRuntime)
- */
- public void setRuntimeTarget(IProject project, IRuntime runtime, IProgressMonitor monitor) throws CoreException {
- if (project == null || runtime == null)
- return;
-
- IJavaProject javaProject = null;
- try {
- javaProject = (IJavaProject) project.getNature(JavaCore.NATURE_ID);
- } catch (Exception e) {
- // ignore
- }
-
- if (javaProject == null)
- return;
-
- try {
- List list = new ArrayList();
- IClasspathEntry[] cp = javaProject.getRawClasspath();
- int size = cp.length;
- for (int i = 0; i < size; i++) {
- if (cp[i].getEntryKind() == IClasspathEntry.CPE_CONTAINER) {
- if (!cp[i].getPath().segment(0).equals(RuntimeClasspathContainer.SERVER_CONTAINER))
- list.add(cp[i]);
- } else
- list.add(cp[i]);
- }
-
- List add = new ArrayList();
- IClasspathEntry[] entries = getDelegateClasspathEntries(runtime, monitor);
- if (entries != null) {
- size = entries.length;
- for (int i = 0; i < size; i++)
- add.add(entries[i]);
- }
-
- String[] ids = getClasspathEntryIds();
- if (ids != null) {
- size = ids.length;
- for (int i = 0; i < size; i++) {
- String id2 = getRuntimeTargetHandler().getId();
- IPath path = new Path(RuntimeClasspathContainer.SERVER_CONTAINER).append(id2).append(runtime.getId());
- if (ids[i] != null)
- path.append(ids[i]);
- add.add(JavaCore.newContainerEntry(path));
- String id = "";
- if (path.segmentCount() > 3)
- id = path.segment(3);
- RuntimeClasspathContainer rcc = new RuntimeClasspathContainer(path, this, runtime, id);
- JavaCore.setClasspathContainer(path, new IJavaProject[] { javaProject}, new IClasspathContainer[] { rcc }, monitor);
- }
- }
-
- // clean up duplicates
- cleanupDuplicateClasspath(javaProject, list, add);
-
- Iterator iterator = add.iterator();
- while (iterator.hasNext()) {
- list.add(iterator.next());
- }
-
- cp = new IClasspathEntry[list.size()];
- list.toArray(cp);
- javaProject.setRawClasspath(cp, monitor);
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Error setting runtime target", e);
- throw new CoreException(new Status(IStatus.ERROR, JavaServerPlugin.PLUGIN_ID, 0, e.getLocalizedMessage(), e));
- }
- }
-
- private void cleanupDuplicateClasspath(IJavaProject project, List current, List add) {
- if (project == null || current == null || add == null)
- throw new IllegalArgumentException();
-
- // check if we even have to bother
- boolean sourceOnly = true;
- Iterator iterator = current.iterator();
- while (iterator.hasNext()) {
- IClasspathEntry entry = (IClasspathEntry) iterator.next();
- if (entry.getEntryKind() != IClasspathEntry.CPE_SOURCE)
- sourceOnly = false;
- }
- if (sourceOnly)
- return;
-
- // remove any of our own containers
- List remove = new ArrayList();
- iterator = current.iterator();
- while (iterator.hasNext()) {
- IClasspathEntry entry = (IClasspathEntry) iterator.next();
-
- if (entry.getEntryKind() == IClasspathEntry.CPE_CONTAINER) {
- try {
- if (RuntimeClasspathContainer.SERVER_CONTAINER.equals(entry.getPath().segment(0))
- || JavaRuntime.JRE_CONTAINER.equals(entry.getPath().segment(0)))
- remove.add(entry);
- } catch (Exception e) {
- Trace.trace(Trace.FINEST, "Error resolving classpath container", e);
- }
- }
- }
-
- // expand the "add" list
- List addExpanded = new ArrayList();
- iterator = add.iterator();
- while (iterator.hasNext()) {
- IClasspathEntry entry = (IClasspathEntry) iterator.next();
- if (entry.getEntryKind() == IClasspathEntry.CPE_CONTAINER) {
- try {
- IClasspathContainer container = JavaCore.getClasspathContainer(entry.getPath(), project);
- IClasspathEntry[] entries = container.getClasspathEntries();
- int size = entries.length;
- for (int i = 0; i < size; i++) {
- if (entries[i] != null)
- addExpanded.add(entries[i]);
- }
- } catch (Exception e) {
- Trace.trace(Trace.FINEST, "Error resolving classpath container 2", e);
- }
- } else if (entry.getEntryKind() == IClasspathEntry.CPE_VARIABLE) {
- entry = JavaCore.getResolvedClasspathEntry(entry);
- if (entry != null)
- addExpanded.add(entry);
- } else
- addExpanded.add(entry);
- }
-
- // check for duplicates by also expanding the current list
- iterator = current.iterator();
- while (iterator.hasNext()) {
- IClasspathEntry entry = (IClasspathEntry) iterator.next();
-
- List currentExpanded = new ArrayList();
- if (entry.getEntryKind() == IClasspathEntry.CPE_CONTAINER) {
- try {
- IClasspathContainer container = JavaCore.getClasspathContainer(entry.getPath(), project);
- IClasspathEntry[] entries = container.getClasspathEntries();
- int size = entries.length;
- for (int i = 0; i < size; i++) {
- if (entries[i] != null)
- currentExpanded.add(entries[i]);
- }
- } catch (Exception e) {
- Trace.trace(Trace.FINEST, "Error resolving classpath container 3", e);
- }
- } else if (entry.getEntryKind() == IClasspathEntry.CPE_VARIABLE) {
- entry = JavaCore.getResolvedClasspathEntry(entry);
- if (entry != null)
- currentExpanded.add(entry);
- } else
- currentExpanded.add(entry);
-
- // loop over all of the expanded entries of this current entry
- boolean dup = false;
- Iterator iterator2 = currentExpanded.iterator();
- while (!dup && iterator2.hasNext()) {
- IClasspathEntry entry2 = (IClasspathEntry) iterator2.next();
- Iterator iterator3 = addExpanded.iterator();
- while (iterator3.hasNext()) {
- IClasspathEntry entry3 = (IClasspathEntry) iterator3.next();
- if (entry3.getPath().equals(entry2.getPath()))
- dup = true;
- }
- }
- if (dup && !remove.contains(entry))
- remove.add(entry);
- }
-
- // remove duplicates
- iterator = remove.iterator();
- while (iterator.hasNext()) {
- current.remove(iterator.next());
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.server.core.model.IRuntimeTargetDelegate#removeRuntimeTarget(org.eclipse.core.resources.IProject, org.eclipse.wst.server.core.IRuntime)
- */
- public void removeRuntimeTarget(IProject project, IRuntime runtime, IProgressMonitor monitor) {
- Trace.trace(Trace.FINEST, "Removing runtime target");
- if (project == null || runtime == null)
- return;
-
- IJavaProject javaProject = null;
- try {
- javaProject = (IJavaProject) project.getNature(JavaCore.NATURE_ID);
- } catch (Exception e) {
- // ignore
- }
-
- if (javaProject == null)
- return;
-
- try {
- IClasspathEntry[] delegates = getDelegateClasspathEntries(runtime, monitor);
- int delegateSize = 0;
- if (delegates != null)
- delegateSize = delegates.length;
-
- List list = new ArrayList();
- IClasspathEntry[] cp = javaProject.getRawClasspath();
- int size = cp.length;
- for (int i = 0; i < size; i++) {
- boolean remove = false;
-
- if (cp[i].getPath().segment(0).equals(RuntimeClasspathContainer.SERVER_CONTAINER))
- remove = true;
-
- for (int j = 0; j < delegateSize; j++) {
- if (cp[i].equals(delegates[j]))
- remove = true;
- }
- if (!remove)
- list.add(cp[i]);
- }
-
- cp = new IClasspathEntry[list.size()];
- list.toArray(cp);
- javaProject.setRawClasspath(cp, monitor);
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Error removing runtime target", e);
- }
- }
-
- protected static void addJarFiles(File dir, List list, boolean includeSubdirectories) {
- int depth = 0;
- if (includeSubdirectories)
- depth = 2;
- addJarFiles(dir, list, depth);
- }
-
- private static void addJarFiles(File dir, List list, int depth) {
- if (dir == null)
- throw new IllegalArgumentException();
-
- File[] files = dir.listFiles();
- if (files != null) {
- int size = files.length;
- for (int i = 0; i < size; i++) {
- if (files[i].isDirectory() && depth > 0) {
- addJarFiles(files[i], list, depth - 1);
- } else if (files[i].getAbsolutePath().endsWith(".jar") || files[i].getAbsolutePath().endsWith(".zip")) {
- IPath path = new Path(files[i].getAbsolutePath());
- list.add(JavaCore.newLibraryEntry(path, null, null));
- }
- }
- }
- }
-
- protected static void addLibraryEntries(List list, File dir, boolean includeSubdirectories) {
- if (dir == null)
- throw new IllegalArgumentException();
- addJarFiles(dir, list, includeSubdirectories);
- }
-
- protected static void addLibraryEntry(List list, File dir) {
- if (dir == null)
- throw new IllegalArgumentException();
-
- IPath path = new Path(dir.getAbsolutePath());
- list.add(JavaCore.newLibraryEntry(path, null, null));
- }
-
- protected static void addLibraryEntry(List list, IPath path) {
- if (path == null)
- throw new IllegalArgumentException();
-
- list.add(JavaCore.newLibraryEntry(path, null, null));
- }
-
- protected static void addLibraryEntry(List list, IPath path, IPath source, IPath root) {
- if (path == null)
- throw new IllegalArgumentException();
-
- list.add(JavaCore.newLibraryEntry(path, source, root));
- }
-
- protected static IClasspathEntry[] resolveList(List list) {
- if (list == null)
- return new IClasspathEntry[0];
- IClasspathEntry[] entries = new IClasspathEntry[list.size()];
- list.toArray(entries);
- return entries;
- }
-
- /**
- * Returns the classpath entries that correspond to the given runtime.
- *
- * @param runtime
- * @param monitor
- * @return an array of classpath entries
- */
- public IClasspathEntry[] getDelegateClasspathEntries(IRuntime runtime, IProgressMonitor monitor) {
- return null;
- }
-
- /**
- * Returns the classpath entry ids for this runtime target handler. These
- * ids will be added to the classpath container id to create a new fully
- * qualified classpath container id.
- * <p>
- * By default, there is a single classpath entry for the runtime, with no
- * extra id (<code>new String[1]</code>). To create multiple ids, just
- * return a string array containing the ids. For instance, to have two
- * classpath containers with ids "id1" and "id2", use
- * <code>new String[] { "id1", "id2" }</code>
- * </p>
- *
- * @return an array of classpath entry ids
- */
- public String[] getClasspathEntryIds() {
- return new String[1];
- }
-
- /**
- * Request that the classpath container for the given runtime and id be updated
- * with the given classpath container entries.
- *
- * @param runtime
- * @param id
- * @param entries
- */
- public void requestClasspathContainerUpdate(IRuntime runtime, String id, IClasspathEntry[] entries) {
- // default behaviour is to save the source path entries
- if (runtime == null || entries == null)
- return;
-
- // find the source attachments
- sourceAttachments = new ArrayList();
-
- int size = entries.length;
- for (int i = 0; i < size; i++) {
- if (entries[i].getSourceAttachmentPath() != null) {
- SourceAttachmentUpdate sau = new SourceAttachmentUpdate();
- sau.runtimeId = runtime.getId();
- sau.id = id;
- sau.entry = entries[i].getPath();
- sau.sourceAttachmentPath = entries[i].getSourceAttachmentPath();
- sau.sourceAttachmentRootPath = entries[i].getSourceAttachmentRootPath();
- sourceAttachments.add(sau);
- }
- }
- save();
- }
-
- /**
- * Returns the classpath container label for the given runtime and the given
- * classpath container id (returned from getClasspathEntryIds()). This method
- * must not return null.
- *
- * @param runtime the runtime to resolve the container label for
- * @param id the classpath entry id
- * @return a classpath container label
- */
- public abstract String getClasspathContainerLabel(IRuntime runtime, String id);
-
- public IClasspathEntry[] resolveClasspathContainerImpl(IRuntime runtime, String id) {
- IClasspathEntry[] entries = resolveClasspathContainer(runtime, id);
-
- if (entries == null)
- entries = new IClasspathEntry[0];
-
- if (sourceAttachments == null)
- load();
-
- int size = entries.length;
- int size2 = sourceAttachments.size();
- for (int i = 0; i < size; i++) {
- for (int j = 0; j < size2; j++) {
- SourceAttachmentUpdate sau = (SourceAttachmentUpdate) sourceAttachments.get(j);
- if ((id != null && sau.id.equals(id)) || (id == null && sau.id == null)) {
- if (sau.runtimeId.equals(runtime.getId()) && sau.entry.equals(entries[i].getPath())) {
- entries[i] = JavaCore.newLibraryEntry(entries[i].getPath(), sau.sourceAttachmentPath, sau.sourceAttachmentRootPath);
- }
- }
- }
- }
-
- return entries;
- }
-
- private void save() {
- if (sourceAttachments == null)
- return;
- String id = getRuntimeTargetHandler().getId();
- String filename = JavaServerPlugin.getInstance().getStateLocation().append(id + ".xml").toOSString();
- try {
- XMLMemento memento = XMLMemento.createWriteRoot("classpath");
-
- Iterator iterator = sourceAttachments.iterator();
- while (iterator.hasNext()) {
- SourceAttachmentUpdate sau = (SourceAttachmentUpdate) iterator.next();
- IMemento child = memento.createChild("source-attachment");
- child.putString("runtime-id", sau.runtimeId);
- if (sau.id != null)
- child.putString("id", sau.id);
- if (sau.entry != null)
- child.putString("entry", sau.entry.toPortableString());
- if (sau.sourceAttachmentPath != null)
- child.putString("source-attachment-path", sau.sourceAttachmentPath.toPortableString());
- if (sau.sourceAttachmentRootPath != null)
- child.putString("source-attachment-root-path", sau.sourceAttachmentRootPath.toPortableString());
- }
-
- memento.saveToFile(filename);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error saving source path info", e);
- }
- }
-
- private void load() {
- sourceAttachments = new ArrayList();
-
- if (getRuntimeTargetHandler() == null)
- return;
- String id = getRuntimeTargetHandler().getId();
- String filename = JavaServerPlugin.getInstance().getStateLocation().append(id + ".xml").toOSString();
-
- try {
- IMemento memento = XMLMemento.loadMemento(filename);
-
- IMemento[] children = memento.getChildren("source-attachment");
- int size = children.length;
-
- for (int i = 0; i < size; i++) {
- try {
- SourceAttachmentUpdate sau = new SourceAttachmentUpdate();
- sau.runtimeId = children[i].getString("runtime-id");
- sau.id = children[i].getString("id");
- String temp = children[i].getString("entry");
- if (temp != null)
- sau.entry = new Path(temp);
- temp = children[i].getString("source-attachment-path");
- if (temp != null)
- sau.sourceAttachmentPath = new Path(temp);
- temp = children[i].getString("source-attachment-root-path");
- if (temp != null)
- sau.sourceAttachmentRootPath = new Path(temp);
- sourceAttachments.add(sau);
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Could not load monitor: " + e);
- }
- }
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Could not load source path info: " + e.getMessage());
- }
- }
-
- /**
- * Resolves (creates the classpath entries for) the classpath container with
- * the given runtime and the given classpath container id (returned from
- * getClasspathEntryIds()). If the classpath container cannot be resolved
- * (for instance, if the runtime does not exist), return null.
- *
- * @param runtime the runtime to resolve the container for
- * @param id the classpath entry id
- * @return an array of classpath entries for the container, or null if the
- * container could not be resolved
- */
- public abstract IClasspathEntry[] resolveClasspathContainer(IRuntime runtime, String id);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/EJBBean.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/EJBBean.java
deleted file mode 100644
index 3713f4f..0000000
--- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/EJBBean.java
+++ /dev/null
@@ -1,77 +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.jst.server.core;
-
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IModuleArtifact;
-/**
- *
- * @since 1.0
- */
-public class EJBBean implements IModuleArtifact {
- private IModule module;
- private String jndiName;
- private boolean local;
- private boolean remote;
-
- /**
- * Create a new EJBBean.
- *
- * @param module the module that the EJB is contained in
- * @param jndiName the JNDI name of the EJB
- * @param remote <code>true</code> if the EJB has a remote interface, and
- * <code>false</code> otherwise
- * @param local <code>true</code> if the EJB has a local interface, and
- * <code>false</code> otherwise
- */
- public EJBBean(IModule module, String jndiName, boolean remote, boolean local) {
- this.module = module;
- this.jndiName = jndiName;
- this.remote = remote;
- this.local = local;
- }
-
- /*
- * @see IModuleArtifact#getModule()
- */
- public IModule getModule() {
- return module;
- }
-
- /**
- * Returns the JNDI name of the EJB.
- *
- * @return the JNDI name of the EJB
- */
- public String getJndiName() {
- return jndiName;
- }
-
- /**
- * Returns whether the EJB has a remote interface.
- *
- * @return <code>true</code> if the EJB has a remote interface, and
- * <code>false</code> otherwise
- */
- public boolean hasRemoteInterface() {
- return remote;
- }
-
- /**
- * Returns whether the EJB has a local interface.
- *
- * @return <code>true</code> if the EJB has a local interface, and
- * <code>false</code> otherwise
- */
- public boolean hasLocalInterface() {
- return local;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/GenericRuntimeUtil.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/GenericRuntimeUtil.java
deleted file mode 100644
index a034a14..0000000
--- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/GenericRuntimeUtil.java
+++ /dev/null
@@ -1,43 +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.jst.server.core;
-
-import org.eclipse.wst.server.core.IRuntime;
-/**
- * Utility methods for the generic J2EE runtime.
- *
- * @since 1.0
- */
-public class GenericRuntimeUtil {
- protected static final String RUNTIME_TYPE_ID = "org.eclipse.jst.server.core.runtimeType";
-
- /**
- * Cannot create GenericRuntimeUtil - use static methods.
- */
- private GenericRuntimeUtil() {
- // can't create
- }
-
- /**
- * Returns <code>true</code> if the given runtime is a generic J2EE runtime, and
- * <code>false</code> otherwise. The runtime may not be null.
- *
- * @param runtime
- * @return <code>true</code> if
- */
- public static boolean isGenericJ2EERuntime(IRuntime runtime) {
- if (runtime == null)
- throw new IllegalArgumentException();
-
- return (runtime.getRuntimeType() != null &&
- runtime.getRuntimeType().getId().startsWith(RUNTIME_TYPE_ID));
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/IApplicationClientModule.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/IApplicationClientModule.java
deleted file mode 100644
index 8bb7561..0000000
--- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/IApplicationClientModule.java
+++ /dev/null
@@ -1,18 +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.jst.server.core;
-/**
- *
- * @since 1.0
- */
-public interface IApplicationClientModule extends IJ2EEModule {
- // no additional methods
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/IConnectorModule.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/IConnectorModule.java
deleted file mode 100644
index c42f165..0000000
--- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/IConnectorModule.java
+++ /dev/null
@@ -1,26 +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.jst.server.core;
-
-import org.eclipse.core.runtime.IPath;
-/**
- * A J2EE connector module.
- *
- * @since 1.0
- */
-public interface IConnectorModule extends IJ2EEModule {
- /**
- * Returns the classpath as an array of absolute IPaths.
- *
- * @return an array of classpath entries
- */
- public IPath[] getClasspath();
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/IEJBModule.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/IEJBModule.java
deleted file mode 100644
index 075bab1..0000000
--- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/IEJBModule.java
+++ /dev/null
@@ -1,23 +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.jst.server.core;
-/**
- *
- * @since 1.0
- */
-public interface IEJBModule extends IJ2EEModule {
- /**
- * Returns a version number in the form "x.y.z".
- *
- * @return java.lang.String
- */
- public String getEJBSpecificationVersion();
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/IEnterpriseApplication.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/IEnterpriseApplication.java
deleted file mode 100644
index 7cab738..0000000
--- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/IEnterpriseApplication.java
+++ /dev/null
@@ -1,60 +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.jst.server.core;
-
-import org.eclipse.core.runtime.IPath;
-/**
- *
- * @since 1.0
- */
-public interface IEnterpriseApplication {
- /**
- * Returns a version number in the form "x.y.z".
- *
- * @return the J2EE specification version
- */
- public String getJ2EESpecificationVersion();
-
- /**
- * Returns the modules contained within this EAR.
- *
- * @return a possibly empty array of modules contained within this application
- */
- public IJ2EEModule[] getModules();
-
- /**
- * Returns the URI of the given J2EE module within this
- * enterprise application.
- *
- * @param module a module within this application
- * @return the URI of the given module, or <code>null</code> if the URI could
- * not be found
- */
- public String getURI(IJ2EEModule module);
-
- /**
- * Returns <code>true</code> if this EAR supports loose modules and <code>false</code>
- * otherwise.
- *
- * @return returns <code>true</code> if this module contains loose modules, or
- * <code>false</code> otherwise
- */
- public boolean containsLooseModules();
-
- /**
- * Returns the location of the root of the application. May
- * return null if isUnitTest() returns false. This should
- * be an absolute path that is not workbench relative.
- *
- * @return the absolute path to the root of this application
- */
- public IPath getLocation();
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/IGenericRuntime.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/IGenericRuntime.java
deleted file mode 100644
index d7f8005..0000000
--- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/IGenericRuntime.java
+++ /dev/null
@@ -1,25 +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.jst.server.core;
-
-import org.eclipse.jdt.launching.IVMInstall;
-/**
- *
- * @since 1.0
- */
-public interface IGenericRuntime {
- /**
- * Return the VM install (installed JRE) that this runtime is using.
- *
- * @return the current VM install
- */
- public IVMInstall getVMInstall();
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/IGenericRuntimeWorkingCopy.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/IGenericRuntimeWorkingCopy.java
deleted file mode 100644
index 44f4d5b..0000000
--- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/IGenericRuntimeWorkingCopy.java
+++ /dev/null
@@ -1,25 +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.jst.server.core;
-
-import org.eclipse.jdt.launching.IVMInstall;
-/**
- *
- * @since 1.0
- */
-public interface IGenericRuntimeWorkingCopy extends IGenericRuntime {
- /**
- * Set the VM install (installed JRE) that this runtime is using.
- *
- * @param vmInstall the VM install to use
- */
- public void setVMInstall(IVMInstall vmInstall);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/IJ2EEModule.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/IJ2EEModule.java
deleted file mode 100644
index 5c2aee9..0000000
--- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/IJ2EEModule.java
+++ /dev/null
@@ -1,57 +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.jst.server.core;
-
-import org.eclipse.core.runtime.IPath;
-/**
- * An abstract J2EE module that can be deployed to a server.
- *
- * @since 1.0
- */
-public interface IJ2EEModule {
- /**
- * Returns a version number in the form "x.y.z".
- *
- * @return the J2EE specification version
- */
- public String getJ2EESpecificationVersion();
-
- /**
- * Returns the location of the root of the module. May
- * return null if isUnitTest() returns false. This should
- * be an absolute path that is not workbench relative.
- *
- * @return the absolute path to the root of this application
- */
- public IPath getLocation();
-
- /**
- * Returns true if this is a binary (zipped) module, and
- * false if it is expanded.
- *
- * <p>If true, members() should return only a single element -
- * the binary (jar or zip file) that contains the contents of
- * this module. (a single IModuleResource, e.g.
- * myejb.jar) Also, getLocation() should return the full path
- * up to and including the binary itself. (e.g.
- * c:\temp\myejb.jar)</p>
- *
- * <p>If false, members() should return the entire contents
- * of the module, starting at the root. There should be no
- * preceeding directory structure. (an array of
- * IModuleResources, e.g. index.html, WEB-INF/web.xml,
- * ...) In this case, getLocation() should return the path to
- * the root folder containing these resources.</p>
- *
- * @return boolean
- */
- public boolean isBinary();
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/ILooseArchive.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/ILooseArchive.java
deleted file mode 100644
index 625c90e..0000000
--- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/ILooseArchive.java
+++ /dev/null
@@ -1,48 +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.jst.server.core;
-
-import org.eclipse.core.runtime.IPath;
-/**
- *
- * @since 1.0
- */
-public interface ILooseArchive {
- /**
- * Returns the location of the root of the loose utility. This should
- * be an absolute path that is not workbench relative.
- *
- * @return org.eclipse.core.runtime.IPath
- */
- public IPath getLocation();
-
- /**
- * Returns true if this is a binary (zipped) archive, and
- * false if it is expanded.
- *
- * <p>If true, members() should return only a single element -
- * the binary (jar or zip file) that contains the contents of
- * this module. (a single IPublishableResource, e.g.
- * myejb.jar) Also, getLocation() should return the full path
- * up to and including the binary itself. (e.g.
- * c:\temp\myejb.jar)</p>
- *
- * <p>If false, members() should return the entire contents
- * of the module, starting at the root. There should be no
- * preceeding directory structure. (an array of
- * IPublishableResources, e.g. index.html, WEB-INF/web.xml,
- * ...) In this case, getLocation() should return the path to
- * the root folder containing these resources.</p>
- *
- * @return boolean
- */
- public boolean isBinary();
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/ILooseArchiveSupport.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/ILooseArchiveSupport.java
deleted file mode 100644
index 19ba5bd..0000000
--- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/ILooseArchiveSupport.java
+++ /dev/null
@@ -1,34 +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.jst.server.core;
-/**
- *
- * @since 1.0
- */
-public interface ILooseArchiveSupport {
- /**
- * Return the loose archives that are contained within this enterprise
- * application.
- *
- * @return a possibly empty array of modules contained within this application
- */
- public ILooseArchive[] getLooseArchives();
-
- /**
- * Returns the URI of the given loose archive within this
- * enterprise application.
- *
- * @param archive a loose archive
- * @return the URI of the given archive, or <code>null</code> if the URI could
- * not be found
- */
- public String getURI(ILooseArchive archive);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/IWebModule.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/IWebModule.java
deleted file mode 100644
index cbf8092..0000000
--- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/IWebModule.java
+++ /dev/null
@@ -1,47 +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.jst.server.core;
-/**
- *
- * @since 1.0
- */
-public interface IWebModule extends IJ2EEModule {
- /**
- * Returns a version number in the form "x.y.z".
- *
- * @return java.lang.String
- */
- public String getServletSpecificationVersion();
-
- /**
- * Returns a version number in the form "x.y.z".
- *
- * @return java.lang.String
- */
- public String getJSPSpecificationVersion();
-
- /**
- * Returns the context root of the module.
- *
- * @return java.lang.String
- */
- public String getContextRoot();
-
- /**
- * Returns false if the files in this module are placed in the
- * correct structure for testing before publishing. Returns true
- * if the file system resources must be published before they will
- * work.
- *
- * @return boolean
- */
- public boolean isPublishRequired();
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/JndiLaunchable.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/JndiLaunchable.java
deleted file mode 100644
index 580e402..0000000
--- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/JndiLaunchable.java
+++ /dev/null
@@ -1,52 +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.jst.server.core;
-
-import java.util.Properties;
-
-import org.eclipse.wst.server.core.ILaunchable;
-/**
- *
- * @since 1.0
- */
-public class JndiLaunchable implements ILaunchable {
- private Properties props;
- private String jndiName;
-
- /**
- * Create a reference to an object that is launchable via JNDI.
- *
- * @param props the JNDI properties required to connect to the object
- * @param jndiName the JNDI name of the object
- */
- public JndiLaunchable(Properties props, String jndiName) {
- this.jndiName = jndiName;
- this.props = props;
- }
-
- /**
- * Returns the JNDI properties required to connect to the object.
- *
- * @return the JNDI properties required to connect to the object
- */
- public Properties getProperties() {
- return props;
- }
-
- /**
- * Returns the JNDI name of the object.
- *
- * @return the JNDI name of the object
- */
- public String getJNDIName() {
- return jndiName;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/JndiObject.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/JndiObject.java
deleted file mode 100644
index 5e51425..0000000
--- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/JndiObject.java
+++ /dev/null
@@ -1,49 +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.jst.server.core;
-
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IModuleArtifact;
-/**
- *
- * @since 1.0
- */
-public class JndiObject implements IModuleArtifact {
- private IModule module;
- private String jndiName;
-
- /**
- * Create a reference to an object in JNDI.
- *
- * @param module the module that the object is contained in
- * @param jndiName the JNDI name of the object
- */
- public JndiObject(IModule module, String jndiName) {
- this.module = module;
- this.jndiName = jndiName;
- }
-
- /*
- * @see IModuleArtifact#getModule()
- */
- public IModule getModule() {
- return module;
- }
-
- /**
- * Return the JNDI name of the object.
- *
- * @return the JNDI name of the object
- */
- public String getJndiName() {
- return jndiName;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/Servlet.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/Servlet.java
deleted file mode 100644
index 0f93ec1..0000000
--- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/Servlet.java
+++ /dev/null
@@ -1,68 +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.jst.server.core;
-
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IModuleArtifact;
-/**
- *
- * @since 1.0
- */
-public class Servlet implements IModuleArtifact {
- private IModule module;
- private String className;
- private String alias;
-
- /**
- * Create a reference to a servlet.
- *
- * @param module the module that the servlet is contained in
- * @param className the class name of the servlet
- * @param alias the servlet's alias
- */
- public Servlet(IModule module, String className, String alias) {
- this.module = module;
- this.className = className;
- this.alias = alias;
- }
-
- /*
- * @see IModuleArtifact#getModule()
- */
- public IModule getModule() {
- return module;
- }
-
- /**
- * Return the class name of the servlet.
- *
- * @return the class name of the servlet
- */
- public String getServletClassName() {
- return className;
- }
-
- /**
- * Return the servlet's alias.
- *
- * @return the servlet's alias
- */
- public String getAlias() {
- return alias;
- }
-
- /*
- * @see Object#toString()
- */
- public String toString() {
- return "Servlet [module=" + module + ", class=" + className + ", alias=" + alias + "]";
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/GenericRuntime.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/GenericRuntime.java
deleted file mode 100644
index faae162..0000000
--- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/GenericRuntime.java
+++ /dev/null
@@ -1,95 +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.jst.server.core.internal;
-
-import org.eclipse.core.runtime.*;
-import org.eclipse.jdt.launching.IVMInstall;
-import org.eclipse.jdt.launching.IVMInstallType;
-import org.eclipse.jdt.launching.JavaRuntime;
-import org.eclipse.jst.server.core.IGenericRuntime;
-import org.eclipse.jst.server.core.IGenericRuntimeWorkingCopy;
-import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.model.RuntimeDelegate;
-/**
- *
- */
-public class GenericRuntime extends RuntimeDelegate implements IGenericRuntime, IGenericRuntimeWorkingCopy {
- protected static final String PROP_VM_INSTALL_TYPE_ID = "vm-install-type-id";
- protected static final String PROP_VM_INSTALL_ID = "vm-install-id";
-
- public GenericRuntime() {
- // do nothing
- }
-
- protected String getVMInstallTypeId() {
- return getAttribute(PROP_VM_INSTALL_TYPE_ID, (String)null);
- }
-
- protected String getVMInstallId() {
- return getAttribute(PROP_VM_INSTALL_ID, (String)null);
- }
-
- public IVMInstall getVMInstall() {
- try {
- IVMInstallType vmInstallType = JavaRuntime.getVMInstallType(getVMInstallTypeId());
- IVMInstall[] vmInstalls = vmInstallType.getVMInstalls();
- int size = vmInstalls.length;
- String id = getVMInstallId();
- for (int i = 0; i < size; i++) {
- if (id.equals(vmInstalls[i].getId()))
- return vmInstalls[i];
- }
- } catch (Exception e) {
- // ignore
- }
- return null;
- }
-
- public IStatus validate() {
- IStatus status = super.validate();
- if (!status.isOK())
- return status;
-
- IRuntime runtime = getRuntime();
-
- IPath path = runtime.getLocation();
- if (!path.toFile().exists())
- return new Status(IStatus.ERROR, JavaServerPlugin.PLUGIN_ID, 0, JavaServerPlugin.getResource("%errorLocation"), null);
- else if (getVMInstall() == null)
- return new Status(IStatus.ERROR, JavaServerPlugin.PLUGIN_ID, 0, JavaServerPlugin.getResource("%errorJRE"), null);
- else
- return new Status(IStatus.OK, JavaServerPlugin.PLUGIN_ID, 0, "", null);
- }
-
- public void setDefaults() {
- IVMInstall vmInstall = JavaRuntime.getDefaultVMInstall();
- setVMInstall(vmInstall.getVMInstallType().getId(), vmInstall.getId());
- }
-
- public void setVMInstall(IVMInstall vmInstall) {
- if (vmInstall == null) {
- setVMInstall(null, null);
- } else
- setVMInstall(vmInstall.getVMInstallType().getId(), vmInstall.getId());
- }
-
- protected void setVMInstall(String typeId, String id) {
- if (typeId == null)
- setAttribute(PROP_VM_INSTALL_TYPE_ID, (String)null);
- else
- setAttribute(PROP_VM_INSTALL_TYPE_ID, typeId);
-
- if (id == null)
- setAttribute(PROP_VM_INSTALL_ID, (String)null);
- else
- setAttribute(PROP_VM_INSTALL_ID, id);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/GenericRuntimeTargetHandler.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/GenericRuntimeTargetHandler.java
deleted file mode 100644
index 396b954..0000000
--- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/GenericRuntimeTargetHandler.java
+++ /dev/null
@@ -1,65 +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.jst.server.core.internal;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.launching.IVMInstall;
-import org.eclipse.jdt.launching.JavaRuntime;
-import org.eclipse.jst.server.core.ClasspathRuntimeTargetHandler;
-
-import org.eclipse.wst.server.core.IRuntime;
-/**
- *
- */
-public class GenericRuntimeTargetHandler extends ClasspathRuntimeTargetHandler {
- public IClasspathEntry[] getDelegateClasspathEntries(IRuntime runtime, IProgressMonitor monitor) {
- GenericRuntime genericRuntime = (GenericRuntime) runtime.getAdapter(GenericRuntime.class);
- IVMInstall vmInstall = genericRuntime.getVMInstall();
- if (vmInstall != null) {
- String name = vmInstall.getName();
- return new IClasspathEntry[] { JavaCore.newContainerEntry(new Path(JavaRuntime.JRE_CONTAINER).append("org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType").append(name)) };
- }
- return null;
- }
-
- public String getClasspathContainerLabel(IRuntime runtime, String id) {
- return JavaServerPlugin.getResource("%runtimeTypeName");
- }
-
- public String[] getClasspathEntryIds(IRuntime runtime) {
- return new String[1];
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.server.target.IServerTargetDelegate#getClasspathEntries()
- */
- public IClasspathEntry[] resolveClasspathContainer(IRuntime runtime, String id) {
- IPath installPath = runtime.getLocation();
-
- if (installPath == null)
- return new IClasspathEntry[0];
-
- List list = new ArrayList();
- addLibraryEntries(list, installPath.toFile(), false);
- return resolveList(list);
- }
-
- public String getId() {
- return "org.eclipse.jst.server.core.runtimeTarget";
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/IMemento.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/IMemento.java
deleted file mode 100644
index 6035548..0000000
--- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/IMemento.java
+++ /dev/null
@@ -1,189 +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.jst.server.core.internal;
-
-import java.util.List;
-/**
- * Interface to a memento used for saving the important state of an object
- * in a form that can be persisted in the file system.
- * <p>
- * Mementos were designed with the following requirements in mind:
- * <ol>
- * <li>Certain objects need to be saved and restored across platform sessions.
- * </li>
- * <li>When an object is restored, an appropriate class for an object might not
- * be available. It must be possible to skip an object in this case.</li>
- * <li>When an object is restored, the appropriate class for the object may be
- * different from the one when the object was originally saved. If so, the
- * new class should still be able to read the old form of the data.</li>
- * </ol>
- * </p>
- * <p>
- * Mementos meet these requirements by providing support for storing a
- * mapping of arbitrary string keys to primitive values, and by allowing
- * mementos to have other mementos as children (arranged into a tree).
- * A robust external storage format based on XML is used.
- * </p><p>
- * The key for an attribute may be any alpha numeric value. However, the
- * value of <code>TAG_ID</code> is reserved for internal use.
- * </p><p>
- * This interface is not intended to be implemented by clients.
- * </p>
- */
-public interface IMemento {
- /**
- * Special reserved key used to store the memento id
- * (value <code>"org.eclipse.ui.id"</code>).
- *
- * @see #getId
- */
- public static final String TAG_ID = "IMemento.internal.id"; //$NON-NLS-1$
-
- /**
- * Creates a new child of this memento with the given type.
- * <p>
- * The <code>getChild</code> and <code>getChildren</code> methods
- * are used to retrieve children of a given type.
- * </p>
- *
- * @param type the type
- * @return a new child memento
- * @see #getChild
- * @see #getChildren
- */
- public IMemento createChild(String type);
-
- /**
- * Creates a new child of this memento with the given type and id.
- * The id is stored in the child memento (using a special reserved
- * key, <code>TAG_ID</code>) and can be retrieved using <code>getId</code>.
- * <p>
- * The <code>getChild</code> and <code>getChildren</code> methods
- * are used to retrieve children of a given type.
- * </p>
- *
- * @param type the type
- * @param id the child id
- * @return a new child memento with the given type and id
- * @see #getId
- */
- public IMemento createChild(String type, String id);
-
- /**
- * Returns the first child with the given type id.
- *
- * @param type the type id
- * @return the first child with the given type
- */
- public IMemento getChild(String type);
-
- /**
- * Returns all children with the given type id.
- *
- * @param type the type id
- * @return the list of children with the given type
- */
- public IMemento[] getChildren(String type);
-
- /**
- * Returns the floating point value of the given key.
- *
- * @param key the key
- * @return the value, or <code>null</code> if the key was not found or was found
- * but was not a floating point number
- */
- public Float getFloat(String key);
-
- /**
- * Returns the id for this memento.
- *
- * @return the memento id, or <code>null</code> if none
- * @see #createChild(java.lang.String,java.lang.String)
- */
- public String getId();
-
- /**
- * Returns the name for this memento.
- *
- * @return the memento name, or <code>null</code> if none
- * @see #createChild(java.lang.String,java.lang.String)
- */
- public String getName();
-
- /**
- * Returns the integer value of the given key.
- *
- * @param key the key
- * @return the value, or <code>null</code> if the key was not found or was found
- * but was not an integer
- */
- public Integer getInteger(String key);
-
- /**
- * Returns the string value of the given key.
- *
- * @param key the key
- * @return the value, or <code>null</code> if the key was not found or was found
- * but was not an integer
- */
- public String getString(String key);
-
- /**
- * Returns the boolean value of the given key.
- *
- * @param key the key
- * @return the value, or <code>null</code> if the key was not found or was found
- * but was not a boolean
- */
- public Boolean getBoolean(String key);
-
- public List getNames();
-
- /**
- * Sets the value of the given key to the given floating point number.
- *
- * @param key the key
- * @param value the value
- */
- public void putFloat(String key, float value);
-
- /**
- * Sets the value of the given key to the given integer.
- *
- * @param key the key
- * @param value the value
- */
- public void putInteger(String key, int value);
-
- /**
- * Sets the value of the given key to the given boolean value.
- *
- * @param key the key
- * @param value the value
- */
- public void putBoolean(String key, boolean value);
-
- /**
- * Copy the attributes and children from <code>memento</code>
- * to the receiver.
- *
- * @param memento the IMemento to be copied.
- */
- public void putMemento(IMemento memento);
-
- /**
- * Sets the value of the given key to the given string.
- *
- * @param key the key
- * @param value the value
- */
- public void putString(String key, String value);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/J2EEUtil.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/J2EEUtil.java
deleted file mode 100644
index 29c7851..0000000
--- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/J2EEUtil.java
+++ /dev/null
@@ -1,55 +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.jst.server.core.internal;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jst.server.core.IEnterpriseApplication;
-import org.eclipse.jst.server.core.IJ2EEModule;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.ServerUtil;
-/**
- *
- * @since 1.0
- */
-public class J2EEUtil {
- /**
- * Returns the enterprise applications that the module is contained within.
- *
- * @param module
- * @return a possibly empty array of enterprise applications
- */
- public static IEnterpriseApplication[] getEnterpriseApplications(IJ2EEModule module) {
- List list = new ArrayList();
- IModule[] modules = ServerUtil.getModules("j2ee.ear");
- if (modules != null) {
- int size = modules.length;
- for (int i = 0; i < size; i++) {
- IModule module2 = modules[i];
- IEnterpriseApplication ear = (IEnterpriseApplication) module2.getAdapter(IEnterpriseApplication.class);
- if (ear != null) {
- IJ2EEModule[] modules2 = ear.getModules();
- if (modules2 != null) {
- int size2 = modules2.length;
- for (int j = 0; j < size2; j++) {
- if (modules2[j].equals(module))
- list.add(ear);
- }
- }
- }
- }
- }
- IEnterpriseApplication[] ears = new IEnterpriseApplication[list.size()];
- list.toArray(ears);
- return ears;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/JavaResources.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/JavaResources.java
deleted file mode 100644
index 39a2094..0000000
--- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/JavaResources.java
+++ /dev/null
@@ -1,37 +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.jst.server.core.internal;
-/**
- *
- */
-public class JavaResources {
- /**
- * Returns the translated String found with the given key.
- *
- * @param key java.lang.String
- * @return java.lang.String
- */
- public static String getResource(String key) {
- return JavaServerPlugin.getResource(key);
- }
-
- /**
- * Returns the translated String found with the given key,
- * and formatted with the given arguments using java.text.MessageFormat.
- *
- * @param key java.lang.String
- * @param arguments java.lang.Object[]
- * @return java.lang.String
- */
- public static String getResource(String key, Object[] arguments) {
- return JavaServerPlugin.getResource(key, arguments);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/JavaServerPlugin.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/JavaServerPlugin.java
deleted file mode 100644
index a8ea100..0000000
--- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/JavaServerPlugin.java
+++ /dev/null
@@ -1,80 +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.jst.server.core.internal;
-
-import java.text.MessageFormat;
-import org.eclipse.core.runtime.*;
-/**
- * The main server tooling plugin class.
- */
-public class JavaServerPlugin extends Plugin {
- // server java plugin id
- public static final String PLUGIN_ID = "org.eclipse.jst.server.core";
-
- // singleton instance of this class
- private static JavaServerPlugin singleton;
-
- /**
- * Create the JavaServerPlugin.
- */
- public JavaServerPlugin() {
- super();
- singleton = this;
- }
-
- /**
- * Returns the singleton instance of this plugin.
- *
- * @return org.eclipse.jst.server.JavaServerPlugin
- */
- public static JavaServerPlugin getInstance() {
- return singleton;
- }
-
- /**
- * Returns the translated String found with the given key.
- *
- * @param key java.lang.String
- * @return java.lang.String
- */
- public static String getResource(String key) {
- try {
- return Platform.getResourceString(getInstance().getBundle(), key);
- } catch (Exception e) {
- return key;
- }
- }
- /**
- * Returns the translated String found with the given key,
- * and formatted with the given arguments using java.text.MessageFormat.
- *
- * @param key java.lang.String
- * @param arguments java.lang.Object[]
- * @return java.lang.String
- */
- public static String getResource(String key, Object[] arguments) {
- try {
- String text = getResource(key);
- return MessageFormat.format(text, arguments);
- } catch (Exception e) {
- return key;
- }
- }
-
- /**
- * Convenience method for logging.
- *
- * @param status org.eclipse.core.runtime.IStatus
- */
- public static void log(IStatus status) {
- getInstance().getLog().log(status);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/LaunchConfigurationUtil.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/LaunchConfigurationUtil.java
deleted file mode 100644
index 0eeb339..0000000
--- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/LaunchConfigurationUtil.java
+++ /dev/null
@@ -1,69 +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.jst.server.core.internal;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
-import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
-import org.eclipse.jdt.launching.JavaRuntime;
-
-import org.eclipse.wst.server.core.IServer;
-/**
- *
- */
-public class LaunchConfigurationUtil {
- /**
- * Gets the classpath from the launch configuration of the given server.
- * If create is false, it will return null if there is no launch configuration
- * (i.e. the server has not been run before) If create is true, it will create
- * a launch configuration if one does not exist.
- *
- * @param server
- * @param create
- * @param monitor a progress monitor
- * @return an array containing runtime classpath entries
- * @throws CoreException
- */
- public static IRuntimeClasspathEntry[] getClasspath(IServer server, boolean create, IProgressMonitor monitor) throws CoreException {
- ILaunchConfiguration config = server.getLaunchConfiguration(create, monitor);
- if (config == null)
- return null;
-
- return JavaRuntime.computeUnresolvedRuntimeClasspath(config);
- }
-
- /**
- * Sets the classpath on the given server's launch configuration.
- *
- * @param server
- * @param classpath
- * @throws CoreException
- */
- public static void setClasspath(IServer server, IRuntimeClasspathEntry[] classpath, IProgressMonitor monitor) throws CoreException {
- ILaunchConfiguration config = server.getLaunchConfiguration(true, monitor);
- ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
- wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH, false);
-
- List mementos = new ArrayList(classpath.length);
- for (int i = 0; i < classpath.length; i++) {
- IRuntimeClasspathEntry entry = classpath[i];
- mementos.add(entry.getMemento());
- }
- wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, mementos);
- wc.doSave();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/RuntimeClasspathContainer.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/RuntimeClasspathContainer.java
deleted file mode 100644
index 79c57e8..0000000
--- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/RuntimeClasspathContainer.java
+++ /dev/null
@@ -1,77 +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.jst.server.core.internal;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jdt.core.IClasspathContainer;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jst.server.core.ClasspathRuntimeTargetHandler;
-
-import org.eclipse.wst.server.core.IRuntime;
-/**
- *
- */
-public class RuntimeClasspathContainer implements IClasspathContainer {
- public static final String SERVER_CONTAINER = JavaServerPlugin.PLUGIN_ID + ".container";
-
- private IPath path;
- private ClasspathRuntimeTargetHandler delegate;
- private IRuntime runtime;
-
- private String id;
-
- public RuntimeClasspathContainer(IPath path, ClasspathRuntimeTargetHandler delegate, IRuntime runtime, String id) {
- this.path = path;
- this.delegate = delegate;
- this.runtime = runtime;
- this.id = id;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.IClasspathContainer#getClasspathEntries()
- */
- public IClasspathEntry[] getClasspathEntries() {
- IClasspathEntry[] entries = null;
- if (delegate != null && runtime != null)
- entries = delegate.resolveClasspathContainerImpl(runtime, id);
-
- if (entries == null)
- return new IClasspathEntry[0];
-
- return entries;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.IClasspathContainer#getDescription()
- */
- public String getDescription() {
- String s = delegate.getClasspathContainerLabel(runtime, id);
-
- if (s != null)
- return s;
-
- return JavaServerPlugin.getResource("%classpathContainerDescription");
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.IClasspathContainer#getKind()
- */
- public int getKind() {
- return IClasspathContainer.K_APPLICATION;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.IClasspathContainer#getPath()
- */
- public IPath getPath() {
- return path;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/RuntimeClasspathContainerInitializer.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/RuntimeClasspathContainerInitializer.java
deleted file mode 100644
index 3091eca..0000000
--- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/RuntimeClasspathContainerInitializer.java
+++ /dev/null
@@ -1,97 +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.jst.server.core.internal;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jdt.core.*;
-import org.eclipse.jst.server.core.*;
-import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.IRuntimeTargetHandler;
-import org.eclipse.wst.server.core.ServerCore;
-/**
- *
- */
-public class RuntimeClasspathContainerInitializer extends ClasspathContainerInitializer {
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.ClasspathContainerInitializer#initialize(org.eclipse.core.runtime.IPath, org.eclipse.jdt.core.IJavaProject)
- */
- public void initialize(IPath containerPath, IJavaProject project) throws CoreException {
- if (containerPath.segmentCount() > 0) {
- if (containerPath.segment(0).equals(RuntimeClasspathContainer.SERVER_CONTAINER)) {
- ClasspathRuntimeTargetHandler crth = null;
- IRuntime runtime = null;
- String id = "";
- if (containerPath.segmentCount() > 2) {
- IRuntimeTargetHandler handler = ServerCore.findRuntimeTargetHandler(containerPath.segment(1));
- if (handler != null)
- crth = (ClasspathRuntimeTargetHandler) handler.getAdapter(ClasspathRuntimeTargetHandler.class);
- String runtimeId = containerPath.segment(2);
- if (runtimeId != null)
- runtime = ServerCore.findRuntime(runtimeId);
- if (containerPath.segmentCount() > 3)
- id = containerPath.segment(3);
- }
- RuntimeClasspathContainer container = new RuntimeClasspathContainer(containerPath, crth, runtime, id);
- JavaCore.setClasspathContainer(containerPath, new IJavaProject[] {project}, new IClasspathContainer[] {container}, null);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.ClasspathContainerInitializer#getDescription(org.eclipse.core.runtime.IPath, org.eclipse.jdt.core.IJavaProject)
- */
- public String getDescription(IPath containerPath, IJavaProject project) {
- return JavaServerPlugin.getResource("%classpathContainerDescription");
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.ClasspathContainerInitializer#canUpdateClasspathContainer(org.eclipse.core.runtime.IPath, org.eclipse.jdt.core.IJavaProject)
- */
- public boolean canUpdateClasspathContainer(IPath containerPath, IJavaProject project) {
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.ClasspathContainerInitializer#requestClasspathContainerUpdate(org.eclipse.core.runtime.IPath, org.eclipse.jdt.core.IJavaProject, org.eclipse.jdt.core.IClasspathContainer)
- */
- public void requestClasspathContainerUpdate(IPath containerPath, IJavaProject project, IClasspathContainer containerSuggestion) throws CoreException {
- if (containerPath.segmentCount() > 0) {
- if (containerPath.segment(0).equals(RuntimeClasspathContainer.SERVER_CONTAINER)) {
- ClasspathRuntimeTargetHandler crth = null;
- IRuntime runtime = null;
- String id = "";
- if (containerPath.segmentCount() > 2) {
- IRuntimeTargetHandler handler = ServerCore.findRuntimeTargetHandler(containerPath.segment(1));
- if (handler != null) {
- crth = (ClasspathRuntimeTargetHandler) handler.getAdapter(ClasspathRuntimeTargetHandler.class);
- }
- String runtimeId = containerPath.segment(2);
- if (runtimeId != null)
- runtime = ServerCore.findRuntime(runtimeId);
- if (containerPath.segmentCount() > 3)
- id = containerPath.segment(3);
- crth.requestClasspathContainerUpdate(runtime, id, containerSuggestion.getClasspathEntries());
- }
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.ClasspathContainerInitializer#getComparisonID(org.eclipse.core.runtime.IPath, org.eclipse.jdt.core.IJavaProject)
- */
- public Object getComparisonID(IPath containerPath, IJavaProject project) {
- if (containerPath == null)
- return null;
-
- return containerPath.toPortableString();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/Trace.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/Trace.java
deleted file mode 100644
index ada415b..0000000
--- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/Trace.java
+++ /dev/null
@@ -1,51 +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.jst.server.core.internal;
-/**
- * Helper class to route trace output.
- */
-public class Trace {
- public static byte CONFIG = 0;
- public static byte WARNING = 1;
- public static byte SEVERE = 2;
- public static byte FINEST = 3;
-
- /**
- * Trace constructor comment.
- */
- private Trace() {
- super();
- }
-
- /**
- * Trace the given text.
- *
- * @param s java.lang.String
- */
- public static void trace(byte level, String s) {
- Trace.trace(level, s, null);
- }
-
- /**
- * Trace the given message and exception.
- *
- * @param s java.lang.String
- * @param t java.lang.Throwable
- */
- public static void trace(byte level, String s, Throwable t) {
- if (!JavaServerPlugin.getInstance().isDebugging())
- return;
-
- System.out.println(s);
- if (t != null)
- t.printStackTrace();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/XMLMemento.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/XMLMemento.java
deleted file mode 100644
index a35ea43..0000000
--- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/XMLMemento.java
+++ /dev/null
@@ -1,453 +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.jst.server.core.internal;
-
-import java.io.*;
-import java.util.*;
-import java.net.URL;
-import org.w3c.dom.*;
-import org.xml.sax.*;
-
-import javax.xml.parsers.*;
-import javax.xml.transform.*;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-/**
- * A Memento is a class independent container for persistence
- * info. It is a reflection of 3 storage requirements.
- *
- * 1) We need the ability to persist an object and restore it.
- * 2) The class for an object may be absent. If so we would
- * like to skip the object and keep reading.
- * 3) The class for an object may change. If so the new class
- * should be able to read the old persistence info.
- *
- * We could ask the objects to serialize themselves into an
- * ObjectOutputStream, DataOutputStream, or Hashtable. However
- * all of these approaches fail to meet the second requirement.
- *
- * Memento supports binary persistance with a version ID.
- */
-public final class XMLMemento implements IMemento {
- private Document factory;
- private Element element;
-
- /**
- * Answer a memento for the document and element. For simplicity
- * you should use createReadRoot and createWriteRoot to create the initial
- * mementos on a document.
- */
- public XMLMemento(Document doc, Element el) {
- factory = doc;
- element = el;
- }
-
- /*
- * @see IMemento
- */
- public IMemento createChild(String type) {
- Element child = factory.createElement(type);
- element.appendChild(child);
- return new XMLMemento(factory, child);
- }
-
- /*
- * @see IMemento
- */
- public IMemento createChild(String type, String id) {
- Element child = factory.createElement(type);
- child.setAttribute(TAG_ID, id);
- element.appendChild(child);
- return new XMLMemento(factory, child);
- }
-
- /**
- * Create a Document from a Reader and answer a root memento for reading
- * a document.
- */
- protected static XMLMemento createReadRoot(Reader reader) {
- Document document = null;
- try {
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- DocumentBuilder parser = factory.newDocumentBuilder();
- document = parser.parse(new InputSource(reader));
- Node node = document.getFirstChild();
- if (node instanceof Element)
- return new XMLMemento(document, (Element) node);
- } catch (Exception e) {
- // ignore
- } finally {
- try {
- reader.close();
- } catch (Exception e) {
- // ignore
- }
- }
- return null;
- }
-
- /**
- * Answer a root memento for writing a document.
- */
- public static XMLMemento createWriteRoot(String type) {
- Document document;
- try {
- document = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
- Element element = document.createElement(type);
- document.appendChild(element);
- return new XMLMemento(document, element);
- } catch (ParserConfigurationException e) {
- throw new Error(e);
- }
- }
-
- /*
- * @see IMemento
- */
- public IMemento getChild(String type) {
- // Get the nodes.
- NodeList nodes = element.getChildNodes();
- int size = nodes.getLength();
- if (size == 0)
- return null;
-
- // Find the first node which is a child of this node.
- for (int nX = 0; nX < size; nX ++) {
- Node node = nodes.item(nX);
- if (node instanceof Element) {
- Element element2 = (Element)node;
- if (element2.getNodeName().equals(type))
- return new XMLMemento(factory, element2);
- }
- }
-
- // A child was not found.
- return null;
- }
-
- /*
- * @see IMemento
- */
- public IMemento [] getChildren(String type) {
- // Get the nodes.
- NodeList nodes = element.getChildNodes();
- int size = nodes.getLength();
- if (size == 0)
- return new IMemento[0];
-
- // Extract each node with given type.
- ArrayList list = new ArrayList(size);
- for (int nX = 0; nX < size; nX ++) {
- Node node = nodes.item(nX);
- if (node instanceof Element) {
- Element element2 = (Element)node;
- if (element2.getNodeName().equals(type))
- list.add(element2);
- }
- }
-
- // Create a memento for each node.
- size = list.size();
- IMemento [] results = new IMemento[size];
- for (int x = 0; x < size; x ++) {
- results[x] = new XMLMemento(factory, (Element)list.get(x));
- }
- return results;
- }
-
- /**
- * Return the contents of this memento as a byte array.
- *
- * @return byte[]
- */
- public byte[] getContents() throws IOException {
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- save(out);
- return out.toByteArray();
- }
-
- /**
- * Returns an input stream for writing to the disk with a local locale.
- *
- * @return java.io.InputStream
- */
- public InputStream getInputStream() throws IOException {
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- save(out);
- return new ByteArrayInputStream(out.toByteArray());
- }
-
- /*
- * @see IMemento
- */
- public Float getFloat(String key) {
- Attr attr = element.getAttributeNode(key);
- if (attr == null)
- return null;
- String strValue = attr.getValue();
- try {
- return new Float(strValue);
- } catch (NumberFormatException e) {
- return null;
- }
- }
-
- /*
- * @see IMemento
- */
- public String getId() {
- return element.getAttribute(TAG_ID);
- }
-
- /*
- * @see IMemento
- */
- public String getName() {
- return element.getNodeName();
- }
-
- /*
- * @see IMemento
- */
- public Integer getInteger(String key) {
- Attr attr = element.getAttributeNode(key);
- if (attr == null)
- return null;
- String strValue = attr.getValue();
- try {
- return new Integer(strValue);
- } catch (NumberFormatException e) {
- return null;
- }
- }
-
- /*
- * @see IMemento
- */
- public String getString(String key) {
- Attr attr = element.getAttributeNode(key);
- if (attr == null)
- return null;
- return attr.getValue();
- }
-
- public List getNames() {
- NamedNodeMap map = element.getAttributes();
- int size = map.getLength();
- List list = new ArrayList();
- for (int i = 0; i < size; i++) {
- Node node = map.item(i);
- String name = node.getNodeName();
- list.add(name);
- }
- return list;
- }
-
- /**
- * Loads a memento from the given filename.
- *
- * @param in java.io.InputStream
- * @return org.eclipse.ui.IMemento
- * @exception java.io.IOException
- */
- public static IMemento loadMemento(InputStream in) {
- return createReadRoot(new InputStreamReader(in));
- }
-
- /**
- * Loads a memento from the given filename.
- *
- * @param in java.io.InputStream
- * @return org.eclipse.ui.IMemento
- * @exception java.io.IOException
- */
- public static IMemento loadCorruptMemento(InputStream in) {
- Document document = null;
- try {
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- DocumentBuilder parser = factory.newDocumentBuilder();
- document = parser.parse(in);
- Node node = document.getFirstChild();
- if (node instanceof Element)
- return new XMLMemento(document, (Element) node);
- } catch (Exception e) {
- // ignore
- } finally {
- try {
- in.close();
- } catch (Exception e) {
- // ignore
- }
- }
- return null;
- }
-
- /**
- * Loads a memento from the given filename.
- *
- * @param filename java.lang.String
- * @return org.eclipse.ui.IMemento
- * @exception java.io.IOException
- */
- public static IMemento loadMemento(String filename) throws IOException {
- return XMLMemento.createReadRoot(new FileReader(filename));
- }
-
- /**
- * Loads a memento from the given filename.
- *
- * @param url java.net.URL
- * @return org.eclipse.ui.IMemento
- * @exception java.io.IOException
- */
- public static IMemento loadMemento(URL url) throws IOException {
- return XMLMemento.createReadRoot(new InputStreamReader(url.openStream()));
- }
-
- /*
- * @see IMemento
- */
- private void putElement(Element element2) {
- NamedNodeMap nodeMap = element2.getAttributes();
- int size = nodeMap.getLength();
- for (int i = 0; i < size; i++){
- Attr attr = (Attr)nodeMap.item(i);
- putString(attr.getName(),attr.getValue());
- }
-
- NodeList nodes = element2.getChildNodes();
- size = nodes.getLength();
- for (int i = 0; i < size; i ++) {
- Node node = nodes.item(i);
- if (node instanceof Element) {
- XMLMemento child = (XMLMemento)createChild(node.getNodeName());
- child.putElement((Element)node);
- }
- }
- }
-
- /*
- * @see IMemento
- */
- public void putFloat(String key, float f) {
- element.setAttribute(key, String.valueOf(f));
- }
-
- /*
- * @see IMemento
- */
- public void putInteger(String key, int n) {
- element.setAttribute(key, String.valueOf(n));
- }
-
- /*
- * @see IMemento
- */
- public void putMemento(IMemento memento) {
- XMLMemento xmlMemento = (XMLMemento) memento;
- putElement(xmlMemento.element);
- }
-
- /*
- * @see IMemento
- */
- public void putString(String key, String value) {
- if (value == null)
- return;
- element.setAttribute(key, value);
- }
-
- /**
- * Save this Memento to a Writer.
- */
- public void save(Writer writer) throws IOException {
- Result result = new StreamResult(writer);
- Source source = new DOMSource(factory);
- try {
- Transformer transformer = TransformerFactory.newInstance().newTransformer();
- transformer.setOutputProperty(OutputKeys.INDENT, "yes");
- transformer.setOutputProperty(OutputKeys.METHOD, "xml");
- transformer.setOutputProperty("{http://xml.apache.org/xalan}indent-amount", "2");
- transformer.transform(source, result);
- } catch (Exception e) {
- throw (IOException) (new IOException().initCause(e));
- }
- }
-
- /**
- * Save this Memento to a Writer.
- */
- public void save(OutputStream os) throws IOException {
- Result result = new StreamResult(os);
- Source source = new DOMSource(factory);
- try {
- Transformer transformer = TransformerFactory.newInstance().newTransformer();
- transformer.setOutputProperty(OutputKeys.INDENT, "yes");
- transformer.setOutputProperty(OutputKeys.METHOD, "xml");
- transformer.setOutputProperty("{http://xml.apache.org/xalan}indent-amount", "2");
- transformer.transform(source, result);
- } catch (Exception e) {
- throw (IOException) (new IOException().initCause(e));
- }
- }
-
- /**
- * Saves the memento to the given file.
- *
- * @param filename java.lang.String
- * @exception java.io.IOException
- */
- public void saveToFile(String filename) throws IOException {
- Writer w = null;
- try {
- w = new FileWriter(filename);
- save(w);
- } catch (IOException e) {
- throw e;
- } catch (Exception e) {
- throw new IOException(e.getLocalizedMessage());
- } finally {
- if (w != null) {
- try {
- w.close();
- } catch (Exception e) {
- // ignore
- }
- }
- }
- }
-
- public String saveToString() throws IOException {
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- save(out);
- return out.toString("UTF-8");
- }
-
- /*
- * @see IMemento#getBoolean(String)
- */
- public Boolean getBoolean(String key) {
- Attr attr = element.getAttributeNode(key);
- if (attr == null)
- return null;
- String strValue = attr.getValue();
- if ("true".equalsIgnoreCase(strValue))
- return new Boolean(true);
- return new Boolean(false);
- }
-
- /*
- * @see IMemento#putBoolean(String, boolean)
- */
- public void putBoolean(String key, boolean value) {
- element.setAttribute(key, value ? "true" : "false");
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/package.xml b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/package.xml
deleted file mode 100644
index b4c0529..0000000
--- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/package.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<html>
-<head>
- <!-- Escape to the root of your source folder -->
- <meta
- name="root"
- content="../../../../../" />
- <title>WTP API overview</title>
-</head>
-
-<body>
-
-<p>Support for Java and J2EE server types.</p>
-
-<p>The ClasspathRuntimeTargetHandler class provides a common subclass
-for runtime target handlers that need to modify a project's classpath
-when a project is targetted to a particular runtime.</p>
-
-<p>IGenericRuntime and its working copy provide type-specific access
-to the generic runtime type. When using a generic runtime, clients can
-access the type specific information by adapting to these types using
-<pre>IGenericRuntime gr = (IGenericRuntime) runtime.getAdapter(IGenericRuntime.class)</pre>.
-GenericRuntimeUtil contains some utility methods for handling the
-generic runtime type.</p>
-
-<p>IEnterpriseApplication, IEJBModule, IWebModule, IApplicationClientModule,
-and IConnectorModule are J2EE module interfaces meant to be implemented
-by module delegates that provide J2EE module support.</p>
-
-<p>ILooseArchive and ILooseArchiveSupport are module interfaces for modules
-that take advantage of loose archive support - allowing JARs contained within
-the module to be available in a separate Java project instead of directly
-within the module.</p>
-
-<p>The remainder of the classes in this package are module artifact and
-launchable types to provide access to J2EE resource types for the server tool
-framework.</p>
-
-</body>
-</html>
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.generic.modules/.cvsignore b/plugins/org.eclipse.jst.server.generic.modules/.cvsignore
deleted file mode 100644
index 42654c1..0000000
--- a/plugins/org.eclipse.jst.server.generic.modules/.cvsignore
+++ /dev/null
@@ -1,5 +0,0 @@
-bin
-build.xml
-commonmodules.jar
-org.eclipse.jst.server.generic.modules_1.0.0.jar
-temp.folder
diff --git a/plugins/org.eclipse.jst.server.generic.modules/.project b/plugins/org.eclipse.jst.server.generic.modules/.project
deleted file mode 100644
index af14ba8..0000000
--- a/plugins/org.eclipse.jst.server.generic.modules/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jst.server.generic.ui</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/.classpath b/plugins/org.eclipse.jst.server.tomcat.core/.classpath
deleted file mode 100644
index df44c2e..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="tomcatcore/"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/.cvsignore b/plugins/org.eclipse.jst.server.tomcat.core/.cvsignore
deleted file mode 100644
index b39eed9..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/.cvsignore
+++ /dev/null
@@ -1,5 +0,0 @@
-bin
-build.xml
-org.eclipse.jst.server.tomcat.core_3.0.0.jar
-tomcatcore.jar
-temp.folder
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/.options b/plugins/org.eclipse.jst.server.tomcat.core/.options
deleted file mode 100644
index ceeae58..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/.options
+++ /dev/null
@@ -1,4 +0,0 @@
-# Debugging options for the org.eclipse.jst.server.tomcat.core plugin
-
-# Turn on general debugging
-org.eclipse.jst.server.tomcat.core/debug=true
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/.project b/plugins/org.eclipse.jst.server.tomcat.core/.project
deleted file mode 100644
index 31bbe42..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jst.server.tomcat.core</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/build.properties b/plugins/org.eclipse.jst.server.tomcat.core/build.properties
deleted file mode 100644
index f1ddd4c..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/build.properties
+++ /dev/null
@@ -1,20 +0,0 @@
-###############################################################################
-# Copyright (c) 2004 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
-###############################################################################
-source.tomcatcore.jar = tomcatcore/
-bin.includes = plugin.xml,\
- plugin.properties,\
- verifyInstall.properties,\
- .options,\
- tomcatcore.jar
-jars.compile.order =
-src.includes = schema/,\
- build.properties
-output.tomcatcore.jar = bin/
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/plugin.properties b/plugins/org.eclipse.jst.server.tomcat.core/plugin.properties
deleted file mode 100644
index b7e78c8..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/plugin.properties
+++ /dev/null
@@ -1,132 +0,0 @@
-###############################################################################
-# Copyright (c) 2004, 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
-###############################################################################
-pluginName=Apache Tomcat Support
-providerName=Eclipse.org
-
-# --------------- Runtime Types ---------------
-apache=Apache
-runtimeTypeTomcat32Label=Apache Tomcat v3.2
-runtimeTypeTomcat32Description=Apache Tomcat v3.2 supports J2EE 1.2 Web modules.
-runtimeTypeTomcat40Label=Apache Tomcat v4.0
-runtimeTypeTomcat40Description=Apache Tomcat v4.0 supports J2EE 1.2 and 1.3 Web modules.
-runtimeTypeTomcat41Label=Apache Tomcat v4.1
-runtimeTypeTomcat41Description=Apache Tomcat v4.1 supports J2EE 1.2 and 1.3 Web modules.
-runtimeTypeTomcat50Label=Apache Tomcat v5.0
-runtimeTypeTomcat50Description=Apache Tomcat v5.0 supports J2EE 1.2, 1.3, and 1.4 Web modules.
-runtimeTypeTomcat55Label=Apache Tomcat v5.5
-runtimeTypeTomcat55Description=Apache Tomcat v5.5 supports J2EE 1.2, 1.3, and 1.4 Web modules.
-
-# runtime locator
-runtimeLocatorLabel=Tomcat Runtimes
-runtimeLocatorDescription=Search for Apache Tomcat v3.2, v4.0, v4.1, and v5.0 runtimes.
-
-serverLocatorLabel=Tomcat Servers
-serverLocatorDescription=Search for Apache Tomcat v3.2, v4.0, v4.1, and v5.0 servers.
-
-# runtime target
-target32runtime=Tomcat v3.2 runtime
-target40runtime=Tomcat v4.0 runtime
-target41runtime=Tomcat v4.1 runtime
-target50runtime=Tomcat v5.0 runtime
-target55runtime=Tomcat v5.5 runtime
-
-# --------------- Servers ---------------
-tomcat32ServerType=Tomcat v3.2 Server
-tomcat32ServerDescription=Publishes and runs J2EE Web projects and server configurations to a local Tomcat server.
-
-tomcat40ServerType=Tomcat v4.0 Server
-tomcat40ServerDescription=Publishes and runs J2EE Web projects and server configurations to a local Tomcat server.
-
-tomcat41ServerType=Tomcat v4.1 Server
-tomcat41ServerDescription=Publishes and runs J2EE Web projects and server configurations to a local Tomcat server.
-
-tomcat50ServerType=Tomcat v5.0 Server
-tomcat50ServerDescription=Publishes and runs J2EE Web projects and server configurations to a local Tomcat server.
-
-tomcat55ServerType=Tomcat v5.5 Server
-tomcat55ServerDescription=Publishes and runs J2EE Web projects and server configurations to a local Tomcat server.
-
-# --------------- Tasks (progress monitors) ---------------
-savingTask=Saving...
-loadingTask=Loading...
-updatingConfigurationTask=Updating run-time configuration...
-publishServerTask=Publishing to server...
-publishConfigurationTask=Publishing the configuration...
-publisherPublishTask=Publishing {0}...
-
-publishContextConfigTask=Publishing META-INF/context.xml configurations...
-checkingContextTask=Checking Context {0} for context.xml...
-savingContextConfigTask=Saving context configuration updates...
-serverPostProcessingComplete=Context configurations added.
-
-cleanupServerTask=Removing obsolete files from server...
-detectingRemovedProjects=Preparing list of removed projects...
-deletingContextFilesTask=Deleting obsolete context files from server...
-deletingContextFile=Deleting obsolete context file {0}...
-deletedContextFile=Context file {0} removed
-
-tomcatLaunchConfigurationType=Apache Tomcat
-
-# Editor commands (used in undo/redo menus)
-configurationEditorActionAddMimeMapping=add MIME mapping
-configurationEditorActionAddMimeMappingDescription=Add a MIME mapping
-configurationEditorActionModifyMimeMapping=modify MIME mapping
-configurationEditorActionModifyMimeMappingDescription=Modify the MIME mapping
-configurationEditorActionRemoveMimeMapping=remove MIME mapping
-configurationEditorActionRemoveMimeMappingDescription=Remove a MIME mapping
-configurationEditorActionAddWebModule=add Web module
-configurationEditorActionAddWebModuleDescription=Add a Web module
-configurationEditorActionModifyWebModule=modify Web module
-configurationEditorActionModifyWebModuleDescription=Modify the Web module
-configurationEditorActionRemoveWebModule=remove Web module
-configurationEditorActionRemoveWebModuleDescription=Remove Web module {0}
-configurationEditorActionModifyPort=set port number
-configurationEditorActionModifyPortDescription=Set the port number
-configurationEditorActionEditWebModulePath=edit Web module path
-configurationEditorActionEditWebModuleDescription=Change Web module path from {0} to {1}
-
-# --------------- General ---------------
-canAddModule=Web module can be added to the server.
-canModifyModules=Web modules can be modified.
-portServer=Tomcat admin port
-portUnknown=unknown port
-
-# --------------- Errors and Info ---------------
-errorInstallDir=The Tomcat installation directory is not correct. It does not point to a valid Tomcat installation.
-errorInstallDirTrailingSlash=The Tomcat installation directory should not have a trailing slash.
-errorJRE=The JRE could not be found. Edit the server and change the JRE location.
-errorPortInvalid=The server cannot be started because one or more of the ports are invalid. Open the server editor and correct the invalid ports.
-errorPortInUse=Port {0} required by {1} is already in use. The server may already be running in another process, or a system process may be using the port. \
- To start this server you will need to stop the other process or change the port number(s).
-errorPortsInUse=Several ports ({0}) required by {1} are already in use. The server may already be running in another process, or a system process may be using the port. \
- To start this server you will need to stop the other process or change the port number(s).
-errorNoConfiguration=The Tomcat server configuration at {0} is missing. Check the server for errors.
-errorCouldNotLoadConfiguration=Could not load the Tomcat server configuration at {0}. The configuration may be corrupt or incomplete.
-errorCouldNotSaveConfiguration=Could not save the Tomcat server configuration: {0}.
-errorPublishConfiguration=Could not publish server configuration: {0}.
-errorCouldNotDeleteContextFile=Could not delete obsolete context file: {0}
-errorCleanupServer=Could not clean server of obsolete files: {0}
-errorWebModulesOnly=Tomcat only supports running J2EE Web modules.
-errorSpec32=Tomcat version 3.2 only supports J2EE 1.2 Web modules
-errorSpec40=Tomcat version 4.0 only supports J2EE 1.2 and 1.3 Web modules
-errorSpec41=Tomcat version 4.1 only supports J2EE 1.2 and 1.3 Web modules
-errorSpec50=Tomcat version 5.0 only supports J2EE 1.2, 1.3, and 1.4 Web modules
-errorSpec55=Tomcat version 5.5 only supports J2EE 1.2, 1.3, and 1.4 Web modules
-
-warningJRE=Tomcat requires a Java SDK in order to compile JSP files. Ensure that the JRE preference settings point to an SDK install location.
-
-# Actions (used in undo/redo menus)
-serverEditorActionSetSecure=set security
-serverEditorActionSetSecureDescription=Set the Tomcat security
-serverEditorActionSetDebugMode=set Tomcat debug mode
-serverEditorActionSetDebugModeDescription=Set Tomcat in debug mode
-serverEditorActionSetTestEnvironment=run modules from workspace
-serverEditorActionSetTestEnvironmentDescription=Run modules from the workspace
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/plugin.xml b/plugins/org.eclipse.jst.server.tomcat.core/plugin.xml
deleted file mode 100644
index c34d4df..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/plugin.xml
+++ /dev/null
@@ -1,221 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-
-<plugin id="org.eclipse.jst.server.tomcat.core"
- name="%pluginName"
- version="1.0.0"
- provider-name="%providerName"
- class="org.eclipse.jst.server.tomcat.core.internal.TomcatPlugin">
-
- <runtime>
- <library name="tomcatcore.jar">
- <export name="*"/>
- </library>
- </runtime>
-
- <requires>
- <import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.eclipse.core.resources"/>
- <import plugin="org.eclipse.debug.core"/>
- <import plugin="org.eclipse.jdt.core"/>
- <import plugin="org.eclipse.jdt.launching"/>
- <import plugin="org.eclipse.wst.server.core"/>
- <import plugin="org.eclipse.jst.server.core"/>
- </requires>
-
- <extension point="org.eclipse.wst.server.core.runtimeTypes">
- <runtimeType
- id="org.eclipse.jst.server.tomcat.runtime.32"
- name="%runtimeTypeTomcat32Label"
- description="%runtimeTypeTomcat32Description"
- vendor="%apache"
- version="3.2"
- order="50"
- class="org.eclipse.jst.server.tomcat.core.internal.TomcatRuntime">
- <moduleType
- types="j2ee.web"
- versions="1.2"/>
- </runtimeType>
-
- <runtimeType
- id="org.eclipse.jst.server.tomcat.runtime.40"
- name="%runtimeTypeTomcat40Label"
- description="%runtimeTypeTomcat40Description"
- vendor="%apache"
- version="4.0"
- order="52"
- class="org.eclipse.jst.server.tomcat.core.internal.TomcatRuntime">
- <moduleType
- types="j2ee.web"
- versions="1.2, 1.3"/>
- </runtimeType>
-
- <runtimeType
- id="org.eclipse.jst.server.tomcat.runtime.41"
- name="%runtimeTypeTomcat41Label"
- description="%runtimeTypeTomcat41Description"
- vendor="%apache"
- version="4.1"
- order="54"
- class="org.eclipse.jst.server.tomcat.core.internal.TomcatRuntime">
- <moduleType
- types="j2ee.web"
- versions="1.2, 1.3"/>
- </runtimeType>
-
- <runtimeType
- id="org.eclipse.jst.server.tomcat.runtime.50"
- name="%runtimeTypeTomcat50Label"
- description="%runtimeTypeTomcat50Description"
- vendor="%apache"
- version="5.0"
- order="56"
- class="org.eclipse.jst.server.tomcat.core.internal.TomcatRuntime">
- <moduleType
- types="j2ee.web"
- versions="1.2, 1.3, 1.4"/>
- </runtimeType>
-
- <runtimeType
- id="org.eclipse.jst.server.tomcat.runtime.55"
- name="%runtimeTypeTomcat55Label"
- description="%runtimeTypeTomcat55Description"
- vendor="%apache"
- version="5.5"
- order="58"
- class="org.eclipse.jst.server.tomcat.core.internal.TomcatRuntime">
- <moduleType
- types="j2ee.web"
- versions="1.2, 1.3, 1.4"/>
- </runtimeType>
-
- </extension>
-
- <extension point="org.eclipse.wst.server.core.runtimeLocators">
- <runtimeLocator
- id="org.eclipse.jst.server.tomcat.runtime.locator"
- typeIds="org.eclipse.jst.server.tomcat.runtime.*"
- class="org.eclipse.jst.server.tomcat.core.internal.TomcatRuntimeLocator"/>
- </extension>
-
- <extension point="org.eclipse.wst.server.core.runtimeTargetHandlers">
- <runtimeTargetHandler
- id="org.eclipse.jst.server.tomcat.runtimeTarget"
- runtimeTypeIds="org.eclipse.jst.server.tomcat.runtime.*"
- class="org.eclipse.jst.server.tomcat.core.internal.TomcatRuntimeTargetHandler"/>
- </extension>
-
- <extension point="org.eclipse.wst.server.core.serverTypes">
- <serverType
- id="org.eclipse.jst.server.tomcat.32"
- name="%tomcat32ServerType"
- description="%tomcat32ServerDescription"
- supportsRemoteHosts="false"
- runtime="true"
- order="50"
- startTimeout="45000"
- stopTimeout="15000"
- initialState="stopped"
- hasConfiguration="true"
- launchConfigId="org.eclipse.jst.server.tomcat.core.launchConfigurationType"
- runtimeTypeId="org.eclipse.jst.server.tomcat.runtime.32"
- class="org.eclipse.jst.server.tomcat.core.internal.TomcatServer"
- behaviourClass="org.eclipse.jst.server.tomcat.core.internal.TomcatServerBehaviour">
- </serverType>
- <serverType
- id="org.eclipse.jst.server.tomcat.40"
- name="%tomcat40ServerType"
- description="%tomcat40ServerDescription"
- supportsRemoteHosts="false"
- runtime="true"
- order="52"
- startTimeout="45000"
- stopTimeout="15000"
- initialState="stopped"
- hasConfiguration="true"
- launchConfigId="org.eclipse.jst.server.tomcat.core.launchConfigurationType"
- runtimeTypeId="org.eclipse.jst.server.tomcat.runtime.40"
- class="org.eclipse.jst.server.tomcat.core.internal.TomcatServer"
- behaviourClass="org.eclipse.jst.server.tomcat.core.internal.TomcatServerBehaviour">
- </serverType>
- <serverType
- id="org.eclipse.jst.server.tomcat.41"
- name="%tomcat41ServerType"
- description="%tomcat41ServerDescription"
- supportsRemoteHosts="false"
- runtime="true"
- order="54"
- startTimeout="45000"
- stopTimeout="15000"
- initialState="stopped"
- hasConfiguration="true"
- launchConfigId="org.eclipse.jst.server.tomcat.core.launchConfigurationType"
- runtimeTypeId="org.eclipse.jst.server.tomcat.runtime.41"
- class="org.eclipse.jst.server.tomcat.core.internal.TomcatServer"
- behaviourClass="org.eclipse.jst.server.tomcat.core.internal.TomcatServerBehaviour">
- </serverType>
- <serverType
- id="org.eclipse.jst.server.tomcat.50"
- name="%tomcat50ServerType"
- description="%tomcat50ServerDescription"
- supportsRemoteHosts="false"
- runtime="true"
- order="56"
- startTimeout="45000"
- stopTimeout="15000"
- initialState="stopped"
- hasConfiguration="true"
- launchConfigId="org.eclipse.jst.server.tomcat.core.launchConfigurationType"
- runtimeTypeId="org.eclipse.jst.server.tomcat.runtime.50"
- class="org.eclipse.jst.server.tomcat.core.internal.TomcatServer"
- behaviourClass="org.eclipse.jst.server.tomcat.core.internal.TomcatServerBehaviour">
- </serverType>
- <serverType
- id="org.eclipse.jst.server.tomcat.55"
- name="%tomcat55ServerType"
- description="%tomcat55ServerDescription"
- supportsRemoteHosts="false"
- runtime="true"
- order="58"
- startTimeout="45000"
- stopTimeout="15000"
- initialState="stopped"
- hasConfiguration="true"
- launchConfigId="org.eclipse.jst.server.tomcat.core.launchConfigurationType"
- runtimeTypeId="org.eclipse.jst.server.tomcat.runtime.55"
- class="org.eclipse.jst.server.tomcat.core.internal.TomcatServer"
- behaviourClass="org.eclipse.jst.server.tomcat.core.internal.TomcatServerBehaviour">
- </serverType>
- </extension>
-
- <extension point="org.eclipse.wst.server.core.serverLocators">
- <serverLocator
- id="org.eclipse.jst.server.tomcat.server.locator"
- supportsRemoteHosts="false"
- typeIds="org.eclipse.jst.server.tomcat.*"
- class="org.eclipse.jst.server.tomcat.core.internal.TomcatServerLocator"/>
- </extension>
-
- <extension point="org.eclipse.wst.server.core.launchableAdapters">
- <launchableAdapter
- class="org.eclipse.jst.server.tomcat.core.internal.TomcatLaunchableAdapterDelegate"
- id="org.eclipse.jst.server.tomcat.web"/>
- </extension>
-
- <extension point="org.eclipse.debug.core.sourcePathComputers">
- <sourcePathComputer
- id="org.eclipse.jst.server.tomcat.core.sourcePathComputer"
- class="org.eclipse.jst.server.tomcat.core.internal.TomcatSourcePathComputerDelegate"/>
- </extension>
-
- <extension point="org.eclipse.debug.core.launchConfigurationTypes">
- <launchConfigurationType
- id="org.eclipse.jst.server.tomcat.core.launchConfigurationType"
- name="%tomcatLaunchConfigurationType"
- delegate="org.eclipse.jst.server.tomcat.core.internal.TomcatLaunchConfigurationDelegate"
- modes="run, debug"
- sourceLocatorId="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector"
- sourcePathComputerId="org.eclipse.jst.server.tomcat.core.sourcePathComputer"/>
- </extension>
-
-</plugin>
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/ClassDetector.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/ClassDetector.java
deleted file mode 100644
index 2ff8737..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/ClassDetector.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.jst.server.tomcat.core.internal;
-/**
- * Utility class to check for the existence of a class given as an
- * argument.
- */
-public class ClassDetector {
- public static void main(String[] args) {
- if (args == null || args.length != 1) {
- System.out.println("Usage: ClassDetector [className]");
- return;
- }
-
- try {
- Class.forName(args[0]);
- System.out.println("true");
- } catch (Exception e) {
- System.out.println("false");
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/FileUtil.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/FileUtil.java
deleted file mode 100644
index 162a5db..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/FileUtil.java
+++ /dev/null
@@ -1,274 +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.jst.server.tomcat.core.internal;
-
-import java.io.*;
-import java.net.URL;
-import org.eclipse.core.runtime.*;
-/**
- * Utility class with an assortment of useful file methods.
- */
-public class FileUtil {
- // size of the buffer
- private static final int BUFFER = 10240;
-
- // the buffer
- private static byte[] buf = new byte[BUFFER];
-
- /**
- * FileUtil cannot be created. Use static methods.
- */
- private FileUtil() {
- super();
- }
-
- /**
- * Copys a directory from a to b.
- *
- * @param from java.lang.String
- * @param to java.lang.String
- */
- public static void copyDirectory(String from, String to, IProgressMonitor monitor) {
- try {
- File fromDir = new File(from);
- File toDir = new File(to);
-
- File[] files = fromDir.listFiles();
-
- toDir.mkdir();
-
- // cycle through files
- int size = files.length;
- monitor = ProgressUtil.getMonitorFor(monitor);
- monitor.beginTask(TomcatPlugin.getResource("%copyingTask", new String[] {from, to}), size * 50);
-
- for (int i = 0; i < size; i++) {
- File current = files[i];
- String fromFile = current.getAbsolutePath();
- String toFile = to;
- if (!toFile.endsWith(File.separator))
- toFile += File.separator;
- toFile += current.getName();
- if (current.isFile()) {
- copyFile(fromFile, toFile);
- monitor.worked(50);
- } else if (current.isDirectory()) {
- monitor.subTask(TomcatPlugin.getResource("%copyingTask", new String[] {fromFile, toFile}));
- copyDirectory(fromFile, toFile, ProgressUtil.getSubMonitorFor(monitor, 50));
- }
- if (monitor.isCanceled())
- return;
- }
- monitor.done();
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error copying directory", e);
- }
- }
-
- /**
- * Copy a file from a to b. Closes the input stream after use.
- *
- * @param in java.io.InputStream
- * @param to java.lang.String
- */
- public static IStatus copyFile(InputStream in, String to) {
- OutputStream out = null;
-
- try {
- out = new FileOutputStream(to);
-
- int avail = in.read(buf);
- while (avail > 0) {
- out.write(buf, 0, avail);
- avail = in.read(buf);
- }
- return new Status(IStatus.OK, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%copyingTask", new String[] {to}), null);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error copying file", e);
- return new Status(IStatus.ERROR, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%errorCopyingFile", new String[] {to, e.getLocalizedMessage()}), e);
- } finally {
- try {
- if (in != null)
- in.close();
- } catch (Exception ex) {
- // ignore
- }
- try {
- if (out != null)
- out.close();
- } catch (Exception ex) {
- // ignore
- }
- }
- }
-
- /**
- * Copy a file from a to b.
- *
- * @param from java.lang.String
- * @param to java.lang.String
- */
- public static IStatus copyFile(String from, String to) {
- try {
- return copyFile(new FileInputStream(from), to);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error copying file", e);
- return new Status(IStatus.ERROR, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%errorCopyingFile", new String[] {to, e.getLocalizedMessage()}), e);
- }
- }
-
- /**
- * Copy a file from a to b.
- *
- * @param from java.net.URL
- * @param to java.lang.String
- */
- public static IStatus copyFile(URL from, String to) {
- try {
- return copyFile(from.openStream(), to);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error copying file", e);
- return new Status(IStatus.ERROR, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%errorCopyingFile", new String[] {to, e.getLocalizedMessage()}), e);
- }
- }
-
- /**
- * Recursively deletes a directory.
- *
- * @param dir java.io.File
- */
- public static void deleteDirectory(File dir, IProgressMonitor monitor) {
- try {
- if (!dir.exists() || !dir.isDirectory())
- return;
-
- File[] files = dir.listFiles();
- int size = files.length;
- monitor = ProgressUtil.getMonitorFor(monitor);
- monitor.beginTask(TomcatPlugin.getResource("%deletingTask", new String[] {dir.getAbsolutePath()}), size * 10);
-
- // cycle through files
- for (int i = 0; i < size; i++) {
- File current = files[i];
- if (current.isFile()) {
- current.delete();
- monitor.worked(10);
- } else if (current.isDirectory()) {
- monitor.subTask(TomcatPlugin.getResource("%deletingTask", new String[] {current.getAbsolutePath()}));
- deleteDirectory(current, ProgressUtil.getSubMonitorFor(monitor, 10));
- }
- }
- dir.delete();
- monitor.done();
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error deleting directory " + dir.getAbsolutePath(), e);
- }
- }
-
- /**
- * Copys a directory from a to b, only modifying as needed
- * and deleting old files and directories.
- *
- * @param from a directory
- * @param to a directory
- * @param monitor a progress monitor
- */
- public static void smartCopyDirectory(String from, String to, IProgressMonitor monitor) {
- try {
- File fromDir = new File(from);
- File toDir = new File(to);
-
- File[] fromFiles = fromDir.listFiles();
- int fromSize = fromFiles.length;
-
- monitor = ProgressUtil.getMonitorFor(monitor);
- monitor.beginTask(TomcatPlugin.getResource("%copyingTask", new String[] {from, to}), 550);
-
- File[] toFiles = null;
-
- // delete old files and directories from this directory
- if (toDir.exists() && toDir.isDirectory()) {
- toFiles = toDir.listFiles();
- int toSize = toFiles.length;
-
- // check if this exact file exists in the new directory
- for (int i = 0; i < toSize; i++) {
- String name = toFiles[i].getName();
- boolean isDir = toFiles[i].isDirectory();
- boolean found = false;
- for (int j = 0; j < fromSize; j++) {
- if (name.equals(fromFiles[j].getName()) && isDir == fromFiles[j].isDirectory())
- found = true;
- }
-
- // delete file if it can't be found or isn't the correct type
- if (!found) {
- if (isDir)
- deleteDirectory(toFiles[i], new NullProgressMonitor());
- else
- toFiles[i].delete();
- }
- if (monitor.isCanceled())
- return;
- }
- } else {
- if (toDir.isFile())
- toDir.delete();
- toDir.mkdir();
- }
- monitor.worked(50);
-
- // cycle through files and only copy when it doesn't exist
- // or is newer
- toFiles = toDir.listFiles();
- int toSize = toFiles.length;
- int dw = 0;
- if (toSize > 0)
- dw = 500 / toSize;
-
- for (int i = 0; i < fromSize; i++) {
- File current = fromFiles[i];
-
- // check if this is a new or newer file
- boolean copy = true;
- if (!current.isDirectory()) {
- String name = current.getName();
- long mod = current.lastModified();
- for (int j = 0; j < toSize; j++) {
- if (name.equals(toFiles[j].getName()) && mod <= toFiles[j].lastModified())
- copy = false;
- }
- }
-
- if (copy) {
- String fromFile = current.getAbsolutePath();
- String toFile = to;
- if (!toFile.endsWith(File.separator))
- toFile += File.separator;
- toFile += current.getName();
- if (current.isFile()) {
- copyFile(fromFile, toFile);
- monitor.worked(dw);
- } else if (current.isDirectory()) {
- monitor.subTask(TomcatPlugin.getResource("%copyingTask", new String[] {fromFile, toFile}));
- smartCopyDirectory(fromFile, toFile, ProgressUtil.getSubMonitorFor(monitor, dw));
- }
- }
- if (monitor.isCanceled())
- return;
- }
- monitor.worked(500 - dw * toSize);
- monitor.done();
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error smart copying directory " + from + " - " + to, e);
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/IMimeMapping.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/IMimeMapping.java
deleted file mode 100644
index ee5946f..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/IMimeMapping.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.jst.server.tomcat.core.internal;
-/**
- *
- */
-public interface IMimeMapping {
- /**
- * Returns the extension.
- *
- * @return the extension
- */
- public String getExtension();
-
- /**
- * Returns the mime type.
- *
- * @return the mime type
- */
- public String getMimeType();
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/ITomcatConfiguration.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/ITomcatConfiguration.java
deleted file mode 100644
index b9bada1..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/ITomcatConfiguration.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.jst.server.tomcat.core.internal;
-
-import java.util.List;
-/**
- *
- */
-public interface ITomcatConfiguration {
- /**
- * Returns a list of mime mappings.
- *
- * @return mime mappings
- */
- public List getMimeMappings();
-
- /**
- * Returns a list of ServerPorts that this configuration uses.
- *
- * @return the server ports
- */
- public List getServerPorts();
-
- /**
- * Return a list of the web modules in this server.
- *
- * @return the web modules
- */
- public List getWebModules();
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/ITomcatConfigurationWorkingCopy.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/ITomcatConfigurationWorkingCopy.java
deleted file mode 100644
index 73a5c1b..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/ITomcatConfigurationWorkingCopy.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.jst.server.tomcat.core.internal;
-
-
-public interface ITomcatConfigurationWorkingCopy extends ITomcatConfiguration {
- /**
- * Add a web module.
- *
- * @param index int
- * @param module org.eclipse.jst.server.tomcat.WebModule
- */
- public void addWebModule(int index, ITomcatWebModule module);
-
- /**
- * Change a web module.
- *
- * @param index int
- * @param docBase java.lang.String
- * @param path java.lang.String
- * @param reloadable boolean
- */
- public void modifyWebModule(int index, String docBase, String path, boolean reloadable);
-
- /**
- * Remove a web module.
- *
- * @param index int
- */
- public void removeWebModule(int index);
-
- /**
- * Adds a mime mapping.
- *
- * @param index int
- * @param map MimeMapping
- */
- public void addMimeMapping(int index, IMimeMapping map);
-
- /**
- * Change a mime mapping.
- *
- * @param index int
- * @param map MimeMapping
- */
- public void modifyMimeMapping(int index, IMimeMapping map);
-
- /**
- * Modify the port with the given id.
- *
- * @param id java.lang.String
- * @param port int
- */
- public void modifyServerPort(String id, int port);
-
- /**
- * Remove a mime mapping.
- *
- * @param index int
- */
- public void removeMimeMapping(int index);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/ITomcatRuntime.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/ITomcatRuntime.java
deleted file mode 100644
index 282a53a..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/ITomcatRuntime.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.jst.server.tomcat.core.internal;
-
-import java.util.List;
-
-import org.eclipse.jdt.launching.IVMInstall;
-/**
- *
- *
- * @since 1.0
- */
-public interface ITomcatRuntime {
- /**
- * Return the VM install (installed JRE) that this runtime is using.
- *
- * @return the current VM install
- */
- public IVMInstall getVMInstall();
-
- /**
- * Returns the runtime classpath that is used by this runtime.
- *
- * @return the runtime classpath
- */
- public List getRuntimeClasspath();
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/ITomcatRuntimeWorkingCopy.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/ITomcatRuntimeWorkingCopy.java
deleted file mode 100644
index ac7a94c..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/ITomcatRuntimeWorkingCopy.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.jst.server.tomcat.core.internal;
-
-import org.eclipse.jdt.launching.IVMInstall;
-/**
- *
- * @since 1.0
- */
-public interface ITomcatRuntimeWorkingCopy extends ITomcatRuntime {
- /**
- * Set the VM install (installed JRE) that this runtime is using.
- *
- * @param vmInstall the VM install to use
- */
- public void setVMInstall(IVMInstall vmInstall);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/ITomcatServer.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/ITomcatServer.java
deleted file mode 100644
index 1cd0044..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/ITomcatServer.java
+++ /dev/null
@@ -1,27 +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.jst.server.tomcat.core.internal;
-
-import org.eclipse.wst.server.core.model.IURLProvider;
-/**
- *
- * @since 1.0
- */
-public interface ITomcatServer extends IURLProvider {
- public static final String PROPERTY_TEST_ENVIRONMENT = "testEnvironment";
- /**
- * Returns true if this is a test (publish and run code out of the
- * workbench) environment server.
- *
- * @return boolean
- */
- public boolean isTestEnvironment();
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/ITomcatServerBehaviour.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/ITomcatServerBehaviour.java
deleted file mode 100644
index ce5cceb..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/ITomcatServerBehaviour.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.jst.server.tomcat.core.internal;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.model.IProcess;
-/**
- *
- * @since 1.0
- */
-public interface ITomcatServerBehaviour {
- /**
- * Returns the main class that is used to launch the Tomcat server.
- *
- * @return the main runtime class
- */
- public String getRuntimeClass();
-
- /**
- * Set the process that is monitored for Tomcat startup and shutdown.
- * Warning: Do not call this method unless you know what you're doing;
- * it should only be used in rare cases.
- *
- * @param newProcess
- */
- public void setProcess(IProcess newProcess);
-
- /**
- * Setup for starting the server.
- *
- * @param launch ILaunch
- * @param launchMode String
- * @param monitor IProgressMonitor
- */
- public void setupLaunch(ILaunch launch, String launchMode, IProgressMonitor monitor) throws CoreException;
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/ITomcatServerWorkingCopy.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/ITomcatServerWorkingCopy.java
deleted file mode 100644
index 6d97523..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/ITomcatServerWorkingCopy.java
+++ /dev/null
@@ -1,23 +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.jst.server.tomcat.core.internal;
-/**
- *
- * @since 1.0
- */
-public interface ITomcatServerWorkingCopy extends ITomcatServer {
- /**
- * Sets this server to test environment mode.
- *
- * @param b boolean
- */
- public void setTestEnvironment(boolean b);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/ITomcatVersionHandler.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/ITomcatVersionHandler.java
deleted file mode 100644
index 69cc9e3..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/ITomcatVersionHandler.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.jst.server.tomcat.core.internal;
-
-import java.util.List;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jst.server.core.IWebModule;
-/**
- *
- */
-public interface ITomcatVersionHandler {
- public boolean verifyInstallPath(IPath installPath);
-
- public String getRuntimeClass();
-
- public List getRuntimeClasspath(IPath installPath);
-
- public String[] getRuntimeProgramArguments(IPath configPath, boolean debug, boolean starting);
-
- public String[] getRuntimeVMArguments(IPath installPath, IPath configPath, boolean isSecure);
-
- /**
- * Returns true if the given project is supported by this
- * server, and false otherwise.
- *
- * @param module a web module
- * @return the status
- */
- public IStatus canAddModule(IWebModule module);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/ITomcatWebModule.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/ITomcatWebModule.java
deleted file mode 100644
index 7cb88b8..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/ITomcatWebModule.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.jst.server.tomcat.core.internal;
-/**
- * A Web module deployed on Tomcat.
- */
-public interface ITomcatWebModule {
- /**
- * Get the document base.
- *
- * @return java.lang.String
- */
- public String getDocumentBase();
-
- /**
- * Return the path. (context root)
- *
- * @return java.lang.String
- */
- public String getPath();
-
- /**
- * Return the memento.
- *
- * @return java.lang.String
- */
- public String getMemento();
-
- /**
- * Return true if the web module is auto-reloadable.
- *
- * @return java.lang.String
- */
- public boolean isReloadable();
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/JavaSourceLookupUtil.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/JavaSourceLookupUtil.java
deleted file mode 100644
index 6cc10fc..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/JavaSourceLookupUtil.java
+++ /dev/null
@@ -1,207 +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.jst.server.tomcat.core.internal;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.debug.core.sourcelookup.ISourceContainer;
-import org.eclipse.debug.core.sourcelookup.containers.ExternalArchiveSourceContainer;
-import org.eclipse.jdt.core.IJavaModel;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
-import org.eclipse.jdt.launching.sourcelookup.containers.JavaProjectSourceContainer;
-import org.eclipse.jdt.launching.sourcelookup.containers.PackageFragmentRootSourceContainer;
-/**
- * Java source lookup utility. Taken directly from
- * org.eclipse.jdt.internal.launching.JavaSourceLookupUtil since it is private.
- */
-public class JavaSourceLookupUtil {
- /**
- * Translates the given runtime classpath entries into associated source
- * containers.
- *
- * @param entries entries to translate
- * @param considerSourceAttachments whether to consider source attachments
- * when comparing against existing packagr fragment roots
- */
- public static ISourceContainer[] translate(IRuntimeClasspathEntry[] entries, boolean considerSourceAttachments) {
- List containers = new ArrayList(entries.length);
- for (int i = 0; i < entries.length; i++) {
- IRuntimeClasspathEntry entry = entries[i];
- switch (entry.getType()) {
- case IRuntimeClasspathEntry.ARCHIVE:
- IPackageFragmentRoot root = getPackageFragmentRoot(entry, considerSourceAttachments);
- String path = entry.getSourceAttachmentLocation();
- if (root == null && path == null && considerSourceAttachments) {
- // use the pkg frag root it there is no source attachment
- root = getPackageFragmentRoot(entry, false);
- }
- if (root == null) {
- ISourceContainer container = null;
- if (path == null) {
- // use the archive itself
- container = new ExternalArchiveSourceContainer(entry.getLocation(), true);
- } else {
- container = new ExternalArchiveSourceContainer(path, true);
-
- }
- if (!containers.contains(container)) {
- containers.add(container);
- }
- } else {
- ISourceContainer container = new PackageFragmentRootSourceContainer(root);
- if (!containers.contains(container)) {
- containers.add(container);
- }
- }
- break;
- case IRuntimeClasspathEntry.PROJECT:
- IResource resource = entry.getResource();
- if (resource != null && resource.getType() == IResource.PROJECT) {
- ISourceContainer container = new JavaProjectSourceContainer(JavaCore.create((IProject)resource));
- if (!containers.contains(container)) {
- containers.add(container);
- }
- }
- break;
- default:
- // no other classpath types are valid in a resolved path
- break;
- }
- }
- return (ISourceContainer[]) containers.toArray(new ISourceContainer[containers.size()]);
- }
-
- /**
- * Returns whether the given objects are equal, allowing
- * for <code>null</code>.
- *
- * @param a
- * @param b
- * @return whether the given objects are equal, allowing
- * for <code>null</code>
- */
- private static boolean equalOrNull(Object a, Object b) {
- if (a == null) {
- return b == null;
- }
- if (b == null) {
- return false;
- }
- return a.equals(b);
- }
-
- /**
- * Returns whether the source attachments of the given package fragment
- * root and runtime classpath entry are equal.
- *
- * @param root package fragment root
- * @param entry runtime classpath entry
- * @return whether the source attachments of the given package fragment
- * root and runtime classpath entry are equal
- * @throws JavaModelException
- */
- private static boolean isSourceAttachmentEqual(IPackageFragmentRoot root, IRuntimeClasspathEntry entry) throws JavaModelException {
- return equalOrNull(root.getSourceAttachmentPath(), entry.getSourceAttachmentPath());
- }
-
- /**
- * Determines if the given archive runtime classpath entry exists
- * in the workspace as a package fragment root. Returns the associated
- * package fragment root possible, otherwise
- * <code>null</code>.
- *
- * @param entry archive runtime classpath entry
- * @param considerSourceAttachment whether the source attachments should be
- * considered comparing against package fragment roots
- * @return package fragment root or <code>null</code>
- */
- private static IPackageFragmentRoot getPackageFragmentRoot(IRuntimeClasspathEntry entry, boolean considerSourceAttachment) {
- IResource resource = entry.getResource();
- if (resource == null) {
- // Check all package fragment roots for case of external archive.
- // External jars are shared, so it does not matter which project it
- // originates from
- IJavaModel model = JavaCore.create(ResourcesPlugin.getWorkspace().getRoot());
- try {
- IJavaProject[] jps = model.getJavaProjects();
- for (int i = 0; i < jps.length; i++) {
- IJavaProject jp = jps[i];
- IProject p = jp.getProject();
- if (p.isOpen()) {
- IPackageFragmentRoot[] allRoots = jp.getPackageFragmentRoots();
- for (int j = 0; j < allRoots.length; j++) {
- IPackageFragmentRoot root = allRoots[j];
- if (root.isExternal() && root.getPath().equals(new Path(entry.getLocation()))) {
- if (!considerSourceAttachment || isSourceAttachmentEqual(root, entry)) {
- // use package fragment root
- return root;
- }
- }
- }
- }
- }
- } catch (JavaModelException e) {
- TomcatPlugin.log(e);
- }
- } else {
- // check if the archive is a package fragment root
- IProject project = resource.getProject();
- IJavaProject jp = JavaCore.create(project);
- try {
- if (project.isOpen() && jp.exists()) {
- IPackageFragmentRoot root = jp.getPackageFragmentRoot(resource);
- IPackageFragmentRoot[] allRoots = jp.getPackageFragmentRoots();
- for (int j = 0; j < allRoots.length; j++) {
- if (allRoots[j].equals(root)) {
- // ensure source attachment paths match
- if (!considerSourceAttachment || isSourceAttachmentEqual(root, entry)) {
- // use package fragment root
- return root;
- }
- }
- }
-
- }
- // check all other java projects to see if another project references
- // the archive
- IJavaModel model = JavaCore.create(ResourcesPlugin.getWorkspace().getRoot());
- IJavaProject[] jps = model.getJavaProjects();
- for (int i = 0; i < jps.length; i++) {
- IJavaProject jp1 = jps[i];
- IProject p = jp1.getProject();
- if (p.isOpen()) {
- IPackageFragmentRoot[] allRoots = jp1.getPackageFragmentRoots();
- for (int j = 0; j < allRoots.length; j++) {
- IPackageFragmentRoot root = allRoots[j];
- if (!root.isExternal() && root.getPath().equals(entry.getPath())) {
- if (!considerSourceAttachment || isSourceAttachmentEqual(root, entry)) {
- // use package fragment root
- return root;
- }
- }
- }
- }
- }
- } catch (JavaModelException e) {
- TomcatPlugin.log(e);
- }
- }
- return null;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/MimeMapping.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/MimeMapping.java
deleted file mode 100644
index 47c7f97..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/MimeMapping.java
+++ /dev/null
@@ -1,44 +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.jst.server.tomcat.core.internal;
-
-/**
- * A mime mapping.
- */
-public class MimeMapping implements IMimeMapping {
- private String extension;
- private String mimeType;
-
- /**
- * MimeMapping constructor comment.
- */
- public MimeMapping(String extension, String mimeType) {
- super();
- this.extension = extension;
- this.mimeType = mimeType;
- }
-
- /**
- * Returns the extension.
- * @return java.lang.String
- */
- public String getExtension() {
- return extension;
- }
-
- /**
- * Returns the mime type.
- * @return java.lang.String
- */
- public String getMimeType() {
- return mimeType;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/ProgressUtil.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/ProgressUtil.java
deleted file mode 100644
index 4a619bf..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/ProgressUtil.java
+++ /dev/null
@@ -1,68 +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.jst.server.tomcat.core.internal;
-
-import org.eclipse.core.runtime.*;
-/**
- * Progress Monitor utility.
- */
-public class ProgressUtil {
- /**
- * ProgressUtil constructor comment.
- */
- private ProgressUtil() {
- super();
- }
-
- /**
- * Return a valid progress monitor.
- *
- * @param monitor org.eclipse.core.runtime.IProgressMonitor
- * @return org.eclipse.core.runtime.IProgressMonitor
- */
- public static IProgressMonitor getMonitorFor(IProgressMonitor monitor) {
- if (monitor == null)
- return new NullProgressMonitor();
- return monitor;
- }
-
- /**
- * Return a sub-progress monitor with the given amount on the
- * current progress monitor.
- *
- * @param monitor org.eclipse.core.runtime.IProgressMonitor
- * @param ticks int
- * @return org.eclipse.core.runtime.IProgressMonitor
- */
- public static IProgressMonitor getSubMonitorFor(IProgressMonitor monitor, int ticks) {
- if (monitor == null)
- return new NullProgressMonitor();
- if (monitor instanceof NullProgressMonitor)
- return monitor;
- return new SubProgressMonitor(monitor, ticks);
- }
-
- /**
- * Return a sub-progress monitor with the given amount on the
- * current progress monitor.
- *
- * @param monitor org.eclipse.core.runtime.IProgressMonitor
- * @param ticks int
- * @return org.eclipse.core.runtime.IProgressMonitor
- */
- public static IProgressMonitor getSubMonitorFor(IProgressMonitor monitor, int ticks, int style) {
- if (monitor == null)
- return new NullProgressMonitor();
- if (monitor instanceof NullProgressMonitor)
- return monitor;
- return new SubProgressMonitor(monitor, ticks, style);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat32Configuration.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat32Configuration.java
deleted file mode 100644
index 1212ebe..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat32Configuration.java
+++ /dev/null
@@ -1,627 +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.jst.server.tomcat.core.internal;
-
-import java.io.*;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.runtime.*;
-import org.eclipse.jst.server.tomcat.core.internal.xml.Factory;
-import org.eclipse.jst.server.tomcat.core.internal.xml.XMLUtil;
-import org.eclipse.jst.server.tomcat.core.internal.xml.server32.Connector;
-import org.eclipse.jst.server.tomcat.core.internal.xml.server32.Context;
-import org.eclipse.jst.server.tomcat.core.internal.xml.server32.ContextManager;
-import org.eclipse.jst.server.tomcat.core.internal.xml.server32.Parameter;
-import org.eclipse.jst.server.tomcat.core.internal.xml.server32.Server;
-import org.w3c.dom.Document;
-import org.xml.sax.InputSource;
-
-import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.IServerPort;
-import org.eclipse.wst.server.core.util.ServerPort;
-/**
- * Tomcat v3.2 server configuration.
- */
-public class Tomcat32Configuration extends TomcatConfiguration {
- public static final String ID = "org.eclipse.tomcat.configuration.32";
-
- protected static final String HTTP_HANDLER = "org.apache.tomcat.service.http.HttpConnectionHandler";
- protected static final String APACHE_HANDLER = "org.apache.tomcat.service.connector.Ajp12ConnectionHandler";
- protected static final String SSL_SOCKET_FACTORY = "org.apache.tomcat.net.SSLSocketFactory";
-
- protected Server server;
- protected Factory serverFactory;
- protected boolean isServerDirty;
-
- protected WebAppDocument webAppDocument;
-
- protected Document tomcatUsersDocument;
-
- protected String policyFile;
-
- /**
- * Tomcat32Configuration constructor comment.
- */
- public Tomcat32Configuration(IFolder path) {
- super(path);
- }
-
- /**
- * Return the root of the docbase parameter.
- *
- * @return java.lang.String
- */
- protected String getDocBaseRoot() {
- return "";
- }
-
- /**
- * Returns the main server port.
- * @return TomcatServerPort
- */
- public IServerPort getMainPort() {
- Iterator iterator = getServerPorts().iterator();
- while (iterator.hasNext()) {
- IServerPort port = (IServerPort) iterator.next();
- if (port.getName().equals("HTTP Connector"))
- return port;
- }
- return null;
- }
-
- /**
- * Returns the mime mappings.
- * @return java.util.List
- */
- public List getMimeMappings() {
- if (webAppDocument == null)
- return new ArrayList(0);
-
- return webAppDocument.getMimeMappings();
- }
-
- /**
- * Returns the prefix that is used in front of the
- * web module path property. (e.g. "webapps")
- *
- * @return java.lang.String
- */
- public String getPathPrefix() {
- return "webapps";
- }
-
- /**
- * Return the docBase of the ROOT web module.
- *
- * @return java.lang.String
- */
- protected String getROOTModuleDocBase() {
- return "webapps/ROOT";
- }
-
- /**
- * Returns the server object (root of server.xml).
- * @return org.eclipse.jst.server.tomcat.internal.xml.server32.Server
- */
- public Server getServer() {
- return server;
- }
-
- /**
- * Returns a list of ServerPorts that this configuration uses.
- *
- * @return java.util.List
- */
- public List getServerPorts() {
- List ports = new ArrayList();
-
- try {
- int count = server.getContextManager().getConnectorCount();
- for (int i = 0; i < count; i++) {
- Connector connector = server.getContextManager().getConnector(i);
- int paramCount = connector.getParameterCount();
- String handler = null;
- String name = TomcatPlugin.getResource("%portUnknown");
- String socketFactory = null;
- String protocol = "TCPIP";
- boolean advanced = true;
- String[] contentTypes = null;
- int port = -1;
- for (int j = 0; j < paramCount; j++) {
- Parameter p = connector.getParameter(j);
- if ("port".equals(p.getName())) {
- try {
- port = Integer.parseInt(p.getValue());
- } catch (Exception e) {
- // ignore
- }
- } else if ("handler".equals(p.getName()))
- handler = p.getValue();
- else if ("socketFactory".equals(p.getName()))
- socketFactory = p.getValue();
- }
- if (HTTP_HANDLER.equals(handler)) {
- protocol = "HTTP";
- contentTypes = new String[] { "web", "webservices" };
- if (SSL_SOCKET_FACTORY.equals(socketFactory)) {
- protocol = "SSL";
- name = "SSL Connector";
- } else {
- name = "HTTP Connector";
- advanced = false;
- }
- } else if (APACHE_HANDLER.equals(handler))
- name = "Apache Connector";
- if (handler != null)
- ports.add(new ServerPort(i + "", name, port, protocol, contentTypes, advanced));
- }
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error getting server ports", e);
- }
-
- return ports;
- }
-
- /**
- * Returns the tomcat-users.xml document.
- *
- * @return org.w3c.dom.Document
- */
- public Document getTomcatUsersDocument() {
- return tomcatUsersDocument;
- }
-
- /**
- * Return a list of the web modules in this server.
- * @return java.util.List
- */
- public List getWebModules() {
- List list = new ArrayList();
-
- try {
- ContextManager contextManager = server.getContextManager();
-
- int size = contextManager.getContextCount();
- for (int i = 0; i < size; i++) {
- Context context = contextManager.getContext(i);
- String reload = context.getReloadable();
- if (reload == null)
- reload = "false";
- WebModule module = new WebModule(context.getPath(),
- context.getDocBase(), context.getSource(),
- reload.equalsIgnoreCase("true") ? true : false);
- list.add(module);
- }
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error getting project refs", e);
- }
-
- return list;
- }
-
- /**
- * Load a Tomcat configuration from the given directory.
- * @param path
- * @return org.eclipse.jst.server.tomcat.internal.Tomcat32Configuration
- */
- public void load(IPath path, IProgressMonitor monitor) throws CoreException {
- try {
- monitor = ProgressUtil.getMonitorFor(monitor);
- monitor.beginTask(TomcatPlugin.getResource("%loadingTask"), 5);
-
- // check for tomcat.policy to verify that this is a v3.2 config
- InputStream in = new FileInputStream(path.append("tomcat.policy").toFile());
- in.read();
- in.close();
- monitor.worked(1);
-
- // create server.xml
- serverFactory = new Factory();
- serverFactory.setPackageName("org.eclipse.jst.server.tomcat.core.internal.xml.server32");
- server = (Server) serverFactory.loadDocument(new FileInputStream(path.append("server.xml").toFile()));
- monitor.worked(1);
-
- webAppDocument = new WebAppDocument(path.append("web.xml"));
- monitor.worked(1);
-
- tomcatUsersDocument = XMLUtil.getDocumentBuilder().parse(new InputSource(new FileInputStream(path.append("tomcat-users.xml").toFile())));
- monitor.worked(1);
-
- // load policy file
- BufferedReader br = null;
- try {
- br = new BufferedReader(new InputStreamReader(new FileInputStream(path.append("tomcat.policy").toFile())));
- String temp = br.readLine();
- policyFile = "";
- while (temp != null) {
- policyFile += temp + "\n";
- temp = br.readLine();
- }
- br.close();
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not load policy file", e);
- } finally {
- if (br != null)
- br.close();
- }
- monitor.worked(1);
-
- if (monitor.isCanceled())
- return;
-
- monitor.done();
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not load Tomcat v3.2 configuration from " + path.toOSString() + ": " + e.getMessage());
- throw new CoreException(new Status(IStatus.ERROR, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%errorCouldNotLoadConfiguration", path.toOSString()), e));
- }
- }
-
- /**
- * Reload a Tomcat configuration from the given resource.
- *
- * @param folder a folder
- * @param monitor a progress monitor
- */
- public void load(IFolder folder, IProgressMonitor monitor) throws CoreException {
- try {
- monitor = ProgressUtil.getMonitorFor(monitor);
- monitor.beginTask(TomcatPlugin.getResource("%loadingTask"), 800);
-
- // check for tomcat.policy to verify that this is a v3.2 config
- IFile file = folder.getFile("tomcat.policy");
- if (!file.exists())
- throw new CoreException(new Status(IStatus.WARNING, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%errorCouldNotLoadConfiguration", folder.getFullPath().toOSString()), null));
-
- // load server.xml
- file = folder.getFile("server.xml");
- InputStream in = file.getContents();
- serverFactory = new Factory();
- serverFactory.setPackageName("org.eclipse.jst.server.tomcat.core.internal.xml.server32");
- server = (Server) serverFactory.loadDocument(in);
- monitor.worked(200);
-
- // load web.xml
- file = folder.getFile("web.xml");
- webAppDocument = new WebAppDocument(file);
- monitor.worked(200);
-
- // load tomcat-users.xml
- file = folder.getFile("tomcat-users.xml");
- in = file.getContents();
-
- tomcatUsersDocument = XMLUtil.getDocumentBuilder().parse(new InputSource(in));
- monitor.worked(200);
-
- // load tomcat.policy
- file = folder.getFile("tomcat.policy");
- in = file.getContents();
- BufferedReader br = null;
- try {
- br = new BufferedReader(new InputStreamReader(in));
- String temp = br.readLine();
- policyFile = "";
- while (temp != null) {
- policyFile += temp + "\n";
- temp = br.readLine();
- }
- br.close();
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not load policy file", e);
- } finally {
- if (br != null)
- br.close();
- }
- monitor.worked(200);
-
- if (monitor.isCanceled())
- throw new Exception("Cancelled");
-
- monitor.done();
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not load Tomcat v3.2 configuration from: " + folder.getFullPath() + ": " + e.getMessage());
- throw new CoreException(new Status(IStatus.ERROR, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%errorCouldNotLoadConfiguration", folder.getFullPath().toOSString()), e));
- }
- }
-
- /**
- * Save the information held by this object to the given directory.
- *
- * @param path a path
- * @param forceDirty if true, the files will be saved, regardless
- * of whether they have been modified
- * @param monitor a progress monitor
- * @throws CoreException
- */
- protected void save(IPath path, boolean forceDirty, IProgressMonitor monitor) throws CoreException {
- try {
- monitor = ProgressUtil.getMonitorFor(monitor);
- monitor.beginTask(TomcatPlugin.getResource("%savingTask"), 5);
-
- // make sure directory exists
- if (!path.toFile().exists()) {
- forceDirty = true;
- path.toFile().mkdir();
- }
- monitor.worked(1);
-
- // save files
- if (forceDirty || isServerDirty)
- serverFactory.save(path.append("server.xml").toOSString());
- monitor.worked(1);
-
- webAppDocument.save(path.append("web.xml").toOSString(), forceDirty);
- monitor.worked(1);
-
- if (forceDirty)
- XMLUtil.save(path.append("tomcat-users.xml").toOSString(), tomcatUsersDocument);
- monitor.worked(1);
-
- if (forceDirty) {
- BufferedWriter bw = new BufferedWriter(new FileWriter(path.append("tomcat.policy").toFile()));
- bw.write(policyFile);
- bw.close();
- }
- monitor.worked(1);
- isServerDirty = false;
-
- if (monitor.isCanceled())
- return;
- monitor.done();
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not save Tomcat v3.2 configuration to " + path, e);
- throw new CoreException(new Status(IStatus.ERROR, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%errorCouldNotSaveConfiguration", new String[] {e.getLocalizedMessage()}), e));
- }
- }
-
- public void save(IPath path, IProgressMonitor monitor) throws CoreException {
- save(path, true, monitor);
- }
-
- /**
- * Save the information held by this object to the given directory.
- *
- * @param folder a folder
- * @param monitor a progress monitor
- * @throws CoreException
- */
- public void save(IFolder folder, IProgressMonitor monitor) throws CoreException {
- try {
- monitor = ProgressUtil.getMonitorFor(monitor);
- monitor.beginTask(TomcatPlugin.getResource("%savingTask"), 900);
-
- if (!folder.exists())
- folder.create(true, true, ProgressUtil.getSubMonitorFor(monitor, 100));
- else
- monitor.worked(100);
-
- // save server.xml
- byte[] data = serverFactory.getContents();
- InputStream in = new ByteArrayInputStream(data);
- IFile file = folder.getFile("server.xml");
- if (file.exists()) {
- if (isServerDirty)
- file.setContents(in, true, true, ProgressUtil.getSubMonitorFor(monitor, 200));
- else
- monitor.worked(200);
- } else
- file.create(in, true, ProgressUtil.getSubMonitorFor(monitor, 200));
-
- // save web.xml
- file = folder.getFile("web.xml");
- webAppDocument.save(file, ProgressUtil.getSubMonitorFor(monitor, 200));
-
- // save tomcat-users.xml
- data = XMLUtil.getContents(tomcatUsersDocument);
- in = new ByteArrayInputStream(data);
- file = folder.getFile("tomcat-users.xml");
- if (file.exists())
- monitor.worked(200);
- //file.setContents(in, true, true, ProgressUtil.getSubMonitorFor(monitor, 200));
- else
- file.create(in, true, ProgressUtil.getSubMonitorFor(monitor, 200));
-
- // save tomcat.policy
- in = new ByteArrayInputStream(policyFile.getBytes());
- file = folder.getFile("tomcat.policy");
- if (file.exists())
- monitor.worked(200);
- //file.setContents(in, true, true, ProgressUtil.getSubMonitorFor(monitor, 200));
- else
- file.create(in, true, ProgressUtil.getSubMonitorFor(monitor, 200));
-
- if (monitor.isCanceled())
- return;
- monitor.done();
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not save Tomcat v3.2 configuration to " + folder.getFullPath(), e);
- throw new CoreException(new Status(IStatus.ERROR, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%errorCouldNotSaveConfiguration", new String[] {e.getLocalizedMessage()}), e));
- }
- }
-
-
- /**
- * Adds a mime mapping.
- * @param map MimeMapping
- */
- public void addMimeMapping(int index, IMimeMapping map) {
- webAppDocument.addMimeMapping(index, map);
- firePropertyChangeEvent(ADD_MAPPING_PROPERTY, new Integer(index), map);
- }
-
- /**
- * Add a web module.
- * @param module org.eclipse.jst.server.tomcat.WebModule
- */
- public void addWebModule(int index, ITomcatWebModule module) {
- try {
- ContextManager contextManager = server.getContextManager();
- Context context = (Context) contextManager.createElement(index, "Context");
-
- context.setPath(module.getPath());
- context.setDocBase(module.getDocumentBase());
- context.setReloadable(module.isReloadable() ? "true" : "false");
- if (module.getMemento() != null && module.getMemento().length() > 0)
- context.setSource(module.getMemento());
- isServerDirty = true;
- firePropertyChangeEvent(ADD_WEB_MODULE_PROPERTY, null, module);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error adding web module", e);
- }
- }
-
- /**
- * Localize the web projects in this configuration.
- *
- * @param path a path
- * @param monitor a progress monitor
- */
- public void localizeConfiguration(IPath path, TomcatServer serverType, IRuntime runtime, IProgressMonitor monitor) {
- try {
- monitor = ProgressUtil.getMonitorFor(monitor);
- monitor.beginTask(TomcatPlugin.getResource("%updatingConfigurationTask"), 100);
-
- Tomcat32Configuration config = new Tomcat32Configuration(null);
- config.load(path, ProgressUtil.getSubMonitorFor(monitor, 30));
-
- if (monitor.isCanceled())
- return;
-
- if (serverType.isTestEnvironment()) {
- config.server.getContextManager().setHome(runtime.getLocation().toOSString());
- config.isServerDirty = true;
- } else {
- //IServerConfigurationWorkingCopy scwc = config.getServerConfiguration().createWorkingCopy();
- //Tomcat32Configuration cfg = (Tomcat32Configuration) scwc.getAdapter(Tomcat32Configuration.class);
- config.localizeWebModules();
- }
-
- monitor.worked(40);
-
- if (monitor.isCanceled())
- return;
-
- config.save(path, false, ProgressUtil.getSubMonitorFor(monitor, 30));
-
- if (!monitor.isCanceled())
- monitor.done();
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error localizing configuration", e);
- }
- }
-
- /**
- * Go through all of the web modules and make the document
- * base "local" to the configuration.
- */
- protected void localizeWebModules() {
- List modules = getWebModules();
-
- int size = modules.size();
- for (int i = 0; i < size; i++) {
- WebModule module = (WebModule) modules.get(i);
- String memento = module.getMemento();
- if (memento != null && memento.length() > 0) {
- // update document base to a relative ref
- String docBase = getPathPrefix() + module.getPath();
- if (docBase.startsWith("/") || docBase.startsWith("\\"))
- docBase = docBase.substring(1);
- modifyWebModule(i, docBase, module.getPath(), module.isReloadable());
- }
- }
- }
-
- /**
- * Change the extension of a mime mapping.
- *
- * @param index
- * @param map
- */
- public void modifyMimeMapping(int index, IMimeMapping map) {
- webAppDocument.modifyMimeMapping(index, map);
- firePropertyChangeEvent(MODIFY_MAPPING_PROPERTY, new Integer(index), map);
- }
-
- /**
- * Modify the port with the given id.
- *
- * @param id java.lang.String
- * @param port int
- */
- public void modifyServerPort(String id, int port) {
- try {
- int con = Integer.parseInt(id);
- Connector connector = server.getContextManager().getConnector(con);
-
- int size = connector.getParameterCount();
- for (int i = 0; i < size; i++) {
- Parameter p = connector.getParameter(i);
- if ("port".equals(p.getName())) {
- p.setValue(port + "");
- isServerDirty = true;
- firePropertyChangeEvent(MODIFY_PORT_PROPERTY, id, new Integer(port));
- return;
- }
- }
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error modifying server port " + id, e);
- }
- }
-
- /**
- * Change a web module.
- * @param index int
- * @param docBase java.lang.String
- * @param path java.lang.String
- * @param reloadable boolean
- */
- public void modifyWebModule(int index, String docBase, String path, boolean reloadable) {
- try {
- ContextManager contextManager = server.getContextManager();
- Context context = contextManager.getContext(index);
- context.setPath(path);
- context.setDocBase(docBase);
- context.setReloadable(reloadable ? "true" : "false");
- isServerDirty = true;
- WebModule module = new WebModule(path, docBase, null, reloadable);
- firePropertyChangeEvent(MODIFY_WEB_MODULE_PROPERTY, new Integer(index), module);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error modifying web module " + index, e);
- }
- }
-
- /**
- * Removes a mime mapping.
- * @param index int
- */
- public void removeMimeMapping(int index) {
- webAppDocument.removeMimeMapping(index);
- firePropertyChangeEvent(REMOVE_MAPPING_PROPERTY, null, new Integer(index));
- }
-
- /**
- * Removes a web module.
- * @param index int
- */
- public void removeWebModule(int index) {
- try {
- ContextManager contextManager = server.getContextManager();
- contextManager.removeElement("Context", index);
- isServerDirty = true;
- firePropertyChangeEvent(REMOVE_WEB_MODULE_PROPERTY, null, new Integer(index));
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error removing web module " + index, e);
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat32Handler.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat32Handler.java
deleted file mode 100644
index e50395f..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat32Handler.java
+++ /dev/null
@@ -1,110 +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.jst.server.tomcat.core.internal;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jdt.launching.JavaRuntime;
-import org.eclipse.jst.server.core.IWebModule;
-/**
- * Tomcat 32 handler.
- */
-public class Tomcat32Handler implements ITomcatVersionHandler {
- public boolean verifyInstallPath(IPath installPath) {
- return TomcatPlugin.verifyInstallPath(installPath, TomcatPlugin.TOMCAT_32);
- }
-
- /**
- * Return the runtime class name.
- *
- * @return java.lang.String
- */
- public String getRuntimeClass() {
- return "org.apache.tomcat.startup.Tomcat";
- }
-
- public List getRuntimeClasspath(IPath installPath) {
- List cp = new ArrayList();
- // add all jars from the Tomcat lib directory
- File libDir = installPath.append("lib").toFile();
- if (libDir.exists()) {
- String[] libs = libDir.list();
- for (int i = 0; i < libs.length; i++) {
- if (libs[i].endsWith("jar")) {
- IPath path = installPath.append("lib").append(libs[i]);
- cp.add(JavaRuntime.newArchiveRuntimeClasspathEntry(path));
- }
- }
- }
-
- return cp;
- }
-
- /**
- * Return the program's runtime arguments.
- *
- * @return java.lang.String[]
- */
- public String[] getRuntimeProgramArguments(IPath configPath, boolean debug, boolean starting) {
- List list = new ArrayList();
- if (configPath != null) {
- list.add("-f");
- list.add("\"" + configPath.append("conf").append("server.xml").toOSString() + "\"");
- }
-
- if (!starting)
- list.add("-stop");
-
- String[] s = new String[list.size()];
- list.toArray(s);
- return s;
- }
-
- /**
- * Return the runtime (VM) arguments.
- *
- * @return java.lang.String[]
- */
- public String[] getRuntimeVMArguments(IPath installPath, IPath configPath, boolean isSecure) {
- List list = new ArrayList();
- list.add("-Dtomcat.home=\"" + installPath.toOSString() + "\"");
-
- // run in secure mode
- if (isSecure) {
- list.add("-Djava.security.manager");
- IPath dir = configPath.append("conf").append("tomcat.policy");
- list.add("-Djava.security.policy=\"" + dir.toOSString() + "\"");
- }
-
- String[] s = new String[list.size()];
- list.toArray(s);
- return s;
- }
-
- /**
- * Returns true if the given project is supported by this
- * server, and false otherwise.
- *
- * @param module a web module
- * @return the status
- */
- public IStatus canAddModule(IWebModule module) {
- if ("1.2".equals(module.getJ2EESpecificationVersion()))
- return new Status(IStatus.OK, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%canAddModule"), null);
-
- return new Status(IStatus.ERROR, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%errorSpec32"), null);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat40Configuration.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat40Configuration.java
deleted file mode 100644
index 2ac314e..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat40Configuration.java
+++ /dev/null
@@ -1,637 +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.jst.server.tomcat.core.internal;
-
-import java.io.BufferedReader;
-import java.io.BufferedWriter;
-import java.io.ByteArrayInputStream;
-import java.io.FileInputStream;
-import java.io.FileWriter;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.runtime.*;
-import org.eclipse.jst.server.tomcat.core.internal.xml.Factory;
-import org.eclipse.jst.server.tomcat.core.internal.xml.XMLUtil;
-import org.eclipse.jst.server.tomcat.core.internal.xml.server40.*;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.xml.sax.InputSource;
-
-import org.eclipse.wst.server.core.IServerPort;
-import org.eclipse.wst.server.core.util.ServerPort;
-/**
- * Tomcat v4.0 server configuration.
- */
-public class Tomcat40Configuration extends TomcatConfiguration {
- protected static final String DEFAULT_SERVICE = "Tomcat-Standalone";
- protected static final String HTTP_CONNECTOR = "org.apache.catalina.connector.http.HttpConnector";
- protected static final String SSL_SOCKET_FACTORY = "org.apache.catalina.net.SSLServerSocketFactory";
- protected static final String TEST_CONNECTOR = "org.apache.catalina.connector.test.HttpConnector";
- protected static final String APACHE_CONNECTOR = "org.apache.catalina.connector.warp.WarpConnector";
-
- protected Server server;
- protected Factory serverFactory;
- protected boolean isServerDirty;
-
- protected WebAppDocument webAppDocument;
-
- protected Document tomcatUsersDocument;
-
- protected String policyFile;
- protected boolean isPolicyDirty;
-
- /**
- * Tomcat40Configuration constructor comment.
- */
- public Tomcat40Configuration(IFolder path) {
- super(path);
- }
-
- /**
- * Returns the root of the docbase parameter.
- *
- * @return java.lang.String
- */
- protected String getDocBaseRoot() {
- return "webapps/";
- }
-
- /**
- * Return the port number.
- * @return int
- */
- public IServerPort getMainPort() {
- Iterator iterator = getServerPorts().iterator();
- while (iterator.hasNext()) {
- IServerPort port = (IServerPort) iterator.next();
- if (port.getName().equals("HTTP Connector"))
- return port;
- }
- return null;
- }
-
- /**
- * Returns the mime mappings.
- * @return java.util.List
- */
- public List getMimeMappings() {
- return webAppDocument.getMimeMappings();
- }
-
- /**
- * Returns the prefix that is used in front of the
- * web module path property. (e.g. "webapps")
- *
- * @return java.lang.String
- */
- public String getPathPrefix() {
- return "";
- }
-
- /**
- * Return the docBase of the ROOT web module.
- *
- * @return java.lang.String
- */
- protected String getROOTModuleDocBase() {
- return "ROOT";
- }
-
- /**
- * Returns a list of ServerPorts that this configuration uses.
- *
- * @return java.util.List
- */
- public List getServerPorts() {
- List ports = new ArrayList();
-
- // first add server port
- try {
- int port = Integer.parseInt(server.getPort());
- ports.add(new ServerPort("server", TomcatPlugin.getResource("%portServer"), port, "TCPIP"));
- } catch (Exception e) {
- // ignore
- }
-
- // add connectors
- try {
- int size = server.getServiceCount();
- for (int i = 0; i < size; i++) {
- Service service = server.getService(i);
- int size2 = service.getConnectorCount();
- for (int j = 0; j < size2; j++) {
- Connector connector = service.getConnector(j);
- String className = connector.getClassName();
- String name = TomcatPlugin.getResource("%portUnknown");
- String protocol = "TCPIP";
- boolean advanced = true;
- String[] contentTypes = null;
- int port = -1;
- try {
- port = Integer.parseInt(connector.getPort());
- } catch (Exception e) {
- // ignore
- }
- if (HTTP_CONNECTOR.equals(className)) {
- name = "HTTP Connector";
- protocol = "HTTP";
- contentTypes = new String[] { "web", "webservices" };
- // check for SSL connector
- try {
- Element element = connector.getSubElement("Factory");
- if (SSL_SOCKET_FACTORY.equals(element.getAttribute("className"))) {
- name = "SSL Connector";
- protocol = "SSL";
- }
- } catch (Exception e) {
- // ignore
- }
- if ("HTTP".equals(protocol))
- advanced = false;
- } else if (APACHE_CONNECTOR.equals(className))
- name = "Apache Connector";
- if (className != null && className.length() > 0)
- ports.add(new ServerPort(i + "/" + j, name, port, protocol, contentTypes, advanced));
- }
- }
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error getting server ports", e);
- }
- return ports;
- }
-
- /**
- * Return a list of the web modules in this server.
- * @return java.util.List
- */
- public List getWebModules() {
- List list = new ArrayList();
-
- try {
- int size = server.getServiceCount();
- for (int i = 0; i < size; i++) {
- Service service = server.getService(i);
- if (service.getName().equalsIgnoreCase(DEFAULT_SERVICE)) {
- Engine engine = service.getEngine();
- Host host = engine.getHost();
- int size2 = host.getContextCount();
- for (int j = 0; j < size2; j++) {
- Context context = host.getContext(j);
- String reload = context.getReloadable();
- if (reload == null)
- reload = "false";
- WebModule module = new WebModule(context.getPath(),
- context.getDocBase(), context.getSource(),
- reload.equalsIgnoreCase("true") ? true : false);
- list.add(module);
- }
- }
- }
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error getting modules", e);
- }
- return list;
- }
-
- /**
- * @param path a path
- * @param monitor a progress monitor
- */
- public void load(IPath path, IProgressMonitor monitor) throws CoreException {
- try {
- monitor = ProgressUtil.getMonitorFor(monitor);
- monitor.beginTask(TomcatPlugin.getResource("%loadingTask"), 5);
-
- // check for catalina.policy to verify that this is a v4.0 config
- InputStream in = new FileInputStream(path.append("catalina.policy").toFile());
- in.read();
- in.close();
- monitor.worked(1);
-
- serverFactory = new Factory();
- serverFactory.setPackageName("org.eclipse.jst.server.tomcat.core.internal.xml.server40");
- server = (Server) serverFactory.loadDocument(new FileInputStream(path.append("server.xml").toFile()));
- monitor.worked(1);
-
- webAppDocument = new WebAppDocument(path.append("web.xml"));
- monitor.worked(1);
-
- tomcatUsersDocument = XMLUtil.getDocumentBuilder().parse(new InputSource(new FileInputStream(path.append("tomcat-users.xml").toFile())));
- monitor.worked(1);
-
- // load policy file
- BufferedReader br = null;
- try {
- br = new BufferedReader(new InputStreamReader(new FileInputStream(path.append("catalina.policy").toFile())));
- String temp = br.readLine();
- policyFile = "";
- while (temp != null) {
- policyFile += temp + "\n";
- temp = br.readLine();
- }
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Could not load policy file", e);
- } finally {
- if (br != null)
- br.close();
- }
- monitor.worked(1);
-
- if (monitor.isCanceled())
- return;
- monitor.done();
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Could not load Tomcat v4.0 configuration from " + path.toOSString() + ": " + e.getMessage());
- throw new CoreException(new Status(IStatus.ERROR, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%errorCouldNotLoadConfiguration", path.toOSString()), e));
- }
- }
-
- /**
- * Load the configuration.
- *
- * @param folder a folder
- * @param monitor a progress monitor
- */
- public void load(IFolder folder, IProgressMonitor monitor) throws CoreException {
- try {
- monitor = ProgressUtil.getMonitorFor(monitor);
- monitor.beginTask(TomcatPlugin.getResource("%loadingTask"), 800);
-
- // check for catalina.policy to verify that this is a v4.0 config
- IFile file = folder.getFile("catalina.policy");
- if (!file.exists())
- throw new CoreException(new Status(IStatus.WARNING, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%errorCouldNotLoadConfiguration", folder.getFullPath().toOSString()), null));
-
- // load server.xml
- file = folder.getFile("server.xml");
- InputStream in = file.getContents();
- serverFactory = new Factory();
- serverFactory.setPackageName("org.eclipse.jst.server.tomcat.core.internal.xml.server40");
- server = (Server) serverFactory.loadDocument(in);
- monitor.worked(200);
-
- // load web.xml
- file = folder.getFile("web.xml");
- webAppDocument = new WebAppDocument(file);
- monitor.worked(200);
-
- // load tomcat-users.xml
- file = folder.getFile("tomcat-users.xml");
- in = file.getContents();
-
- tomcatUsersDocument = XMLUtil.getDocumentBuilder().parse(new InputSource(in));
- monitor.worked(200);
-
- // load catalina.policy
- file = folder.getFile("catalina.policy");
- in = file.getContents();
- BufferedReader br = null;
- try {
- br = new BufferedReader(new InputStreamReader(in));
- String temp = br.readLine();
- policyFile = "";
- while (temp != null) {
- policyFile += temp + "\n";
- temp = br.readLine();
- }
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Could not load policy file", e);
- } finally {
- if (br != null)
- br.close();
- }
- monitor.worked(200);
-
- if (monitor.isCanceled())
- throw new Exception("Cancelled");
- monitor.done();
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Could not reload Tomcat v4.0 configuration from: " + folder.getFullPath() + ": " + e.getMessage());
- throw new CoreException(new Status(IStatus.ERROR, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%errorCouldNotLoadConfiguration", folder.getFullPath().toOSString()), e));
- }
- }
-
- /**
- * Save to the given directory.
- *
- * @param path a path
- * @param forceDirty boolean
- * @param monitor a progress monitor
- * @exception CoreException
- */
- protected void save(IPath path, boolean forceDirty, IProgressMonitor monitor) throws CoreException {
- try {
- monitor = ProgressUtil.getMonitorFor(monitor);
- monitor.beginTask(TomcatPlugin.getResource("%savingTask"), 3);
-
- // make sure directory exists
- if (!path.toFile().exists()) {
- forceDirty = true;
- path.toFile().mkdir();
- }
- monitor.worked(1);
-
- // save files
- if (forceDirty || isServerDirty)
- serverFactory.save(path.append("server.xml").toOSString());
- monitor.worked(1);
-
- //if (forceDirty || isWebAppDirty)
- // webAppFactory.save(dirPath + "web.xml");
- //webAppDocument.save(path.toOSString(), forceDirty || isPolicyDirty);
- webAppDocument.save(path.append("web.xml").toOSString(), forceDirty);
- monitor.worked(1);
-
- if (forceDirty)
- XMLUtil.save(path.append("tomcat-users.xml").toOSString(), tomcatUsersDocument);
- monitor.worked(1);
-
- if (forceDirty || isPolicyDirty) {
- BufferedWriter bw = new BufferedWriter(new FileWriter(path.append("catalina.policy").toFile()));
- bw.write(policyFile);
- bw.close();
- }
- monitor.worked(1);
- isServerDirty = false;
- isPolicyDirty = false;
-
- if (monitor.isCanceled())
- return;
- monitor.done();
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not save Tomcat v4.0 configuration to " + path, e);
- throw new CoreException(new Status(IStatus.ERROR, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%errorCouldNotSaveConfiguration", new String[] {e.getLocalizedMessage()}), e));
- }
- }
-
- public void save(IPath path, IProgressMonitor monitor) throws CoreException {
- save(path, true, monitor);
- }
-
- /**
- * Save the information held by this object to the given directory.
- *
- * @param folder a folder
- * @param monitor a progress monitor
- * @throws CoreException
- */
- public void save(IFolder folder, IProgressMonitor monitor) throws CoreException {
- try {
- monitor = ProgressUtil.getMonitorFor(monitor);
- monitor.beginTask(TomcatPlugin.getResource("%savingTask"), 900);
-
- // save server.xml
- byte[] data = serverFactory.getContents();
- InputStream in = new ByteArrayInputStream(data);
- IFile file = folder.getFile("server.xml");
- if (file.exists()) {
- if (isServerDirty)
- file.setContents(in, true, true, ProgressUtil.getSubMonitorFor(monitor, 200));
- else
- monitor.worked(200);
- } else
- file.create(in, true, ProgressUtil.getSubMonitorFor(monitor, 200));
-
- // save web.xml
- webAppDocument.save(folder.getFile("web.xml"), ProgressUtil.getSubMonitorFor(monitor, 200));
-
- // save tomcat-users.xml
- data = XMLUtil.getContents(tomcatUsersDocument);
- in = new ByteArrayInputStream(data);
- file = folder.getFile("tomcat-users.xml");
- if (file.exists())
- monitor.worked(200);
- //file.setContents(in, true, true, ProgressUtil.getSubMonitorFor(monitor, 200));
- else
- file.create(in, true, ProgressUtil.getSubMonitorFor(monitor, 200));
-
- // save catalina.policy
- in = new ByteArrayInputStream(policyFile.getBytes());
- file = folder.getFile("catalina.policy");
- if (file.exists())
- monitor.worked(200);
- //file.setContents(in, true, true, ProgressUtil.getSubMonitorFor(monitor, 200));
- else
- file.create(in, true, ProgressUtil.getSubMonitorFor(monitor, 200));
-
- if (monitor.isCanceled())
- return;
- monitor.done();
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not save Tomcat v4.0 configuration to " + folder.toString(), e);
- throw new CoreException(new Status(IStatus.ERROR, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%errorCouldNotSaveConfiguration", new String[] {e.getLocalizedMessage()}), e));
- }
- }
-
- /**
- * Adds a mime mapping.
- *
- * @param index
- * @param map
- */
- public void addMimeMapping(int index, IMimeMapping map) {
- webAppDocument.addMimeMapping(index, map);
- firePropertyChangeEvent(ADD_MAPPING_PROPERTY, new Integer(index), map);
- }
-
- /**
- * Add a web module.
- * @param module org.eclipse.jst.server.tomcat.WebModule
- */
- public void addWebModule(int index, ITomcatWebModule module) {
- try {
- int size = server.getServiceCount();
- for (int i = 0; i < size; i++) {
- Service service = server.getService(i);
- if (service.getName().equalsIgnoreCase(DEFAULT_SERVICE)) {
- Engine engine = service.getEngine();
- Host host = engine.getHost();
- Context context = (Context) host.createElement(index, "Context");
- context.setDocBase(module.getDocumentBase());
- context.setPath(module.getPath());
- context.setReloadable(module.isReloadable() ? "true" : "false");
- if (module.getMemento() != null && module.getMemento().length() > 0)
- context.setSource(module.getMemento());
- isServerDirty = true;
- firePropertyChangeEvent(ADD_WEB_MODULE_PROPERTY, null, module);
- return;
- }
- }
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error adding web module " + module.getPath(), e);
- }
- }
-
- /**
- * Localize the web projects in this configuration.
- *
- * @param path a path
- * @param monitor a progress monitor
- */
- public void localizeConfiguration(IPath path, TomcatServer server2, IProgressMonitor monitor) {
- try {
- monitor = ProgressUtil.getMonitorFor(monitor);
- monitor.beginTask(TomcatPlugin.getResource("%updatingConfigurationTask"), 100);
-
- Tomcat40Configuration config = new Tomcat40Configuration(null);
- config.load(path, ProgressUtil.getSubMonitorFor(monitor, 40));
-
- if (monitor.isCanceled())
- return;
-
- if (!server2.isTestEnvironment()) {
- //IServerConfigurationWorkingCopy scwc = config.getServerConfiguration().createWorkingCopy();
- //Tomcat40Configuration cfg = (Tomcat40Configuration) scwc.getAdapter(Tomcat40Configuration.class);
- config.localizeWebModules();
- }
-
- monitor.worked(20);
-
- if (monitor.isCanceled())
- return;
-
- config.save(path, false, ProgressUtil.getSubMonitorFor(monitor, 40));
-
- if (!monitor.isCanceled())
- monitor.done();
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error localizing configuration", e);
- }
- }
-
- /**
- * Go through all of the web modules and make the document
- * base "local" to the configuration.
- */
- protected void localizeWebModules() {
- List modules = getWebModules();
-
- int size = modules.size();
- for (int i = 0; i < size; i++) {
- WebModule module = (WebModule) modules.get(i);
- String memento = module.getMemento();
- if (memento != null && memento.length() > 0) {
- // update document base to a relative ref
- String docBase = getPathPrefix() + module.getPath();
- if (docBase.startsWith("/") || docBase.startsWith("\\"))
- docBase = docBase.substring(1);
- modifyWebModule(i, docBase, module.getPath(), module.isReloadable());
- }
- }
- }
-
- /**
- * Change the extension of a mime mapping.
- *
- * @param index
- * @param map
- */
- public void modifyMimeMapping(int index, IMimeMapping map) {
- webAppDocument.modifyMimeMapping(index, map);
- firePropertyChangeEvent(MODIFY_MAPPING_PROPERTY, new Integer(index), map);
- }
-
- /**
- * Modify the port with the given id.
- *
- * @param id java.lang.String
- * @param port int
- */
- public void modifyServerPort(String id, int port) {
- try {
- if ("server".equals(id)) {
- server.setPort(port + "");
- isServerDirty = true;
- firePropertyChangeEvent(MODIFY_PORT_PROPERTY, id, new Integer(port));
- return;
- }
-
- int i = id.indexOf("/");
- int servNum = Integer.parseInt(id.substring(0, i));
- int connNum = Integer.parseInt(id.substring(i + 1));
-
- Service service = server.getService(servNum);
- Connector connector = service.getConnector(connNum);
- connector.setPort(port + "");
- isServerDirty = true;
- firePropertyChangeEvent(MODIFY_PORT_PROPERTY, id, new Integer(port));
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error modifying server port " + id, e);
- }
- }
- /**
- * Change a web module.
- * @param index int
- * @param docBase java.lang.String
- * @param path java.lang.String
- * @param reloadable boolean
- */
- public void modifyWebModule(int index, String docBase, String path, boolean reloadable) {
- try {
- int size = server.getServiceCount();
- for (int i = 0; i < size; i++) {
- Service service = server.getService(i);
- if (service.getName().equalsIgnoreCase(DEFAULT_SERVICE)) {
- Engine engine = service.getEngine();
- Host host = engine.getHost();
- Context context = host.getContext(index);
- context.setPath(path);
- context.setDocBase(docBase);
- context.setReloadable(reloadable ? "true" : "false");
- isServerDirty = true;
- WebModule module = new WebModule(path, docBase, null, reloadable);
- firePropertyChangeEvent(MODIFY_WEB_MODULE_PROPERTY, new Integer(index), module);
- return;
- }
- }
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error modifying web module " + index, e);
- }
- }
-
- /**
- * Removes a mime mapping.
- * @param index int
- */
- public void removeMimeMapping(int index) {
- webAppDocument.removeMimeMapping(index);
- firePropertyChangeEvent(REMOVE_MAPPING_PROPERTY, null, new Integer(index));
- }
-
- /**
- * Removes a web module.
- * @param index int
- */
- public void removeWebModule(int index) {
- try {
- int size = server.getServiceCount();
- for (int i = 0; i < size; i++) {
- Service service = server.getService(i);
- if (service.getName().equalsIgnoreCase(DEFAULT_SERVICE)) {
- Engine engine = service.getEngine();
- Host host = engine.getHost();
- host.removeElement("Context", index);
- isServerDirty = true;
- firePropertyChangeEvent(REMOVE_WEB_MODULE_PROPERTY, null, new Integer(index));
- return;
- }
- }
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error removing module ref " + index, e);
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat40Handler.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat40Handler.java
deleted file mode 100644
index 84c36ff..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat40Handler.java
+++ /dev/null
@@ -1,119 +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.jst.server.tomcat.core.internal;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jdt.launching.JavaRuntime;
-import org.eclipse.jst.server.core.IWebModule;
-/**
- * Tomcat 40 handler.
- */
-public class Tomcat40Handler implements ITomcatVersionHandler {
- public boolean verifyInstallPath(IPath installPath) {
- if (installPath == null)
- return false;
-
- String s = installPath.lastSegment();
- if (s != null && s.startsWith("jakarta-tomcat-") && !s.startsWith("jakarta-tomcat-4.0"))
- return false;
- return TomcatPlugin.verifyInstallPath(installPath, TomcatPlugin.TOMCAT_40);
- }
-
- /**
- * Return the runtime class name.
- *
- * @return java.lang.String
- */
- public String getRuntimeClass() {
- return "org.apache.catalina.startup.Bootstrap";
- }
-
- public List getRuntimeClasspath(IPath installPath) {
- List cp = new ArrayList();
-
- // 4.0 - add bootstrap.jar from the Tomcat bin directory
- IPath binPath = installPath.append("bin");
- if (binPath.toFile().exists()) {
- IPath path = binPath.append("bootstrap.jar");
- cp.add(JavaRuntime.newArchiveRuntimeClasspathEntry(path));
- }
-
- return cp;
- }
-
- /**
- * Return the program's runtime arguments.
- *
- * @return java.lang.String[]
- */
- public String[] getRuntimeProgramArguments(IPath configPath, boolean debug, boolean starting) {
- List list = new ArrayList();
- if (configPath != null) {
- list.add("-config");
- list.add("\"" + configPath.append("conf").append("server.xml").toOSString() + "\"");
- }
-
- if (debug)
- list.add("-debug");
-
- if (starting)
- list.add("start");
- else
- list.add("stop");
-
- String[] s = new String[list.size()];
- list.toArray(s);
- return s;
- }
-
- /**
- * Return the runtime (VM) arguments.
- *
- * @return java.lang.String[]
- */
- public String[] getRuntimeVMArguments(IPath installPath, IPath configPath, boolean isSecure) {
- List list = new ArrayList();
- list.add("-Dcatalina.home=\"" + installPath.toOSString() + "\"");
- String endorsed = installPath.append("bin").toOSString() +
- installPath.append("common").append("lib").toOSString();
- list.add("-Djava.endorsed.dirs=\"" + endorsed + "\"");
-
- // run in secure mode
- if (isSecure) {
- list.add("-Djava.security.manager");
- IPath dir = configPath.append("conf").append("catalina.policy");
- list.add("-Djava.security.policy=\"" + dir.toOSString() + "\"");
- }
-
- String[] s = new String[list.size()];
- list.toArray(s);
- return s;
- }
-
- /**
- * Returns true if the given project is supported by this
- * server, and false otherwise.
- *
- * @param module a web module
- * @return the status
- */
- public IStatus canAddModule(IWebModule module) {
- if ("1.2".equals(module.getJ2EESpecificationVersion()) || "1.3".equals(module.getJ2EESpecificationVersion()))
- return new Status(IStatus.OK, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%canAddModule"), null);
-
- return new Status(IStatus.ERROR, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%errorSpec40"), null);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat41Configuration.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat41Configuration.java
deleted file mode 100644
index bba61c4..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat41Configuration.java
+++ /dev/null
@@ -1,775 +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.jst.server.tomcat.core.internal;
-
-import java.io.BufferedReader;
-import java.io.BufferedWriter;
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.runtime.*;
-import org.eclipse.jst.server.tomcat.core.internal.xml.Factory;
-import org.eclipse.jst.server.tomcat.core.internal.xml.XMLUtil;
-import org.eclipse.jst.server.tomcat.core.internal.xml.server40.*;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.xml.sax.InputSource;
-
-import org.eclipse.wst.server.core.IServerPort;
-import org.eclipse.wst.server.core.util.ServerPort;
-/**
- * Tomcat v4.1 server configuration.
- */
-public class Tomcat41Configuration extends TomcatConfiguration {
- protected static final String DEFAULT_SERVICE = "Tomcat-Standalone";
- protected static final String HTTP_CONNECTOR = "org.apache.coyote.tomcat4.CoyoteConnector";
- protected static final String JK_PROTOCOL_HANDLER = "org.apache.jk.server.JkCoyoteHandler";
- protected static final String SSL_SOCKET_FACTORY = "org.apache.coyote.tomcat4.CoyoteServerSocketFactory";
- //protected static final String TEST_CONNECTOR = "org.apache.catalina.connector.test.HttpConnector";
- //org.apache.ajp.tomcat4.Ajp13Connector
- protected static final String APACHE_CONNECTOR = "org.apache.catalina.connector.warp.WarpConnector";
-
- protected Server server;
- protected Factory serverFactory;
- protected boolean isServerDirty;
-
- protected WebAppDocument webAppDocument;
-
- protected Document tomcatUsersDocument;
-
- protected String policyFile;
- protected boolean isPolicyDirty;
-
- /**
- * Tomcat41Configuration constructor comment.
- */
- public Tomcat41Configuration(IFolder path) {
- super(path);
- }
-
- /**
- * Returns the root of the docbase parameter.
- *
- * @return java.lang.String
- */
- protected String getDocBaseRoot() {
- return "webapps/";
- }
-
- /**
- * Return the port number.
- * @return int
- */
- public IServerPort getMainPort() {
- Iterator iterator = getServerPorts().iterator();
- while (iterator.hasNext()) {
- IServerPort port = (IServerPort) iterator.next();
- if (port.getName().equals("HTTP Connector"))
- return port;
- }
- return null;
- }
-
- /**
- * Returns the mime mappings.
- * @return java.util.List
- */
- public List getMimeMappings() {
- return webAppDocument.getMimeMappings();
- }
-
- /**
- * Returns the prefix that is used in front of the
- * web module path property. (e.g. "webapps")
- *
- * @return java.lang.String
- */
- public String getPathPrefix() {
- return "";
- }
-
- /**
- * Return the docBase of the ROOT web module.
- *
- * @return java.lang.String
- */
- protected String getROOTModuleDocBase() {
- return "ROOT";
- }
-
- /**
- * Returns a list of ServerPorts that this configuration uses.
- *
- * @return java.util.List
- */
- public List getServerPorts() {
- List ports = new ArrayList();
-
- // first add server port
- try {
- int port = Integer.parseInt(server.getPort());
- ports.add(new ServerPort("server", TomcatPlugin.getResource("%portServer"), port, "TCPIP"));
- } catch (Exception e) {
- // ignore
- }
-
- // add connectors
- try {
- int size = server.getServiceCount();
- for (int i = 0; i < size; i++) {
- Service service = server.getService(i);
- int size2 = service.getConnectorCount();
- for (int j = 0; j < size2; j++) {
- Connector connector = service.getConnector(j);
- String className = connector.getClassName();
- String name = className;
- String protocol = "TCPIP";
- boolean advanced = true;
- String[] contentTypes = null;
- int port = -1;
- try {
- port = Integer.parseInt(connector.getPort());
- } catch (Exception e) {
- // ignore
- }
- if (HTTP_CONNECTOR.equals(className)) {
- name = "HTTP Connector";
- protocol = "HTTP";
- contentTypes = new String[] { "web", "webservices" };
- // check for AJP/1.3 Coyote connector
- String protocolHandler = connector.getProtocolHandlerClassName();
- if (JK_PROTOCOL_HANDLER.equals(protocolHandler)) {
- name = "AJP/1.3 Connector";
- protocol = "AJP/1.3";
- } else {
- // assume HTTP, check for HTTP SSL connector
- try {
- Element element = connector.getSubElement("Factory");
- if (SSL_SOCKET_FACTORY.equals(element.getAttribute("className"))) {
- name = "SSL Connector";
- protocol = "SSL";
- }
- } catch (Exception e) {
- // ignore
- }
- }
- if ("HTTP".equals(protocol))
- advanced = false;
- } else if (APACHE_CONNECTOR.equals(className))
- name = "Apache Connector";
- if (className != null && className.length() > 0)
- ports.add(new ServerPort(i + "/" + j, name, port, protocol, contentTypes, advanced));
- }
- }
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error getting server ports", e);
- }
- return ports;
- }
-
- /**
- * Return a list of the web modules in this server.
- * @return java.util.List
- */
- public List getWebModules() {
- List list = new ArrayList();
-
- try {
- int size = server.getServiceCount();
- for (int i = 0; i < size; i++) {
- Service service = server.getService(i);
- if (service.getName().equalsIgnoreCase(DEFAULT_SERVICE)) {
- Engine engine = service.getEngine();
- Host host = engine.getHost();
- int size2 = host.getContextCount();
- for (int j = 0; j < size2; j++) {
- Context context = host.getContext(j);
- String reload = context.getReloadable();
- if (reload == null)
- reload = "false";
- WebModule module = new WebModule(context.getPath(),
- context.getDocBase(), context.getSource(),
- reload.equalsIgnoreCase("true") ? true : false);
- list.add(module);
- }
- }
- }
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error getting project refs", e);
- }
- return list;
- }
-
- /**
- *
- * @return org.eclipse.jst.server.tomcat.internal.Tomcat40Configuration
- */
- public void load(IPath path, IProgressMonitor monitor) throws CoreException {
- try {
- monitor = ProgressUtil.getMonitorFor(monitor);
- monitor.beginTask(TomcatPlugin.getResource("%loadingTask"), 5);
-
- // check for catalina.policy to verify that this is a v4.0 config
- InputStream in = new FileInputStream(path.append("catalina.policy").toFile());
- in.read();
- in.close();
- monitor.worked(1);
-
- serverFactory = new Factory();
- serverFactory.setPackageName("org.eclipse.jst.server.tomcat.core.internal.xml.server40");
- server = (Server) serverFactory.loadDocument(new FileInputStream(path.append("server.xml").toFile()));
- monitor.worked(1);
-
- webAppDocument = new WebAppDocument(path.append("web.xml"));
- monitor.worked(1);
-
- tomcatUsersDocument = XMLUtil.getDocumentBuilder().parse(new InputSource(new FileInputStream(path.append("tomcat-users.xml").toFile())));
- monitor.worked(1);
-
- // load policy file
- BufferedReader br = null;
- try {
- br = new BufferedReader(new InputStreamReader(new FileInputStream(path.append("catalina.policy").toFile())));
- String temp = br.readLine();
- policyFile = "";
- while (temp != null) {
- policyFile += temp + "\n";
- temp = br.readLine();
- }
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Could not load policy file", e);
- } finally {
- if (br != null)
- br.close();
- }
- monitor.worked(1);
-
- if (monitor.isCanceled())
- return;
- monitor.done();
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Could not load Tomcat v4.0 configuration from " + path.toOSString() + ": " + e.getMessage());
- throw new CoreException(new Status(IStatus.ERROR, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%errorCouldNotLoadConfiguration", path.toOSString()), e));
- }
- }
-
- /**
- * Reload the configuration.
- */
- public void load(IFolder folder, IProgressMonitor monitor) throws CoreException {
- try {
- monitor = ProgressUtil.getMonitorFor(monitor);
- monitor.beginTask(TomcatPlugin.getResource("%loadingTask"), 800);
-
- // check for catalina.policy to verify that this is a v4.0 config
- IFile file = folder.getFile("catalina.policy");
- if (!file.exists())
- throw new CoreException(new Status(IStatus.WARNING, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%errorCouldNotLoadConfiguration", folder.getFullPath().toOSString()), null));
-
- // load server.xml
- file = folder.getFile("server.xml");
- InputStream in = file.getContents();
- serverFactory = new Factory();
- serverFactory.setPackageName("org.eclipse.jst.server.tomcat.core.internal.xml.server40");
- server = (Server) serverFactory.loadDocument(in);
- monitor.worked(200);
-
- // load web.xml
- file = folder.getFile("web.xml");
- webAppDocument = new WebAppDocument(file);
- monitor.worked(200);
-
- // load tomcat-users.xml
- file = folder.getFile("tomcat-users.xml");
- in = file.getContents();
-
- tomcatUsersDocument = XMLUtil.getDocumentBuilder().parse(new InputSource(in));
- monitor.worked(200);
-
- // load catalina.policy
- file = folder.getFile("catalina.policy");
- in = file.getContents();
- BufferedReader br = null;
- try {
- br = new BufferedReader(new InputStreamReader(in));
- String temp = br.readLine();
- policyFile = "";
- while (temp != null) {
- policyFile += temp + "\n";
- temp = br.readLine();
- }
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Could not load policy file", e);
- } finally {
- if (br != null)
- br.close();
- }
- monitor.worked(200);
-
- if (monitor.isCanceled())
- throw new Exception("Cancelled");
- monitor.done();
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Could not reload Tomcat v4.1 configuration from: " + folder.getFullPath() + ": " + e.getMessage());
- throw new CoreException(new Status(IStatus.ERROR, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%errorCouldNotLoadConfiguration", folder.getFullPath().toOSString()), e));
- }
- }
-
- /**
- * Save to the given directory.
- *
- * @param path a path
- * @param forceDirty boolean
- * @param monitor a progress monitor
- * @exception CoreException
- */
- protected void save(IPath path, boolean forceDirty, IProgressMonitor monitor) throws CoreException {
- try {
- monitor = ProgressUtil.getMonitorFor(monitor);
- monitor.beginTask(TomcatPlugin.getResource("%savingTask"), 3);
-
- // make sure directory exists
- if (!path.toFile().exists()) {
- forceDirty = true;
- path.toFile().mkdir();
- }
- monitor.worked(1);
-
- // save files
- if (forceDirty || isServerDirty)
- serverFactory.save(path.append("server.xml").toOSString());
- monitor.worked(1);
-
- //if (forceDirty || isWebAppDirty)
- // webAppFactory.save(dirPath + "web.xml");
- //webAppDocument.save(path.toOSString(), forceDirty || isPolicyDirty);
- webAppDocument.save(path.append("web.xml").toOSString(), forceDirty);
- monitor.worked(1);
-
- if (forceDirty)
- XMLUtil.save(path.append("tomcat-users.xml").toOSString(), tomcatUsersDocument);
- monitor.worked(1);
-
- if (forceDirty || isPolicyDirty) {
- BufferedWriter bw = new BufferedWriter(new FileWriter(path.append("catalina.policy").toFile()));
- bw.write(policyFile);
- bw.close();
- }
- monitor.worked(1);
- isServerDirty = false;
- isPolicyDirty = false;
-
- if (monitor.isCanceled())
- return;
- monitor.done();
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not save Tomcat v4.1 configuration to " + path, e);
- throw new CoreException(new Status(IStatus.ERROR, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%errorCouldNotSaveConfiguration", new String[] {e.getLocalizedMessage()}), e));
- }
- }
-
- public void save(IPath path, IProgressMonitor monitor) throws CoreException {
- save(path, true, monitor);
- }
-
- /**
- * Save the information held by this object to the given directory.
- *
- * @param folder a folder
- * @param monitor a progress monitor
- * @throws CoreException
- */
- public void save(IFolder folder, IProgressMonitor monitor) throws CoreException {
- try {
- monitor = ProgressUtil.getMonitorFor(monitor);
- monitor.beginTask(TomcatPlugin.getResource("%savingTask"), 900);
-
- // save server.xml
- byte[] data = serverFactory.getContents();
- InputStream in = new ByteArrayInputStream(data);
- IFile file = folder.getFile("server.xml");
- if (file.exists()) {
- if (isServerDirty)
- file.setContents(in, true, true, ProgressUtil.getSubMonitorFor(monitor, 200));
- else
- monitor.worked(200);
- } else
- file.create(in, true, ProgressUtil.getSubMonitorFor(monitor, 200));
-
- // save web.xml
- webAppDocument.save(folder.getFile("web.xml"), ProgressUtil.getSubMonitorFor(monitor, 200));
-
- // save tomcat-users.xml
- data = XMLUtil.getContents(tomcatUsersDocument);
- in = new ByteArrayInputStream(data);
- file = folder.getFile("tomcat-users.xml");
- if (file.exists())
- monitor.worked(200);
- //file.setContents(in, true, true, ProgressUtil.getSubMonitorFor(monitor, 200));
- else
- file.create(in, true, ProgressUtil.getSubMonitorFor(monitor, 200));
-
- // save catalina.policy
- in = new ByteArrayInputStream(policyFile.getBytes());
- file = folder.getFile("catalina.policy");
- if (file.exists())
- monitor.worked(200);
- //file.setContents(in, true, true, ProgressUtil.getSubMonitorFor(monitor, 200));
- else
- file.create(in, true, ProgressUtil.getSubMonitorFor(monitor, 200));
-
- if (monitor.isCanceled())
- return;
- monitor.done();
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not save Tomcat v4.1 configuration to " + folder.toString(), e);
- throw new CoreException(new Status(IStatus.ERROR, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%errorCouldNotSaveConfiguration", new String[] {e.getLocalizedMessage()}), e));
- }
- }
-
- protected static boolean hasMDBListener(Server server) {
- if (server == null)
- return false;
-
- int count = server.getListenerCount();
- if (count == 0)
- return false;
-
- for (int i = 0; i < count; i++) {
- Listener listener = server.getListener(i);
- if (listener != null && listener.getClassName() != null && listener.getClassName().indexOf("mbean") >= 0)
- return true;
- }
- return false;
- }
-
- /**
- * Adds a mime mapping.
- *
- * @param index
- * @param map
- */
- public void addMimeMapping(int index, IMimeMapping map) {
- webAppDocument.addMimeMapping(index, map);
- firePropertyChangeEvent(ADD_MAPPING_PROPERTY, new Integer(index), map);
- }
-
- /**
- * Add a web module.
- * @param module org.eclipse.jst.server.tomcat.WebModule
- */
- public void addWebModule(int index, ITomcatWebModule module) {
- try {
- int size = server.getServiceCount();
- for (int i = 0; i < size; i++) {
- Service service = server.getService(i);
- if (service.getName().equalsIgnoreCase(DEFAULT_SERVICE)) {
- Engine engine = service.getEngine();
- Host host = engine.getHost();
- Context context = (Context) host.createElement(index, "Context");
- context.setDocBase(module.getDocumentBase());
- context.setPath(module.getPath());
- context.setReloadable(module.isReloadable() ? "true" : "false");
- if (module.getMemento() != null && module.getMemento().length() > 0)
- context.setSource(module.getMemento());
- isServerDirty = true;
- firePropertyChangeEvent(ADD_WEB_MODULE_PROPERTY, null, module);
- return;
- }
- }
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error adding web module " + module.getPath(), e);
- }
- }
-
- /**
- * Localize the web projects in this configuration.
- *
- * @param path a path
- * @param monitor a progress monitor
- */
- public void localizeConfiguration(IPath path, TomcatServer server2, TomcatRuntime runtime, IProgressMonitor monitor) {
- try {
- monitor = ProgressUtil.getMonitorFor(monitor);
- monitor.beginTask(TomcatPlugin.getResource("%updatingConfigurationTask"), 100);
-
- Tomcat41Configuration config = new Tomcat41Configuration(null);
- config.load(path, ProgressUtil.getSubMonitorFor(monitor, 40));
-
- if (monitor.isCanceled())
- return;
-
- if (!server2.isTestEnvironment()) {
- //IServerConfigurationWorkingCopy scwc = config.getServerConfiguration().createWorkingCopy();
- //Tomcat41Configuration cfg = (Tomcat41Configuration) scwc.getAdapter(Tomcat41Configuration.class);
- config.localizeWebModules();
- }
- monitor.worked(20);
-
- if (monitor.isCanceled())
- return;
-
- config.save(path, false, ProgressUtil.getSubMonitorFor(monitor, 40));
-
- if (!monitor.isCanceled())
- monitor.done();
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error localizing configuration", e);
- }
- }
-
- /**
- * Go through all of the web modules and make the document
- * base "local" to the configuration.
- */
- protected void localizeWebModules() {
- List modules = getWebModules();
-
- int size = modules.size();
- for (int i = 0; i < size; i++) {
- WebModule module = (WebModule) modules.get(i);
- String memento = module.getMemento();
- if (memento != null && memento.length() > 0) {
- // update document base to a relative ref
- String docBase = getPathPrefix() + module.getPath();
- if (docBase.startsWith("/") || docBase.startsWith("\\"))
- docBase = docBase.substring(1);
- modifyWebModule(i, docBase, module.getPath(), module.isReloadable());
- }
- }
- }
-
- /**
- * Change the extension of a mime mapping.
- *
- * @param index
- * @param map
- */
- public void modifyMimeMapping(int index, IMimeMapping map) {
- webAppDocument.modifyMimeMapping(index, map);
- firePropertyChangeEvent(MODIFY_MAPPING_PROPERTY, new Integer(index), map);
- }
-
- /**
- * Modify the port with the given id.
- *
- * @param id java.lang.String
- * @param port int
- */
- public void modifyServerPort(String id, int port) {
- try {
- if ("server".equals(id)) {
- server.setPort(port + "");
- isServerDirty = true;
- firePropertyChangeEvent(MODIFY_PORT_PROPERTY, id, new Integer(port));
- return;
- }
-
- int i = id.indexOf("/");
- int servNum = Integer.parseInt(id.substring(0, i));
- int connNum = Integer.parseInt(id.substring(i + 1));
-
- Service service = server.getService(servNum);
- Connector connector = service.getConnector(connNum);
- connector.setPort(port + "");
- isServerDirty = true;
- firePropertyChangeEvent(MODIFY_PORT_PROPERTY, id, new Integer(port));
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error modifying server port " + id, e);
- }
- }
- /**
- * Change a web module.
- * @param index int
- * @param docBase java.lang.String
- * @param path java.lang.String
- * @param reloadable boolean
- */
- public void modifyWebModule(int index, String docBase, String path, boolean reloadable) {
- try {
- int size = server.getServiceCount();
- for (int i = 0; i < size; i++) {
- Service service = server.getService(i);
- if (service.getName().equalsIgnoreCase(DEFAULT_SERVICE)) {
- Engine engine = service.getEngine();
- Host host = engine.getHost();
- Context context = host.getContext(index);
- context.setPath(path);
- context.setDocBase(docBase);
- context.setReloadable(reloadable ? "true" : "false");
- isServerDirty = true;
- WebModule module = new WebModule(path, docBase, null, reloadable);
- firePropertyChangeEvent(MODIFY_WEB_MODULE_PROPERTY, new Integer(index), module);
- return;
- }
- }
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error modifying web module " + index, e);
- }
- }
-
- /**
- * Removes a mime mapping.
- * @param index int
- */
- public void removeMimeMapping(int index) {
- webAppDocument.removeMimeMapping(index);
- firePropertyChangeEvent(REMOVE_MAPPING_PROPERTY, null, new Integer(index));
- }
-
- /**
- * Removes a web module.
- * @param index int
- */
- public void removeWebModule(int index) {
- try {
- int size = server.getServiceCount();
- for (int i = 0; i < size; i++) {
- Service service = server.getService(i);
- if (service.getName().equalsIgnoreCase(DEFAULT_SERVICE)) {
- Engine engine = service.getEngine();
- Host host = engine.getHost();
- host.removeElement("Context", index);
- isServerDirty = true;
- firePropertyChangeEvent(REMOVE_WEB_MODULE_PROPERTY, null, new Integer(index));
- return;
- }
- }
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error removing module ref " + index, e);
- }
- }
-
- protected IStatus backupAndPublish(IPath confDir, boolean doBackup, IProgressMonitor monitor) {
- MultiStatus ms = new MultiStatus(TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%publishConfigurationTask"), null);
- Trace.trace(Trace.FINER, "Backup and publish");
- monitor = ProgressUtil.getMonitorFor(monitor);
-
- backupAndPublish(confDir, doBackup, ms, monitor, 300);
- // TODO Refactor success detection once Bug 81060 is addressed
- // This approach avoids refactoring to TomcatConfiguration.backupFolder()
- // and backupPath() for now.
- if (ms.isOK() && ms.getChildren().length > 0)
- publishContextConfig(confDir, ms, monitor);
-
- monitor.done();
- return ms;
- }
-
- protected void publishContextConfig(IPath confDir, MultiStatus ms, IProgressMonitor monitor) {
- Trace.trace(Trace.FINER, "Apply context configurations");
- try {
- confDir = confDir.append("conf");
-
- monitor.subTask(TomcatPlugin.getResource("%publishContextConfigTask"));
- Factory factory = new Factory();
- factory.setPackageName("org.eclipse.jst.server.tomcat.core.internal.xml.server40");
- Server publishedServer = (Server) factory.loadDocument(new FileInputStream(confDir.append("server.xml").toFile()));
- monitor.worked(100);
-
- boolean modified = false;
-
- int size = publishedServer.getServiceCount();
- for (int i = 0; i < size; i++) {
- Service service = publishedServer.getService(i);
- if (service.getName().equalsIgnoreCase(DEFAULT_SERVICE)) {
- Engine engine = service.getEngine();
- Host host = engine.getHost();
- int size2 = host.getContextCount();
- for (int j = 0; j < size2; j++) {
- Context context = host.getContext(j);
- monitor.subTask(TomcatPlugin.getResource("%checkingContextTask",
- new String[] {context.getPath()}));
- if (addContextConfig(context)) {
- modified = true;
- }
- }
- }
- }
- monitor.worked(100);
- if (modified) {
- monitor.subTask(TomcatPlugin.getResource("%savingContextConfigTask"));
- factory.save(confDir.append("server.xml").toOSString());
- }
- monitor.worked(100);
-
- Trace.trace(Trace.FINER, "Server.xml updated with context.xml configurations");
- ms.add(new Status(IStatus.OK, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%serverPostProcessingComplete"), null));
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Could not apply context configurations published Tomcat v5.0 configuration from " + confDir.toOSString() + ": " + e.getMessage());
- IStatus s = new Status(IStatus.ERROR, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%errorPublishConfiguration", new String[] {e.getLocalizedMessage()}), e);
- ms.add(s);
- }
- }
-
- /**
- * If the specified Context is linked to a project, try to
- * update any configuration found a META-INF/context.xml found
- * relative to the specified docBase.
- * @param context Context object to receive context.xml contents.
- * @return Returns true if context is modified.
- */
- protected boolean addContextConfig(Context context) {
- boolean modified = false;
- String source = context.getSource();
- if (source != null && source.length() > 0 )
- {
- if (context.hasChildNodes()) {
- context.removeChildren();
- modified = true;
- }
- String docBase = context.getDocBase();
- Context contextConfig = loadContextConfig(docBase);
- if (null != contextConfig) {
- contextConfig.copyChildrenTo(context);
- modified = true;
- }
- }
- return modified;
- }
-
- /**
- * Tries to read a META-INF/context.xml file relative to the
- * specified docBase. If found, it creates a Context object
- * containing the contexts of that file.
- * @param docBase
- * @return Context element created from context.xml, or null if not found.
- */
- protected Context loadContextConfig(String docBase) {
- File contexXML = new File(docBase + File.separator + "META-INF" + File.separator + "context.xml");
- if (contexXML.exists()) {
- try {
- InputStream is = new FileInputStream(contexXML);
- Factory ctxFactory = new Factory();
- ctxFactory.setPackageName("org.eclipse.jst.server.tomcat.core.internal.xml.server40");
- Context ctx = (Context)ctxFactory.loadDocument(is);
- is.close();
- return ctx;
- } catch (FileNotFoundException e) {
- // Ignore, should never occur
- } catch (IOException e) {
- Trace.trace(Trace.SEVERE, "Error reading web module's context.xml file: " + docBase, e);
- }
- }
- return null;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat41Handler.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat41Handler.java
deleted file mode 100644
index e36a7e4..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat41Handler.java
+++ /dev/null
@@ -1,117 +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.jst.server.tomcat.core.internal;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jdt.launching.JavaRuntime;
-import org.eclipse.jst.server.core.IWebModule;
-/**
- * Tomcat 41 handler.
- */
-public class Tomcat41Handler implements ITomcatVersionHandler {
- public boolean verifyInstallPath(IPath installPath) {
- if (installPath == null)
- return false;
-
- String s = installPath.lastSegment();
- if (s != null && s.startsWith("jakarta-tomcat-") && !s.startsWith("jakarta-tomcat-4.1"))
- return false;
- return TomcatPlugin.verifyInstallPath(installPath, TomcatPlugin.TOMCAT_41);
- }
-
- /**
- * Return the runtime class name.
- *
- * @return java.lang.String
- */
- public String getRuntimeClass() {
- return "org.apache.catalina.startup.Bootstrap";
- }
-
- public List getRuntimeClasspath(IPath installPath) {
- List cp = new ArrayList();
-
- // 4.1 - add bootstrap.jar from the Tomcat bin directory
- IPath binPath = installPath.append("bin");
- if (binPath.toFile().exists()) {
- IPath path = binPath.append("bootstrap.jar");
- cp.add(JavaRuntime.newArchiveRuntimeClasspathEntry(path));
- }
-
- return cp;
- }
-
- /**
- * Return the program's runtime arguments.
- *
- * @return java.lang.String[]
- */
- public String[] getRuntimeProgramArguments(IPath configPath, boolean debug, boolean starting) {
- List list = new ArrayList();
- if (configPath != null) {
- list.add("-config");
- list.add("\"" + configPath.append("conf").append("server.xml").toOSString() + "\"");
- }
-
- if (debug)
- list.add("-debug");
-
- if (starting)
- list.add("start");
- else
- list.add("stop");
-
- String[] temp = new String[list.size()];
- list.toArray(temp);
- return temp;
- }
-
- /**
- * Return the runtime (VM) arguments.
- *
- * @return java.lang.String[]
- */
- public String[] getRuntimeVMArguments(IPath installPath, IPath configPath, boolean isSecure) {
- List list = new ArrayList();
- list.add("-Dcatalina.home=\"" + installPath.toOSString() + "\"");
- list.add("-Djava.endorsed.dirs=\"" + installPath.append("common").append("endorsed").toOSString() + "\"");
-
- // run in secure mode
- if (isSecure) {
- list.add("-Djava.security.manager");
- IPath dir = configPath.append("conf").append("catalina.policy");
- list.add("-Djava.security.policy=\"" + dir.toOSString() + "\"");
- }
-
- String[] s = new String[list.size()];
- list.toArray(s);
- return s;
- }
-
- /**
- * Returns true if the given project is supported by this
- * server, and false otherwise.
- *
- * @param module a web module
- * @return the status
- */
- public IStatus canAddModule(IWebModule module) {
- if ("1.2".equals(module.getJ2EESpecificationVersion()) || "1.3".equals(module.getJ2EESpecificationVersion()))
- return new Status(IStatus.OK, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%canAddModule"), null);
-
- return new Status(IStatus.ERROR, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%errorSpec41"), null);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat50Configuration.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat50Configuration.java
deleted file mode 100644
index c999b45..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat50Configuration.java
+++ /dev/null
@@ -1,843 +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.jst.server.tomcat.core.internal;
-
-import java.io.*;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.runtime.*;
-import org.eclipse.jst.server.tomcat.core.internal.xml.Factory;
-import org.eclipse.jst.server.tomcat.core.internal.xml.XMLUtil;
-import org.eclipse.jst.server.tomcat.core.internal.xml.server40.*;
-import org.w3c.dom.Document;
-import org.xml.sax.InputSource;
-
-import org.eclipse.wst.server.core.IServerPort;
-import org.eclipse.wst.server.core.util.ServerPort;
-/**
- * Tomcat v5.0 server configuration.
- */
-public class Tomcat50Configuration extends TomcatConfiguration {
- protected static final String DEFAULT_SERVICE = "Catalina";
- protected Server server;
- protected Factory serverFactory;
- protected boolean isServerDirty;
-
- protected WebAppDocument webAppDocument;
-
- protected Document tomcatUsersDocument;
-
- protected String policyFile;
- protected boolean isPolicyDirty;
-
- /**
- * Tomcat50Configuration constructor comment.
- */
- public Tomcat50Configuration(IFolder path) {
- super(path);
- }
-
- /**
- * Returns the root of the docbase parameter.
- *
- * @return java.lang.String
- */
- protected String getDocBaseRoot() {
- return "webapps/";
- }
-
- /**
- * Return the port number.
- * @return int
- */
- public IServerPort getMainPort() {
- Iterator iterator = getServerPorts().iterator();
- while (iterator.hasNext()) {
- IServerPort port = (IServerPort) iterator.next();
- if (port.getName().equals("HTTP"))
- return port;
- }
- return null;
- }
-
- /**
- * Returns the mime mappings.
- * @return java.util.List
- */
- public List getMimeMappings() {
- return webAppDocument.getMimeMappings();
- }
-
- /**
- * Returns the prefix that is used in front of the
- * web module path property. (e.g. "webapps")
- *
- * @return java.lang.String
- */
- public String getPathPrefix() {
- return "";
- }
-
- /**
- * Return the docBase of the ROOT web module.
- *
- * @return java.lang.String
- */
- protected String getROOTModuleDocBase() {
- return "ROOT";
- }
-
- /**
- * Returns a list of ServerPorts that this configuration uses.
- *
- * @return java.util.List
- */
- public List getServerPorts() {
- List ports = new ArrayList();
-
- // first add server port
- try {
- int port = Integer.parseInt(server.getPort());
- ports.add(new ServerPort("server", TomcatPlugin.getResource("%portServer"), port, "TCPIP"));
- } catch (Exception e) {
- // ignore
- }
-
- // add connectors
- try {
- int size = server.getServiceCount();
- for (int i = 0; i < size; i++) {
- Service service = server.getService(i);
- int size2 = service.getConnectorCount();
- for (int j = 0; j < size2; j++) {
- Connector connector = service.getConnector(j);
- String name = "HTTP";
- String protocol2 = "HTTP";
- boolean advanced = true;
- String[] contentTypes = null;
- int port = -1;
- try {
- port = Integer.parseInt(connector.getPort());
- } catch (Exception e) {
- // ignore
- }
- String protocol = connector.getProtocol();
- if (protocol != null && protocol.length() > 0) {
- name = protocol;
- protocol2 = protocol;
- }
- if ("HTTP".equals(protocol))
- contentTypes = new String[] { "web", "webservices" };
- String secure = connector.getSecure();
- if (secure != null && secure.length() > 0) {
- name = "SSL";
- protocol2 = "SSL";
- } else
- advanced = false;
- ports.add(new ServerPort(i +"/" + j, name, port, protocol2, contentTypes, advanced));
- }
- }
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error getting server ports", e);
- }
- return ports;
- }
-
- /**
- * Return a list of the web modules in this server.
- * @return java.util.List
- */
- public List getWebModules() {
- List list = new ArrayList();
-
- try {
- int size = server.getServiceCount();
- for (int i = 0; i < size; i++) {
- Service service = server.getService(i);
- if (service.getName().equalsIgnoreCase(DEFAULT_SERVICE)) {
- Engine engine = service.getEngine();
- Host host = engine.getHost();
- int size2 = host.getContextCount();
- for (int j = 0; j < size2; j++) {
- Context context = host.getContext(j);
- String reload = context.getReloadable();
- if (reload == null)
- reload = "false";
- WebModule module = new WebModule(context.getPath(),
- context.getDocBase(), context.getSource(),
- reload.equalsIgnoreCase("true") ? true : false);
- list.add(module);
- }
- }
- }
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error getting project refs", e);
- }
- return list;
- }
-
- /**
- * @param path a path
- * @param monitor a progress monitor
- */
- public void load(IPath path, IProgressMonitor monitor) throws CoreException {
- try {
- monitor = ProgressUtil.getMonitorFor(monitor);
- monitor.beginTask(TomcatPlugin.getResource("%loadingTask"), 5);
-
- // check for catalina.policy to verify that this is a v5.0 config
- InputStream in = new FileInputStream(path.append("catalina.policy").toFile());
- in.read();
- in.close();
- monitor.worked(1);
-
- serverFactory = new Factory();
- serverFactory.setPackageName("org.eclipse.jst.server.tomcat.core.internal.xml.server40");
- server = (Server) serverFactory.loadDocument(new FileInputStream(path.append("server.xml").toFile()));
- monitor.worked(1);
-
- webAppDocument = new WebAppDocument(path.append("web.xml"));
- monitor.worked(1);
-
- tomcatUsersDocument = XMLUtil.getDocumentBuilder().parse(new InputSource(new FileInputStream(path.append("tomcat-users.xml").toFile())));
- monitor.worked(1);
-
- // load policy file
- BufferedReader br = null;
- try {
- br = new BufferedReader(new InputStreamReader(new FileInputStream(path.append("catalina.policy").toFile())));
- String temp = br.readLine();
- policyFile = "";
- while (temp != null) {
- policyFile += temp + "\n";
- temp = br.readLine();
- }
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Could not load policy file", e);
- } finally {
- if (br != null)
- br.close();
- }
- monitor.worked(1);
-
- if (monitor.isCanceled())
- return;
- monitor.done();
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Could not load Tomcat v5.0 configuration from " + path.toOSString() + ": " + e.getMessage());
- throw new CoreException(new Status(IStatus.ERROR, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%errorCouldNotLoadConfiguration", path.toOSString()), e));
- }
- }
-
- /**
- * Reload the configuration.
- *
- * @param folder a folder
- * @param monitor a progress monitor
- */
- public void load(IFolder folder, IProgressMonitor monitor) throws CoreException {
- try {
- monitor = ProgressUtil.getMonitorFor(monitor);
- monitor.beginTask(TomcatPlugin.getResource("%loadingTask"), 800);
-
- // check for catalina.policy to verify that this is a v4.0 config
- IFile file = folder.getFile("catalina.policy");
- if (!file.exists())
- throw new CoreException(new Status(IStatus.WARNING, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%errorCouldNotLoadConfiguration", folder.getFullPath().toOSString()), null));
-
- // load server.xml
- file = folder.getFile("server.xml");
- InputStream in = file.getContents();
- serverFactory = new Factory();
- serverFactory.setPackageName("org.eclipse.jst.server.tomcat.core.internal.xml.server40");
- server = (Server) serverFactory.loadDocument(in);
- monitor.worked(200);
-
- // load web.xml
- file = folder.getFile("web.xml");
- webAppDocument = new WebAppDocument(file);
- monitor.worked(200);
-
- // load tomcat-users.xml
- file = folder.getFile("tomcat-users.xml");
- in = file.getContents();
-
- tomcatUsersDocument = XMLUtil.getDocumentBuilder().parse(new InputSource(in));
- monitor.worked(200);
-
- // load catalina.policy
- file = folder.getFile("catalina.policy");
- in = file.getContents();
- BufferedReader br = null;
- try {
- br = new BufferedReader(new InputStreamReader(in));
- String temp = br.readLine();
- policyFile = "";
- while (temp != null) {
- policyFile += temp + "\n";
- temp = br.readLine();
- }
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Could not load policy file", e);
- } finally {
- if (br != null)
- br.close();
- }
- monitor.worked(200);
-
- if (monitor.isCanceled())
- throw new Exception("Cancelled");
- monitor.done();
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Could not reload Tomcat v5.0 configuration from: " + folder.getFullPath() + ": " + e.getMessage());
- throw new CoreException(new Status(IStatus.ERROR, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%errorCouldNotLoadConfiguration", folder.getFullPath().toOSString()), e));
- }
- }
-
- /**
- * Save to the given directory.
- * @param path a path
- * @param forceDirty boolean
- * @param monitor a progress monitor
- * @exception CoreException
- */
- protected void save(IPath path, boolean forceDirty, IProgressMonitor monitor) throws CoreException {
- try {
- monitor = ProgressUtil.getMonitorFor(monitor);
- monitor.beginTask(TomcatPlugin.getResource("%savingTask"), 3);
-
- // make sure directory exists
- if (!path.toFile().exists()) {
- forceDirty = true;
- path.toFile().mkdir();
- }
- monitor.worked(1);
-
- // save files
- if (forceDirty || isServerDirty)
- serverFactory.save(path.append("server.xml").toOSString());
- monitor.worked(1);
-
- //if (forceDirty || isWebAppDirty)
- // webAppFactory.save(dirPath + "web.xml");
- //webAppDocument.save(path.toOSString(), forceDirty || isPolicyDirty);
- webAppDocument.save(path.append("web.xml").toOSString(), forceDirty);
- monitor.worked(1);
-
- if (forceDirty)
- XMLUtil.save(path.append("tomcat-users.xml").toOSString(), tomcatUsersDocument);
- monitor.worked(1);
-
- if (forceDirty || isPolicyDirty) {
- BufferedWriter bw = new BufferedWriter(new FileWriter(path.append("catalina.policy").toFile()));
- bw.write(policyFile);
- bw.close();
- }
- monitor.worked(1);
- isServerDirty = false;
- isPolicyDirty = false;
-
- if (monitor.isCanceled())
- return;
- monitor.done();
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not save Tomcat v5.0 configuration to " + path, e);
- throw new CoreException(new Status(IStatus.ERROR, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%errorCouldNotSaveConfiguration", new String[] {e.getLocalizedMessage()}), e));
- }
- }
-
- public void save(IPath path, IProgressMonitor monitor) throws CoreException {
- save(path, true, monitor);
- }
-
- /**
- * Save the information held by this object to the given directory.
- *
- * @param folder a folder
- * @param monitor a progress monitor
- * @throws CoreException
- */
- public void save(IFolder folder, IProgressMonitor monitor) throws CoreException {
- try {
- monitor = ProgressUtil.getMonitorFor(monitor);
- monitor.beginTask(TomcatPlugin.getResource("%savingTask"), 900);
-
- // save server.xml
- byte[] data = serverFactory.getContents();
- InputStream in = new ByteArrayInputStream(data);
- IFile file = folder.getFile("server.xml");
- if (file.exists()) {
- if (isServerDirty)
- file.setContents(in, true, true, ProgressUtil.getSubMonitorFor(monitor, 200));
- else
- monitor.worked(200);
- } else
- file.create(in, true, ProgressUtil.getSubMonitorFor(monitor, 200));
-
- // save web.xml
- webAppDocument.save(folder.getFile("web.xml"), ProgressUtil.getSubMonitorFor(monitor, 200));
-
- // save tomcat-users.xml
- data = XMLUtil.getContents(tomcatUsersDocument);
- in = new ByteArrayInputStream(data);
- file = folder.getFile("tomcat-users.xml");
- if (file.exists())
- monitor.worked(200);
- //file.setContents(in, true, true, ProgressUtil.getSubMonitorFor(monitor, 200));
- else
- file.create(in, true, ProgressUtil.getSubMonitorFor(monitor, 200));
-
- // save catalina.policy
- in = new ByteArrayInputStream(policyFile.getBytes());
- file = folder.getFile("catalina.policy");
- if (file.exists())
- monitor.worked(200);
- //file.setContents(in, true, true, ProgressUtil.getSubMonitorFor(monitor, 200));
- else
- file.create(in, true, ProgressUtil.getSubMonitorFor(monitor, 200));
-
- if (monitor.isCanceled())
- return;
- monitor.done();
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not save Tomcat v5.0 configuration to " + folder.toString(), e);
- throw new CoreException(new Status(IStatus.ERROR, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%errorCouldNotSaveConfiguration", new String[] {e.getLocalizedMessage()}), e));
- }
- }
-
- protected static boolean hasMDBListener(Server server) {
- if (server == null)
- return false;
-
- int count = server.getListenerCount();
- if (count == 0)
- return false;
-
- for (int i = 0; i < count; i++) {
- Listener listener = server.getListener(i);
- if (listener != null && listener.getClassName() != null && listener.getClassName().indexOf("mbean") >= 0)
- return true;
- }
- return false;
- }
-
- /**
- * Adds a mime mapping.
- *
- * @param index
- * @param map
- */
- public void addMimeMapping(int index, IMimeMapping map) {
- webAppDocument.addMimeMapping(index, map);
- firePropertyChangeEvent(ADD_MAPPING_PROPERTY, new Integer(index), map);
- }
-
- /**
- * Add a web module.
- * @param module org.eclipse.jst.server.tomcat.WebModule
- */
- public void addWebModule(int index, ITomcatWebModule module) {
- try {
- int size = server.getServiceCount();
- for (int i = 0; i < size; i++) {
- Service service = server.getService(i);
- if (service.getName().equalsIgnoreCase(DEFAULT_SERVICE)) {
- Engine engine = service.getEngine();
- Host host = engine.getHost();
- Context context = (Context) host.createElement(index, "Context");
- context.setDocBase(module.getDocumentBase());
- context.setPath(module.getPath());
- context.setReloadable(module.isReloadable() ? "true" : "false");
- if (module.getMemento() != null && module.getMemento().length() > 0)
- context.setSource(module.getMemento());
- isServerDirty = true;
- firePropertyChangeEvent(ADD_WEB_MODULE_PROPERTY, null, module);
- return;
- }
- }
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error adding web module " + module.getPath(), e);
- }
- }
-
- /**
- * Localize the web projects in this configuration.
- *
- * @param path a path
- * @param monitor a progress monitor
- */
- public void localizeConfiguration(IPath path, TomcatServer server2, TomcatRuntime runtime, IProgressMonitor monitor) {
- try {
- monitor = ProgressUtil.getMonitorFor(monitor);
- monitor.beginTask(TomcatPlugin.getResource("%updatingConfigurationTask"), 100);
-
- Tomcat50Configuration config = new Tomcat50Configuration(null);
- config.load(path, ProgressUtil.getSubMonitorFor(monitor, 40));
-
- if (monitor.isCanceled())
- return;
-
- if (!server2.isTestEnvironment()) {
- //IServerConfigurationWorkingCopy scwc = config.getServerConfiguration().createWorkingCopy();
- //Tomcat50Configuration cfg = (Tomcat50Configuration) scwc.getAdapter(Tomcat50Configuration.class);
- config.localizeWebModules();
- }
- monitor.worked(20);
-
- if (monitor.isCanceled())
- return;
-
- config.save(path, false, ProgressUtil.getSubMonitorFor(monitor, 40));
-
- if (!monitor.isCanceled())
- monitor.done();
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error localizing configuration", e);
- }
- }
-
- /**
- * Go through all of the web modules and make the document
- * base "local" to the configuration.
- */
- protected void localizeWebModules() {
- List modules = getWebModules();
-
- int size = modules.size();
- for (int i = 0; i < size; i++) {
- WebModule module = (WebModule) modules.get(i);
- String memento = module.getMemento();
- if (memento != null && memento.length() > 0) {
- // update document base to a relative ref
- String docBase = getPathPrefix() + module.getPath();
- if (docBase.startsWith("/") || docBase.startsWith("\\"))
- docBase = docBase.substring(1);
- modifyWebModule(i, docBase, module.getPath(), module.isReloadable());
- }
- }
- }
-
- /**
- * Change the extension of a mime mapping.
- *
- * @param index
- * @param map
- */
- public void modifyMimeMapping(int index, IMimeMapping map) {
- webAppDocument.modifyMimeMapping(index, map);
- firePropertyChangeEvent(MODIFY_MAPPING_PROPERTY, new Integer(index), map);
- }
-
- /**
- * Modify the port with the given id.
- *
- * @param id java.lang.String
- * @param port int
- */
- public void modifyServerPort(String id, int port) {
- try {
- if ("server".equals(id)) {
- server.setPort(port + "");
- isServerDirty = true;
- firePropertyChangeEvent(MODIFY_PORT_PROPERTY, id, new Integer(port));
- return;
- }
-
- int i = id.indexOf("/");
- int servNum = Integer.parseInt(id.substring(0, i));
- int connNum = Integer.parseInt(id.substring(i + 1));
-
- Service service = server.getService(servNum);
- Connector connector = service.getConnector(connNum);
- connector.setPort(port + "");
- isServerDirty = true;
- firePropertyChangeEvent(MODIFY_PORT_PROPERTY, id, new Integer(port));
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error modifying server port " + id, e);
- }
- }
- /**
- * Change a web module.
- * @param index int
- * @param docBase java.lang.String
- * @param path java.lang.String
- * @param reloadable boolean
- */
- public void modifyWebModule(int index, String docBase, String path, boolean reloadable) {
- try {
- int size = server.getServiceCount();
- for (int i = 0; i < size; i++) {
- Service service = server.getService(i);
- if (service.getName().equalsIgnoreCase(DEFAULT_SERVICE)) {
- Engine engine = service.getEngine();
- Host host = engine.getHost();
- Context context = host.getContext(index);
- context.setPath(path);
- context.setDocBase(docBase);
- context.setReloadable(reloadable ? "true" : "false");
- isServerDirty = true;
- WebModule module = new WebModule(path, docBase, null, reloadable);
- firePropertyChangeEvent(MODIFY_WEB_MODULE_PROPERTY, new Integer(index), module);
- return;
- }
- }
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error modifying web module " + index, e);
- }
- }
-
- /**
- * Removes a mime mapping.
- * @param index int
- */
- public void removeMimeMapping(int index) {
- webAppDocument.removeMimeMapping(index);
- firePropertyChangeEvent(REMOVE_MAPPING_PROPERTY, null, new Integer(index));
- }
-
- /**
- * Removes a web module.
- * @param index int
- */
- public void removeWebModule(int index) {
- try {
- int size = server.getServiceCount();
- for (int i = 0; i < size; i++) {
- Service service = server.getService(i);
- if (service.getName().equalsIgnoreCase(DEFAULT_SERVICE)) {
- Engine engine = service.getEngine();
- Host host = engine.getHost();
- host.removeElement("Context", index);
- isServerDirty = true;
- firePropertyChangeEvent(REMOVE_WEB_MODULE_PROPERTY, null, new Integer(index));
- return;
- }
- }
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error removing module ref " + index, e);
- }
- }
-
- protected IStatus backupAndPublish(IPath confDir, boolean doBackup, IProgressMonitor monitor) {
- MultiStatus ms = new MultiStatus(TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%publishConfigurationTask"), null);
- Trace.trace(Trace.FINER, "Backup and publish");
- monitor = ProgressUtil.getMonitorFor(monitor);
-
- backupAndPublish(confDir, doBackup, ms, monitor, 300);
- // TODO Refactor success detection once Bug 81060 is addressed
- // This approach avoids refactoring TomcatConfiguration.backupFolder()
- // and backupPath() for now.
- if (ms.isOK() && ms.getChildren().length > 0)
- publishContextConfig(confDir, ms, monitor);
-
- monitor.done();
- return ms;
- }
-
- protected void publishContextConfig(IPath confDir, MultiStatus ms, IProgressMonitor monitor) {
- Trace.trace(Trace.FINER, "Apply context configurations");
- try {
- confDir = confDir.append("conf");
-
- monitor.subTask(TomcatPlugin.getResource("%publishContextConfigTask"));
- Factory factory = new Factory();
- factory.setPackageName("org.eclipse.jst.server.tomcat.core.internal.xml.server40");
- Server publishedServer = (Server) factory.loadDocument(new FileInputStream(confDir.append("server.xml").toFile()));
- monitor.worked(100);
-
- boolean modified = false;
-
- int size = publishedServer.getServiceCount();
- for (int i = 0; i < size; i++) {
- Service service = publishedServer.getService(i);
- if (service.getName().equalsIgnoreCase(DEFAULT_SERVICE)) {
- Engine engine = service.getEngine();
- Host host = engine.getHost();
- int size2 = host.getContextCount();
- for (int j = 0; j < size2; j++) {
- Context context = host.getContext(j);
- monitor.subTask(TomcatPlugin.getResource("%checkingContextTask",
- new String[] {context.getPath()}));
- if (addContextConfig(context)) {
- modified = true;
- }
- }
- }
- }
- monitor.worked(100);
- if (modified) {
- monitor.subTask(TomcatPlugin.getResource("%savingContextConfigTask"));
- factory.save(confDir.append("server.xml").toOSString());
- }
- monitor.worked(100);
-
- Trace.trace(Trace.FINER, "Server.xml updated with context.xml configurations");
- ms.add(new Status(IStatus.OK, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%serverPostProcessingComplete"), null));
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Could not apply context configurations published Tomcat v5.0 configuration from " + confDir.toOSString() + ": " + e.getMessage());
- IStatus s = new Status(IStatus.ERROR, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%errorPublishConfiguration", new String[] {e.getLocalizedMessage()}), e);
- ms.add(s);
- }
- }
-
- /**
- * If the specified Context is linked to a project, try to
- * update any configuration found a META-INF/context.xml found
- * relative to the specified docBase.
- * @param context Context object to receive context.xml contents.
- * @return Returns true if context is modified.
- */
- protected boolean addContextConfig(Context context) {
- boolean modified = false;
- String source = context.getSource();
- if (source != null && source.length() > 0 )
- {
- if (context.hasChildNodes()) {
- context.removeChildren();
- modified = true;
- }
- String docBase = context.getDocBase();
- Context contextConfig = loadContextConfig(docBase);
- if (null != contextConfig) {
- contextConfig.copyChildrenTo(context);
- modified = true;
- }
- }
- return modified;
- }
-
- /**
- * Tries to read a META-INF/context.xml file relative to the
- * specified docBase. If found, it creates a Context object
- * containing the contexts of that file.
- * @param docBase
- * @return Context element created from context.xml, or null if not found.
- */
- protected Context loadContextConfig(String docBase) {
- File contexXML = new File(docBase + File.separator + "META-INF" + File.separator + "context.xml");
- if (contexXML.exists()) {
- try {
- InputStream is = new FileInputStream(contexXML);
- Factory ctxFactory = new Factory();
- ctxFactory.setPackageName("org.eclipse.jst.server.tomcat.core.internal.xml.server40");
- Context ctx = (Context)ctxFactory.loadDocument(is);
- is.close();
- return ctx;
- } catch (FileNotFoundException e) {
- // Ignore, should never occur
- } catch (IOException e) {
- Trace.trace(Trace.SEVERE, "Error reading web module's context.xml file: " + docBase, e);
- }
- }
- return null;
- }
-
- protected IStatus cleanupServer(IPath confDir, IPath installDir, IProgressMonitor monitor) {
- MultiStatus ms = new MultiStatus(TomcatPlugin.PLUGIN_ID, 0,
- TomcatPlugin.getResource("%cleanupServerTask"), null);
- monitor = ProgressUtil.getMonitorFor(monitor);
- monitor.beginTask(TomcatPlugin.getResource("%cleanupServerTask"), 200);
-
- try {
- monitor.subTask(TomcatPlugin.getResource("%detectingRemovedProjects"));
-
- // Try to read old server configuration
- Factory factory = new Factory();
- factory.setPackageName("org.eclipse.jst.server.tomcat.core.internal.xml.server40");
- File serverFile = confDir.append("conf").append("server.xml").toFile();
- if (serverFile.exists()) {
- Server oldServer = (Server) factory.loadDocument(new FileInputStream(serverFile));
-
- // Begin building path to context directory
- IPath contextDir = installDir.append("conf");
-
- // Collect paths of old web modules managed by WTP
- Set oldPaths = new HashSet();
- int size = oldServer.getServiceCount();
- for (int i = 0; i < size; i++) {
- Service service = oldServer.getService(i);
- if (service.getName().equalsIgnoreCase(DEFAULT_SERVICE)) {
- Engine engine = service.getEngine();
- Host host = engine.getHost();
- // Finish path to context directory
- contextDir = contextDir.append(engine.getName()).append(host.getName());
- int size2 = host.getContextCount();
- for (int j = 0; j < size2; j++) {
- Context context = host.getContext(j);
- String source = context.getSource();
- if (source != null && source.length() > 0 ) {
- oldPaths.add(context.getPath());
- }
- }
- }
- }
-
- // Remove paths for web modules that are staying around
- List modules = getWebModules();
- size = modules.size();
- for (int i = 0; i < size; i++) {
- WebModule module = (WebModule) modules.get(i);
- oldPaths.remove(module.getPath());
- }
- monitor.worked(100);
-
- // Delete context files for managed web modules that have gone away
- if (oldPaths.size() > 0 ) {
- IProgressMonitor subMonitor = ProgressUtil.getSubMonitorFor(monitor, 100);
- subMonitor.beginTask(TomcatPlugin.getResource("%deletingContextFilesTask"), oldPaths.size() * 100);
-
- Iterator iter = oldPaths.iterator();
- while (iter.hasNext()) {
- // Derive the context file name from the path + ".xml", minus the leading '/'
- String fileName = ((String)iter.next()).substring(1) + ".xml";
- IPath contextPath = contextDir.append(fileName);
- File contextFile = contextPath.toFile();
- if (contextFile.exists()) {
- subMonitor.subTask(TomcatPlugin.getResource("%deletingContextFile", fileName));
- if (contextFile.delete()) {
- Trace.trace(Trace.FINER, "Leftover context file " + fileName + " deleted.");
- ms.add(new Status(IStatus.OK, TomcatPlugin.PLUGIN_ID, 0,
- TomcatPlugin.getResource("%deletedContextFile", fileName), null));
-
- } else {
- Trace.trace(Trace.SEVERE, "Could not delete obsolete context file " + contextPath.toOSString());
- ms.add(new Status(IStatus.ERROR, TomcatPlugin.PLUGIN_ID, 0,
- TomcatPlugin.getResource("%errorCouldNotDeleteContextFile", contextPath.toOSString()), null));
- }
- subMonitor.worked(100);
- }
- }
- subMonitor.done();
- } else {
- monitor.worked(100);
- }
- }
- // Else no server.xml. Assume first publish to new temp directory
- else {
- monitor.worked(200);
- }
- Trace.trace(Trace.FINER, "Server cleaned");
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not cleanup server at " + confDir.toOSString() + ": " + e.getMessage());
- ms.add(new Status(IStatus.ERROR, TomcatPlugin.PLUGIN_ID, 0,
- TomcatPlugin.getResource("%errorCleanupServer", new String[] {e.getLocalizedMessage()}), e));
- }
-
- monitor.done();
- return ms;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat50Handler.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat50Handler.java
deleted file mode 100644
index f1cd86f..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat50Handler.java
+++ /dev/null
@@ -1,117 +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.jst.server.tomcat.core.internal;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jdt.launching.JavaRuntime;
-import org.eclipse.jst.server.core.IWebModule;
-/**
- * Tomcat 50 handler.
- */
-public class Tomcat50Handler implements ITomcatVersionHandler {
- public boolean verifyInstallPath(IPath installPath) {
- if (installPath == null)
- return false;
-
- String s = installPath.lastSegment();
- if (s != null && s.startsWith("jakarta-tomcat-") && !s.startsWith("jakarta-tomcat-5.0"))
- return false;
- return TomcatPlugin.verifyInstallPath(installPath, TomcatPlugin.TOMCAT_50);
- }
-
- /**
- * Return the runtime class name.
- *
- * @return java.lang.String
- */
- public String getRuntimeClass() {
- return "org.apache.catalina.startup.Bootstrap";
- }
-
- public List getRuntimeClasspath(IPath installPath) {
- List cp = new ArrayList();
-
- // 5.0 - add bootstrap.jar from the Tomcat bin directory
- IPath binPath = installPath.append("bin");
- if (binPath.toFile().exists()) {
- IPath path = binPath.append("bootstrap.jar");
- cp.add(JavaRuntime.newArchiveRuntimeClasspathEntry(path));
- }
-
- return cp;
- }
-
- /**
- * Return the program's runtime arguments.
- *
- * @return java.lang.String[]
- */
- public String[] getRuntimeProgramArguments(IPath configPath, boolean debug, boolean starting) {
- List list = new ArrayList();
- if (configPath != null) {
- list.add("-config");
- list.add("\"" + configPath.append("conf").append("server.xml").toOSString() + "\"");
- }
-
- if (debug)
- list.add("-debug");
-
- if (starting)
- list.add("start");
- else
- list.add("stop");
-
- String[] temp = new String[list.size()];
- list.toArray(temp);
- return temp;
- }
-
- /**
- * Return the runtime (VM) arguments.
- *
- * @return java.lang.String[]
- */
- public String[] getRuntimeVMArguments(IPath installPath, IPath configPath, boolean isSecure) {
- List list = new ArrayList();
- list.add("-Dcatalina.home=\"" + installPath.toOSString() + "\"");
- list.add("-Djava.endorsed.dirs=\"" + installPath.append("common").append("endorsed").toOSString() + "\"");
-
- // run in secure mode
- if (isSecure) {
- list.add("-Djava.security.manager");
- IPath dir = configPath.append("conf").append("catalina.policy");
- list.add("-Djava.security.policy=\"" + dir.toOSString() + "\"");
- }
-
- String[] s = new String[list.size()];
- list.toArray(s);
- return s;
- }
-
- /**
- * Returns true if the given project is supported by this
- * server, and false otherwise.
- *
- * @param module a web module
- * @return the status
- */
- public IStatus canAddModule(IWebModule module) {
- if ("1.2".equals(module.getJ2EESpecificationVersion()) || "1.3".equals(module.getJ2EESpecificationVersion()) || "1.4".equals(module.getJ2EESpecificationVersion()))
- return new Status(IStatus.OK, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%canAddModule"), null);
-
- return new Status(IStatus.ERROR, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%errorSpec50"), null);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat55Configuration.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat55Configuration.java
deleted file mode 100644
index cc33fb5..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat55Configuration.java
+++ /dev/null
@@ -1,746 +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.jst.server.tomcat.core.internal;
-
-import java.io.*;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.runtime.*;
-import org.eclipse.jst.server.tomcat.core.internal.xml.Factory;
-import org.eclipse.jst.server.tomcat.core.internal.xml.XMLUtil;
-import org.eclipse.jst.server.tomcat.core.internal.xml.server40.*;
-import org.w3c.dom.Document;
-import org.xml.sax.InputSource;
-
-import org.eclipse.wst.server.core.IServerPort;
-import org.eclipse.wst.server.core.util.ServerPort;
-/**
- * Tomcat v5.5 server configuration.
- */
-public class Tomcat55Configuration extends TomcatConfiguration {
- protected static final String DEFAULT_SERVICE = "Catalina";
- protected Server server;
- protected Factory serverFactory;
- protected boolean isServerDirty;
-
- protected WebAppDocument webAppDocument;
-
- protected Document tomcatUsersDocument;
-
- protected String policyFile;
- protected boolean isPolicyDirty;
-
- /**
- * Tomcat55Configuration constructor comment.
- */
- public Tomcat55Configuration(IFolder path) {
- super(path);
- }
-
- /**
- * Returns the root of the docbase parameter.
- *
- * @return java.lang.String
- */
- protected String getDocBaseRoot() {
- return "webapps/";
- }
-
- /**
- * Return the port number.
- * @return int
- */
- public IServerPort getMainPort() {
- Iterator iterator = getServerPorts().iterator();
- while (iterator.hasNext()) {
- IServerPort port = (IServerPort) iterator.next();
- if (port.getName().equals("HTTP"))
- return port;
- }
- return null;
- }
-
- /**
- * Returns the mime mappings.
- * @return java.util.List
- */
- public List getMimeMappings() {
- return webAppDocument.getMimeMappings();
- }
-
- /**
- * Returns the prefix that is used in front of the
- * web module path property. (e.g. "webapps")
- *
- * @return java.lang.String
- */
- public String getPathPrefix() {
- return "";
- }
-
- /**
- * Return the docBase of the ROOT web module.
- *
- * @return java.lang.String
- */
- protected String getROOTModuleDocBase() {
- return "ROOT";
- }
-
- /**
- * Returns a list of ServerPorts that this configuration uses.
- *
- * @return java.util.List
- */
- public List getServerPorts() {
- List ports = new ArrayList();
-
- // first add server port
- try {
- int port = Integer.parseInt(server.getPort());
- ports.add(new ServerPort("server", TomcatPlugin.getResource("%portServer"), port, "TCPIP"));
- } catch (Exception e) {
- // ignore
- }
-
- // add connectors
- try {
- int size = server.getServiceCount();
- for (int i = 0; i < size; i++) {
- Service service = server.getService(i);
- int size2 = service.getConnectorCount();
- for (int j = 0; j < size2; j++) {
- Connector connector = service.getConnector(j);
- String name = "HTTP";
- String protocol2 = "TCPIP";
- boolean advanced = true;
- String[] contentTypes = null;
- int port = -1;
- try {
- port = Integer.parseInt(connector.getPort());
- } catch (Exception e) {
- // ignore
- }
- String protocol = connector.getProtocol();
- if (protocol != null && protocol.length() > 0) {
- name = protocol;
- protocol2 = protocol;
- }
- if ("HTTP".equals(protocol))
- contentTypes = new String[] { "web", "webservices" };
- String secure = connector.getSecure();
- if (secure != null && secure.length() > 0) {
- name = "SSL";
- protocol2 = "SSL";
- } else
- advanced = false;
- ports.add(new ServerPort(i +"/" + j, name, port, protocol2, contentTypes, advanced));
- }
- }
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error getting server ports", e);
- }
- return ports;
- }
-
- /**
- * Return a list of the web modules in this server.
- * @return java.util.List
- */
- public List getWebModules() {
- List list = new ArrayList();
-
- try {
- int size = server.getServiceCount();
- for (int i = 0; i < size; i++) {
- Service service = server.getService(i);
- if (service.getName().equalsIgnoreCase(DEFAULT_SERVICE)) {
- Engine engine = service.getEngine();
- Host host = engine.getHost();
- int size2 = host.getContextCount();
- for (int j = 0; j < size2; j++) {
- Context context = host.getContext(j);
- String reload = context.getReloadable();
- if (reload == null)
- reload = "false";
- WebModule module = new WebModule(context.getPath(),
- context.getDocBase(), context.getSource(),
- reload.equalsIgnoreCase("true") ? true : false);
- list.add(module);
- }
- }
- }
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error getting project refs", e);
- }
- return list;
- }
-
- /**
- * @param path a path
- * @param monitor a progress monitor
- */
- public void load(IPath path, IProgressMonitor monitor) throws CoreException {
- try {
- monitor = ProgressUtil.getMonitorFor(monitor);
- monitor.beginTask(TomcatPlugin.getResource("%loadingTask"), 5);
-
- // check for catalina.policy to verify that this is a v5.5 config
- InputStream in = new FileInputStream(path.append("catalina.policy").toFile());
- in.read();
- in.close();
- monitor.worked(1);
-
- serverFactory = new Factory();
- serverFactory.setPackageName("org.eclipse.jst.server.tomcat.core.internal.xml.server40");
- server = (Server) serverFactory.loadDocument(new FileInputStream(path.append("server.xml").toFile()));
- monitor.worked(1);
-
- webAppDocument = new WebAppDocument(path.append("web.xml"));
- monitor.worked(1);
-
- tomcatUsersDocument = XMLUtil.getDocumentBuilder().parse(new InputSource(new FileInputStream(path.append("tomcat-users.xml").toFile())));
- monitor.worked(1);
-
- // load policy file
- BufferedReader br = null;
- try {
- br = new BufferedReader(new InputStreamReader(new FileInputStream(path.append("catalina.policy").toFile())));
- String temp = br.readLine();
- policyFile = "";
- while (temp != null) {
- policyFile += temp + "\n";
- temp = br.readLine();
- }
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Could not load policy file", e);
- } finally {
- if (br != null)
- br.close();
- }
- monitor.worked(1);
-
- if (monitor.isCanceled())
- return;
- monitor.done();
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Could not load Tomcat v5.5 configuration from " + path.toOSString() + ": " + e.getMessage());
- throw new CoreException(new Status(IStatus.ERROR, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%errorCouldNotLoadConfiguration", path.toOSString()), e));
- }
- }
-
- /**
- * Load the configuration.
- *
- * @param folder a folder
- * @param monitor a progress monitor
- */
- public void load(IFolder folder, IProgressMonitor monitor) throws CoreException {
- try {
- monitor = ProgressUtil.getMonitorFor(monitor);
- monitor.beginTask(TomcatPlugin.getResource("%loadingTask"), 800);
-
- // check for catalina.policy to verify that this is a v4.0 config
- IFile file = folder.getFile("catalina.policy");
- if (!file.exists())
- throw new CoreException(new Status(IStatus.WARNING, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%errorCouldNotLoadConfiguration", folder.getFullPath().toOSString()), null));
-
- // load server.xml
- file = folder.getFile("server.xml");
- InputStream in = file.getContents();
- serverFactory = new Factory();
- serverFactory.setPackageName("org.eclipse.jst.server.tomcat.core.internal.xml.server40");
- server = (Server) serverFactory.loadDocument(in);
- monitor.worked(200);
-
- // load web.xml
- file = folder.getFile("web.xml");
- webAppDocument = new WebAppDocument(file);
- monitor.worked(200);
-
- // load tomcat-users.xml
- file = folder.getFile("tomcat-users.xml");
- in = file.getContents();
-
- tomcatUsersDocument = XMLUtil.getDocumentBuilder().parse(new InputSource(in));
- monitor.worked(200);
-
- // load catalina.policy
- file = folder.getFile("catalina.policy");
- in = file.getContents();
- BufferedReader br = null;
- try {
- br = new BufferedReader(new InputStreamReader(in));
- String temp = br.readLine();
- policyFile = "";
- while (temp != null) {
- policyFile += temp + "\n";
- temp = br.readLine();
- }
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Could not load policy file", e);
- } finally {
- if (br != null)
- br.close();
- }
- monitor.worked(200);
-
- if (monitor.isCanceled())
- throw new Exception("Cancelled");
- monitor.done();
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Could not reload Tomcat v5.5 configuration from: " + folder.getFullPath() + ": " + e.getMessage());
- throw new CoreException(new Status(IStatus.ERROR, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%errorCouldNotLoadConfiguration", folder.getFullPath().toOSString()), e));
- }
- }
-
- /**
- * Save to the given directory.
- * @param path a path
- * @param forceDirty boolean
- * @param monitor a progress monitor
- * @exception java.io.IOException
- */
- protected void save(IPath path, boolean forceDirty, IProgressMonitor monitor) throws CoreException {
- try {
- monitor = ProgressUtil.getMonitorFor(monitor);
- monitor.beginTask(TomcatPlugin.getResource("%savingTask"), 3);
-
- // make sure directory exists
- if (!path.toFile().exists()) {
- forceDirty = true;
- path.toFile().mkdir();
- }
- monitor.worked(1);
-
- // save files
- if (forceDirty || isServerDirty)
- serverFactory.save(path.append("server.xml").toOSString());
- monitor.worked(1);
-
- //if (forceDirty || isWebAppDirty)
- // webAppFactory.save(dirPath + "web.xml");
- //webAppDocument.save(path.toOSString(), forceDirty || isPolicyDirty);
- webAppDocument.save(path.append("web.xml").toOSString(), forceDirty);
- monitor.worked(1);
-
- if (forceDirty)
- XMLUtil.save(path.append("tomcat-users.xml").toOSString(), tomcatUsersDocument);
- monitor.worked(1);
-
- if (forceDirty || isPolicyDirty) {
- BufferedWriter bw = new BufferedWriter(new FileWriter(path.append("catalina.policy").toFile()));
- bw.write(policyFile);
- bw.close();
- }
- monitor.worked(1);
- isServerDirty = false;
- isPolicyDirty = false;
-
- if (monitor.isCanceled())
- return;
- monitor.done();
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not save Tomcat v5.5 configuration to " + path, e);
- throw new CoreException(new Status(IStatus.ERROR, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%errorCouldNotSaveConfiguration", new String[] {e.getLocalizedMessage()}), e));
- }
- }
-
- public void save(IPath path, IProgressMonitor monitor) throws CoreException {
- save(path, true, monitor);
- }
-
- /**
- * Save the information held by this object to the given directory.
- *
- * @param folder a folder
- * @param monitor a progress monitor
- * @throws CoreException
- */
- public void save(IFolder folder, IProgressMonitor monitor) throws CoreException {
- try {
- monitor = ProgressUtil.getMonitorFor(monitor);
- monitor.beginTask(TomcatPlugin.getResource("%savingTask"), 900);
-
- // save server.xml
- byte[] data = serverFactory.getContents();
- InputStream in = new ByteArrayInputStream(data);
- IFile file = folder.getFile("server.xml");
- if (file.exists()) {
- if (isServerDirty)
- file.setContents(in, true, true, ProgressUtil.getSubMonitorFor(monitor, 200));
- else
- monitor.worked(200);
- } else
- file.create(in, true, ProgressUtil.getSubMonitorFor(monitor, 200));
-
- // save web.xml
- webAppDocument.save(folder.getFile("web.xml"), ProgressUtil.getSubMonitorFor(monitor, 200));
-
- // save tomcat-users.xml
- data = XMLUtil.getContents(tomcatUsersDocument);
- in = new ByteArrayInputStream(data);
- file = folder.getFile("tomcat-users.xml");
- if (file.exists())
- monitor.worked(200);
- //file.setContents(in, true, true, ProgressUtil.getSubMonitorFor(monitor, 200));
- else
- file.create(in, true, ProgressUtil.getSubMonitorFor(monitor, 200));
-
- // save catalina.policy
- in = new ByteArrayInputStream(policyFile.getBytes());
- file = folder.getFile("catalina.policy");
- if (file.exists())
- monitor.worked(200);
- //file.setContents(in, true, true, ProgressUtil.getSubMonitorFor(monitor, 200));
- else
- file.create(in, true, ProgressUtil.getSubMonitorFor(monitor, 200));
-
- if (monitor.isCanceled())
- return;
- monitor.done();
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not save Tomcat v5.5 configuration to " + folder.toString(), e);
- throw new CoreException(new Status(IStatus.ERROR, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%errorCouldNotSaveConfiguration", new String[] {e.getLocalizedMessage()}), e));
- }
- }
-
- protected static boolean hasMDBListener(Server server) {
- if (server == null)
- return false;
-
- int count = server.getListenerCount();
- if (count == 0)
- return false;
-
- for (int i = 0; i < count; i++) {
- Listener listener = server.getListener(i);
- if (listener != null && listener.getClassName() != null && listener.getClassName().indexOf("mbean") >= 0)
- return true;
- }
- return false;
- }
-
- /**
- * Adds a mime mapping.
- *
- * @param index
- * @param map
- */
- public void addMimeMapping(int index, IMimeMapping map) {
- webAppDocument.addMimeMapping(index, map);
- firePropertyChangeEvent(ADD_MAPPING_PROPERTY, new Integer(index), map);
- }
-
- /**
- * Add a web module.
- * @param module org.eclipse.jst.server.tomcat.WebModule
- */
- public void addWebModule(int index, ITomcatWebModule module) {
- try {
- int size = server.getServiceCount();
- for (int i = 0; i < size; i++) {
- Service service = server.getService(i);
- if (service.getName().equalsIgnoreCase(DEFAULT_SERVICE)) {
- Engine engine = service.getEngine();
- Host host = engine.getHost();
- Context context = (Context) host.createElement(index, "Context");
- context.setDocBase(module.getDocumentBase());
- context.setPath(module.getPath());
- context.setReloadable(module.isReloadable() ? "true" : "false");
- if (module.getMemento() != null && module.getMemento().length() > 0)
- context.setSource(module.getMemento());
- isServerDirty = true;
- firePropertyChangeEvent(ADD_WEB_MODULE_PROPERTY, null, module);
- return;
- }
- }
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error adding web module " + module.getPath(), e);
- }
- }
-
- /**
- * Localize the web projects in this configuration.
- *
- * @param path a path
- * @param monitor a progress monitor
- */
- public void localizeConfiguration(IPath path, TomcatServer server2, TomcatRuntime runtime, IProgressMonitor monitor) {
- try {
- monitor = ProgressUtil.getMonitorFor(monitor);
- monitor.beginTask(TomcatPlugin.getResource("%updatingConfigurationTask"), 100);
-
- Tomcat55Configuration config = new Tomcat55Configuration(null);
- config.load(path, ProgressUtil.getSubMonitorFor(monitor, 40));
-
- if (monitor.isCanceled())
- return;
-
- if (!server2.isTestEnvironment()) {
- //IServerConfigurationWorkingCopy scwc = config.getServerConfiguration().createWorkingCopy();
- //Tomcat55Configuration cfg = (Tomcat55Configuration) scwc.getAdapter(Tomcat55Configuration.class);
- config.localizeWebModules();
- }
- monitor.worked(20);
-
- if (monitor.isCanceled())
- return;
-
- config.save(path, false, ProgressUtil.getSubMonitorFor(monitor, 40));
-
- if (!monitor.isCanceled())
- monitor.done();
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error localizing configuration", e);
- }
- }
-
- /**
- * Go through all of the web modules and make the document
- * base "local" to the configuration.
- */
- protected void localizeWebModules() {
- List modules = getWebModules();
-
- int size = modules.size();
- for (int i = 0; i < size; i++) {
- WebModule module = (WebModule) modules.get(i);
- String memento = module.getMemento();
- if (memento != null && memento.length() > 0) {
- // update document base to a relative ref
- String docBase = getPathPrefix() + module.getPath();
- if (docBase.startsWith("/") || docBase.startsWith("\\"))
- docBase = docBase.substring(1);
- modifyWebModule(i, docBase, module.getPath(), module.isReloadable());
- }
- }
- }
-
- /**
- * Change the extension of a mime mapping.
- *
- * @param index
- * @param map
- */
- public void modifyMimeMapping(int index, IMimeMapping map) {
- webAppDocument.modifyMimeMapping(index, map);
- firePropertyChangeEvent(MODIFY_MAPPING_PROPERTY, new Integer(index), map);
- }
-
- /**
- * Modify the port with the given id.
- *
- * @param id java.lang.String
- * @param port int
- */
- public void modifyServerPort(String id, int port) {
- try {
- if ("server".equals(id)) {
- server.setPort(port + "");
- isServerDirty = true;
- firePropertyChangeEvent(MODIFY_PORT_PROPERTY, id, new Integer(port));
- return;
- }
-
- int i = id.indexOf("/");
- int servNum = Integer.parseInt(id.substring(0, i));
- int connNum = Integer.parseInt(id.substring(i + 1));
-
- Service service = server.getService(servNum);
- Connector connector = service.getConnector(connNum);
- connector.setPort(port + "");
- isServerDirty = true;
- firePropertyChangeEvent(MODIFY_PORT_PROPERTY, id, new Integer(port));
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error modifying server port " + id, e);
- }
- }
- /**
- * Change a web module.
- * @param index int
- * @param docBase java.lang.String
- * @param path java.lang.String
- * @param reloadable boolean
- */
- public void modifyWebModule(int index, String docBase, String path, boolean reloadable) {
- try {
- int size = server.getServiceCount();
- for (int i = 0; i < size; i++) {
- Service service = server.getService(i);
- if (service.getName().equalsIgnoreCase(DEFAULT_SERVICE)) {
- Engine engine = service.getEngine();
- Host host = engine.getHost();
- Context context = host.getContext(index);
- context.setPath(path);
- context.setDocBase(docBase);
- context.setReloadable(reloadable ? "true" : "false");
- isServerDirty = true;
- WebModule module = new WebModule(path, docBase, null, reloadable);
- firePropertyChangeEvent(MODIFY_WEB_MODULE_PROPERTY, new Integer(index), module);
- return;
- }
- }
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error modifying web module " + index, e);
- }
- }
-
- /**
- * Removes a mime mapping.
- * @param index int
- */
- public void removeMimeMapping(int index) {
- webAppDocument.removeMimeMapping(index);
- firePropertyChangeEvent(REMOVE_MAPPING_PROPERTY, null, new Integer(index));
- }
-
- /**
- * Removes a web module.
- * @param index int
- */
- public void removeWebModule(int index) {
- try {
- int size = server.getServiceCount();
- for (int i = 0; i < size; i++) {
- Service service = server.getService(i);
- if (service.getName().equalsIgnoreCase(DEFAULT_SERVICE)) {
- Engine engine = service.getEngine();
- Host host = engine.getHost();
- host.removeElement("Context", index);
- isServerDirty = true;
- firePropertyChangeEvent(REMOVE_WEB_MODULE_PROPERTY, null, new Integer(index));
- return;
- }
- }
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error removing module ref " + index, e);
- }
- }
-
- protected IStatus backupAndPublish(IPath confDir, boolean doBackup, IProgressMonitor monitor) {
- MultiStatus ms = new MultiStatus(TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%publishConfigurationTask"), null);
- Trace.trace(Trace.FINER, "Backup and publish");
- monitor = ProgressUtil.getMonitorFor(monitor);
-
- backupAndPublish(confDir, doBackup, ms, monitor, 300);
- // TODO Refactor success detection once Bug 81060 is addressed
- // This approach avoids refactoring TomcatConfiguration.backupFolder()
- // and backupPath() for now.
- if (ms.isOK() && ms.getChildren().length > 0)
- publishContextConfig(confDir, ms, monitor);
-
- monitor.done();
- return ms;
- }
-
- protected void publishContextConfig(IPath confDir, MultiStatus ms, IProgressMonitor monitor) {
- Trace.trace(Trace.FINER, "Apply context configurations");
- try {
- confDir = confDir.append("conf");
-
- monitor.subTask(TomcatPlugin.getResource("%publishContextConfigTask"));
- Factory factory = new Factory();
- factory.setPackageName("org.eclipse.jst.server.tomcat.core.internal.xml.server40");
- Server publishedServer = (Server) factory.loadDocument(new FileInputStream(confDir.append("server.xml").toFile()));
- monitor.worked(100);
-
- boolean modified = false;
-
- int size = publishedServer.getServiceCount();
- for (int i = 0; i < size; i++) {
- Service service = publishedServer.getService(i);
- if (service.getName().equalsIgnoreCase(DEFAULT_SERVICE)) {
- Engine engine = service.getEngine();
- Host host = engine.getHost();
- int size2 = host.getContextCount();
- for (int j = 0; j < size2; j++) {
- Context context = host.getContext(j);
- monitor.subTask(TomcatPlugin.getResource("%checkingContextTask",
- new String[] {context.getPath()}));
- if (addContextConfig(context)) {
- modified = true;
- }
- }
- }
- }
- monitor.worked(100);
- if (modified) {
- monitor.subTask(TomcatPlugin.getResource("%savingContextConfigTask"));
- factory.save(confDir.append("server.xml").toOSString());
- }
- monitor.worked(100);
-
- Trace.trace(Trace.FINER, "Server.xml updated with context.xml configurations");
- ms.add(new Status(IStatus.OK, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%serverPostProcessingComplete"), null));
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Could not apply context configurations published Tomcat v5.0 configuration from " + confDir.toOSString() + ": " + e.getMessage());
- IStatus s = new Status(IStatus.ERROR, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%errorPublishConfiguration", new String[] {e.getLocalizedMessage()}), e);
- ms.add(s);
- }
- }
-
- /**
- * If the specified Context is linked to a project, try to
- * update any configuration found a META-INF/context.xml found
- * relative to the specified docBase.
- * @param context Context object to receive context.xml contents.
- * @return Returns true if context is modified.
- */
- protected boolean addContextConfig(Context context) {
- boolean modified = false;
- String source = context.getSource();
- if (source != null && source.length() > 0 )
- {
- if (context.hasChildNodes()) {
- context.removeChildren();
- modified = true;
- }
- String docBase = context.getDocBase();
- Context contextConfig = loadContextConfig(docBase);
- if (null != contextConfig) {
- contextConfig.copyChildrenTo(context);
- modified = true;
- }
- }
- return modified;
- }
-
- /**
- * Tries to read a META-INF/context.xml file relative to the
- * specified docBase. If found, it creates a Context object
- * containing the contexts of that file.
- * @param docBase
- * @return Context element created from context.xml, or null if not found.
- */
- protected Context loadContextConfig(String docBase) {
- File contexXML = new File(docBase + File.separator + "META-INF" + File.separator + "context.xml");
- if (contexXML.exists()) {
- try {
- InputStream is = new FileInputStream(contexXML);
- Factory ctxFactory = new Factory();
- ctxFactory.setPackageName("org.eclipse.jst.server.tomcat.core.internal.xml.server40");
- Context ctx = (Context)ctxFactory.loadDocument(is);
- is.close();
- return ctx;
- } catch (FileNotFoundException e) {
- // Ignore, should never occur
- } catch (IOException e) {
- Trace.trace(Trace.SEVERE, "Error reading web module's context.xml file: " + docBase, e);
- }
- }
- return null;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat55Handler.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat55Handler.java
deleted file mode 100644
index c4221c2..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat55Handler.java
+++ /dev/null
@@ -1,44 +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.jst.server.tomcat.core.internal;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jst.server.core.IWebModule;
-/**
- * Tomcat 55 handler.
- */
-public class Tomcat55Handler extends Tomcat50Handler {
- public boolean verifyInstallPath(IPath installPath) {
- if (installPath == null)
- return false;
-
- String s = installPath.lastSegment();
- if (s != null && s.startsWith("jakarta-tomcat-") && !s.startsWith("jakarta-tomcat-5.5"))
- return false;
- return TomcatPlugin.verifyInstallPath(installPath, TomcatPlugin.TOMCAT_55);
- }
-
- /**
- * Returns true if the given project is supported by this
- * server, and false otherwise.
- *
- * @param module a web module
- * @return the status
- */
- public IStatus canAddModule(IWebModule module) {
- if ("1.2".equals(module.getJ2EESpecificationVersion()) || "1.3".equals(module.getJ2EESpecificationVersion()) || "1.4".equals(module.getJ2EESpecificationVersion()))
- return new Status(IStatus.OK, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%canAddModule"), null);
-
- return new Status(IStatus.ERROR, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%errorSpec55"), null);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatConfiguration.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatConfiguration.java
deleted file mode 100644
index f047682..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatConfiguration.java
+++ /dev/null
@@ -1,322 +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.jst.server.tomcat.core.internal;
-
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.io.File;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.*;
-import org.eclipse.jst.server.core.IWebModule;
-
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IServerPort;
-/**
- * Generic Tomcat server configuration.
- */
-public abstract class TomcatConfiguration implements ITomcatConfiguration, ITomcatConfigurationWorkingCopy {
- public static final String NAME_PROPERTY = "name";
- public static final String PORT_PROPERTY = "port";
- public static final String MODIFY_PORT_PROPERTY = "modifyPort";
- public static final String ADD_MAPPING_PROPERTY = "addMapping";
- public static final String REMOVE_MAPPING_PROPERTY = "removeMapping";
- public static final String MODIFY_MAPPING_PROPERTY = "modifyMapping";
-
- public static final String MODIFY_WEB_MODULE_PROPERTY = "modifyWebModule";
- public static final String ADD_WEB_MODULE_PROPERTY = "addWebModule";
- public static final String REMOVE_WEB_MODULE_PROPERTY = "removeWebModule";
-
- protected IFolder configPath;
-
- // property change listeners
- private transient List propertyListeners;
-
- /**
- * TomcatConfiguration constructor comment.
- */
- public TomcatConfiguration(IFolder path) {
- super();
- this.configPath = path;
- /*try {
- load(configPath, new NullProgressMonitor());
- } catch (Exception e) {
- // ignore
- }*/
- }
-
- protected IFolder getFolder() {
- return configPath;
- }
-
- /**
- * Copies all files from the given directory in the workbench
- * to the given location. Can be overridden by version specific
- * class to modify or enhance what publish does.
- *
- * @return org.eclipse.core.runtime.IStatus
- */
- protected IStatus backupAndPublish(IPath confDir, boolean doBackup, IProgressMonitor monitor) {
- MultiStatus ms = new MultiStatus(TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%publishConfigurationTask"), null);
- Trace.trace(Trace.FINER, "Backup and publish");
- monitor = ProgressUtil.getMonitorFor(monitor);
-
- backupAndPublish(confDir, doBackup, ms, monitor, 0);
-
- monitor.done();
- return ms;
- }
-
- protected void backupAndPublish(IPath confDir, boolean doBackup, MultiStatus ms, IProgressMonitor monitor, int additionalWork) {
- try {
- IPath backup = null;
- if (doBackup) {
- // create backup directory
- backup = confDir.append("backup");
- if (!backup.toFile().exists())
- backup.toFile().mkdir();
- }
-
- confDir = confDir.append("conf");
-
- /*IServerConfiguration config = getServerConfiguration();
- IFolder folder = config.getConfigurationDataFolder();
- if (folder != null)
- backupFolder(folder, confDir, backup, ms, monitor);
- else {
- IPath path = config.getConfigurationDataPath();
- backupPath(configPath, confDir, backup, ms, monitor);*/
- backupFolder(getFolder(), confDir, backup, ms, monitor, additionalWork);
- //}
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "backupAndPublish() error", e);
- IStatus s = new Status(IStatus.ERROR, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%errorPublishConfiguration", new String[] {e.getLocalizedMessage()}), e);
- ms.add(s);
- }
- }
-
- protected void backupFolder(IFolder folder, IPath confDir, IPath backup, MultiStatus ms, IProgressMonitor monitor, int additionalWork) throws CoreException {
- IResource[] children = folder.members();
- if (children == null)
- return;
-
- int size = children.length;
- monitor.beginTask(TomcatPlugin.getResource("%publishConfigurationTask"), size * 100 + additionalWork);
- for (int i = 0; i < size; i++) {
- if (children[i] instanceof IFile) {
- try {
- IFile file = (IFile) children[i];
- String name = file.getName();
- monitor.subTask(TomcatPlugin.getResource("%publisherPublishTask", new String[] {name}));
- Trace.trace(Trace.FINEST, "Publishing " + name);
-
- // backup and copy file
- boolean copy = true;
- if (backup != null && !(backup.append(name).toFile().exists())) {
- IStatus status = FileUtil.copyFile(confDir.append(name).toOSString(), backup + File.separator + name);
- ms.add(status);
- if (!status.isOK())
- copy = false;
- }
-
- if (copy) {
- InputStream in = file.getContents();
- ms.add(FileUtil.copyFile(in, confDir.append(name).toOSString()));
- }
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "backupAndPublish() error", e);
- ms.add(new Status(IStatus.ERROR, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%errorPublishConfiguration", new String[] {e.getLocalizedMessage()}), e));
- }
- }
- monitor.worked(100);
- }
- }
-
- protected void backupPath(IPath path, IPath confDir, IPath backup, MultiStatus ms, IProgressMonitor monitor) {
- File[] files = path.toFile().listFiles();
- if (files == null)
- return;
-
- int size = files.length;
- monitor.beginTask(TomcatPlugin.getResource("%publishConfigurationTask"), size * 100);
- for (int i = 0; i < size; i++) {
- try {
- File file = files[i];
- String name = file.getName();
- monitor.subTask(TomcatPlugin.getResource("%publisherPublishTask", new String[] {name}));
- Trace.trace(Trace.FINEST, "Publishing " + name);
-
- // backup and copy file
- boolean copy = true;
- if (backup != null && !(backup.append(name).toFile().exists())) {
- IStatus status = FileUtil.copyFile(confDir.append(name).toOSString(), backup + File.separator + name);
- ms.add(status);
- if (!status.isOK())
- copy = false;
- }
-
- if (copy)
- ms.add(FileUtil.copyFile(file.getAbsolutePath(), confDir.append(name).toOSString()));
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "backupAndPublish() error", e);
- ms.add(new Status(IStatus.ERROR, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%errorPublishConfiguration", new String[] {e.getLocalizedMessage()}), e));
- }
- monitor.worked(100);
- }
- }
-
- protected IStatus cleanupServer(IPath confDir, IPath installDir, IProgressMonitor monitor) {
- // Default implementation assumes nothing to clean
- monitor = ProgressUtil.getMonitorFor(monitor);
- monitor.done();
- return Status.OK_STATUS;
- }
-
-
- /**
- * Returns the root of the docbase parameter.
- *
- * @return java.lang.String
- */
- protected abstract String getDocBaseRoot();
-
- /**
- * Returns the main server port.
- * @return IServerPort
- */
- public abstract IServerPort getMainPort();
-
- /**
- * Returns the prefix that is used in front of the
- * web module path property. (e.g. "webapps")
- *
- * @return java.lang.String
- */
- public abstract String getPathPrefix();
-
- /**
- * Returns the partial URL applicable to this module.
- *
- * @param webModule a web module
- * @return the partial URL
- */
- protected String getWebModuleURL(IModule webModule) {
- WebModule module = getWebModule(webModule);
- if (module != null)
- return module.getPath();
-
- IWebModule webModule2 = (IWebModule) webModule.getAdapter(IWebModule.class);
- return "/" + webModule2.getContextRoot();
- }
-
- /**
- * Returns the given module from the config.
- *
- * @param module a web module
- * @return a web module
- */
- protected WebModule getWebModule(IModule module) {
- if (module == null)
- return null;
-
- String memento = module.getId();
-
- List modules = getWebModules();
- int size = modules.size();
- for (int i = 0; i < size; i++) {
- WebModule webModule = (WebModule) modules.get(i);
- if (memento.equals(webModule.getMemento())) {
- return webModule;
- }
- }
- return null;
- }
-
- /**
- * Return the docBase of the ROOT web module.
- *
- * @return java.lang.String
- */
- protected abstract String getROOTModuleDocBase();
-
- protected abstract void save(IFolder folder, IProgressMonitor monitor) throws CoreException;
-
- protected void firePropertyChangeEvent(String propertyName, Object oldValue, Object newValue) {
- if (propertyListeners == null)
- return;
-
- PropertyChangeEvent event = new PropertyChangeEvent(this, propertyName, oldValue, newValue);
- try {
- Iterator iterator = propertyListeners.iterator();
- while (iterator.hasNext()) {
- try {
- PropertyChangeListener listener = (PropertyChangeListener) iterator.next();
- listener.propertyChange(event);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error firing property change event", e);
- }
- }
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error in property event", e);
- }
- }
-
- /**
- * Adds a property change listener to this server.
- *
- * @param listener java.beans.PropertyChangeListener
- */
- public void addPropertyChangeListener(PropertyChangeListener listener) {
- if (propertyListeners == null)
- propertyListeners = new ArrayList();
- propertyListeners.add(listener);
- }
-
- /**
- * Removes a property change listener from this server.
- *
- * @param listener java.beans.PropertyChangeListener
- */
- public void removePropertyChangeListener(PropertyChangeListener listener) {
- if (propertyListeners != null)
- propertyListeners.remove(listener);
- }
-
- /*public void importFromPath(IPath path, IProgressMonitor monitor) throws CoreException {
- load(path, monitor);
- }
-
- public void importFromRuntime(IRuntime runtime, IProgressMonitor monitor) throws CoreException {
- load(runtime.getLocation().append("conf"), monitor);
- }*/
-
- protected abstract void load(IPath path, IProgressMonitor monitor) throws CoreException;
-
- protected abstract void load(IFolder folder, IProgressMonitor monitor) throws CoreException;
-
- public abstract void addWebModule(int index, ITomcatWebModule module);
-
- public abstract void removeWebModule(int index);
-
- /**
- * Return a string representation of this object.
- * @return java.lang.String
- */
- public String toString() {
- return "TomcatConfiguration[" + this + "]";
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatLaunchConfigurationDelegate.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatLaunchConfigurationDelegate.java
deleted file mode 100644
index eaa18b4..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatLaunchConfigurationDelegate.java
+++ /dev/null
@@ -1,86 +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.jst.server.tomcat.core.internal;
-
-import java.io.File;
-import java.util.Map;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.jdt.launching.*;
-
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.IServerAttributes;
-import org.eclipse.wst.server.core.ServerCore;
-/**
- *
- */
-public class TomcatLaunchConfigurationDelegate extends AbstractJavaLaunchConfigurationDelegate {
-
- public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
- String serverId = configuration.getAttribute(IServerAttributes.ATTR_SERVER_ID, (String) null);
-
- IServer server = null;
- if (serverId != null)
- server = ServerCore.findServer(serverId);
- if (server == null) {
- Trace.trace(Trace.FINEST, "Launch configuration could not find server");
- // throw CoreException();
- return;
- }
-
- TomcatServerBehaviour tomcatServer = (TomcatServerBehaviour) server.getAdapter(TomcatServerBehaviour.class);
- tomcatServer.setupLaunch(launch, mode, monitor);
-
- String mainTypeName = tomcatServer.getRuntimeClass();
-
- IVMInstall vm = verifyVMInstall(configuration);
-
- IVMRunner runner = vm.getVMRunner(mode);
-
- File workingDir = verifyWorkingDirectory(configuration);
- String workingDirName = null;
- if (workingDir != null)
- workingDirName = workingDir.getAbsolutePath();
-
- // Program & VM args
- String pgmArgs = getProgramArguments(configuration);
- String vmArgs = getVMArguments(configuration);
-
- ExecutionArguments execArgs = new ExecutionArguments(vmArgs, pgmArgs);
-
- // VM-specific attributes
- Map vmAttributesMap = getVMSpecificAttributesMap(configuration);
-
- // Classpath
- String[] classpath = getClasspath(configuration);
-
- // Create VM config
- VMRunnerConfiguration runConfig = new VMRunnerConfiguration(mainTypeName, classpath);
- runConfig.setProgramArguments(execArgs.getProgramArgumentsArray());
- runConfig.setVMArguments(execArgs.getVMArgumentsArray());
- runConfig.setWorkingDirectory(workingDirName);
- runConfig.setVMSpecificAttributesMap(vmAttributesMap);
-
- // Bootpath
- String[] bootpath = getBootpath(configuration);
- if (bootpath != null && bootpath.length > 0)
- runConfig.setBootClassPath(bootpath);
-
- setDefaultSourceLocator(launch, configuration);
-
- // Launch the configuration
- runner.run(runConfig, launch, monitor);
- tomcatServer.setProcess(launch.getProcesses()[0]);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatLaunchableAdapterDelegate.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatLaunchableAdapterDelegate.java
deleted file mode 100644
index 33fbf2e..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatLaunchableAdapterDelegate.java
+++ /dev/null
@@ -1,69 +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.jst.server.tomcat.core.internal;
-
-import java.net.URL;
-
-import org.eclipse.jst.server.core.IWebModule;
-import org.eclipse.jst.server.core.Servlet;
-import org.eclipse.wst.server.core.ILaunchable;
-import org.eclipse.wst.server.core.IModuleArtifact;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.model.*;
-import org.eclipse.wst.server.core.util.HttpLaunchable;
-import org.eclipse.wst.server.core.util.WebResource;
-/**
- * Launchable adapter delegate for Web resources in Tomcat.
- */
-public class TomcatLaunchableAdapterDelegate extends LaunchableAdapterDelegate {
- /*
- * @see LaunchableAdapterDelegate#getLaunchable(IServer, IModuleArtifact)
- */
- public ILaunchable getLaunchable(IServer server, IModuleArtifact moduleObject) {
- Trace.trace(Trace.FINER, "TomcatLaunchableAdapter " + server + "-" + moduleObject);
- if (server.getAdapter(TomcatServer.class) == null)
- return null;
- if (!(moduleObject instanceof Servlet) &&
- !(moduleObject instanceof WebResource))
- return null;
- if (moduleObject.getModule().getAdapter(IWebModule.class) == null)
- return null;
-
- try {
- URL url = ((IURLProvider) server.getAdapter(IURLProvider.class)).getModuleRootURL(moduleObject.getModule());
-
- Trace.trace(Trace.FINER, "root: " + url);
-
- if (moduleObject instanceof Servlet) {
- Servlet servlet = (Servlet) moduleObject;
- if (servlet.getAlias() != null) {
- String path = servlet.getAlias();
- if (path.startsWith("/"))
- path = path.substring(1);
- url = new URL(url, path);
- } else
- url = new URL(url, "servlet/" + servlet.getServletClassName());
- } else if (moduleObject instanceof WebResource) {
- WebResource resource = (WebResource) moduleObject;
- String path = resource.getPath().toString();
- Trace.trace(Trace.FINER, "path: " + path);
- if (path != null && path.startsWith("/") && path.length() > 0)
- path = path.substring(1);
- if (path != null && path.length() > 0)
- url = new URL(url, path);
- }
- return new HttpLaunchable(url);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error getting URL for " + moduleObject, e);
- return null;
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatPlugin.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatPlugin.java
deleted file mode 100644
index 688de2e..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatPlugin.java
+++ /dev/null
@@ -1,316 +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.jst.server.tomcat.core.internal;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URL;
-import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-import java.util.StringTokenizer;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.Status;
-/**
- * The Tomcat plugin.
- */
-public class TomcatPlugin extends Plugin {
- protected static TomcatPlugin singleton;
-
- public static final String PLUGIN_ID = "org.eclipse.jst.server.tomcat.core";
-
- public static final String TOMCAT_32 = "org.eclipse.jst.server.tomcat.32";
- public static final String TOMCAT_40 = "org.eclipse.jst.server.tomcat.40";
- public static final String TOMCAT_41 = "org.eclipse.jst.server.tomcat.41";
- public static final String TOMCAT_50 = "org.eclipse.jst.server.tomcat.50";
- public static final String TOMCAT_55 = "org.eclipse.jst.server.tomcat.55";
-
- protected static final String VERIFY_INSTALL_FILE = "verifyInstall.properties";
- protected static String[] verify32;
- protected static String[] verify40;
- protected static String[] verify41;
- protected static String[] verify50;
- protected static String[] verify55;
-
- /**
- * TomcatPlugin constructor comment.
- */
- public TomcatPlugin() {
- super();
- singleton = this;
- }
-
- /**
- * Returns the singleton instance of this plugin.
- * @return org.eclipse.jst.server.tomcat.internal.TomcatPlugin
- */
- public static TomcatPlugin getInstance() {
- return singleton;
- }
-
- /**
- * Return the install location preference.
- *
- * @param id a runtime type id
- * @return the install location
- */
- public static String getPreference(String id) {
- return getInstance().getPluginPreferences().getString(id);
- }
-
- /**
- * Set the install location preference.
- *
- * @param id the runtimt type id
- * @param value the location
- */
- public static void setPreference(String id, String value) {
- getInstance().getPluginPreferences().setValue(id, value);
- getInstance().savePluginPreferences();
- }
-
- /**
- * Convenience method for logging.
- *
- * @param status a status object
- */
- public static void log(IStatus status) {
- getInstance().getLog().log(status);
- }
-
- /**
- * Returns the translated String found with the given key.
- *
- * @param key a key
- * @return a translated string
- */
- public static String getResource(String key) {
- try {
- return Platform.getResourceString(getInstance().getBundle(), key);
- } catch (Exception e) {
- return key;
- }
- }
-
- /**
- * Returns the translated String found with the given key,
- * and formatted with the given object.
- *
- * @param key a key
- * @param obj substitution arguments
- * @return a translated string
- */
- public static String getResource(String key, Object[] obj) {
- try {
- return MessageFormat.format(getResource(key), obj);
- } catch (Exception e) {
- return key;
- }
- }
-
- /**
- * Returns the translated String found with the given key,
- * and formatted with the given object.
- *
- * @param key a key
- * @param arg an argument
- * @return a translated string
- */
- public static String getResource(String key, String arg) {
- return getResource(key, new String[] { arg });
- }
-
- /**
- * Returns the translated String found with the given key,
- * and formatted with the given object.
- *
- * @param key a key
- * @param arg1 an argument
- * @param arg2 another argument
- * @return a translated string
- */
- public static String getResource(String key, String arg1, String arg2) {
- return getResource(key, new String[] { arg1, arg2 });
- }
-
- /**
- * Returns the Tomcat home directory.
- * @return java.lang.String
- */
- protected static String getTomcatStateLocation() {
- try {
- return getInstance().getStateLocation().toOSString();
- } catch (Exception e) {
- return null;
- }
- }
-
- public static ITomcatVersionHandler getTomcatVersionHandler(String id) {
- if (id.indexOf("runtime") > 0)
- id = id.substring(0, 30) + id.substring(38);
- //id = id.substring(0, id.length() - 8);
- if (TOMCAT_32.equals(id))
- return new Tomcat32Handler();
- else if (TOMCAT_40.equals(id))
- return new Tomcat40Handler();
- else if (TOMCAT_41.equals(id))
- return new Tomcat41Handler();
- else if (TOMCAT_50.equals(id))
- return new Tomcat50Handler();
- else if (TOMCAT_55.equals(id))
- return new Tomcat55Handler();
- else
- return null;
- }
-
- /**
- * Loads the files to verify the Tomcat installation.
- */
- public static void loadVerifyFiles() {
- if (verify32 != null)
- return;
-
- // backup (empty) values
- verify32 = new String[0];
- verify40 = new String[0];
- verify41 = new String[0];
- verify50 = new String[0];
- verify55 = new String[0];
-
- try {
- URL url = getInstance().getBundle().getEntry(VERIFY_INSTALL_FILE);
- url = Platform.resolve(url);
- Properties p = new Properties();
- p.load(url.openStream());
-
- String verify = p.getProperty("verify32install");
- verify.replace('/', File.separatorChar);
-
- StringTokenizer st = new StringTokenizer(verify, ",");
- List list = new ArrayList();
- while (st.hasMoreTokens())
- list.add(st.nextToken());
- Trace.trace(Trace.FINEST, "Verify32: " + list.toString());
- verify32 = new String[list.size()];
- list.toArray(verify32);
-
- // v4.0
- verify = p.getProperty("verify40install");
- verify.replace('/', File.separatorChar);
-
- st = new StringTokenizer(verify, ",");
- list = new ArrayList();
- while (st.hasMoreTokens())
- list.add(st.nextToken());
- Trace.trace(Trace.FINEST, "Verify40: " + list.toString());
- verify40 = new String[list.size()];
- list.toArray(verify40);
-
- // v4.1
- verify = p.getProperty("verify41install");
- verify.replace('/', File.separatorChar);
-
- st = new StringTokenizer(verify, ",");
- list = new ArrayList();
- while (st.hasMoreTokens())
- list.add(st.nextToken());
- Trace.trace(Trace.FINEST, "Verify41: " + list.toString());
- verify41 = new String[list.size()];
- list.toArray(verify41);
-
- // v5.0
- verify = p.getProperty("verify50install");
- verify.replace('/', File.separatorChar);
-
- st = new StringTokenizer(verify, ",");
- list = new ArrayList();
- while (st.hasMoreTokens())
- list.add(st.nextToken());
- Trace.trace(Trace.FINEST, "Verify50: " + list.toString());
- verify50 = new String[list.size()];
- list.toArray(verify50);
-
- // v5.5
- verify = p.getProperty("verify55install");
- verify.replace('/', File.separatorChar);
-
- st = new StringTokenizer(verify, ",");
- list = new ArrayList();
- while (st.hasMoreTokens())
- list.add(st.nextToken());
- Trace.trace(Trace.FINEST, "Verify55: " + list.toString());
- verify55 = new String[list.size()];
- list.toArray(verify55);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not load installation verification properties", e);
- }
- }
-
- public static boolean verifyInstallPath(IPath installPath, String id) {
- if (installPath == null)
- return false;
-
- String dir = installPath.toOSString();
- if (!dir.endsWith(File.separator))
- dir += File.separator;
-
- // look for the following files and directories
- TomcatPlugin.loadVerifyFiles();
-
- String[] paths = null;
- if (TOMCAT_32.equals(id))
- paths = verify32;
- else if (TOMCAT_40.equals(id))
- paths = verify40;
- else if (TOMCAT_41.equals(id))
- paths = verify41;
- else if (TOMCAT_50.equals(id))
- paths = verify50;
- else if (TOMCAT_55.equals(id))
- paths = verify55;
- else
- return false;
-
- for (int i = 0; i < paths.length; i++) {
- File temp = new File(dir + paths[i]);
- if (!temp.exists())
- return false;
- }
- return true;
- }
-
- /**
- * Return a <code>java.io.File</code> object that corresponds to the specified
- * <code>IPath</code> in the plugin directory.
- */
- public static File getFileInPlugin(IPath path) {
- try {
- URL installURL = new URL(getInstance().getBundle().getEntry("/"), path.toString());
- URL localURL = Platform.asLocalURL(installURL);
- return new File(localURL.getFile());
- } catch (IOException ioe) {
- return null;
- }
- }
-
- public static void log(String message) {
- log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.ERROR, message, null));
- }
-
- public static void log(Throwable e) {
- log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.ERROR, e.getMessage(), e));
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatRuntime.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatRuntime.java
deleted file mode 100644
index aaf6d9a..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatRuntime.java
+++ /dev/null
@@ -1,223 +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.jst.server.tomcat.core.internal;
-
-import java.io.File;
-import java.text.MessageFormat;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.core.Launch;
-import org.eclipse.debug.core.model.IStreamsProxy;
-import org.eclipse.jdt.launching.*;
-
-import org.eclipse.wst.server.core.IRuntimeType;
-import org.eclipse.wst.server.core.model.RuntimeDelegate;
-/**
- *
- */
-public class TomcatRuntime extends RuntimeDelegate implements ITomcatRuntime, ITomcatRuntimeWorkingCopy {
- protected static final String PROP_VM_INSTALL_TYPE_ID = "vm-install-type-id";
- protected static final String PROP_VM_INSTALL_ID = "vm-install-id";
-
- protected static Map sdkMap = new HashMap(2);
-
- public TomcatRuntime() {
- // do nothing
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.server.core.model.IRuntime#getLocation()
- */
- public ITomcatVersionHandler getVersionHandler() {
- IRuntimeType type = getRuntime().getRuntimeType();
- return TomcatPlugin.getTomcatVersionHandler(type.getId());
- }
-
- protected String getVMInstallTypeId() {
- return getAttribute(PROP_VM_INSTALL_TYPE_ID, (String)null);
- }
-
- protected String getVMInstallId() {
- return getAttribute(PROP_VM_INSTALL_ID, (String)null);
- }
-
- public IVMInstall getVMInstall() {
- try {
- IVMInstallType vmInstallType = JavaRuntime.getVMInstallType(getVMInstallTypeId());
- IVMInstall[] vmInstalls = vmInstallType.getVMInstalls();
- int size = vmInstalls.length;
- String id = getVMInstallId();
- for (int i = 0; i < size; i++) {
- if (id.equals(vmInstalls[i].getId()))
- return vmInstalls[i];
- }
- } catch (Exception e) {
- // ignore
- }
- return null;
- }
-
- public List getRuntimeClasspath() {
- return getVersionHandler().getRuntimeClasspath(getRuntime().getLocation());
- }
-
- /**
- * Verifies the Tomcat installation directory. If it is
- * correct, true is returned. Otherwise, the user is notified
- * and false is returned.
- * @return boolean
- */
- public boolean verifyLocation() {
- return getVersionHandler().verifyInstallPath(getRuntime().getLocation());
- }
-
- /*
- * Validate the runtime
- */
- public IStatus validate() {
- IStatus status = super.validate();
- if (!status.isOK())
- return status;
-
- if (!verifyLocation())
- return new Status(IStatus.ERROR, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%errorInstallDir"), null);
- // don't accept trailing space since that can cause startup problems
- if (getRuntime().getLocation().hasTrailingSeparator())
- return new Status(IStatus.ERROR, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%errorInstallDirTrailingSlash"), null);
- if (getVMInstall() == null)
- return new Status(IStatus.ERROR, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%errorJRE"), null);
-
- // check for tools.jar (contains the javac compiler on Windows & Linux) to see whether
- // Tomcat will be able to compile JSPs.
- boolean found = false;
- File file = getVMInstall().getInstallLocation();
- if (file != null) {
- File toolsJar = new File(file, "lib" + File.separator + "tools.jar");
- if (toolsJar.exists())
- found = true;
- }
-
- // on Mac, tools.jar is merged into classes.zip. if tools.jar wasn't found,
- // try loading the javac class by running a check inside the VM
- if (!found)
- found = checkForCompiler();
-
- if (!found)
- return new Status(IStatus.WARNING, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%warningJRE"), null);
-
- return new Status(IStatus.OK, TomcatPlugin.PLUGIN_ID, 0, "", null);
- }
-
- public void setDefaults() {
- IVMInstall vmInstall = JavaRuntime.getDefaultVMInstall();
- setVMInstall(vmInstall.getVMInstallType().getId(), vmInstall.getId());
-
- IRuntimeType type = getRuntimeWorkingCopy().getRuntimeType();
- getRuntimeWorkingCopy().setLocation(new Path(TomcatPlugin.getPreference("location" + type.getId())));
- }
-
- public void setVMInstall(IVMInstall vmInstall) {
- if (vmInstall == null) {
- setVMInstall(null, null);
- } else
- setVMInstall(vmInstall.getVMInstallType().getId(), vmInstall.getId());
- }
-
- protected void setVMInstall(String typeId, String id) {
- if (typeId == null)
- setAttribute(PROP_VM_INSTALL_TYPE_ID, (String)null);
- else
- setAttribute(PROP_VM_INSTALL_TYPE_ID, typeId);
-
- if (id == null)
- setAttribute(PROP_VM_INSTALL_ID, (String)null);
- else
- setAttribute(PROP_VM_INSTALL_ID, id);
- }
-
- /**
- * Checks for the existance of the Java compiler in the given java
- * executable. A main program is run (<code>org.eclipse.jst.tomcat.core.
- * internal.ClassDetector</code>), that dumps a true or false value
- * depending on whether the compiler is found. This output is then
- * parsed and cached for future reference.
- *
- * @return true if the compiler was found
- */
- protected boolean checkForCompiler() {
- // first try the cache
- File javaHome = getVMInstall().getInstallLocation();
- try {
- Boolean b = (Boolean) sdkMap.get(javaHome);
- return b.booleanValue();
- } catch (Exception e) {
- // ignore
- }
-
- // locate tomcatcore.jar - it contains the class detector main program
- File file = TomcatPlugin.getFileInPlugin(new Path("tomcatcore.jar"));
- if (file != null && file.exists()) {
- IVMRunner vmRunner = getVMInstall().getVMRunner(ILaunchManager.RUN_MODE);
- VMRunnerConfiguration config = new VMRunnerConfiguration("org.eclipse.jst.server.tomcat.core.internal.ClassDetector", new String[] { file.getAbsolutePath() });
- config.setProgramArguments(new String[] { "com.sun.tools.javac.Main" });
- ILaunch launch = new Launch(null, ILaunchManager.RUN_MODE, null);
- try {
- vmRunner.run(config, launch, null);
- for (int i = 0; i < 200; i++) {
- // wait no more than 10 seconds (200 * 50 mils)
- if (launch.isTerminated()) {
- break;
- }
- try {
- Thread.sleep(50);
- } catch (InterruptedException e) {
- // ignore
- }
- }
- IStreamsProxy streamsProxy = launch.getProcesses()[0].getStreamsProxy();
- String text = null;
- if (streamsProxy != null) {
- text = streamsProxy.getOutputStreamMonitor().getContents();
-
- if (text != null && text.length() > 0) {
- boolean found = false;
- if ("true".equals(text))
- found = true;
-
- sdkMap.put(javaHome, new Boolean(found));
- return found;
- }
- }
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error checking for JDK", e);
- } finally {
- if (!launch.isTerminated()) {
- try {
- launch.terminate();
- } catch (Exception ex) {
- // ignore
- }
- }
- }
- }
-
- // log error that we were unable to check for the compiler
- TomcatPlugin.log(MessageFormat.format("Failed compiler check for {0}", new String[] { javaHome.getAbsolutePath() }));
- return false;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatRuntimeLocator.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatRuntimeLocator.java
deleted file mode 100644
index 9212c55..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatRuntimeLocator.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.jst.server.tomcat.core.internal;
-
-import java.io.File;
-import java.io.FileFilter;
-
-import org.eclipse.core.runtime.*;
-import org.eclipse.jdt.launching.JavaRuntime;
-
-import org.eclipse.wst.server.core.IRuntimeType;
-import org.eclipse.wst.server.core.IRuntimeWorkingCopy;
-import org.eclipse.wst.server.core.ServerCore;
-import org.eclipse.wst.server.core.model.RuntimeLocatorDelegate;
-/**
- *
- */
-public class TomcatRuntimeLocator extends RuntimeLocatorDelegate {
- protected static final String[] runtimeTypes = new String[] {
- "org.eclipse.jst.server.tomcat.runtime.32",
- "org.eclipse.jst.server.tomcat.runtime.40",
- "org.eclipse.jst.server.tomcat.runtime.41",
- "org.eclipse.jst.server.tomcat.runtime.50",
- "org.eclipse.jst.server.tomcat.runtime.55"};
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.server.core.model.IRuntimeFactoryDelegate#getKnownRuntimes()
- */
- public void searchForRuntimes(IPath path, IRuntimeSearchListener listener, IProgressMonitor monitor) {
- searchForRuntimes2(path, listener, monitor);
- }
-
- protected static void searchForRuntimes2(IPath path, IRuntimeSearchListener listener, IProgressMonitor monitor) {
- File[] files = null;
- if (path != null) {
- File f = path.toFile();
- if (f.exists())
- files = f.listFiles();
- else
- return;
- } else
- files = File.listRoots();
-
- if (files != null) {
- int size = files.length;
- int work = 100 / size;
- int workLeft = 100 - (work * size);
- for (int i = 0; i < size; i++) {
- if (monitor.isCanceled())
- return;
- if (files[i] != null && files[i].isDirectory())
- searchDir(listener, files[i], 4, monitor);
- monitor.worked(work);
- }
- monitor.worked(workLeft);
- } else
- monitor.worked(100);
- }
-
- protected static void searchDir(IRuntimeSearchListener listener, File dir, int depth, IProgressMonitor monitor) {
- if ("conf".equals(dir.getName())) {
- IRuntimeWorkingCopy runtime = getRuntimeFromDir(dir.getParentFile(), monitor);
- if (runtime != null) {
- listener.runtimeFound(runtime);
- return;
- }
- }
-
- if (depth == 0)
- return;
-
- File[] files = dir.listFiles(new FileFilter() {
- public boolean accept(File file) {
- return file.isDirectory();
- }
- });
- if (files != null) {
- int size = files.length;
- for (int i = 0; i < size; i++) {
- if (monitor.isCanceled())
- return;
- searchDir(listener, files[i], depth - 1, monitor);
- }
- }
- }
-
- protected static IRuntimeWorkingCopy getRuntimeFromDir(File dir, IProgressMonitor monitor) {
- for (int i = 0; i < runtimeTypes.length; i++) {
- try {
- IRuntimeType runtimeType = ServerCore.findRuntimeType(runtimeTypes[i]);
- IRuntimeWorkingCopy runtime = runtimeType.createRuntime(dir.getAbsolutePath(), monitor);
- runtime.setName(dir.getName());
- runtime.setLocation(new Path(dir.getAbsolutePath()));
- ITomcatRuntimeWorkingCopy wc = (ITomcatRuntimeWorkingCopy) runtime.getAdapter(ITomcatRuntimeWorkingCopy.class);
- wc.setVMInstall(JavaRuntime.getDefaultVMInstall());
- IStatus status = runtime.validate(monitor);
- if (status == null || status.getSeverity() != IStatus.ERROR)
- return runtime;
-
- Trace.trace(Trace.FINER, "False runtime found at " + dir.getAbsolutePath() + ": " + status.getMessage());
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not find runtime", e);
- }
- }
- return null;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatRuntimeTargetHandler.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatRuntimeTargetHandler.java
deleted file mode 100644
index 13e6c75..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatRuntimeTargetHandler.java
+++ /dev/null
@@ -1,86 +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.jst.server.tomcat.core.internal;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.launching.IVMInstall;
-import org.eclipse.jdt.launching.JavaRuntime;
-import org.eclipse.jst.server.core.ClasspathRuntimeTargetHandler;
-
-import org.eclipse.wst.server.core.IRuntime;
-/**
- *
- */
-public class TomcatRuntimeTargetHandler extends ClasspathRuntimeTargetHandler {
- public IClasspathEntry[] getDelegateClasspathEntries(IRuntime runtime, IProgressMonitor monitor) {
- ITomcatRuntime tomcatRuntime = (ITomcatRuntime) runtime.getAdapter(ITomcatRuntime.class);
- IVMInstall vmInstall = tomcatRuntime.getVMInstall();
- if (vmInstall != null) {
- String name = vmInstall.getName();
- return new IClasspathEntry[] { JavaCore.newContainerEntry(new Path(JavaRuntime.JRE_CONTAINER).append("org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType").append(name)) };
- }
- return null;
- }
-
- /**
- * Return a label for the classpath container.
- *
- * @return the classpath container label
- */
- public String getClasspathContainerLabel(IRuntime runtime, String id) {
- String id2 = runtime.getRuntimeType().getId();
- if (id2.indexOf("32") > 0)
- return TomcatPlugin.getResource("%target32runtime");
- else if (id2.indexOf("40") > 0)
- return TomcatPlugin.getResource("%target40runtime");
- else if (id2.indexOf("41") > 0)
- return TomcatPlugin.getResource("%target41runtime");
- else if (id2.indexOf("50") > 0)
- return TomcatPlugin.getResource("%target50runtime");
-
- return TomcatPlugin.getResource("%target55runtime");
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.server
- */
- public IClasspathEntry[] resolveClasspathContainer(IRuntime runtime, String id) {
- return resolveClasspathContainer(runtime);
- }
-
- /**
- * Resolve the classpath entries.
- */
- public IClasspathEntry[] resolveClasspathContainer(IRuntime runtime) {
- IPath installPath = runtime.getLocation();
-
- if (installPath == null)
- return new IClasspathEntry[0];
-
- List list = new ArrayList();
- if (runtime.getRuntimeType().getId().indexOf("32") > 0) {
- IPath path = installPath.append("lib");
- addLibraryEntries(list, path.toFile(), true);
- } else {
- IPath path = installPath.append("common");
- addLibraryEntries(list, path.append("lib").toFile(), true);
- addLibraryEntries(list, path.append("endorsed").toFile(), true);
- }
- return resolveList(list);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatServer.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatServer.java
deleted file mode 100644
index 7406471..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatServer.java
+++ /dev/null
@@ -1,370 +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.jst.server.tomcat.core.internal;
-
-import java.net.URL;
-import java.util.List;
-
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.runtime.*;
-import org.eclipse.jst.server.core.IWebModule;
-
-import org.eclipse.wst.server.core.*;
-import org.eclipse.wst.server.core.internal.ServerMonitorManager;
-import org.eclipse.wst.server.core.model.*;
-/**
- * Generic Tomcat server.
- */
-public class TomcatServer extends ServerDelegate implements ITomcatServer, ITomcatServerWorkingCopy {
- public static final String PROPERTY_SECURE = "secure";
- public static final String PROPERTY_DEBUG = "debug";
-
- protected transient TomcatConfiguration configuration;
-
- /**
- * TomcatServer.
- */
- public TomcatServer() {
- super();
- }
-
- public TomcatRuntime getTomcatRuntime() {
- if (getServer().getRuntime() == null)
- return null;
-
- return (TomcatRuntime) getServer().getRuntime().getAdapter(TomcatRuntime.class);
- }
-
- public ITomcatVersionHandler getTomcatVersionHandler() {
- if (getServer().getRuntime() == null)
- return null;
-
- return getTomcatRuntime().getVersionHandler();
- }
-
- public ITomcatConfiguration getServerConfiguration() throws CoreException {
- return getTomcatConfiguration();
- }
-
- public TomcatConfiguration getTomcatConfiguration() throws CoreException {
- if (configuration == null) {
- IFolder folder = getServer().getServerConfiguration();
- if (!folder.exists())
- throw new CoreException(new Status(IStatus.ERROR, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%errorNoConfiguration", folder.getFullPath().toOSString()), null));
-
- String id = getServer().getServerType().getId();
- if (id.indexOf("32") > 0)
- configuration = new Tomcat32Configuration(folder);
- else if (id.indexOf("40") > 0)
- configuration = new Tomcat40Configuration(folder);
- else if (id.indexOf("41") > 0)
- configuration = new Tomcat41Configuration(folder);
- else if (id.indexOf("50") > 0)
- configuration = new Tomcat50Configuration(folder);
- else if (id.indexOf("55") > 0)
- configuration = new Tomcat55Configuration(folder);
- try {
- configuration.load(folder, null);
- } catch (CoreException ce) {
- // ignore
- configuration = null;
- throw ce;
- }
- }
- return configuration;
- }
-
- public void importConfiguration(IRuntime runtime, IProgressMonitor monitor) {
- IPath path = runtime.getLocation().append("conf");
-
- String id = getServer().getServerType().getId();
- IFolder folder = getServer().getServerConfiguration();
- if (id.indexOf("32") > 0)
- configuration = new Tomcat32Configuration(folder);
- else if (id.indexOf("40") > 0)
- configuration = new Tomcat40Configuration(folder);
- else if (id.indexOf("41") > 0)
- configuration = new Tomcat41Configuration(folder);
- else if (id.indexOf("50") > 0)
- configuration = new Tomcat50Configuration(folder);
- else if (id.indexOf("55") > 0)
- configuration = new Tomcat55Configuration(folder);
- try {
- configuration.load(path, monitor);
- } catch (CoreException ce) {
- // ignore
- configuration = null;
- }
- }
-
- public void saveConfiguration(IProgressMonitor monitor) throws CoreException {
- TomcatConfiguration config = getTomcatConfiguration();
- if (config == null)
- throw new CoreException(new Status(IStatus.ERROR, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%errorCouldNotSaveConfiguration", "null"), null));
- config.save(getServer().getServerConfiguration(), monitor);
- }
-
- public void configurationChanged() {
- configuration = null;
- }
-
- /**
- * Return the root URL of this module.
- * @param module org.eclipse.wst.server.core.model.IModule
- * @return java.net.URL
- */
- public URL getModuleRootURL(IModule module) {
- try {
- if (module == null)
- return null;
-
- TomcatConfiguration config = getTomcatConfiguration();
- if (config == null)
- return null;
-
- String url = "http://localhost";
- int port = config.getMainPort().getPort();
- port = ServerMonitorManager.getInstance().getMonitoredPort(getServer(), port, "web");
- if (port != 80)
- url += ":" + port;
-
- url += config.getWebModuleURL(module);
-
- if (!url.endsWith("/"))
- url += "/";
-
- return new URL(url);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not get root URL", e);
- return null;
- }
- }
-
- /**
- * Returns true if the process is set to run in debug mode.
- * This feature only works with Tomcat v4.0.
- *
- * @return boolean
- */
- public boolean isDebug() {
- return getAttribute(PROPERTY_DEBUG, false);
- }
-
- /**
- * Returns true if this is a test (run code out of the workbench) server.
- *
- * @return boolean
- */
- public boolean isTestEnvironment() {
- return getAttribute(PROPERTY_TEST_ENVIRONMENT, false);
- }
-
- /**
- * Returns true if the process is set to run in secure mode.
- *
- * @return boolean
- */
- public boolean isSecure() {
- return getAttribute(PROPERTY_SECURE, false);
- }
-
- protected static String renderCommandLine(String[] commandLine, String separator) {
- if (commandLine == null || commandLine.length < 1)
- return "";
- StringBuffer buf= new StringBuffer(commandLine[0]);
- for (int i = 1; i < commandLine.length; i++) {
- buf.append(separator);
- buf.append(commandLine[i]);
- }
- return buf.toString();
- }
-
- /**
- * Return a string representation of this object.
- * @return java.lang.String
- */
- public String toString() {
- return "TomcatServer";
- }
-
- /*
- * Returns the child module(s) of this module.
- */
- public IModule[] getChildModules(IModule module) {
- return new IModule[0];
- }
-
- /*
- * Returns the root module(s) of this module.
- */
- public IModule[] getRootModules(IModule module) throws CoreException {
- if (module.getAdapter(IWebModule.class) != null) {
- IStatus status = canModifyModules(new IModule[] { module }, null);
- if (status == null || !status.isOK())
- throw new CoreException(status);
- return new IModule[] { module };
- }
- return null;
- }
-
- /**
- * Returns the project references for projects that are in
- * this configuration.
- *
- * @return java.lang.String[]
- */
- /*public IModule[] getModules() {
- List list = new ArrayList();
-
- ITomcatConfiguration config = getTomcatConfiguration();
- if (config != null) {
- List modules = config.getWebModules();
- int size = modules.size();
- for (int i = 0; i < size; i++) {
- WebModule module = (WebModule) modules.get(i);
-
- String memento = module.getMemento();
- if (memento != null) {
- IModule module2 = ServerUtil.getModule(memento);
- if (module2 != null)
- list.add(module2);
- }
- }
- }
-
- IModule[] s = new IModule[list.size()];
- list.toArray(s);
-
- return s;
- }*/
-
- public byte getModuleState(IModule module) {
- return IServer.STATE_STARTED;
- }
-
- /**
- * Returns true if the given project is supported by this
- * server, and false otherwise.
- *
- * @param add modules
- * @param remove modules
- * @return the status
- */
- public IStatus canModifyModules(IModule[] add, IModule[] remove) {
- if (add != null) {
- int size = add.length;
- for (int i = 0; i < size; i++) {
- IModule module = add[i];
- IWebModule webModule = (IWebModule) module.getAdapter(IWebModule.class);
- if (webModule == null)
- return new Status(IStatus.ERROR, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%errorWebModulesOnly"), null);
-
- IStatus status = getTomcatVersionHandler().canAddModule(webModule);
- if (status != null && !status.isOK())
- return status;
- }
- }
-
- return new Status(IStatus.OK, TomcatPlugin.PLUGIN_ID, 0, "%canModifyModules", null);
- }
-
- public IServerPort[] getServerPorts() {
- if (getServer().getServerConfiguration() == null)
- return new IServerPort[0];
-
- try {
- List list = getTomcatConfiguration().getServerPorts();
- IServerPort[] sp = new IServerPort[list.size()];
- list.toArray(sp);
- return sp;
- } catch (Exception e) {
- return new IServerPort[0];
- }
- }
-
- public void setDefaults() {
- setTestEnvironment(true);
- }
-
- /**
- * Sets this process to debug mode. This feature only works
- * with Tomcat v4.0.
- *
- * @param b boolean
- */
- public void setDebug(boolean b) {
- setAttribute(PROPERTY_DEBUG, b);
- }
-
- /**
- * Sets this process to secure mode.
- * @param b boolean
- */
- public void setSecure(boolean b) {
- setAttribute(PROPERTY_SECURE, b);
- }
-
- /**
- * Sets this server to test environment mode.
- *
- * @param b boolean
- */
- public void setTestEnvironment(boolean b) {
- setAttribute(PROPERTY_TEST_ENVIRONMENT, b);
- }
-
- /**
- * Add the given project to this configuration. The project
- * has already been verified using isSupportedProject() and
- * does not already exist in the configuration.
- *
- * @param add modules
- * @param remove modules
- * @param monitor a progress monitor
- */
- public void modifyModules(IModule[] add, IModule[] remove, IProgressMonitor monitor) throws CoreException {
- IStatus status = canModifyModules(add, remove);
- if (status == null || !status.isOK())
- throw new CoreException(status);
-
- TomcatConfiguration config = getTomcatConfiguration();
-
- if (add != null) {
- int size = add.length;
- for (int i = 0; i < size; i++) {
- IModule module3 = add[i];
- IWebModule module = (IWebModule) module3.getAdapter(IWebModule.class);
- String contextRoot = module.getContextRoot();
- if (contextRoot != null && !contextRoot.startsWith("/"))
- contextRoot = "/" + contextRoot;
- WebModule module2 = new WebModule(contextRoot,
- module.getLocation().toOSString(), module3.getId(), true);
- config.addWebModule(-1, module2);
- }
- }
-
- if (remove != null) {
- int size2 = remove.length;
- for (int j = 0; j < size2; j++) {
- IModule module3 = remove[j];
- String memento = module3.getId();
- List modules = getTomcatConfiguration().getWebModules();
- int size = modules.size();
- for (int i = 0; i < size; i++) {
- WebModule module = (WebModule) modules.get(i);
- if (memento.equals(module.getMemento()))
- config.removeWebModule(i);
- }
- }
- }
- config.save(config.getFolder(), monitor);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatServerBehaviour.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatServerBehaviour.java
deleted file mode 100644
index ed9a32e..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatServerBehaviour.java
+++ /dev/null
@@ -1,395 +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.jst.server.tomcat.core.internal;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Properties;
-
-import org.eclipse.core.runtime.*;
-import org.eclipse.debug.core.*;
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
-import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
-import org.eclipse.jdt.launching.IVMInstall;
-import org.eclipse.jdt.launching.JavaRuntime;
-import org.eclipse.jst.server.core.IWebModule;
-
-import org.eclipse.wst.server.core.*;
-import org.eclipse.wst.server.core.model.*;
-import org.eclipse.wst.server.core.util.PingThread;
-import org.eclipse.wst.server.core.util.SocketUtil;
-/**
- * Generic Tomcat server.
- */
-public class TomcatServerBehaviour extends ServerBehaviourDelegate implements ITomcatServerBehaviour {
- private static final String ATTR_STOP = "stop-server";
-
- // the thread used to ping the server to check for startup
- protected transient PingThread ping = null;
- protected transient IProcess process;
- protected transient IDebugEventSetListener processListener;
-
- /**
- * TomcatServer.
- */
- public TomcatServerBehaviour() {
- super();
- }
-
- public void initialize() {
- setModules(getServer().getModules());
- }
-
- public TomcatRuntime getTomcatRuntime() {
- if (getServer().getRuntime() == null)
- return null;
-
- return (TomcatRuntime) getServer().getRuntime().getAdapter(TomcatRuntime.class);
- }
-
- public ITomcatVersionHandler getTomcatVersionHandler() {
- if (getServer().getRuntime() == null)
- return null;
-
- return getTomcatRuntime().getVersionHandler();
- }
-
- public TomcatConfiguration getTomcatConfiguration() throws CoreException {
- return getTomcatServer().getTomcatConfiguration();
- }
-
- public TomcatServer getTomcatServer() {
- return (TomcatServer) getServer().getAdapter(TomcatServer.class);
- }
-
- /**
- * Return the runtime class name.
- *
- * @return the class name
- */
- public String getRuntimeClass() {
- return getTomcatVersionHandler().getRuntimeClass();
- }
-
- /**
- * Return the program's runtime arguments to start or stop.
- *
- * @param starting true if starting
- * @return an array of runtime program arguments
- */
- protected String[] getRuntimeProgramArguments(boolean starting) {
- IPath configPath = null;
- if (getTomcatServer().isTestEnvironment())
- configPath = getTempDirectory();
- return getTomcatVersionHandler().getRuntimeProgramArguments(configPath, getTomcatServer().isDebug(), starting);
- }
-
- /**
- * Return the runtime (VM) arguments.
- *
- * @return an array of runtime arguments
- */
- protected String[] getRuntimeVMArguments() {
- IPath installPath = getServer().getRuntime().getLocation();
- IPath configPath = null;
- if (getTomcatServer().isTestEnvironment())
- configPath = getTempDirectory();
- else
- configPath = installPath;
- return getTomcatVersionHandler().getRuntimeVMArguments(installPath, configPath, getTomcatServer().isSecure());
- }
-
- protected static String renderCommandLine(String[] commandLine, String separator) {
- if (commandLine == null || commandLine.length < 1)
- return "";
- StringBuffer buf= new StringBuffer(commandLine[0]);
- for (int i = 1; i < commandLine.length; i++) {
- buf.append(separator);
- buf.append(commandLine[i]);
- }
- return buf.toString();
- }
-
- public void setProcess(final IProcess newProcess) {
- if (process != null)
- return;
-
- process = newProcess;
- processListener = new IDebugEventSetListener() {
- public void handleDebugEvents(DebugEvent[] events) {
- if (events != null) {
- int size = events.length;
- for (int i = 0; i < size; i++) {
- if (process.equals(events[i].getSource()) && events[i].getKind() == DebugEvent.TERMINATE) {
- DebugPlugin.getDefault().removeDebugEventListener(this);
- stopImpl();
- }
- }
- }
- }
- };
- DebugPlugin.getDefault().addDebugEventListener(processListener);
- }
-
- protected void stopImpl() {
- if (ping != null) {
- ping.stopPinging();
- ping = null;
- }
- if (process != null) {
- process = null;
- DebugPlugin.getDefault().removeDebugEventListener(processListener);
- processListener = null;
- }
- setServerState(IServer.STATE_STOPPED);
- }
-
- public void publishServer(int kind, IProgressMonitor monitor) throws CoreException {
- IPath installDir = getServer().getRuntime().getLocation();
- IPath confDir = null;
- if (getTomcatServer().isTestEnvironment()) {
- confDir = getTempDirectory();
- File temp = confDir.append("conf").toFile();
- if (!temp.exists())
- temp.mkdirs();
- } else
- confDir = installDir;
-
- monitor = ProgressUtil.getMonitorFor(monitor);
- monitor.beginTask(TomcatPlugin.getResource("%publishServerTask"), 500);
-
- IStatus status = getTomcatConfiguration().cleanupServer(confDir, installDir, ProgressUtil.getSubMonitorFor(monitor, 100));
- if (status != null && !status.isOK())
- throw new CoreException(status);
-
- status = getTomcatConfiguration().backupAndPublish(confDir, !getTomcatServer().isTestEnvironment(), ProgressUtil.getSubMonitorFor(monitor, 400));
- if (status != null && !status.isOK())
- throw new CoreException(status);
-
- monitor.done();
-
- setServerPublishState(IServer.PUBLISH_STATE_NONE);
- setModules(getServer().getModules());
- }
-
- /*
- * Publishes the given module to the server.
- */
- public void publishModule(int kind, int deltaKind, IModule[] parents, IModule module, IProgressMonitor monitor) throws CoreException {
- if (getTomcatServer().isTestEnvironment())
- return;
-
- IPath path = getTempDirectory().append("publish.txt");
- Properties p = new Properties();
- try {
- p.load(new FileInputStream(path.toFile()));
- } catch (Exception e) {
- // ignore
- }
-
- if (deltaKind == IServer.REMOVED) {
- try {
- String publishPath = (String) p.get(module.getId());
- FileUtil.deleteDirectory(new File(publishPath), monitor);
- } catch (Exception e) {
- throw new CoreException(new Status(IStatus.WARNING, TomcatPlugin.PLUGIN_ID, 0, "Could not remove module", e));
- }
- } else {
- IWebModule webModule = (IWebModule) module.getAdapter(IWebModule.class);
- IPath from = webModule.getLocation();
- IPath to = getServer().getRuntime().getLocation().append("webapps").append(webModule.getContextRoot());
- FileUtil.smartCopyDirectory(from.toOSString(), to.toOSString(), monitor);
- p.put(module.getId(), to.toOSString());
- setModulePublishState(module, IServer.PUBLISH_STATE_NONE);
- }
-
- try {
- p.store(new FileOutputStream(path.toFile()), "Tomcat publish data");
- } catch (Exception e) {
- // ignore
- }
- }
-
- /**
- * Setup for starting the server.
- *
- * @param launch ILaunch
- * @param launchMode String
- * @param monitor IProgressMonitor
- */
- public void setupLaunch(ILaunch launch, String launchMode, IProgressMonitor monitor) throws CoreException {
- if ("true".equals(launch.getLaunchConfiguration().getAttribute(ATTR_STOP, "false")))
- return;
- IStatus status = getTomcatRuntime().validate();
- if (status != null && status.getSeverity() == IStatus.ERROR)
- throw new CoreException(status);
-
- //setRestartNeeded(false);
- TomcatConfiguration configuration = getTomcatConfiguration();
-
- // check that ports are free
- Iterator iterator = configuration.getServerPorts().iterator();
- List usedPorts = new ArrayList();
- while (iterator.hasNext()) {
- IServerPort sp = (IServerPort) iterator.next();
- if (sp.getPort() < 0)
- throw new CoreException(new Status(IStatus.ERROR, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%errorPortInvalid"), null));
- if (SocketUtil.isPortInUse(sp.getPort(), 5)) {
- usedPorts.add(sp);
- }
- }
- if (usedPorts.size() == 1) {
- IServerPort port = (IServerPort) usedPorts.get(0);
- throw new CoreException(new Status(IStatus.ERROR, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%errorPortInUse", new String[] {port.getPort() + "", getServer().getName()}), null));
- } else if (usedPorts.size() > 1) {
- String portStr = "";
- iterator = usedPorts.iterator();
- boolean first = true;
- while (iterator.hasNext()) {
- if (!first)
- portStr += ", ";
- first = false;
- IServerPort sp = (IServerPort) iterator.next();
- portStr += "" + sp.getPort();
- }
- throw new CoreException(new Status(IStatus.ERROR, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%errorPortsInUse", new String[] {portStr, getServer().getName()}), null));
- }
-
- setServerState(IServer.STATE_STARTING);
- setMode(launchMode);
-
- // ping server to check for startup
- try {
- String url = "http://localhost";
- int port = configuration.getMainPort().getPort();
- if (port != 80)
- url += ":" + port;
- ping = new PingThread(getServer(), this, url, 50);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Can't ping for Tomcat startup.");
- }
- }
-
- /**
- * Cleanly shuts down and terminates the server.
- */
- public void stop(boolean force) {
- if (force) {
- terminate();
- return;
- }
- int state = getServer().getServerState();
- if (state == IServer.STATE_STOPPED)
- return;
- else if (state == IServer.STATE_STARTING || state == IServer.STATE_STOPPING) {
- terminate();
- return;
- }
-
- try {
- Trace.trace(Trace.FINER, "Stopping Tomcat");
- if (state != IServer.STATE_STOPPED)
- setServerState(IServer.STATE_STOPPING);
-
- ILaunchConfiguration launchConfig = getServer().getLaunchConfiguration(true, null);
- ILaunchConfigurationWorkingCopy wc = launchConfig.getWorkingCopy();
-
- String args = renderCommandLine(getRuntimeProgramArguments(false), " ");
- wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, args);
- wc.setAttribute(ATTR_STOP, "true");
- wc.launch(ILaunchManager.RUN_MODE, new NullProgressMonitor());
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error stopping Tomcat", e);
- }
- }
-
- /**
- * Terminates the server.
- */
- protected void terminate() {
- if (getServer().getServerState() == IServer.STATE_STOPPED)
- return;
-
- try {
- setServerState(IServer.STATE_STOPPING);
- Trace.trace(Trace.FINER, "Killing the Tomcat process");
- if (process != null && !process.isTerminated()) {
- process.terminate();
- stopImpl();
- }
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error killing the process", e);
- }
- }
-
- /**
- * Return a string representation of this object.
- * @return java.lang.String
- */
- public String toString() {
- return "TomcatServer";
- }
-
- public void setupLaunchConfiguration(ILaunchConfigurationWorkingCopy workingCopy, IProgressMonitor monitor) throws CoreException {
- String existingProgArgs = workingCopy.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, (String)null);
- String progArgs = renderCommandLine(getRuntimeProgramArguments(true), " ");
- if (existingProgArgs == null || existingProgArgs.indexOf(progArgs) < 0)
- workingCopy.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, progArgs);
-
- String existingVMArgs = workingCopy.getAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, (String)null);
- String vmArgs = renderCommandLine(getRuntimeVMArguments(), " ");
- if (existingVMArgs == null || existingVMArgs.indexOf(vmArgs) < 0)
- workingCopy.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, vmArgs);
-
- ITomcatRuntime runtime = getTomcatRuntime();
- IVMInstall vmInstall = runtime.getVMInstall();
- if (vmInstall != null) {
- workingCopy.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_INSTALL_TYPE, vmInstall.getVMInstallType().getId());
- workingCopy.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_INSTALL_NAME, vmInstall.getName());
- }
-
- // add tools.jar to the path
- List cp = runtime.getRuntimeClasspath();
- if (vmInstall != null) {
- try {
- cp.add(JavaRuntime.newRuntimeContainerClasspathEntry(new Path(JavaRuntime.JRE_CONTAINER).append("org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType").append(vmInstall.getName()), IRuntimeClasspathEntry.BOOTSTRAP_CLASSES));
- } catch (Exception e) {
- // ignore
- }
-
- IPath jrePath = new Path(vmInstall.getInstallLocation().getAbsolutePath());
- if (jrePath != null) {
- IPath toolsPath = jrePath.append("lib").append("tools.jar");
- if (toolsPath.toFile().exists()) {
- cp.add(JavaRuntime.newArchiveRuntimeClasspathEntry(toolsPath));
- }
- }
- }
-
- Iterator cpi = cp.iterator();
- List list = new ArrayList();
- while (cpi.hasNext()) {
- IRuntimeClasspathEntry entry = (IRuntimeClasspathEntry) cpi.next();
- try {
- list.add(entry.getMemento());
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not resolve classpath entry: " + entry, e);
- }
- }
- workingCopy.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, list);
- workingCopy.setAttribute(IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH, false);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatServerLocator.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatServerLocator.java
deleted file mode 100644
index 8017d2d..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatServerLocator.java
+++ /dev/null
@@ -1,37 +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.jst.server.tomcat.core.internal;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-
-import org.eclipse.wst.server.core.*;
-import org.eclipse.wst.server.core.model.ServerLocatorDelegate;
-/**
- *
- */
-public class TomcatServerLocator extends ServerLocatorDelegate {
- public void searchForServers(String host, final IServerSearchListener listener, final IProgressMonitor monitor) {
- TomcatRuntimeLocator.IRuntimeSearchListener listener2 = new TomcatRuntimeLocator.IRuntimeSearchListener() {
- public void runtimeFound(IRuntimeWorkingCopy runtime) {
- String runtimeTypeId = runtime.getRuntimeType().getId();
- String serverTypeId = runtimeTypeId.substring(0, runtimeTypeId.length() - 8);
- IServerType serverType = ServerCore.findServerType(serverTypeId);
- try {
- IServerWorkingCopy server = serverType.createServer(serverTypeId, null, runtime, monitor);
- listener.serverFound(server);
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Could not create Tomcat server", e);
- }
- }
- };
- TomcatRuntimeLocator.searchForRuntimes2(null, listener2, monitor);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatServerUtil.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatServerUtil.java
deleted file mode 100644
index 4f720e8..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatServerUtil.java
+++ /dev/null
@@ -1,86 +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.jst.server.tomcat.core.internal;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.JavaCore;
-/**
- * Helper class to load and save Tomcat server and identify configurations.
- */
-public class TomcatServerUtil {
- /**
- * TomcatServerSerializer constructor comment.
- */
- protected TomcatServerUtil() {
- super();
- }
-
- /**
- * Returns the kind of a <code>PackageFragmentRoot</code> from its <code>String</code> form.
- */
- protected static int getClasspathKindFromString(String kindStr) {
- //if (kindStr.equalsIgnoreCase("prj"))
- // return IClasspathEntry.CPE_PROJECT;
- if (kindStr.equalsIgnoreCase("var"))
- return IClasspathEntry.CPE_VARIABLE;
- //if (kindStr.equalsIgnoreCase("src"))
- // return IClasspathEntry.CPE_SOURCE;
- if (kindStr.equalsIgnoreCase("lib"))
- return IClasspathEntry.CPE_LIBRARY;
- return -1;
- }
-
- /**
- * Returns a <code>String</code> for the kind of a class path entry.
- */
- protected static String getClasspathKindToString(int kind) {
- switch (kind) {
- //case IClasspathEntry.CPE_PROJECT :
- // return "prj";
- //case IClasspathEntry.CPE_SOURCE :
- // return "src";
- case IClasspathEntry.CPE_LIBRARY :
- return "lib";
- case IClasspathEntry.CPE_VARIABLE :
- return "var";
- default :
- return "unknown";
- }
- }
-
- /**
- * Create's a classpath entry of the specified kind.
- *
- * Returns null if unable to create a valid entry.
- */
- protected static IClasspathEntry createClasspathEntry(IPath path, int kind, IPath sourceAttachmentPath, IPath sourceAttachmentRootPath) {
- switch (kind) {
- /*case IClasspathEntry.CPE_PROJECT:
- if (!path.isAbsolute())
- return null;
- else
- return JavaCore.newProjectEntry(path);*/
-
- case IClasspathEntry.CPE_LIBRARY:
- if (!path.isAbsolute())
- return null;
-
- return JavaCore.newLibraryEntry(path, sourceAttachmentPath, sourceAttachmentRootPath);
-
- case IClasspathEntry.CPE_VARIABLE:
- return JavaCore.newVariableEntry(path, sourceAttachmentPath, sourceAttachmentRootPath);
-
- default:
- return null;
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatSourcePathComputerDelegate.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatSourcePathComputerDelegate.java
deleted file mode 100644
index f4bbe83..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatSourcePathComputerDelegate.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2004, 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.jst.server.tomcat.core.internal;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.sourcelookup.ISourceContainer;
-import org.eclipse.debug.core.sourcelookup.ISourcePathComputerDelegate;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
-import org.eclipse.jdt.launching.JavaRuntime;
-import org.eclipse.wst.server.core.*;
-/**
- *
- */
-public class TomcatSourcePathComputerDelegate implements ISourcePathComputerDelegate {
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.sourcelookup.ISourcePathComputerDelegate#computeSourceContainers(org.eclipse.debug.core.ILaunchConfiguration, org.eclipse.core.runtime.IProgressMonitor)
- */
- public ISourceContainer[] computeSourceContainers(ILaunchConfiguration configuration, IProgressMonitor monitor) throws CoreException {
- IRuntimeClasspathEntry[] entries = JavaRuntime.computeUnresolvedSourceLookupPath(configuration);
-
- String serverId = configuration.getAttribute(IServerAttributes.ATTR_SERVER_ID, (String) null);
-
- IServer server = null;
- if (serverId != null)
- server = ServerCore.findServer(serverId);
- if (server != null) {
- List list = new ArrayList();
- List pathList = new ArrayList();
- IModule[] modules = server.getModules();
- for (int i = 0; i < modules.length; i++) {
- IProject project = modules[i].getProject();
- if (project != null) {
- try {
- if (project.hasNature(JavaCore.NATURE_ID)) {
- IJavaProject javaProject = (IJavaProject) project.getNature(JavaCore.NATURE_ID);
- list.add(javaProject);
- }
- } catch (Exception e) {
- // ignore
- }
-
- IPath path = server.getRuntime().getLocation().append("work").append("Catalina").append("localhost").append(modules[i].getName());
- pathList.add(path);
- }
- }
- int size = list.size();
- IJavaProject[] projects = new IJavaProject[size];
- list.toArray(projects);
-
- int size2 = entries.length;
- int size3 = pathList.size();
- IRuntimeClasspathEntry[] entries2 = new IRuntimeClasspathEntry[size + size2 + size3];
- System.arraycopy(entries, 0, entries2, 0, size2);
-
- for (int i = 0; i < size; i++) {
- entries2[size2 + i] = JavaRuntime.newProjectRuntimeClasspathEntry(projects[i]);
- }
-
- for (int i = 0; i < size3; i++) {
- entries2[size + size2 + i] = JavaRuntime.newArchiveRuntimeClasspathEntry((IPath) pathList.get(i));
- }
-
- entries = entries2;
- }
-
- IRuntimeClasspathEntry[] resolved = JavaRuntime.resolveSourceLookupPath(entries, configuration);
- return JavaSourceLookupUtil.translate(resolved, true);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Trace.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Trace.java
deleted file mode 100644
index f4b97fe..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Trace.java
+++ /dev/null
@@ -1,52 +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.jst.server.tomcat.core.internal;
-/**
- * Helper class to route trace output.
- */
-public class Trace {
- public static byte CONFIG = 0;
- public static byte WARNING = 1;
- public static byte SEVERE = 2;
- public static byte FINEST = 3;
- public static byte FINER = 4;
-
- /**
- * Trace constructor comment.
- */
- private Trace() {
- super();
- }
-
- /**
- * Trace the given text.
- *
- * @param s java.lang.String
- */
- public static void trace(byte level, String s) {
- Trace.trace(level, s, null);
- }
-
- /**
- * Trace the given message and exception.
- *
- * @param s java.lang.String
- * @param t java.lang.Throwable
- */
- public static void trace(byte level, String s, Throwable t) {
- if (!TomcatPlugin.getInstance().isDebugging())
- return;
-
- System.out.println(TomcatPlugin.PLUGIN_ID + " " + s);
- if (t != null)
- t.printStackTrace();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/WebAppDocument.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/WebAppDocument.java
deleted file mode 100644
index 81a14cf..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/WebAppDocument.java
+++ /dev/null
@@ -1,160 +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.jst.server.tomcat.core.internal;
-
-import java.io.ByteArrayInputStream;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jst.server.tomcat.core.internal.xml.XMLUtil;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.InputSource;
-/**
- * Helper class to access a web.xml file.
- */
-public class WebAppDocument {
- protected boolean isWebAppDirty;
- protected Document webAppDocument;
-
- /**
- * Loads a web.xml from the given URL.
- *
- * @param path a path
- */
- public WebAppDocument(IPath path) throws Exception {
- webAppDocument = XMLUtil.getDocumentBuilder().parse(new InputSource(new FileInputStream(path.toFile())));
- }
-
- /**
- * Loads a web.xml from the given resource.
- *
- * @param file a file
- */
- public WebAppDocument(IFile file) throws Exception {
- webAppDocument = XMLUtil.getDocumentBuilder().parse(new InputSource(file.getContents()));
- }
-
- /**
- * Adds a MimeMapping.
- *
- * @param index int
- * @param map org.eclipse.jst.server.tomcat.IMimeMapping
- */
- public void addMimeMapping(int index, IMimeMapping map) {
- Trace.trace(Trace.FINER, "Adding mime mapping " + index + " " + map.getMimeType() + " " + map.getExtension());
- Element element = webAppDocument.getDocumentElement();
- Element mapping = XMLUtil.createChildElement(webAppDocument, element, index, "mime-mapping");
- XMLUtil.insertText(webAppDocument, mapping, "\n\t");
- XMLUtil.createTextChildElement(webAppDocument, mapping, "extension", map.getExtension());
- XMLUtil.insertText(webAppDocument, mapping, "\n\t");
- XMLUtil.createTextChildElement(webAppDocument, mapping, "mime-type", map.getMimeType());
- XMLUtil.insertText(webAppDocument, mapping, "\n");
-
- isWebAppDirty = true;
- }
-
- /**
- * Returns a list of MimeMappings.
- *
- * @return java.util.List
- */
- public List getMimeMappings() {
- List map = new ArrayList();
-
- Element root = webAppDocument.getDocumentElement();
- Iterator iterator = XMLUtil.getNodeIterator(root, "mime-mapping");
- while (iterator.hasNext()) {
- Element element = (Element) iterator.next();
- String mimeType = XMLUtil.getSubNodeValue(element, "mime-type");
- String extension = XMLUtil.getSubNodeValue(element, "extension");
- MimeMapping mm = new MimeMapping(extension, mimeType);
- map.add(mm);
- }
-
- return map;
- }
-
- /**
- * Modifies a mime mapping.
- *
- * @param index
- * @param map
- */
- public void modifyMimeMapping(int index, IMimeMapping map) {
- Element element = webAppDocument.getDocumentElement();
- NodeList list = element.getElementsByTagName("mime-mapping");
- Element element2 = (Element) list.item(index);
- XMLUtil.setNodeValue(element2.getElementsByTagName("extension").item(0), "extension", map.getExtension());
- XMLUtil.setNodeValue(element2.getElementsByTagName("mime-type").item(0), "mime-type", map.getMimeType());
-
- isWebAppDirty = true;
- }
-
- /**
- * Removes the mime mapping at the specified index.
- *
- * @param index int
- */
- public void removeMimeMapping(int index) {
- Element element = webAppDocument.getDocumentElement();
- NodeList list = element.getElementsByTagName("mime-mapping");
- Node node = list.item(index);
- element.removeChild(node);
- isWebAppDirty = true;
- }
-
- /**
- * Saves the Web app document.
- *
- * @param path a path
- * @param forceDirty true to force a save
- */
- public void save(String path, boolean forceDirty) throws IOException {
- if (forceDirty || isWebAppDirty)
- XMLUtil.save(path, webAppDocument);
- }
-
- /**
- * Saves the Web app document.
- *
- * @param file a file
- * @param monitor a progress monitor
- */
- public void save(IFile file, IProgressMonitor monitor) throws Exception {
- byte[] data = XMLUtil.getContents(webAppDocument);
- InputStream in = null;
- try {
- in = new ByteArrayInputStream(data);
- if (file.exists())
- file.setContents(in, true, true, ProgressUtil.getSubMonitorFor(monitor, 200));
- else
- file.create(in, true, ProgressUtil.getSubMonitorFor(monitor, 200));
- } catch (Exception e) {
- // ignore
- } finally {
- try {
- in.close();
- } catch (Exception e) {
- // ignore
- }
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/WebModule.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/WebModule.java
deleted file mode 100644
index e8f9b4c..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/WebModule.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.jst.server.tomcat.core.internal;
-/**
- * A Web module.
- */
-public class WebModule implements ITomcatWebModule {
- private String docBase;
- private String path;
- private String memento;
- private boolean reloadable;
-
- /**
- * WebModule constructor comment.
- */
- public WebModule(String path, String docBase, String memento, boolean reloadable) {
- super();
- this.path = path;
- this.docBase = docBase;
- this.memento = memento;
- this.reloadable = reloadable;
- }
-
- /**
- * Get the document base.
- *
- * @return java.lang.String
- */
- public String getDocumentBase() {
- return docBase;
- }
-
- /**
- * Return the path. (context root)
- *
- * @return java.lang.String
- */
- public String getPath() {
- return path;
- }
-
- /**
- * Return the memento.
- *
- * @return java.lang.String
- */
- public String getMemento() {
- return memento;
- }
-
- /**
- * Return true if the web module is auto-reloadable.
- *
- * @return java.lang.String
- */
- public boolean isReloadable() {
- return reloadable;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/command/AddMimeMappingCommand.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/command/AddMimeMappingCommand.java
deleted file mode 100644
index 5a6623a..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/command/AddMimeMappingCommand.java
+++ /dev/null
@@ -1,59 +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.jst.server.tomcat.core.internal.command;
-
-import org.eclipse.jst.server.tomcat.core.internal.*;
-/**
- * Command to add a mime mapping.
- */
-public class AddMimeMappingCommand extends ConfigurationCommand {
- protected MimeMapping map;
-
- /**
- * ModifyMimeTypeExtensionCommand constructor comment.
- */
- public AddMimeMappingCommand(ITomcatConfigurationWorkingCopy configuration, MimeMapping map) {
- super(configuration);
- this.map = map;
- }
-
- /**
- * Execute the command.
- * @return boolean
- */
- public boolean execute() {
- configuration.addMimeMapping(0, map);
- return true;
- }
-
- /**
- * Returns this command's description.
- * @return java.lang.String
- */
- public String getDescription() {
- return TomcatPlugin.getResource("%configurationEditorActionAddMimeMappingDescription");
- }
-
- /**
- * Returns this command's label.
- * @return java.lang.String
- */
- public String getName() {
- return TomcatPlugin.getResource("%configurationEditorActionAddMimeMapping");
- }
-
- /**
- * Undo the command.
- */
- public void undo() {
- configuration.removeMimeMapping(0);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/command/AddWebModuleCommand.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/command/AddWebModuleCommand.java
deleted file mode 100644
index e49623c..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/command/AddWebModuleCommand.java
+++ /dev/null
@@ -1,63 +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.jst.server.tomcat.core.internal.command;
-
-import org.eclipse.jst.server.tomcat.core.internal.ITomcatConfigurationWorkingCopy;
-import org.eclipse.jst.server.tomcat.core.internal.TomcatPlugin;
-import org.eclipse.jst.server.tomcat.core.internal.WebModule;
-/**
- * Command to add a web module.
- */
-public class AddWebModuleCommand extends ConfigurationCommand {
- protected WebModule module;
- protected int modules = -1;
-
- /**
- * AddWebModuleCommand constructor comment.
- */
- public AddWebModuleCommand(ITomcatConfigurationWorkingCopy configuration, WebModule module) {
- super(configuration);
- this.module = module;
- }
-
- /**
- * Execute the command.
- * @return boolean
- */
- public boolean execute() {
- modules = configuration.getWebModules().size();
- configuration.addWebModule(-1, module);
- return true;
- }
-
- /**
- * Returns this command's description.
- * @return java.lang.String
- */
- public String getDescription() {
- return TomcatPlugin.getResource("%configurationEditorActionAddWebModuleDescription");
- }
-
- /**
- * Returns this command's label.
- * @return java.lang.String
- */
- public String getName() {
- return TomcatPlugin.getResource("%configurationEditorActionAddWebModule");
- }
-
- /**
- * Undo the command.
- */
- public void undo() {
- configuration.removeWebModule(modules);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/command/ConfigurationCommand.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/command/ConfigurationCommand.java
deleted file mode 100644
index 104e9ec..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/command/ConfigurationCommand.java
+++ /dev/null
@@ -1,43 +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.jst.server.tomcat.core.internal.command;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jst.server.tomcat.core.internal.ITomcatConfigurationWorkingCopy;
-import org.eclipse.wst.server.core.util.Task;
-/**
- * Configuration command.
- */
-public abstract class ConfigurationCommand extends Task {
- protected ITomcatConfigurationWorkingCopy configuration;
-
- /**
- * ConfigurationCommand constructor comment.
- */
- public ConfigurationCommand(ITomcatConfigurationWorkingCopy configuration) {
- super();
- this.configuration = configuration;
- }
-
- /**
- * Returns true if this command can be undone.
- * @return boolean
- */
- public boolean canUndo() {
- return true;
- }
-
- public abstract boolean execute();
-
- public void execute(IProgressMonitor monitor) {
- execute();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/command/ModifyMimeMappingCommand.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/command/ModifyMimeMappingCommand.java
deleted file mode 100644
index 6f6bd8b..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/command/ModifyMimeMappingCommand.java
+++ /dev/null
@@ -1,62 +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.jst.server.tomcat.core.internal.command;
-
-import org.eclipse.jst.server.tomcat.core.internal.ITomcatConfigurationWorkingCopy;
-import org.eclipse.jst.server.tomcat.core.internal.MimeMapping;
-import org.eclipse.jst.server.tomcat.core.internal.TomcatPlugin;
-/**
- * Command to change a mime type extension.
- */
-public class ModifyMimeMappingCommand extends ConfigurationCommand {
- protected int index;
- protected MimeMapping oldMap;
- protected MimeMapping newMap;
-
- public ModifyMimeMappingCommand(ITomcatConfigurationWorkingCopy configuration, int index, MimeMapping map) {
- super(configuration);
- this.index = index;
- newMap = map;
- }
-
- /**
- * Execute the command.
- * @return boolean
- */
- public boolean execute() {
- oldMap = (MimeMapping) configuration.getMimeMappings().get(index);
- configuration.modifyMimeMapping(index, newMap);
- return true;
- }
-
- /**
- * Returns this command's description.
- * @return java.lang.String
- */
- public String getDescription() {
- return TomcatPlugin.getResource("%configurationEditorActionModifyMimeMappingDescription");
- }
-
- /**
- * Returns this command's label.
- * @return java.lang.String
- */
- public String getName() {
- return TomcatPlugin.getResource("%configurationEditorActionModifyMimeMapping");
- }
-
- /**
- * Undo the command.
- */
- public void undo() {
- configuration.modifyMimeMapping(index, oldMap);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/command/ModifyPortCommand.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/command/ModifyPortCommand.java
deleted file mode 100644
index af0fb7a..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/command/ModifyPortCommand.java
+++ /dev/null
@@ -1,75 +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.jst.server.tomcat.core.internal.command;
-
-import java.util.Iterator;
-
-import org.eclipse.jst.server.tomcat.core.internal.ITomcatConfigurationWorkingCopy;
-import org.eclipse.jst.server.tomcat.core.internal.TomcatPlugin;
-import org.eclipse.wst.server.core.IServerPort;
-/**
- * Command to change the configuration port.
- */
-public class ModifyPortCommand extends ConfigurationCommand {
- protected String id;
- protected int port;
- protected int oldPort;
-
- /**
- * ChangePortCommand constructor comment.
- */
- public ModifyPortCommand(ITomcatConfigurationWorkingCopy configuration, String id, int port) {
- super(configuration);
- this.id = id;
- this.port = port;
- }
-
- /**
- * Execute the command.
- * @return boolean
- */
- public boolean execute() {
- // find old port number
- Iterator iterator = configuration.getServerPorts().iterator();
- while (iterator.hasNext()) {
- IServerPort temp = (IServerPort) iterator.next();
- if (id.equals(temp.getId()))
- oldPort = temp.getPort();
- }
-
- // make the change
- configuration.modifyServerPort(id, port);
- return true;
- }
-
- /**
- * Returns this command's description.
- * @return java.lang.String
- */
- public String getDescription() {
- return TomcatPlugin.getResource("%configurationEditorActionModifyPortDescription");
- }
-
- /**
- * Returns this command's label.
- * @return java.lang.String
- */
- public String getName() {
- return TomcatPlugin.getResource("%configurationEditorActionModifyPort");
- }
-
- /**
- * Undo the command.
- */
- public void undo() {
- configuration.modifyServerPort(id, oldPort);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/command/ModifyWebModuleCommand.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/command/ModifyWebModuleCommand.java
deleted file mode 100644
index 1dce689..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/command/ModifyWebModuleCommand.java
+++ /dev/null
@@ -1,62 +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.jst.server.tomcat.core.internal.command;
-
-import org.eclipse.jst.server.tomcat.core.internal.ITomcatConfigurationWorkingCopy;
-import org.eclipse.jst.server.tomcat.core.internal.TomcatPlugin;
-import org.eclipse.jst.server.tomcat.core.internal.WebModule;
-/**
- * Command to change a web module.
- */
-public class ModifyWebModuleCommand extends ConfigurationCommand {
- protected int index;
- protected WebModule oldModule;
- protected WebModule newModule;
-
- public ModifyWebModuleCommand(ITomcatConfigurationWorkingCopy configuration, int index, WebModule module) {
- super(configuration);
- this.index = index;
- newModule = module;
- }
-
- /**
- * Execute the command.
- * @return boolean
- */
- public boolean execute() {
- oldModule = (WebModule) configuration.getWebModules().get(index);
- configuration.modifyWebModule(index, newModule.getDocumentBase(), newModule.getPath(), newModule.isReloadable());
- return true;
- }
-
- /**
- * Returns this command's description.
- * @return java.lang.String
- */
- public String getDescription() {
- return TomcatPlugin.getResource("%configurationEditorActionModifyWebModuleDescription");
- }
-
- /**
- * Returns this command's label.
- * @return java.lang.String
- */
- public String getName() {
- return TomcatPlugin.getResource("%configurationEditorActionModifyWebModule");
- }
-
- /**
- * Undo the command.
- */
- public void undo() {
- configuration.modifyWebModule(index, oldModule.getDocumentBase(), oldModule.getPath(), oldModule.isReloadable());
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/command/RemoveMimeMappingCommand.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/command/RemoveMimeMappingCommand.java
deleted file mode 100644
index b475773..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/command/RemoveMimeMappingCommand.java
+++ /dev/null
@@ -1,63 +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.jst.server.tomcat.core.internal.command;
-
-import org.eclipse.jst.server.tomcat.core.internal.ITomcatConfigurationWorkingCopy;
-import org.eclipse.jst.server.tomcat.core.internal.MimeMapping;
-import org.eclipse.jst.server.tomcat.core.internal.TomcatPlugin;
-/**
- * Command to remove a mime mapping.
- */
-public class RemoveMimeMappingCommand extends ConfigurationCommand {
- protected int index;
- protected MimeMapping mapping;
-
- /**
- * ModifyMimeTypeExtensionCommand constructor comment.
- */
- public RemoveMimeMappingCommand(ITomcatConfigurationWorkingCopy configuration, int index) {
- super(configuration);
- this.index = index;
- }
-
- /**
- * Execute the command.
- * @return boolean
- */
- public boolean execute() {
- mapping = (MimeMapping) configuration.getMimeMappings().get(index);
- configuration.removeMimeMapping(index);
- return true;
- }
-
- /**
- * Returns this command's description.
- * @return java.lang.String
- */
- public String getDescription() {
- return TomcatPlugin.getResource("%configurationEditorActionRemoveMimeMappingDescription");
- }
-
- /**
- * Returns this command's label.
- * @return java.lang.String
- */
- public String getName() {
- return TomcatPlugin.getResource("%configurationEditorActionRemoveMimeMapping");
- }
-
- /**
- * Undo the command.
- */
- public void undo() {
- configuration.addMimeMapping(index, mapping);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/command/RemoveWebModuleCommand.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/command/RemoveWebModuleCommand.java
deleted file mode 100644
index de866ba..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/command/RemoveWebModuleCommand.java
+++ /dev/null
@@ -1,65 +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.jst.server.tomcat.core.internal.command;
-
-import org.eclipse.jst.server.tomcat.core.internal.ITomcatConfigurationWorkingCopy;
-import org.eclipse.jst.server.tomcat.core.internal.TomcatPlugin;
-import org.eclipse.jst.server.tomcat.core.internal.WebModule;
-/**
- * Command to remove a web module.
- */
-public class RemoveWebModuleCommand extends ConfigurationCommand {
- protected int index;
- protected WebModule module;
-
- /**
- * RemoveWebModuleCommand constructor comment.
- */
- public RemoveWebModuleCommand(ITomcatConfigurationWorkingCopy configuration, int index) {
- super(configuration);
- this.index = index;
- }
-
- /**
- * Execute the command.
- * @return boolean
- */
- public boolean execute() {
- module = (WebModule) configuration.getWebModules().get(index);
- configuration.removeWebModule(index);
- return true;
- }
-
- /**
- * Returns this command's description.
- * @return java.lang.String
- */
- public String getDescription() {
- if (module == null)
- module = (WebModule) configuration.getWebModules().get(index);
- return TomcatPlugin.getResource("%configurationEditorActionRemoveWebModuleDescription", module.getPath());
- }
-
- /**
- * Returns this command's label.
- * @return java.lang.String
- */
- public String getName() {
- return TomcatPlugin.getResource("%configurationEditorActionRemoveWebModule");
- }
-
- /**
- * Undo the command.
- */
- public void undo() {
- configuration.addWebModule(index, module);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/command/RemoveWebModuleTask.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/command/RemoveWebModuleTask.java
deleted file mode 100644
index ecea508..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/command/RemoveWebModuleTask.java
+++ /dev/null
@@ -1,94 +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.jst.server.tomcat.core.internal.command;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jst.server.tomcat.core.internal.TomcatConfiguration;
-import org.eclipse.jst.server.tomcat.core.internal.TomcatPlugin;
-import org.eclipse.jst.server.tomcat.core.internal.TomcatServer;
-import org.eclipse.jst.server.tomcat.core.internal.WebModule;
-
-import org.eclipse.wst.server.core.IServerWorkingCopy;
-import org.eclipse.wst.server.core.TaskModel;
-import org.eclipse.wst.server.core.util.Task;
-/**
- * Task to remove a web module.
- */
-public class RemoveWebModuleTask extends Task {
- protected int index;
- protected WebModule module;
-
- /**
- * RemoveWebModuleTask constructor comment.
- */
- public RemoveWebModuleTask(int index) {
- super();
- this.index = index;
- }
-
- /**
- * Execute the command.
- * @return boolean
- */
- public void execute(IProgressMonitor monitor) throws CoreException {
- IServerWorkingCopy wc = (IServerWorkingCopy) getTaskModel().getObject(TaskModel.TASK_SERVER);
- TomcatServer server = (TomcatServer) wc.getAdapter(TomcatServer.class);
- TomcatConfiguration configuration = server.getTomcatConfiguration();
- if (configuration.getWebModules().size() <= index)
- return;
- module = (WebModule) configuration.getWebModules().get(index);
- configuration.removeWebModule(index);
- }
-
- /**
- * Returns this command's description.
- * @return java.lang.String
- */
- public String getDescription() {
- if (module == null) {
- try {
- IServerWorkingCopy wc = (IServerWorkingCopy) getTaskModel().getObject(TaskModel.TASK_SERVER);
- TomcatServer server = (TomcatServer) wc.getAdapter(TomcatServer.class);
- TomcatConfiguration configuration = server.getTomcatConfiguration();
- module = (WebModule) configuration.getWebModules().get(index);
- } catch (Exception e) {
- // ignore
- }
- }
- if (module == null)
- return TomcatPlugin.getResource("%configurationEditorActionRemoveWebModuleDescription", "<>");
-
- return TomcatPlugin.getResource("%configurationEditorActionRemoveWebModuleDescription", module.getPath());
- }
-
- /**
- * Returns this command's label.
- * @return java.lang.String
- */
- public String getName() {
- return TomcatPlugin.getResource("%configurationEditorActionRemoveWebModule");
- }
-
- /**
- * Undo the command.
- */
- public void undo() {
- try {
- IServerWorkingCopy wc = (IServerWorkingCopy) getTaskModel().getObject(TaskModel.TASK_SERVER);
- TomcatServer server = (TomcatServer) wc.getAdapter(TomcatServer.class);
- TomcatConfiguration configuration = server.getTomcatConfiguration();
- configuration.addWebModule(index, module);
- } catch (Exception e) {
- // ignore
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/command/ServerCommand.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/command/ServerCommand.java
deleted file mode 100644
index f0de5de..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/command/ServerCommand.java
+++ /dev/null
@@ -1,44 +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.jst.server.tomcat.core.internal.command;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jst.server.tomcat.core.internal.ITomcatServerWorkingCopy;
-import org.eclipse.jst.server.tomcat.core.internal.TomcatServer;
-import org.eclipse.wst.server.core.util.Task;
-/**
- * A command on a Tomcat server.
- */
-public abstract class ServerCommand extends Task {
- protected TomcatServer server;
-
- /**
- * ServerCommand constructor comment.
- */
- public ServerCommand(ITomcatServerWorkingCopy server) {
- super();
- this.server = (TomcatServer) server;
- }
-
- /**
- * Returns true if this command can be undone.
- * @return boolean
- */
- public boolean canUndo() {
- return true;
- }
-
- public abstract boolean execute();
-
- public void execute(IProgressMonitor monitor) {
- execute();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/command/SetDebugModeCommand.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/command/SetDebugModeCommand.java
deleted file mode 100644
index 672c77a..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/command/SetDebugModeCommand.java
+++ /dev/null
@@ -1,62 +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.jst.server.tomcat.core.internal.command;
-
-import org.eclipse.jst.server.tomcat.core.internal.ITomcatServerWorkingCopy;
-import org.eclipse.jst.server.tomcat.core.internal.TomcatPlugin;
-/**
- * Command to change the server debug mode.
- */
-public class SetDebugModeCommand extends ServerCommand {
- protected boolean debug;
- protected boolean oldDebug;
-
- /**
- * SetDebugModeCommand constructor comment.
- */
- public SetDebugModeCommand(ITomcatServerWorkingCopy server, boolean debug) {
- super(server);
- this.debug = debug;
- }
-
- /**
- * Execute the command.
- * @return boolean
- */
- public boolean execute() {
- oldDebug = server.isDebug();
- server.setDebug(debug);
- return true;
- }
-
- /**
- * Returns this command's description.
- * @return java.lang.String
- */
- public String getDescription() {
- return TomcatPlugin.getResource("%serverEditorActionSetDebugModeDescription");
- }
-
- /**
- * Returns this command's label.
- * @return java.lang.String
- */
- public String getName() {
- return TomcatPlugin.getResource("%serverEditorActionSetDebugMode");
- }
-
- /**
- * Undo the command.
- */
- public void undo() {
- server.setDebug(oldDebug);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/command/SetSecureCommand.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/command/SetSecureCommand.java
deleted file mode 100644
index e3b17f8..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/command/SetSecureCommand.java
+++ /dev/null
@@ -1,62 +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.jst.server.tomcat.core.internal.command;
-
-import org.eclipse.jst.server.tomcat.core.internal.ITomcatServerWorkingCopy;
-import org.eclipse.jst.server.tomcat.core.internal.TomcatPlugin;
-/**
- * Command to change the server security option.
- */
-public class SetSecureCommand extends ServerCommand {
- protected boolean secure;
- protected boolean oldSecure;
-
- /**
- * SetSecureCommand constructor comment.
- */
- public SetSecureCommand(ITomcatServerWorkingCopy server, boolean secure) {
- super(server);
- this.secure = secure;
- }
-
- /**
- * Execute the command.
- * @return boolean
- */
- public boolean execute() {
- oldSecure = server.isSecure();
- server.setSecure(secure);
- return true;
- }
-
- /**
- * Returns this command's description.
- * @return java.lang.String
- */
- public String getDescription() {
- return TomcatPlugin.getResource("%serverEditorActionSetSecureDescription");
- }
-
- /**
- * Returns this command's label.
- * @return java.lang.String
- */
- public String getName() {
- return TomcatPlugin.getResource("%serverEditorActionSetSecure");
- }
-
- /**
- * Undo the command.
- */
- public void undo() {
- server.setSecure(oldSecure);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/command/SetTestEnvironmentCommand.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/command/SetTestEnvironmentCommand.java
deleted file mode 100644
index 5e58439..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/command/SetTestEnvironmentCommand.java
+++ /dev/null
@@ -1,62 +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.jst.server.tomcat.core.internal.command;
-
-import org.eclipse.jst.server.tomcat.core.internal.ITomcatServerWorkingCopy;
-import org.eclipse.jst.server.tomcat.core.internal.TomcatPlugin;
-/**
- * Command to change the server debug mode.
- */
-public class SetTestEnvironmentCommand extends ServerCommand {
- protected boolean te;
- protected boolean oldTe;
-
- /**
- * SetTestEnvironmentCommand constructor comment.
- */
- public SetTestEnvironmentCommand(ITomcatServerWorkingCopy server, boolean te) {
- super(server);
- this.te = te;
- }
-
- /**
- * Execute the command.
- * @return boolean
- */
- public boolean execute() {
- oldTe = server.isTestEnvironment();
- server.setTestEnvironment(te);
- return true;
- }
-
- /**
- * Returns this command's description.
- * @return java.lang.String
- */
- public String getDescription() {
- return TomcatPlugin.getResource("%serverEditorActionSetTestEnvironmentDescription");
- }
-
- /**
- * Returns this command's label.
- * @return java.lang.String
- */
- public String getName() {
- return TomcatPlugin.getResource("%serverEditorActionSetTestEnvironment");
- }
-
- /**
- * Undo the command.
- */
- public void undo() {
- server.setTestEnvironment(oldTe);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/command/SetWebModulePathCommand.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/command/SetWebModulePathCommand.java
deleted file mode 100644
index 31dd5a6..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/command/SetWebModulePathCommand.java
+++ /dev/null
@@ -1,72 +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.jst.server.tomcat.core.internal.command;
-
-import org.eclipse.jst.server.tomcat.core.internal.ITomcatConfigurationWorkingCopy;
-import org.eclipse.jst.server.tomcat.core.internal.TomcatPlugin;
-import org.eclipse.jst.server.tomcat.core.internal.WebModule;
-/**
- * Command to modify the path of a Web module.
- */
-public class SetWebModulePathCommand extends ConfigurationCommand {
- protected int index;
- protected WebModule oldModule;
- protected String path;
-
- /**
- * SetWebModulePathCommand constructor comment.
- */
- public SetWebModulePathCommand(ITomcatConfigurationWorkingCopy configuration, int index, String contextRoot) {
- super(configuration);
- this.index = index;
- this.path = contextRoot;
- }
-
- /**
- * Execute the command.
- * @return boolean
- */
- public boolean execute() {
- oldModule = (WebModule) configuration.getWebModules().get(index);
- configuration.removeWebModule(index);
-
- WebModule module = new WebModule(path, oldModule.getDocumentBase(), oldModule.getMemento(), oldModule.isReloadable());
- configuration.addWebModule(index, module);
- return true;
- }
-
- /**
- * Returns this command's description.
- * @return java.lang.String
- */
- public String getDescription() {
- if (oldModule == null)
- oldModule = (WebModule) configuration.getWebModules().get(index);
-
- return TomcatPlugin.getResource("%configurationEditorActionEditWebModuleDescription", oldModule.getPath(), path);
- }
-
- /**
- * Returns this command's label.
- * @return java.lang.String
- */
- public String getName() {
- return TomcatPlugin.getResource("%configurationEditorActionEditWebModulePath");
- }
-
- /**
- * Undo the command.
- */
- public void undo() {
- configuration.removeWebModule(index);
- configuration.addWebModule(index, oldModule);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/command/SetWebModulePathTask.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/command/SetWebModulePathTask.java
deleted file mode 100644
index 75e6eac..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/command/SetWebModulePathTask.java
+++ /dev/null
@@ -1,99 +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.jst.server.tomcat.core.internal.command;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jst.server.tomcat.core.internal.TomcatConfiguration;
-import org.eclipse.jst.server.tomcat.core.internal.TomcatPlugin;
-import org.eclipse.jst.server.tomcat.core.internal.TomcatServer;
-import org.eclipse.jst.server.tomcat.core.internal.WebModule;
-
-import org.eclipse.wst.server.core.IServerWorkingCopy;
-import org.eclipse.wst.server.core.TaskModel;
-import org.eclipse.wst.server.core.util.Task;
-/**
- * Task to modify the path of a Web module.
- */
-public class SetWebModulePathTask extends Task {
- protected int index;
- protected WebModule oldModule;
- protected String path;
-
- /**
- * SetWebModulePathTask constructor comment.
- */
- public SetWebModulePathTask(int index, String contextRoot) {
- super();
- this.index = index;
- this.path = contextRoot;
- }
-
- /**
- * Execute the command.
- * @return boolean
- */
- public void execute(IProgressMonitor monitor) throws CoreException {
- IServerWorkingCopy wc = (IServerWorkingCopy) getTaskModel().getObject(TaskModel.TASK_SERVER);
- TomcatServer server = (TomcatServer) wc.getAdapter(TomcatServer.class);
- TomcatConfiguration configuration = server.getTomcatConfiguration();
- oldModule = (WebModule) configuration.getWebModules().get(index);
- configuration.removeWebModule(index);
-
- WebModule module = new WebModule(path, oldModule.getDocumentBase(), oldModule.getMemento(), oldModule.isReloadable());
- configuration.addWebModule(index, module);
- }
-
- /**
- * Returns this command's description.
- * @return java.lang.String
- */
- public String getDescription() {
- if (oldModule == null) {
- try {
- IServerWorkingCopy wc = (IServerWorkingCopy) getTaskModel().getObject(TaskModel.TASK_SERVER);
- TomcatServer server = (TomcatServer) wc.getAdapter(TomcatServer.class);
- TomcatConfiguration configuration = server.getTomcatConfiguration();
- oldModule = (WebModule) configuration.getWebModules().get(index);
- } catch (Exception e) {
- // ignore
- }
- }
-
- if (oldModule == null)
- return TomcatPlugin.getResource("%configurationEditorActionEditWebModuleDescription", "<>", path);
-
- return TomcatPlugin.getResource("%configurationEditorActionEditWebModuleDescription", oldModule.getPath(), path);
- }
-
- /**
- * Returns this command's label.
- * @return java.lang.String
- */
- public String getName() {
- return TomcatPlugin.getResource("%configurationEditorActionEditWebModulePath");
- }
-
- /**
- * Undo the command.
- */
- public void undo() {
- try {
- IServerWorkingCopy wc = (IServerWorkingCopy) getTaskModel().getObject(TaskModel.TASK_SERVER);
- TomcatServer server = (TomcatServer) wc.getAdapter(TomcatServer.class);
- TomcatConfiguration configuration = server.getTomcatConfiguration();
- configuration.removeWebModule(index);
- configuration.addWebModule(index, oldModule);
- } catch (Exception e) {
- // ignore
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/package.xml b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/package.xml
deleted file mode 100644
index d4b9606..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/package.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<html>
-<head>
- <!-- Escape to the root of your source folder -->
- <meta
- name="root"
- content="../../../../../../" />
- <title>WTP API overview</title>
-</head>
-
-<body>
-
-<p>Support for Apache Tomcat server tools.</p>
-
-<p>ITomcatRuntime and its working copy provide type-specific access
-to the Tomcat runtime type. When using a Tomcat runtime, clients can
-access the type specific information by adapting to these types using
-<pre>ITomcatRuntime tr = (ITomcatRuntime) runtime.getAdapter(ITomcatRuntime.class)</pre>.
-ITomcatServer can be accessed in the same way.</p>
-
-</body>
-</html>
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/xml/Factory.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/xml/Factory.java
deleted file mode 100644
index 1e59666..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/xml/Factory.java
+++ /dev/null
@@ -1,129 +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.jst.server.tomcat.core.internal.xml;
-
-import java.io.*;
-
-import org.w3c.dom.*;
-import org.xml.sax.InputSource;
-
-import org.eclipse.jst.server.tomcat.core.internal.Trace;
-/**
- * Factory for reading and writing from XML files.
- */
-public class Factory {
- protected String packageName;
- protected Document document;
-
- public Factory() {
- // do nothing
- }
-
- protected Attr createAttribute(String s, Element element) {
- Attr attr = document.createAttribute(s);
- element.setAttributeNode(attr);
- return attr;
- }
-
- protected XMLElement createElement(int index, String s, Node node) {
- if (index < 0)
- return createElement(s, node);
-
- Element element = document.createElement(s);
- try {
- Node child = node.getFirstChild();
- for (int i = 0; i < index; i++)
- child = child.getNextSibling();
-
- node.insertBefore(element, child);
- } catch (Exception e) {
- node.appendChild(element);
- }
- return newInstance(element);
- }
-
- protected XMLElement createElement(String s, Node node) {
- Element element = document.createElement(s);
- node.appendChild(element);
- return newInstance(element);
- }
-
- public byte[] getContents() throws IOException {
- return XMLUtil.getContents(document);
- }
-
- /**
- *
- * @return org.w3c.dom.Document
- */
- public Document getDocument() {
- return document;
- }
-
- public String getPackageName() {
- return packageName;
- }
-
- public XMLElement loadDocument(InputStream in) throws IOException {
- try {
- InputStreamReader reader = new InputStreamReader(in);
- document = XMLUtil.getDocumentBuilder().parse(new InputSource(reader));
- Element element = document.getDocumentElement();
- return newInstance(element);
- } catch (Exception exception) {
- Trace.trace(Trace.WARNING, "Error loading document", exception);
- throw new IOException("Could not load document");
- }
- }
-
- protected XMLElement newInstance(Element element) {
- String s = element.getNodeName();
- try {
- // change "web-app:test" to "WebAppTest"
- s = s.substring(0, 1).toUpperCase() + s.substring(1);
- int i = s.indexOf("-");
- while (i >= 0) {
- s = s.substring(0, i) + s.substring(i+1, i+2).toUpperCase() + s.substring(i+2);
- i = s.indexOf("-");
- }
- i = s.indexOf(":");
- while (i >= 0) {
- s = s.substring(0, i) + s.substring(i+1, i+2).toUpperCase() + s.substring(i+2);
- i = s.indexOf(":");
- }
-
- // add package name
- if (packageName != null)
- s = packageName + "." + s;
- Class class1 = Class.forName(s);
-
- XMLElement xmlElement = (XMLElement) class1.newInstance();
- xmlElement.setElement(element);
- xmlElement.setFactory(this);
- return xmlElement;
- } catch (Exception exception) {
- // ignore
- }
- return null;
- }
-
- public void save(String filename) throws IOException {
- XMLUtil.save(filename, document);
- }
-
- public void setDocument(Document d) {
- document = d;
- }
-
- public void setPackageName(String s) {
- packageName = s;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/xml/XMLElement.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/xml/XMLElement.java
deleted file mode 100644
index 5ac618f..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/xml/XMLElement.java
+++ /dev/null
@@ -1,232 +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.jst.server.tomcat.core.internal.xml;
-
-import org.w3c.dom.*;
-/**
- * An XML element.
- */
-public class XMLElement {
- private Element xmlElement;
- protected Factory factory;
-
- public XMLElement() {
- // do nothing
- }
-
- public Attr addAttribute(String s, String s1) {
- Attr attr = factory.createAttribute(s, xmlElement);
- attr.setValue(s1);
- return attr;
- }
-
- public XMLElement createElement(int index, String s) {
- return factory.createElement(index, s, xmlElement);
- }
-
- public XMLElement createElement(String s) {
- return factory.createElement(s, xmlElement);
- }
-
- public XMLElement findElement(String s) {
- NodeList nodelist = xmlElement.getElementsByTagName(s);
- int i = nodelist == null ? 0 : nodelist.getLength();
- for (int j = 0; j < i; j++) {
- Node node = nodelist.item(j);
- String s1 = node.getNodeName().trim();
- if (s1.equals(s))
- return factory.newInstance((Element) node);
- }
-
- return createElement(s);
- }
-
- public XMLElement findElement(String s, int i) {
- NodeList nodelist = xmlElement.getElementsByTagName(s);
- int j = nodelist == null ? 0 : nodelist.getLength();
- for (int k = 0; k < j; k++) {
- Node node = nodelist.item(k);
- String s1 = node.getNodeName().trim();
- if (s1.equals(s) && k == i)
- return factory.newInstance((Element) node);
- }
-
- return createElement(s);
- }
-
- public String getAttributeValue(String s) {
- Attr attr = xmlElement.getAttributeNode(s);
- if (attr != null)
- return attr.getValue();
-
- return null;
- }
-
- public String getElementName() {
- return xmlElement.getNodeName();
- }
-
- public String getElementValue() {
- return getElementValue(xmlElement);
- }
-
- protected static String getElementValue(Element element) {
- String s = element.getNodeValue();
- if (s != null)
- return s;
- NodeList nodelist = element.getChildNodes();
- for (int i = 0; i < nodelist.getLength(); i++)
- if (nodelist.item(i) instanceof Text)
- return ((Text) nodelist.item(i)).getData();
-
- return null;
- }
-
- public Element getSubElement(String s) {
- NodeList nodelist = xmlElement.getElementsByTagName(s);
- int i = nodelist == null ? 0 : nodelist.getLength();
- for (int j = 0; j < i; j++) {
- Node node = nodelist.item(j);
- String s1 = node.getNodeName().trim();
- if (s1.equals(s))
- return (Element) node;
- }
-
- return null;
- }
-
- public String getSubElementValue(String s) {
- Element element = getSubElement(s);
- if (element == null)
- return null;
-
- String value = getElementValue(element);
- if (value == null)
- return null;
-
- return value.trim();
- }
-
- public boolean removeAttribute(String s) {
- try {
- xmlElement.removeAttribute(s);
- return true;
- } catch (Exception ex) {
- return false;
- }
- }
-
- public boolean removeElement(String s, int i) {
- NodeList nodelist = xmlElement.getElementsByTagName(s);
- int j = nodelist == null ? 0 : nodelist.getLength();
- for (int k = 0; k < j; k++) {
- Node node = nodelist.item(k);
- String s1 = node.getNodeName().trim();
- if (s1.equals(s) && k == i) {
- xmlElement.removeChild(node);
- return true;
- }
- }
-
- return false;
- }
-
- public void setAttributeValue(String s, String s1) {
- Attr attr = xmlElement.getAttributeNode(s);
- if (attr == null)
- attr = addAttribute(s, s1);
- else
- attr.setValue(s1);
- }
-
- void setElement(Element element) {
- xmlElement = element;
- }
-
- protected static void setElementValue(Element element, String value) {
- String s = element.getNodeValue();
- if (s != null) {
- element.setNodeValue(value);
- return;
- }
- NodeList nodelist = element.getChildNodes();
- for (int i = 0; i < nodelist.getLength(); i++)
- if (nodelist.item(i) instanceof Text) {
- Text text = (Text) nodelist.item(i);
- text.setData(value);
- return;
- }
-
- return;
- }
-
- void setFactory(Factory factory1) {
- factory = factory1;
- }
-
- public void setSubElementValue(String s, String value) {
- Element element = getSubElement(s);
- if (element == null) {
- element = factory.document.createElement(s);
- element.appendChild(factory.document.createTextNode("temp"));
- xmlElement.appendChild(element);
- }
- setElementValue(element, value);
- }
-
- public int sizeOfElement(String s) {
- NodeList nodelist = xmlElement.getElementsByTagName(s);
- int i = nodelist == null ? 0 : nodelist.getLength();
- return i;
- }
-
- public void updateElementValue(String s) {
- try {
- xmlElement.setNodeValue(s);
- } catch (DOMException ex) {
- NodeList nodelist = xmlElement.getChildNodes();
- int i = nodelist == null ? 0 : nodelist.getLength();
- if (i > 0) {
- for (int j = 0; j < i; j++)
- if (nodelist.item(j) instanceof Text) {
- ((Text) nodelist.item(j)).setData(s);
- return;
- }
- } else {
- xmlElement.appendChild(factory.document.createTextNode(s));
- }
- }
- }
-
- public boolean hasChildNodes() {
- return xmlElement.hasChildNodes();
- }
-
- public void removeChildren()
- {
- while (xmlElement.hasChildNodes()) {
- xmlElement.removeChild(xmlElement.getFirstChild());
- }
- }
-
- public void copyChildrenTo(XMLElement destination) {
- NodeList nodelist = xmlElement.getChildNodes();
- int len = nodelist == null ? 0 : nodelist.getLength();
- for (int i = 0; i < len; i++) {
- Node node = nodelist.item(i);
- destination.importNode(node, true);
- }
- }
-
- void importNode(Node node, boolean deep) {
- xmlElement.appendChild(xmlElement.getOwnerDocument().importNode(node, deep));
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/xml/XMLUtil.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/xml/XMLUtil.java
deleted file mode 100644
index 4610ba1..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/xml/XMLUtil.java
+++ /dev/null
@@ -1,383 +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.jst.server.tomcat.core.internal.xml;
-
-import java.io.*;
-import java.util.*;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
-import org.eclipse.jst.server.tomcat.core.internal.Trace;
-import org.w3c.dom.*;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-/**
- * Utility class to create and read XML documents.
- */
-public class XMLUtil {
- private static DocumentBuilder documentBuilder;
-
- /**
- * XMLUtil constructor comment.
- */
- public XMLUtil() {
- super();
- }
-
- public static DocumentBuilder getDocumentBuilder() {
- if (documentBuilder == null)
- try {
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- factory.setValidating(false);
- factory.setNamespaceAware(false);
- factory.setExpandEntityReferences(false);
- //factory.setAttribute("http://apache.org/xml/features/nonvalidating/load-external-dtd", new Boolean(false));
- documentBuilder = factory.newDocumentBuilder();
- documentBuilder.setEntityResolver(new EntityResolver() {
- public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
- return new InputSource(new ByteArrayInputStream(new byte[0]));
- }
- });
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Rrror creating document builder");
- }
-
- return documentBuilder;
- }
-
- /**
- * Create a child of the given node at the given index.
- * @return org.w3c.dom.Element
- * @param nodeName java.lang.String
- */
- public static Element createChildElement(Document doc, Element element, int index, String nodeName) {
- Element element2 = doc.createElement(nodeName);
- try {
- NodeList childList = element.getElementsByTagName(nodeName);
- Node child = childList.item(index);
- element.insertBefore(element2, child);
- } catch (Exception e) {
- element.appendChild(element2);
- }
- return element2;
- }
-
- /**
- * Create a child of the given node.
- * @return org.w3c.dom.Element
- * @param nodeName java.lang.String
- */
- public static Element createChildElement(Document doc, Node node, String nodeName) {
- Element element = doc.createElement(nodeName);
- node.appendChild(element);
- return element;
- }
-
- /*
- * Set the value of the given node to the given text.
- */
- public static void createTextChildElement(Document doc, Node node, String name, String value) {
- Element element = createChildElement(doc, node, name);
- element.appendChild(doc.createTextNode(value));
- }
-
- /**
- * Return the attribute value.
- * @return java.lang.String
- * @param element org.w3c.dom.Element
- * @param attr java.lang.String
- */
- public static String getAttributeValue(Element element, String attr) {
- return element.getAttributeNode(attr).getValue();
- }
-
- public static byte[] getContents(Document document) throws IOException {
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- try {
- print(new PrintWriter(out), document);
- return out.toByteArray();
- } catch (Exception ex) {
- throw new IOException(ex.getLocalizedMessage());
- } finally {
- if (out != null)
- try {
- out.close();
- } catch (Exception e) {
- // ignore
- }
- }
- }
-
- protected static String getDocumentTypeData(DocumentType doctype) {
- String data = doctype.getName();
- if (doctype.getPublicId() != null) {
- data += " PUBLIC \"" + doctype.getPublicId() + "\"";
- String systemId = doctype.getSystemId();
- if (systemId == null)
- systemId = "";
- data += " \"" + systemId + "\"";
- } else
- data += " SYSTEM \"" + doctype.getSystemId() + "\"";
-
- return data;
- }
-
- /**
- * Return an iterator for the subelements.
- * @return java.util.Iterator
- * @param element org.w3c.dom.Element
- * @param name java.lang.String
- */
- public static Iterator getNodeIterator(Element element, String name) {
- List list = new ArrayList();
- NodeList nodeList = element.getElementsByTagName(name);
-
- int length = nodeList.getLength();
- for (int i = 0; i < length; i++)
- list.add(nodeList.item(i));
-
- return list.iterator();
- }
-
- /**
- * Get the value of this node. Will return "" instead of null.
- * @return java.lang.String
- * @param node org.w3c.dom.Node
- */
- public static String getNodeValue(Node node) {
- NodeList nodeList = node.getChildNodes();
-
- int length = nodeList.getLength();
- for (int i = 0; i < length; i++) {
- Node n = nodeList.item(i);
- if (n instanceof Text) {
- Text t = (Text) n;
- return t.getNodeValue();
- }
- }
- return "";
- }
-
- /*
- * Get the value of a subnode.
-
- * @return java.lang.String
- */
- public static String getSubNodeValue(Element element, String name) {
- NodeList nodeList = element.getElementsByTagName(name);
- return getNodeValue(nodeList.item(0)).trim();
- }
-
- /*
- * Insert the given text.
- */
- public static void insertText(Document doc, Node node, String text) {
- node.appendChild(doc.createCDATASection(text));
- }
-
- protected static String normalize(String s) {
- StringBuffer stringbuffer = new StringBuffer();
- int i = s == null ? 0 : s.length();
- for (int j = 0; j < i; j++) {
- char c = s.charAt(j);
- switch (c) {
- case 60 : /* '<' */
- stringbuffer.append("<");
- break;
-
- case 62 : /* '>' */
- stringbuffer.append(">");
- break;
-
- case 38 : /* '&' */
- stringbuffer.append("&");
- break;
-
- case 34 : /* '"' */
- stringbuffer.append(""");
- break;
-
- case 10 : /* '\n' */
- case 13 : /* '\r' */
- default :
- stringbuffer.append(c);
- break;
-
- }
- }
-
- return stringbuffer.toString();
- }
-
- protected static void print(PrintWriter out, Node node) {
- if (node == null)
- return;
- short type = node.getNodeType();
- switch (type) {
- case Node.DOCUMENT_NODE: {
- //out.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
- out.println("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n");
- NodeList nodelist = node.getChildNodes();
- int size = nodelist.getLength();
- for (int i = 0; i < size; i++)
- print(out, nodelist.item(i));
- break;
- }
-
- case Node.DOCUMENT_TYPE_NODE: {
- DocumentType docType = (DocumentType) node;
- out.print("<!DOCTYPE " + getDocumentTypeData(docType) + ">\n");
- break;
- }
-
- case Node.ELEMENT_NODE: {
- out.print('<');
- out.print(node.getNodeName());
- NamedNodeMap map = node.getAttributes();
- if (map != null) {
- int size = map.getLength();
- for (int i = 0; i < size; i++) {
- Attr attr = (Attr) map.item(i);
- out.print(' ');
- out.print(attr.getNodeName());
- out.print("=\"");
- out.print(normalize(attr.getNodeValue()));
- out.print('"');
- }
- }
-
- if (!node.hasChildNodes())
- out.print("/>");
- else {
- out.print('>');
- NodeList nodelist = node.getChildNodes();
- int numChildren = nodelist.getLength();
- for (int i = 0; i < numChildren; i++)
- print(out, nodelist.item(i));
-
- out.print("</");
- out.print(node.getNodeName());
- out.print('>');
- }
- break;
- }
-
- case Node.ENTITY_REFERENCE_NODE: {
- NodeList nodelist = node.getChildNodes();
- if (nodelist != null) {
- int size = nodelist.getLength();
- for (int i = 0; i < size; i++)
- print(out, nodelist.item(i));
-
- }
- break;
- }
-
- case Node.CDATA_SECTION_NODE: {
- out.print(normalize(node.getNodeValue()));
- break;
- }
-
- case Node.TEXT_NODE: {
- out.print(normalize(node.getNodeValue()));
- break;
- }
-
- case Node.PROCESSING_INSTRUCTION_NODE: {
- out.print("<?");
- out.print(node.getNodeName());
- String s = node.getNodeValue();
- if (s != null && s.length() > 0) {
- out.print(' ');
- out.print(s);
- }
- out.print("?>");
- break;
- }
-
- case Node.COMMENT_NODE: {
- out.print("<!--");
- out.print(node.getNodeValue());
- out.print("-->");
- break;
- }
-
- default: {
- out.print(normalize(node.getNodeValue()));
- break;
- }
- }
- out.flush();
- }
-
- public static void save(String filename, Document document) throws IOException {
- PrintWriter out = null;
- try {
- out = new PrintWriter(new BufferedWriter(new FileWriter(filename)));
- //traceNode(document, "");
- print(out, document);
- } catch (Exception ex) {
- throw new IOException(ex.getLocalizedMessage());
- } finally {
- if (out != null)
- try {
- out.close();
- } catch (Exception e) {
- // ignore
- }
- }
- }
-
- /*
- * Set the value of the subnode
- *
- * @param name java.lang.String
- * @param value java.lang.String
- */
- public static void setNodeValue(Node node, String name, String value) {
- String s = node.getNodeValue();
- if (s != null) {
- node.setNodeValue(value);
- return;
- }
- NodeList nodelist = node.getChildNodes();
- for (int i = 0; i < nodelist.getLength(); i++) {
- if (nodelist.item(i) instanceof Text) {
- Text text = (Text) nodelist.item(i);
- text.setData(value);
- return;
- }
- }
- return;
- }
-
- public static String toString(Document document) {
- PrintWriter out = null;
- try {
- ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
- out = new PrintWriter(baos);
- print(out, document);
- return new String(baos.toByteArray());
- } catch (Exception ex) {
- // ignore
- } finally {
- if (out != null)
- try {
- out.close();
- } catch (Exception e) {
- // ignore
- }
- }
- return null;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/xml/server32/Connector.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/xml/server32/Connector.java
deleted file mode 100644
index a0324f2..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/xml/server32/Connector.java
+++ /dev/null
@@ -1,37 +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.jst.server.tomcat.core.internal.xml.server32;
-
-import org.eclipse.jst.server.tomcat.core.internal.xml.*;
-/**
- *
- */
-public class Connector extends XMLElement {
- public Connector() {
- // do nothing
- }
-
- public String getClassName() {
- return getAttributeValue("className");
- }
-
- public Parameter getParameter(int index) {
- return (Parameter) findElement("Parameter", index);
- }
-
- public int getParameterCount() {
- return sizeOfElement("Parameter");
- }
-
- public void setClassName(String className) {
- setAttributeValue("className", className);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/xml/server32/Context.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/xml/server32/Context.java
deleted file mode 100644
index b5568e8..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/xml/server32/Context.java
+++ /dev/null
@@ -1,77 +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.jst.server.tomcat.core.internal.xml.server32;
-
-import org.eclipse.jst.server.tomcat.core.internal.xml.*;
-/**
- *
- */
-public class Context extends XMLElement {
- public Context() {
- // do nothing
- }
-
- public String getCrossContext() {
- return getAttributeValue("crossContext");
- }
-
- public String getDebug() {
- return getAttributeValue("debug");
- }
-
- public String getDocBase() {
- return getAttributeValue("docBase");
- }
-
- public String getPath() {
- return getAttributeValue("path");
- }
-
- public String getReloadable() {
- return getAttributeValue("reloadable");
- }
-
- public String getSource() {
- return getAttributeValue("source");
- }
-
- public String getTrusted() {
- return getAttributeValue("trusted");
- }
-
- public void setCrossContext(String crossContext) {
- setAttributeValue("crossContext", crossContext);
- }
-
- public void setDebug(String debug) {
- setAttributeValue("debug", debug);
- }
-
- public void setDocBase(String docBase) {
- setAttributeValue("docBase", docBase);
- }
-
- public void setPath(String path) {
- setAttributeValue("path", path);
- }
-
- public void setReloadable(String reloadable) {
- setAttributeValue("reloadable", reloadable);
- }
-
- public void setSource(String source) {
- setAttributeValue("source", source);
- }
-
- public void setTrusted(String trusted) {
- setAttributeValue("trusted", trusted);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/xml/server32/ContextManager.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/xml/server32/ContextManager.java
deleted file mode 100644
index e7829d1..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/xml/server32/ContextManager.java
+++ /dev/null
@@ -1,77 +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.jst.server.tomcat.core.internal.xml.server32;
-
-import org.eclipse.jst.server.tomcat.core.internal.xml.*;
-/**
- *
- */
-public class ContextManager extends XMLElement {
- public ContextManager() {
- // do nothing
- }
-
- public Connector getConnector(int index) {
- return (Connector) findElement("Connector", index);
- }
-
- public int getConnectorCount() {
- return sizeOfElement("Connector");
- }
-
- public Context getContext(int index) {
- return (Context) findElement("Context", index);
- }
-
- public int getContextCount() {
- return sizeOfElement("Context");
- }
-
- public int getContextInterceptorCount() {
- return sizeOfElement("ContextInterceptor");
- }
-
- public String getDebug() {
- return getAttributeValue("debug");
- }
-
- public String getHome() {
- return getAttributeValue("home");
- }
-
- public int getRequestInterceptorCount() {
- return sizeOfElement("RequestInterceptor");
- }
-
- public String getShowDebugInfo() {
- return getAttributeValue("showDebugInfo");
- }
-
- public String getWorkDir() {
- return getAttributeValue("workDir");
- }
-
- public void setDebug(String debug) {
- setAttributeValue("debug", debug);
- }
-
- public void setHome(String home) {
- setAttributeValue("home", home);
- }
-
- public void setShowDebugInfo(String showDebugInfo) {
- setAttributeValue("showDebugInfo", showDebugInfo);
- }
-
- public void setWorkDir(String workDir) {
- setAttributeValue("workDir", workDir);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/xml/server32/Parameter.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/xml/server32/Parameter.java
deleted file mode 100644
index 1608cf1..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/xml/server32/Parameter.java
+++ /dev/null
@@ -1,37 +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.jst.server.tomcat.core.internal.xml.server32;
-
-import org.eclipse.jst.server.tomcat.core.internal.xml.*;
-/**
- *
- */
-public class Parameter extends XMLElement {
- public Parameter() {
- // do nothing
- }
-
- public String getName() {
- return getAttributeValue("name");
- }
-
- public String getValue() {
- return getAttributeValue("value");
- }
-
- public void setName(String name) {
- setAttributeValue("name", name);
- }
-
- public void setValue(String value) {
- setAttributeValue("value", value);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/xml/server32/Server.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/xml/server32/Server.java
deleted file mode 100644
index 5d8cdd0..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/xml/server32/Server.java
+++ /dev/null
@@ -1,37 +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.jst.server.tomcat.core.internal.xml.server32;
-
-import org.eclipse.jst.server.tomcat.core.internal.xml.*;
-/**
- *
- */
-public class Server extends XMLElement {
- public Server() {
- // do nothing
- }
-
- public ContextManager getContextManager() {
- return (ContextManager) findElement("ContextManager");
- }
-
- public int getLoggerCount() {
- return sizeOfElement("Logger");
- }
-
- public String getName() {
- return getAttributeValue("name");
- }
-
- public void setName(String name) {
- setAttributeValue("name", name);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/xml/server40/Connector.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/xml/server40/Connector.java
deleted file mode 100644
index 79bf6c9..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/xml/server40/Connector.java
+++ /dev/null
@@ -1,85 +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.jst.server.tomcat.core.internal.xml.server40;
-
-import org.eclipse.jst.server.tomcat.core.internal.xml.*;
-/**
- *
- */
-public class Connector extends XMLElement {
- public Connector() {
- // do nothing
- }
-
- public String getAcceptCount() {
- return getAttributeValue("acceptCount");
- }
-
- public String getClassName() {
- return getAttributeValue("className");
- }
-
- public String getDebug() {
- return getAttributeValue("debug");
- }
-
- public String getMaxProcessors() {
- return getAttributeValue("maxProcessors");
- }
-
- public String getMinProcessors() {
- return getAttributeValue("minProcessors");
- }
-
- public String getPort() {
- return getAttributeValue("port");
- }
-
- public String getSecure() {
- return getAttributeValue("secure");
- }
-
- public String getProtocol() {
- return getAttributeValue("protocol");
- }
-
- public String getProtocolHandlerClassName() {
- return getAttributeValue("protocolHandlerClassName");
- }
-
- public void setAcceptCount(String acceptCount) {
- setAttributeValue("acceptCount", acceptCount);
- }
-
- public void setClassName(String className) {
- setAttributeValue("className", className);
- }
-
- public void setDebug(String debug) {
- setAttributeValue("debug", debug);
- }
-
- public void setMaxProcessors(String maxProcessors) {
- setAttributeValue("maxProcessors", maxProcessors);
- }
-
- public void setMinProcessors(String minProcessors) {
- setAttributeValue("minProcessors", minProcessors);
- }
-
- public void setPort(String port) {
- setAttributeValue("port", port);
- }
-
- public void setProtocolHandlerClassName(String protocolHandlerClassName) {
- setAttributeValue("protocolHandlerClassName", protocolHandlerClassName);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/xml/server40/Context.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/xml/server40/Context.java
deleted file mode 100644
index b597c89..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/xml/server40/Context.java
+++ /dev/null
@@ -1,61 +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.jst.server.tomcat.core.internal.xml.server40;
-
-import org.eclipse.jst.server.tomcat.core.internal.xml.*;
-/**
- *
- */
-public class Context extends XMLElement {
- public Context() {
- // do nothing
- }
-
- public String getDebug() {
- return getAttributeValue("debug");
- }
-
- public String getDocBase() {
- return getAttributeValue("docBase");
- }
-
- public String getPath() {
- return getAttributeValue("path");
- }
-
- public String getReloadable() {
- return getAttributeValue("reloadable");
- }
-
- public String getSource() {
- return getAttributeValue("source");
- }
-
- public void setDebug(String debug) {
- setAttributeValue("debug", debug);
- }
-
- public void setDocBase(String docBase) {
- setAttributeValue("docBase", docBase);
- }
-
- public void setPath(String path) {
- setAttributeValue("path", path);
- }
-
- public void setReloadable(String reloadable) {
- setAttributeValue("reloadable", reloadable);
- }
-
- public void setSource(String source) {
- setAttributeValue("source", source);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/xml/server40/Engine.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/xml/server40/Engine.java
deleted file mode 100644
index 166ce0b..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/xml/server40/Engine.java
+++ /dev/null
@@ -1,65 +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.jst.server.tomcat.core.internal.xml.server40;
-
-import org.eclipse.jst.server.tomcat.core.internal.xml.*;
-/**
- *
- */
-public class Engine extends XMLElement {
- public Engine() {
- // do nothing
- }
-
- public String getAppBase() {
- return getAttributeValue("appBase");
- }
-
- public String getClassName() {
- return getAttributeValue("className");
- }
-
- public String getDebug() {
- return getAttributeValue("debug");
- }
-
- public String getDefaultHost() {
- return getAttributeValue("defaultHost");
- }
-
- public Host getHost() {
- return (Host) findElement("Host");
- }
-
- public String getName() {
- return getAttributeValue("name");
- }
-
- public void setAppBase(String appBase) {
- setAttributeValue("appBase", appBase);
- }
-
- public void setClassName(String className) {
- setAttributeValue("className", className);
- }
-
- public void setDebug(String debug) {
- setAttributeValue("debug", debug);
- }
-
- public void setDefaultHost(String defaultHost) {
- setAttributeValue("defaultHost", defaultHost);
- }
-
- public void setName(String name) {
- setAttributeValue("name", name);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/xml/server40/Host.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/xml/server40/Host.java
deleted file mode 100644
index dc91098..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/xml/server40/Host.java
+++ /dev/null
@@ -1,53 +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.jst.server.tomcat.core.internal.xml.server40;
-
-import org.eclipse.jst.server.tomcat.core.internal.xml.*;
-/**
- *
- */
-public class Host extends XMLElement {
- public Host() {
- // do nothing
- }
-
- public String getAppBase() {
- return getAttributeValue("appBase");
- }
-
- public Context getContext(int index) {
- return (Context) findElement("Context", index);
- }
-
- public int getContextCount() {
- return sizeOfElement("Context");
- }
-
- public String getDebug() {
- return getAttributeValue("debug");
- }
-
- public String getName() {
- return getAttributeValue("name");
- }
-
- public void setAppBase(String appBase) {
- setAttributeValue("appBase", appBase);
- }
-
- public void setDebug(String debug) {
- setAttributeValue("debug", debug);
- }
-
- public void setName(String name) {
- setAttributeValue("name", name);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/xml/server40/Listener.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/xml/server40/Listener.java
deleted file mode 100644
index 97378bc..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/xml/server40/Listener.java
+++ /dev/null
@@ -1,37 +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.jst.server.tomcat.core.internal.xml.server40;
-
-import org.eclipse.jst.server.tomcat.core.internal.xml.*;
-/**
- *
- */
-public class Listener extends XMLElement {
- public Listener() {
- // do nothing
- }
-
- public String getClassName() {
- return getAttributeValue("className");
- }
-
- public String getDebug() {
- return getAttributeValue("debug");
- }
-
- public void setClassName(String className) {
- setAttributeValue("className", className);
- }
-
- public void setDebug(String debug) {
- setAttributeValue("debug", debug);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/xml/server40/Server.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/xml/server40/Server.java
deleted file mode 100644
index 097111d..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/xml/server40/Server.java
+++ /dev/null
@@ -1,69 +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.jst.server.tomcat.core.internal.xml.server40;
-
-import org.eclipse.jst.server.tomcat.core.internal.xml.*;
-/**
- *
- */
-public class Server extends XMLElement {
- public Server() {
- // do nothing
- }
-
- public String getDebug() {
- return getAttributeValue("debug");
- }
-
- public String getName() {
- return getAttributeValue("name");
- }
-
- public String getPort() {
- return getAttributeValue("port");
- }
-
- public Service getService(int index) {
- return (Service) findElement("Service", index);
- }
-
- public int getServiceCount() {
- return sizeOfElement("Service");
- }
-
- public String getShutdown() {
- return getAttributeValue("shutdown");
- }
-
- public void setDebug(String debug) {
- setAttributeValue("debug", debug);
- }
-
- public void setName(String name) {
- setAttributeValue("name", name);
- }
-
- public void setPort(String port) {
- setAttributeValue("port", port);
- }
-
- public void setShutdown(String shutdown) {
- setAttributeValue("shutdown", shutdown);
- }
-
- public Listener getListener(int index) {
- return (Listener) findElement("Listener", index);
- }
-
- public int getListenerCount() {
- return sizeOfElement("Listener");
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/xml/server40/Service.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/xml/server40/Service.java
deleted file mode 100644
index cc24a4a..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/xml/server40/Service.java
+++ /dev/null
@@ -1,41 +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.jst.server.tomcat.core.internal.xml.server40;
-
-import org.eclipse.jst.server.tomcat.core.internal.xml.*;
-/**
- *
- */
-public class Service extends XMLElement {
- public Service() {
- // do nothing
- }
-
- public Connector getConnector(int index) {
- return (Connector) findElement("Connector", index);
- }
-
- public int getConnectorCount() {
- return sizeOfElement("Connector");
- }
-
- public Engine getEngine() {
- return (Engine) findElement("Engine");
- }
-
- public String getName() {
- return getAttributeValue("name");
- }
-
- public void setName(String name) {
- setAttributeValue("name", name);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/verifyInstall.properties b/plugins/org.eclipse.jst.server.tomcat.core/verifyInstall.properties
deleted file mode 100644
index 2de506c..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.core/verifyInstall.properties
+++ /dev/null
@@ -1,15 +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
-###############################################################################
-verify32install=lib/jasper.jar,lib/servlet.jar,bin,conf,webapps
-verify40install=bin/bootstrap.jar,conf,webapps
-verify41install=bin/bootstrap.jar,conf,webapps
-verify50install=bin/bootstrap.jar,conf,webapps
-verify55install=bin/bootstrap.jar,conf,webapps
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/.classpath b/plugins/org.eclipse.jst.server.tomcat.ui/.classpath
deleted file mode 100644
index b0cfa1b..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="tomcatui/"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/.cvsignore b/plugins/org.eclipse.jst.server.tomcat.ui/.cvsignore
deleted file mode 100644
index dc63549..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/.cvsignore
+++ /dev/null
@@ -1,5 +0,0 @@
-bin
-build.xml
-org.eclipse.jst.server.tomcat.ui_3.0.0.jar
-tomcatui.jar
-temp.folder
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/.options b/plugins/org.eclipse.jst.server.tomcat.ui/.options
deleted file mode 100644
index d88b03b..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/.options
+++ /dev/null
@@ -1,4 +0,0 @@
-# Debugging options for the org.eclipse.jst.server.tomcat.ui plugin
-
-# Turn on general debugging
-org.eclipse.jst.server.tomcat.ui/debug=true
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/.project b/plugins/org.eclipse.jst.server.tomcat.ui/.project
deleted file mode 100644
index 731f756..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jst.server.tomcat.ui</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/build.properties b/plugins/org.eclipse.jst.server.tomcat.ui/build.properties
deleted file mode 100644
index 8c2d9d8..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/build.properties
+++ /dev/null
@@ -1,18 +0,0 @@
-###############################################################################
-# Copyright (c) 2004 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
-###############################################################################
-bin.includes = plugin.xml,\
- plugin.properties,\
- icons/,\
- tomcatui.jar
-source.tomcatui.jar = tomcatui/
-jars.compile.order =
-src.includes = build.properties
-output.tomcatui.jar = bin/
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/icons/obj16/mime_extension.gif b/plugins/org.eclipse.jst.server.tomcat.ui/icons/obj16/mime_extension.gif
deleted file mode 100644
index c585010..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/icons/obj16/mime_extension.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/icons/obj16/mime_mapping.gif b/plugins/org.eclipse.jst.server.tomcat.ui/icons/obj16/mime_mapping.gif
deleted file mode 100644
index 0a8e4bf..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/icons/obj16/mime_mapping.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/icons/obj16/port.gif b/plugins/org.eclipse.jst.server.tomcat.ui/icons/obj16/port.gif
deleted file mode 100644
index 7a354b7..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/icons/obj16/port.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/icons/obj16/project_missing.gif b/plugins/org.eclipse.jst.server.tomcat.ui/icons/obj16/project_missing.gif
deleted file mode 100644
index 0cb4c16..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/icons/obj16/project_missing.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/icons/obj16/server_32.gif b/plugins/org.eclipse.jst.server.tomcat.ui/icons/obj16/server_32.gif
deleted file mode 100644
index bb4d02d..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/icons/obj16/server_32.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/icons/obj16/server_40.gif b/plugins/org.eclipse.jst.server.tomcat.ui/icons/obj16/server_40.gif
deleted file mode 100644
index e3745fc..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/icons/obj16/server_40.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/icons/obj16/server_41.gif b/plugins/org.eclipse.jst.server.tomcat.ui/icons/obj16/server_41.gif
deleted file mode 100644
index ed45603..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/icons/obj16/server_41.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/icons/obj16/server_50.gif b/plugins/org.eclipse.jst.server.tomcat.ui/icons/obj16/server_50.gif
deleted file mode 100644
index 0cac53e..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/icons/obj16/server_50.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/icons/obj16/server_55.gif b/plugins/org.eclipse.jst.server.tomcat.ui/icons/obj16/server_55.gif
deleted file mode 100644
index 69577f8..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/icons/obj16/server_55.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/icons/obj16/tomcat_tools.gif b/plugins/org.eclipse.jst.server.tomcat.ui/icons/obj16/tomcat_tools.gif
deleted file mode 100644
index 73bf959..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/icons/obj16/tomcat_tools.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/icons/obj16/web_module.gif b/plugins/org.eclipse.jst.server.tomcat.ui/icons/obj16/web_module.gif
deleted file mode 100644
index bf20f70..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/icons/obj16/web_module.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/icons/wizban/tomcat_wiz.gif b/plugins/org.eclipse.jst.server.tomcat.ui/icons/wizban/tomcat_wiz.gif
deleted file mode 100644
index 63a9599..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/icons/wizban/tomcat_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/plugin.properties b/plugins/org.eclipse.jst.server.tomcat.ui/plugin.properties
deleted file mode 100644
index 4f88751..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/plugin.properties
+++ /dev/null
@@ -1,82 +0,0 @@
-###############################################################################
-# Copyright (c) 2004 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
-###############################################################################
-pluginName=Apache Tomcat UI Support
-providerName=Eclipse.org
-
-# --------------- Editors ---------------
-
-# General text used in both editors
-editorRemove=Remove
-editorAdd=Add...
-editorEdit=Edit...
-
-# --- Configuration Editor ---
-configurationEditorWebModulesPage=Modules
-configurationEditorWebModulesPageTitle=Web Modules
-configurationEditorWebModulesSection=Web Modules
-configurationEditorWebModulesDescription=Configure the Web Modules on this server.
-configurationEditorMimeMappingsSection=MIME Mappings
-configurationEditorMimeMappingsDescription=Configure MIME type mappings.
-configurationEditorPortsSection=Ports
-configurationEditorPortsDescription=Modify the server ports.
-
-# Fields
-configurationEditorPortNameColumn=Port Name
-configurationEditorPortValueColumn=Port Number
-configurationEditorPathColumn=Path
-configurationEditorDocBaseColumn=Document Base
-configurationEditorProjectColumn=Project
-configurationEditorReloadColumn=Auto Reload
-configurationEditorProjectMissing={0} missing
-configurationEditorReloadEnabled=Enabled
-configurationEditorReloadDisabled=Disabled
-configurationEditorAddProjectModule=Add Web Project...
-configurationEditorAddExternalModule=Add External Web Module...
-
-# Add/Edit Mime Mapping dialog
-configurationEditorMimeMapppingDialogTitleEdit=Edit MIME Mapping
-configurationEditorMimeMapppingDialogTitleAdd=Add MIME Mapping
-configurationEditorMimeMapppingDialogMimeType=MIME type:
-configurationEditorMimeMapppingDialogMimeExtension=MIME extension:
-
-# Add/Edit Web Module dialog
-configurationEditorWebModuleDialogTitleEdit=Edit Web Module
-configurationEditorWebModuleDialogTitleAdd=Add Web Module
-configurationEditorWebModuleDialogProjects=Projects:
-configurationEditorWebModuleDialogPath=Path:
-configurationEditorWebModuleDialogDocumentBase=Document base:
-configurationEditorWebModuleDialogAutoReload=Auto reloading:
-configurationEditorWebModuleDialogReloadEnabled=Enabled
-configurationEditorWebModuleDialogSelectDirectory=Select the Web module directory.
-
-
-# --- Server Editor ---
-serverEditorGeneralSection=Server
-serverEditorGeneralDescription=Enter settings for the server.
-
-# Fields
-serverEditorSecure=Enable security
-serverEditorDebugMode=Enable Tomcat debug mode (v4.x and above only)
-serverEditorTestEnvironment=Run modules directly from the workspace (do not modify the Tomcat installation)
-
-
-# --------------- General UI ---------------
-
-runtimeName=Na&me:
-browse=B&rowse...
-installDir=Tomcat installation &directory:
-installedJRE=&JRE:
-installedJREs=&Installed JREs...
-selectInstallDir=Select Tomcat installation directory.
-
-# New Tomcat server wizard
-wizardTitle=Tomcat Server
-wizardDescription=Specify the installation directory
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/plugin.xml b/plugins/org.eclipse.jst.server.tomcat.ui/plugin.xml
deleted file mode 100644
index 9a3565e..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/plugin.xml
+++ /dev/null
@@ -1,143 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-
-<plugin id="org.eclipse.jst.server.tomcat.ui"
- name="%pluginName"
- version="1.0.0"
- provider-name="%providerName"
- class="org.eclipse.jst.server.tomcat.ui.internal.TomcatUIPlugin">
-
- <runtime>
- <library name="tomcatui.jar">
- <export name="*"/>
- </library>
- </runtime>
-
- <requires>
- <import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.eclipse.ui"/>
- <import plugin="org.eclipse.ui.ide"/>
- <import plugin="org.eclipse.ui.forms"/>
- <import plugin="org.eclipse.debug.ui"/>
- <import plugin="org.eclipse.jdt.debug.ui"/>
- <import plugin="org.eclipse.jdt.launching"/>
- <import plugin="org.eclipse.wst.server.core"/>
- <import plugin="org.eclipse.wst.server.ui"/>
- <import plugin="org.eclipse.jst.server.core"/>
- <import plugin="org.eclipse.jst.server.tomcat.core"/>
- </requires>
-
- <extension point="org.eclipse.wst.server.ui.serverImages">
- <image
- id="org.eclipse.jst.server.tomcat.32"
- icon="icons/obj16/server_32.gif"
- typeIds="org.eclipse.jst.server.tomcat.runtime.32"/>
- <image
- id="org.eclipse.jst.server.tomcat.40"
- icon="icons/obj16/server_40.gif"
- typeIds="org.eclipse.jst.server.tomcat.runtime.40"/>
- <image
- id="org.eclipse.jst.server.tomcat.41"
- icon="icons/obj16/server_41.gif"
- typeIds="org.eclipse.jst.server.tomcat.runtime.41"/>
- <image
- id="org.eclipse.jst.server.tomcat.50"
- icon="icons/obj16/server_50.gif"
- typeIds="org.eclipse.jst.server.tomcat.runtime.50"/>
- <image
- id="org.eclipse.jst.server.tomcat.55"
- icon="icons/obj16/server_55.gif"
- typeIds="org.eclipse.jst.server.tomcat.runtime.55"/>
-
- <image
- id="org.eclipse.jst.server.tomcat.32"
- icon="icons/obj16/server_32.gif"
- typeIds="org.eclipse.jst.server.tomcat.32"/>
- <image
- id="org.eclipse.jst.server.tomcat.40"
- icon="icons/obj16/server_40.gif"
- typeIds="org.eclipse.jst.server.tomcat.40"/>
- <image
- id="org.eclipse.jst.server.tomcat.41"
- icon="icons/obj16/server_41.gif"
- typeIds="org.eclipse.jst.server.tomcat.41"/>
- <image
- id="org.eclipse.jst.server.tomcat.50"
- icon="icons/obj16/server_50.gif"
- typeIds="org.eclipse.jst.server.tomcat.50"/>
- <image
- id="org.eclipse.jst.server.tomcat.55"
- icon="icons/obj16/server_55.gif"
- typeIds="org.eclipse.jst.server.tomcat.55"/>
- </extension>
-
- <extension point="org.eclipse.wst.server.ui.editorPages">
- <page
- id="org.eclipse.jst.server.tomcat.configuration.editor.webmodule"
- order="20"
- name="%configurationEditorWebModulesPage"
- typeIds="org.eclipse.jst.server.tomcat.*"
- class="org.eclipse.jst.server.tomcat.ui.internal.editor.ConfigurationWebModuleEditorFactory"/>
- </extension>
-
- <extension point="org.eclipse.wst.server.ui.editorPageSections">
- <section
- id="org.eclipse.jst.server.tomcat.server.editor.general"
- order="0"
- insertionId="org.eclipse.wst.server.editor.overview.left"
- typeIds="org.eclipse.jst.server.tomcat.*"
- class="org.eclipse.jst.server.tomcat.ui.internal.editor.ServerGeneralEditorSectionFactory"/>
- <section
- id="org.eclipse.jst.server.tomcat.configuration.editor.port"
- order="10"
- insertionId="org.eclipse.wst.server.editor.overview.right"
- typeIds="org.eclipse.jst.server.tomcat.*"
- class="org.eclipse.jst.server.tomcat.ui.internal.editor.ConfigurationPortEditorSectionFactory"/>
- <section
- id="org.eclipse.jst.server.tomcat.configuration.editor.mime"
- order="20"
- insertionId="org.eclipse.wst.server.editor.overview.right"
- typeIds="org.eclipse.jst.server.tomcat.*"
- class="org.eclipse.jst.server.tomcat.ui.internal.editor.ConfigurationMimeEditorSectionFactory"/>
- </extension>
-
- <extension point="org.eclipse.wst.server.ui.wizardFragments">
- <fragment
- id="org.eclipse.jst.server.tomcat.runtime.32"
- typeIds="org.eclipse.jst.server.tomcat.runtime.32"
- class="org.eclipse.jst.server.tomcat.ui.internal.TomcatRuntimeWizardFragment"/>
- <fragment
- id="org.eclipse.jst.server.tomcat.runtime.40"
- typeIds="org.eclipse.jst.server.tomcat.runtime.40"
- class="org.eclipse.jst.server.tomcat.ui.internal.TomcatRuntimeWizardFragment"/>
- <fragment
- id="org.eclipse.jst.server.tomcat.runtime.41"
- typeIds="org.eclipse.jst.server.tomcat.runtime.41"
- class="org.eclipse.jst.server.tomcat.ui.internal.TomcatRuntimeWizardFragment"/>
- <fragment
- id="org.eclipse.jst.server.tomcat.runtime.50"
- typeIds="org.eclipse.jst.server.tomcat.runtime.50"
- class="org.eclipse.jst.server.tomcat.ui.internal.TomcatRuntimeWizardFragment"/>
- <fragment
- id="org.eclipse.jst.server.tomcat.runtime.55"
- typeIds="org.eclipse.jst.server.tomcat.runtime.55"
- class="org.eclipse.jst.server.tomcat.ui.internal.TomcatRuntimeWizardFragment"/>
- </extension>
-
- <extension point="org.eclipse.debug.ui.launchConfigurationTypeImages">
- <launchConfigurationTypeImage
- id="org.eclipse.jst.server.tomcat.ui.launchConfigurationTypeImage"
- configTypeID="org.eclipse.jst.server.tomcat.core.launchConfigurationType"
- icon="icons/obj16/tomcat_tools.gif">
- </launchConfigurationTypeImage>
- </extension>
-
- <extension point="org.eclipse.debug.ui.launchConfigurationTabGroups">
- <launchConfigurationTabGroup
- id="org.eclipse.jst.server.tomcat.ui.launchConfigurationTabGroup"
- type="org.eclipse.jst.server.tomcat.core.launchConfigurationType"
- class="org.eclipse.jst.server.tomcat.ui.internal.TomcatLaunchConfigurationTabGroup">
- </launchConfigurationTabGroup>
- </extension>
-
-</plugin>
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/ContextIds.java b/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/ContextIds.java
deleted file mode 100644
index e8aa59b..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/ContextIds.java
+++ /dev/null
@@ -1,48 +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.jst.server.tomcat.ui.internal;
-/**
- * Constant ids for context help.
- */
-public interface ContextIds {
- public static final String SERVER_EDITOR = TomcatUIPlugin.PLUGIN_ID + ".teig0000";
- public static final String SERVER_EDITOR_TEST_ENVIRONMENT = TomcatUIPlugin.PLUGIN_ID + ".teig0002";
- public static final String SERVER_EDITOR_SECURE = TomcatUIPlugin.PLUGIN_ID + ".teig0004";
- public static final String SERVER_EDITOR_DEBUG_MODE = TomcatUIPlugin.PLUGIN_ID + ".teig0006";
-
- public static final String CONFIGURATION_EDITOR_WEBMODULES = TomcatUIPlugin.PLUGIN_ID + ".tecw0000";
- public static final String CONFIGURATION_EDITOR_WEBMODULES_LIST = TomcatUIPlugin.PLUGIN_ID + ".tecw0002";
- public static final String CONFIGURATION_EDITOR_WEBMODULES_ADD_PROJECT = TomcatUIPlugin.PLUGIN_ID + ".tecw0004";
- public static final String CONFIGURATION_EDITOR_WEBMODULES_ADD_EXTERNAL = TomcatUIPlugin.PLUGIN_ID + ".tecw0006";
- public static final String CONFIGURATION_EDITOR_WEBMODULES_EDIT = TomcatUIPlugin.PLUGIN_ID + ".tecw0008";
- public static final String CONFIGURATION_EDITOR_WEBMODULES_REMOVE = TomcatUIPlugin.PLUGIN_ID + ".tecw0010";
-
- public static final String CONFIGURATION_EDITOR_WEBMODULE_DIALOG = TomcatUIPlugin.PLUGIN_ID + ".tdwm0000";
- public static final String CONFIGURATION_EDITOR_WEBMODULE_DIALOG_PROJECT = TomcatUIPlugin.PLUGIN_ID + ".tdpr0002";
- public static final String CONFIGURATION_EDITOR_WEBMODULE_DIALOG_PATH = TomcatUIPlugin.PLUGIN_ID + ".tdpr0004";
- public static final String CONFIGURATION_EDITOR_WEBMODULE_DIALOG_DOCBASE = TomcatUIPlugin.PLUGIN_ID + ".tdpr0006";
- public static final String CONFIGURATION_EDITOR_WEBMODULE_DIALOG_RELOAD = TomcatUIPlugin.PLUGIN_ID + ".tdpr0008";
-
- public static final String CONFIGURATION_EDITOR_MAPPINGS = TomcatUIPlugin.PLUGIN_ID + ".tecm0000";
- public static final String CONFIGURATION_EDITOR_MAPPINGS_LIST = TomcatUIPlugin.PLUGIN_ID + ".tecm0002";
- public static final String CONFIGURATION_EDITOR_MAPPINGS_ADD = TomcatUIPlugin.PLUGIN_ID + ".tecm0004";
- public static final String CONFIGURATION_EDITOR_MAPPINGS_EDIT = TomcatUIPlugin.PLUGIN_ID + ".tecm0006";
- public static final String CONFIGURATION_EDITOR_MAPPINGS_REMOVE = TomcatUIPlugin.PLUGIN_ID + ".tecm0008";
-
- public static final String CONFIGURATION_EDITOR_MAPPING_DIALOG = TomcatUIPlugin.PLUGIN_ID + ".tdmm0000";
- public static final String CONFIGURATION_EDITOR_MAPPING_DIALOG_TYPE = TomcatUIPlugin.PLUGIN_ID + ".tdmm0002";
- public static final String CONFIGURATION_EDITOR_MAPPING_DIALOG_EXTENSION = TomcatUIPlugin.PLUGIN_ID + ".tdmm0004";
-
- public static final String CONFIGURATION_EDITOR_PORTS = TomcatUIPlugin.PLUGIN_ID + ".tecp0000";
- public static final String CONFIGURATION_EDITOR_PORTS_LIST = TomcatUIPlugin.PLUGIN_ID + ".tecp0002";
-
- public static final String RUNTIME = TomcatUIPlugin.PLUGIN_ID + ".twnr0000";
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/SWTUtil.java b/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/SWTUtil.java
deleted file mode 100644
index 4a81015..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/SWTUtil.java
+++ /dev/null
@@ -1,55 +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.jst.server.tomcat.ui.internal;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.FontMetrics;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-/**
- * SWT Utility class.
- */
-public class SWTUtil {
- private static FontMetrics fontMetrics;
-
- protected static void initializeDialogUnits(Control testControl) {
- // Compute and store a font metric
- GC gc = new GC(testControl);
- gc.setFont(JFaceResources.getDialogFont());
- fontMetrics = gc.getFontMetrics();
- gc.dispose();
- }
-
- /**
- * Returns a width hint for a button control.
- */
- protected static int getButtonWidthHint(Button button) {
- int widthHint = Dialog.convertHorizontalDLUsToPixels(fontMetrics, IDialogConstants.BUTTON_WIDTH);
- return Math.max(widthHint, button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
- }
-
- public static Button createButton(Composite comp, String label) {
- Button b = new Button(comp, SWT.PUSH);
- b.setText(label);
- if (fontMetrics == null)
- initializeDialogUnits(comp);
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- data.widthHint = getButtonWidthHint(b);
- b.setLayoutData(data);
- return b;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/TomcatLaunchConfigurationTabGroup.java b/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/TomcatLaunchConfigurationTabGroup.java
deleted file mode 100644
index f39cd01..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/TomcatLaunchConfigurationTabGroup.java
+++ /dev/null
@@ -1,46 +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.jst.server.tomcat.ui.internal;
-
-import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup;
-import org.eclipse.debug.ui.CommonTab;
-import org.eclipse.debug.ui.EnvironmentTab;
-import org.eclipse.debug.ui.ILaunchConfigurationDialog;
-import org.eclipse.debug.ui.ILaunchConfigurationTab;
-import org.eclipse.debug.ui.sourcelookup.SourceLookupTab;
-import org.eclipse.jdt.debug.ui.launchConfigurations.JavaArgumentsTab;
-import org.eclipse.jdt.debug.ui.launchConfigurations.JavaClasspathTab;
-
-import org.eclipse.wst.server.ui.ServerLaunchConfigurationTab;
-/**
- *
- */
-public class TomcatLaunchConfigurationTabGroup extends AbstractLaunchConfigurationTabGroup {
- /*
- * @see ILaunchConfigurationTabGroup#createTabs(ILaunchConfigurationDialog, String)
- */
- public void createTabs(ILaunchConfigurationDialog dialog, String mode) {
- ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[6];
- tabs[0] = new ServerLaunchConfigurationTab(new String[] { "org.eclipse.jst.server.tomcat" });
- tabs[0].setLaunchConfigurationDialog(dialog);
- tabs[1] = new JavaArgumentsTab();
- tabs[1].setLaunchConfigurationDialog(dialog);
- tabs[2] = new JavaClasspathTab();
- tabs[2].setLaunchConfigurationDialog(dialog);
- tabs[3] = new SourceLookupTab();
- tabs[3].setLaunchConfigurationDialog(dialog);
- tabs[4] = new EnvironmentTab();
- tabs[4].setLaunchConfigurationDialog(dialog);
- tabs[5] = new CommonTab();
- tabs[5].setLaunchConfigurationDialog(dialog);
- setTabs(tabs);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/TomcatRuntimeComposite.java b/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/TomcatRuntimeComposite.java
deleted file mode 100644
index e68714f..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/TomcatRuntimeComposite.java
+++ /dev/null
@@ -1,281 +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.jst.server.tomcat.ui.internal;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.launching.IVMInstall;
-import org.eclipse.jdt.launching.IVMInstallType;
-import org.eclipse.jdt.launching.JavaRuntime;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.jface.preference.IPreferenceNode;
-import org.eclipse.jface.preference.PreferenceDialog;
-import org.eclipse.jface.preference.PreferenceManager;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jst.server.tomcat.core.internal.ITomcatRuntimeWorkingCopy;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.BusyIndicator;
-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.events.SelectionListener;
-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.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-
-import org.eclipse.wst.server.core.IRuntimeWorkingCopy;
-import org.eclipse.wst.server.ui.wizard.IWizardHandle;
-/**
- * Wizard page to set the server install directory.
- */
-public class TomcatRuntimeComposite extends Composite {
- protected IRuntimeWorkingCopy runtimeWC;
- protected ITomcatRuntimeWorkingCopy runtime;
-
- protected IWizardHandle wizard;
-
- protected Text installDir;
- protected Text name;
- protected Combo combo;
- protected List installedJREs;
- protected String[] jreNames;
- protected int defaultVMIndex;
-
- /**
- * TomcatRuntimeWizardPage constructor comment.
- *
- * @param parent the parent composite
- * @param wizard the wizard handle
- */
- protected TomcatRuntimeComposite(Composite parent, IWizardHandle wizard) {
- super(parent, SWT.NONE);
- this.wizard = wizard;
-
- wizard.setTitle(TomcatUIPlugin.getResource("%wizardTitle"));
- wizard.setDescription(TomcatUIPlugin.getResource("%wizardDescription"));
- wizard.setImageDescriptor(TomcatUIPlugin.getImageDescriptor(TomcatUIPlugin.IMG_WIZ_TOMCAT));
-
- createControl();
- }
-
- protected void setRuntime(IRuntimeWorkingCopy newRuntime) {
- if (newRuntime == null) {
- runtimeWC = null;
- runtime = null;
- } else {
- runtimeWC = newRuntime;
- runtime = (ITomcatRuntimeWorkingCopy) newRuntime.getAdapter(ITomcatRuntimeWorkingCopy.class);
- }
-
- init();
- validate();
- }
-
- /**
- * Provide a wizard page to change the Tomcat installation directory.
- */
- protected void createControl() {
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- setLayout(layout);
- setLayoutData(new GridData(GridData.FILL_BOTH));
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, ContextIds.RUNTIME);
-
- Label label = new Label(this, SWT.NONE);
- label.setText(TomcatUIPlugin.getResource("%runtimeName"));
- GridData data = new GridData();
- data.horizontalSpan = 2;
- label.setLayoutData(data);
-
- name = new Text(this, SWT.BORDER);
- data = new GridData(GridData.FILL_HORIZONTAL);
- name.setLayoutData(data);
- name.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- runtimeWC.setName(name.getText());
- validate();
- }
- });
-
- label = new Label(this, SWT.NONE);
- label.setText(TomcatUIPlugin.getResource("%installDir"));
- data = new GridData();
- data.horizontalSpan = 2;
- label.setLayoutData(data);
-
- installDir = new Text(this, SWT.BORDER);
- data = new GridData(GridData.FILL_HORIZONTAL);
- installDir.setLayoutData(data);
- installDir.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- runtimeWC.setLocation(new Path(installDir.getText()));
- validate();
- }
- });
-
- Button browse = SWTUtil.createButton(this, TomcatUIPlugin.getResource("%browse"));
- browse.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent se) {
- DirectoryDialog dialog = new DirectoryDialog(TomcatRuntimeComposite.this.getShell());
- dialog.setMessage(TomcatUIPlugin.getResource("%selectInstallDir"));
- dialog.setFilterPath(installDir.getText());
- String selectedDirectory = dialog.open();
- if (selectedDirectory != null)
- installDir.setText(selectedDirectory);
- }
- });
-
- updateJREs();
-
- // JDK location
- label = new Label(this, SWT.NONE);
- label.setText(TomcatUIPlugin.getResource("%installedJRE"));
- data = new GridData();
- data.horizontalSpan = 2;
- label.setLayoutData(data);
-
- combo = new Combo(this, SWT.DROP_DOWN | SWT.READ_ONLY);
- combo.setItems(jreNames);
- data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- combo.setLayoutData(data);
-
- combo.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- int sel = combo.getSelectionIndex();
- IVMInstall vmInstall = (IVMInstall) installedJREs.get(sel);
- runtime.setVMInstall(vmInstall);
- validate();
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
- });
-
- Button button = SWTUtil.createButton(this, TomcatUIPlugin.getResource("%installedJREs"));
- button.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- String currentVM = combo.getText();
- if (showPreferencePage()) {
- updateJREs();
- combo.setItems(jreNames);
- combo.setText(currentVM);
- if (combo.getSelectionIndex() == -1)
- combo.select(defaultVMIndex);
- }
- }
- });
-
- init();
- validate();
-
- Dialog.applyDialogFont(this);
-
- name.forceFocus();
- }
-
- protected void updateJREs() {
- // get all installed JVMs
- installedJREs = new ArrayList();
- IVMInstallType[] vmInstallTypes = JavaRuntime.getVMInstallTypes();
- int size = vmInstallTypes.length;
- for (int i = 0; i < size; i++) {
- IVMInstall[] vmInstalls = vmInstallTypes[i].getVMInstalls();
- int size2 = vmInstalls.length;
- for (int j = 0; j < size2; j++) {
- installedJREs.add(vmInstalls[j]);
- }
- }
-
- // get names
- size = installedJREs.size();
- jreNames = new String[size];
- for (int i = 0; i < size; i++) {
- IVMInstall vmInstall = (IVMInstall) installedJREs.get(i);
- jreNames[i] = vmInstall.getName();
- }
-
- IVMInstall defaultVM = JavaRuntime.getDefaultVMInstall();
- defaultVMIndex = installedJREs.indexOf(defaultVM);
- }
-
- protected boolean showPreferencePage() {
- PreferenceManager manager = PlatformUI.getWorkbench().getPreferenceManager();
- IPreferenceNode node = manager.find("org.eclipse.jdt.ui.preferences.JavaBasePreferencePage").findSubNode("org.eclipse.jdt.debug.ui.preferences.VMPreferencePage");
- PreferenceManager manager2 = new PreferenceManager();
- manager2.addToRoot(node);
- final PreferenceDialog dialog = new PreferenceDialog(getShell(), manager2);
- final boolean[] result = new boolean[] { false };
- BusyIndicator.showWhile(getDisplay(), new Runnable() {
- public void run() {
- dialog.create();
- if (dialog.open() == Window.OK)
- result[0] = true;
- }
- });
- return result[0];
- }
-
- protected void init() {
- if (name == null || runtime == null)
- return;
-
- if (runtimeWC.getName() != null)
- name.setText(runtimeWC.getName());
- else
- name.setText("");
-
- if (runtimeWC.getLocation() != null)
- installDir.setText(runtimeWC.getLocation().toOSString());
- else
- installDir.setText("");
-
- // set selection
- boolean found = false;
- int size = installedJREs.size();
- for (int i = 0; i < size; i++) {
- IVMInstall vmInstall = (IVMInstall) installedJREs.get(i);
- if (vmInstall.equals(runtime.getVMInstall())) {
- combo.select(i);
- found = true;
- }
- }
- if (!found)
- combo.select(defaultVMIndex);
- }
-
- protected void validate() {
- if (runtime == null) {
- wizard.setMessage("", IMessageProvider.ERROR);
- return;
- }
-
- IStatus status = runtimeWC.validate(null);
- if (status == null || status.isOK())
- wizard.setMessage(null, IMessageProvider.NONE);
- else if (status.getSeverity() == IStatus.WARNING)
- wizard.setMessage(status.getMessage(), IMessageProvider.WARNING);
- else
- wizard.setMessage(status.getMessage(), IMessageProvider.ERROR);
- wizard.update();
- }
-}
\ No newline at end of file
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
deleted file mode 100644
index 4bf8c3f..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/TomcatRuntimeWizardFragment.java
+++ /dev/null
@@ -1,66 +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.jst.server.tomcat.ui.internal;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jst.server.tomcat.core.internal.TomcatPlugin;
-import org.eclipse.swt.widgets.Composite;
-
-import org.eclipse.wst.server.core.IRuntimeWorkingCopy;
-import org.eclipse.wst.server.core.TaskModel;
-import org.eclipse.wst.server.ui.wizard.IWizardHandle;
-import org.eclipse.wst.server.ui.wizard.WizardFragment;
-/**
- *
- */
-public class TomcatRuntimeWizardFragment extends WizardFragment {
- protected TomcatRuntimeComposite comp;
-
- public TomcatRuntimeWizardFragment() {
- // do nothing
- }
-
- 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);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.server.ui.task.WizardFragment#createComposite()
- */
- public Composite createComposite(Composite parent, IWizardHandle wizard) {
- comp = new TomcatRuntimeComposite(parent, wizard);
- return comp;
- }
-
- public void enter() {
- if (comp != null) {
- IRuntimeWorkingCopy runtime = (IRuntimeWorkingCopy) getTaskModel().getObject(TaskModel.TASK_RUNTIME);
- comp.setRuntime(runtime);
- }
- }
-
- public void exit() {
- IRuntimeWorkingCopy runtime = (IRuntimeWorkingCopy) getTaskModel().getObject(TaskModel.TASK_RUNTIME);
- IPath path = runtime.getLocation();
- if (runtime.validate(null).isOK())
- TomcatPlugin.setPreference("location" + runtime.getRuntimeType().getId(), path.toString());
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/TomcatUIPlugin.java b/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/TomcatUIPlugin.java
deleted file mode 100644
index a1d297b..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/TomcatUIPlugin.java
+++ /dev/null
@@ -1,191 +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.jst.server.tomcat.ui.internal;
-
-import java.net.URL;
-import java.text.MessageFormat;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-/**
- * The actual Tomcat plugin. It allows the rest of the classes
- * to load images and get a handle to the desktop.
- */
-public class TomcatUIPlugin extends AbstractUIPlugin {
- protected static TomcatUIPlugin singleton;
-
- protected Map imageDescriptors = new HashMap();
-
- // base url for icons
- private static URL ICON_BASE_URL;
-
- private static final String URL_OBJ = "obj16/";
- private static final String URL_WIZBAN = "wizban/";
-
- public static final String PLUGIN_ID = "org.eclipse.tomcat";
-
- public static final String IMG_WIZ_TOMCAT = "wizTomcat";
-
- public static final String IMG_WEB_MODULE = "webModule";
- public static final String IMG_MIME_MAPPING = "mimeMapping";
- public static final String IMG_MIME_EXTENSION = "mimeExtension";
- public static final String IMG_PORT = "port";
- public static final String IMG_PROJECT_MISSING = "projectMissing";
-
- public static final String PREF_TOMCAT32_INSTALL_DIR = "tomcat32install";
- public static final String PREF_TOMCAT40_INSTALL_DIR = "tomcat40install";
- public static final String PREF_TOMCAT41_INSTALL_DIR = "tomcat41install";
- public static final String PREF_TOMCAT50_INSTALL_DIR = "tomcat50install";
- public static final String PREF_JDK_INSTALL_DIR = "jdkinstall";
-
- /**
- * TomcatUIPlugin constructor comment.
- */
- public TomcatUIPlugin() {
- super();
- singleton = this;
- }
-
- protected ImageRegistry createImageRegistry() {
- ImageRegistry registry = new ImageRegistry();
-
- registerImage(registry, IMG_WIZ_TOMCAT, URL_WIZBAN + "tomcat_wiz.gif");
-
- registerImage(registry, IMG_WEB_MODULE, URL_OBJ + "web_module.gif");
- registerImage(registry, IMG_MIME_MAPPING, URL_OBJ + "mime_mapping.gif");
- registerImage(registry, IMG_MIME_EXTENSION, URL_OBJ + "mime_extension.gif");
- registerImage(registry, IMG_PORT, URL_OBJ + "port.gif");
- registerImage(registry, IMG_PROJECT_MISSING, URL_OBJ + "project_missing.gif");
-
- return registry;
- }
-
- /**
- * Return the image with the given key from the image registry.
- * @param key java.lang.String
- * @return org.eclipse.jface.parts.IImage
- */
- public static Image getImage(String key) {
- return getInstance().getImageRegistry().get(key);
- }
-
- /**
- * Return the image with the given key from the image registry.
- * @param key java.lang.String
- * @return org.eclipse.jface.parts.IImage
- */
- public static ImageDescriptor getImageDescriptor(String key) {
- try {
- getInstance().getImageRegistry();
- return (ImageDescriptor) getInstance().imageDescriptors.get(key);
- } catch (Exception e) {
- return null;
- }
- }
-
- /**
- * Returns the singleton instance of this plugin.
- * @return org.eclipse.jst.server.tomcat.internal.TomcatUIPlugin
- */
- public static TomcatUIPlugin getInstance() {
- return singleton;
- }
-
- /**
- * Convenience method for logging.
- *
- * @param status org.eclipse.core.runtime.IStatus
- */
- public static void log(IStatus status) {
- getInstance().getLog().log(status);
- }
-
- /**
- * Returns the translated String found with the given key.
- *
- * @param key a key
- * @return a translated string
- */
- public static String getResource(String key) {
- try {
- return Platform.getResourceString(getInstance().getBundle(), key);
- } catch (Exception e) {
- return key;
- }
- }
-
- /**
- * Returns the translated String found with the given key,
- * and formatted with the given object.
- *
- * @param key a key
- * @param obj substitution arguments
- * @return a translated string
- */
- public static String getResource(String key, Object[] obj) {
- try {
- return MessageFormat.format(getResource(key), obj);
- } catch (Exception e) {
- return key;
- }
- }
-
- /**
- * Returns the translated String found with the given key,
- * and formatted with the given object.
- *
- * @param key a key
- * @param arg an argument
- * @return a translated string
- */
- public static String getResource(String key, String arg) {
- return getResource(key, new String[] { arg });
- }
-
- /**
- * Returns the translated String found with the given key,
- * and formatted with the given object.
- *
- * @param key a key
- * @param arg1 an argument
- * @param arg2 another argument
- * @return a translated string
- */
- public static String getResource(String key, String arg1, String arg2) {
- return getResource(key, new String[] { arg1, arg2 });
- }
-
- /**
- * Register an image with the registry.
- * @param key java.lang.String
- * @param partialURL java.lang.String
- */
- private void registerImage(ImageRegistry registry, String key, String partialURL) {
- if (ICON_BASE_URL == null) {
- String pathSuffix = "icons/";
- ICON_BASE_URL = singleton.getBundle().getEntry(pathSuffix);
- }
-
- try {
- ImageDescriptor id = ImageDescriptor.createFromURL(new URL(ICON_BASE_URL, partialURL));
- registry.put(key, id);
- imageDescriptors.put(key, id);
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Error registering image", e);
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/Trace.java b/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/Trace.java
deleted file mode 100644
index 6244aab..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/Trace.java
+++ /dev/null
@@ -1,52 +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.jst.server.tomcat.ui.internal;
-/**
- * Helper class to route trace output.
- */
-public class Trace {
- public static byte CONFIG = 0;
- public static byte WARNING = 1;
- public static byte SEVERE = 2;
- public static byte FINEST = 3;
- public static byte FINER = 4;
-
- /**
- * Trace constructor comment.
- */
- private Trace() {
- super();
- }
-
- /**
- * Trace the given text.
- *
- * @param s java.lang.String
- */
- public static void trace(byte level, String s) {
- Trace.trace(level, s, null);
- }
-
- /**
- * Trace the given message and exception.
- *
- * @param s java.lang.String
- * @param t java.lang.Throwable
- */
- public static void trace(byte level, String s, Throwable t) {
- if (!TomcatUIPlugin.getInstance().isDebugging())
- return;
-
- System.out.println(s);
- if (t != null)
- t.printStackTrace();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/ConfigurationMimeEditorSection.java b/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/ConfigurationMimeEditorSection.java
deleted file mode 100644
index 3a88ff1..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/ConfigurationMimeEditorSection.java
+++ /dev/null
@@ -1,419 +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.jst.server.tomcat.ui.internal.editor;
-
-import java.beans.*;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.wst.server.ui.editor.*;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jst.server.tomcat.core.internal.MimeMapping;
-import org.eclipse.jst.server.tomcat.core.internal.TomcatConfiguration;
-import org.eclipse.jst.server.tomcat.core.internal.TomcatServer;
-import org.eclipse.jst.server.tomcat.core.internal.command.*;
-import org.eclipse.jst.server.tomcat.ui.internal.ContextIds;
-import org.eclipse.jst.server.tomcat.ui.internal.TomcatUIPlugin;
-import org.eclipse.ui.*;
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.ui.forms.widgets.Section;
-import org.eclipse.ui.help.IWorkbenchHelpSystem;
-/**
- * Tomcat configuration mime editor section.
- */
-public class ConfigurationMimeEditorSection extends ServerEditorSection {
- protected TomcatConfiguration tomcatConfiguration;
-
- protected boolean updating;
-
- protected PropertyChangeListener listener;
-
- protected Tree mimeTypes;
- protected int index = -1;
- protected List mappings;
- protected Button add;
- protected Button remove;
- protected Button edit;
-
- /**
- * ConfigurationMimeEditorSection constructor comment.
- */
- protected ConfigurationMimeEditorSection() {
- super();
- }
-
- /**
- *
- */
- protected void addChangeListener() {
- listener = new PropertyChangeListener() {
- public void propertyChange(PropertyChangeEvent event) {
- if (TomcatConfiguration.ADD_MAPPING_PROPERTY.equals(event.getPropertyName())) {
- Integer in = (Integer) event.getOldValue();
- MimeMapping mapping = (MimeMapping) event.getNewValue();
- addMimeMapping(in.intValue(), mapping);
- } else if (TomcatConfiguration.REMOVE_MAPPING_PROPERTY.equals(event.getPropertyName())) {
- Integer in = (Integer) event.getNewValue();
- removeMimeMapping(in.intValue());
- } else if (TomcatConfiguration.MODIFY_MAPPING_PROPERTY.equals(event.getPropertyName())) {
- Integer in = (Integer) event.getOldValue();
- MimeMapping mapping = (MimeMapping) event.getNewValue();
- modifyMimeMapping(in.intValue(), mapping);
- }
- }
- };
- tomcatConfiguration.addPropertyChangeListener(listener);
- }
-
- public void createSection(Composite parent) {
- super.createSection(parent);
-
- FormToolkit toolkit = getFormToolkit(parent.getDisplay());
-
- Section section = toolkit.createSection(parent, ExpandableComposite.TWISTIE | ExpandableComposite.TITLE_BAR
- | Section.DESCRIPTION | ExpandableComposite.FOCUS_TITLE);
- section.setText(TomcatUIPlugin.getResource("%configurationEditorMimeMappingsSection"));
- section.setDescription(TomcatUIPlugin.getResource("%configurationEditorMimeMappingsDescription"));
- section.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL));
-
- Composite composite = toolkit.createComposite(section);
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- layout.marginHeight = 5;
- layout.marginWidth = 10;
- layout.verticalSpacing = 5;
- layout.horizontalSpacing = 15;
- composite.setLayout(layout);
- GridData data = new GridData(GridData.FILL_BOTH);
- composite.setLayoutData(data);
- IWorkbenchHelpSystem whs = PlatformUI.getWorkbench().getHelpSystem();
- whs.setHelp(composite, ContextIds.CONFIGURATION_EDITOR_MAPPINGS);
- toolkit.paintBordersFor(composite);
- section.setClient(composite);
-
- mimeTypes = toolkit.createTree(composite, SWT.V_SCROLL | SWT.SINGLE | SWT.H_SCROLL);
- data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL);
- data.widthHint = 220;
- data.heightHint = 200;
- mimeTypes.setLayoutData(data);
- whs.setHelp(mimeTypes, ContextIds.CONFIGURATION_EDITOR_MAPPINGS_LIST);
-
- // add listener to the table
- mimeTypes.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- selectMimeMapping();
- }
- });
-
- Composite buttonComp = toolkit.createComposite(composite);
- layout = new GridLayout();
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- buttonComp.setLayout(layout);
- buttonComp.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING | GridData.HORIZONTAL_ALIGN_BEGINNING));
-
- add = toolkit.createButton(buttonComp, TomcatUIPlugin.getResource("%editorAdd"), SWT.PUSH);
- data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- data.widthHint = 75;
- add.setLayoutData(data);
-
- add.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- MimeMappingDialog dialog = new MimeMappingDialog(getShell());
- dialog.open();
- if (dialog.getReturnCode() == IDialogConstants.OK_ID) {
- commandManager.executeCommand(new AddMimeMappingCommand(tomcatConfiguration, dialog.getMimeMapping()));
- }
- }
- });
- whs.setHelp(add, ContextIds.CONFIGURATION_EDITOR_MAPPINGS_ADD);
-
- edit = toolkit.createButton(buttonComp, TomcatUIPlugin.getResource("%editorEdit"), SWT.PUSH);
- data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- data.widthHint = 75;
- edit.setLayoutData(data);
- edit.setEnabled(false);
-
- edit.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- if (index < 0)
- return;
- MimeMappingDialog dialog = new MimeMappingDialog(getShell(), (MimeMapping) tomcatConfiguration.getMimeMappings().get(index));
- dialog.open();
- if (dialog.getReturnCode() == IDialogConstants.OK_ID) {
- commandManager.executeCommand(new ModifyMimeMappingCommand(tomcatConfiguration, index, dialog.getMimeMapping()));
- }
- }
- });
- whs.setHelp(edit, ContextIds.CONFIGURATION_EDITOR_MAPPINGS_EDIT);
-
- remove = toolkit.createButton(buttonComp, TomcatUIPlugin.getResource("%editorRemove"), SWT.PUSH);
- data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- data.widthHint = 75;
- remove.setLayoutData(data);
- remove.setEnabled(false);
-
- remove.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- if (index < 0)
- return;
- commandManager.executeCommand(new RemoveMimeMappingCommand(tomcatConfiguration, index));
- index = -1;
- edit.setEnabled(false);
- remove.setEnabled(false);
- }
- });
- whs.setHelp(remove, ContextIds.CONFIGURATION_EDITOR_MAPPINGS_REMOVE);
-
- initialize();
- }
-
- public void dispose() {
- if (tomcatConfiguration != null)
- tomcatConfiguration.removePropertyChangeListener(listener);
- }
-
- public void init(IEditorSite site, IEditorInput input) {
- super.init(site, input);
-
- TomcatServer ts = (TomcatServer) server.getAdapter(TomcatServer.class);
- try {
- tomcatConfiguration = ts.getTomcatConfiguration();
- } catch (Exception e) {
- // ignore
- }
- addChangeListener();
- initialize();
- }
-
- /**
- * Initialize the fields in this editor.
- */
- protected void initialize() {
- if (mimeTypes == null)
- return;
-
- mimeTypes.removeAll();
-
- mappings = tomcatConfiguration.getMimeMappings();
-
- // sort mappings
- int size = mappings.size();
- int[] map = new int[size];
- for (int i = 0; i < size; i++)
- map[i] = i;
-
- for (int i = 0; i < size - 1; i++) {
- for (int j = i + 1; j < size; j++) {
- MimeMapping mappingA = (MimeMapping) mappings.get(map[i]);
- MimeMapping mappingB = (MimeMapping) mappings.get(map[j]);
- if (mappingA.getMimeType().compareTo(mappingB.getMimeType()) > 0 ||
- ((mappingA.getMimeType().equals(mappingB.getMimeType())) &&
- mappingA.getExtension().compareTo(mappingB.getExtension()) > 0)) {
- int temp = map[i];
- map[i] = map[j];
- map[j] = temp;
- }
- }
- }
-
- // display them
- Map hash = new HashMap();
-
- for (int i = 0; i < size; i++) {
- MimeMapping mapping = (MimeMapping) mappings.get(map[i]);
- // get parent node
- TreeItem parent = (TreeItem) hash.get(mapping.getMimeType());
- if (parent == null) {
- parent = new TreeItem(mimeTypes, SWT.NONE);
- parent.setText(mapping.getMimeType());
- parent.setImage(TomcatUIPlugin.getImage(TomcatUIPlugin.IMG_MIME_MAPPING));
- hash.put(mapping.getMimeType(), parent);
- }
-
- // add node
- TreeItem item = new TreeItem(parent, SWT.NONE);
- item.setText(mapping.getExtension());
- item.setImage(TomcatUIPlugin.getImage(TomcatUIPlugin.IMG_MIME_EXTENSION));
- item.setData(new Integer(map[i]));
- }
-
- if (readOnly) {
- add.setEnabled(false);
- edit.setEnabled(false);
- remove.setEnabled(false);
- } else {
- add.setEnabled(true);
- selectMimeMapping();
- }
- }
-
- /**
- * Add a mime mapping.
- *
- * @param index2
- * @param map
- */
- protected void addMimeMapping(int index2, MimeMapping map) {
- mappings.add(index2, map);
-
- // correct all index numbers
- int size = mimeTypes.getItemCount();
- TreeItem[] parents = mimeTypes.getItems();
- for (int i = 0; i < size; i++) {
- TreeItem parent = parents[i];
-
- int size2 = parent.getItemCount();
- TreeItem[] children = parent.getItems();
- for (int j = 0; j < size2; j++) {
- Integer in = (Integer) children[j].getData();
- if (in.intValue() >= index2)
- children[j].setData(new Integer(in.intValue() + 1));
- }
- }
-
- // check if there is a parent. If so, just add a new child
- for (int i = 0; i < size; i++) {
- TreeItem parent = parents[i];
- if (parent.getText().equals(map.getMimeType())) {
- TreeItem item = new TreeItem(parent, SWT.NONE);
- item.setText(map.getExtension());
- item.setImage(TomcatUIPlugin.getImage(TomcatUIPlugin.IMG_MIME_EXTENSION));
- item.setData(new Integer(index2));
- mimeTypes.showItem(item);
- return;
- }
- }
-
- // if not, add a new parent and child to the end
- TreeItem parent = new TreeItem(mimeTypes, SWT.NONE);
- parent.setText(map.getMimeType());
- parent.setImage(TomcatUIPlugin.getImage(TomcatUIPlugin.IMG_MIME_MAPPING));
-
- TreeItem item = new TreeItem(parent, SWT.NONE);
- item.setText(map.getExtension());
- item.setImage(TomcatUIPlugin.getImage(TomcatUIPlugin.IMG_MIME_EXTENSION));
- item.setData(new Integer(index2));
- mimeTypes.showItem(item);
- }
-
- /**
- *
- * @param index2
- * @param map
- */
- protected void modifyMimeMapping(int index2, MimeMapping map) {
- MimeMapping oldMap = (MimeMapping) mappings.get(index2);
- mappings.set(index2, map);
-
- int size = mimeTypes.getItemCount();
- TreeItem[] parents = mimeTypes.getItems();
-
- if (oldMap.getMimeType().equals(map.getMimeType())) {
- for (int i = 0; i < size; i++) {
- TreeItem parent = parents[i];
-
- if (parent.getText().equals(map.getMimeType())) {
- int size2 = parent.getItemCount();
- TreeItem[] children = parent.getItems();
- for (int j = 0; j < size2; j++) {
- Integer in = (Integer) children[j].getData();
- if (in.intValue() == index2) {
- children[j].setText(map.getExtension());
- children[j].setData(new Integer(index2));
- mimeTypes.showItem(children[j]);
- return;
- }
- }
- }
- }
- return;
- }
-
- // otherwise, let's try a remove and an add
- removeMimeMapping(index2);
- addMimeMapping(index2, map);
- }
-
- /**
- * Remove the mime mapping at the given index.
- *
- * @param index2
- */
- protected void removeMimeMapping(int index2) {
- mappings.remove(index2);
-
- // remove item
- int size = mimeTypes.getItemCount();
- TreeItem[] parents = mimeTypes.getItems();
- for (int i = 0; i < size; i++) {
- TreeItem parent = parents[i];
-
- int size2 = parent.getItemCount();
- TreeItem[] children = parent.getItems();
- for (int j = 0; j < size2; j++) {
- Integer in = (Integer) children[j].getData();
- if (in.intValue() == index2) {
- children[j].dispose();
- if (size2 == 1)
- parent.dispose();
- i += size;
- j += size2;
- }
- }
- }
-
- // correct all index numbers
- size = mimeTypes.getItemCount();
- parents = mimeTypes.getItems();
- for (int i = 0; i < size; i++) {
- TreeItem parent = parents[i];
-
- int size2 = parent.getItemCount();
- TreeItem[] children = parent.getItems();
- for (int j = 0; j < size2; j++) {
- Integer in = (Integer) children[j].getData();
- if (in.intValue() > index2)
- children[j].setData(new Integer(in.intValue() - 1));
- }
- }
- }
-
- /**
- *
- */
- protected void selectMimeMapping() {
- if (readOnly)
- return;
-
- try {
- TreeItem item = mimeTypes.getSelection()[0];
- Integer in = (Integer) item.getData();
- index = in.intValue();
-
- remove.setEnabled(true);
- edit.setEnabled(true);
- } catch (Exception e) {
- index = -1;
- remove.setEnabled(false);
- edit.setEnabled(false);
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/ConfigurationMimeEditorSectionFactory.java b/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/ConfigurationMimeEditorSectionFactory.java
deleted file mode 100644
index 4c0385c..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/ConfigurationMimeEditorSectionFactory.java
+++ /dev/null
@@ -1,39 +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.jst.server.tomcat.ui.internal.editor;
-
-import org.eclipse.jst.server.tomcat.core.internal.ITomcatServer;
-import org.eclipse.jst.server.tomcat.core.internal.TomcatServer;
-import org.eclipse.wst.server.core.IServerWorkingCopy;
-import org.eclipse.wst.server.ui.editor.*;
-/**
- *
- */
-public class ConfigurationMimeEditorSectionFactory extends ServerEditorPageSectionFactoryDelegate {
- /*
- * @see ServerEditorPartFactoryDelegate#shouldDisplay(IServer)
- */
- public boolean shouldCreateSection(IServerWorkingCopy server) {
- TomcatServer tomcatServer = (TomcatServer) server.getAdapter(ITomcatServer.class);
- try {
- return tomcatServer.getServerConfiguration() != null;
- } catch (Exception e) {
- return false;
- }
- }
-
- /*
- * @see ServerEditorPartFactoryDelegate#createPage()
- */
- public IServerEditorSection createSection() {
- return new ConfigurationMimeEditorSection();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/ConfigurationPortEditorSection.java b/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/ConfigurationPortEditorSection.java
deleted file mode 100644
index 9dd7b8c..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/ConfigurationPortEditorSection.java
+++ /dev/null
@@ -1,248 +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.jst.server.tomcat.ui.internal.editor;
-
-import java.beans.*;
-import java.util.Iterator;
-
-import org.eclipse.wst.server.core.IServerPort;
-import org.eclipse.wst.server.core.util.ServerPort;
-import org.eclipse.wst.server.ui.editor.*;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Item;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.jst.server.tomcat.core.internal.TomcatConfiguration;
-import org.eclipse.jst.server.tomcat.core.internal.TomcatServer;
-import org.eclipse.jst.server.tomcat.core.internal.command.*;
-import org.eclipse.jst.server.tomcat.ui.internal.ContextIds;
-import org.eclipse.jst.server.tomcat.ui.internal.TomcatUIPlugin;
-import org.eclipse.ui.*;
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.ui.forms.widgets.Section;
-import org.eclipse.ui.help.IWorkbenchHelpSystem;
-/**
- * Tomcat configuration port editor page.
- */
-public class ConfigurationPortEditorSection extends ServerEditorSection {
- protected TomcatConfiguration tomcatConfiguration;
-
- protected boolean updating;
-
- protected Table ports;
- protected TableViewer viewer;
-
- protected PropertyChangeListener listener;
-
- /**
- * ConfigurationPortEditorSection constructor comment.
- */
- protected ConfigurationPortEditorSection() {
- super();
- }
-
- /**
- *
- */
- protected void addChangeListener() {
- listener = new PropertyChangeListener() {
- public void propertyChange(PropertyChangeEvent event) {
- if (TomcatConfiguration.MODIFY_PORT_PROPERTY.equals(event.getPropertyName())) {
- String id = (String) event.getOldValue();
- Integer i = (Integer) event.getNewValue();
- changePortNumber(id, i.intValue());
- }
- }
- };
- tomcatConfiguration.addPropertyChangeListener(listener);
- }
-
- /**
- *
- * @param id java.lang.String
- * @param port int
- */
- protected void changePortNumber(String id, int port) {
- TableItem[] items = ports.getItems();
- int size = items.length;
- for (int i = 0; i < size; i++) {
- IServerPort sp = (IServerPort) items[i].getData();
- if (sp.getId().equals(id)) {
- items[i].setData(new ServerPort(id, sp.getName(), port, sp.getProtocol()));
- items[i].setText(1, port + "");
- /*if (i == selection) {
- selectPort();
- }*/
- return;
- }
- }
- }
-
- /**
- * Creates the SWT controls for this workbench part.
- *
- * @param parent the parent control
- */
- public void createSection(Composite parent) {
- super.createSection(parent);
- FormToolkit toolkit = getFormToolkit(parent.getDisplay());
-
- Section section = toolkit.createSection(parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED
- | ExpandableComposite.TITLE_BAR | Section.DESCRIPTION | ExpandableComposite.FOCUS_TITLE);
- section.setText(TomcatUIPlugin.getResource("%configurationEditorPortsSection"));
- section.setDescription(TomcatUIPlugin.getResource("%configurationEditorPortsDescription"));
- section.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL));
-
- // ports
- Composite composite = toolkit.createComposite(section);
- GridLayout layout = new GridLayout();
- layout.marginHeight = 8;
- layout.marginWidth = 8;
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.FILL_HORIZONTAL));
- IWorkbenchHelpSystem whs = PlatformUI.getWorkbench().getHelpSystem();
- whs.setHelp(composite, ContextIds.CONFIGURATION_EDITOR_PORTS);
- toolkit.paintBordersFor(composite);
- section.setClient(composite);
-
- ports = toolkit.createTable(composite, SWT.V_SCROLL | SWT.H_SCROLL | SWT.FULL_SELECTION);
- ports.setHeaderVisible(true);
- ports.setLinesVisible(true);
- whs.setHelp(ports, ContextIds.CONFIGURATION_EDITOR_PORTS_LIST);
-
- TableLayout tableLayout = new TableLayout();
-
- TableColumn col = new TableColumn(ports, SWT.NONE);
- col.setText(TomcatUIPlugin.getResource("%configurationEditorPortNameColumn"));
- ColumnWeightData colData = new ColumnWeightData(15, 150, true);
- tableLayout.addColumnData(colData);
-
- col = new TableColumn(ports, SWT.NONE);
- col.setText(TomcatUIPlugin.getResource("%configurationEditorPortValueColumn"));
- colData = new ColumnWeightData(8, 80, true);
- tableLayout.addColumnData(colData);
-
- GridData data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL);
- data.widthHint = 230;
- data.heightHint = 100;
- ports.setLayoutData(data);
- ports.setLayout(tableLayout);
-
- viewer = new TableViewer(ports);
- viewer.setColumnProperties(new String[] {"name", "port"});
-
- initialize();
- }
-
- protected void setupPortEditors() {
- viewer.setCellEditors(new CellEditor[] {null, new TextCellEditor(ports)});
-
- ICellModifier cellModifier = new ICellModifier() {
- public Object getValue(Object element, String property) {
- IServerPort sp = (IServerPort) element;
- if (sp.getPort() < 0)
- return "-";
- return sp.getPort() + "";
- }
-
- public boolean canModify(Object element, String property) {
- if ("port".equals(property))
- return true;
-
- return false;
- }
-
- public void modify(Object element, String property, Object value) {
- try {
- Item item = (Item) element;
- IServerPort sp = (IServerPort) item.getData();
- int port = Integer.parseInt((String) value);
- commandManager.executeCommand(new ModifyPortCommand(tomcatConfiguration, sp.getId(), port));
- } catch (Exception ex) {
- // ignore
- }
- }
- };
- viewer.setCellModifier(cellModifier);
-
- // preselect second column (Windows-only)
- String os = System.getProperty("os.name");
- if (os != null && os.toLowerCase().indexOf("win") >= 0) {
- ports.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent event) {
- try {
- int n = ports.getSelectionIndex();
- viewer.editElement(ports.getItem(n).getData(), 1);
- } catch (Exception e) {
- // ignore
- }
- }
- });
- }
- }
-
- public void dispose() {
- if (tomcatConfiguration != null)
- tomcatConfiguration.removePropertyChangeListener(listener);
- }
-
- /* (non-Javadoc)
- * Initializes the editor part with a site and input.
- */
- public void init(IEditorSite site, IEditorInput input) {
- super.init(site, input);
-
- TomcatServer ts = (TomcatServer) server.getAdapter(TomcatServer.class);
- try {
- tomcatConfiguration = ts.getTomcatConfiguration();
- } catch (Exception e) {
- // ignore
- }
- addChangeListener();
- initialize();
- }
-
- /**
- * Initialize the fields in this editor.
- */
- protected void initialize() {
- if (ports == null)
- return;
-
- ports.removeAll();
-
- Iterator iterator = tomcatConfiguration.getServerPorts().iterator();
- while (iterator.hasNext()) {
- IServerPort port = (IServerPort) iterator.next();
- TableItem item = new TableItem(ports, SWT.NONE);
- String portStr = "-";
- if (port.getPort() >= 0)
- portStr = port.getPort() + "";
- String[] s = new String[] {port.getName(), portStr};
- item.setText(s);
- item.setImage(TomcatUIPlugin.getImage(TomcatUIPlugin.IMG_PORT));
- item.setData(port);
- }
-
- if (readOnly) {
- viewer.setCellEditors(new CellEditor[] {null, null});
- viewer.setCellModifier(null);
- } else {
- setupPortEditors();
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/ConfigurationPortEditorSectionFactory.java b/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/ConfigurationPortEditorSectionFactory.java
deleted file mode 100644
index a01bb98..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/ConfigurationPortEditorSectionFactory.java
+++ /dev/null
@@ -1,38 +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.jst.server.tomcat.ui.internal.editor;
-
-import org.eclipse.jst.server.tomcat.core.internal.TomcatServer;
-import org.eclipse.wst.server.core.IServerWorkingCopy;
-import org.eclipse.wst.server.ui.editor.*;
-/**
- *
- */
-public class ConfigurationPortEditorSectionFactory extends ServerEditorPageSectionFactoryDelegate {
- /*
- * @see ServerEditorPartFactoryDelegate#shouldDisplay(IServer)
- */
- public boolean shouldCreateSection(IServerWorkingCopy server) {
- TomcatServer tomcatServer = (TomcatServer) server.getAdapter(TomcatServer.class);
- try {
- return tomcatServer.getServerConfiguration() != null;
- } catch (Exception e) {
- return false;
- }
- }
-
- /*
- * @see ServerEditorPartFactoryDelegate#createPage()
- */
- public IServerEditorSection createSection() {
- return new ConfigurationPortEditorSection();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/ConfigurationWebModuleEditorFactory.java b/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/ConfigurationWebModuleEditorFactory.java
deleted file mode 100644
index df44e7f..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/ConfigurationWebModuleEditorFactory.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.jst.server.tomcat.ui.internal.editor;
-
-import org.eclipse.jst.server.tomcat.core.internal.TomcatServer;
-import org.eclipse.ui.IEditorPart;
-
-import org.eclipse.wst.server.core.IServerWorkingCopy;
-import org.eclipse.wst.server.ui.editor.ServerEditorPartFactoryDelegate;
-/**
- *
- */
-public class ConfigurationWebModuleEditorFactory extends ServerEditorPartFactoryDelegate {
- /*
- * @see ServerEditorPartFactoryDelegate#shouldDisplay(IServer)
- */
- public boolean shouldCreatePage(IServerWorkingCopy server) {
- TomcatServer tomcatServer = (TomcatServer) server.getAdapter(TomcatServer.class);
- try {
- return tomcatServer.getServerConfiguration() != null;
- } catch (Exception e) {
- return false;
- }
- }
-
- /*
- * @see ServerEditorPartFactoryDelegate#createPage()
- */
- public IEditorPart createPage() {
- return new ConfigurationWebModuleEditorPart();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/ConfigurationWebModuleEditorPart.java b/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/ConfigurationWebModuleEditorPart.java
deleted file mode 100644
index fe40aaa..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/ConfigurationWebModuleEditorPart.java
+++ /dev/null
@@ -1,373 +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.jst.server.tomcat.ui.internal.editor;
-
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jst.server.core.IWebModule;
-import org.eclipse.jst.server.tomcat.core.internal.ITomcatServerWorkingCopy;
-import org.eclipse.jst.server.tomcat.core.internal.TomcatConfiguration;
-import org.eclipse.jst.server.tomcat.core.internal.TomcatServer;
-import org.eclipse.jst.server.tomcat.core.internal.WebModule;
-import org.eclipse.jst.server.tomcat.core.internal.command.AddWebModuleCommand;
-import org.eclipse.jst.server.tomcat.core.internal.command.ModifyWebModuleCommand;
-import org.eclipse.jst.server.tomcat.core.internal.command.RemoveWebModuleCommand;
-import org.eclipse.jst.server.tomcat.ui.internal.ContextIds;
-import org.eclipse.jst.server.tomcat.ui.internal.TomcatUIPlugin;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.ui.forms.widgets.ScrolledForm;
-import org.eclipse.ui.forms.widgets.Section;
-import org.eclipse.ui.help.IWorkbenchHelpSystem;
-
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.ServerUtil;
-import org.eclipse.wst.server.ui.ServerUICore;
-import org.eclipse.wst.server.ui.editor.ICommandManager;
-import org.eclipse.wst.server.ui.editor.ServerEditorPart;
-/**
- * Tomcat configuration web module editor page.
- */
-public class ConfigurationWebModuleEditorPart extends ServerEditorPart {
- protected ITomcatServerWorkingCopy server2;
- protected TomcatConfiguration configuration;
-
- protected Table webAppTable;
- protected int selection = -1;
- protected Button addProject;
- protected Button addExtProject;
- protected Button remove;
- protected Button edit;
-
- protected PropertyChangeListener listener;
-
- /**
- * ConfigurationWebModuleEditorPart constructor comment.
- */
- protected ConfigurationWebModuleEditorPart() {
- super();
- }
-
- /**
- *
- */
- protected void addChangeListener() {
- listener = new PropertyChangeListener() {
- public void propertyChange(PropertyChangeEvent event) {
- if (TomcatConfiguration.MODIFY_WEB_MODULE_PROPERTY.equals(event.getPropertyName())) {
- initialize();
- } else if (TomcatConfiguration.ADD_WEB_MODULE_PROPERTY.equals(event.getPropertyName())) {
- initialize();
- } else if (TomcatConfiguration.REMOVE_WEB_MODULE_PROPERTY.equals(event.getPropertyName())) {
- initialize();
- }
- }
- };
- configuration.addPropertyChangeListener(listener);
- }
-
- protected ICommandManager getCommandManager() {
- return commandManager;
- }
-
- /**
- * Creates the SWT controls for this workbench part.
- */
- public void createPartControl(Composite parent) {
- FormToolkit toolkit = getFormToolkit(parent.getDisplay());
-
- ScrolledForm form = toolkit.createScrolledForm(parent);
- form.setText(TomcatUIPlugin.getResource("%configurationEditorWebModulesPageTitle"));
- form.getBody().setLayout(new GridLayout());
-
- Section section = toolkit.createSection(form.getBody(), ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED
- | ExpandableComposite.TITLE_BAR | Section.DESCRIPTION | ExpandableComposite.FOCUS_TITLE);
- section.setText(TomcatUIPlugin.getResource("%configurationEditorWebModulesSection"));
- section.setDescription(TomcatUIPlugin.getResource("%configurationEditorWebModulesDescription"));
- section.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- Composite composite = toolkit.createComposite(section);
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- layout.marginHeight = 5;
- layout.marginWidth = 10;
- layout.verticalSpacing = 5;
- layout.horizontalSpacing = 15;
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
- IWorkbenchHelpSystem whs = PlatformUI.getWorkbench().getHelpSystem();
- whs.setHelp(composite, ContextIds.CONFIGURATION_EDITOR_WEBMODULES);
- toolkit.paintBordersFor(composite);
- section.setClient(composite);
-
- webAppTable = toolkit.createTable(composite, SWT.V_SCROLL | SWT.SINGLE | SWT.FULL_SELECTION);
- webAppTable.setHeaderVisible(true);
- webAppTable.setLinesVisible(true);
- whs.setHelp(webAppTable, ContextIds.CONFIGURATION_EDITOR_WEBMODULES_LIST);
- //toolkit.paintBordersFor(webAppTable);
-
- TableLayout tableLayout = new TableLayout();
-
- TableColumn col = new TableColumn(webAppTable, SWT.NONE);
- col.setText(TomcatUIPlugin.getResource("%configurationEditorPathColumn"));
- ColumnWeightData colData = new ColumnWeightData(8, 85, true);
- tableLayout.addColumnData(colData);
-
- TableColumn col2 = new TableColumn(webAppTable, SWT.NONE);
- col2.setText(TomcatUIPlugin.getResource("%configurationEditorDocBaseColumn"));
- colData = new ColumnWeightData(13, 135, true);
- tableLayout.addColumnData(colData);
-
- TableColumn col3 = new TableColumn(webAppTable, SWT.NONE);
- col3.setText(TomcatUIPlugin.getResource("%configurationEditorProjectColumn"));
- colData = new ColumnWeightData(8, 85, true);
- tableLayout.addColumnData(colData);
-
- TableColumn col4 = new TableColumn(webAppTable, SWT.NONE);
- col4.setText(TomcatUIPlugin.getResource("%configurationEditorReloadColumn"));
- colData = new ColumnWeightData(7, 75, true);
- tableLayout.addColumnData(colData);
-
- webAppTable.setLayout(tableLayout);
-
- GridData data = new GridData(GridData.FILL_HORIZONTAL);
- data.widthHint = 450;
- data.heightHint = 120;
- webAppTable.setLayoutData(data);
- webAppTable.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- selectWebApp();
- }
- });
-
- Composite rightPanel = toolkit.createComposite(composite);
- layout = new GridLayout();
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- rightPanel.setLayout(layout);
- data = new GridData();
- rightPanel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_BEGINNING));
- //toolkit.paintBordersFor(rightPanel);
-
- // buttons still to add:
- // add project, add external module, remove module
- addProject = toolkit.createButton(rightPanel, TomcatUIPlugin.getResource("%configurationEditorAddProjectModule"), SWT.PUSH);
- data = new GridData(GridData.FILL_HORIZONTAL);
- addProject.setLayoutData(data);
- whs.setHelp(addProject, ContextIds.CONFIGURATION_EDITOR_WEBMODULES_ADD_PROJECT);
-
- // disable the add project module button if there are no
- // web projects in the workbench
- if (!canAddWebModule())
- addProject.setEnabled(false);
- else {
- addProject.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- WebModuleDialog dialog = new WebModuleDialog(getEditorSite().getShell(), getServer(), server2, configuration, true);
- dialog.open();
- if (dialog.getReturnCode() == IDialogConstants.OK_ID) {
- getCommandManager().executeCommand(new AddWebModuleCommand(configuration, dialog.getWebModule()));
- }
- }
- });
- }
-
- addExtProject = toolkit.createButton(rightPanel, TomcatUIPlugin.getResource("%configurationEditorAddExternalModule"), SWT.PUSH);
- data = new GridData(GridData.FILL_HORIZONTAL);
- addExtProject.setLayoutData(data);
- addExtProject.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- WebModuleDialog dialog = new WebModuleDialog(getEditorSite().getShell(), getServer(), server2, configuration, false);
- dialog.open();
- if (dialog.getReturnCode() == IDialogConstants.OK_ID) {
- getCommandManager().executeCommand(new AddWebModuleCommand(configuration, dialog.getWebModule()));
- }
- }
- });
- whs.setHelp(addExtProject, ContextIds.CONFIGURATION_EDITOR_WEBMODULES_ADD_EXTERNAL);
-
- edit = toolkit.createButton(rightPanel, TomcatUIPlugin.getResource("%editorEdit"), SWT.PUSH);
- data = new GridData(GridData.FILL_HORIZONTAL);
- edit.setLayoutData(data);
- edit.setEnabled(false);
- edit.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- if (selection < 0)
- return;
- WebModule module = (WebModule) configuration.getWebModules().get(selection);
- WebModuleDialog dialog = new WebModuleDialog(getEditorSite().getShell(), getServer(), server2, configuration, module);
- dialog.open();
- if (dialog.getReturnCode() == IDialogConstants.OK_ID) {
- getCommandManager().executeCommand(new ModifyWebModuleCommand(configuration, selection, dialog.getWebModule()));
- }
- }
- });
- whs.setHelp(edit, ContextIds.CONFIGURATION_EDITOR_WEBMODULES_EDIT);
-
- remove = toolkit.createButton(rightPanel, TomcatUIPlugin.getResource("%editorRemove"), SWT.PUSH);
- data = new GridData(GridData.FILL_HORIZONTAL);
- remove.setLayoutData(data);
- remove.setEnabled(false);
- remove.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- if (selection < 0)
- return;
- getCommandManager().executeCommand(new RemoveWebModuleCommand(configuration, selection));
- remove.setEnabled(false);
- edit.setEnabled(false);
- selection = -1;
- }
- });
- whs.setHelp(remove, ContextIds.CONFIGURATION_EDITOR_WEBMODULES_REMOVE);
-
- form.setContent(section);
- form.reflow(true);
-
- initialize();
- }
-
- protected boolean canAddWebModule() {
- IModule[] modules = ServerUtil.getModules(server.getServerType().getRuntimeType().getModuleTypes());
- if (modules != null) {
- int size = modules.length;
- for (int i = 0; i < size; i++) {
- IWebModule webModule = (IWebModule) modules[i].getAdapter(IWebModule.class);
- if (webModule != null) {
- IStatus status = server.canModifyModules(new IModule[] { modules[i] }, null, null);
- if (status != null && status.isOK())
- return true;
- }
- }
- }
- return false;
- }
-
- public void dispose() {
- if (configuration != null)
- configuration.removePropertyChangeListener(listener);
- }
-
- /* (non-Javadoc)
- * Initializes the editor part with a site and input.
- */
- public void init(IEditorSite site, IEditorInput input) {
- super.init(site, input);
-
- TomcatServer ts = (TomcatServer) server.getAdapter(TomcatServer.class);
- try {
- configuration = ts.getTomcatConfiguration();
- } catch (Exception e) {
- // ignore
- }
- if (configuration != null)
- addChangeListener();
-
- if (server != null)
- server2 = (ITomcatServerWorkingCopy) server.getAdapter(ITomcatServerWorkingCopy.class);
-
- initialize();
- }
-
- /**
- *
- */
- protected void initialize() {
- if (webAppTable == null)
- return;
-
- webAppTable.removeAll();
-
- List list = configuration.getWebModules();
- Iterator iterator = list.iterator();
- while (iterator.hasNext()) {
- WebModule module = (WebModule) iterator.next();
- TableItem item = new TableItem(webAppTable, SWT.NONE);
-
- // FIX-ME
- String memento = module.getMemento();
- String projectName = "";
- Image projectImage = null;
- if (memento != null && memento.length() > 0) {
- projectName = TomcatUIPlugin.getResource("%configurationEditorProjectMissing", new String[] {memento});
- projectImage = TomcatUIPlugin.getImage(TomcatUIPlugin.IMG_PROJECT_MISSING);
- IModule module2 = ServerUtil.getModule(memento);
- if (module != null) {
- projectName = ServerUICore.getLabelProvider().getText(module2);
- projectImage = ServerUICore.getLabelProvider().getImage(module2);
- }
- }
-
- String reload = module.isReloadable() ? TomcatUIPlugin.getResource("%configurationEditorReloadEnabled") : TomcatUIPlugin.getResource("%configurationEditorReloadDisabled");
- String[] s = new String[] {module.getPath(), module.getDocumentBase(), projectName, reload};
- item.setText(s);
- item.setImage(0, TomcatUIPlugin.getImage(TomcatUIPlugin.IMG_WEB_MODULE));
- if (projectImage != null)
- item.setImage(2, projectImage);
- }
-
- if (readOnly) {
- addProject.setEnabled(false);
- addExtProject.setEnabled(false);
- edit.setEnabled(false);
- remove.setEnabled(false);
- } else {
- addProject.setEnabled(canAddWebModule());
- addExtProject.setEnabled(true);
- }
- }
-
- /**
- *
- */
- protected void selectWebApp() {
- if (readOnly)
- return;
-
- try {
- selection = webAppTable.getSelectionIndex();
- remove.setEnabled(true);
- edit.setEnabled(true);
- } catch (Exception e) {
- selection = -1;
- remove.setEnabled(false);
- edit.setEnabled(false);
- }
- }
-
- /*
- * @see IWorkbenchPart#setFocus()
- */
- public void setFocus() {
- if (webAppTable != null)
- webAppTable.setFocus();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/MimeMappingDialog.java b/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/MimeMappingDialog.java
deleted file mode 100644
index 561ad65..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/MimeMappingDialog.java
+++ /dev/null
@@ -1,152 +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.jst.server.tomcat.ui.internal.editor;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jst.server.tomcat.core.internal.MimeMapping;
-import org.eclipse.jst.server.tomcat.ui.internal.ContextIds;
-import org.eclipse.jst.server.tomcat.ui.internal.TomcatUIPlugin;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.help.IWorkbenchHelpSystem;
-/**
- * Dialog to add or modify mime mappings.
- */
-public class MimeMappingDialog extends Dialog {
- protected MimeMapping map;
- protected boolean isEdit;
-
- /**
- * MimeMappingDialog constructor comment.
- * @param parentShell org.eclipse.swt.widgets.Shell
- */
- public MimeMappingDialog(Shell parentShell) {
- this(parentShell, new MimeMapping("", ""));
- isEdit = false;
- }
-
- /**
- * SystemPropertyDialog constructor comment.
- * @param parentShell org.eclipse.swt.widgets.Shell
- */
- public MimeMappingDialog(Shell parentShell, MimeMapping map) {
- super(parentShell);
- this.map = map;
- isEdit = true;
- }
-
- /**
- *
- */
- protected void configureShell(Shell newShell) {
- super.configureShell(newShell);
- newShell.setImage(TomcatUIPlugin.getImage(TomcatUIPlugin.IMG_MIME_MAPPING));
- if (isEdit)
- newShell.setText(TomcatUIPlugin.getResource("%configurationEditorMimeMapppingDialogTitleEdit"));
- else
- newShell.setText(TomcatUIPlugin.getResource("%configurationEditorMimeMapppingDialogTitleAdd"));
- }
-
- /**
- * Creates and returns the contents of the upper part
- * of this dialog (above the button bar).
- * <p>
- * The <code>Dialog</code> implementation of this framework method
- * creates and returns a new <code>Composite</code> with
- * standard margins and spacing. Subclasses should override.
- * </p>
- *
- * @param parent the parent composite to contain the dialog area
- * @return the dialog area control
- */
- protected Control createDialogArea(Composite parent) {
- // create a composite with standard margins and spacing
- Composite composite = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
- layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
- layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
- layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
- composite.setFont(parent.getFont());
- IWorkbenchHelpSystem whs = PlatformUI.getWorkbench().getHelpSystem();
- whs.setHelp(composite, ContextIds.CONFIGURATION_EDITOR_MAPPING_DIALOG);
-
- new Label(composite, SWT.NONE).setText(TomcatUIPlugin.getResource("%configurationEditorMimeMapppingDialogMimeType"));
- final Text type = new Text(composite, SWT.BORDER);
- GridData data = new GridData();
- data.widthHint = 150;
- type.setLayoutData(data);
- type.setText(map.getMimeType());
- type.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- map = new MimeMapping(map.getExtension(), type.getText());
- validate();
- }
- });
- whs.setHelp(type, ContextIds.CONFIGURATION_EDITOR_MAPPING_DIALOG_TYPE);
-
- new Label(composite, SWT.NONE).setText(TomcatUIPlugin.getResource("%configurationEditorMimeMapppingDialogMimeExtension"));
- final Text extension = new Text(composite, SWT.BORDER);
- data = new GridData();
- data.widthHint = 150;
- extension.setLayoutData(data);
- extension.setText(map.getExtension());
- extension.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- map = new MimeMapping(extension.getText(), map.getMimeType());
- validate();
- }
- });
- whs.setHelp(extension, ContextIds.CONFIGURATION_EDITOR_MAPPING_DIALOG_EXTENSION);
-
- Dialog.applyDialogFont(composite);
-
- return composite;
- }
-
- protected Control createButtonBar(Composite parent) {
- Control control = super.createButtonBar(parent);
- validate();
-
- return control;
- }
-
- protected void validate() {
- boolean ok = true;
- if (map.getExtension() == null || map.getExtension().length() < 1)
- ok = false;
- if (map.getMimeType() == null || map.getMimeType().length() < 1)
- ok = false;
- getButton(IDialogConstants.OK_ID).setEnabled(ok);
- }
-
- /**
- * Return the mime mapping.
- *
- * @return org.eclipse.jst.server.tomcat.MimeMapping
- */
- public MimeMapping getMimeMapping() {
- return map;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/ServerGeneralEditorSection.java b/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/ServerGeneralEditorSection.java
deleted file mode 100644
index bd0579b..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/ServerGeneralEditorSection.java
+++ /dev/null
@@ -1,203 +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.jst.server.tomcat.ui.internal.editor;
-
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-
-import org.eclipse.jst.server.tomcat.core.internal.ITomcatServer;
-import org.eclipse.jst.server.tomcat.core.internal.TomcatServer;
-import org.eclipse.jst.server.tomcat.core.internal.command.SetDebugModeCommand;
-import org.eclipse.jst.server.tomcat.core.internal.command.SetSecureCommand;
-import org.eclipse.jst.server.tomcat.core.internal.command.SetTestEnvironmentCommand;
-import org.eclipse.jst.server.tomcat.ui.internal.ContextIds;
-import org.eclipse.jst.server.tomcat.ui.internal.TomcatUIPlugin;
-import org.eclipse.swt.SWT;
-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.Composite;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.ui.forms.widgets.Section;
-import org.eclipse.ui.help.IWorkbenchHelpSystem;
-
-import org.eclipse.wst.server.ui.editor.*;
-/**
- * Tomcat server general editor page.
- */
-public class ServerGeneralEditorSection extends ServerEditorSection {
- protected TomcatServer tomcatServer;
-
- protected Button secure;
- protected Button debug;
- protected Button testEnvironment;
- protected boolean updating;
-
- protected PropertyChangeListener listener;
-
- /**
- * ServerGeneralEditorPart constructor comment.
- */
- protected ServerGeneralEditorSection() {
- // do nothing
- }
-
- /**
- *
- */
- protected void addChangeListener() {
- listener = new PropertyChangeListener() {
- public void propertyChange(PropertyChangeEvent event) {
- if (updating)
- return;
- updating = true;
- if (TomcatServer.PROPERTY_SECURE.equals(event.getPropertyName())) {
- Boolean b = (Boolean) event.getNewValue();
- ServerGeneralEditorSection.this.secure.setSelection(b.booleanValue());
- } else if (TomcatServer.PROPERTY_DEBUG.equals(event.getPropertyName())) {
- Boolean b = (Boolean) event.getNewValue();
- ServerGeneralEditorSection.this.debug.setSelection(b.booleanValue());
- } else if (ITomcatServer.PROPERTY_TEST_ENVIRONMENT.equals(event.getPropertyName())) {
- Boolean b = (Boolean) event.getNewValue();
- ServerGeneralEditorSection.this.testEnvironment.setSelection(b.booleanValue());
- }
- updating = false;
- }
- };
- server.addPropertyChangeListener(listener);
- }
-
- /**
- * Creates the SWT controls for this workbench part.
- *
- * @param parent the parent control
- */
- public void createSection(Composite parent) {
- super.createSection(parent);
- FormToolkit toolkit = getFormToolkit(parent.getDisplay());
-
- Section section = toolkit.createSection(parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED
- | ExpandableComposite.TITLE_BAR | Section.DESCRIPTION | ExpandableComposite.FOCUS_TITLE);
- section.setText(TomcatUIPlugin.getResource("%serverEditorGeneralSection"));
- section.setDescription(TomcatUIPlugin.getResource("%serverEditorGeneralDescription"));
- section.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL));
-
- Composite composite = toolkit.createComposite(section);
- GridLayout layout = new GridLayout();
- layout.numColumns = 3;
- layout.marginHeight = 5;
- layout.marginWidth = 10;
- layout.verticalSpacing = 5;
- layout.horizontalSpacing = 15;
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL));
- IWorkbenchHelpSystem whs = PlatformUI.getWorkbench().getHelpSystem();
- whs.setHelp(composite, ContextIds.SERVER_EDITOR);
- toolkit.paintBordersFor(composite);
- section.setClient(composite);
-
- // test environment
- testEnvironment = toolkit.createButton(composite, TomcatUIPlugin.getResource("%serverEditorTestEnvironment"), SWT.CHECK);
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- data.horizontalSpan = 3;
- testEnvironment.setLayoutData(data);
- testEnvironment.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent se) {
- if (updating)
- return;
- updating = true;
- commandManager.executeCommand(new SetTestEnvironmentCommand(tomcatServer, testEnvironment.getSelection()));
- updating = false;
- }
- });
- whs.setHelp(testEnvironment, ContextIds.SERVER_EDITOR_TEST_ENVIRONMENT);
-
- // security
- secure = toolkit.createButton(composite, TomcatUIPlugin.getResource("%serverEditorSecure"), SWT.CHECK);
- data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- data.horizontalSpan = 3;
- secure.setLayoutData(data);
- secure.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent se) {
- if (updating)
- return;
- updating = true;
- commandManager.executeCommand(new SetSecureCommand(tomcatServer, secure.getSelection()));
- updating = false;
- }
- });
- whs.setHelp(secure, ContextIds.SERVER_EDITOR_SECURE);
-
- // debug mode
- debug = toolkit.createButton(composite, TomcatUIPlugin.getResource("%serverEditorDebugMode"), SWT.CHECK);
- data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- data.horizontalSpan = 3;
- debug.setLayoutData(data);
- debug.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent se) {
- if (updating)
- return;
- updating = true;
- commandManager.executeCommand(new SetDebugModeCommand(tomcatServer, debug.getSelection()));
- updating = false;
- }
- });
- whs.setHelp(debug, ContextIds.SERVER_EDITOR_DEBUG_MODE);
-
- initialize();
- }
-
- public void dispose() {
- if (server != null)
- server.removePropertyChangeListener(listener);
- }
-
- public void init(IEditorSite site, IEditorInput input) {
- super.init(site, input);
-
- if (server != null) {
- tomcatServer = (TomcatServer) server.getAdapter(TomcatServer.class);
- addChangeListener();
- }
- initialize();
- }
-
- /**
- * Initialize the fields in this editor.
- */
- protected void initialize() {
- if (secure == null || tomcatServer == null)
- return;
- updating = true;
-
- testEnvironment.setSelection(tomcatServer.isTestEnvironment());
- secure.setSelection(tomcatServer.isSecure());
- if (server.getRuntime() != null && server.getRuntime().getRuntimeType().getId().indexOf("32") >= 0 || readOnly)
- debug.setEnabled(false);
- else {
- debug.setEnabled(true);
- debug.setSelection(tomcatServer.isDebug());
- }
-
- if (readOnly)
- secure.setEnabled(false);
- else
- secure.setEnabled(true);
-
- updating = false;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/ServerGeneralEditorSectionFactory.java b/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/ServerGeneralEditorSectionFactory.java
deleted file mode 100644
index 7931f0c..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/ServerGeneralEditorSectionFactory.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.jst.server.tomcat.ui.internal.editor;
-
-import org.eclipse.wst.server.ui.editor.*;
-/**
- *
- */
-public class ServerGeneralEditorSectionFactory extends ServerEditorPageSectionFactoryDelegate {
- /*
- * @see ServerEditorPartFactoryDelegate#createPage()
- */
- public IServerEditorSection createSection() {
- return new ServerGeneralEditorSection();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/WebModuleDialog.java b/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/WebModuleDialog.java
deleted file mode 100644
index 77d2606..0000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/WebModuleDialog.java
+++ /dev/null
@@ -1,270 +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.jst.server.tomcat.ui.internal.editor;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jst.server.core.IWebModule;
-import org.eclipse.jst.server.tomcat.core.internal.ITomcatConfiguration;
-import org.eclipse.jst.server.tomcat.core.internal.ITomcatServer;
-import org.eclipse.jst.server.tomcat.core.internal.WebModule;
-import org.eclipse.jst.server.tomcat.ui.internal.ContextIds;
-import org.eclipse.jst.server.tomcat.ui.internal.TomcatUIPlugin;
-import org.eclipse.jst.server.tomcat.ui.internal.Trace;
-import org.eclipse.swt.SWT;
-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.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.DirectoryDialog;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.help.IWorkbenchHelpSystem;
-
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IServerAttributes;
-import org.eclipse.wst.server.core.ServerUtil;
-import org.eclipse.wst.server.ui.ServerUICore;
-/**
- * Dialog to add or modify web modules.
- */
-public class WebModuleDialog extends Dialog {
- protected WebModule module;
- protected boolean isEdit;
- protected boolean isProject;
- protected Text docBase;
- protected IServerAttributes server2;
- protected ITomcatServer server;
- protected ITomcatConfiguration config;
-
- protected Table projTable;
-
- /**
- * WebModuleDialog constructor comment.
- * @param parentShell org.eclipse.swt.widgets.Shell
- */
- public WebModuleDialog(Shell parentShell, IServerAttributes server2, ITomcatServer server, ITomcatConfiguration config, WebModule module) {
- super(parentShell);
- this.module = module;
- this.server2 = server2;
- this.server = server;
- this.config = config;
- isEdit = true;
- }
-
- /**
- * WebModuleDialog constructor comment.
- * @param parentShell org.eclipse.swt.widgets.Shell
- */
- public WebModuleDialog(Shell parentShell, IServerAttributes server2, ITomcatServer server, ITomcatConfiguration config, boolean isProject) {
- this(parentShell, server2, server, config, new WebModule("/", "", null, true));
- isEdit = false;
- this.isProject = isProject;
- }
-
- /**
- *
- */
- protected void configureShell(Shell newShell) {
- super.configureShell(newShell);
- if (isEdit)
- newShell.setText(TomcatUIPlugin.getResource("%configurationEditorWebModuleDialogTitleEdit"));
- else
- newShell.setText(TomcatUIPlugin.getResource("%configurationEditorWebModuleDialogTitleAdd"));
- }
-
- /**
- * Creates and returns the contents of the upper part
- * of this dialog (above the button bar).
- * <p>
- * The <code>Dialog</code> implementation of this framework method
- * creates and returns a new <code>Composite</code> with
- * standard margins and spacing. Subclasses should override.
- * </p>
- *
- * @param parent the parent composite to contain the dialog area
- * @return the dialog area control
- */
- protected Control createDialogArea(Composite parent) {
- // create a composite with standard margins and spacing
- Composite composite = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 3;
- layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
- layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
- layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
- layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
- composite.setFont(parent.getFont());
- IWorkbenchHelpSystem whs = PlatformUI.getWorkbench().getHelpSystem();
- whs.setHelp(composite, ContextIds.CONFIGURATION_EDITOR_WEBMODULE_DIALOG);
- // add project field if we are adding a project
- if (!isEdit && isProject) {
- Label l = new Label(composite, SWT.NONE);
- l.setText(TomcatUIPlugin.getResource("%configurationEditorWebModuleDialogProjects"));
- GridData data = new GridData(GridData.VERTICAL_ALIGN_BEGINNING);
- l.setLayoutData(data);
-
- projTable = new Table(composite, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL | SWT.SINGLE);
- data = new GridData();
- data.widthHint = 150;
- data.heightHint = 75;
- projTable.setLayoutData(data);
- whs.setHelp(projTable, ContextIds.CONFIGURATION_EDITOR_WEBMODULE_DIALOG_PROJECT);
-
- // fill table with web module projects
- IModule[] modules = ServerUtil.getModules(server2.getServerType().getRuntimeType().getModuleTypes());
- if (modules != null) {
- int size = modules.length;
- for (int i = 0; i < size; i++) {
- IModule module3 = modules[i];
- IWebModule module2 = (IWebModule) module3.getAdapter(IWebModule.class);
- if (module2 != null) {
- IStatus status = server2.canModifyModules(new IModule[] { module3 }, null, null);
- if (status != null && status.isOK()) {
- TableItem item = new TableItem(projTable, SWT.NONE);
- item.setText(0, ServerUICore.getLabelProvider().getText(module2));
- item.setImage(0, ServerUICore.getLabelProvider().getImage(module2));
- item.setData(module2);
- }
- }
- }
- }
- new Label(composite, SWT.NONE).setText(" ");
- }
-
- new Label(composite, SWT.NONE).setText(TomcatUIPlugin.getResource("%configurationEditorWebModuleDialogDocumentBase"));
- docBase = new Text(composite, SWT.BORDER);
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- docBase.setLayoutData(data);
- docBase.setText(module.getDocumentBase());
- whs.setHelp(docBase, ContextIds.CONFIGURATION_EDITOR_WEBMODULE_DIALOG_DOCBASE);
-
- // disable document base for project modules
- if (isProject || (module.getMemento() != null && module.getMemento().length() > 0))
- docBase.setEnabled(false);
- else {
- docBase.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- module = new WebModule(module.getPath(), docBase.getText(), module.getMemento(), module.isReloadable());
- validate();
- }
- });
- }
-
- if (isEdit || isProject)
- new Label(composite, SWT.NONE).setText(" ");
- else {
- Button browse = new Button(composite, SWT.NONE);
- browse.setText(TomcatUIPlugin.getResource("%browse"));
- browse.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent se) {
- try {
- DirectoryDialog dialog = new DirectoryDialog(getShell());
- dialog.setMessage(TomcatUIPlugin.getResource("%configurationEditorWebModuleDialogSelectDirectory"));
- String selectedDirectory = dialog.open();
- if (selectedDirectory != null)
- docBase.setText(selectedDirectory);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error browsing", e);
- }
- }
- });
- }
-
- // path (context-root)
- new Label(composite, SWT.NONE).setText(TomcatUIPlugin.getResource("%configurationEditorWebModuleDialogPath"));
- final Text path = new Text(composite, SWT.BORDER);
- data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- data.widthHint = 150;
- path.setLayoutData(data);
- path.setText(module.getPath());
- path.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- module = new WebModule(path.getText(), module.getDocumentBase(), module.getMemento(), module.isReloadable());
- }
- });
- whs.setHelp(path, ContextIds.CONFIGURATION_EDITOR_WEBMODULE_DIALOG_PATH);
-
- new Label(composite, SWT.NONE).setText("");
-
- // auto reload
- new Label(composite, SWT.NONE).setText(TomcatUIPlugin.getResource("%configurationEditorWebModuleDialogAutoReload"));
- final Button reloadable = new Button(composite, SWT.CHECK);
- reloadable.setText(TomcatUIPlugin.getResource("%configurationEditorWebModuleDialogReloadEnabled"));
- data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- reloadable.setLayoutData(data);
- reloadable.setSelection(module.isReloadable());
- reloadable.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- module = new WebModule(module.getPath(), module.getDocumentBase(), module.getMemento(), reloadable.getSelection());
- }
- });
- whs.setHelp(reloadable, ContextIds.CONFIGURATION_EDITOR_WEBMODULE_DIALOG_RELOAD);
-
- if (!isEdit && isProject) {
- projTable.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent event) {
- try {
- IWebModule module2 = (IWebModule) projTable.getSelection()[0].getData();
- String contextRoot = module2.getContextRoot();
- if (contextRoot != null && !contextRoot.startsWith("/"))
- contextRoot = "/" + contextRoot;
- module = new WebModule(contextRoot, module2.getLocation().toOSString(), module.getMemento(), module.isReloadable());
- docBase.setText(module2.getLocation().toOSString());
- } catch (Exception e) {
- // ignore
- }
- validate();
- }
- });
- new Label(composite, SWT.NONE).setText("");
- }
-
- Dialog.applyDialogFont(composite);
- return composite;
- }
-
- protected Control createButtonBar(Composite parent) {
- Control control = super.createButtonBar(parent);
- validate();
-
- return control;
- }
-
- protected void validate() {
- boolean ok = true;
- if (module.getDocumentBase() == null || module.getDocumentBase().length() < 1)
- ok = false;
-
- getButton(IDialogConstants.OK_ID).setEnabled(ok);
- }
-
- /**
- * Return the mime mapping.
- *
- * @return org.eclipse.jst.server.tomcat.WebModule
- */
- public WebModule getWebModule() {
- return module;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.ui/.classpath b/plugins/org.eclipse.jst.server.ui/.classpath
deleted file mode 100644
index 6f75060..0000000
--- a/plugins/org.eclipse.jst.server.ui/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="sjavaui/"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/plugins/org.eclipse.jst.server.ui/.cvsignore b/plugins/org.eclipse.jst.server.ui/.cvsignore
deleted file mode 100644
index 92a2cef..0000000
--- a/plugins/org.eclipse.jst.server.ui/.cvsignore
+++ /dev/null
@@ -1,5 +0,0 @@
-bin
-build.xml
-org.eclipse.jst.server.ui_3.0.0.jar
-sjavaui.jar
-temp.folder
diff --git a/plugins/org.eclipse.jst.server.ui/.options b/plugins/org.eclipse.jst.server.ui/.options
deleted file mode 100644
index a747d69..0000000
--- a/plugins/org.eclipse.jst.server.ui/.options
+++ /dev/null
@@ -1,4 +0,0 @@
-# Debugging options for the org.eclipse.jst.server.ui plugin
-
-# Turn on general debugging
-org.eclipse.jst.server.ui/debug=true
diff --git a/plugins/org.eclipse.jst.server.ui/.project b/plugins/org.eclipse.jst.server.ui/.project
deleted file mode 100644
index abd835d..0000000
--- a/plugins/org.eclipse.jst.server.ui/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jst.server.ui</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/plugins/org.eclipse.jst.server.ui/build.properties b/plugins/org.eclipse.jst.server.ui/build.properties
deleted file mode 100644
index 0873853..0000000
--- a/plugins/org.eclipse.jst.server.ui/build.properties
+++ /dev/null
@@ -1,19 +0,0 @@
-###############################################################################
-# Copyright (c) 2004 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
-###############################################################################
-bin.includes = plugin.xml,\
- plugin.properties,\
- icons/,\
- sjavaui.jar
-jars.compile.order =
-src.includes = schema/,\
- build.properties
-output.sjavaui.jar = bin/
-source.sjavaui.jar = sjavaui/
diff --git a/plugins/org.eclipse.jst.server.ui/icons/obj16/appclient_module.gif b/plugins/org.eclipse.jst.server.ui/icons/obj16/appclient_module.gif
deleted file mode 100644
index 4423578..0000000
--- a/plugins/org.eclipse.jst.server.ui/icons/obj16/appclient_module.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.server.ui/icons/obj16/ear.gif b/plugins/org.eclipse.jst.server.ui/icons/obj16/ear.gif
deleted file mode 100644
index b5630b3..0000000
--- a/plugins/org.eclipse.jst.server.ui/icons/obj16/ear.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.server.ui/icons/obj16/ejb_module.gif b/plugins/org.eclipse.jst.server.ui/icons/obj16/ejb_module.gif
deleted file mode 100644
index f8b5c0a..0000000
--- a/plugins/org.eclipse.jst.server.ui/icons/obj16/ejb_module.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.server.ui/icons/obj16/java_jar.gif b/plugins/org.eclipse.jst.server.ui/icons/obj16/java_jar.gif
deleted file mode 100644
index 6059f86..0000000
--- a/plugins/org.eclipse.jst.server.ui/icons/obj16/java_jar.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.server.ui/icons/obj16/web_module.gif b/plugins/org.eclipse.jst.server.ui/icons/obj16/web_module.gif
deleted file mode 100644
index bf20f70..0000000
--- a/plugins/org.eclipse.jst.server.ui/icons/obj16/web_module.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.server.ui/icons/wizban/new_runtime_wiz.gif b/plugins/org.eclipse.jst.server.ui/icons/wizban/new_runtime_wiz.gif
deleted file mode 100644
index 30de91f..0000000
--- a/plugins/org.eclipse.jst.server.ui/icons/wizban/new_runtime_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.server.ui/plugin.properties b/plugins/org.eclipse.jst.server.ui/plugin.properties
deleted file mode 100644
index 44093b7..0000000
--- a/plugins/org.eclipse.jst.server.ui/plugin.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-###############################################################################
-# Copyright (c) 2004, 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
-###############################################################################
-pluginName=Java Server UI Support
-providerName=Eclipse.org
-
-runtimeTypeTitle=Generic J2EE Runtime
-runtimeTypeDescription=Define a generic J2EE runtime. Specify a directory containing jar files to compile against.
-runtimeTypeName=Na&me:
-runtimeTypeLocation=&Location:
-browse=B&rowse...
-runtimeTypeSelectLocation=Select the location of the runtime.
-runtimeTypeJRE=&JRE:
-runtimeTypeInstalledJREs=In&stalled JREs...
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.ui/plugin.xml b/plugins/org.eclipse.jst.server.ui/plugin.xml
deleted file mode 100644
index 4f4957e..0000000
--- a/plugins/org.eclipse.jst.server.ui/plugin.xml
+++ /dev/null
@@ -1,64 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-
-<plugin id="org.eclipse.jst.server.ui"
- name="%pluginName"
- version="1.0.0"
- provider-name="%providerName"
- class="org.eclipse.jst.server.ui.internal.JavaServerUIPlugin">
-
-<requires>
- <import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.eclipse.ui"/>
- <import plugin="org.eclipse.jdt.core"/>
- <import plugin="org.eclipse.jdt.launching"/>
- <import plugin="org.eclipse.wst.server.core"/>
- <import plugin="org.eclipse.wst.server.ui"/>
- <import plugin="org.eclipse.jst.server.core"/>
-</requires>
-
- <runtime>
- <library name="sjavaui.jar">
- <export name="*"/>
- </library>
- </runtime>
-
- <extension point="org.eclipse.wst.server.ui.serverImages">
- <image
- id="org.eclipse.jst.server"
- typeIds="org.eclipse.jst.server.core.runtimeType"
- icon="icons/obj16/java_jar.gif"/>
- <image
- id="org.eclipse.jst.server"
- typeIds="j2ee.web"
- icon="icons/obj16/web_module.gif"/>
- <image
- id="org.eclipse.jst.server"
- typeIds="j2ee.ejb"
- icon="icons/obj16/ejb_module.gif"/>
- <image
- id="org.eclipse.jst.server"
- typeIds="j2ee.ear"
- icon="icons/obj16/ear.gif"/>
- <image
- id="org.eclipse.jst.server"
- typeIds="j2ee.appclient"
- icon="icons/obj16/appclient_module.gif"/>
- <image
- id="org.eclipse.jst.server"
- typeIds="j2ee.connector"
- icon="icons/obj16/java_jar.gif"/>
- <image
- id="org.eclipse.jst.server"
- typeIds="j2ee.loosearchive"
- icon="icons/obj16/java_jar.gif"/>
- </extension>
-
- <extension point="org.eclipse.wst.server.ui.wizardFragments">
- <fragment
- id="org.eclipse.jst.server.core.runtimeType"
- typeIds="org.eclipse.jst.server.core.runtimeType"
- class="org.eclipse.jst.server.ui.internal.GenericRuntimeWizardFragment"/>
- </extension>
-
-</plugin>
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.ui/sjavaui/org/eclipse/jst/server/ui/internal/ContextIds.java b/plugins/org.eclipse.jst.server.ui/sjavaui/org/eclipse/jst/server/ui/internal/ContextIds.java
deleted file mode 100644
index f3cbdeb..0000000
--- a/plugins/org.eclipse.jst.server.ui/sjavaui/org/eclipse/jst/server/ui/internal/ContextIds.java
+++ /dev/null
@@ -1,54 +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.jst.server.ui.internal;
-/**
- * Context help id constants.
- */
-public interface ContextIds {
- public static final String JAVA_CLASSPATH = JavaServerUIPlugin.PLUGIN_ID + ".jvcp0000";
- public static final String JAVA_CLASSPATH_TABLE = JavaServerUIPlugin.PLUGIN_ID + ".jvcp0002";
- public static final String JAVA_CLASSPATH_UP = JavaServerUIPlugin.PLUGIN_ID + ".jvcp0004";
- public static final String JAVA_CLASSPATH_DOWN = JavaServerUIPlugin.PLUGIN_ID + ".jvcp0006";
- public static final String JAVA_CLASSPATH_ADD_EXTERNAL_JAR = JavaServerUIPlugin.PLUGIN_ID + ".jvcp0008";
- public static final String JAVA_CLASSPATH_ADD_EXTERNAL_FOLDER = JavaServerUIPlugin.PLUGIN_ID + ".jvcp0009";
- public static final String JAVA_CLASSPATH_ADD_VARIABLE = JavaServerUIPlugin.PLUGIN_ID + ".jvcp0011";
- public static final String JAVA_CLASSPATH_ADD_STRING = JavaServerUIPlugin.PLUGIN_ID + ".jvcp0013";
- public static final String JAVA_CLASSPATH_EDIT = JavaServerUIPlugin.PLUGIN_ID + ".jvcp0015";
- public static final String JAVA_CLASSPATH_REMOVE = JavaServerUIPlugin.PLUGIN_ID + ".jvcp0012";
-
- public static final String JAVA_PATH = JavaServerUIPlugin.PLUGIN_ID + ".jvpt0000";
- public static final String JAVA_PATH_FIELD = JavaServerUIPlugin.PLUGIN_ID + ".jvpt0002";
- public static final String JAVA_PATH_APPEND = JavaServerUIPlugin.PLUGIN_ID + ".jvpt0004";
- public static final String JAVA_PATH_PREPEND = JavaServerUIPlugin.PLUGIN_ID + ".jvpt0006";
- public static final String JAVA_PATH_REPLACE = JavaServerUIPlugin.PLUGIN_ID + ".jvpt0008";
-
- public static final String JAVA_SYSTEM_PROPERTY = JavaServerUIPlugin.PLUGIN_ID + ".jvsp0000";
- public static final String JAVA_SYSTEM_PROPERTY_TABLE = JavaServerUIPlugin.PLUGIN_ID + ".jvsp0002";
- public static final String JAVA_SYSTEM_PROPERTY_ADD = JavaServerUIPlugin.PLUGIN_ID + ".jvsp0004";
- public static final String JAVA_SYSTEM_PROPERTY_EDIT = JavaServerUIPlugin.PLUGIN_ID + ".jvsp0006";
- public static final String JAVA_SYSTEM_PROPERTY_REMOVE = JavaServerUIPlugin.PLUGIN_ID + ".jvsp0008";
-
- public static final String JAVA_SYSTEM_PROPERTY_DIALOG = JavaServerUIPlugin.PLUGIN_ID + ".jvpd0000";
- public static final String JAVA_SYSTEM_PROPERTY_DIALOG_NAME = JavaServerUIPlugin.PLUGIN_ID + ".jvpd0002";
- public static final String JAVA_SYSTEM_PROPERTY_DIALOG_VALUE = JavaServerUIPlugin.PLUGIN_ID + ".jvpd0004";
-
- public static final String JAVA_CLASSPATH_VARIABLE_DIALOG = JavaServerUIPlugin.PLUGIN_ID + ".jvvd0000";
- public static final String JAVA_CLASSPATH_VARIABLE_DIALOG_VARIABLE = JavaServerUIPlugin.PLUGIN_ID + ".jvvd0002";
- public static final String JAVA_CLASSPATH_VARIABLE_DIALOG_EXTENSION = JavaServerUIPlugin.PLUGIN_ID + ".jvvd0004";
- public static final String JAVA_CLASSPATH_VARIABLE_DIALOG_EXTENSION_BROWSE = JavaServerUIPlugin.PLUGIN_ID + ".jvvd0006";
-
- public static final String JAVA_CLASSPATH_STRING_DIALOG = JavaServerUIPlugin.PLUGIN_ID + ".jvsd0000";
- public static final String JAVA_CLASSPATH_STRING_DIALOG_PATH = JavaServerUIPlugin.PLUGIN_ID + ".jvsd0002";
-
- public static final String JAVA_VM_ARGUMENTS = JavaServerUIPlugin.PLUGIN_ID + ".jvvm0000";
-
- public static final String RUNTIME_TARGET_COMPOSITE = JavaServerUIPlugin.PLUGIN_ID + ".jvrt0000";
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.ui/sjavaui/org/eclipse/jst/server/ui/internal/GenericRuntimeComposite.java b/plugins/org.eclipse.jst.server.ui/sjavaui/org/eclipse/jst/server/ui/internal/GenericRuntimeComposite.java
deleted file mode 100644
index 01fab58..0000000
--- a/plugins/org.eclipse.jst.server.ui/sjavaui/org/eclipse/jst/server/ui/internal/GenericRuntimeComposite.java
+++ /dev/null
@@ -1,262 +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.jst.server.ui.internal;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.server.core.IRuntimeWorkingCopy;
-import org.eclipse.wst.server.ui.wizard.IWizardHandle;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.events.*;
-import org.eclipse.jdt.launching.IVMInstall;
-import org.eclipse.jdt.launching.IVMInstallType;
-import org.eclipse.jdt.launching.JavaRuntime;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.jface.preference.IPreferenceNode;
-import org.eclipse.jface.preference.PreferenceDialog;
-import org.eclipse.jface.preference.PreferenceManager;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jst.server.core.IGenericRuntimeWorkingCopy;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.ui.PlatformUI;
-/**
- * Wizard page to set the server install directory.
- */
-public class GenericRuntimeComposite extends Composite {
- protected static final String INSTALLED_JRE_PREFERENCE_PAGE_ID = "org.eclipse.jdt.debug.ui.preferences.VMPreferencePage";
- protected IRuntimeWorkingCopy runtimeWC;
- protected IGenericRuntimeWorkingCopy runtime;
-
- protected IWizardHandle wizard;
-
- protected Text name;
- protected Text installDir;
- protected Combo combo;
- protected List installedJREs;
- protected String[] jreNames;
- protected int defaultVMIndex;
-
- /**
- * GenericRuntimeComposite constructor comment.
- */
- protected GenericRuntimeComposite(Composite parent, IWizardHandle wizard) {
- super(parent, SWT.NONE);
- this.wizard = wizard;
-
- wizard.setTitle(JavaServerUIPlugin.getResource("%runtimeTypeTitle"));
- wizard.setDescription(JavaServerUIPlugin.getResource("%runtimeTypeDescription"));
- wizard.setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_RUNTIME_TYPE));
-
- createControl();
- }
-
- protected void setRuntime(IRuntimeWorkingCopy newRuntime) {
- if (newRuntime == null) {
- runtimeWC = null;
- runtime = null;
- } else {
- runtimeWC = newRuntime;
- runtime = (IGenericRuntimeWorkingCopy) newRuntime.getAdapter(IGenericRuntimeWorkingCopy.class);
- }
-
- init();
- validate();
- }
-
- /**
- * Provide a wizard page to change the root directory.
- */
- protected void createControl() {
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- setLayout(layout);
- setLayoutData(new GridData(GridData.FILL_BOTH));
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, ContextIds.RUNTIME_TARGET_COMPOSITE);
-
- Label label = new Label(this, SWT.NONE);
- label.setText(JavaServerUIPlugin.getResource("%runtimeTypeName"));
- GridData data = new GridData();
- data.horizontalSpan = 2;
- label.setLayoutData(data);
-
- name = new Text(this, SWT.BORDER);
- data = new GridData(GridData.FILL_HORIZONTAL);
- name.setLayoutData(data);
- name.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- runtimeWC.setName(name.getText());
- validate();
- }
- });
-
- label = new Label(this, SWT.NONE);
- label.setText(JavaServerUIPlugin.getResource("%runtimeTypeLocation"));
- data = new GridData();
- data.horizontalSpan = 2;
- label.setLayoutData(data);
-
- installDir = new Text(this, SWT.BORDER);
- data = new GridData(GridData.FILL_HORIZONTAL);
- installDir.setLayoutData(data);
- installDir.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- runtimeWC.setLocation(new Path(installDir.getText()));
- validate();
- }
- });
-
- Button browse = SWTUtil.createButton(this, JavaServerUIPlugin.getResource("%browse"));
- browse.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent se) {
- DirectoryDialog dialog = new DirectoryDialog(GenericRuntimeComposite.this.getShell());
- dialog.setMessage(JavaServerUIPlugin.getResource("%runtimeTypeSelectLocation"));
- dialog.setFilterPath(installDir.getText());
- String selectedDirectory = dialog.open();
- if (selectedDirectory != null)
- installDir.setText(selectedDirectory);
- }
- });
-
- updateJREs();
-
- // JDK location
- label = new Label(this, SWT.NONE);
- label.setText(JavaServerUIPlugin.getResource("%runtimeTypeJRE"));
- data = new GridData();
- data.horizontalSpan = 2;
- label.setLayoutData(data);
-
- combo = new Combo(this, SWT.DROP_DOWN | SWT.READ_ONLY);
- combo.setItems(jreNames);
- data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- combo.setLayoutData(data);
-
- combo.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- int sel = combo.getSelectionIndex();
- IVMInstall vmInstall = (IVMInstall) installedJREs.get(sel);
- runtime.setVMInstall(vmInstall);
- validate();
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
- });
-
- Button button = SWTUtil.createButton(this, JavaServerUIPlugin.getResource("%runtimeTypeInstalledJREs"));
- button.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- String currentVM = combo.getText();
- if (showPreferencePage()) {
- updateJREs();
- combo.setItems(jreNames);
- combo.setText(currentVM);
- if (combo.getSelectionIndex() == -1)
- combo.select(defaultVMIndex);
- }
- }
- });
-
- init();
- validate();
-
- Dialog.applyDialogFont(this);
-
- name.forceFocus();
- }
-
- protected void updateJREs() {
- // get all installed JVMs
- installedJREs = new ArrayList();
- IVMInstallType[] vmInstallTypes = JavaRuntime.getVMInstallTypes();
- int size = vmInstallTypes.length;
- for (int i = 0; i < size; i++) {
- IVMInstall[] vmInstalls = vmInstallTypes[i].getVMInstalls();
- int size2 = vmInstalls.length;
- for (int j = 0; j < size2; j++) {
- installedJREs.add(vmInstalls[j]);
- }
- }
-
- // get names
- size = installedJREs.size();
- jreNames = new String[size];
- for (int i = 0; i < size; i++) {
- IVMInstall vmInstall = (IVMInstall) installedJREs.get(i);
- jreNames[i] = vmInstall.getName();
- }
-
- IVMInstall defaultVM = JavaRuntime.getDefaultVMInstall();
- defaultVMIndex = installedJREs.indexOf(defaultVM);
- }
-
- protected boolean showPreferencePage() {
- PreferenceManager manager = PlatformUI.getWorkbench().getPreferenceManager();
- IPreferenceNode node = manager.find("org.eclipse.jdt.ui.preferences.JavaBasePreferencePage").findSubNode("org.eclipse.jdt.debug.ui.preferences.VMPreferencePage");
- PreferenceManager manager2 = new PreferenceManager();
- manager2.addToRoot(node);
- final PreferenceDialog dialog = new PreferenceDialog(getShell(), manager2);
- final boolean[] result = new boolean[] { false };
- BusyIndicator.showWhile(getDisplay(), new Runnable() {
- public void run() {
- dialog.create();
- if (dialog.open() == Window.OK)
- result[0] = true;
- }
- });
- return result[0];
- }
-
- protected void init() {
- if (installDir == null || runtime == null)
- return;
-
- name.setText(runtimeWC.getName());
-
- if (runtimeWC.getLocation() != null)
- installDir.setText(runtimeWC.getLocation().toOSString());
- else
- installDir.setText("");
-
- // set selection
- boolean found = false;
- int size = installedJREs.size();
- for (int i = 0; i < size; i++) {
- IVMInstall vmInstall = (IVMInstall) installedJREs.get(i);
- if (vmInstall.equals(runtime.getVMInstall())) {
- combo.select(i);
- found = true;
- }
- }
- if (!found)
- combo.select(defaultVMIndex);
- }
-
- protected void validate() {
- if (runtime == null) {
- wizard.setMessage("", IMessageProvider.ERROR);
- return;
- }
-
- IStatus status = runtimeWC.validate(null);
- if (status == null || status.isOK())
- wizard.setMessage(null, IMessageProvider.NONE);
- else
- wizard.setMessage(status.getMessage(), IMessageProvider.ERROR);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.ui/sjavaui/org/eclipse/jst/server/ui/internal/GenericRuntimeWizardFragment.java b/plugins/org.eclipse.jst.server.ui/sjavaui/org/eclipse/jst/server/ui/internal/GenericRuntimeWizardFragment.java
deleted file mode 100644
index af60495..0000000
--- a/plugins/org.eclipse.jst.server.ui/sjavaui/org/eclipse/jst/server/ui/internal/GenericRuntimeWizardFragment.java
+++ /dev/null
@@ -1,53 +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.jst.server.ui.internal;
-
-import org.eclipse.wst.server.core.*;
-import org.eclipse.wst.server.ui.wizard.IWizardHandle;
-import org.eclipse.wst.server.ui.wizard.WizardFragment;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.swt.widgets.Composite;
-/**
- *
- */
-public class GenericRuntimeWizardFragment extends WizardFragment {
- protected GenericRuntimeComposite comp;
-
- public GenericRuntimeWizardFragment() {
- // do nothing
- }
-
- public boolean hasComposite() {
- return true;
- }
-
- public Composite createComposite(Composite parent, IWizardHandle wizard) {
- comp = new GenericRuntimeComposite(parent, wizard);
- return comp;
- }
-
- 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.isOK());
- }
-
- public void enter() {
- if (comp != null) {
- IRuntimeWorkingCopy runtime = (IRuntimeWorkingCopy) getTaskModel().getObject(TaskModel.TASK_RUNTIME);
- comp.setRuntime(runtime);
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.ui/sjavaui/org/eclipse/jst/server/ui/internal/ImageResource.java b/plugins/org.eclipse.jst.server.ui/sjavaui/org/eclipse/jst/server/ui/internal/ImageResource.java
deleted file mode 100644
index afb3668..0000000
--- a/plugins/org.eclipse.jst.server.ui/sjavaui/org/eclipse/jst/server/ui/internal/ImageResource.java
+++ /dev/null
@@ -1,123 +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.jst.server.ui.internal;
-
-import java.net.URL;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.Iterator;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-/**
- * Utility class to handle image resources.
- */
-public class ImageResource {
- // the image registry
- private static ImageRegistry imageRegistry;
-
- // map of image descriptors since these
- // will be lost by the image registry
- private static Map imageDescriptors;
-
- // map of IElement images
- private static Map elementImages;
-
- // base urls for images
- private static URL ICON_BASE_URL;
-
- static {
- try {
- String pathSuffix = "icons/";
- ICON_BASE_URL = JavaServerUIPlugin.getInstance().getBundle().getEntry(pathSuffix);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not set icon base URL", e);
- }
- }
-
- private static final String URL_WIZBAN = "wizban/";
-
- // Java images
- public static final String IMG_RUNTIME_TYPE = "runtimeType";
-
- /**
- * Cannot construct an ImageResource. Use static methods only.
- */
- private ImageResource() {
- // do nothing
- }
-
- /**
- * Dispose of element images that were created.
- */
- protected static void dispose() {
- try {
- Trace.trace(Trace.FINEST, "Disposing of element images");
- Iterator iterator = elementImages.values().iterator();
- while (iterator.hasNext()) {
- Image image = (Image) iterator.next();
- image.dispose();
- }
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Could not dispose of images");
- }
- }
-
- /**
- * Return the image with the given key.
- *
- * @param key java.lang.String
- * @return org.eclipse.swt.graphics.Image
- */
- public static Image getImage(String key) {
- if (imageRegistry == null)
- initializeImageRegistry();
- return imageRegistry.get(key);
- }
-
- /**
- * Return the image descriptor with the given key.
- *
- * @param key java.lang.String
- * @return org.eclipse.jface.resource.ImageDescriptor
- */
- public static ImageDescriptor getImageDescriptor(String key) {
- if (imageRegistry == null)
- initializeImageRegistry();
- return (ImageDescriptor) imageDescriptors.get(key);
- }
-
- /**
- * Initialize the image resources.
- */
- protected static void initializeImageRegistry() {
- imageRegistry = new ImageRegistry();
- imageDescriptors = new HashMap();
-
- registerImage(IMG_RUNTIME_TYPE, URL_WIZBAN + "new_runtime_wiz.gif");
- }
-
- /**
- * Register an image with the registry.
- *
- * @param key java.lang.String
- * @param partialURL java.lang.String
- */
- private static void registerImage(String key, String partialURL) {
- try {
- ImageDescriptor id = ImageDescriptor.createFromURL(new URL(ICON_BASE_URL, partialURL));
- imageRegistry.put(key, id);
- imageDescriptors.put(key, id);
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Error registering image " + key + " from " + partialURL, e);
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.ui/sjavaui/org/eclipse/jst/server/ui/internal/JavaServerUIPlugin.java b/plugins/org.eclipse.jst.server.ui/sjavaui/org/eclipse/jst/server/ui/internal/JavaServerUIPlugin.java
deleted file mode 100644
index 9bc843d..0000000
--- a/plugins/org.eclipse.jst.server.ui/sjavaui/org/eclipse/jst/server/ui/internal/JavaServerUIPlugin.java
+++ /dev/null
@@ -1,81 +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.jst.server.ui.internal;
-
-import java.text.MessageFormat;
-import org.eclipse.core.runtime.*;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-/**
- * The main server tooling plugin class.
- */
-public class JavaServerUIPlugin extends AbstractUIPlugin {
- // server java plugin id
- public static final String PLUGIN_ID = "org.eclipse.jst.server.ui";
-
- // singleton instance of this class
- private static JavaServerUIPlugin singleton;
-
- /**
- * Create the JavaServerUIPlugin.
- */
- public JavaServerUIPlugin() {
- super();
- singleton = this;
- }
-
- /**
- * Returns the singleton instance of this plugin.
- *
- * @return org.eclipse.jst.server.ui.JavaServerUIPlugin
- */
- public static JavaServerUIPlugin getInstance() {
- return singleton;
- }
-
- /**
- * Returns the translated String found with the given key.
- *
- * @param key java.lang.String
- * @return java.lang.String
- */
- public static String getResource(String key) {
- try {
- return Platform.getResourceString(getInstance().getBundle(), key);
- } catch (Exception e) {
- return key;
- }
- }
- /**
- * Returns the translated String found with the given key,
- * and formatted with the given arguments using java.text.MessageFormat.
- *
- * @param key java.lang.String
- * @param arguments java.lang.Object[]
- * @return java.lang.String
- */
- public static String getResource(String key, Object[] arguments) {
- try {
- String text = getResource(key);
- return MessageFormat.format(text, arguments);
- } catch (Exception e) {
- return key;
- }
- }
-
- /**
- * Convenience method for logging.
- *
- * @param status org.eclipse.core.runtime.IStatus
- */
- public static void log(IStatus status) {
- getInstance().getLog().log(status);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.ui/sjavaui/org/eclipse/jst/server/ui/internal/SWTUtil.java b/plugins/org.eclipse.jst.server.ui/sjavaui/org/eclipse/jst/server/ui/internal/SWTUtil.java
deleted file mode 100644
index b277e1e..0000000
--- a/plugins/org.eclipse.jst.server.ui/sjavaui/org/eclipse/jst/server/ui/internal/SWTUtil.java
+++ /dev/null
@@ -1,55 +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.jst.server.ui.internal;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.FontMetrics;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-/**
- * SWT Utility class.
- */
-public class SWTUtil {
- private static FontMetrics fontMetrics;
-
- protected static void initializeDialogUnits(Control testControl) {
- // Compute and store a font metric
- GC gc = new GC(testControl);
- gc.setFont(JFaceResources.getDialogFont());
- fontMetrics = gc.getFontMetrics();
- gc.dispose();
- }
-
- /**
- * Returns a width hint for a button control.
- */
- protected static int getButtonWidthHint(Button button) {
- int widthHint = Dialog.convertHorizontalDLUsToPixels(fontMetrics, IDialogConstants.BUTTON_WIDTH);
- return Math.max(widthHint, button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
- }
-
- public static Button createButton(Composite comp, String label) {
- Button b = new Button(comp, SWT.PUSH);
- b.setText(label);
- if (fontMetrics == null)
- initializeDialogUnits(comp);
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- data.widthHint = getButtonWidthHint(b);
- b.setLayoutData(data);
- return b;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.ui/sjavaui/org/eclipse/jst/server/ui/internal/Trace.java b/plugins/org.eclipse.jst.server.ui/sjavaui/org/eclipse/jst/server/ui/internal/Trace.java
deleted file mode 100644
index 20ede83..0000000
--- a/plugins/org.eclipse.jst.server.ui/sjavaui/org/eclipse/jst/server/ui/internal/Trace.java
+++ /dev/null
@@ -1,51 +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.jst.server.ui.internal;
-/**
- * Helper class to route trace output.
- */
-public class Trace {
- public static byte CONFIG = 0;
- public static byte WARNING = 1;
- public static byte SEVERE = 2;
- public static byte FINEST = 3;
-
- /**
- * Trace constructor comment.
- */
- private Trace() {
- super();
- }
-
- /**
- * Trace the given text.
- *
- * @param s java.lang.String
- */
- public static void trace(byte level, String s) {
- Trace.trace(level, s, null);
- }
-
- /**
- * Trace the given message and exception.
- *
- * @param s java.lang.String
- * @param t java.lang.Throwable
- */
- public static void trace(byte level, String s, Throwable t) {
- if (!JavaServerUIPlugin.getInstance().isDebugging())
- return;
-
- System.out.println(s);
- if (t != null)
- t.printStackTrace();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/.classpath b/plugins/org.eclipse.wst.internet.monitor.core/.classpath
deleted file mode 100644
index 1d974a9..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="monitorcore/"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/.cvsignore b/plugins/org.eclipse.wst.internet.monitor.core/.cvsignore
deleted file mode 100644
index 8ca260d..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/.cvsignore
+++ /dev/null
@@ -1,5 +0,0 @@
-bin
-monitorcore.jar
-build.xml
-temp.folder
-org.eclipse.wst.internet.monitor.core_3.0.0.jar
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/.options b/plugins/org.eclipse.wst.internet.monitor.core/.options
deleted file mode 100644
index 47070ee..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/.options
+++ /dev/null
@@ -1,6 +0,0 @@
-# Debugging options for the org.eclipse.wst.internet.monitor.core plugin
-
-# Turn on general debugging
-org.eclipse.wst.internet.monitor.core/debug=true
-
-org.eclipse.wst.internet.monitor.core/parsing=false
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/.project b/plugins/org.eclipse.wst.internet.monitor.core/.project
deleted file mode 100644
index 93b239c..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.internet.monitor.core</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/build.properties b/plugins/org.eclipse.wst.internet.monitor.core/build.properties
deleted file mode 100644
index f8cb62c..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/build.properties
+++ /dev/null
@@ -1,20 +0,0 @@
-###############################################################################
-# Copyright (c) 2004 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
-###############################################################################
-bin.includes = plugin.xml,\
- *.jar,\
- monitorcore.jar,\
- plugin.properties,\
- .options
-jars.compile.order =
-src.includes = build.properties,\
- schema/
-output.monitorcore.jar = bin/
-source.monitorcore.jar = monitorcore/
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/ContentFilterDelegate.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/ContentFilterDelegate.java
deleted file mode 100644
index f4e08e4..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/ContentFilterDelegate.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2004, 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.internet.monitor.core;
-
-import java.io.IOException;
-/**
- * A content filter that filters contents from the monitor traffic on a request.
- * <p>
- * This abstract class is intended to be subclassed only by clients
- * to extend the <code>contentFilters</code> extension point.
- * The subclass must have a public 0-argument constructor, which will be used
- * automatically to instantiate the delegate when required.
- * </p>
- * <p>
- * [issue: The notion of content filters is a UI/presentation
- * concern, not something that is makes sense to have as core
- * functionality. The contentFilters extension point, IContentFilter,
- * and ContentFilterDelegate should all move to the o.e.wst.internet.monitor.ui
- * plug-in.]
- * [issue: CS - I'd echo the comment above that this seems like a UI concern.
- * I noticed there's also a viewer on the UI side, so i'm not sure how these would interact.
- * I assume that filters operate on the byte stream and aren't concerned with UI presentation...
- * but usually UI's and filters are tightly coupled.
- * </p>
- *
- * @since 1.0
- */
-public abstract class ContentFilterDelegate {
- /**
- * Filter the given content from the given request. The content that has been filtered out will
- * not be shown to clients of the TCP/IP monitor.
- *
- * @param request the request that the filter will be performed on
- * @param isRequest set to true if the content filter applies to request monitor traffic,
- * or set to false if the content filter applies to the response monitor traffic
- * @param content the message content to be filtered out
- * @return the filtered content
- * @throws IOException if there is an error while parsing or filtering the content
- */
- public abstract byte[] filter(Request request, boolean isRequest, byte[] content) throws IOException;
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/IMonitor.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/IMonitor.java
deleted file mode 100644
index e46d882..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/IMonitor.java
+++ /dev/null
@@ -1,197 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.internet.monitor.core;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-/**
- * Represents a monitor between a client and server.
- * The monitor watches all network traffic between a local client (talking
- * on a given local port) and a remote server (identified by host and port).
- * The global list of known monitors is available via {@link MonitorCore#getMonitors()}.
- * IMonitor is thread-safe.
- * <p>
- * IMonitors are read-only. To make changes to a monitor, you must create an
- * IMonitorWorkingCopy by calling createWorkingCopy(). Changes to the working copy
- * are applied when the working copy is saved. Monitors and monitor working copies
- * have the following properties:
- * * equals() returns true for a monitor and it's working copy
- * <p>
- * [issue: Why the built-in assumption that the client is local? A monitor
- * would make just as much sense sitting between a client on a remote machine
- * and a server.]
- * </p>
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- * @see IMonitorWorkingCopy
- * @since 1.0
- */
-public interface IMonitor {
- /**
- * Returns the id of this monitor.
- * Each monitor has a distinct, fixed id. Ids are intended to be used internally as keys;
- * they are not intended to be shown to end users.
- *
- * @return the monitor id
- */
- public String getId();
-
- /**
- * Returns the remote host name of the server being monitored.
- *
- * @return the remote host name
- */
- public String getRemoteHost();
-
- /**
- * Returns the remote port number of the server being monitored.
- *
- * @return the remote port number
- */
- public int getRemotePort();
-
- /**
- * Returns the local port number of the client being monitored. This
- * is the port that the client is talking to the remote server on.
- *
- * @return the local port number
- */
- public int getLocalPort();
-
- /**
- * Returns the protocol that this monitor uses to read network
- * traffic.
- *
- * @return the protocol id
- */
- public String getProtocol();
-
- /**
- * Returns whether this monitor is currently running. Monitor working
- * copies will always return false (since they cannot be run).
- *
- * @return <code>true</code> if the monitor is currently running, or
- * <code>false</code> otherwise
- */
- public boolean isRunning();
-
- /**
- * Deletes this monitor. The monitor will no longer be available to clients.
- * If the monitor is currently running, it will be stopped first.
- * This method has no effect if the monitor has already been deleted or if
- * it is called on a working copy. Clients have no obligation to delete
- * working copies.
- */
- public void delete();
-
- /**
- * Returns whether this monitor is a working copy. Monitors which return
- * <code>true</code> to this method can be safely cast to
- * {@link IMonitorWorkingCopy}.
- *
- * @return <code>true</code> if this monitor is a working copy, and
- * <code>false</code> otherwise
- */
- public boolean isWorkingCopy();
-
- /**
- * Returns a working copy for this monitor. If the receiver is not a
- * working copy, a new working copy will be created and initialized to have
- * the same attributes as this monitor. If the receiver is a working copy,
- * this method simply returns the receiver. After configuring attributes on
- * the working copy, calling {@link IMonitorWorkingCopy#save()} applies
- * the changes to the original monitor.
- *
- * @return a working copy of this monitor
- */
- public IMonitorWorkingCopy createWorkingCopy();
-
- /**
- * Starts the given monitor listening on its client port. This method is
- * synchronous and the monitor will be running and ready for use by the
- * time that the method returns. This method has no effect if the monitor
- * is already running.
- * <p>
- * A CoreException is thrown if the monitor is not valid, the local port
- * is in use, or if another problem occurs when starting the monitor.
- * </p>
- * <p>
- * This method must not be called on a working copy or after the monitor
- * has been deleted.
- * </p>
- *
- * @throws CoreException thrown if the monitor's properties are invalid,
- * if it fails to start because the port is in use, or another problem occurs
- */
- public void start() throws CoreException;
-
- /**
- * Stops the given monitor and frees up all underlying operating
- * system resources. This method is synchronous and the monitor will be
- * running and ready for use by the time that the method returns.
- * This method has no effect if the monitor was not already running.
- * <p>
- * After returning from this method, the monitor may be restarted at
- * any time. This method must not be called on a working copy or after
- * the monitor has been deleted.
- * </p>
- */
- public void stop();
-
- /**
- * Adds a request listener.
- * Once registered, a listener starts receiving notification of
- * changes to the global list of requests. The listener continues to receive
- * notifications until it is removed.
- * Has no effect if an identical listener is already registered.
- * <p>
- * If a listener is added to a working copy, it will automatically be added
- * to the original monitor. If the monitor does not exist yet (when the working
- * copy was just created from MonitorCore.createMonitor()), the listener will
- * be added to the created monitor when (if) the working copy is saved.
- * </p>
- *
- * @param listener the request listener
- * @see #removeRequestListener(IRequestListener)
- */
- public void addRequestListener(IRequestListener listener);
-
- /**
- * Removes the given request listener. Has no effect if the listener is
- * not registered.
- * <p>
- * If a listener is removed from a working copy, it will automatically be
- * removed from the corresponding original monitor. Removing a monitor from
- * a newly created monitor has no effect unless the monitor had already been
- * added, in which case it is removed from notification and will not be added
- * to the created monitor when (if) the working copy is saved.
- * </p>
- *
- * @param listener the listener
- * @see #addRequestListener(IRequestListener)
- */
- public void removeRequestListener(IRequestListener listener);
-
- /**
- * Validates this monitor. This method should return an error if the monitor
- * has invalid ports or remote hostname.
- * <p>
- * This method is not on the working copy so that the runtime can be validated
- * at any time.
- * </p>
- *
- * @return a status object with code <code>IStatus.OK</code> if this
- * runtime is valid, otherwise a status object indicating what is
- * wrong with it
- */
- public IStatus validate();
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/IMonitorListener.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/IMonitorListener.java
deleted file mode 100644
index 5ba3e5c..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/IMonitorListener.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.internet.monitor.core;
-/**
- * Listener for global changes affecting monitors.
- * <p>
- * Clients should implement this interface and register
- * their listener via {@link MonitorCore#addMonitorListener(IMonitorListener)}.
- * </p>
- *
- * @since 1.0
- */
-public interface IMonitorListener {
-
- /**
- * Notification that the given monitor has been created (added to the
- * global list of known monitors).
- *
- * @param monitor the newly-created monitor
- */
- public void monitorAdded(IMonitor monitor);
-
- /**
- * Notification that the given monitor has been changed.
- * Note that the monitor is never a working copy.
- *
- * @param monitor the monitor that has been changed
- */
- public void monitorChanged(IMonitor monitor);
-
- /**
- * Notification that the given monitor has been deleted (removed
- * from the global list of known monitors).
- *
- * @param monitor the monitor that has been deleted
- */
- public void monitorRemoved(IMonitor monitor);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/IMonitorWorkingCopy.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/IMonitorWorkingCopy.java
deleted file mode 100644
index e81ae35..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/IMonitorWorkingCopy.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.internet.monitor.core;
-
-import org.eclipse.core.runtime.CoreException;
-/**
- * Represents a working copy of a monitor. A working copy is a copy that the
- * attributes can be changed.
- * IMonitorWorkingCopy is thread-safe. However, working copies instances
- * should be short-lived to reduce the chance of multiple working copies
- * being created by different clients and one client overwritting changes
- * made to the other working copy.
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- * @see IMonitor
- * @since 1.0
- *
- * [issue : CS - it sounds like this is something useful for creating monitors.
- * Shouldn't this be called a IMonitorConfiguration? Is there an advantage to making
- * this actually seem to be a IMonitor? Perhaps some UI convenience?
- * Is a IMonitorWorkingCopy actually 'useable' for monitoring .. or is it really just a configuration? ]
- */
-public interface IMonitorWorkingCopy extends IMonitor {
- /**
- * Returns the original monitor that this working copy corresponds to, or
- * <code>null</code> if this working copy was just created from
- * MonitorCore.createMonitor().
- *
- * @return the original monitor, or <code>null</code> if this working copy
- * was just created
- */
- public IMonitor getOriginal();
-
- /**
- * Sets the local port number of the client to be monitored.
- *
- * @param port the local (client) port number
- * @see IMonitor#getLocalPort()
- */
- public void setLocalPort(int port);
-
- /**
- * Sets the remote host name of the server to be monitored.
- *
- * @param host the new remote host name
- * @see IMonitor#getRemoteHost()
- */
- public void setRemoteHost(String host);
-
- /**
- * Sets the remote port number of the server to be monitored.
- *
- * @param port the new remote port number
- * @see IMonitor#getRemotePort()
- */
- public void setRemotePort(int port);
-
- /**
- * Sets the protocol to be used to read network
- * traffic between the server and the client.
- *
- * @param protocolId the protocol id
- * @see IMonitor#getProtocol()
- */
- public void setProtocol(String protocolId);
-
- /**
- * Saves the changes made to this working copy.
- * For a brand new working copy (created by
- * {@link MonitorCore#createMonitor()}, and not yet saved), this method
- * creates a new monitor instance with attributes matching this working copy.
- * For a working copy cloned from an existing monitor instance (by
- * {@link IMonitor#createWorkingCopy()}), this method stops the existing
- * monitor (using {@link IMonitor#stop()}) if necessary,
- * and then sets the attributes of the monitor instance to match this
- * working copy (the monitor instance is returned).
- * <p>
- * Saving a working copy for a monitor that was already deleted will cause
- * the monitor to get recreated (with any changes in the working copy).
- * </p>
- * <p>
- * This method throws a CoreException if there is a problem saving the
- * monitor. No validation checks occur when saving the monitor. This can be
- * done by calling IMonitor.validate() prior to saving.
- * </p>
- *
- * @return the affected monitor
- * @throws CoreException thrown if a problem occurs while saving the monitor
- */
- public IMonitor save() throws CoreException;
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/IRequestListener.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/IRequestListener.java
deleted file mode 100644
index b02b8b8..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/IRequestListener.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2004, 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.internet.monitor.core;
-/**
- * Listener for new or modified requests created from a single monitor.
- * Each request represents message traffic between a monitored client
- * and server.
- * <p>
- * Requests are not persisted - they only exist in this API until the
- * connection is done. An initial requestAdded() event is fired when the
- * request is created (by the client creating a connection), and then
- * requestChanged() events occur as data is passed through the request
- * or changes are made to the request's properties.
- * </p>
- *
- * @see IMonitor#addRequestListener(IRequestListener)
- * @since 1.0
- */
-public interface IRequestListener {
- /**
- * Notification that the given request was created.
- * <p>
- * Requests may be created with little to no data in them.
- * As additional information is available, the
- * <code>requestChanged</code> method is called.
- * </p>
- *
- * @param monitor the monitor from which the request was initiated
- * @param request the request that has been added
- */
- public void requestAdded(IMonitor monitor, Request request);
-
- /**
- * Notification that the given request has been changed.
- * This method is called when more data is available in the
- * request.
- * <p>
- * Individual values within the request are rarely modified.
- * This method may be called when they are initially set or
- * when more data is received from the client or server.
- * </p>
- *
- * @param monitor the monitor from which the request was initiated
- * @param request the request that has been changed
- */
- public void requestChanged(IMonitor monitor, Request request);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/MonitorCore.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/MonitorCore.java
deleted file mode 100644
index 6afc49a..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/MonitorCore.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2004, 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.internet.monitor.core;
-
-import java.util.List;
-
-import org.eclipse.wst.internet.monitor.core.internal.MonitorManager;
-/**
- * Main class for creating new monitors and locating existing ones. The methods on
- * this class are thread safe.
- * <p>
- * This class provides all functionality through static members. It is not intended
- * to be instantiated or subclassed.
- * </p>
- *
- * @since 1.0
- */
-public final class MonitorCore {
- private static MonitorManager manager;
-
- /**
- * Cannot create MonitorCore - use static methods.
- */
- private MonitorCore() {
- // can't create
- }
-
- /**
- * Returns a monitor manager instance.
- *
- * @return the monitor manager
- */
- private static MonitorManager getManager() {
- if (manager == null)
- manager = MonitorManager.getInstance();
- return manager;
- }
-
- /**
- * Returns a list of all known monitor instances. The list will not contain any
- * working copies and is persisted between workbench sessions.
- * <p>
- * A new array is returned on each call; clients may safely store or modify the result.
- * </p>
- *
- * @return a possibly-empty array of monitor instances
- */
- public static IMonitor[] getMonitors() {
- List list = getManager().getMonitors();
- IMonitor[] m = new IMonitor[list.size()];
- list.toArray(m);
- return m;
- }
-
- /**
- * Creates a new monitor working copy. After configuring parameters on
- * the working copy, calling {@link IMonitorWorkingCopy#save()} brings
- * the monitor into existence.
- * <p>
- * Note that the client is responsible for calling {@link IMonitor#delete()}
- * to delete the monitor once it is no longer needed.
- * </p>
- * <p>
- * When monitors are created, the local and remote port values default to
- * <code>80</code>, but they do not have a protocol or remote host (values
- * are <code>null</code>).
- * </p>
- *
- * @return a monitor working copy
- */
- public static IMonitorWorkingCopy createMonitor() {
- return getManager().createMonitor();
- }
-
- /**
- * Adds a monitor listener.
- * Once registered, a listener starts receiving notification of
- * changes to the monitors. The listener continues to receive
- * notifications until it is removed.
- * Has no effect if an identical listener is already registered.
- *
- * @param listener the monitor listener
- * @see #removeMonitorListener(IMonitorListener)
- */
- public static void addMonitorListener(IMonitorListener listener) {
- if (listener == null)
- throw new IllegalArgumentException();
- getManager().addMonitorListener(listener);
- }
-
- /**
- * Removes the given monitor listener. Has no
- * effect if the listener is not registered.
- *
- * @param listener the listener
- * @see #addMonitorListener(IMonitorListener)
- */
- public static void removeMonitorListener(IMonitorListener listener) {
- if (listener == null)
- throw new IllegalArgumentException();
- getManager().removeMonitorListener(listener);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/Request.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/Request.java
deleted file mode 100644
index b6388a7..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/Request.java
+++ /dev/null
@@ -1,344 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2004, 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.internet.monitor.core;
-
-import java.util.Date;
-import java.util.Properties;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.internet.monitor.core.internal.Monitor;
-import org.eclipse.wst.internet.monitor.core.internal.Trace;
-/**
- * Represents a TCP/IP request made between the client and the server.
- * Each request represents a request-response pair, where the request
- * is from client -> server, and the response is from server -> client.
- * <p>
- * Requests are created by a running monitor. They do not have a reference
- * back to the monitor because the monitor may have been deleted or modified
- * since the request was created.
- * </p>
- * <p>
- * This interface is intended to be extended only by clients
- * to extend the <code>protocolAdapters</code> extension point.
- * </p>
- *
- * @since 1.0
- */
-public class Request implements IAdaptable {
- protected Monitor monitor;
- protected Date date;
- protected long responseTime = -1;
- protected int localPort;
- protected String remoteHost;
- protected int remotePort;
- protected byte[] request;
- protected byte[] response;
-
- protected String name;
- protected String protocolId;
-
- protected Properties properties;
-
- /**
- * Request2 content type (value 1) for the transport (header) of a request
- * or response.
- *
- * @see #getRequest(int)
- * @see #getResponse(int)
- */
- public static final int TRANSPORT = 1;
-
- /**
- * Request2 content type (value 2) for the content (body) of a request
- * or response.
- *
- * @see #getRequest(int)
- * @see #getResponse(int)
- */
- public static final int CONTENT = 2;
-
- /**
- * Request2 content type (value 3) for the entire content of a request
- * or response.
- *
- * @see #getRequest(int)
- * @see #getResponse(int)
- */
- public static final int ALL = 3;
-
- /**
- * Create a new Request.
- */
- public Request(Monitor monitor, String protocolId, int localPort, String remoteHost, int remotePort) {
- super();
- this.monitor = monitor;
- this.protocolId = protocolId;
- this.localPort = localPort;
- this.remoteHost = remoteHost;
- this.remotePort = remotePort;
- date = new Date();
- properties = new Properties();
- if (monitor != null)
- monitor.addRequest(this);
- }
-
- /**
- * Returns the protocol responsible for creating this request.
- *
- * @return the protocol id
- */
- public String getProtocol() {
- return protocolId;
- }
-
- /**
- * Returns the time this request was made.
- *
- * @return the timestamp
- */
- public Date getDate() {
- return date;
- }
-
- /**
- * Returns the local (client) port.
- *
- * @return the local port number
- */
- public int getLocalPort() {
- return localPort;
- }
-
- /**
- * Returns the remote (server) host.
- *
- * @return the remote host
- */
- public String getRemoteHost() {
- return remoteHost;
- }
-
- /**
- * Returns the remote (server) port.
- *
- * @return the remote port number
- */
- public int getRemotePort() {
- return remotePort;
- }
-
- /**
- * Returns the selected content of the request portion of this request.
- * <p>
- * [issue: I don't know how to explain this. For basic TCP/IP requests,
- * distinction between transport and content is ignored.
- * For HTTP requests, this TRANSPORT returns just the HTTP header and
- * CONTENT returns just the HTTP body without the headers. What would
- * it mean for other protocols?
- * </p>
- *
- * @param type the content type: one of {@link #TRANSPORT},
- * {@link #CONTENT}, or {@link #ALL}
- * @return the content bytes
- */
- public byte[] getRequest(int type) {
- return request;
- }
-
- /**
- * Returns the selected content of the response portion of this request.
- * <p>
- * [issue: I don't know how to explain this. For basic TCP/IP requests,
- * distinction between transport and content is ignored.
- * For HTTP requests, this TRANSPORT returns just the HTTP header and
- * CONTENT returns just the HTTP body without the headers. What would
- * it mean for other protocols?]
- * </p>
- *
- * @param type the content type: one of {@link #TRANSPORT},
- * {@link #CONTENT}, or {@link #ALL}
- * @return the content bytes
- */
- public byte[] getResponse(int type) {
- return response;
- }
-
- /**
- * Returns the server's response time in milliseconds. If the request
- * has not been completed yet, -1 is returned.
- *
- * @return the server's response time, or -1 if there has been no
- * response yet
- */
- public long getResponseTime() {
- return responseTime;
- }
-
- /**
- * Returns a name for this request.
- *
- * @return the name
- */
- public String getName() {
- if (name == null)
- return getRemoteHost() + ":" + getRemotePort();
-
- return name;
- }
-
- /**
- * Sets the name of this request.
- *
- * @param n the name
- */
- protected void setName(String n) {
- name = n;
- }
-
- /**
- * Sets the given key-value property on this request. To remove a property,
- * set the value to null.
- * <p>
- * This method is typically called by protocol adapters to attach protocol-
- * specific fields to the request, but it may be called by any client.
- * </p>
- *
- * @param key the key
- * @param value the value
- */
- public void setProperty(String key, Object value) {
- try {
- if (properties.containsKey(key))
- properties.remove(key);
- if (value != null)
- properties.put(key, value);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not add property", e);
- }
- }
-
- /**
- * Returns the value of the property with the given key from this request.
- * If the key does not exist, <code>null</code> is returned.
- *
- * @param key the property key
- * @return the property value
- */
- public Object getProperty(String key) {
- try {
- return properties.get(key);
- } catch (Exception e) {
- return null;
- }
- }
-
- /**
- * Add to the request.
- *
- * @param addRequest byte[]
- */
- public void addToRequest(byte[] addRequest) {
- if (addRequest == null || addRequest.length == 0)
- return;
-
- if (request == null || request.length == 0) {
- setRequest(addRequest);
- return;
- }
-
- int size = request.length + addRequest.length;
- byte[] b = new byte[size];
- System.arraycopy(request, 0, b, 0, request.length);
- System.arraycopy(addRequest, 0, b, request.length, addRequest.length);
- request = b;
- fireChangedEvent();
- }
-
- /**
- * Add to the response.
- *
- * @param addResponse byte[]
- */
- public void addToResponse(byte[] addResponse) {
- if (addResponse == null || addResponse.length == 0)
- return;
-
- if (response == null || response.length == 0) {
- setResponse(addResponse);
- return;
- }
-
- int size = response.length + addResponse.length;
- byte[] b = new byte[size];
- System.arraycopy(response, 0, b, 0, response.length);
- System.arraycopy(addResponse, 0, b, response.length, addResponse.length);
- response = b;
- fireChangedEvent();
- }
-
- /**
- * Set the request.
- *
- * @param request byte[]
- */
- protected void setRequest(byte[] request) {
- if (request == null || request.length == 0)
- return;
-
- this.request = request;
- monitor.requestChanged(this);
- }
-
- /**
- * Set the response.
- *
- * @param response byte[]
- */
- protected void setResponse(byte[] response) {
- if (response == null || response.length == 0)
- return;
-
- this.response = response;
- responseTime = System.currentTimeMillis() - date.getTime();
- monitor.requestChanged(this);
- }
-
- /**
- * Returns the monitor that created this request.
- * Change events will be fired from this monitor.
- * <p>
- * Note that the monitor may have been editted since this
- * request was created, so you cannot rely on the monitor's
- * hostname or port values.
- * </p>
- *
- * @return the monitor that created this request
- */
- public IMonitor getMonitor() {
- return monitor;
- }
-
- /**
- * Fire a change event to notify monitor listeners that the request has changed.
- */
- protected void fireChangedEvent() {
- if (monitor != null)
- monitor.requestChanged(this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
- */
- public Object getAdapter(Class adapter) {
- return Platform.getAdapterManager().getAdapter(this, adapter);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/AcceptThread.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/AcceptThread.java
deleted file mode 100644
index 30ce3d2..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/AcceptThread.java
+++ /dev/null
@@ -1,131 +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.internet.monitor.core.internal;
-
-import java.io.InterruptedIOException;
-import java.net.*;
-
-import org.eclipse.wst.internet.monitor.core.IMonitor;
-/**
- * The actual TCP/IP monitoring server. This is a thread that
- * listens on a port and relays a call to another server.
- */
-public class AcceptThread {
- protected IMonitor monitor;
-
- protected boolean alive = true;
- protected ServerSocket serverSocket;
-
- protected Thread thread;
-
- class ServerThread extends Thread{
- /**
- * ServerThread accepts incoming connections and delegates to the protocol
- * adapter to deal with the connection.
- */
- public void run() {
- // create a new server socket
- try {
- serverSocket = new ServerSocket(monitor.getLocalPort());
- serverSocket.setSoTimeout(2000);
- Trace.trace(Trace.FINEST, "Monitoring localhost:" + monitor.getLocalPort() + " -> " + monitor.getRemoteHost()
- + ":" + monitor.getRemotePort());
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not start monitoring");
- return;
- }
-
- while (alive) {
- try {
- // accept the connection from the client
- Socket localSocket = serverSocket.accept();
-
- // connect to the remote server
- Socket remoteSocket = new Socket(monitor.getRemoteHost(), monitor.getRemotePort());
-
- // relay the call through
- String protocolId = monitor.getProtocol();
- ProtocolAdapter adapter = MonitorPlugin.getInstance().getProtocolAdapter(protocolId);
- adapter.connect(monitor, localSocket, remoteSocket);
- } catch (InterruptedIOException e) {
- // do nothing
- } catch (Exception e) {
- if (alive)
- Trace.trace(Trace.SEVERE, "Error while monitoring", e);
- }
- }
- }
- }
-
- /**
- * AcceptThread constructor comment.
- */
- public AcceptThread(IMonitor monitor) {
- super();
- this.monitor = monitor;
- }
-
- public void startServer() {
- if (thread != null)
- return;
- thread = new ServerThread();
- thread.setDaemon(true);
- thread.start();
- }
-
- public boolean isRunning() {
- return (thread != null);
- }
-
- /**
- * Correctly close the server socket and shut down the server.
- */
- public void stopServer() {
- try {
- alive = false;
- thread = null;
-
- String protocolId = monitor.getProtocol();
- ProtocolAdapter adapter = MonitorPlugin.getInstance().getProtocolAdapter(protocolId);
- adapter.disconnect(monitor);
- serverSocket.close();
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error stopping server", e);
- }
- }
-
- /**
- * Returns true if this port is in use.
- *
- * @return boolean
- * @param port int
- */
- public static boolean isPortInUse(int port) {
- ServerSocket s = null;
- try {
- s = new ServerSocket(port);
- } catch (SocketException e) {
- return true;
- } catch (Exception e) {
- return true;
- } finally {
- if (s != null) {
- try {
- s.close();
- } catch (Exception e) {
- // ignore
- }
- }
- }
-
- return false;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/Connection.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/Connection.java
deleted file mode 100644
index 78653f5..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/Connection.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 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.internet.monitor.core.internal;
-
-import java.net.Socket;
-/**
- *
- */
-public class Connection {
- protected Socket in;
- protected Socket out;
-
- public Connection(Socket in, Socket out) {
- this.in = in;
- this.out = out;
- }
-
- public void close() {
- Trace.trace(Trace.FINEST, "Closing connection");
- try {
- in.getOutputStream().flush();
- in.shutdownInput();
- in.shutdownOutput();
-
- out.getOutputStream().flush();
- out.shutdownInput();
- out.shutdownOutput();
- Trace.trace(Trace.FINEST, "Connection closed");
- } catch (Exception ex) {
- Trace.trace(Trace.WARNING, "Error closing connection " + this + " " + ex.getMessage());
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/ContentFilter.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/ContentFilter.java
deleted file mode 100644
index 28e727e..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/ContentFilter.java
+++ /dev/null
@@ -1,76 +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.internet.monitor.core.internal;
-
-import java.io.IOException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.wst.internet.monitor.core.ContentFilterDelegate;
-import org.eclipse.wst.internet.monitor.core.Request;
-/**
- *
- */
-public class ContentFilter implements IContentFilter {
- protected IConfigurationElement element;
- protected ContentFilterDelegate delegate;
-
- protected ContentFilter(IConfigurationElement element) {
- this.element = element;
- }
-
- /**
- * Return the id.
- *
- * @return the id
- */
- public String getId() {
- return element.getAttribute("id");
- }
-
- /*
- * Returns the relative order for this filter.
- */
- public int getOrder() {
- try {
- return Integer.parseInt(element.getAttribute("order"));
- } catch (Exception e) {
- return 0;
- }
- }
-
- /**
- * Returns the name.
- *
- * @return the name
- */
- public String getName() {
- return element.getAttribute("name");
- }
-
- /**
- * Do the filtering.
- *
- * @param request the request
- * @param isRequest true if request, false if response
- * @param content the content
- * @return the filtered content
- */
- public byte[] filter(Request request, boolean isRequest, byte[] content) throws IOException {
- if (delegate == null) {
- try {
- delegate = (ContentFilterDelegate) element.createExecutableExtension("class");
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not create content filter delegate: " + getId(), e);
- return new byte[0];
- }
- }
- return delegate.filter(request, isRequest, content);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/IContentFilter.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/IContentFilter.java
deleted file mode 100644
index fd89588..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/IContentFilter.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.internet.monitor.core.internal;
-
-import java.io.IOException;
-import org.eclipse.wst.internet.monitor.core.Request;
-/**
- * A content filter that filters specific contents from the monitor traffic
- * of a request.
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- * @since 1.0
- */
-public interface IContentFilter {
- /**
- * Returns the id of this filter.
- * Each filter has a distinct, fixed id. Ids are intended to be used internally as keys;
- * they are not intended to be shown to end users.
- *
- * @return the element id
- */
- public String getId();
-
- /**
- * Returns the displayable (translated) name for this filter.
- *
- * @return a displayable name
- */
- public String getName();
-
- /**
- * Returns the relative order of this filter.
- * Each filter has a relative order that allows them to be applied in the correct
- * order relative to each other. Lower orders are processed first.
- *
- * @return the relative order
- *
- * [issue: CS - The schema (contentFilterns.exsd) defines an 'order' attribute.
- * The comments above suggest that filters should be designed to be composable. Is this correct?
- * It would be good to make this optional if the user had no idea how his filter should be ordered.
- * I've found that sometimes 'low', 'medium', 'high' are adequate to handle ordering issues and are
- * easier for the extension writer deal with and get a sense of the proper value to assign. ]
- */
- //public int getOrder();
-
- /**
- * Filter the given content from the given request. The content that has been filtered out will
- * not be shown to clients of the TCP/IP monitor.
- *
- * @param request the request that the filter will be performed on
- * @param isRequest set to true if the content filter applies to request monitor traffic,
- * or set to false if the content filter applies to the response monitor traffic
- * @param content the message content to be filtered out
- * @return the filtered content
- * @throws IOException if there is an error while parsing or filtering the content
- */
- public byte[] filter(Request request, boolean isRequest, byte[] content) throws IOException;
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/IMemento.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/IMemento.java
deleted file mode 100644
index b6c1626..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/IMemento.java
+++ /dev/null
@@ -1,189 +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.internet.monitor.core.internal;
-
-import java.util.List;
-/**
- * Interface to a memento used for saving the important state of an object
- * in a form that can be persisted in the file system.
- * <p>
- * Mementos were designed with the following requirements in mind:
- * <ol>
- * <li>Certain objects need to be saved and restored across platform sessions.
- * </li>
- * <li>When an object is restored, an appropriate class for an object might not
- * be available. It must be possible to skip an object in this case.</li>
- * <li>When an object is restored, the appropriate class for the object may be
- * different from the one when the object was originally saved. If so, the
- * new class should still be able to read the old form of the data.</li>
- * </ol>
- * </p>
- * <p>
- * Mementos meet these requirements by providing support for storing a
- * mapping of arbitrary string keys to primitive values, and by allowing
- * mementos to have other mementos as children (arranged into a tree).
- * A robust external storage format based on XML is used.
- * </p><p>
- * The key for an attribute may be any alpha numeric value. However, the
- * value of <code>TAG_ID</code> is reserved for internal use.
- * </p><p>
- * This interface is not intended to be implemented by clients.
- * </p>
- */
-public interface IMemento {
- /**
- * Special reserved key used to store the memento id
- * (value <code>"org.eclipse.ui.id"</code>).
- *
- * @see #getId
- */
- public static final String TAG_ID = "IMemento.internal.id"; //$NON-NLS-1$
-
- /**
- * Creates a new child of this memento with the given type.
- * <p>
- * The <code>getChild</code> and <code>getChildren</code> methods
- * are used to retrieve children of a given type.
- * </p>
- *
- * @param type the type
- * @return a new child memento
- * @see #getChild
- * @see #getChildren
- */
- public IMemento createChild(String type);
-
- /**
- * Creates a new child of this memento with the given type and id.
- * The id is stored in the child memento (using a special reserved
- * key, <code>TAG_ID</code>) and can be retrieved using <code>getId</code>.
- * <p>
- * The <code>getChild</code> and <code>getChildren</code> methods
- * are used to retrieve children of a given type.
- * </p>
- *
- * @param type the type
- * @param id the child id
- * @return a new child memento with the given type and id
- * @see #getId
- */
- public IMemento createChild(String type, String id);
-
- /**
- * Returns the first child with the given type id.
- *
- * @param type the type id
- * @return the first child with the given type
- */
- public IMemento getChild(String type);
-
- /**
- * Returns all children with the given type id.
- *
- * @param type the type id
- * @return the list of children with the given type
- */
- public IMemento[] getChildren(String type);
-
- /**
- * Returns the floating point value of the given key.
- *
- * @param key the key
- * @return the value, or <code>null</code> if the key was not found or was found
- * but was not a floating point number
- */
- public Float getFloat(String key);
-
- /**
- * Returns the id for this memento.
- *
- * @return the memento id, or <code>null</code> if none
- * @see #createChild(java.lang.String,java.lang.String)
- */
- public String getId();
-
- /**
- * Returns the name for this memento.
- *
- * @return the memento name, or <code>null</code> if none
- * @see #createChild(java.lang.String,java.lang.String)
- */
- public String getName();
-
- /**
- * Returns the integer value of the given key.
- *
- * @param key the key
- * @return the value, or <code>null</code> if the key was not found or was found
- * but was not an integer
- */
- public Integer getInteger(String key);
-
- /**
- * Returns the string value of the given key.
- *
- * @param key the key
- * @return the value, or <code>null</code> if the key was not found or was found
- * but was not an integer
- */
- public String getString(String key);
-
- /**
- * Returns the boolean value of the given key.
- *
- * @param key the key
- * @return the value, or <code>null</code> if the key was not found or was found
- * but was not a boolean
- */
- public Boolean getBoolean(String key);
-
- public List getNames();
-
- /**
- * Sets the value of the given key to the given floating point number.
- *
- * @param key the key
- * @param value the value
- */
- public void putFloat(String key, float value);
-
- /**
- * Sets the value of the given key to the given integer.
- *
- * @param key the key
- * @param value the value
- */
- public void putInteger(String key, int value);
-
- /**
- * Sets the value of the given key to the given boolean value.
- *
- * @param key the key
- * @param value the value
- */
- public void putBoolean(String key, boolean value);
-
- /**
- * Copy the attributes and children from <code>memento</code>
- * to the receiver.
- *
- * @param memento the IMemento to be copied.
- */
- public void putMemento(IMemento memento);
-
- /**
- * Sets the value of the given key to the given string.
- *
- * @param key the key
- * @param value the value
- */
- public void putString(String key, String value);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/IProtocolAdapter.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/IProtocolAdapter.java
deleted file mode 100644
index 4403f1c..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/IProtocolAdapter.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.internet.monitor.core.internal;
-/**
- * A protocol adapter enables a monitor to support a particular network
- * protocol used to communicate between a client and server. All supported
- * protocols will be based on TCP/IP.
- * <p>
- * Protocol adapters are registered via the <code>protocolAdapaters</code>
- * extension point in the <code>org.eclipse.wst.internet.monitor.core</code>
- * plug-in. The global list of known protocol adapters is available via
- * {@link MonitorPlugin#getProtocolAdapters()}. Standard protocol
- * adapters for {@linkplain #HTTP_PROTOCOL_ID HTTP} and
- * {@linkplain #TCPIP_PROTOCOL_ID TCP/IP} are built-in.
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- *
- * @since 1.0
- */
-public interface IProtocolAdapter {
- /**
- * Protocol adapter id (value {@value}) for TCP/IP.
- * The TCP/IP protocol adapter is standard.
- */
- public static String TCPIP_PROTOCOL_ID = "TCP/IP";
-
- /**
- * Protocol adapter id (value {@value}) for HTTP.
- * The HTTP protocol adapter is standard.
- */
- public static String HTTP_PROTOCOL_ID = "HTTP";
-
- /**
- * Returns the id of this adapter.
- * Each adapter has a distinct, fixed id. Ids are intended to be used
- * internally as keys; they are not intended to be shown to end users.
- *
- * @return the element id
- */
- public String getId();
-
- /**
- * Returns the displayable (translated) name for this adapter.
- *
- * @return a displayable name
- */
- public String getName();
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/IStartup.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/IStartup.java
deleted file mode 100644
index 475b5e1..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/IStartup.java
+++ /dev/null
@@ -1,25 +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.internet.monitor.core.internal;
-/**
- * An interface for the startup extension point.
- * Plug-ins that register a startup extension will be activated when the monitor
- * core plug-in initializes and have an opportunity to run code that can't be
- * implemented using the normal contribution mechanisms.
- *
- * @since 1.0
- */
-public interface IStartup {
- /**
- * Will be called on monitor core startup.
- */
- public void startup();
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/Monitor.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/Monitor.java
deleted file mode 100644
index e74788d..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/Monitor.java
+++ /dev/null
@@ -1,292 +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.internet.monitor.core.internal;
-
-import java.net.InetAddress;
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.internet.monitor.core.*;
-/**
- *
- */
-public class Monitor implements IMonitor {
- private static final String MEMENTO_ID = "id";
- private static final String MEMENTO_LOCAL_PORT = "local-port";
- private static final String MEMENTO_REMOTE_HOST = "remote-host";
- private static final String MEMENTO_REMOTE_PORT = "remote-port";
- private static final String MEMENTO_TYPE_ID = "type-id";
-
- private static final int ADD = 0;
- private static final int CHANGE = 1;
-
- protected String id;
- protected String remoteHost;
- protected int remotePort = 80;
- protected int localPort = 80;
- protected String protocolId;
-
- protected List requestListeners = new ArrayList(2);
-
- public Monitor() {
- protocolId = MonitorPlugin.getInstance().getDefaultType();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.internal.IMonitor#getId()
- */
- public String getId() {
- return id;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.internal.IMonitor#getRemoteHost()
- */
- public String getRemoteHost() {
- return remoteHost;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.internal.IMonitor#getRemotePort()
- */
- public int getRemotePort() {
- return remotePort;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.internal.IMonitor#getLocalPort()
- */
- public int getLocalPort() {
- return localPort;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.internal.IMonitor#isHTTPEnabled()
- */
- public String getProtocol() {
- return protocolId;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.internal.IMonitor#isRunning()
- */
- public boolean isRunning() {
- if (isWorkingCopy())
- return false;
- return MonitorManager.getInstance().isRunning(this);
- }
-
- public void delete() {
- if (isWorkingCopy())
- return;
- MonitorManager.getInstance().removeMonitor(this);
- }
-
- public boolean isWorkingCopy() {
- return false;
- }
-
- public IMonitorWorkingCopy createWorkingCopy() {
- return new MonitorWorkingCopy(this);
- }
-
- protected void setInternal(IMonitor monitor) {
- id = monitor.getId();
- remoteHost = monitor.getRemoteHost();
- remotePort = monitor.getRemotePort();
- localPort = monitor.getLocalPort();
- protocolId = monitor.getProtocol();
- }
-
- protected void save(IMemento memento) {
- memento.putString(MEMENTO_ID, id);
- memento.putString(MEMENTO_TYPE_ID, protocolId);
- memento.putInteger(MEMENTO_LOCAL_PORT, localPort);
- memento.putString(MEMENTO_REMOTE_HOST, remoteHost);
- memento.putInteger(MEMENTO_REMOTE_PORT, remotePort);
- }
-
- protected void load(IMemento memento) {
- id = memento.getString(MEMENTO_ID);
- protocolId = memento.getString(MEMENTO_TYPE_ID);
- Integer temp = memento.getInteger(MEMENTO_LOCAL_PORT);
- if (temp != null)
- localPort = temp.intValue();
- remoteHost = memento.getString(MEMENTO_REMOTE_HOST);
- temp = memento.getInteger(MEMENTO_REMOTE_PORT);
- if (temp != null)
- remotePort = temp.intValue();
- }
-
- /*
- * Starts the given monitor listening on its client port.
- */
- public synchronized void start() throws CoreException {
- if (isRunning())
- return;
- if (isWorkingCopy() || !MonitorManager.getInstance().exists(this))
- throw new IllegalArgumentException();
-
- IStatus status = validate();
- if (!status.isOK())
- throw new CoreException(status);
-
- MonitorManager.getInstance().startMonitor(this);
- }
-
- /*
- * Stops the given monitor and frees up all underlying operating
- * system resources.
- */
- public synchronized void stop() {
- if (isWorkingCopy() || !MonitorManager.getInstance().exists(this))
- throw new IllegalArgumentException();
- if (!isRunning())
- return;
- MonitorManager.getInstance().stopMonitor(this);
- }
-
- /*
- * Adds a request listener.
- */
- public synchronized void addRequestListener(IRequestListener listener) {
- if (listener == null)
- throw new IllegalArgumentException();
- if (!requestListeners.contains(listener))
- requestListeners.add(listener);
- }
-
- /*
- * Removes the given request listener. Has no
- * effect if the listener is not registered.
- */
- public synchronized void removeRequestListener(IRequestListener listener) {
- if (listener == null)
- throw new IllegalArgumentException();
- requestListeners.remove(listener);
- }
-
- /**
- * Fire a request event.
- * @param rr
- * @param type
- */
- protected void fireRequestEvent(Request rr, int type) {
- int size = requestListeners.size();
- IRequestListener[] rl = new IRequestListener[size];
- requestListeners.toArray(rl);
-
- for (int i = 0; i < size; i++) {
- IRequestListener listener = rl[i];
- if (type == ADD)
- listener.requestAdded(this, rr);
- else if (type == CHANGE)
- listener.requestChanged(this, rr);
- }
- }
-
- /**
- * Add a new request response pair.
- */
- public void addRequest(Request rr) {
- fireRequestEvent(rr, ADD);
- }
-
- public void requestChanged(Request rr) {
- fireRequestEvent(rr, CHANGE);
- }
-
- public IStatus validate() {
- if (localPort < 0)
- return new Status(IStatus.ERROR, MonitorPlugin.PLUGIN_ID, 0, MonitorPlugin.getResource("%errorInvalidLocalPort"), null);
-
- if (remotePort < 0)
- return new Status(IStatus.ERROR, MonitorPlugin.PLUGIN_ID, 0, MonitorPlugin.getResource("%errorInvalidRemotePort"), null);
-
- if (remoteHost == null || remoteHost.length() == 0 || !isValidHostname(remoteHost))
- return new Status(IStatus.ERROR, MonitorPlugin.PLUGIN_ID, 0, MonitorPlugin.getResource("%errorInvalidRemoteHost"), null);
-
- if (isLocalhost(remoteHost) && localPort == remotePort)
- return new Status(IStatus.ERROR, MonitorPlugin.PLUGIN_ID, 0, MonitorPlugin.getResource("%errorInvalidLocalPort"), null);
-
- return new Status(IStatus.OK, MonitorPlugin.PLUGIN_ID, 0, MonitorPlugin.getResource("%monitorValid"), null);
- }
-
- protected static boolean isValidHostname(String host) {
- if (host == null || host.trim().length() < 1)
- return false;
-
- int length = host.length();
- for (int i = 0; i < length; i++) {
- char c = host.charAt(i);
- if (!Character.isLetterOrDigit(c) && c != ':' && c != '.')
- return false;
- }
- if (host.endsWith(":"))
- return false;
- return true;
- }
-
- protected static boolean isLocalhost(String host) {
- if (host == null)
- return false;
- try {
- if ("localhost".equals(host) || "127.0.0.1".equals(host))
- return true;
- InetAddress localHostaddr = InetAddress.getLocalHost();
- if (localHostaddr.getHostName().equals(host))
- return true;
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Error checking for localhost", e);
- }
- return false;
- }
-
- public String toString() {
- return "Monitor [" + getId() + ", " + getProtocol() + ", " + getLocalPort() + ", "
- + getRemoteHost() + ", " + getRemotePort() + "]";
- }
-
- public boolean equals(Object obj) {
- if (!(obj instanceof Monitor))
- return false;
-
- IMonitor m = (IMonitor) obj;
- if (m.isWorkingCopy()) {
- m = ((IMonitorWorkingCopy) m).getOriginal();
- if (m == null)
- return false;
- }
- if (id == null && m.getId() != null)
- return false;
- if (id != null && !id.equals(m.getId()))
- return false;
-
- if (localPort != m.getLocalPort())
- return false;
- if (remotePort != m.getRemotePort())
- return false;
-
- if (remoteHost == null && m.getRemoteHost() != null)
- return false;
- if (remoteHost != null && !remoteHost.equals(m.getRemoteHost()))
- return false;
-
- if (protocolId == null && m.getProtocol() != null)
- return false;
- if (protocolId != null && !protocolId.equals(m.getProtocol()))
- return false;
-
- return true;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/MonitorManager.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/MonitorManager.java
deleted file mode 100644
index 5e2fed4..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/MonitorManager.java
+++ /dev/null
@@ -1,277 +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.internet.monitor.core.internal;
-
-import java.io.ByteArrayInputStream;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.internet.monitor.core.*;
-import org.eclipse.wst.internet.monitor.core.internal.http.ResendHTTPRequest;
-/**
- *
- */
-public class MonitorManager {
- private static final int ADD = 0;
- private static final int CHANGE = 1;
- private static final int REMOVE = 2;
-
- // monitors
- protected List monitors;
- protected Map threads = new HashMap();
-
- protected List monitorListeners = new ArrayList();
-
- private Preferences.IPropertyChangeListener pcl;
- protected boolean ignorePreferenceChanges = false;
-
- protected Map resendMap = new HashMap();
-
- protected static MonitorManager instance;
-
- static {
- MonitorPlugin.getInstance().executeStartups();
- }
-
- public static MonitorManager getInstance() {
- if (instance == null)
- instance = new MonitorManager();
-
- return instance;
- }
-
- private MonitorManager() {
- loadMonitors();
-
- pcl = new Preferences.IPropertyChangeListener() {
- public void propertyChange(Preferences.PropertyChangeEvent event) {
- if (ignorePreferenceChanges)
- return;
- String property = event.getProperty();
- if (property.equals("monitors")) {
- loadMonitors();
- }
- }
- };
-
- MonitorPlugin.getInstance().getPluginPreferences().addPropertyChangeListener(pcl);
- }
-
- protected void dispose() {
- MonitorPlugin.getInstance().getPluginPreferences().removePropertyChangeListener(pcl);
- }
-
- public IMonitorWorkingCopy createMonitor() {
- return new MonitorWorkingCopy();
- }
-
- public List getMonitors() {
- return new ArrayList(monitors);
- }
-
- protected synchronized void addMonitor(IMonitor monitor) {
- if (!monitors.contains(monitor))
- monitors.add(monitor);
- fireMonitorEvent(monitor, ADD);
- saveMonitors();
- }
-
- protected boolean isRunning(IMonitor monitor) {
- return (threads.get(monitor) != null);
- }
-
- public void startMonitor(IMonitor monitor) throws CoreException {
- if (!monitors.contains(monitor))
- return;
-
- if (AcceptThread.isPortInUse(monitor.getLocalPort()))
- throw new CoreException(new Status(IStatus.ERROR, MonitorPlugin.PLUGIN_ID, 0, MonitorPlugin.getResource("%errorPortInUse", monitor.getLocalPort() + ""), null));
-
- AcceptThread thread = new AcceptThread(monitor);
- thread.startServer();
- threads.put(monitor, thread);
- }
-
- public void stopMonitor(IMonitor monitor) {
- if (!monitors.contains(monitor))
- return;
-
- AcceptThread thread = (AcceptThread) threads.get(monitor);
- if (thread != null) {
- thread.stopServer();
- threads.remove(monitor);
- }
- }
-
- protected synchronized void removeMonitor(IMonitor monitor) {
- if (monitor.isRunning())
- stopMonitor(monitor);
- monitors.remove(monitor);
- fireMonitorEvent(monitor, REMOVE);
- saveMonitors();
- }
-
- protected synchronized void monitorChanged(IMonitor monitor) {
- fireMonitorEvent(monitor, CHANGE);
- saveMonitors();
- }
-
- protected boolean exists(IMonitor monitor) {
- return (monitors.contains(monitor));
- }
-
- /**
- * Add monitor listener.
- *
- * @param listener
- */
- public synchronized void addMonitorListener(IMonitorListener listener) {
- if (!monitorListeners.contains(listener))
- monitorListeners.add(listener);
- }
-
- /**
- * Remove monitor listener.
- *
- * @param listener
- */
- public synchronized void removeMonitorListener(IMonitorListener listener) {
- if (monitorListeners.contains(listener))
- monitorListeners.remove(listener);
- }
-
- /**
- * Fire a monitor event.
- *
- * @param monitor the monitor
- * @param type the type of event
- */
- protected void fireMonitorEvent(IMonitor monitor, int type) {
- Object[] obj = monitorListeners.toArray();
-
- int size = obj.length;
- for (int i = 0; i < size; i++) {
- IMonitorListener listener = (IMonitorListener) obj[i];
- if (type == ADD)
- listener.monitorAdded(monitor);
- else if (type == CHANGE)
- listener.monitorChanged(monitor);
- else if (type == REMOVE)
- listener.monitorRemoved(monitor);
- }
- }
-
- protected synchronized void loadMonitors() {
- Trace.trace(Trace.FINEST, "Loading monitors");
-
- monitors = new ArrayList();
- Preferences prefs = MonitorPlugin.getInstance().getPluginPreferences();
- String xmlString = prefs.getString("monitors");
- if (xmlString != null && xmlString.length() > 0) {
- try {
- ByteArrayInputStream in = new ByteArrayInputStream(xmlString.getBytes());
- IMemento memento = XMLMemento.loadMemento(in);
-
- IMemento[] children = memento.getChildren("monitor");
- if (children != null) {
- int size = children.length;
- for (int i = 0; i < size; i++) {
- Monitor monitor = new Monitor();
- monitor.load(children[i]);
- monitors.add(monitor);
- }
- }
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Could not load monitors: " + e.getMessage());
- }
- }
- }
-
- protected synchronized void saveMonitors() {
- try {
- ignorePreferenceChanges = true;
- XMLMemento memento = XMLMemento.createWriteRoot("monitors");
-
- Iterator iterator = monitors.iterator();
- while (iterator.hasNext()) {
- Monitor monitor = (Monitor) iterator.next();
- IMemento child = memento.createChild("monitor");
- monitor.save(child);
- }
-
- String xmlString = memento.saveToString();
- Preferences prefs = MonitorPlugin.getInstance().getPluginPreferences();
- prefs.setValue("monitors", xmlString);
- MonitorPlugin.getInstance().savePluginPreferences();
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not save browsers", e);
- }
- ignorePreferenceChanges = false;
- }
-
- /**
- * Creates a new resend request from the given request.
- *
- * @param request the request that is to be resent; may not be <code>null</code>
- * @return a new resend request
- */
- public static ResendHTTPRequest createResendRequest(Request request) {
- if (request == null)
- throw new IllegalArgumentException();
- return new ResendHTTPRequest((Monitor)request.getMonitor(), request);
- }
-
- /**
- * Adds a resend request to this request.
- *
- * @param request the resend request to add
- */
- public void addResendRequest(Request request, ResendHTTPRequest resendReq) {
- if (request == null || resendReq == null)
- return;
-
- List list = null;
- try {
- list = (List) resendMap.get(request);
- } catch (Exception e) {
- // ignore
- }
-
- if (list == null) {
- list = new ArrayList();
- resendMap.put(request, list);
- }
- list.add(resendReq);
- }
-
- /**
- * Returns an array of resend requests based on this request.
- *
- * @return the array of resend requests based on this request
- */
- public ResendHTTPRequest[] getResendRequests(Request request) {
- try {
- List list = (List) resendMap.get(request);
- ResendHTTPRequest[] rr = new ResendHTTPRequest[list.size()];
- list.toArray(rr);
- return rr;
- } catch (Exception e) {
- return new ResendHTTPRequest[0];
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/MonitorPlugin.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/MonitorPlugin.java
deleted file mode 100644
index c895de0..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/MonitorPlugin.java
+++ /dev/null
@@ -1,206 +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.internet.monitor.core.internal;
-
-import java.text.MessageFormat;
-import java.util.*;
-
-import org.eclipse.core.runtime.*;
-/**
- * The monitor core plugin.
- */
-public class MonitorPlugin extends Plugin {
- public static final String PLUGIN_ID = "org.eclipse.wst.internet.monitor.core";
-
- private static MonitorPlugin singleton;
-
- protected Map protocolAdapters;
- protected Map contentFilters;
- protected boolean startupsLoaded;
-
- /**
- * MonitorPlugin constructor comment.
- */
- public MonitorPlugin() {
- super();
- singleton = this;
- loadProtocolAdapters();
- loadContentFilters();
- }
-
- /**
- * Returns the singleton instance of this plugin.
- *
- * @return org.eclipse.wst.internet.monitor.core.MonitorPlugin
- */
- public static MonitorPlugin getInstance() {
- return singleton;
- }
-
- /**
- * Returns the translated String found with the given key.
- *
- * @return java.lang.String
- * @param key java.lang.String
- */
- public static String getResource(String key) {
- try {
- return Platform.getResourceString(getInstance().getBundle(), key);
- } catch (Exception e) {
- return key;
- }
- }
-
- /**
- * Returns the translated String found with the given key,
- * and formatted with the given arguments using java.text.MessageFormat.
- *
- * @param key java.lang.String
- * @param arguments java.lang.Object[]
- * @return java.lang.String
- */
- public static String getResource(String key, Object[] arguments) {
- try {
- String text = getResource(key);
- return MessageFormat.format(text, arguments);
- } catch (Exception e) {
- return key;
- }
- }
-
- /**
- * Returns the translated String found with the given key,
- * and formatted with the given arguments using java.text.MessageFormat.
- *
- * @param key the key
- * @param arg an argument
- * @return the translated string
- */
- public static String getResource(String key, String arg) {
- return getResource(key, new String[] { arg });
- }
-
- public String getDefaultType() {
- return "HTTP";
- }
-
- /**
- * Returns the protocol adapter with the given id, or <code>null</code>
- * if none. This convenience method searches the list of known
- * protocol adapters ({@link #getProtocolAdapters()}) for the one with a
- * matching id.
- *
- * @param id the protocol adapter id; must not be <code>null</code>
- * @return the protocol adapter instance, or <code>null</code> if there
- * is no protocol adapter with the given id
- */
- public ProtocolAdapter getProtocolAdapter(String id) {
- return (ProtocolAdapter) protocolAdapters.get(id);
- }
-
- /**
- * Returns a list of all known protocol adapter instances.
- * <p>
- * Protocol adapters are registered via the <code>protocolAdapaters</code>
- * extension point in the <code>org.eclipse.wst.internet.monitor.core</code>
- * plug-in.
- * </p>
- * <p>
- * A new array is returned on each call; clients may safely store or modify the result.
- * </p>
- *
- * @return a possibly-empty array of protocol adapter instances
- */
- public ProtocolAdapter[] getProtocolAdapters() {
- List list = new ArrayList();
- Iterator iterator = protocolAdapters.values().iterator();
- while (iterator.hasNext()) {
- list.add(iterator.next());
- }
- ProtocolAdapter[] types = new ProtocolAdapter[list.size()];
- list.toArray(types);
- return types;
- }
-
- public IContentFilter[] getContentFilters() {
- List list = new ArrayList();
- Iterator iterator = contentFilters.values().iterator();
- while (iterator.hasNext()) {
- list.add(iterator.next());
- }
- IContentFilter[] cf = new IContentFilter[list.size()];
- list.toArray(cf);
- return cf;
- }
-
- public IContentFilter findContentFilter(String id) {
- if (id == null)
- throw new IllegalArgumentException();
- return (IContentFilter) contentFilters.get(id);
- }
-
- protected synchronized void loadProtocolAdapters() {
- if (protocolAdapters != null)
- return;
- Trace.trace(Trace.CONFIG, "Loading protocol adapters");
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IConfigurationElement[] cf = registry.getConfigurationElementsFor(MonitorPlugin.PLUGIN_ID, "internalProtocolAdapters");
-
- int size = cf.length;
- protocolAdapters = new HashMap(size);
- for (int i = 0; i < size; i++) {
- String id = cf[i].getAttribute("id");
- Trace.trace(Trace.CONFIG, "Loading adapter: " + id);
- protocolAdapters.put(id, new ProtocolAdapter(cf[i]));
- }
- }
-
- protected synchronized void loadContentFilters() {
- if (contentFilters != null)
- return;
- Trace.trace(Trace.CONFIG, "Loading content filters");
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IConfigurationElement[] cf = registry.getConfigurationElementsFor(MonitorPlugin.PLUGIN_ID, "contentFilters");
-
- int size = cf.length;
- contentFilters = new HashMap(size);
- for (int i = 0; i < size; i++) {
- String id = cf[i].getAttribute("id");
- Trace.trace(Trace.CONFIG, "Loading filter: " + id);
- contentFilters.put(id, new ContentFilter(cf[i]));
- }
- }
-
- protected synchronized void executeStartups() {
- if (startupsLoaded)
- return;
-
- Trace.trace(Trace.CONFIG, "Loading startups");
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IConfigurationElement[] cf = registry.getConfigurationElementsFor(MonitorPlugin.PLUGIN_ID, "internalStartup");
-
- int size = cf.length;
- for (int i = 0; i < size; i++) {
- String id = cf[i].getAttribute("id");
- Trace.trace(Trace.CONFIG, "Loading startup: " + id);
- try {
- IStartup startup = (IStartup) cf[i].createExecutableExtension("class");
- try {
- startup.startup();
- } catch (Exception ex) {
- Trace.trace(Trace.SEVERE, "Startup failed" + startup.toString(), ex);
- }
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not create startup: " + id, e);
- }
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/MonitorWorkingCopy.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/MonitorWorkingCopy.java
deleted file mode 100644
index 20b6b4b..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/MonitorWorkingCopy.java
+++ /dev/null
@@ -1,100 +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.internet.monitor.core.internal;
-
-import org.eclipse.wst.internet.monitor.core.*;
-/**
- *
- */
-public class MonitorWorkingCopy extends Monitor implements IMonitorWorkingCopy {
- protected Monitor monitor;
-
- // creation
- public MonitorWorkingCopy() {
- // do nothing
- }
-
- // working copy
- public MonitorWorkingCopy(Monitor monitor) {
- this.monitor = monitor;
- setInternal(monitor);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.internal.IMonitorWorkingCopy#getOriginal()
- */
- public IMonitor getOriginal() {
- return monitor;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.internal.IMonitorWorkingCopy#setRemoteHost(java.lang.String)
- */
- public void setId(String newId) {
- id = newId;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.internal.IMonitorWorkingCopy#setRemoteHost(java.lang.String)
- */
- public void setRemoteHost(String host) {
- remoteHost = host;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.internal.IMonitorWorkingCopy#setRemotePort(int)
- */
- public void setRemotePort(int port) {
- remotePort = port;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.internal.IMonitorWorkingCopy#setLocalPort(int)
- */
- public void setLocalPort(int port) {
- localPort = port;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.internal.IMonitorWorkingCopy#setProtocolAdapter(IProtocolAdapter)
- */
- public void setProtocol(String protocolId2) {
- protocolId = protocolId2;
- }
-
- public boolean isWorkingCopy() {
- return true;
- }
-
- public IMonitorWorkingCopy createWorkingCopy() {
- return this;
- }
-
- public synchronized IMonitor save() {
- MonitorManager mm = MonitorManager.getInstance();
- if (monitor != null) {
- //boolean restart = false;
- if (monitor.isRunning()) {
- //restart = true;
- mm.stopMonitor(monitor);
- }
- monitor.setInternal(this);
- mm.monitorChanged(monitor);
- //if (restart)
- // mm.startMonitor(monitor);
- } else {
- monitor = new Monitor();
- monitor.setInternal(this);
- mm.addMonitor(monitor);
- }
- return monitor;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/ProtocolAdapter.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/ProtocolAdapter.java
deleted file mode 100644
index 9941503..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/ProtocolAdapter.java
+++ /dev/null
@@ -1,55 +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.internet.monitor.core.internal;
-
-import java.io.IOException;
-import java.net.Socket;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.wst.internet.monitor.core.IMonitor;
-/**
- *
- */
-public class ProtocolAdapter implements IProtocolAdapter {
- protected IConfigurationElement element;
- protected ProtocolAdapterDelegate delegate;
-
- protected ProtocolAdapter(IConfigurationElement element) {
- this.element = element;
- }
-
- public String getId() {
- return element.getAttribute("id");
- }
-
- public String getName() {
- return element.getAttribute("name");
- }
-
- protected ProtocolAdapterDelegate getDelegate() {
- if (delegate != null)
- return delegate;
-
- try {
- delegate = (ProtocolAdapterDelegate) element.createExecutableExtension("class");
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not create protocol adapter delegate: " + getId(), e);
- }
- return delegate;
- }
-
- public void connect(IMonitor monitor, Socket in, Socket out) throws IOException {
- getDelegate().connect(monitor, in, out);
- }
-
- public void disconnect(IMonitor monitor) throws IOException {
- getDelegate().disconnect(monitor);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/ProtocolAdapterDelegate.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/ProtocolAdapterDelegate.java
deleted file mode 100644
index db48eb1..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/ProtocolAdapterDelegate.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.internet.monitor.core.internal;
-
-import java.io.IOException;
-import java.net.Socket;
-import org.eclipse.wst.internet.monitor.core.IMonitor;
-/**
- * Abstract base class for protocol adapter delegates, which provide the
- * implementation behind a particular protocol adapter.
- * A protocol adapter watches the message traffic passing between client and
- * server; it parses the messages and reports them in the form of
- * Request objects.
- * <p>
- * This abstract class is intended to be subclassed only by clients
- * to extend the <code>protocolAdapters</code> extension point.
- * The subclass must have a public 0-argument constructor, which will be used
- * automatically to instantiate the delegate when required.
- * </p>
- * <p>
- * There is only one delegate created per protocol, and this delegate must
- * be able to handle multiple monitor instances. This means that the delegate
- * typically will not have instance state, or must synchronize and keep the
- * state separate.
- * </p>
- * <p>
- * [issue: The HTTP and TCP/IP delegate implementations create threads which
- * shuffle info between sockets. If the monitor is changed or deleted, how do
- * these threads go away? Methinks that delegates in general should be forced
- * to implement disconnect(IMonitor) as well. This method would be called by the
- * system when the monitor is changed or deleted, or when the plug-in is
- * being shut down.]
- * </p>
- *
- * @since 1.0
- */
-public abstract class ProtocolAdapterDelegate {
- /**
- * Establishes an ongoing connection between client and server being
- * monitored by the given monitor. The <code>in</code> socket is associated
- * with the monitor's client. The <code>out</code> socket is associated with
- * the monitor's server. Different adapaters handle different network
- * protocols.
- * <p>
- * Subclasses must implement this method to achieve the following:
- * <ul>
- * <li>Client to server communication -
- * Opening an input stream on the <code>in</code> socket, opening an output
- * stream on the <code>out</code> socket, and establishing a mechanism that
- * will pass along all bytes received on the input stream to the output
- * stream.</li>
- * <li>Server to client communication - Opening an input stream on the
- * <code>out</code> socket, opening an output stream on the <code>in</code>
- * socket, and establishing a mechanism that will pass along all bytes
- * received on the input stream to the output stream.</li>
- * <li>Parsing the protocol-specific message traffic to create and report
- * request objects for each message passed between client and server.</li>
- * <li>Closing the input and output sockets and otherwise cleaning up
- * afterwards.</li>
- * </ul>
- * </p>
- *
- * @param monitor the monitor that uses this protocol adapter
- * @param in the input socket of the monitor client
- * @param out the output socket of the monitor server
- * @throws IOException if an exception occur when opening the streams of the
- * input or output sockets
- */
- public abstract void connect(IMonitor monitor, Socket in, Socket out) throws IOException;
-
- /**
- * Called if the monitor is changed or deleted, or the plugin is shutting down.
- * The delegate must clean up the connections and threads created to respond to
- * this monitor.
- *
- * @param monitor
- * @throws IOException
- */
- public abstract void disconnect(IMonitor monitor) throws IOException;
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/SocketWrapper.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/SocketWrapper.java
deleted file mode 100644
index e096185..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/SocketWrapper.java
+++ /dev/null
@@ -1,346 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.internet.monitor.core.internal;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.InetAddress;
-import java.net.Socket;
-import java.net.SocketAddress;
-import java.net.SocketException;
-import java.nio.channels.SocketChannel;
-/**
- * A socket that is only used for resending requests. All input operations are
- * ignored.
- */
-public class SocketWrapper extends Socket {
- private InputStream inputStream;
- private OutputStream outputStream;
-
- public SocketWrapper(InputStream inputStream) {
- this.inputStream = inputStream;
- this.outputStream = new DummyOutputStream();
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#bind(java.net.SocketAddress)
- */
- public void bind(SocketAddress arg0) throws IOException {
- // do nothing
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#close()
- */
- public synchronized void close() throws IOException {
- // do nothing
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#connect(java.net.SocketAddress, int)
- */
- public void connect(SocketAddress arg0, int arg1) throws IOException {
- // do nothing
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#connect(java.net.SocketAddress)
- */
- public void connect(SocketAddress arg0) throws IOException {
- // do nothing
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#getChannel()
- */
- public SocketChannel getChannel() {
- return super.getChannel();
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#getInetAddress()
- */
- public InetAddress getInetAddress() {
- return super.getInetAddress();
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#getInputStream()
- */
- public InputStream getInputStream() throws IOException {
- return inputStream;
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#getKeepAlive()
- */
- public boolean getKeepAlive() throws SocketException {
- return false;
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#getLocalAddress()
- */
- public InetAddress getLocalAddress() {
- return super.getLocalAddress();
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#getLocalPort()
- */
- public int getLocalPort() {
- return super.getLocalPort();
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#getLocalSocketAddress()
- */
- public SocketAddress getLocalSocketAddress() {
- return super.getLocalSocketAddress();
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#getOOBInline()
- */
- public boolean getOOBInline() throws SocketException {
- return super.getOOBInline();
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#getOutputStream()
- */
- public OutputStream getOutputStream() throws IOException {
- return outputStream;
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#getPort()
- */
- public int getPort() {
- return super.getPort();
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#getReceiveBufferSize()
- */
- public synchronized int getReceiveBufferSize() throws SocketException {
- return super.getReceiveBufferSize();
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#getRemoteSocketAddress()
- */
- public SocketAddress getRemoteSocketAddress() {
- return super.getRemoteSocketAddress();
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#getReuseAddress()
- */
- public boolean getReuseAddress() throws SocketException {
- return super.getReuseAddress();
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#getSendBufferSize()
- */
- public synchronized int getSendBufferSize() throws SocketException {
- return super.getSendBufferSize();
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#getSoLinger()
- */
- public int getSoLinger() throws SocketException {
- return super.getSoLinger();
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#getSoTimeout()
- */
- public synchronized int getSoTimeout() throws SocketException {
- return super.getSoTimeout();
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#getTcpNoDelay()
- */
- public boolean getTcpNoDelay() throws SocketException {
- return super.getTcpNoDelay();
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#getTrafficClass()
- */
- public int getTrafficClass() throws SocketException {
- return super.getTrafficClass();
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#isBound()
- */
- public boolean isBound() {
- return super.isBound();
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#isClosed()
- */
- public boolean isClosed() {
- return false;
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#isConnected()
- */
- public boolean isConnected() {
- return true;
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#isInputShutdown()
- */
- public boolean isInputShutdown() {
- return false;
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#isOutputShutdown()
- */
- public boolean isOutputShutdown() {
- return false;
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#sendUrgentData(int)
- */
- public void sendUrgentData(int arg0) throws IOException {
- super.sendUrgentData(arg0);
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#setKeepAlive(boolean)
- */
- public void setKeepAlive(boolean arg0) throws SocketException {
- super.setKeepAlive(arg0);
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#setOOBInline(boolean)
- */
- public void setOOBInline(boolean arg0) throws SocketException {
- super.setOOBInline(arg0);
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#setReceiveBufferSize(int)
- */
- public synchronized void setReceiveBufferSize(int arg0) throws SocketException {
- super.setReceiveBufferSize(arg0);
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#setReuseAddress(boolean)
- */
- public void setReuseAddress(boolean arg0) throws SocketException {
- super.setReuseAddress(arg0);
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#setSendBufferSize(int)
- */
- public synchronized void setSendBufferSize(int arg0) throws SocketException {
- super.setSendBufferSize(arg0);
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#setSoLinger(boolean, int)
- */
- public void setSoLinger(boolean arg0, int arg1) throws SocketException {
- super.setSoLinger(arg0, arg1);
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#setSoTimeout(int)
- */
- public synchronized void setSoTimeout(int arg0) throws SocketException {
- super.setSoTimeout(arg0);
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#setTcpNoDelay(boolean)
- */
- public void setTcpNoDelay(boolean arg0) throws SocketException {
- super.setTcpNoDelay(arg0);
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#setTrafficClass(int)
- */
- public void setTrafficClass(int arg0) throws SocketException {
- super.setTrafficClass(arg0);
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#shutdownInput()
- */
- public void shutdownInput() throws IOException {
- inputStream.close();
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#shutdownOutput()
- */
- public void shutdownOutput() throws IOException {
- // do nothing
- }
-
- /**
- * A dummy OutputStream that allows us to fake output for a socket.
- */
- public class DummyOutputStream extends OutputStream {
- /* (non-Javadoc)
- * @see java.io.OutputStream#close()
- */
- public void close() throws IOException {
- // do nothing
- }
-
- /* (non-Javadoc)
- * @see java.io.OutputStream#flush()
- */
- public void flush() throws IOException {
- // do nothing
- }
-
- /* (non-Javadoc)
- * @see java.io.OutputStream#write(byte[], int, int)
- */
- public void write(byte[] arg0, int arg1, int arg2) throws IOException {
- // do nothing
- }
-
- /* (non-Javadoc)
- * @see java.io.OutputStream#write(byte[])
- */
- public void write(byte[] arg0) throws IOException {
- // do nothing
- }
-
- /* (non-Javadoc)
- * @see java.io.OutputStream#write(int)
- */
- public void write(int arg0) throws IOException {
- // do nothing
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/TCPIPProtocolAdapter.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/TCPIPProtocolAdapter.java
deleted file mode 100644
index 2e52df2..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/TCPIPProtocolAdapter.java
+++ /dev/null
@@ -1,43 +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.internet.monitor.core.internal;
-
-import java.io.IOException;
-import java.net.Socket;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.wst.internet.monitor.core.IMonitor;
-import org.eclipse.wst.internet.monitor.core.Request;
-/**
- *
- */
-public class TCPIPProtocolAdapter extends ProtocolAdapterDelegate {
- protected Map map = new HashMap();
-
- public void connect(IMonitor monitor, Socket in, Socket out) throws IOException {
- Request request = new Request((Monitor) monitor, IProtocolAdapter.TCPIP_PROTOCOL_ID, monitor.getLocalPort(), monitor.getRemoteHost(), monitor.getRemotePort());
- Connection conn = new Connection(in, out);
- map.put(monitor, conn);
- TCPIPThread requestThread = new TCPIPThread(conn, request, in.getInputStream(), out.getOutputStream(), true);
- requestThread.start();
- new TCPIPThread(conn, request, out.getInputStream(), in.getOutputStream(), false).start();
- }
-
- public void disconnect(IMonitor monitor) throws IOException {
- try {
- Connection conn = (Connection) map.get(monitor);
- conn.close();
- } catch (Exception e) {
- // ignore
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/TCPIPThread.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/TCPIPThread.java
deleted file mode 100644
index 84e35e2..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/TCPIPThread.java
+++ /dev/null
@@ -1,75 +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.internet.monitor.core.internal;
-
-import java.io.*;
-import org.eclipse.wst.internet.monitor.core.Request;
-/**
- * Monitor server I/O thread.
- */
-public class TCPIPThread extends Thread {
- private static final int BUFFER = 2048;
- protected InputStream in;
- protected OutputStream out;
- protected boolean isRequest;
-
- protected Connection conn;
- protected Request request;
-
- /**
- * MonitorThread constructor comment.
- */
- public TCPIPThread(Connection conn, Request request, InputStream in, OutputStream out, boolean isRequest) {
- super();
- this.conn = conn;
- this.request = request;
- this.in = in;
- this.out = out;
- this.isRequest = isRequest;
- setPriority(Thread.NORM_PRIORITY + 1);
- setDaemon(true);
- }
-
- /**
- * Listen for input, save it, and pass to the output stream.
- */
- public void run() {
- try {
- byte[] b = new byte[BUFFER];
- int n = in.read(b);
- while (n > 0) {
- out.write(b, 0, n);
- if (b != null && n > 0) {
- byte[] x = null;
- if (n == BUFFER)
- x = b;
- else {
- x = new byte[n];
- System.arraycopy(b, 0, x, 0, n);
- }
- if (isRequest)
- request.addToRequest(x);
- else
- request.addToResponse(x);
- }
- n = in.read(b);
- Thread.yield();
- }
- out.flush();
- } catch (IOException e) {
- // ignore
- } finally {
- //request.fireChangedEvent();
- if (!isRequest)
- conn.close();
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/Trace.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/Trace.java
deleted file mode 100644
index 60f6cc3..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/Trace.java
+++ /dev/null
@@ -1,53 +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.internet.monitor.core.internal;
-/**
- * Helper class to route trace output.
- */
-public class Trace {
- public static byte CONFIG = 0;
- public static byte WARNING = 1;
- public static byte SEVERE = 2;
- public static byte FINEST = 3;
-
- public static byte PARSING = 4;
-
- /**
- * Trace constructor comment.
- */
- private Trace() {
- super();
- }
-
- /**
- * Trace the given text.
- *
- * @param s java.lang.String
- */
- public static void trace(byte level, String s) {
- trace(level, s, null);
- }
-
- /**
- * Trace the given message and exception.
- *
- * @param s java.lang.String
- * @param t java.lang.Throwable
- */
- public static void trace(byte level, String s, Throwable t) {
- if (!MonitorPlugin.getInstance().isDebugging())
- return;
-
- System.out.println(System.currentTimeMillis() + " " + s);
- if (t != null)
- t.printStackTrace();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/XMLMemento.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/XMLMemento.java
deleted file mode 100644
index fee2ce3..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/XMLMemento.java
+++ /dev/null
@@ -1,460 +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.internet.monitor.core.internal;
-
-import java.io.*;
-import java.util.*;
-import java.net.URL;
-import org.w3c.dom.*;
-import org.xml.sax.*;
-
-import javax.xml.parsers.*;
-import javax.xml.transform.*;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-/**
- * A Memento is a class independent container for persistence
- * info. It is a reflection of 3 storage requirements.
- *
- * 1) We need the ability to persist an object and restore it.
- * 2) The class for an object may be absent. If so we would
- * like to skip the object and keep reading.
- * 3) The class for an object may change. If so the new class
- * should be able to read the old persistence info.
- *
- * We could ask the objects to serialize themselves into an
- * ObjectOutputStream, DataOutputStream, or Hashtable. However
- * all of these approaches fail to meet the second requirement.
- *
- * Memento supports binary persistance with a version ID.
- */
-public final class XMLMemento implements IMemento {
- private Document factory;
- private Element element;
-
- /**
- * Answer a memento for the document and element. For simplicity
- * you should use createReadRoot and createWriteRoot to create the initial
- * mementos on a document.
- */
- public XMLMemento(Document doc, Element el) {
- factory = doc;
- element = el;
- }
-
- /*
- * @see IMemento
- */
- public IMemento createChild(String type) {
- Element child = factory.createElement(type);
- element.appendChild(child);
- return new XMLMemento(factory, child);
- }
-
- /*
- * @see IMemento
- */
- public IMemento createChild(String type, String id) {
- Element child = factory.createElement(type);
- child.setAttribute(TAG_ID, id);
- element.appendChild(child);
- return new XMLMemento(factory, child);
- }
-
- /**
- * Create a Document from a Reader and answer a root memento for reading
- * a document.
- */
- protected static XMLMemento createReadRoot(Reader reader) {
- Document document = null;
- try {
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- DocumentBuilder parser = factory.newDocumentBuilder();
- document = parser.parse(new InputSource(reader));
- Node node = document.getFirstChild();
- if (node instanceof Element)
- return new XMLMemento(document, (Element) node);
- } catch (ParserConfigurationException e) {
- // ignore
- } catch (IOException e) {
- // ignore
- } catch (SAXException e) {
- // ignore
- } finally {
- try {
- reader.close();
- } catch (Exception e) {
- // ignore
- }
- }
- return null;
- }
-
- /**
- * Answer a root memento for writing a document.
- */
- public static XMLMemento createWriteRoot(String type) {
- Document document;
- try {
- document = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
- Element element = document.createElement(type);
- document.appendChild(element);
- return new XMLMemento(document, element);
- } catch (ParserConfigurationException e) {
- throw new Error(e);
- }
- }
-
- /*
- * @see IMemento
- */
- public IMemento getChild(String type) {
- // Get the nodes.
- NodeList nodes = element.getChildNodes();
- int size = nodes.getLength();
- if (size == 0)
- return null;
-
- // Find the first node which is a child of this node.
- for (int nX = 0; nX < size; nX ++) {
- Node node = nodes.item(nX);
- if (node instanceof Element) {
- Element element2 = (Element)node;
- if (element2.getNodeName().equals(type))
- return new XMLMemento(factory, element2);
- }
- }
-
- // A child was not found.
- return null;
- }
-
- /*
- * @see IMemento
- */
- public IMemento [] getChildren(String type) {
- // Get the nodes.
- NodeList nodes = element.getChildNodes();
- int size = nodes.getLength();
- if (size == 0)
- return new IMemento[0];
-
- // Extract each node with given type.
- ArrayList list = new ArrayList(size);
- for (int nX = 0; nX < size; nX ++) {
- Node node = nodes.item(nX);
- if (node instanceof Element) {
- Element element2 = (Element)node;
- if (element2.getNodeName().equals(type))
- list.add(element2);
- }
- }
-
- // Create a memento for each node.
- size = list.size();
- IMemento [] results = new IMemento[size];
- for (int x = 0; x < size; x ++) {
- results[x] = new XMLMemento(factory, (Element)list.get(x));
- }
- return results;
- }
-
- /**
- * Return the contents of this memento as a byte array.
- *
- * @return byte[]
- */
- public byte[] getContents() throws IOException {
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- save(out);
- return out.toByteArray();
- }
-
- /**
- * Returns an input stream for writing to the disk with a local locale.
- *
- * @return the input stream
- */
- public InputStream getInputStream() throws IOException {
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- save(out);
- return new ByteArrayInputStream(out.toByteArray());
- }
-
- /*
- * @see IMemento
- */
- public Float getFloat(String key) {
- Attr attr = element.getAttributeNode(key);
- if (attr == null)
- return null;
- String strValue = attr.getValue();
- try {
- return new Float(strValue);
- } catch (NumberFormatException e) {
- return null;
- }
- }
-
- /*
- * @see IMemento
- */
- public String getId() {
- return element.getAttribute(TAG_ID);
- }
-
- /*
- * @see IMemento
- */
- public String getName() {
- return element.getNodeName();
- }
-
- /*
- * @see IMemento
- */
- public Integer getInteger(String key) {
- Attr attr = element.getAttributeNode(key);
- if (attr == null)
- return null;
- String strValue = attr.getValue();
- try {
- return new Integer(strValue);
- } catch (NumberFormatException e) {
- return null;
- }
- }
-
- /*
- * @see IMemento
- */
- public String getString(String key) {
- Attr attr = element.getAttributeNode(key);
- if (attr == null)
- return null;
- return attr.getValue();
- }
-
- public List getNames() {
- NamedNodeMap map = element.getAttributes();
- int size = map.getLength();
- List list = new ArrayList();
- for (int i = 0; i < size; i++) {
- Node node = map.item(i);
- String name = node.getNodeName();
- list.add(name);
- }
- return list;
- }
-
- /**
- * Loads a memento from the given filename.
- *
- * @param in the input stream
- * @return a memento
- * @exception java.io.IOException
- */
- public static IMemento loadMemento(InputStream in) {
- return createReadRoot(new InputStreamReader(in));
- }
-
- /**
- * Loads a memento from the given filename.
- *
- * @param in the input stream
- * @return a memento
- * @exception java.io.IOException
- */
- public static IMemento loadCorruptMemento(InputStream in) {
- Document document = null;
- try {
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- DocumentBuilder parser = factory.newDocumentBuilder();
- document = parser.parse(in);
- Node node = document.getFirstChild();
- if (node instanceof Element)
- return new XMLMemento(document, (Element) node);
- } catch (ParserConfigurationException e) {
- // ignore
- } catch (IOException e) {
- // ignore
- } catch (SAXException e) {
- // ignore
- } finally {
- try {
- in.close();
- } catch (Exception e) {
- // ignore
- }
- }
- return null;
- }
-
- /**
- * Loads a memento from the given filename.
- *
- * @param filename java.lang.String
- * @return a memento
- * @exception java.io.IOException
- */
- public static IMemento loadMemento(String filename) throws IOException {
- return XMLMemento.createReadRoot(new FileReader(filename));
- }
-
- /**
- * Loads a memento from the given filename.
- *
- * @param url java.net.URL
- * @return a memento
- * @exception java.io.IOException
- */
- public static IMemento loadMemento(URL url) throws IOException {
- return XMLMemento.createReadRoot(new InputStreamReader(url.openStream()));
- }
-
- /*
- * @see IMemento
- */
- private void putElement(Element element2) {
- NamedNodeMap nodeMap = element2.getAttributes();
- int size = nodeMap.getLength();
- for (int i = 0; i < size; i++){
- Attr attr = (Attr)nodeMap.item(i);
- putString(attr.getName(),attr.getValue());
- }
-
- NodeList nodes = element2.getChildNodes();
- size = nodes.getLength();
- for (int i = 0; i < size; i ++) {
- Node node = nodes.item(i);
- if (node instanceof Element) {
- XMLMemento child = (XMLMemento)createChild(node.getNodeName());
- child.putElement((Element)node);
- }
- }
- }
-
- /*
- * @see IMemento
- */
- public void putFloat(String key, float f) {
- element.setAttribute(key, String.valueOf(f));
- }
-
- /*
- * @see IMemento
- */
- public void putInteger(String key, int n) {
- element.setAttribute(key, String.valueOf(n));
- }
-
- /*
- * @see IMemento
- */
- public void putMemento(IMemento memento) {
- XMLMemento xmlMemento = (XMLMemento) memento;
- putElement(xmlMemento.element);
- }
-
- /*
- * @see IMemento
- */
- public void putString(String key, String value) {
- if (value == null)
- return;
- element.setAttribute(key, value);
- }
-
- /**
- * Save this Memento to a Writer.
- */
- public void save(Writer writer) throws IOException {
- Result result = new StreamResult(writer);
- Source source = new DOMSource(factory);
- try {
- Transformer transformer = TransformerFactory.newInstance().newTransformer();
- transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
- transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$
- transformer.transform(source, result);
- } catch (Exception e) {
- throw (IOException) (new IOException().initCause(e));
- }
- }
-
- /**
- * Save this Memento to a Writer.
- */
- public void save(OutputStream os) throws IOException {
- Result result = new StreamResult(os);
- Source source = new DOMSource(factory);
- try {
- Transformer transformer = TransformerFactory.newInstance().newTransformer();
- transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
- transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$
- transformer.transform(source, result);
- } catch (Exception e) {
- throw (IOException) (new IOException().initCause(e));
- }
- }
-
- /**
- * Saves the memento to the given file.
- *
- * @param filename java.lang.String
- * @exception java.io.IOException
- */
- public void saveToFile(String filename) throws IOException {
- Writer w = null;
- try {
- w = new FileWriter(filename);
- save(w);
- } catch (IOException e) {
- throw e;
- } catch (Exception e) {
- throw new IOException(e.getLocalizedMessage());
- } finally {
- if (w != null) {
- try {
- w.close();
- } catch (Exception e) {
- // ignore
- }
- }
- }
- }
-
- public String saveToString() throws IOException {
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- save(out);
- return out.toString("UTF-8");
- }
-
- /*
- * @see IMemento#getBoolean(String)
- */
- public Boolean getBoolean(String key) {
- Attr attr = element.getAttributeNode(key);
- if (attr == null)
- return null;
- String strValue = attr.getValue();
- if ("true".equalsIgnoreCase(strValue))
- return new Boolean(true);
-
- return new Boolean(false);
- }
-
- /*
- * @see IMemento#putBoolean(String, boolean)
- */
- public void putBoolean(String key, boolean value) {
- element.setAttribute(key, value ? "true" : "false");
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/HTTPConnection.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/HTTPConnection.java
deleted file mode 100644
index ca7231b..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/HTTPConnection.java
+++ /dev/null
@@ -1,112 +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.internet.monitor.core.internal.http;
-
-import org.eclipse.wst.internet.monitor.core.IMonitor;
-import org.eclipse.wst.internet.monitor.core.Request;
-import org.eclipse.wst.internet.monitor.core.internal.Monitor;
-import org.eclipse.wst.internet.monitor.core.internal.Trace;
-
-import java.util.List;
-import java.util.ArrayList;
-/**
- * Manages a monitor server connection between two hosts. This
- * connection may spawn one or more TCP/IP requests to be displayed
- * in the monitor server view.
- */
-public class HTTPConnection {
- protected IMonitor monitor;
-
- protected int req = -1;
- protected int resp = -1;
-
- protected List requests = new ArrayList();
-
- /**
- * MonitorHTTPConnection constructor comment.
- */
- public HTTPConnection(IMonitor monitor) {
- super();
- this.monitor = monitor;
- Trace.trace(Trace.PARSING, "TCP/IP monitor connection opened " + monitor);
- }
-
- /**
- * Add a request.
- *
- * @param b the request data
- * @param isNew true if new
- */
- public void addRequest(byte[] b, boolean isNew) {
- if (isNew)
- req ++;
- HTTPRequest request = (HTTPRequest) getRequestResponse(req);
- request.addToRequest(b);
- }
-
- /**
- * Add a response.
- *
- * @param b the response data
- * @param isNew true if new
- */
- public void addResponse(byte[] b, boolean isNew) {
- if (isNew)
- resp ++;
- HTTPRequest request = (HTTPRequest) getRequestResponse(resp);
- request.addToResponse(b);
- }
-
- /**
- *
- */
- public void addProperty(String key, Object value) {
- Request request = getRequestResponse(req);
- request.setProperty(key, value);
- }
-
- /**
- *
- */
- public Request getRequestResponse(boolean isRequest) {
- if (isRequest)
- return getRequestResponse(req);
-
- return getRequestResponse(resp);
- }
-
- /**
- *
- */
- protected Request getRequestResponse(int i) {
- synchronized (this) {
- while (i >= requests.size()) {
- Request request = new HTTPRequest((Monitor) monitor, monitor.getLocalPort(), monitor.getRemoteHost(), monitor.getRemotePort());
- requests.add(request);
- return request;
- }
- return (Request) requests.get(i);
- }
- }
-
- /**
- * Set the title.
- *
- * @param title the title
- * @param isNew boolean
- */
- public void setLabel(String title, boolean isNew) {
- if (isNew)
- req ++;
- HTTPRequest request = (HTTPRequest) getRequestResponse(req);
- request.setName(title);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/HTTPProtocolAdapter.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/HTTPProtocolAdapter.java
deleted file mode 100644
index 0a403d8..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/HTTPProtocolAdapter.java
+++ /dev/null
@@ -1,45 +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.internet.monitor.core.internal.http;
-
-import java.io.IOException;
-import java.net.Socket;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.wst.internet.monitor.core.IMonitor;
-import org.eclipse.wst.internet.monitor.core.internal.Connection;
-import org.eclipse.wst.internet.monitor.core.internal.ProtocolAdapterDelegate;
-/**
- *
- */
-public class HTTPProtocolAdapter extends ProtocolAdapterDelegate {
- protected Map map = new HashMap();
-
- public void connect(IMonitor monitor, Socket in, Socket out) throws IOException {
- Connection conn2 = new Connection(in, out);
- map.put(monitor, conn2);
- HTTPConnection conn = new HTTPConnection(monitor);
- HTTPThread request = new HTTPThread(conn2, in.getInputStream(), out.getOutputStream(), conn, true, monitor.getRemoteHost(), monitor.getRemotePort());
- HTTPThread response = new HTTPThread(conn2, out.getInputStream(), in.getOutputStream(), conn, false, "localhost", monitor.getLocalPort(), request);
- request.start();
- response.start();
- }
-
- public void disconnect(IMonitor monitor) throws IOException {
- try {
- Connection conn = (Connection) map.get(monitor);
- conn.close();
- } catch (Exception e) {
- // ignore
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/HTTPRequest.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/HTTPRequest.java
deleted file mode 100644
index a40b498..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/HTTPRequest.java
+++ /dev/null
@@ -1,84 +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.internet.monitor.core.internal.http;
-
-import org.eclipse.wst.internet.monitor.core.Request;
-import org.eclipse.wst.internet.monitor.core.internal.IProtocolAdapter;
-import org.eclipse.wst.internet.monitor.core.internal.Monitor;
-/**
- *
- */
-public class HTTPRequest extends Request {
- protected static final String HTTP_REQUEST_HEADER = "request-header";
- protected static final String HTTP_RESPONSE_HEADER = "response-header";
-
- protected static final String HTTP_REQUEST_BODY = "request-body";
- protected static final String HTTP_RESPONSE_BODY = "response-body";
-
- protected static final byte[] EMPTY = new byte[0];
-
- /**
- * HTTPRequestResponse constructor comment.
- */
- public HTTPRequest(Monitor monitor, int localPort, String remoteHost, int remotePort) {
- super(monitor, IProtocolAdapter.HTTP_PROTOCOL_ID, localPort, remoteHost, remotePort);
- }
-
- public byte[] getRequest(int type2) {
- if (type2 == ALL)
- return request;
- else if (type2 == TRANSPORT)
- return getRequestHeader();
- else
- return getRequestContent();
- }
-
- public byte[] getResponse(int type2) {
- if (type2 == ALL)
- return response;
- else if (type2 == TRANSPORT)
- return getResponseHeader();
- else
- return getResponseContent();
- }
-
- protected byte[] getRequestHeader() {
- Object obj = getProperty(HTTP_REQUEST_HEADER);
- if (obj == null || !(obj instanceof byte[]))
- return null;
- return (byte[]) obj;
- }
-
- protected byte[] getRequestContent() {
- Object obj = getProperty(HTTP_REQUEST_BODY);
- if (obj == null || !(obj instanceof byte[]))
- return null;
- return (byte[]) obj;
- }
-
- protected byte[] getResponseHeader() {
- Object obj = getProperty(HTTP_RESPONSE_HEADER);
- if (obj == null || !(obj instanceof byte[]))
- return null;
- return (byte[]) obj;
- }
-
- protected byte[] getResponseContent() {
- Object obj = getProperty(HTTP_RESPONSE_BODY);
- if (obj == null || !(obj instanceof byte[]))
- return null;
- return (byte[]) obj;
- }
-
- protected void setName(String n) {
- super.setName(n);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/HTTPThread.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/HTTPThread.java
deleted file mode 100644
index 6363c26..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/HTTPThread.java
+++ /dev/null
@@ -1,608 +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.internet.monitor.core.internal.http;
-
-import java.io.*;
-import org.eclipse.wst.internet.monitor.core.Request;
-import org.eclipse.wst.internet.monitor.core.internal.Connection;
-import org.eclipse.wst.internet.monitor.core.internal.Trace;
-/**
- * Monitor server I/O thread.
- */
-public class HTTPThread extends Thread {
- private static final int BUFFER = 2048;
- private static final byte CR = (byte) '\r';
- private static final byte LF = (byte) '\n';
- protected static int threadCount = 0;
-
- private byte[] readBuffer = new byte[BUFFER];
-
- // buffer and index
- protected byte[] buffer = new byte[0];
- protected int bufferIndex = 0;
-
- protected InputStream in;
- protected OutputStream out;
- protected HTTPConnection conn;
- protected boolean isRequest;
- protected Connection conn2;
-
- protected HTTPThread request;
- protected boolean isWaiting;
-
- // user to translate the Host: header
- protected String host;
- protected int port;
-
- protected int contentLength = -1;
- protected byte transferEncoding = -1;
- protected String responseType = null;
- protected boolean keepAlive = false;
-
- protected static final String[] ENCODING_STRING = new String[] {
- "chunked", "identity", "gzip", "compressed", "deflate"};
-
- protected static final byte ENCODING_CHUNKED = 0;
- protected static final byte ENCODING_IDENTITY = 1;
- protected static final byte ENCODING_GZIP = 2;
- protected static final byte ENCODING_COMPRESSED = 3;
- protected static final byte ENCODING_DEFLATE = 4;
-
-/* change:
-Referer: http://localhost:8081/index.html
-Host: localhost:8081
-*/
-/* The Connection header has the following grammar:
-
- Connection = "Connection" ":" 1#(connection-token)
- connection-token = token
-
- HTTP/1.1 proxies MUST parse the Connection header field before a
- message is forwarded and, for each connection-token in this field,
- remove any header field(s) from the message with the same name as the
- connection-token. */
-
- /**
- * MonitorThread constructor comment.
- */
- public HTTPThread(Connection conn2, InputStream in, OutputStream out, HTTPConnection conn, boolean isRequest, String host, int port) {
- super();
- this.conn2 = conn2;
- this.in = in;
- this.out = out;
- this.conn = conn;
- this.isRequest = isRequest;
- this.host = host;
- this.port = port;
-
- setName("HTTP (" + host + ":" + port + ") " + (isRequest ? "REQUEST" : "RESPONSE") + " " + (threadCount++));
- setPriority(Thread.NORM_PRIORITY + 1);
- setDaemon(true);
-
- Trace.trace(Trace.PARSING, "Started: " + this);
- }
-
- /**
- * MonitorThread constructor comment.
- */
- public HTTPThread(Connection conn2, InputStream in, OutputStream out, HTTPConnection conn, boolean isRequest, String host, int port, HTTPThread request) {
- this(conn2, in, out, conn, isRequest, host, port);
-
- this.request = request;
- }
-
- /**
- * Add a line feed to the end of the byte array.
- * @return byte[]
- * @param b byte[]
- */
- protected static byte[] convert(byte[] b) {
- if (b == null || b.length == 0)
- return b;
-
- int size = b.length;
- byte[] x = new byte[size + 2];
- System.arraycopy(b, 0, x, 0, size);
- x[size] = (byte) '\r'; // CR
- x[size + 1] = (byte) '\n'; // LF
- return x;
- }
-
- /**
- * Read more data into the buffer.
- *
- * @return byte[]
- */
- protected void fillBuffer() throws IOException {
- int n = in.read(readBuffer);
-
- if (n <= 0)
- throw new IOException("End of input");
-
- // add to full buffer
- int len = buffer.length - bufferIndex;
- if (len < 0)
- len = 0;
- byte[] x = new byte[n + len];
- System.arraycopy(buffer, bufferIndex, x, 0, len);
- System.arraycopy(readBuffer, 0, x, len, n);
- bufferIndex = 0;
- buffer = x;
- }
-
- /**
- * Returns the first location of a CRLF.
- *
- * @return int
- */
- protected int getFirstCRLF() {
- int size = buffer.length;
- int i = bufferIndex + 1;
- while (i < size) {
- if (buffer[i - 1] == CR && buffer[i] == LF)
- return i;
- i++;
- }
- return -1;
- }
-
- /**
- * Output the given bytes.
- * @param b byte[]
- */
- protected void outputBytes(byte[] b, boolean isNew) throws IOException {
- out.write(b);
- if (isRequest)
- conn.addRequest(b, isNew);
- else
- conn.addResponse(b, isNew);
- }
-
- /**
- * Parse the HTTP body.
- */
- public void parseBody() throws IOException {
- Trace.trace(Trace.PARSING, "Parsing body for: " + this);
-
- if (isRequest) {
- if (contentLength != -1) {
- byte[] b = readBytes(contentLength);
- out.write(b);
- conn.addRequest(b, false);
- setHTTPBody(b);
- } else if (transferEncoding != -1 && transferEncoding != ENCODING_IDENTITY) {
- parseChunk();
- }
-
- Trace.trace(Trace.PARSING, "Done parsing request body for: " + this);
- return;
- }
-
- // just return body for HTTP 1.0 responses
- if (!isRequest && !keepAlive && contentLength == -1 && transferEncoding == -1) {
- Trace.trace(Trace.PARSING, "Assuming HTTP 1.0 for: " + this);
- int n = buffer.length - bufferIndex;
- byte[] b = readBytes(n);
- byte[] body = new byte[0];
- while (n >= 0) {
- Trace.trace(Trace.PARSING, "Bytes read: " + n + " " + this);
- if (b != null && n > 0) {
- byte[] x = null;
- if (n == b.length)
- x = b;
- else {
- x = new byte[n];
- System.arraycopy(b, 0, x, 0, n);
- }
- outputBytes(x, false);
-
- // copy to HTTP body
- byte[] temp = new byte[body.length + x.length];
- System.arraycopy(body, 0, temp, 0, body.length);
- System.arraycopy(x, 0, temp, body.length, x.length);
- body = temp;
- }
- if (b.length < BUFFER)
- b = new byte[BUFFER];
- n = in.read(b);
- Thread.yield();
- }
- out.flush();
- setHTTPBody(body);
- return;
- }
-
- // spec 4.4.1
- if (responseType != null && (responseType.startsWith("1") || "204".equals(responseType) || "304".equals(responseType))) {
- setHTTPBody(new byte[0]);
- return;
- }
-
- // spec 4.4.2
- if (transferEncoding != -1 && transferEncoding != ENCODING_IDENTITY) {
- parseChunk();
- return;
- }
-
- // spec 4.4.3
- if (contentLength != -1) {
- byte[] b = readBytes(contentLength);
- out.write(b);
- if (isRequest)
- conn.addRequest(b, false);
- else
- conn.addResponse(b, false);
- setHTTPBody(b);
- return;
- }
-
- // spec 4.4.4 (?)
-
- Trace.trace(Trace.PARSING, "Unknown body for: " + this);
- }
-
- /**
- * Parse an HTTP chunk.
- */
- public void parseChunk() throws IOException {
- Trace.trace(Trace.PARSING, "Parsing chunk for: " + this);
- boolean done = false;
- byte[] body = new byte[0];
-
- while (!done) {
- // read chunk size
- byte[] b = readLine();
-
- String s = new String(b);
- int index = s.indexOf(" ");
- int length = -1;
- try {
- if (index > 0)
- s = s.substring(0, index);
- length = Integer.parseInt(s.trim(), 16);
- } catch (Exception e) {
- Trace.trace(Trace.PARSING, "Error chunk for: " + this, e);
- }
-
- // output bytes
- outputBytes(b, false);
-
- if (length <= 0)
- done = true;
- else {
- // read and output chunk data plus CRLF
- b = readBytes(length + 2);
- outputBytes(b, false);
-
- // copy to HTTP body
- byte[] temp = new byte[body.length + b.length - 2];
- System.arraycopy(body, 0, temp, 0, body.length);
- System.arraycopy(b, 0, temp, body.length, b.length - 2);
- body = temp;
- }
- }
-
- // read trailer
- byte[] b = readLine();
- while (b.length > 2) {
- outputBytes(b, false);
- b = readLine();
- }
-
- outputBytes(b, false);
- setHTTPBody(body);
- }
-
- /**
- * Parse an HTTP header.
- */
- public void parseHeader() throws IOException {
- Trace.trace(Trace.PARSING, "Parsing header for: " + this);
-
- // read until first blank line
- boolean isFirstLine = true;
- boolean isNew = true;
-
- byte[] b = readLine();
- while (b.length > 5) {
- Trace.trace(Trace.PARSING, "Parsing header line: '" + new String(b) + "'");
-
- if (isFirstLine) {
- String s = new String(b);
- if (isRequest) {
- setLabel(s);
- isNew = false;
- }
-
- if (!isRequest) {
- int index1 = s.indexOf(' ');
- int index2 = s.indexOf(' ', index1 + 1);
-
- try {
- responseType = s.substring(index1 + 1, index2).trim();
- Trace.trace(Trace.PARSING, "Response Type: " + this + " " + responseType);
- } catch (Exception e) {
- Trace.trace(Trace.PARSING, "Error parsing response type for: " + this, e);
- }
- if (responseType != null && responseType.equals("100")) {
- outputBytes(b, isNew);
- isNew = false;
-
- b = readLine();
- outputBytes(b, false);
-
- b = readLine();
-
- index1 = s.indexOf(' ');
- index2 = s.indexOf(' ', index1 + 1);
-
- try {
- responseType = s.substring(index1 + 1, index2).trim();
- Trace.trace(Trace.PARSING, "Response Type: " + this + " " + responseType);
- } catch (Exception e) {
- Trace.trace(Trace.PARSING, "Error parsing response type for: " + this, e);
- }
- }
- }
- isFirstLine = false;
- }
-
- // translate
- b = translateHeaderLine(b);
-
- outputBytes(b, isNew);
- isNew = false;
-
- b = readLine();
- }
-
- Trace.trace(Trace.PARSING, "Parsing final header line: '" + new String(b) + "'");
-
- outputBytes(b, false);
-
- Request rr = conn.getRequestResponse(isRequest);
- Trace.trace(Trace.PARSING, "Setting header length: " + rr.getRequest(Request.ALL).length);
-
- setHTTPHeader(rr);
- }
-
- /**
- * Read bytes from the stream.
- * @return byte[]
- */
- protected byte[] readBytes(int n) throws IOException {
- Trace.trace(Trace.PARSING, "readBytes() " + n + " for: " + this);
- while (buffer.length - bufferIndex < n)
- fillBuffer();
-
- return removeFromBuffer(bufferIndex + n);
- }
-
- /**
- * Read and return the next full line.
- *
- * @return byte[]
- */
- protected byte[] readLine() throws IOException {
- Trace.trace(Trace.PARSING, "readLine() for: " + this);
-
- int n = getFirstCRLF();
- while (n < 0) {
- fillBuffer();
- n = getFirstCRLF();
- }
- return removeFromBuffer(n + 1);
- }
-
- /**
- * Remove data from the buffer up to the absolute index n.
- * Return the data from between bufferIndex and n.
- *
- * @param n the bytes to remove
- * @return a byte array
- */
- protected byte[] removeFromBuffer(int n) {
- // copy line out of buffer
- byte[] b = new byte[n - bufferIndex];
- System.arraycopy(buffer, bufferIndex, b, 0, n - bufferIndex);
-
- if (buffer.length > BUFFER * 2 || bufferIndex > BUFFER) {
- // remove line from buffer
- int size = buffer.length;
- byte[] x = new byte[size - n];
- System.arraycopy(buffer, n, x, 0, size - n);
- buffer = x;
- bufferIndex = 0;
- } else
- bufferIndex = n;
-
- return b;
- }
-
- /**
- * Listen for input, save it, and pass to the output stream.
- * Philosophy: Read a single line separately and translate.
- * When blank line is reached, just pass all other data through.
- */
- public void run() {
- try {
- try {
- while (true) {
- contentLength = -1;
- transferEncoding = -1;
- keepAlive = false;
-
- parseHeader();
- parseBody();
-
- if (isRequest && keepAlive)
- waitForResponse();
-
- //Request r = conn.getRequestResponse(true);
- //r.fireChangedEvent();
-
- Trace.trace(Trace.PARSING, "Done HTTP request for " + this + " " + keepAlive);
- if (!isRequest && !request.keepAlive) {
- conn2.close();
- break;
- }
-
- if (!isRequest)
- notifyRequest();
-
- Thread.yield();
- }
- } catch (IOException e) {
- // reached end of input
- Trace.trace(Trace.PARSING, "End of buffer for: " + this + " " + e.getMessage());
- }
-
- // send rest of buffer
- out.write(buffer, bufferIndex, buffer.length - bufferIndex);
- out.flush();
- } catch (Exception e) {
- Trace.trace(Trace.PARSING, "Error in: " + this, e);
- }
- //if (!isRequest)
- // conn2.close();
-
- Trace.trace(Trace.PARSING, "Closing thread " + this);
- }
-
- /**
- * Sets the title of the call.
- *
- * @param s java.lang.String
- */
- protected void setLabel(String s) {
- try {
- int index1 = s.indexOf(' ');
- if (index1 < 0 || index1 > 15)
- return;
- int index2 = s.indexOf(' ', index1 + 1);
- if (index2 < 0)
- return;
-
- conn.setLabel(s.substring(index1 + 1, index2), true);
- } catch (Exception e) {
- // ignore
- }
- }
-
- /**
- * Translate the header line.
- *
- * @return byte[]
- * @param b byte[]
- */
- protected byte[] translateHeaderLine(byte[] b) {
- String s = new String(b);
-
- if (isRequest && s.startsWith("Host: ")) {
- String t = "Host: " + host;
- if (port != 80)
- t += ":" + port;
- return convert(t.getBytes());
- } else if (s.startsWith("Content-Length: ")) {
- try {
- contentLength = Integer.parseInt(s.substring(16).trim());
- Trace.trace(Trace.PARSING, "Content length: " + this + " " + contentLength);
- } catch (Exception e) {
- Trace.trace(Trace.PARSING, "Content length error", e);
- }
- } else if (s.startsWith("Connection: ")) {
- try {
- String t = s.substring(11).trim();
- if (t.equalsIgnoreCase("Keep-Alive"))
- keepAlive = true;
- Trace.trace(Trace.PARSING, "Keep alive: " + keepAlive);
- } catch (Exception e) {
- Trace.trace(Trace.PARSING, "Error getting Connection: from header", e);
- }
- } else if (s.startsWith("Transfer-Encoding: ")) {
- String t = s.substring(19).trim();
- int size = ENCODING_STRING.length;
- for (int i = 0; i < size; i++) {
- if (ENCODING_STRING[i].equalsIgnoreCase(t)) {
- transferEncoding = (byte) i;
- Trace.trace(Trace.PARSING, "Transfer encoding: " + ENCODING_STRING[i]);
- }
- }
- }
-
- return b;
- }
-
- protected void close() {
- try {
- Trace.trace(Trace.PARSING, "Closing: " + this);
- out.close();
- } catch (Exception e) {
- Trace.trace(Trace.PARSING, "Error closing connection " + this + " " + e.getMessage());
- }
- }
-
- protected void waitForResponse() {
- Trace.trace(Trace.PARSING, "Waiting for response " + this);
- synchronized (this) {
- try {
- isWaiting = true;
- wait();
- } catch (Exception e) {
- Trace.trace(Trace.PARSING, "Error in waitForResponse() " + this + " " + e.getMessage());
- }
- isWaiting = false;
- }
- Trace.trace(Trace.PARSING, "Done waiting for response " + this);
- }
-
- protected void notifyRequest() {
- Trace.trace(Trace.PARSING, "Notifying request " + this);
- while (request.keepAlive && !request.isWaiting) {
- Trace.trace(Trace.PARSING, "Waiting for request " + this);
- try {
- Thread.sleep(100);
- } catch (Exception e) {
- // ignore
- }
- }
- synchronized (request) {
- try {
- request.notify();
- } catch (Exception e) {
- Trace.trace(Trace.PARSING, "Error in notifyRequest() " + this + " " + e.getMessage());
- }
- }
- Trace.trace(Trace.PARSING, "Done notifying request " + this);
- }
-
- protected void setHTTPHeader(Request rr) {
- if (isRequest) {
- byte[] b = rr.getRequest(Request.ALL);
- byte[] h = new byte[b.length];
- System.arraycopy(b, 0, h, 0, b.length);
- rr.setProperty(HTTPRequest.HTTP_REQUEST_HEADER, h);
- } else {
- byte[] b = rr.getResponse(Request.ALL);
- byte[] h = new byte[b.length];
- System.arraycopy(b, 0, h, 0, b.length);
- rr.setProperty(HTTPRequest.HTTP_RESPONSE_HEADER, h);
- }
- }
-
- protected void setHTTPBody(byte[] b) {
- Request rr = conn.getRequestResponse(isRequest);
- if (isRequest)
- rr.setProperty(HTTPRequest.HTTP_REQUEST_BODY, b);
- else
- rr.setProperty(HTTPRequest.HTTP_RESPONSE_BODY, b);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/ResendHTTPConnection.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/ResendHTTPConnection.java
deleted file mode 100644
index 6ac371b..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/ResendHTTPConnection.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.internet.monitor.core.internal.http;
-
-import org.eclipse.wst.internet.monitor.core.Request;
-/**
- * A resend HTTP connection wraps an HTTP connection to send an existing request.
- */
-public class ResendHTTPConnection extends HTTPConnection{
- protected Request existingRequest;
-
- public ResendHTTPConnection(Request request) {
- super(null);
- this.existingRequest = request;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.core.internal.http.HTTPConnection#getRequestResponse(int)
- */
- protected Request getRequestResponse(int i) {
- return existingRequest;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/ResendHTTPRequest.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/ResendHTTPRequest.java
deleted file mode 100644
index a4b7907..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/ResendHTTPRequest.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2004, 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.internet.monitor.core.internal.http;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.net.Socket;
-
-import org.eclipse.wst.internet.monitor.core.Request;
-import org.eclipse.wst.internet.monitor.core.internal.Connection;
-import org.eclipse.wst.internet.monitor.core.internal.Monitor;
-import org.eclipse.wst.internet.monitor.core.internal.SocketWrapper;
-/**
- * Wraps an existing request to create an HTTP request that can be sent. The
- * response is ignored. Only the request is important in this case.
- */
-public class ResendHTTPRequest extends HTTPRequest {
- private boolean sent = false;
-
- private byte[] header;
-
- private byte[] content;
-
- private Request originalRequest = null;
-
- /**
- * Constructor.
- *
- * @param req the request that is to be resent.
- */
- public ResendHTTPRequest(Monitor monitor, Request req) {
- super(monitor, req.getLocalPort(), req.getRemoteHost(), req.getRemotePort());
- setProperty(HTTP_REQUEST_HEADER, req.getProperty(HTTP_REQUEST_HEADER));
- setProperty(HTTP_REQUEST_BODY, req.getProperty(HTTP_REQUEST_BODY));
- header = req.getRequest(TRANSPORT);
- content = req.getRequest(CONTENT);
- request = req.getRequest(ALL);
- name = req.getName();
- this.originalRequest = req;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.core.IResendRequest#sendRequest()
- */
- public void sendRequest() {
- try {
- Socket inSocket = new SocketWrapper(new ByteArrayInputStream(request));
- Socket outSocket = new Socket(remoteHost, remotePort);
- //Connection conn = new Connection(inSocket, outSocket);
- //TCPIPThread requestThread = new TCPIPThread(conn, this, in,
- // outSocket.getOutputStream(), true);
- //requestThread.start();
- //new TCPIPThread(conn, this, outSocket.getInputStream(),
- // inSocket.getOutputStream(), false).start();
- Connection conn2 = new Connection(inSocket, outSocket);
- ResendHTTPConnection conn = new ResendHTTPConnection(this);
-
- HTTPThread request2 = new HTTPThread(conn2, inSocket.getInputStream(),
- outSocket.getOutputStream(), conn, true, remoteHost, remotePort);
- HTTPThread response2 = new HTTPThread(conn2, outSocket.getInputStream(),
- inSocket.getOutputStream(), conn, false, "localhost", localPort, request2);
- request2.start();
- response2.start();
- } catch (IOException e) {
- response = ("Unable to resend to server.\n" + e).getBytes();
- }
- sent = true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.core.internal.Request2#addToRequest(byte[])
- */
- public void addToRequest(byte[] addRequest) {
- // Don't want to add to the request as we already have the request.
- }
-
- public boolean hasBeenSent() {
- return sent;
- }
-
- public void setRequest(byte[] request, int type) {
- if (type == TRANSPORT && request != null)
- header = request;
- else if (type == CONTENT)
- content = request;
-
- int length = 0;
- int headerLength = 0;
- if (header != null) {
- length += header.length;
- headerLength = length;
- }
- if (content != null)
- length += content.length;
- byte[] newRequest = new byte[length];
- if (header != null)
- System.arraycopy(header, 0, newRequest, 0, header.length);
- if (content != null)
- System.arraycopy(content, 0, newRequest, headerLength, content.length);
- super.setRequest(newRequest);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.core.internal.http.HTTPRequest#getRequestContent()
- */
- protected byte[] getRequestContent() {
- return content;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.core.internal.http.HTTPRequest#getRequestHeader()
- */
- protected byte[] getRequestHeader() {
- return header;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.core.IResendRequest#getOriginalRequest()
- */
- public Request getOriginalRequest() {
- return originalRequest;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/package.xml b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/package.xml
deleted file mode 100644
index 2b80e09..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/package.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<html>
-<head>
- <!-- Escape to the root of your source folder -->
- <meta
- name="root"
- content="../../../../../../" />
- <title>WTP API overview</title>
-</head>
-
-<body>
-
-<p>TCP/IP monitor core</p>
-
-<p>This package gives core (non-UI) access to the TCP/IP monitor. Clients can
-query for existing monitors, create new monitors, start/stop monitors, and
-listen for requests being received by a running monitor.</p>
-
-<p>The MonitorCore class gives initial access to all of the API. From here you
-can query the existing monitors, create new ones, and add/remove a listener for
-monitor changes.</p>
-
-<p>The IMonitor interface provides information about a particular monitor,
-allowing you to change it via a working copy, start/stop it, or add a listener
-for request activity.</p>
-
-</body>
-</html>
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/plugin.properties b/plugins/org.eclipse.wst.internet.monitor.core/plugin.properties
deleted file mode 100644
index aa7568c..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/plugin.properties
+++ /dev/null
@@ -1,27 +0,0 @@
-###############################################################################
-# Copyright (c) 2004, 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
-###############################################################################
-pluginName=Monitor
-providerName=Eclipse.org
-
-# --------------- Errors ---------------
-errorPortInUse=The TCP/IP monitor could not start because port {0} is in use.
-errorInvalidLocalPort=The local port number is invalid.
-errorInvalidRemotePort=The remote port number is invalid.
-errorInvalidRemoteHost=The remote host name is invalid.
-
-extensionPointProtocolAdapters=Protocol Adapters
-extensionPointContentFilters=Content Filters
-extensionPointStartup=Startup
-
-monitorValid=The monitor is valid.
-
-HTTP=HTTP
-TCPIP=TCP/IP
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/plugin.xml b/plugins/org.eclipse.wst.internet.monitor.core/plugin.xml
deleted file mode 100644
index 98a0e29..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/plugin.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-
-<plugin id="org.eclipse.wst.internet.monitor.core"
- name="%pluginName"
- version="1.0.0"
- provider-name="%providerName"
- class="org.eclipse.wst.internet.monitor.core.internal.MonitorPlugin">
-
-<requires>
- <import plugin="org.eclipse.core.runtime"/>
-</requires>
-
-<runtime>
- <library name="monitorcore.jar">
- <export name="*"/>
- </library>
-</runtime>
-
-<extension-point name="%extensionPointProtocolAdapters" id="internalProtocolAdapters" schema="schema/protocolAdapters.exsd"/>
-<extension-point name="%extensionPointContentFilters" id="contentFilters" schema="schema/contentFilters.exsd"/>
-<extension-point name="%extensionPointStartup" id="internalStartup" schema="schema/startup.exsd"/>
-
-<extension point="org.eclipse.wst.internet.monitor.core.internalProtocolAdapters">
- <protocolAdapter
- id="TCP/IP"
- class="org.eclipse.wst.internet.monitor.core.internal.TCPIPProtocolAdapter"
- name="%TCPIP"/>
- <protocolAdapter
- id="HTTP"
- class="org.eclipse.wst.internet.monitor.core.internal.http.HTTPProtocolAdapter"
- name="%HTTP"/>
-</extension>
-
-</plugin>
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/schema/contentFilters.exsd b/plugins/org.eclipse.wst.internet.monitor.core/schema/contentFilters.exsd
deleted file mode 100644
index 9549579..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/schema/contentFilters.exsd
+++ /dev/null
@@ -1,131 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.internet.monitor.core">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.internet.monitor.core" id="contentFilters" name="Content Filters"/>
- </appInfo>
- <documentation>
- This extension point is used to filter content received in a monitor.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="filter" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="filter">
- <annotation>
- <appInfo>
- <meta.element labelAttribute="name"/>
- </appInfo>
- </annotation>
- <complexType>
- <sequence>
- </sequence>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- specifies a unique identifier for this extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- specifies the fully qualified name of a Java class that extends <samp>org.eclipse.wst.internet.monitor.core.ContentFilterDelegate</samp>.
-Content filter instances of this type will delegate to instances of this class.
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.wst.internet.monitor.core.ContentFilterDelegate"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="name" type="string" use="required">
- <annotation>
- <documentation>
- a translatable name used to identify the filter
- </documentation>
- </annotation>
- </attribute>
- <attribute name="order" type="int">
- <annotation>
- <documentation>
- an integer used to order filters relative to each other. Lower orders are processed first
- </documentation>
- <appInfo>
- <meta.attribute kind="java"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following is an example of a content filter extension point:
-
-<p>
-<pre>
- <extension point="org.eclipse.wst.internet.monitor.core.contentFilter">
- <filter
- id="com.example.ExampleIdentifier"
- name="%exampleName"
- class="com.example.ExampleContentFilter"/>
- </extension>
-</pre>
-</p>
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- Value of the attribute <b>class</b> must be a fully qualified name of a Java class that extends the abstract class <b>org.eclipse.wst.internet.monitor.core.ContentFilterDelegate</b>.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2003, 2004 IBM Corporation and others.<br>
-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
-<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/schema/protocolAdapters.exsd b/plugins/org.eclipse.wst.internet.monitor.core/schema/protocolAdapters.exsd
deleted file mode 100644
index 12e52b7..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/schema/protocolAdapters.exsd
+++ /dev/null
@@ -1,123 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.internet.monitor.core">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.internet.monitor.core" id="internalProtocolAdapters" name="Protocol Adapters"/>
- </appInfo>
- <documentation>
- This extension point is used to provide an adapter for a new protocol (e.g. HTTP). This allows different types of protocols to be monitored in a specific way.
-
-This extension point is currently not being exposed as API.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="protocolAdapter" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="protocolAdapter">
- <annotation>
- <appInfo>
- <meta.element labelAttribute="name"/>
- </appInfo>
- </annotation>
- <complexType>
- <sequence>
- </sequence>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- specifies a unique identifier for this extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- specifies the fully qualified name of the Java class that extends <samp>org.eclipse.wst.internet.monitor.core.internal.ProtocolAdapterDelegate</samp>
-Protocol adapter instances of this type will delegate to instances of this class.
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.wst.internet.monitor.core.internal.ProtocolAdapterDelegate"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="name" type="string" use="required">
- <annotation>
- <documentation>
- a translatable name used to identify the protocol adapter
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following is an example of a protocol adapter extension point to define a protocol adapter for TCP/IP:
-
-<p>
-<pre>
-<extension point="org.eclipse.wst.internet.monitor.core.protocolAdapters">
- <protocolAdapter
- id="TCPIP"
- class="com.example.TCPIPProtocolAdapter"
- name="%TCPIP"/>
-</extension>
-</pre>
-</p>
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- Value of the attribute <b>class</b> must be a fully qualified name of a Java class that extends the abstract class <b>org.eclipse.wst.internet.monitor.core.internal.ProtocolAdapterDelegate</b>.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2003, 2004 IBM Corporation and others.<br>
-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
-<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/schema/startup.exsd b/plugins/org.eclipse.wst.internet.monitor.core/schema/startup.exsd
deleted file mode 100644
index 1382f3a..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/schema/startup.exsd
+++ /dev/null
@@ -1,114 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.internet.monitor.core">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.internet.monitor.core" id="internalStartup" name="Startup"/>
- </appInfo>
- <documentation>
- This extension point is used to load a secondary plugin. The extension point will be called when the monitor core plugin starts up.
-
-This extension point is internal and should not be used by any other plugins.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="startup" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="startup">
- <annotation>
- <appInfo>
- <meta.element labelAttribute="name"/>
- </appInfo>
- </annotation>
- <complexType>
- <sequence>
- </sequence>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- specifies a unique identifier for this extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.wst.internet.monitor.core.internal.IStartup"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following is an example of a startup extension point:
-
-<p>
-<pre>
-<extension point="org.eclipse.wst.internet.monitor.core.internal.startups">
- <startup
- id="com.example.myplugin"
- class="com.example.myplugin.Startup"/>
-</extension>
-</pre>
-</p>
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- This extension point is internal and should not be used by any other plugins.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2005 IBM Corporation and others.<br>
-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
-<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/.classpath b/plugins/org.eclipse.wst.internet.monitor.ui/.classpath
deleted file mode 100644
index 0631920..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="monitorui/"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/.cvsignore b/plugins/org.eclipse.wst.internet.monitor.ui/.cvsignore
deleted file mode 100644
index 7d2f75b..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/.cvsignore
+++ /dev/null
@@ -1,5 +0,0 @@
-bin
-monitorui.jar
-build.xml
-temp.folder
-org.eclipse.wst.internet.monitor.ui_3.0.0.jar
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/.options b/plugins/org.eclipse.wst.internet.monitor.ui/.options
deleted file mode 100644
index 08412ea..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/.options
+++ /dev/null
@@ -1,4 +0,0 @@
-# Debugging options for the org.eclipse.wst.internet.monitor.ui plugin
-
-# Turn on general debugging
-org.eclipse.wst.internet.monitor.ui/debug=true
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/.project b/plugins/org.eclipse.wst.internet.monitor.ui/.project
deleted file mode 100644
index b81173e..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.internet.monitor.ui</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/build.properties b/plugins/org.eclipse.wst.internet.monitor.ui/build.properties
deleted file mode 100644
index a4f741a..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/build.properties
+++ /dev/null
@@ -1,20 +0,0 @@
-###############################################################################
-# Copyright (c) 2004 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
-###############################################################################
-bin.includes = plugin.xml,\
- *.jar,\
- monitorui.jar,\
- plugin.properties,\
- icons/
-jars.compile.order =
-src.includes = schema/,\
- build.properties
-output.monitorui.jar = bin/
-source.monitorui.jar = monitorui/
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/icons/clcl16/clear.gif b/plugins/org.eclipse.wst.internet.monitor.ui/icons/clcl16/clear.gif
deleted file mode 100644
index 389954f..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/icons/clcl16/clear.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/icons/clcl16/httpHeader.gif b/plugins/org.eclipse.wst.internet.monitor.ui/icons/clcl16/httpHeader.gif
deleted file mode 100644
index fb20c38..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/icons/clcl16/httpHeader.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/icons/clcl16/sortResponseTime.gif b/plugins/org.eclipse.wst.internet.monitor.ui/icons/clcl16/sortResponseTime.gif
deleted file mode 100644
index e334e9f..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/icons/clcl16/sortResponseTime.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/icons/cview16/monitorView.gif b/plugins/org.eclipse.wst.internet.monitor.ui/icons/cview16/monitorView.gif
deleted file mode 100644
index c374f13..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/icons/cview16/monitorView.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/icons/dlcl16/clear.gif b/plugins/org.eclipse.wst.internet.monitor.ui/icons/dlcl16/clear.gif
deleted file mode 100644
index 3bf98c0..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/icons/dlcl16/clear.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/icons/dlcl16/httpHeader.gif b/plugins/org.eclipse.wst.internet.monitor.ui/icons/dlcl16/httpHeader.gif
deleted file mode 100644
index 6d71a8b..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/icons/dlcl16/httpHeader.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/icons/dlcl16/sortResponseTime.gif b/plugins/org.eclipse.wst.internet.monitor.ui/icons/dlcl16/sortResponseTime.gif
deleted file mode 100644
index 06e0c73..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/icons/dlcl16/sortResponseTime.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/icons/elcl16/clear.gif b/plugins/org.eclipse.wst.internet.monitor.ui/icons/elcl16/clear.gif
deleted file mode 100644
index 389954f..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/icons/elcl16/clear.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/icons/elcl16/httpHeader.gif b/plugins/org.eclipse.wst.internet.monitor.ui/icons/elcl16/httpHeader.gif
deleted file mode 100644
index fb20c38..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/icons/elcl16/httpHeader.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/icons/elcl16/resendRequest.gif b/plugins/org.eclipse.wst.internet.monitor.ui/icons/elcl16/resendRequest.gif
deleted file mode 100644
index cf62b63..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/icons/elcl16/resendRequest.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/icons/elcl16/sortResponseTime.gif b/plugins/org.eclipse.wst.internet.monitor.ui/icons/elcl16/sortResponseTime.gif
deleted file mode 100644
index e334e9f..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/icons/elcl16/sortResponseTime.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/icons/etool16/editRequest.gif b/plugins/org.eclipse.wst.internet.monitor.ui/icons/etool16/editRequest.gif
deleted file mode 100644
index d044e59..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/icons/etool16/editRequest.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/icons/eview16/monitorView.gif b/plugins/org.eclipse.wst.internet.monitor.ui/icons/eview16/monitorView.gif
deleted file mode 100644
index c374f13..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/icons/eview16/monitorView.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/icons/obj16/host.gif b/plugins/org.eclipse.wst.internet.monitor.ui/icons/obj16/host.gif
deleted file mode 100644
index b51ae39..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/icons/obj16/host.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/icons/obj16/monitorOff.gif b/plugins/org.eclipse.wst.internet.monitor.ui/icons/obj16/monitorOff.gif
deleted file mode 100644
index 42e5f31..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/icons/obj16/monitorOff.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/icons/obj16/monitorOn.gif b/plugins/org.eclipse.wst.internet.monitor.ui/icons/obj16/monitorOn.gif
deleted file mode 100644
index 2ff3974..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/icons/obj16/monitorOn.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/icons/obj16/tcp.gif b/plugins/org.eclipse.wst.internet.monitor.ui/icons/obj16/tcp.gif
deleted file mode 100644
index 8a6e219..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/icons/obj16/tcp.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/ContentViewer.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/ContentViewer.java
deleted file mode 100644
index 853ab2d..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/ContentViewer.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2004, 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.internet.monitor.ui;
-
-import org.eclipse.swt.widgets.Composite;
-/**
- * Editable viewer for displaying and editing requests and responses.
- * <p>
- * This abstract class is intended to be subclassed only by clients
- * to extend the <code>contentViewers</code> extension point.
- * The subclass must have a public 0-argument constructor, which will be used
- * automatically to instantiate the viewer when required.
- * Once instantiated, {@link #init(Composite)} is called to create
- * the viewer's controls. Then {@link #setContent(byte[])} is called,
- * one or more times, to cause the viewer to display particular
- * content. Finally, when the viewer is no longer needed, {@link #dispose()}
- * is called to free up any resources tied up by the viewer.
- * </p>
- * <p>
- * [issue: It's unclear how these content viewers are used.
- * Is it just that the UI provides a list of available
- * views for the user to make a manual selection from, regardless
- * of the actual content of the message traffic?]
- * </p>
- * [issue: CS - If a ContentViewer is editable, does that mean we can edit the
- * bytes of the message and resend it across the wire? How is an editable ContentViewer
- * handled differently by the framework? Perhaps an example of what an editeable viewer would do. ]
- * @since 1.0
- */
-public abstract class ContentViewer {
- /**
- * Creates a new content viewer instance.
- */
- protected ContentViewer() {
- // do nothing
- }
-
- /**
- * Creates the controls for this viewer as children of the given composite.
- * <p>
- * The default implementation of this method does nothing.
- * Subclasses should override this method.
- * </p>
- *
- * @param parent the parent composite
- */
- public abstract void init(Composite parent);
-
- /**
- * Sets the content that the viewer should display.
- * The parameter may be null if no content should be displayed.
- * <p>
- * The default implementation of this method does nothing.
- * Subclasses should override this method.
- * </p>
- * <p>
- * [issue: Since this is for displaying request-reponse messages,
- * why not pass an Request? The problem as it stands now is that
- * it is unclear from specs how content viewers relate to anything
- * else having to do with the monitor.]
- * </p>
- *
- * @param b the content to display, or <code>null</code> to
- * display nothing
- */
- public abstract void setContent(byte[] b);
-
- /**
- * Get the content from the viewer. This is usually only interesting if the
- * content has changed.
- * <p>
- * The default implementation of this method does nothing and
- * returns null. Subclasses should override this method.
- * </p>
- *
- * @return the content from the viewer, or <code>null</code> if none
- */
- public abstract byte[] getContent();
-
- /**
- * Disposes this viewer and any underlying resources such as a composite.
- * This method will be called whenever the user switches to use another
- * viewer or the monitor view is closed. The parent composite should not
- * be disposed since it may be used to display another viewer.
- * <p>
- * The default implementation of this method does nothing.
- * Subclasses should override this method to provide specialized cleanup.
- * </p>
- */
- public void dispose() {
- // do nothing
- }
-
- /**
- * Set whether the current viewer is editable, that is, the user is able to
- * edit the content.
- * <p>
- * The default implementation of this method does nothing.
- * Subclasses should override this method to allows instances
- * to be made editable.
- * </p>
- *
- * @param editable <code>true</code> if true the content can be edited,
- * and <code>false</code> otherwise
- */
- public void setEditable(boolean editable) {
- // do nothing
- }
-
- /**
- * Returns whether the current viewer is editable, that is, the user is able to
- * edit the content.
- * <p>
- * The default implementation of this method does nothing.
- * Subclasses should override this method to allows instances
- * to be made editable.
- * </p>
- *
- * @return <code>true</code> if true the content can be edited,
- * and <code>false</code> otherwise
- */
- public boolean getEditable() {
- return false;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/MonitorUICore.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/MonitorUICore.java
deleted file mode 100644
index 6a0a756..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/MonitorUICore.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2004, 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.internet.monitor.ui;
-
-import org.eclipse.wst.internet.monitor.core.Request;
-import org.eclipse.wst.internet.monitor.ui.internal.MonitorUIPlugin;
-/**
- * Main class for access to the monitor UI.
- * <p>
- * This class provides all functionality through static members. It is not intended
- * to be instantiated or subclassed.
- * </p>
- *
- * @since 1.0
- */
-public final class MonitorUICore {
- /**
- * Cannot create MonitorUICore - use static methods.
- */
- private MonitorUICore() {
- // can't create
- }
-
- /**
- * Returns an array of the requests currently being displayed in the TCP/IP
- * monitor view.
- *
- * @return an array of requests
- */
- public static Request[] getRequests() {
- return MonitorUIPlugin.getInstance().getRequests();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/ContextIds.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/ContextIds.java
deleted file mode 100644
index df1d1c7..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/ContextIds.java
+++ /dev/null
@@ -1,25 +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.internet.monitor.ui.internal;
-/**
- * Constant ids for context help.
- */
-public interface ContextIds {
- public static final String VIEW = MonitorUIPlugin.PLUGIN_ID + ".tmvw0000";
- public static final String VIEW_TREE = MonitorUIPlugin.PLUGIN_ID + ".tmvw0002";
- public static final String VIEW_REQUEST = MonitorUIPlugin.PLUGIN_ID + ".tmvw0004";
- public static final String VIEW_RESPONSE = MonitorUIPlugin.PLUGIN_ID + ".tmvw0006";
-
- public static final String PREF = MonitorUIPlugin.PLUGIN_ID + ".tmpr0000";
- public static final String PREF_SHOW = MonitorUIPlugin.PLUGIN_ID + ".tmpr0002";
- public static final String PREF_MONITORS = MonitorUIPlugin.PLUGIN_ID + ".tmpr0004";
- public static final String PREF_DIALOG = MonitorUIPlugin.PLUGIN_ID + ".tmpr0006";
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/MonitorContentProvider.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/MonitorContentProvider.java
deleted file mode 100644
index 52c52be..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/MonitorContentProvider.java
+++ /dev/null
@@ -1,49 +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.internet.monitor.ui.internal;
-
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.wst.internet.monitor.core.MonitorCore;
-/**
- * Monitor content provider.
- */
-public class MonitorContentProvider implements IStructuredContentProvider {
- /**
- * MonitorContentProvider constructor comment.
- */
- public MonitorContentProvider() {
- super();
- }
-
- /*
- * Disposes of this content provider.
- */
- public void dispose() {
- // do nothing
- }
-
- /*
- * Returns the elements to display in the viewer
- * when its input is set to the given element.
- */
- public Object[] getElements(Object inputElement) {
- return MonitorCore.getMonitors();
- }
-
- /*
- * Notifies this content provider that the given viewer's input
- * has been switched to a different element.
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- // do nothing
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/MonitorDialog.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/MonitorDialog.java
deleted file mode 100644
index a743ae2..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/MonitorDialog.java
+++ /dev/null
@@ -1,235 +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.internet.monitor.ui.internal;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.*;
-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.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.internet.monitor.core.IMonitorWorkingCopy;
-import org.eclipse.wst.internet.monitor.core.MonitorCore;
-import org.eclipse.wst.internet.monitor.core.internal.IProtocolAdapter;
-/**
- *
- */
-public class MonitorDialog extends Dialog {
- protected IMonitorWorkingCopy monitor;
- protected boolean isEdit;
-
- private Button okButton;
- private Text monitorPort;
- private Text remotePort;
-
- interface StringModifyListener {
- public void valueChanged(String s);
- }
-
- interface BooleanModifyListener {
- public void valueChanged(boolean b);
- }
-
- interface TypeModifyListener {
- public void valueChanged(IProtocolAdapter type);
- }
-
- /**
- * @param parentShell
- */
- public MonitorDialog(Shell parentShell, IMonitorWorkingCopy monitor) {
- super(parentShell);
- this.monitor = monitor;
- isEdit = true;
- }
-
- public MonitorDialog(Shell parentShell) {
- super(parentShell);
- monitor = MonitorCore.createMonitor();
- isEdit = false;
- }
-
- protected void configureShell(Shell shell) {
- super.configureShell(shell);
- if (isEdit)
- shell.setText(MonitorUIPlugin.getResource("%editMonitor"));
- else
- shell.setText(MonitorUIPlugin.getResource("%newMonitor"));
- }
-
- protected Label createLabel(Composite comp, String txt) {
- Label label = new Label(comp, SWT.NONE);
- label.setText(txt);
- label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_BEGINNING));
- return label;
- }
-
- protected Text createText(Composite comp, String txt, final StringModifyListener listener) {
- final Text text = new Text(comp, SWT.BORDER);
- if (txt != null)
- text.setText(txt);
- GridData data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
- data.widthHint = 150;
- text.setLayoutData(data);
- if (listener != null)
- text.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- listener.valueChanged(text.getText());
- }
- });
- return text;
- }
-
- protected Combo createTypeCombo(Composite comp, final String[] types, String sel, final StringModifyListener listener) {
- final Combo combo = new Combo(comp, SWT.DROP_DOWN | SWT.READ_ONLY);
- int size = types.length;
- String[] items = new String[size];
- int index = -1;
- for (int i = 0; i < size; i++) {
- items[i] = types[i];
- if (types[i].equals(sel))
- index = i;
- }
- combo.setItems(items);
- if (index >= 0)
- combo.select(index);
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_BEGINNING);
- data.widthHint = 150;
- combo.setLayoutData(data);
- if (listener != null)
- combo.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- listener.valueChanged(types[combo.getSelectionIndex()]);
- }
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
- });
- return combo;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
- */
- protected Control createDialogArea(Composite parent) {
- Composite composite = (Composite) super.createDialogArea(parent);
- ((GridLayout)composite.getLayout()).numColumns = 2;
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, ContextIds.PREF_DIALOG);
-
- createLabel(composite, MonitorUIPlugin.getResource("%localPort"));
- monitorPort = createText(composite, monitor.getLocalPort() + "", new StringModifyListener() {
- public void valueChanged(String s) {
- try {
- monitor.setLocalPort(Integer.parseInt(s));
- } catch (Exception e) {
- // ignore
- }
- validateFields();
- }
- });
-
- Group group = new Group(composite, SWT.NONE);
- GridLayout layout = new GridLayout(2, false);
- group.setLayout(layout);
- GridData data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 2;
- group.setLayoutData(data);
- group.setText(MonitorUIPlugin.getResource("%remoteGroup"));
-
- createLabel(group, MonitorUIPlugin.getResource("%remoteHost"));
- createText(group, monitor.getRemoteHost(), new StringModifyListener() {
- public void valueChanged(String s) {
- monitor.setRemoteHost(s);
- validateFields();
- }
- });
-
- createLabel(group, MonitorUIPlugin.getResource("%remotePort"));
- remotePort = createText(group, monitor.getRemotePort() + "", new StringModifyListener() {
- public void valueChanged(String s) {
- try {
- monitor.setRemotePort(Integer.parseInt(s));
- } catch (Exception e) {
- // ignore
- }
- validateFields();
- }
- });
-
- createLabel(group, MonitorUIPlugin.getResource("%parseType"));
- createTypeCombo(group, new String[] {"TCP/IP","HTTP"}, monitor.getProtocol(), new StringModifyListener() {
- public void valueChanged(String protocolId) {
- monitor.setProtocol(protocolId);
- }
- });
-
- return composite;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#okPressed()
- */
- protected void okPressed() {
- try {
- monitor.save();
- } catch (CoreException ce) {
- ErrorDialog.openError(getShell(), MonitorUIPlugin.getResource("%errorDialogTitle"), ce.getLocalizedMessage(), ce.getStatus());
- return;
- }
- super.okPressed();
- }
-
- protected Control createButtonBar(Composite parent) {
- Control buttonControl = super.createButtonBar(parent);
- validateFields();
- return buttonControl;
- }
-
- private void setOKButtonEnabled(boolean curIsEnabled) {
- if (okButton == null)
- okButton = getButton(IDialogConstants.OK_ID);
-
- if (okButton != null)
- okButton.setEnabled(curIsEnabled);
- }
-
- protected void validateFields() {
- if (monitorPort == null)
- return;
-
- boolean result = true;
- try {
- Integer.parseInt(remotePort.getText());
- Integer.parseInt(monitorPort.getText());
- } catch (Exception e) {
- result = false;
- }
-
- IStatus status = monitor.validate();
- if (!status.isOK())
- result = false;
-
- setOKButtonEnabled(result);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/MonitorPreferencePage.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/MonitorPreferencePage.java
deleted file mode 100644
index 81c2d1f..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/MonitorPreferencePage.java
+++ /dev/null
@@ -1,339 +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.internet.monitor.ui.internal;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.swt.*;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.window.Window;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.internet.monitor.core.IMonitor;
-import org.eclipse.wst.internet.monitor.core.IMonitorWorkingCopy;
-import org.eclipse.wst.internet.monitor.core.MonitorCore;
-/**
- * The preference page that holds monitor properties.
- */
-public class MonitorPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
- protected Button displayButton;
-
- protected Table table;
- protected TableViewer tableViewer;
-
- protected Button edit;
- protected Button remove;
- protected Button start;
- protected Button stop;
-
- protected List selection2;
-
- /**
- * MonitorPreferencePage constructor comment.
- */
- public MonitorPreferencePage() {
- super();
- noDefaultAndApplyButton();
- }
-
- /**
- * Create the preference options.
- *
- * @param parent org.eclipse.swt.widgets.Composite
- * @return org.eclipse.swt.widgets.Control
- */
- protected Control createContents(Composite parent) {
- initializeDialogUnits(parent);
-
- Composite composite = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- layout.horizontalSpacing = convertHorizontalDLUsToPixels(4);
- layout.verticalSpacing = convertVerticalDLUsToPixels(3);
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- composite.setLayout(layout);
- GridData data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL);
- composite.setLayoutData(data);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, ContextIds.PREF);
-
- Label label = new Label(composite, SWT.WRAP);
- label.setText(MonitorUIPlugin.getResource("%preferenceDescription"));
- data = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
- data.horizontalSpan = 2;
- label.setLayoutData(data);
-
- displayButton = new Button(composite, SWT.CHECK);
- displayButton.setText(MonitorUIPlugin.getResource("%prefShowView"));
- displayButton.setSelection(MonitorUIPlugin.getShowOnActivityPreference());
- data = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
- data.horizontalSpan = 2;
- displayButton.setLayoutData(data);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(displayButton, ContextIds.PREF_SHOW);
-
- label = new Label(composite, SWT.NONE);
- label.setText("");
- data = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
- data.horizontalSpan = 2;
- label.setLayoutData(data);
-
- label = new Label(composite, SWT.WRAP);
- label.setText(MonitorUIPlugin.getResource("%monitorList"));
- data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 2;
- label.setLayoutData(data);
-
- table = new Table(composite, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL | SWT.MULTI | SWT.FULL_SELECTION);
- data = new GridData(GridData.FILL_BOTH);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(table, ContextIds.PREF_MONITORS);
-
- table.setLayoutData(data);
- table.setHeaderVisible(true);
- table.setLinesVisible(true);
-
- TableLayout tableLayout = new TableLayout();
-
- TableColumn statusColumn = new TableColumn(table, SWT.NONE);
- statusColumn.setText(MonitorUIPlugin.getResource("%columnStatus"));
- ColumnWeightData colData = new ColumnWeightData(6, 60, true);
- tableLayout.addColumnData(colData);
-
- TableColumn remoteColumn = new TableColumn(table, SWT.NONE);
- remoteColumn.setText(MonitorUIPlugin.getResource("%columnRemote"));
- colData = new ColumnWeightData(12, 120, true);
- tableLayout.addColumnData(colData);
-
- TableColumn httpColumn = new TableColumn(table, SWT.NONE);
- httpColumn.setText(MonitorUIPlugin.getResource("%columnType"));
- colData = new ColumnWeightData(5, 55, true);
- tableLayout.addColumnData(colData);
-
- TableColumn localColumn = new TableColumn(table, SWT.NONE);
- localColumn.setText(MonitorUIPlugin.getResource("%columnLocal"));
- colData = new ColumnWeightData(5, 50, true);
- tableLayout.addColumnData(colData);
-
- table.setLayout(tableLayout);
-
- tableViewer = new TableViewer(table);
- tableViewer.setContentProvider(new MonitorContentProvider());
- tableViewer.setLabelProvider(new MonitorTableLabelProvider());
- tableViewer.setInput("root");
-
- tableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- setSelection(event.getSelection());
- }
- });
-
- Composite buttonComp = new Composite(composite, SWT.NONE);
- layout = new GridLayout();
- layout.horizontalSpacing = 0;
- layout.verticalSpacing = convertVerticalDLUsToPixels(3);
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- layout.numColumns = 1;
- buttonComp.setLayout(layout);
- data = new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.VERTICAL_ALIGN_FILL);
- buttonComp.setLayoutData(data);
-
- Button add = SWTUtil.createButton(buttonComp, MonitorUIPlugin.getResource("%add"));
- add.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- MonitorDialog dialog = new MonitorDialog(getShell());
- if (dialog.open() == Window.CANCEL)
- return;
- tableViewer.refresh();
-
- IMonitor[] monitors = MonitorCore.getMonitors();
- Object monitor = monitors[monitors.length - 1];
- tableViewer.setSelection(new StructuredSelection(monitor));
- }
- });
-
- edit = SWTUtil.createButton(buttonComp, MonitorUIPlugin.getResource("%edit"));
- edit.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- IMonitor monitor = (IMonitor) getSelection().get(0);
- IMonitorWorkingCopy wc = monitor.createWorkingCopy();
-
- MonitorDialog dialog = new MonitorDialog(getShell(), wc);
- if (dialog.open() != Window.CANCEL) {
- try {
- tableViewer.refresh(wc.save());
- } catch (Exception ex) {
- // ignore
- }
- }
- }
- });
- edit.setEnabled(false);
-
- remove = SWTUtil.createButton(buttonComp, MonitorUIPlugin.getResource("%remove"));
- remove.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- Iterator iterator = getSelection().iterator();
- while (iterator.hasNext()) {
- IMonitor monitor = (IMonitor) iterator.next();
- try {
- monitor.delete();
- } catch (Exception ex) {
- // ignore
- }
- tableViewer.remove(monitor);
-
- IMonitor[] monitors = MonitorCore.getMonitors();
- Object monitor2 = monitors[monitors.length - 1];
- tableViewer.setSelection(new StructuredSelection(monitor2));
- }
- }
- });
- remove.setEnabled(false);
-
- start = SWTUtil.createButton(buttonComp, MonitorUIPlugin.getResource("%start"));
- data = (GridData) start.getLayoutData();
- data.verticalIndent = 9;
- start.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- Iterator iterator = getSelection().iterator();
- while (iterator.hasNext()) {
- IMonitor monitor = (IMonitor) iterator.next();
- try {
- monitor.start();
- } catch (CoreException ce) {
- MessageDialog.openError(getShell(), MonitorUIPlugin.getResource("%errorDialogTitle"), ce.getStatus().getMessage());
- } catch (Exception ce) {
- MessageDialog.openError(getShell(), MonitorUIPlugin.getResource("%errorDialogTitle"), ce.getMessage());
- }
- tableViewer.refresh(monitor, true);
- }
- tableViewer.setSelection(tableViewer.getSelection());
- }
- });
- start.setEnabled(false);
-
- stop = SWTUtil.createButton(buttonComp, MonitorUIPlugin.getResource("%stop"));
- stop.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- Iterator iterator = getSelection().iterator();
- while (iterator.hasNext()) {
- IMonitor monitor = (IMonitor) iterator.next();
- try {
- monitor.stop();
- } catch (Exception ex) {
- // ignore
- }
- tableViewer.refresh(monitor, true);
- }
- tableViewer.setSelection(tableViewer.getSelection());
- }
- });
- stop.setEnabled(false);
-
- Dialog.applyDialogFont(composite);
-
- return composite;
- }
-
- /**
- * Initializes this preference page using the passed workbench.
- *
- * @param workbench the current workbench
- */
- public void init(IWorkbench workbench) {
- // do nothing
- }
-
- /**
- * Performs special processing when this page's Defaults button has been pressed.
- * <p>
- * This is a framework hook method for sublcasses to do special things when
- * the Defaults button has been pressed.
- * Subclasses may override, but should call <code>super.performDefaults</code>.
- * </p>
- */
- protected void performDefaults() {
- displayButton.setSelection(MonitorUIPlugin.getDefaultShowOnActivityPreference());
- super.performDefaults();
- }
-
- /**
- * Method declared on IPreferencePage.
- * Subclasses should override
- */
- public boolean performOk() {
- MonitorUIPlugin.setShowOnActivityPreference(displayButton.getSelection());
- MonitorUIPlugin.getInstance().savePluginPreferences();
- return true;
- }
-
- protected List getSelection() {
- return selection2;
- }
-
- protected void setSelection(ISelection sel2) {
- IStructuredSelection sel = (IStructuredSelection) sel2;
- Iterator iterator = sel.iterator();
- selection2 = new ArrayList();
-
- while (iterator.hasNext()) {
- Object obj = iterator.next();
- if (obj instanceof IMonitor)
- selection2.add(obj);
- }
-
- if (!selection2.isEmpty()) {
- remove.setEnabled(true);
-
- boolean allStopped = true;
- boolean allStarted = true;
-
- iterator = selection2.iterator();
- while (iterator.hasNext()) {
- IMonitor monitor = (IMonitor) iterator.next();
- if (monitor.isRunning())
- allStopped = false;
- else
- allStarted = false;
- }
- start.setEnabled(allStopped);
- stop.setEnabled(allStarted);
- edit.setEnabled(selection2.size() == 1 && allStopped);
- } else {
- edit.setEnabled(false);
- remove.setEnabled(false);
- start.setEnabled(false);
- stop.setEnabled(false);
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/MonitorTableLabelProvider.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/MonitorTableLabelProvider.java
deleted file mode 100644
index 9d644cc..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/MonitorTableLabelProvider.java
+++ /dev/null
@@ -1,130 +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.internet.monitor.ui.internal;
-
-import org.eclipse.jface.viewers.ILabelProviderListener;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.internet.monitor.core.IMonitor;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-/**
- * Monitor table label provider.
- */
-public class MonitorTableLabelProvider implements ITableLabelProvider {
- /**
- * MonitorTableLabelProvider constructor comment.
- */
- public MonitorTableLabelProvider() {
- super();
- }
-
- /**
- * Adds a listener to this label provider.
- * Has no effect if an identical listener is already registered.
- * <p>
- * Label provider listeners are informed about state changes
- * that affect the rendering of the viewer that uses this label provider.
- * </p>
- *
- * @param listener a label provider listener
- */
- public void addListener(ILabelProviderListener listener) {
- // do nothing
- }
-
- /**
- * Disposes of this label provider. When a label provider is
- * attached to a viewer, the viewer will automatically call
- * this method when the viewer is being closed. When label providers
- * are used outside of the context of a viewer, it is the client's
- * responsibility to ensure that this method is called when the
- * provider is no longer needed.
- */
- public void dispose() {
- // do nothing
- }
-
- /**
- * Returns the label image for the given column of the given element.
- *
- * @param element the object representing the entire row, or
- * <code>null</code> indicating that no input object is set
- * in the viewer
- * @param columnIndex the zero-based index of the column in which
- * the label appears
- */
- public Image getColumnImage(Object element, int columnIndex) {
- if (columnIndex == 0) {
- IMonitor monitor = (IMonitor) element;
- if (monitor.isRunning())
- return MonitorUIPlugin.getImage(MonitorUIPlugin.IMG_MONITOR_ON);
- return MonitorUIPlugin.getImage(MonitorUIPlugin.IMG_MONITOR_OFF);
- }
- return null;
- }
-
- /**
- * Returns the label text for the given column of the given element.
- *
- * @param element the object representing the entire row, or
- * <code>null</code> indicating that no input object is set
- * in the viewer
- * @param columnIndex the zero-based index of the column in which the label appears
- */
- public String getColumnText(Object element, int columnIndex) {
- IMonitor monitor = (IMonitor) element;
- if (columnIndex == 0) {
- if (monitor.isRunning())
- return MonitorUIPlugin.getResource("%started");
- return MonitorUIPlugin.getResource("%stopped");
- } else if (columnIndex == 1)
- return monitor.getRemoteHost() + ":" + monitor.getRemotePort();
- else if (columnIndex == 2)
- return monitor.getProtocol();
- else if (columnIndex == 3)
- return monitor.getLocalPort() + "";
- else
- return "X";
- }
-
- protected String notNull(String s) {
- if (s == null)
- return "";
-
- return s;
- }
-
- /**
- * Returns whether the label would be affected
- * by a change to the given property of the given element.
- * This can be used to optimize a non-structural viewer update.
- * If the property mentioned in the update does not affect the label,
- * then the viewer need not update the label.
- *
- * @param element the element
- * @param property the property
- * @return <code>true</code> if the label would be affected,
- * and <code>false</code> if it would be unaffected
- */
- public boolean isLabelProperty(Object element, String property) {
- return false;
- }
-
- /**
- * Removes a listener to this label provider.
- * Has no affect if an identical listener is not registered.
- *
- * @param listener a label provider listener
- */
- public void removeListener(ILabelProviderListener listener) {
- // do nothing
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/MonitorUIPlugin.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/MonitorUIPlugin.java
deleted file mode 100644
index 00600b8..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/MonitorUIPlugin.java
+++ /dev/null
@@ -1,345 +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.internet.monitor.ui.internal;
-
-import java.io.BufferedReader;
-import java.io.ByteArrayInputStream;
-import java.io.InputStreamReader;
-import java.net.URL;
-import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.internet.monitor.core.*;
-import org.eclipse.wst.internet.monitor.core.internal.Trace;
-import org.eclipse.wst.internet.monitor.ui.internal.view.MonitorView;
-import org.osgi.framework.BundleContext;
-/**
- * The TCP/IP monitor UI plugin.
- */
-public class MonitorUIPlugin extends AbstractUIPlugin {
- public static final String PLUGIN_ID = "org.eclipse.wst.internet.monitor.ui";
-
- private static MonitorUIPlugin singleton;
-
- protected Map imageDescriptors = new HashMap();
-
- private static final String lineSeparator = System.getProperty("line.separator");
-
- private static URL ICON_BASE_URL;
- private static final String URL_CLCL = "clcl16/";
- private static final String URL_ELCL = "elcl16/";
- private static final String URL_DLCL = "dlcl16/";
- private static final String URL_OBJ = "obj16/";
-
- public static final String IMG_ELCL_SORT_RESPONSE_TIME = "IMG_ELCL_SORT_RESPONSE_TIME";
- public static final String IMG_ELCL_CLEAR = "IMG_ELCL_CLEAR";
- public static final String IMG_ELCL_HTTP_HEADER = "IMG_ELCL_HTTP_HEADER";
- public static final String IMG_CLCL_SORT_RESPONSE_TIME = "IMG_CLCL_SORT_RESPONSE_TIME";
- public static final String IMG_CLCL_CLEAR = "IMG_CLCL_CLEAR";
- public static final String IMG_CLCL_HTTP_HEADER = "IMG_CLCL_HTTP_HEADER";
- public static final String IMG_DLCL_SORT_RESPONSE_TIME = "IMG_DLCL_SORT_RESPONSE_TIME";
- public static final String IMG_DLCL_CLEAR = "IMG_DLCL_CLEAR";
- public static final String IMG_DLCL_HTTP_HEADER = "IMG_DLCL_HTTP_HEADER";
-
- public static final String IMG_REQUEST_RESPONSE = "requestResponse";
- public static final String IMG_RESEND_REQUEST_RESPONSE = "resendRequestResponse";
-
- public static final String IMG_HOST = "host";
- public static final String IMG_MONITOR_ON = "monitorOn";
- public static final String IMG_MONITOR_OFF = "monitorOff";
-
- private static final String SHOW_VIEW_ON_ACTIVITY = "show-view";
- private static final String SHOW_HEADER = "show-header";
-
- protected List requests = new ArrayList();
-
- protected IMonitorListener monitorListener = new IMonitorListener() {
- public void monitorAdded(IMonitor monitor) {
- monitor.addRequestListener(requestListener);
- }
-
- public void monitorChanged(IMonitor monitor) {
- // ignore
- }
-
- public void monitorRemoved(IMonitor monitor) {
- monitor.removeRequestListener(requestListener);
- }
- };
-
- protected IRequestListener requestListener = new IRequestListener() {
- public void requestAdded(IMonitor monitor, Request request) {
- addRequest(request);
-
- if (MonitorView.view != null)
- MonitorView.view.doRequestAdded(request);
- else if (MonitorUIPlugin.getShowOnActivityPreference())
- MonitorView.open(request);
- }
-
- public void requestChanged(IMonitor monitor, Request request) {
- if (MonitorView.view != null)
- MonitorView.view.doRequestChanged(request);
- }
- };
-
- /**
- * MonitorUIPlugin constructor comment.
- */
- public MonitorUIPlugin() {
- super();
- singleton = this;
- }
-
- /**
- * Creates and pre-loads the image registry.
- *
- * @return ImageRegistry
- */
- protected ImageRegistry createImageRegistry() {
- ImageRegistry registry = super.createImageRegistry();
-
- registerImage(registry, IMG_REQUEST_RESPONSE, URL_OBJ + "tcp.gif");
- registerImage(registry, IMG_RESEND_REQUEST_RESPONSE, URL_ELCL + "resendRequest.gif");
-
- registerImage(registry, IMG_HOST, URL_OBJ + "host.gif");
- registerImage(registry, IMG_MONITOR_ON, URL_OBJ + "monitorOn.gif");
- registerImage(registry, IMG_MONITOR_OFF, URL_OBJ + "monitorOff.gif");
-
- registerImage(registry, IMG_CLCL_CLEAR, URL_CLCL + "clear.gif");
- registerImage(registry, IMG_CLCL_SORT_RESPONSE_TIME, URL_CLCL + "sortResponseTime.gif");
- registerImage(registry, IMG_CLCL_HTTP_HEADER, URL_CLCL + "httpHeader.gif");
-
- registerImage(registry, IMG_ELCL_CLEAR, URL_ELCL + "clear.gif");
- registerImage(registry, IMG_ELCL_SORT_RESPONSE_TIME, URL_ELCL + "sortResponseTime.gif");
- registerImage(registry, IMG_ELCL_HTTP_HEADER, URL_ELCL + "httpHeader.gif");
-
- registerImage(registry, IMG_DLCL_CLEAR, URL_DLCL + "clear.gif");
- registerImage(registry, IMG_DLCL_SORT_RESPONSE_TIME, URL_DLCL + "sortResponseTime.gif");
- registerImage(registry, IMG_DLCL_HTTP_HEADER, URL_DLCL + "httpHeader.gif");
-
- return registry;
- }
-
- /**
- * Return the image with the given key from the image registry.
- *
- * @param key the key
- * @return the image
- */
- public static Image getImage(String key) {
- return getInstance().getImageRegistry().get(key);
- }
-
- /**
- * Return the image with the given key from the image registry.
- *
- * @param key the key
- * @return an image descriptor
- */
- public static ImageDescriptor getImageDescriptor(String key) {
- try {
- getInstance().getImageRegistry();
- return (ImageDescriptor) getInstance().imageDescriptors.get(key);
- } catch (Exception e) {
- return null;
- }
- }
-
- /**
- * Returns the singleton instance of this plugin.
- *
- * @return the plugin
- */
- public static MonitorUIPlugin getInstance() {
- return singleton;
- }
-
- /**
- * Returns the translated String found with the given key.
- *
- * @param key the key
- * @return the translated string
- */
- public static String getResource(String key) {
- try {
- return Platform.getResourceString(getInstance().getBundle(), key);
- } catch (Exception e) {
- return key;
- }
- }
-
- /**
- * Returns the translated String found with the given key, and formatted
- * with the given object.
- *
- * @param key the key
- * @param obj substitution variables
- * @return the translated string
- */
- public static String getResource(String key, Object[] obj) {
- try {
- return MessageFormat.format(getResource(key), obj);
- } catch (Exception e) {
- return key;
- }
- }
-
- /**
- * Returns the translated String found with the given key, and formatted
- * with the given object.
- *
- * @param key the key
- * @param s substitution variable
- * @return the translated string
- */
- public static String getResource(String key, String s) {
- try {
- return MessageFormat.format(getResource(key), new String[] { s });
- } catch (Exception e) {
- return key;
- }
- }
-
- /**
- * Register an image with the registry.
- *
- * @param key the key
- * @param partialURL
- */
- private void registerImage(ImageRegistry registry, String key, String partialURL) {
- if (ICON_BASE_URL == null) {
- String pathSuffix = "icons/";
- ICON_BASE_URL = singleton.getBundle().getEntry(pathSuffix);
- }
-
- try {
- ImageDescriptor id = ImageDescriptor.createFromURL(new URL(ICON_BASE_URL, partialURL));
- registry.put(key, id);
- imageDescriptors.put(key, id);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error registering image", e);
- }
- }
-
- /**
- * Start this plug-in.
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
-
- getPreferenceStore().setDefault(MonitorUIPlugin.SHOW_VIEW_ON_ACTIVITY, true);
-
- MonitorCore.addMonitorListener(monitorListener);
-
- IMonitor[] monitors = MonitorCore.getMonitors();
- if (monitors != null) {
- int size = monitors.length;
- for (int i = 0; i < size; i++) {
- monitors[i].addRequestListener(requestListener);
- }
- }
- }
-
- public void stop(BundleContext context) throws Exception {
- super.stop(context);
-
- IMonitor[] monitors = MonitorCore.getMonitors();
- if (monitors != null) {
- int size = monitors.length;
- for (int i = 0; i < size; i++) {
- monitors[i].removeRequestListener(requestListener);
- }
- }
-
- MonitorCore.removeMonitorListener(monitorListener);
- }
-
- public static boolean getDefaultShowOnActivityPreference() {
- return getInstance().getPreferenceStore().getDefaultBoolean(SHOW_VIEW_ON_ACTIVITY);
- }
-
- public static boolean getShowOnActivityPreference() {
- return getInstance().getPreferenceStore().getBoolean(SHOW_VIEW_ON_ACTIVITY);
- }
-
- public static void setShowOnActivityPreference(boolean b) {
- getInstance().getPreferenceStore().setValue(SHOW_VIEW_ON_ACTIVITY, b);
- getInstance().savePluginPreferences();
- }
-
- public static boolean getShowHeaderPreference() {
- return getInstance().getPreferenceStore().getBoolean(SHOW_HEADER);
- }
-
- public static void setShowHeaderPreference(boolean b) {
- getInstance().getPreferenceStore().setValue(SHOW_HEADER, b);
- getInstance().savePluginPreferences();
- }
-
- /**
- * Convenience method to parse the given bytes into String form. The bytes
- * are parsed into a line delimited string. The byte array must not be null.
- *
- * @param b a byte array
- * @return the string after the conversion
- */
- public static String parse(byte[] b) {
- if (b == null)
- throw new IllegalArgumentException();
-
- ByteArrayInputStream bin = new ByteArrayInputStream(b);
- BufferedReader br = new BufferedReader(new InputStreamReader(bin));
- StringBuffer sb = new StringBuffer();
- try {
- String s = br.readLine();
-
- while (s != null) {
- sb.append(s);
- s = br.readLine();
- if (s != null)
- sb.append(lineSeparator);
- }
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error parsing input", e);
- }
-
- return sb.toString();
- }
-
- public void addRequest(Request request) {
- if (!requests.contains(request))
- requests.add(request);
- }
-
- /**
- * Returns a list of the current requests.
- *
- * @return java.util.List
- */
- public Request[] getRequests() {
- Request[] r = new Request[requests.size()];
- requests.toArray(r);
- return r;
- }
-
- public void clearRequests() {
- requests = new ArrayList();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/RequestActionFilter.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/RequestActionFilter.java
deleted file mode 100644
index be7e24e..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/RequestActionFilter.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.internet.monitor.ui.internal;
-
-import org.eclipse.ui.IActionFilter;
-import org.eclipse.wst.internet.monitor.core.Request;
-/**
- * An action filter for requests.
- */
-public class RequestActionFilter implements IActionFilter{
- public static final String REQUEST_SENT = "requestsent";
-
- /**
- * @see IActionFilter#testAttribute(Object, String, String)
- */
- public boolean testAttribute(Object target, String name, String value) {
- Request request = (Request) target;
- if (name.equals(REQUEST_SENT)) {
- if (value.equals("true"))
- return request.getResponseTime() != -1;
-
- return request.getResponseTime() == -1;
- }
- return false;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/RequestAdapterFactory.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/RequestAdapterFactory.java
deleted file mode 100644
index ac7d685..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/RequestAdapterFactory.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.internet.monitor.ui.internal;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.ui.IActionFilter;
-/**
- * Adapter factory to adapt Requests to IActionFilter.
- */
-public class RequestAdapterFactory implements IAdapterFactory {
- private RequestActionFilter reqActionFilter = null;
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
- */
- public Object getAdapter(Object adaptableObject, Class adapterType) {
- if (adapterType == IActionFilter.class) {
- if (reqActionFilter == null) {
- reqActionFilter = new RequestActionFilter();
- }
- return reqActionFilter;
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
- */
- public Class[] getAdapterList() {
- return new Class[] { IActionFilter.class };
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/SWTUtil.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/SWTUtil.java
deleted file mode 100644
index fed03ff..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/SWTUtil.java
+++ /dev/null
@@ -1,76 +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.internet.monitor.ui.internal;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.FontMetrics;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-/**
- * SWT Utility class.
- */
-public class SWTUtil {
- private static FontMetrics fontMetrics;
-
- protected static void initializeDialogUnits(Control testControl) {
- // Compute and store a font metric
- GC gc = new GC(testControl);
- gc.setFont(JFaceResources.getDialogFont());
- fontMetrics = gc.getFontMetrics();
- gc.dispose();
- }
-
- /**
- * Returns a width hint for a button control.
- */
- protected static int getButtonWidthHint(Button button) {
- int widthHint = Dialog.convertHorizontalDLUsToPixels(fontMetrics, IDialogConstants.BUTTON_WIDTH);
- return Math.max(widthHint, button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
- }
-
- public static Button createButton(Composite comp, String label) {
- Button b = new Button(comp, SWT.PUSH);
- b.setText(label);
- if (fontMetrics == null)
- initializeDialogUnits(comp);
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_BEGINNING);
- data.widthHint = getButtonWidthHint(b);
- b.setLayoutData(data);
- return b;
- }
-
- public static Button createCheckbox(Composite comp, String txt, boolean isSelected){
- Button button = new Button(comp, SWT.CHECK);
- button.setText(txt);
- GridLayout layout = new GridLayout();
- comp.setLayout(layout);
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_BEGINNING);
- data.horizontalIndent = 10;
- button.setLayoutData(data);
- button.setSelection(isSelected);
- return button;
- }
-
- public static Label createLabel(Composite comp, String txt) {
- Label label = new Label(comp, SWT.NONE);
- label.setText(txt);
- label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_BEGINNING));
- return label;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/Startup.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/Startup.java
deleted file mode 100644
index 1b83e00..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/Startup.java
+++ /dev/null
@@ -1,24 +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.internet.monitor.ui.internal;
-
-import org.eclipse.wst.internet.monitor.core.internal.IStartup;
-/**
- * Startup hook.
- */
-public class Startup implements IStartup {
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.core.IStartup#startup()
- */
- public void startup() {
- // do nothing - plugin loading is enough
- }
-}
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/Trace.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/Trace.java
deleted file mode 100644
index df3d955..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/Trace.java
+++ /dev/null
@@ -1,51 +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.internet.monitor.ui.internal;
-/**
- * Helper class to route trace output.
- */
-public class Trace {
- public static byte CONFIG = 0;
- public static byte WARNING = 1;
- public static byte SEVERE = 2;
- public static byte FINEST = 3;
-
- /**
- * Trace constructor comment.
- */
- private Trace() {
- super();
- }
-
- /**
- * Trace the given text.
- *
- * @param s java.lang.String
- */
- public static void trace(byte level, String s) {
- trace(level, s, null);
- }
-
- /**
- * Trace the given message and exception.
- *
- * @param s java.lang.String
- * @param t java.lang.Throwable
- */
- public static void trace(byte level, String s, Throwable t) {
- if (!MonitorUIPlugin.getInstance().isDebugging())
- return;
-
- System.out.println(s);
- if (t != null)
- t.printStackTrace();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/FilterAction.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/FilterAction.java
deleted file mode 100644
index cc79b00..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/FilterAction.java
+++ /dev/null
@@ -1,36 +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.internet.monitor.ui.internal.view;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.wst.internet.monitor.core.internal.IContentFilter;
-/**
- *
- */
-public class FilterAction extends Action {
- protected IViewerManager vm;
- protected IContentFilter filter;
- protected boolean enabled;
-
- public FilterAction(IViewerManager vm, IContentFilter filter) {
- super(filter.getName(), IAction.AS_CHECK_BOX);
- this.vm = vm;
- this.filter = filter;
- }
-
- public void run() {
- if (!isChecked())
- vm.removeFilter(filter);
- else
- vm.addFilter(filter);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/IViewerManager.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/IViewerManager.java
deleted file mode 100644
index c684b39..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/IViewerManager.java
+++ /dev/null
@@ -1,98 +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.internet.monitor.ui.internal.view;
-
-import java.util.List;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.wst.internet.monitor.core.Request;
-import org.eclipse.wst.internet.monitor.core.internal.IContentFilter;
-import org.eclipse.wst.internet.monitor.ui.ContentViewer;
-import org.eclipse.wst.internet.monitor.ui.internal.viewers.HeaderViewer;
-/**
- * Manager interface for TCP/IP request and response message viewers
- */
-public interface IViewerManager {
- /**
- * Set whether or not to show HTTP header details.
- *
- * @param b boolean
- */
- public void setDisplayHeaderInfo(boolean b);
-
- /**
- * Returns whether or not HTTP header details is showing.
- *
- * @return boolean
- */
- public boolean getDisplayHeaderInfo();
-
- /**
- * Show the TCP/IP request message in a parent Composite
- *
- * @param request the request
- */
- public void setRequest(Request request);
-
- /**
- * Returns an array of the available TCP/IP request viewer ids
- *
- * @return a list of request viewers
- */
- public List getRequestViewers();
-
- /**
- * Returns an array of the available TCP/IP response viewer ids
- *
- * @return a list of response viewers
- */
- public List getResponseViewers();
-
- /**
- * Set the TCP/IP request message viewer
- *
- * @param element
- */
- public void setRequestViewer(IConfigurationElement element);
-
- /**
- * Set the TCP/IP response message viewer
- *
- * @param element
- */
- public void setResponseViewer(IConfigurationElement element);
-
- /**
- *
- * @param filter
- */
- public void addFilter(IContentFilter filter);
-
- /**
- *
- * @param filter
- */
- public void removeFilter(IContentFilter filter);
-
- /**
- * Return the current request viewer.
- *
- * @return the current request viewer
- */
- public ContentViewer getCurrentRequestViewer();
-
- /**
- * Return the current request header viewer.
- *
- * @return the current request header viewer
- */
- public HeaderViewer getCurrentRequestHeaderViewer();
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/ModifyMessageAction.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/ModifyMessageAction.java
deleted file mode 100644
index 4f620ef..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/ModifyMessageAction.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.internet.monitor.ui.internal.view;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.wst.internet.monitor.core.Request;
-import org.eclipse.wst.internet.monitor.core.internal.MonitorManager;
-import org.eclipse.wst.internet.monitor.core.internal.http.ResendHTTPRequest;
-/**
- * Modify the selected message. Creates a new resendrequest and adds it
- * to the tree.
- */
-public class ModifyMessageAction implements IViewActionDelegate{
- ISelection selection = null;
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
- */
- public void init(IViewPart view) {
- // do nothing
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- if (selection != null) {
- Object element = ((StructuredSelection) selection).getFirstElement();
- if (element != null && element instanceof Request) {
- Request req = (Request) element;
- ResendHTTPRequest newReq = MonitorManager.createResendRequest(req);
- MonitorManager.getInstance().addResendRequest(req, newReq);
- TreeViewer treeViewer = MonitorView.view.treeViewer;
- treeViewer.add(req, newReq);
- treeViewer.setSelection(new StructuredSelection(newReq), false);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection2) {
- this.selection = selection2;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/MonitorTreeContentProvider.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/MonitorTreeContentProvider.java
deleted file mode 100644
index 682d767..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/MonitorTreeContentProvider.java
+++ /dev/null
@@ -1,201 +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.internet.monitor.ui.internal.view;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.wst.internet.monitor.core.Request;
-import org.eclipse.wst.internet.monitor.core.internal.MonitorManager;
-import org.eclipse.wst.internet.monitor.core.internal.http.ResendHTTPRequest;
-import org.eclipse.wst.internet.monitor.ui.internal.MonitorUIPlugin;
-/**
- * Content provider for the monitor server view.
- */
-public class MonitorTreeContentProvider implements ITreeContentProvider{
- protected static final String ROOT = "root";
-
- protected boolean sortByResponseTime;
-
- /**
- * ProxyTreeContentProvider constructor comment.
- */
- public MonitorTreeContentProvider() {
- super();
- }
-
- /**
- * Disposes of this content provider.
- * <p>
- * [Issue: This method should be changed to take a Viewer,
- * renamed and repurposed to disconnect a content provider from
- * a viewer. This is over and above what inputChanged does,
- * which is disconnecting a content provider from the viewer's
- * input (but not the viewer itself).
- * ]
- * </p>
- */
- public void dispose() {
- // do nothing
- }
-
- /**
- * Returns an iterator over the child elements of the given element.
- * <p>
- * Note: The difference between this method and
- * <code>IStructuredContentProvider.getElements</code> is
- * that <code>getElements</code> is called to obtain the
- * tree viewer's root elements, whereas <code>getChildren</code> is used
- * to obtain the children of a given node in the tree
- * (including a root).
- * </p>
- * <p>
- * [Issue: Don't know what above is trying to say.
- * See IStructuredContentProvider.getElements.
- * ]
- * </p>
- *
- * @param element the element
- * @return an iterator over the child elements
- * (element type: <code>Object</code>)
- */
- public Object[] getChildren(Object element) {
- if (element instanceof Integer) {
- Integer in = (Integer) element;
- List list = new ArrayList();
- Request[] requests = MonitorUIPlugin.getInstance().getRequests();
- if (requests != null) {
- int size = requests.length;
- for (int i = 0; i < size; i++) {
- Request req = requests[i];
- if ((req.getLocalPort() == in.intValue())
- && !(req instanceof ResendHTTPRequest))
- list.add(req);
- }
- }
- if (sortByResponseTime)
- sortByResponseTime(list);
- return list.toArray();
- } else if (element instanceof Request) {
- Request req = (Request) element;
- ResendHTTPRequest[] rr = MonitorManager.getInstance().getResendRequests(req);
- List list = new ArrayList();
- if (rr != null) {
- int size = rr.length;
- for (int i = 0; i < size; i++) {
- list.add(rr[i]);
- }
- }
- if (sortByResponseTime)
- sortByResponseTime(list);
- return list.toArray();
- }
- return null;
- }
-
- /*
- * Returns an iterator over the elements belonging to the
- * given element. These elements can be presented as rows in a table,
- * items in a list, etc.
- */
- public Object[] getElements(Object element) {
- if (ROOT.equals(element)) {
- List list = new ArrayList();
- Request[] requests = MonitorUIPlugin.getInstance().getRequests();
- if (requests != null) {
- int size = requests.length;
- for (int i = 0; i < size; i++) {
- Request req = requests[i];
- Integer in = new Integer(req.getLocalPort());
- if (!list.contains(in))
- list.add(in);
- }
- }
- if (sortByResponseTime)
- sortByResponseTime(list);
- return list.toArray();
- }
- return getChildren(element);
- }
-
- /*
- * Returns the parent for the given element, or <code>null</code>
- * indicating that the parent can't be computed.
- */
- public Object getParent(Object element) {
- if (element != null) {
- if (element instanceof Integer)
- return ROOT;
- Request call = (Request) element;
- if (call instanceof ResendHTTPRequest) {
- ResendHTTPRequest callResend = (ResendHTTPRequest) call;
- Request parent = callResend.getOriginalRequest();
- if (parent != null)
- return parent;
- }
- return new Integer(call.getLocalPort());
- }
- return null;
- }
-
- /*
- * Returns true if the elements are currently being sorted by response time.
- */
- public boolean getSortByResponseTime() {
- return sortByResponseTime;
- }
-
- /*
- * Returns whether the given element has children.
- */
- public boolean hasChildren(Object element) {
- if (element instanceof Integer)
- return true;
- if (element instanceof Request)
- return MonitorManager.getInstance().getResendRequests((Request) element).length > 0;
-
- return false;
- }
-
- /*
- * Notifies this content provider that the given viewer's input
- * has been switched to a different element.
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- // do nothing
- }
-
- /**
- * Sets the sort by response time option.
- * @param b boolean
- */
- public void setSortByResponseTime(boolean b) {
- sortByResponseTime = b;
- }
-
- /**
- *
- */
- protected void sortByResponseTime(List list) {
- int size = list.size();
- for (int i = 0; i < size - 1; i++) {
- for (int j = i + 1; j < size; j++) {
- Request c1 = (Request) list.get(i);
- Request c2 = (Request) list.get(j);
- if (c1.getResponseTime() < c2.getResponseTime()) {
- list.set(i, c2);
- list.set(j, c1);
- }
- }
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/MonitorView.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/MonitorView.java
deleted file mode 100644
index 2ea3991..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/MonitorView.java
+++ /dev/null
@@ -1,550 +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.internet.monitor.ui.internal.view;
-
-import java.text.SimpleDateFormat;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.jface.action.*;
-import org.eclipse.jface.preference.IPreferenceNode;
-import org.eclipse.jface.preference.PreferenceDialog;
-import org.eclipse.jface.preference.PreferenceManager;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.custom.SashForm;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.ui.*;
-import org.eclipse.ui.part.ViewPart;
-import org.eclipse.wst.internet.monitor.core.*;
-import org.eclipse.wst.internet.monitor.core.internal.IContentFilter;
-import org.eclipse.wst.internet.monitor.core.internal.MonitorPlugin;
-import org.eclipse.wst.internet.monitor.core.internal.http.ResendHTTPRequest;
-import org.eclipse.wst.internet.monitor.ui.internal.*;
-/**
- * View of TCP/IP activity.
- */
-public class MonitorView extends ViewPart {
- protected Tree tree;
- protected TreeViewer treeViewer;
- protected MonitorTreeContentProvider contentProvider;
-
- protected IRequestListener listener;
- protected IViewerManager vm;
- protected List requestViewers;
- protected List responseViewers;
-
- protected static SimpleDateFormat format = new SimpleDateFormat(MonitorUIPlugin.getResource("%viewDateFormat"));
- protected static final String VIEW_ID = "org.eclipse.wst.internet.monitor.view";
- protected static final String DEFAULT_VIEWER = "org.eclipse.wst.internet.monitor.viewers.byteviewer";
-
- protected IAction httpHeaderAction;
-
- public static MonitorView view;
-
- protected Request currentRequest = null;
- protected StructuredSelection currentSelection = null;
-
- /**
- * MonitorView constructor comment.
- */
- public MonitorView() {
- super();
- view = this;
- }
-
- public void doRequestAdded(final Request rr) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (!(rr instanceof ResendHTTPRequest)) {
- Integer in = new Integer(rr.getLocalPort());
- treeViewer.add(MonitorTreeContentProvider.ROOT, in);
- treeViewer.add(in, rr);
- treeViewer.setSelection(new StructuredSelection(rr), true);
- }
- }
- });
- }
-
- public void doRequestChanged(final Request rr) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- IStructuredSelection sel = (IStructuredSelection) treeViewer.getSelection();
-
- treeViewer.refresh(rr);
- if (!sel.isEmpty())
- treeViewer.setSelection(sel);
- }
- });
- }
-
- /**
- * Clear the view.
- */
- protected void clear() {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- treeViewer.setSelection(null);
- treeViewer.setInput(MonitorTreeContentProvider.ROOT);
- }
- });
- }
-
- protected void setSelection(Request request) {
- if (treeViewer != null)
- treeViewer.setSelection(new StructuredSelection(request));
- }
-
- /**
- * Returns the inner component in a desktop part.
- */
- public void createPartControl(Composite parent) {
- SashForm sashFparent = new SashForm(parent, SWT.VERTICAL);
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- layout.horizontalSpacing = 4;
- layout.verticalSpacing = 4;
- sashFparent.setLayout(layout);
- sashFparent.setLayoutData(new GridData(GridData.FILL_BOTH));
- PlatformUI.getWorkbench().getHelpSystem().setHelp(sashFparent, ContextIds.VIEW);
-
- // create tree panel
- Composite treePanel = new Composite(sashFparent, SWT.NONE);
- layout = new GridLayout();
- layout.numColumns = 2;
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- treePanel.setLayout(layout);
- GridData data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
- data.heightHint = 110;
- data.horizontalSpan = 2;
- treePanel.setLayoutData(data);
-
- tree = new Tree(treePanel, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL | SWT.SINGLE);
- data = new GridData(GridData.FILL_BOTH);
- //data.widthHint = 120;
- tree.setLayoutData(data);
- treeViewer = new TreeViewer(tree);
- contentProvider = new MonitorTreeContentProvider();
- treeViewer.setContentProvider(contentProvider);
- treeViewer.setInput(MonitorTreeContentProvider.ROOT);
- treeViewer.setLabelProvider(new TreeLabelProvider());
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(tree, ContextIds.VIEW_TREE);
-
- Composite detailsPanel = new Composite(treePanel, SWT.NONE);
- layout = new GridLayout();
- layout.numColumns = 1;
- layout.marginHeight = 2;
- layout.marginWidth = 0;
- detailsPanel.setLayout(layout);
- data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL);
- data.widthHint = 200;
- detailsPanel.setLayoutData(data);
-
- final Label label = new Label(detailsPanel, SWT.NONE);
- label.setText(MonitorUIPlugin.getResource("%viewTime", ""));
- label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING));
-
- final Label label2 = new Label(detailsPanel, SWT.NONE);
- label2.setText(MonitorUIPlugin.getResource("%viewResponseTime", ""));
- label2.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING));
-
- final Label label3 = new Label(detailsPanel, SWT.NONE);
- label3.setText(MonitorUIPlugin.getResource("%viewType", ""));
- label3.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING));
-
- // create center and right panels
- SashForm sashFchild = new SashForm(sashFparent, SWT.NONE);
- layout = new GridLayout();
- layout.numColumns = 2;
- layout.horizontalSpacing = 2;
- layout.verticalSpacing = 4;
- sashFchild.setLayout(layout);
- sashFparent.setWeights(new int[] { 30, 70 });
-
- // request panel
- Composite request = new Composite(sashFchild, SWT.NONE);
- layout = new GridLayout();
- layout.verticalSpacing = 3;
- layout.marginHeight = 2;
- layout.marginWidth = 0;
- request.setLayout(layout);
- request.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- Composite requestHeader = new Composite(request, SWT.NONE);
- layout = new GridLayout();
- layout.verticalSpacing = 0;
- layout.numColumns = 2;
- layout.marginHeight = 0;
- layout.marginWidth = 2;
- data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
- data.heightHint = 30;
- requestHeader.setLayout(layout);
- requestHeader.setLayoutData(data);
-
- Composite requestHeaderLeft = new Composite(requestHeader, SWT.NONE);
- layout = new GridLayout();
- layout.verticalSpacing = 2;
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- data = new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL);
- data.heightHint = 30;
- requestHeaderLeft.setLayout(layout);
- requestHeaderLeft.setLayoutData(data);
-
- Label empty1 = new Label(requestHeaderLeft, SWT.NONE);
- empty1.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL));
-
- final Label requestLabel = new Label(requestHeaderLeft, SWT.NONE);
- requestLabel.setText(MonitorUIPlugin.getResource("%viewRequest", ""));
- requestLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_END));
-
- final Label requestSizeLabel = new Label(requestHeaderLeft, SWT.NONE);
- requestSizeLabel.setText(MonitorUIPlugin.getResource("%viewSize", ""));
- requestSizeLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_END));
-
- Composite requestHeaderRight = new Composite(requestHeader, SWT.NONE);
- layout = new GridLayout();
- layout.verticalSpacing = 0;
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- data = new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.FILL_VERTICAL);
- data.heightHint = 30;
- requestHeaderRight.setLayout(layout);
- requestHeaderRight.setLayoutData(data);
-
- Label empty2 = new Label(requestHeaderRight, SWT.NONE);
- empty2.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL));
-
- Combo requestViewerCombo = new Combo(requestHeaderRight, SWT.DROP_DOWN | SWT.READ_ONLY);
- requestViewerCombo.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.VERTICAL_ALIGN_END));
-
- // response panel
- Composite response = new Composite(sashFchild, SWT.NONE);
- layout = new GridLayout();
- layout.verticalSpacing = 3;
- layout.marginHeight = 2;
- layout.marginWidth = 0;
- response.setLayout(layout);
- response.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- Composite responseHeader = new Composite(response, SWT.NONE);
- layout = new GridLayout();
- layout.verticalSpacing = 0;
- layout.numColumns = 2;
- layout.marginHeight = 0;
- layout.marginWidth = 2;
- data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
- data.heightHint = 30;
- responseHeader.setLayout(layout);
- responseHeader.setLayoutData(data);
-
- Composite responseHeaderLeft = new Composite(responseHeader, SWT.NONE);
- layout = new GridLayout();
- layout.verticalSpacing = 2;
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- data = new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL);
- data.heightHint = 30;
- responseHeaderLeft.setLayout(layout);
- responseHeaderLeft.setLayoutData(data);
-
- Label empty3 = new Label(responseHeaderLeft, SWT.NONE);
- empty3.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL));
-
- final Label responseLabel = new Label(responseHeaderLeft, SWT.NONE);
- responseLabel.setText(MonitorUIPlugin.getResource("%viewResponse", ""));
- responseLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING));
-
- final Label responseSizeLabel = new Label(responseHeaderLeft, SWT.NONE);
- responseSizeLabel.setText(MonitorUIPlugin.getResource("%viewSize", ""));
- responseSizeLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_END));
-
- Composite responseHeaderRight = new Composite(responseHeader, SWT.NONE);
- layout = new GridLayout();
- layout.verticalSpacing = 0;
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- data = new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.FILL_VERTICAL);
- data.heightHint = 30;
- responseHeaderRight.setLayout(layout);
- responseHeaderRight.setLayoutData(data);
-
- Label empty4 = new Label(responseHeaderRight, SWT.NONE);
- empty4.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL));
-
- Combo responseViewerCombo = new Combo(responseHeaderRight, SWT.DROP_DOWN | SWT.READ_ONLY);
- responseViewerCombo.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.VERTICAL_ALIGN_END));
-
- // viewer manager
- vm = new ViewerManager(request, request, response, response);
- requestViewers = vm.getRequestViewers();
- responseViewers = vm.getResponseViewers();
-
- // set up the viewer combo boxes
- Iterator iterator = requestViewers.iterator();
- int ctr = 0;
- while (iterator.hasNext()) {
- IConfigurationElement element = (IConfigurationElement) iterator.next();
- requestViewerCombo.add(element.getAttribute("label"), ctr);
- if (element.getAttribute("id").equals(DEFAULT_VIEWER)) {
- requestViewerCombo.select(ctr);
- vm.setRequestViewer(element);
- }
- ctr++;
- }
- requestViewerCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent arg0) {
- Combo rvCombo = (Combo) arg0.getSource();
- vm.setRequestViewer((IConfigurationElement) requestViewers.get(rvCombo.getSelectionIndex()));
- }
- });
- requestHeader.layout(true);
-
- iterator = responseViewers.iterator();
- ctr = 0;
- while(iterator.hasNext()) {
- IConfigurationElement element = (IConfigurationElement) iterator.next();
- responseViewerCombo.add(element.getAttribute("label"), ctr);
- if(element.getAttribute("id").equals(DEFAULT_VIEWER)) {
- responseViewerCombo.select(ctr);
- vm.setResponseViewer(element);
- }
- ctr++;
- }
- responseViewerCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent arg0) {
- Combo rvCombo = (Combo) arg0.getSource();
- vm.setResponseViewer((IConfigurationElement) requestViewers.get(rvCombo.getSelectionIndex()));
- }
- });
- responseHeader.layout(true);
-
- // selection listener
- treeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- ISelection selection = event.getSelection();
-
- Request req = null;
- if (selection != null && !selection.isEmpty()) {
- StructuredSelection sel = (StructuredSelection) selection;
- currentSelection = sel;
- Object obj = sel.iterator().next();
- if (obj instanceof Request)
- req = (Request) obj;
- }
-
- if (req != null) {
- label.setText(MonitorUIPlugin.getResource("%viewTime", format.format(req.getDate())));
-
- if (req.getResponseTime() == -1)
- label2.setText(MonitorUIPlugin.getResource("%viewResponseTime", ""));
- else {
- String time = MonitorUIPlugin.getResource("%viewResponseTimeFormat", req.getResponseTime() + "");
- label2.setText(MonitorUIPlugin.getResource("%viewResponseTime", time));
- }
- label3.setText(MonitorUIPlugin.getResource("%viewType", req.getProtocol()));
-
- // request information
- requestLabel.setText(MonitorUIPlugin.getResource("%viewRequest", "localhost:" + req.getLocalPort()));
- requestSizeLabel.setText(getSizeString(req.getRequest(Request.CONTENT), req.getRequest(Request.ALL)));
-
- // response information
- responseLabel.setText(MonitorUIPlugin.getResource("%viewResponse", req.getRemoteHost() + ":" + req.getRemotePort()));
- responseSizeLabel.setText(getSizeString(req.getResponse(Request.CONTENT), req.getResponse(Request.ALL)));
-
- vm.setRequest(req);
- } else {
- label.setText(MonitorUIPlugin.getResource("%viewTime", ""));
- label2.setText(MonitorUIPlugin.getResource("%viewResponseTime", ""));
- requestLabel.setText(MonitorUIPlugin.getResource("%viewRequest", ""));
- requestSizeLabel.setText(MonitorUIPlugin.getResource("%viewSize", ""));
- responseLabel.setText(MonitorUIPlugin.getResource("%viewResponse", ""));
- responseSizeLabel.setText(MonitorUIPlugin.getResource("%viewSize", ""));
- vm.setRequest(req);
- }
- currentRequest = req;
- }
- });
- treeViewer.expandToLevel(2);
-
- // create a menu manager for a context menu
- MenuManager menuManager = new MenuManager();
- menuManager.setRemoveAllWhenShown(true);
- menuManager.addMenuListener(new IMenuListener() {
- public void menuAboutToShow(IMenuManager mgr) {
- mgr.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
- }
- });
-
- // create the menu
- Menu menu = menuManager.createContextMenu(treeViewer.getControl());
- treeViewer.getControl().setMenu(menu);
-
- // register the menu with the platform
- getSite().registerContextMenu(menuManager, treeViewer);
-
- initializeActions();
- }
-
- protected String getSizeString(byte[] a, byte[] b) {
- String aa = "0";
- String bb = "0";
- if (a != null)
- aa = a.length + "";
- if (b != null)
- bb = b.length + "";
- String size = MonitorUIPlugin.getResource("%viewSizeFormat", new Object[] { aa, bb});
- return MonitorUIPlugin.getResource("%viewSize", size);
- }
-
- public void dispose() {
- super.dispose();
- treeViewer = null;
- view = null;
- }
-
- /**
- *
- */
- public void initializeActions() {
- final IAction sortByResponseTimeAction = new Action() {
- public void run() {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- boolean b = contentProvider.getSortByResponseTime();
- contentProvider.setSortByResponseTime(!b);
- treeViewer.refresh();
- setChecked(!b);
- }
- });
- }
- };
- sortByResponseTimeAction.setChecked(false);
- sortByResponseTimeAction.setToolTipText(MonitorUIPlugin.getResource("%actionSortByResponseTime"));
- sortByResponseTimeAction.setImageDescriptor(MonitorUIPlugin.getImageDescriptor(MonitorUIPlugin.IMG_ELCL_SORT_RESPONSE_TIME));
- sortByResponseTimeAction.setHoverImageDescriptor(MonitorUIPlugin.getImageDescriptor(MonitorUIPlugin.IMG_CLCL_SORT_RESPONSE_TIME));
- sortByResponseTimeAction.setDisabledImageDescriptor(MonitorUIPlugin.getImageDescriptor(MonitorUIPlugin.IMG_DLCL_SORT_RESPONSE_TIME));
-
- IAction clearAction = new Action() {
- public void run() {
- MonitorUIPlugin.getInstance().clearRequests();
- }
- };
- clearAction.setToolTipText(MonitorUIPlugin.getResource("%actionClearToolTip"));
- clearAction.setImageDescriptor(MonitorUIPlugin.getImageDescriptor(MonitorUIPlugin.IMG_ELCL_CLEAR));
- clearAction.setHoverImageDescriptor(MonitorUIPlugin.getImageDescriptor(MonitorUIPlugin.IMG_CLCL_CLEAR));
- clearAction.setDisabledImageDescriptor(MonitorUIPlugin.getImageDescriptor(MonitorUIPlugin.IMG_DLCL_CLEAR));
-
- httpHeaderAction = new Action() {
- public void run() {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- boolean b = vm.getDisplayHeaderInfo();
- vm.setDisplayHeaderInfo(!b);
- setChecked(!b);
- }
- });
- }
- };
- httpHeaderAction.setChecked(vm.getDisplayHeaderInfo());
- httpHeaderAction.setText(MonitorUIPlugin.getResource("%actionShowHeader"));
-
- IAction preferenceAction = new Action() {
- public void run() {
- showPreferencePage();
- }
- };
- preferenceAction.setText(MonitorUIPlugin.getResource("%actionProperties"));
-
-
- IToolBarManager tbm = getViewSite().getActionBars().getToolBarManager();
- tbm.add(sortByResponseTimeAction);
- tbm.add(clearAction);
-
- IContentFilter[] filters = MonitorPlugin.getInstance().getContentFilters();
- IMenuManager menuManager = getViewSite().getActionBars().getMenuManager();
- menuManager.add(httpHeaderAction);
- int size = filters.length;
- for (int i = 0; i < size; i++) {
- FilterAction action = new FilterAction(vm, filters[i]);
- menuManager.add(action);
- }
- menuManager.add(preferenceAction);
- }
-
- protected boolean showPreferencePage() {
- PreferenceManager manager = PlatformUI.getWorkbench().getPreferenceManager();
- IPreferenceNode node = manager.find("org.eclipse.internet").findSubNode("org.eclipse.wst.internet.monitor.preferencePage");
- PreferenceManager manager2 = new PreferenceManager();
- manager2.addToRoot(node);
-
- final PreferenceDialog dialog = new PreferenceDialog(getSite().getShell(), manager2);
- final boolean[] result = new boolean[] { false };
- BusyIndicator.showWhile(getSite().getShell().getDisplay(), new Runnable() {
- public void run() {
- dialog.create();
- if (dialog.open() == Window.OK)
- result[0] = true;
- }
- });
- return result[0];
- }
-
- /**
- *
- */
- public static void open(final Request request) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- try {
- IWorkbench workbench = MonitorUIPlugin.getInstance().getWorkbench();
- IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
-
- IWorkbenchPage page = workbenchWindow.getActivePage();
-
- IViewPart view2 = page.findView(VIEW_ID);
-
- if (view2 != null)
- page.bringToTop(view2);
- else
- page.showView(VIEW_ID);
-
- if (view != null)
- view.setSelection(request);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error opening TCP/IP view", e);
- }
- }
- });
- }
-
- /**
- *
- */
- public void setFocus() {
- if (tree != null)
- tree.setFocus();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/ResendMessageAction.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/ResendMessageAction.java
deleted file mode 100644
index 06c7576..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/ResendMessageAction.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.internet.monitor.ui.internal.view;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.wst.internet.monitor.core.Request;
-import org.eclipse.wst.internet.monitor.core.internal.MonitorManager;
-import org.eclipse.wst.internet.monitor.core.internal.http.ResendHTTPRequest;
-/**
- * Resends the selected request and adds the result to the request/response tree.
- */
-public class ResendMessageAction implements IViewActionDelegate{
- protected ISelection selection = null;
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
- */
- public void init(IViewPart view) {
- // do nothing
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- if (selection != null) {
- Object element = ((StructuredSelection) selection).getFirstElement();
- if (element != null && element instanceof Request) {
- Request req = (Request) element;
- ResendHTTPRequest newReq = MonitorManager.createResendRequest(req);
- MonitorManager.getInstance().addResendRequest(req, newReq);
- TreeViewer treeViewer = MonitorView.view.treeViewer;
- treeViewer.add(req, newReq);
- treeViewer.setSelection(new StructuredSelection(newReq), false);
- newReq.sendRequest();
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection2) {
- this.selection = selection2;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/SendModifiedMessageAction.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/SendModifiedMessageAction.java
deleted file mode 100644
index 3829dbb..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/SendModifiedMessageAction.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.internet.monitor.ui.internal.view;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.wst.internet.monitor.core.Request;
-import org.eclipse.wst.internet.monitor.core.internal.http.ResendHTTPRequest;
-import org.eclipse.wst.internet.monitor.ui.ContentViewer;
-import org.eclipse.wst.internet.monitor.ui.internal.viewers.HeaderViewer;
-/**
- * Send a modified message.
- */
-public class SendModifiedMessageAction implements IViewActionDelegate{
- ISelection selection = null;
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
- */
- public void init(IViewPart view) {
- // do nothing
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- if (selection != null) {
- Object element = ((StructuredSelection) selection).getFirstElement();
- if (element != null && element instanceof ResendHTTPRequest) {
- ResendHTTPRequest req = (ResendHTTPRequest) element;
- ContentViewer curViewer = MonitorView.view.vm.getCurrentRequestViewer();
- HeaderViewer curHeaderViewer = MonitorView.view.vm.getCurrentRequestHeaderViewer();
- req.setRequest(curViewer.getContent(), Request.CONTENT);
-
- if (curHeaderViewer != null)
- req.setRequest(curHeaderViewer.getContent(), Request.TRANSPORT);
-
- req.sendRequest();
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection2) {
- this.selection = selection2;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/TreeLabelProvider.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/TreeLabelProvider.java
deleted file mode 100644
index bbe8a50..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/TreeLabelProvider.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.internet.monitor.ui.internal.view;
-
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.internet.monitor.core.Request;
-import org.eclipse.wst.internet.monitor.core.internal.http.ResendHTTPRequest;
-import org.eclipse.wst.internet.monitor.ui.internal.MonitorUIPlugin;
-/**
- * A label provider for the monitor server view.
- */
-public class TreeLabelProvider implements ILabelProvider {
- /**
- * TreeLabelProvider constructor comment.
- */
- public TreeLabelProvider() {
- super();
- }
-
- /*
- * Adds a listener to this label provider.
- */
- public void addListener(ILabelProviderListener listener) {
- // do nothing
- }
-
- /*
- * Disposes of this label provider.
- */
- public void dispose() {
- // do nothing
- }
-
- /*
- * Returns the image for the label of the given element for use
- * in the given viewer.
- */
- public Image getImage(Object element) {
- if (element instanceof Request) {
- if (element instanceof ResendHTTPRequest) {
- if (!((ResendHTTPRequest) element).hasBeenSent())
- return MonitorUIPlugin.getImage(MonitorUIPlugin.IMG_RESEND_REQUEST_RESPONSE);
- }
- return MonitorUIPlugin.getImage(MonitorUIPlugin.IMG_REQUEST_RESPONSE);
- }
- return MonitorUIPlugin.getImage(MonitorUIPlugin.IMG_HOST);
- }
-
- /*
- * Returns the text for the label of the given element for use
- * in the given viewer.
- */
- public String getText(Object element) {
- if (element instanceof Request) {
- Request call = (Request) element;
- return call.getName();
- } else if (element instanceof Integer) {
- Integer in = (Integer) element;
- return "localhost:" + in.intValue();
- } else
- return element.toString();
- }
-
- /*
- * Returns whether the label would be affected
- * by a change to the given property of the given element.
- */
- public boolean isLabelProperty(Object element, String property) {
- return false;
- }
-
- /*
- * Removes a listener to this label provider.
- */
- public void removeListener(ILabelProviderListener listener) {
- // do nothing
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/ViewerManager.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/ViewerManager.java
deleted file mode 100644
index 3213c2b..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/ViewerManager.java
+++ /dev/null
@@ -1,256 +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.internet.monitor.ui.internal.view;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.core.runtime.*;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.internet.monitor.core.*;
-import org.eclipse.wst.internet.monitor.core.internal.IContentFilter;
-import org.eclipse.wst.internet.monitor.core.internal.http.ResendHTTPRequest;
-import org.eclipse.wst.internet.monitor.ui.ContentViewer;
-import org.eclipse.wst.internet.monitor.ui.internal.MonitorUIPlugin;
-import org.eclipse.wst.internet.monitor.ui.internal.Trace;
-import org.eclipse.wst.internet.monitor.ui.internal.viewers.ByteViewer;
-import org.eclipse.wst.internet.monitor.ui.internal.viewers.HeaderViewer;
-/**
- *
- */
-public class ViewerManager implements IViewerManager{
- private boolean displayHeaderInf;
-
- protected ContentViewer reqViewer;
- protected ContentViewer respViewer;
-
- protected HeaderViewer reqHeader;
- protected HeaderViewer respHeader;
-
- protected Composite reqHComp;
- protected Composite reqVComp;
-
- protected Composite respHComp;
- protected Composite respVComp;
-
- protected List viewers;
-
- protected Request request;
-
- protected List filters = new ArrayList();
-
- public ViewerManager(Composite reqHeadParent, Composite reqViewParent, Composite respHeadParent, Composite respViewParent) {
- reqHComp = reqHeadParent;
- respHComp = respHeadParent;
- reqVComp = reqViewParent;
- respVComp = respViewParent;
- reqHeader = new HeaderViewer(reqHComp, HeaderViewer.REQUEST_HEADER);
- respHeader = new HeaderViewer(respHComp, HeaderViewer.RESPONSE_HEADER);
- reqViewer = new ByteViewer();
- reqViewer.init(reqVComp);
- respViewer = new ByteViewer();
- respViewer.init(respVComp);
- setDisplayHeaderInfo(MonitorUIPlugin.getShowHeaderPreference());
- setAvailableViewers();
- }
-
- private void setAvailableViewers() {
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IConfigurationElement[] cf = registry.getConfigurationElementsFor(MonitorUIPlugin.PLUGIN_ID, "viewers");
- int size = cf.length;
- viewers = new ArrayList(size);
- for (int i = 0; i < size; i++) {
- viewers.add(cf[i]);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.internal.view.IViewerManager#setDisplayHeaderInfo(boolean)
- */
- public void setDisplayHeaderInfo(boolean b) {
- displayHeaderInf = b;
- reqHeader.setDisplayHeader(b);
- respHeader.setDisplayHeader(b);
- MonitorUIPlugin.setShowHeaderPreference(b);
- if (b) {
- reqHeader.setEditable(false);
- if (request instanceof ResendHTTPRequest && request.getResponse(Request.TRANSPORT) == null) {
- reqHeader.setEditable(true);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.internal.view.IViewerManager#getDisplayHeaderInfo()
- */
- public boolean getDisplayHeaderInfo() {
- return displayHeaderInf;
- }
-
- public void setRequest(Request rr) {
- // maintain the state of the request and request header if they've been modified.
- if (request instanceof ResendHTTPRequest && request.getResponse(Request.ALL) == null) {
- ResendHTTPRequest resRequest = (ResendHTTPRequest) request;
- //EditableContentViewer editViewer = (ContentViewer) reqViewer;
- byte[] content = reqViewer.getContent();
- byte[] b = resRequest.getRequest(Request.CONTENT);
- if (content != null && b != null && !MonitorUIPlugin.parse(b).equals(MonitorUIPlugin.parse(content))) {
- resRequest.setRequest(content, Request.CONTENT);
- }
- byte[] header = reqHeader.getContent();
- b = resRequest.getRequest(Request.TRANSPORT);
- if (header != null && b != null && !MonitorUIPlugin.parse(b).equals(MonitorUIPlugin.parse(header))) {
- resRequest.setRequest(header, Request.TRANSPORT);
- }
- }
- reqHeader.setRequestResponse(rr);
- respHeader.setRequestResponse(rr);
- byte[] b = null;
- if (rr != null)
- b = filter(rr.getRequest(Request.CONTENT));
- reqViewer.setContent(b);
- b = null;
- if (rr != null)
- b = filter(rr.getResponse(Request.CONTENT));
- respViewer.setContent(b);
- request = rr;
- // Set the editor to editable if the request hasn't been sent and the
- // editor can be set as editable.
- if (request instanceof ResendHTTPRequest && request.getResponse(Request.ALL) == null) {
- if (displayHeaderInf) {
- reqHeader.setEditable(true);
- }
- reqViewer.setEditable(true);
- } else {
- if (displayHeaderInf) {
- reqHeader.setEditable(false);
- }
- reqViewer.setEditable(false);
- }
- }
-
- public void addFilter(IContentFilter filter) {
- filters.add(filter);
- setRequest(request);
- }
-
- public void removeFilter(IContentFilter filter) {
- filters.remove(filter);
- setRequest(request);
- }
-
- protected byte[] filter(byte[] b) {
- if (b == null)
- return null;
- Iterator iterator = filters.iterator();
- while (iterator.hasNext()) {
- IContentFilter filter = (IContentFilter) iterator.next();
- try {
- b = filter.filter(request, false, b);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error while filtering with " + filter.getId(), e);
- }
- }
- return b;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcpip.monitor.internal.view.IViewerManager#getRequestViewers()
- */
- public List getRequestViewers() {
- IConfigurationElement element;
- Iterator iterator = viewers.iterator();
- List temp = new ArrayList();
- while (iterator.hasNext()) {
- element = (IConfigurationElement) iterator.next();
- if (element.getAttribute("type").toLowerCase().indexOf("request") >= 0)
- temp.add(element);
- }
- return temp;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcpip.monitor.internal.view.IViewerManager#getResponseViewers()
- */
- public List getResponseViewers() {
- IConfigurationElement element;
- Iterator iterator = viewers.iterator();
- List temp = new ArrayList();
- while (iterator.hasNext()) {
- element = (IConfigurationElement) iterator.next();
- if (element.getAttribute("type").toLowerCase().indexOf("response") >= 0)
- temp.add(element);
- }
- return temp;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcpip.monitor.internal.view.IViewerManager#setRequestViewer(java.lang.String)
- */
- public void setRequestViewer(IConfigurationElement element) {
- // Call set request to save and reset the request.
- setRequest(request);
- reqViewer.dispose();
- try {
- reqViewer = (ContentViewer) element.createExecutableExtension("class");
- } catch (CoreException e) {
- Trace.trace(Trace.SEVERE, "Error", e);
- }
- reqViewer.init(reqVComp);
- //reqViewer.setRequestResponse(rr);
- byte[] b = null;
- if (request != null) {
- b = filter(request.getRequest(Request.CONTENT));
- // set the editor to editable if the request hasn't been sent and the
- // editor can be set as editable
- if (request instanceof ResendHTTPRequest && request.getResponse(Request.TRANSPORT) == null) {
- reqViewer.setEditable(true);
- } else {
- reqViewer.setEditable(false);
- }
- }
- reqViewer.setContent(b);
- reqVComp.layout(true);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcpip.monitor.internal.view.IViewerManager#setResponseViewer(java.lang.String)
- */
- public void setResponseViewer(IConfigurationElement element) {
- respViewer.dispose();
- try {
- respViewer = (ContentViewer) element.createExecutableExtension("class");
- } catch (CoreException e) {
- Trace.trace(Trace.SEVERE, "Error", e);
- }
- respViewer.init(respVComp);
- //respViewer.setRequestResponse(rr);
- byte[] b = null;
- if (request != null)
- b = filter(request.getResponse(Request.CONTENT));
- respViewer.setContent(b);
- respVComp.layout(true);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.ui.internal.view.IViewerManager#getCurrentRequestViewer()
- */
- public ContentViewer getCurrentRequestViewer() {
- return reqViewer;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.ui.internal.view.IViewerManager#getCurrentRequestHeaderViewer()
- */
- public HeaderViewer getCurrentRequestHeaderViewer() {
- return reqHeader;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/viewers/ByteViewer.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/viewers/ByteViewer.java
deleted file mode 100644
index bab14b1..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/viewers/ByteViewer.java
+++ /dev/null
@@ -1,105 +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.internet.monitor.ui.internal.viewers;
-
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.internet.monitor.ui.ContentViewer;
-import org.eclipse.wst.internet.monitor.ui.internal.ContextIds;
-import org.eclipse.wst.internet.monitor.ui.internal.MonitorUIPlugin;
-/**
- * A basic byte viewer.
- */
-public class ByteViewer extends ContentViewer {
- protected Text text;
- protected Composite comp;
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.ui.IContentViewer#dispose()
- */
- public void dispose() {
- comp.dispose();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.ui.IContentViewer#setContent()
- */
- public void setContent(byte[] b) {
- String out = "";
- if (b != null)
- out = MonitorUIPlugin.parse(b);
-
- String lineSeparator = System.getProperty("line.separator");
- int ls = lineSeparator.length();
- if (out.length() > ls) {
- while (out.substring(0, ls).indexOf(lineSeparator) >= 0)
- out = out.substring(ls, out.length());
- }
-
- text.setText(out);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.ui.IContentViewer#init(Composite)
- */
- public void init(Composite parent) {
- comp = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- comp.setLayout(layout);
- GridData data = new GridData(GridData.FILL_BOTH);
- comp.setLayoutData(data);
-
- text = new Text(comp, SWT.BORDER | SWT.MULTI | SWT.READ_ONLY | SWT.H_SCROLL | SWT.V_SCROLL);
- Display display = comp.getDisplay();
- text.setBackground(display.getSystemColor(SWT.COLOR_LIST_BACKGROUND));
- text.setForeground(display.getSystemColor(SWT.COLOR_LIST_FOREGROUND));
- text.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL));
- text.setFont(JFaceResources.getTextFont());
- PlatformUI.getWorkbench().getHelpSystem().setHelp(text, ContextIds.VIEW_RESPONSE);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.ui.IEditableContentViewer#setEditable(boolean)
- */
- public void setEditable(boolean editable) {
- text.setEditable(editable);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.ui.IEditableContentViewer#getContent()
- */
- public byte[] getContent() {
- if (text == null) {
- return new byte[0];
- }
- String content = text.getText().trim();
- if (content.equals("")) {
- return new byte[0];
- }
- // Need to ensure that there is a newline at the end of the content.
- // getBytes() removes the newline.
- byte[] twoNewlines = new byte[] { '\015', '\012' };
- byte[] contentBytes = content.getBytes();
- byte[] retBytes = new byte[contentBytes.length + 2];
- System.arraycopy(contentBytes, 0, retBytes, 0, contentBytes.length);
- System.arraycopy(twoNewlines, 0, retBytes, contentBytes.length, 2);
- return retBytes;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/viewers/HeaderViewer.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/viewers/HeaderViewer.java
deleted file mode 100644
index faeced0..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/viewers/HeaderViewer.java
+++ /dev/null
@@ -1,198 +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.internet.monitor.ui.internal.viewers;
-
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.internet.monitor.core.Request;
-import org.eclipse.wst.internet.monitor.ui.internal.ContextIds;
-import org.eclipse.wst.internet.monitor.ui.internal.MonitorUIPlugin;
-/**
- * An transport (header) viewer.
- */
-public class HeaderViewer {
- protected boolean displayHeader;
-
- protected Composite headerComp;
- protected Composite innerComp;
- protected Composite rootComp;
-
- protected Label headerLabel;
- protected Text headerText;
- protected Request rr;
- protected byte msg;
- protected GridLayout layout;
- protected GridData data;
-
- protected boolean hidden;
-
- protected static int HEADER_LABEL_SIZE = 15;
- protected static int HEADER_TEXT_SIZE = 110;
- public static byte REQUEST_HEADER = 0;
- public static byte RESPONSE_HEADER = 1;
-
- public HeaderViewer(Composite parent, byte message) {
- rootComp = parent;
- displayHeader = true;
- hidden = false;
-
- headerComp = new Composite(parent, SWT.NONE);
- layout = new GridLayout();
- layout.numColumns = 1;
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- headerComp.setLayout(layout);
- data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
- headerComp.setLayoutData(data);
-
- innerComp = new Composite(headerComp, SWT.NONE);
- layout = new GridLayout();
- layout.numColumns = 1;
- layout.marginHeight = 0;
- layout.marginWidth = 2;
- innerComp.setLayout(layout);
- data = new GridData(GridData.FILL_BOTH);
- data.heightHint = HEADER_LABEL_SIZE;
- innerComp.setLayoutData(data);
-
- rr = null;
- msg = message;
-
- setDisplayHeader(false);
- }
-
- public void setRequestResponse(Request reqresp) {
- rr = reqresp;
- if (!hidden)
- getView();
- }
-
- public void setDisplayHeader(boolean b) {
- if (displayHeader != b) {
- displayHeader = b;
- if (displayHeader) {
- innerComp.dispose();
-
- data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
- data.heightHint = HEADER_TEXT_SIZE;
- headerComp.setLayoutData(data);
-
- innerComp = new Composite(headerComp, SWT.NONE);
- layout = new GridLayout();
- layout.numColumns = 1;
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- innerComp.setLayout(layout);
- data = new GridData(GridData.FILL_BOTH);
- data.heightHint = HEADER_TEXT_SIZE;
- innerComp.setLayoutData(data);
-
- headerText = new Text(innerComp, SWT.BORDER | SWT.MULTI | SWT.READ_ONLY | SWT.H_SCROLL | SWT.V_SCROLL);
- Display display = innerComp.getDisplay();
- headerText.setBackground(display.getSystemColor(SWT.COLOR_LIST_BACKGROUND));
- headerText.setForeground(display.getSystemColor(SWT.COLOR_LIST_FOREGROUND));
- headerText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL));
- headerText.setFont(JFaceResources.getTextFont());
- PlatformUI.getWorkbench().getHelpSystem().setHelp(headerText, ContextIds.VIEW_RESPONSE);
-
- rootComp.layout(true);
- } else {
- innerComp.dispose();
-
- data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
- data.heightHint = HEADER_LABEL_SIZE;
- headerComp.setLayoutData(data);
-
- innerComp = new Composite(headerComp, SWT.NONE);
- layout = new GridLayout();
- layout.numColumns = 1;
- layout.marginHeight = 0;
- layout.marginWidth = 2;
- innerComp.setLayout(layout);
- data = new GridData(GridData.FILL_BOTH);
- data.heightHint = HEADER_LABEL_SIZE;
- innerComp.setLayoutData(data);
-
- headerLabel = new Label(innerComp, SWT.NONE);
- headerLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING));
-
- rootComp.layout(true);
- }
- }
- getView();
- }
-
- private void getView() {
- String out = "";
- if (rr != null) {
- if (msg == REQUEST_HEADER) {
- byte[] b = rr.getRequest(Request.TRANSPORT);
- if (b != null)
- out = MonitorUIPlugin.parse(b);
- } else if (msg == RESPONSE_HEADER) {
- byte[] b = rr.getResponse(Request.TRANSPORT);
- if (b != null)
- out = MonitorUIPlugin.parse(b);
- }
- }
-
- if (displayHeader) {
- headerText.setText(out);
- } else {
- String lineSeparator = System.getProperty("line.separator");
- int index = out.indexOf(lineSeparator);
- if(index > 0)
- headerLabel.setText(MonitorUIPlugin.getResource("%headerLabel") + ": " + out.substring(0, index));
- else
- headerLabel.setText(MonitorUIPlugin.getResource("%headerLabel") + ": " + out);
- }
- }
-
- public void dispose() {
- headerComp.dispose();
- }
-
- /**
- * Set whether the header can be edited.
- *
- * @param editable If true the header can be edited, otherwise the header cannot be edited.
- */
- public void setEditable(boolean editable) {
- headerText.setEditable(editable);
- }
-
- /**
- * Get the content from the header.
- *
- * @return The content from the header.
- */
- public byte[] getContent() {
- if (headerText == null || headerText.isDisposed())
- return null;
-
- String header = headerText.getText().trim();
- // Need to ensure that the following 4 bytes end the header. The getBytes()
- // method removes spaces at the end of the string.
- byte[] twoNewlines = new byte[] { '\015', '\012', '\015', '\012' };
- byte[] headerBytes = header.getBytes();
- byte[] retBytes = new byte[headerBytes.length + 4];
- System.arraycopy(headerBytes, 0, retBytes, 0, headerBytes.length);
- System.arraycopy(twoNewlines, 0, retBytes, headerBytes.length, 4);
- return retBytes;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/viewers/ImageViewer.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/viewers/ImageViewer.java
deleted file mode 100644
index f4f381b..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/viewers/ImageViewer.java
+++ /dev/null
@@ -1,100 +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.internet.monitor.ui.internal.viewers;
-
-import java.io.ByteArrayInputStream;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.ImageData;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.wst.internet.monitor.ui.ContentViewer;
-import org.eclipse.wst.internet.monitor.ui.internal.MonitorUIPlugin;
-/**
- * An image viewer.
- */
-public class ImageViewer extends ContentViewer {
- protected Composite rootComp;
- protected Composite viewerComp;
- protected Label messageLabel;
-
- protected byte[] content;
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.ui.IContentViewer#init(Composite)
- */
- public void init(Composite parent) {
- rootComp = parent;
-
- viewerComp = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- viewerComp.setLayout(layout);
- GridData data = new GridData(GridData.FILL_BOTH);
- viewerComp.setLayoutData(data);
-
- messageLabel = new Label(viewerComp, SWT.NONE);
- messageLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_BEGINNING));
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.ui.IContentViewer#setContent()
- */
- public void setContent(byte[] b) {
- content = b;
- if (b == null || b.length == 0) {
- messageLabel.setText("<" + MonitorUIPlugin.getResource("%imageViewInvalid") + ">");
- } else {
- byte cr = '\r';
- byte lf = '\n';
- int trimFront = 0;
- int trimBack = 0;
- int len = b.length - 1;
- while(b[trimFront] == cr || b[trimFront] == lf)
- trimFront++;
- while(b[len - trimBack] == cr || b[len - trimBack] == lf)
- trimBack++;
-
- if (trimFront + trimBack > 0) {
- byte[] temp = b;
- b = new byte[temp.length - trimBack - trimFront];
- for(int i = trimFront; i < temp.length - trimBack; i++) {
- b[i - trimFront] = temp[i];
- }
- }
- try {
- ImageData imgD = new ImageData(new ByteArrayInputStream(b));
- Image img = new Image(null, imgD);
- messageLabel.setImage(img);
- } catch(Exception e) {
- messageLabel.setText("<" + MonitorUIPlugin.getResource("%imageViewInvalid") + ">");
- }
- }
-
- viewerComp.layout(true);
- }
-
- public byte[] getContent() {
- return content;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.ui.IContentViewer#dispose()
- */
- public void dispose() {
- viewerComp.dispose();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/viewers/XMLViewer.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/viewers/XMLViewer.java
deleted file mode 100644
index 61165ae..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/viewers/XMLViewer.java
+++ /dev/null
@@ -1,226 +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.internet.monitor.ui.internal.viewers;
-
-import java.io.*;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Result;
-import javax.xml.transform.Source;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-
-import org.eclipse.jface.resource.JFaceResources;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.StackLayout;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.internet.monitor.ui.ContentViewer;
-import org.eclipse.wst.internet.monitor.ui.internal.ContextIds;
-import org.eclipse.wst.internet.monitor.ui.internal.MonitorUIPlugin;
-
-import org.w3c.dom.*;
-import org.xml.sax.*;
-/**
- * XML Viewer.
- */
-public class XMLViewer extends ContentViewer {
- protected GridData data;
- protected StackLayout layout;
- protected Text messageText;
-
- protected Composite rootComp;
- protected Composite viewerComp;
- protected Label messageLabel;
-
- protected boolean xmlTagMissing = false;
- protected boolean setEncoding = false;
- protected boolean missingEncoding = false;
- protected String originalEncoding;
-
- protected byte[] content;
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.ui.IContentViewer#dispose()
- */
- public void dispose() {
- viewerComp.dispose();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.ui.IContentViewer#setContent()
- */
- public void setContent(byte[] b) {
- content = b;
- String out = "";
- if (b != null)
- out = MonitorUIPlugin.parse(b);
-
- String lineSeparator = System.getProperty("line.separator");
- int ls = lineSeparator.length();
- if (out.length() > ls) {
- while (out.substring(0, ls).indexOf(lineSeparator) >= 0)
- out = out.substring(ls, out.length());
- }
-
- String out_temp = out.toLowerCase();
- if (out_temp.indexOf("<?xml") < 0)
- xmlTagMissing = true;
-
- if (out.length() > 0) {
- byte[] b1 = createDocument(out);
- String finalMsg = new String (b1);
- if (finalMsg.startsWith("Invalid XML")) {
- //case: error parsing
- messageText.setVisible(false);
- layout.topControl = messageLabel;
- messageLabel.setVisible(true);
- messageLabel.setText("<" + MonitorUIPlugin.getResource("%xmlViewInvalid") + ">");
- } else if (xmlTagMissing && finalMsg.startsWith("<?xml version=\"1.0\" encoding=\"UTF-8\"?>")) {
- int x = finalMsg.indexOf("\n") + 1;
- String Msg = finalMsg.substring(x);
- finalMsg = Msg;
-
- messageText.setText(finalMsg);
- } else if (setEncoding) {
- //change back to original Encoding
- int begin = finalMsg.indexOf("UTF-8"); //location of opening "
- int last = begin + 5; //location of closing "
- String first_half = finalMsg.substring(0,begin);
- String second_half = finalMsg.substring(last);
- finalMsg = first_half + originalEncoding + second_half;
-
- messageText.setText(finalMsg);
- } else if (missingEncoding) {
- //remove encoding completely
- int begin = finalMsg.indexOf("encoding=\"UTF-8\""); //location of opening "
- int last = begin + 16; //location of closing "
- String first_half = finalMsg.substring(0,begin);
- String second_half = finalMsg.substring(last);
- finalMsg = first_half + second_half;
-
- messageText.setText(finalMsg);
- }
- } else
- messageText.setText(out);
- }
-
- public byte[] getContent() {
- return content;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.ui.IContentViewer#init(Composite)
- */
- public void init(Composite parent) {
- rootComp = parent;
-
- viewerComp = new Composite(parent, SWT.NONE);
- layout = new StackLayout();
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- viewerComp.setLayout(layout);
- data = new GridData(GridData.FILL_BOTH);
- viewerComp.setLayoutData(data);
-
- messageText = new Text(viewerComp, SWT.BORDER | SWT.MULTI | SWT.READ_ONLY | SWT.H_SCROLL | SWT.V_SCROLL);
- Display display = viewerComp.getDisplay();
- messageText.setBackground(display.getSystemColor(SWT.COLOR_LIST_BACKGROUND));
- messageText.setForeground(display.getSystemColor(SWT.COLOR_LIST_FOREGROUND));
- messageText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL));
- messageText.setFont(JFaceResources.getTextFont());
- messageText.setVisible(true);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(messageText, ContextIds.VIEW_RESPONSE);
-
- messageLabel = new Label(viewerComp, SWT.NONE);
- messageLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_BEGINNING));
- messageLabel.setVisible(false);
-
- layout.topControl = messageText;
- }
-
- /* (non-Javadoc)
- * @#createDocument(String)
- */
- protected byte[] createDocument(String str) {
- byte[] parseArray = null;
- Document document = null;
- byte[] result = null;
-
- try {
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- try {
- factory.setAttribute("http://apache.org/xml/features/allow-java-encodings", new Boolean(true));
- factory.setAttribute("http://apache.org/xml/features/continue-after-fatal-error", new Boolean(true));
- } catch (Exception e) {
- // ignore
- }
- DocumentBuilder parser = factory.newDocumentBuilder();
-
- if (xmlTagMissing) {
- str = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + str;
- } else {
- String str_temp = str.toLowerCase();
-
- //if encoding present,then save original Encoding, change to UTF-8
- if (str_temp.indexOf("encoding=") >= 0) {
- setEncoding = true;
- String temp1 = str.substring(str_temp.indexOf("encoding="));
- int beginIndex = temp1.indexOf("\"") + 1;
- String temp2 = temp1.substring(beginIndex);
- int endIndex = temp2.indexOf("\"");
- originalEncoding = temp2.substring(0, endIndex);
- }
-
- //if no encoding at all,then no changes to be made
- else if (str_temp.indexOf("encoding") < 0) {
- setEncoding = false;
- missingEncoding = true;
- }
- }
- parseArray = str.getBytes();
- document = parser.parse(new InputSource(new ByteArrayInputStream(parseArray)));
- result = getContents(document);
-
- } catch (Exception e) {
- result = "Invalid XML".getBytes();
- }
- return result;
- }
-
- protected byte[] getContents(Document document) throws IOException {
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- Result result = new StreamResult(out);
- Source source = new DOMSource(document);
- try {
- Transformer transformer = TransformerFactory.newInstance().newTransformer();
- transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
- transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$
- transformer.transform(source, result);
- } catch (TransformerConfigurationException e) {
- throw (IOException) (new IOException().initCause(e));
- } catch (TransformerException e) {
- throw (IOException) (new IOException().initCause(e));
- }
- return out.toByteArray();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/package.xml b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/package.xml
deleted file mode 100644
index a54f7ab..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/package.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<html>
-<head>
- <!-- Escape to the root of your source folder -->
- <meta
- name="root"
- content="../../../../../../" />
- <title>WTP API overview</title>
-</head>
-
-<body>
-<p>TCP/IP monitor UI</p>
-
-<p>The MonitorUICore class gives access to the requests that are currently
-visible in the TCP/IP monitor view. The ContentViewer class is provided to
-implement the viewers extension point that allows external plugins to provide
-a view for viewing request and response data content in the monitor view.
-</p>
-
-</body>
-</html>
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/plugin.properties b/plugins/org.eclipse.wst.internet.monitor.ui/plugin.properties
deleted file mode 100644
index c71b803..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/plugin.properties
+++ /dev/null
@@ -1,77 +0,0 @@
-###############################################################################
-# Copyright (c) 2004 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
-###############################################################################
-pluginName=TCP/IP Monitor
-providerName=Eclipse.org
-
-extensionPointViewers=Viewers
-
-# --------------- TCP/IP Monitor view ---------------
-
-# Labels
-viewTitle=TCP/IP Monitor
-viewRequest=Request: {0}
-viewResponse=Response: {0}
-viewTime=Time of request: {0}
-viewType=Type: {0}
-viewResponseTime=Response Time: {0}
-viewSize=Size: {0}
-viewResponseTimeFormat={0} ms
-viewSizeFormat={0} ({1}) bytes
-viewDateFormat=h:mm.s.S a
-
-# Actions
-actionSortByResponseTime=Sort by response time
-actionClearToolTip=Clear
-actionShowHeader=Show header
-actionProperties=Properties...
-actionResend=Resend request
-actionModify=Modify request
-actionModifyResend=Send Modified Request
-
-
-# --------------- RequestResponse Viewers ---------------
-byteView=Byte View
-imageView=Image View
-xmlView=XML View
-headerLabel=Header
-imageViewInvalid=Not a valid image file
-xmlViewInvalid=Not a valid XML file
-
-# --------------- Errors ---------------
-errorDialogTitle=Error
-
-# --------------- General UI ---------------
-monitorList=TCP/IP Monitors:
-columnLocal=Local Port
-columnRemote=Host name
-columnType=Type
-columnStatus=Status
-add=Add...
-edit=Edit...
-remove=Remove
-start=Start
-stop=Stop
-started=Started
-stopped=Stopped
-
-newMonitor=New Monitor
-editMonitor=Edit Monitor
-
-localPort=Local monitoring port:
-remoteGroup=Monitor
-remoteHost=Host name:
-remotePort=Port:
-parseType=Type:
-
-preferenceTitle=TCP/IP Monitor
-preferenceDescription=Configure TCP/IP monitors on local and remote ports.
-
-prefShowView=&Show the TCP/IP Monitor view when there is activity
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/plugin.xml b/plugins/org.eclipse.wst.internet.monitor.ui/plugin.xml
deleted file mode 100644
index 3a29e8e..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/plugin.xml
+++ /dev/null
@@ -1,112 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-
-<plugin id="org.eclipse.wst.internet.monitor.ui"
- name="%pluginName"
- version="1.0.0"
- provider-name="%providerName"
- class="org.eclipse.wst.internet.monitor.ui.internal.MonitorUIPlugin">
-
-<requires>
- <import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.eclipse.ui.ide"/>
- <import plugin="org.eclipse.ui"/>
- <import plugin="org.eclipse.wst.internet.monitor.core"/>
-</requires>
-
-<runtime>
- <library name="monitorui.jar">
- <export name="*"/>
- </library>
-</runtime>
-
-<extension-point name="%extensionPointViewers" id="viewers" schema="schema/viewers.exsd"/>
-
-<extension point="org.eclipse.wst.internet.monitor.core.internalStartup">
- <startup
- id="org.eclipse.wst.internet.monitor.ui"
- class="org.eclipse.wst.internet.monitor.ui.internal.Startup"/>
-</extension>
-
-<extension point="org.eclipse.ui.views">
- <view
- id="org.eclipse.wst.internet.monitor.view"
- name="%viewTitle"
- category="org.eclipse.debug.ui"
- class="org.eclipse.wst.internet.monitor.ui.internal.view.MonitorView"
- icon="icons/cview16/monitorView.gif">
- </view>
-</extension>
-
-<extension point="org.eclipse.ui.preferencePages">
- <page
- id="org.eclipse.wst.internet.monitor.preferencePage"
- name="%preferenceTitle"
- category="org.eclipse.internet"
- class="org.eclipse.wst.internet.monitor.ui.internal.MonitorPreferencePage"/>
-</extension>
-
-<extension point="org.eclipse.wst.internet.monitor.ui.viewers">
- <viewer
- id="org.eclipse.wst.internet.monitor.viewers.byteviewer"
- class="org.eclipse.wst.internet.monitor.ui.internal.viewers.ByteViewer"
- type="requestresponse"
- label="%byteView"/>
- <viewer
- id="org.eclipse.wst.internet.monitor.viewers.imageviewer"
- class="org.eclipse.wst.internet.monitor.ui.internal.viewers.ImageViewer"
- type="requestresponse"
- label="%imageView"/>
- <viewer
- id="org.eclipse.wst.internet.monitor.viewers.XMLViewer"
- class="org.eclipse.wst.internet.monitor.ui.internal.viewers.XMLViewer"
- type="requestresponse"
- label="%xmlView"/>
-</extension>
-
-<extension point="org.eclipse.core.runtime.adapters">
- <factory
- class="org.eclipse.wst.internet.monitor.ui.internal.RequestAdapterFactory"
- adaptableType="org.eclipse.wst.internet.monitor.core.Request">
- <adapter type="org.eclipse.ui.IActionFilter"/>
- </factory>
-</extension>
-
-<extension point="org.eclipse.ui.popupMenus">
- <objectContribution
- objectClass="org.eclipse.wst.internet.monitor.core.Request"
- id="org.eclipse.wst.internet.monitor.ui.modifyaction">
- <filter name="requestsent" value="true"/>
- <action
- label="%actionResend"
- menubarPath="additions"
- class="org.eclipse.wst.internet.monitor.ui.internal.view.ResendMessageAction"
- enablesFor="1"
- id="org.eclipse.wst.internet.monitor.ui.internal.view.ResendMessageAction"
- icon="icons/elcl16/resendRequest.gif">
- </action>
- <action
- label="%actionModify"
- menubarPath="additions"
- class="org.eclipse.wst.internet.monitor.ui.internal.view.ModifyMessageAction"
- enablesFor="1"
- id="org.eclipse.wst.internet.monitor.ui.internal.view.ModifyMessageAction"
- icon="icons/etool16/editRequest.gif">
- </action>
- </objectContribution>
- <objectContribution
- objectClass="org.eclipse.wst.internet.monitor.core.Request"
- id="org.eclipse.wst.internet.monitor.ui.sendmodifyaction">
- <filter name="requestsent" value="false"/>
- <action
- label="%actionModifyResend"
- menubarPath="additions"
- class="org.eclipse.wst.internet.monitor.ui.internal.view.SendModifiedMessageAction"
- enablesFor="1"
- id="org.eclipse.wst.internet.monitor.ui.internal.view.SendModifiedMessageAction"
- icon="icons/elcl16/resendRequest.gif">
- </action>
- </objectContribution>
-</extension>
-
-</plugin>
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/schema/viewers.exsd b/plugins/org.eclipse.wst.internet.monitor.ui/schema/viewers.exsd
deleted file mode 100644
index ad60186..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/schema/viewers.exsd
+++ /dev/null
@@ -1,128 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.internet.monitor.ui">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.internet.monitor.ui" id="viewers" name="Content Viewers"/>
- </appInfo>
- <documentation>
- This extension point is used to provide a viewer for a specific type of content. (e.g. a viewer for a particular image format)
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="viewer" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="viewer">
- <annotation>
- <appInfo>
- <meta.element labelAttribute="name"/>
- </appInfo>
- </annotation>
- <complexType>
- <sequence>
- </sequence>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- specifies a unique identifier for this extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- specifies the fully qualified name of the Java class that extends <samp>org.eclipse.wst.internet.monitor.ui.ContentViewer</samp>. Viewers instances of this type will delegate to instances of this class.
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.wst.internet.monitor.ui.ContentViewer"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="label" type="string" use="required">
- <annotation>
- <documentation>
- a translatable name used to identify the content viewer
- </documentation>
- </annotation>
- </attribute>
- <attribute name="type" type="string" use="required">
- <annotation>
- <documentation>
- [issue: what is this used for?]
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following is an example of a content viewer extension point:
-
-<p>
-<pre>
-<extension point="org.eclipse.wst.internet.monitor.ui.viewers">
- <viewer
- id="com.example.byteviewer"
- class="com.example.ByteContentViewer"
- type="requestresponse"
- label="%byteView"/>
-</extension>
-</pre>
-</p>
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- Value of the attribute <b>class</b> must be a fully qualified name of a Java class that extends the abstract class <b>org.eclipse.wst.internet.monitor.ui.ContentViewer</b>.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2003, 2004 IBM Corporation and others.<br>
-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
-<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/org.eclipse.wst.server.core/.classpath b/plugins/org.eclipse.wst.server.core/.classpath
deleted file mode 100644
index cf5d302..0000000
--- a/plugins/org.eclipse.wst.server.core/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="servercore/"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/plugins/org.eclipse.wst.server.core/.cvsignore b/plugins/org.eclipse.wst.server.core/.cvsignore
deleted file mode 100644
index dd71f75..0000000
--- a/plugins/org.eclipse.wst.server.core/.cvsignore
+++ /dev/null
@@ -1,5 +0,0 @@
-bin
-temp.folder
-build.xml
-servercore.jar
-org.eclipse.wst.server.core_3.0.0.jar
diff --git a/plugins/org.eclipse.wst.server.core/.options b/plugins/org.eclipse.wst.server.core/.options
deleted file mode 100644
index 6b73658..0000000
--- a/plugins/org.eclipse.wst.server.core/.options
+++ /dev/null
@@ -1,7 +0,0 @@
-# Debugging options for the org.eclipse.wst.server.core plugin
-
-# Turn on general debugging
-org.eclipse.wst.server.core/debug=true
-
-# Prints out values
-org.eclipse.wst.server.core/resources=false
diff --git a/plugins/org.eclipse.wst.server.core/.project b/plugins/org.eclipse.wst.server.core/.project
deleted file mode 100644
index bf1e7ef..0000000
--- a/plugins/org.eclipse.wst.server.core/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.server.core</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/plugins/org.eclipse.wst.server.core/build.properties b/plugins/org.eclipse.wst.server.core/build.properties
deleted file mode 100644
index a3c08db..0000000
--- a/plugins/org.eclipse.wst.server.core/build.properties
+++ /dev/null
@@ -1,20 +0,0 @@
-###############################################################################
-# Copyright (c) 2004 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
-###############################################################################
-bin.includes = plugin.xml,\
- *.jar,\
- plugin.properties,\
- servercore.jar,\
- .options
-jars.compile.order =
-src.includes = schema/,\
- build.properties
-source.servercore.jar = servercore/
-output.servercore.jar = bin/
diff --git a/plugins/org.eclipse.wst.server.core/plugin.properties b/plugins/org.eclipse.wst.server.core/plugin.properties
deleted file mode 100644
index a088cc0..0000000
--- a/plugins/org.eclipse.wst.server.core/plugin.properties
+++ /dev/null
@@ -1,86 +0,0 @@
-###############################################################################
-# Copyright (c) 2004, 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
-###############################################################################
-pluginName=Server Core
-providerName=Eclipse.org
-
-extensionPointServerStartup=Server Startup
-extensionPointModuleTypes=Module Types
-extensionPointRuntimeTypes=Runtime Types
-extensionPointRuntimeTargetHandlers=Runtime Target Handlers
-extensionPointRuntimeLocators=Runtime Locators
-extensionPointServerTypes=Server Types
-extensionPointServerLocators=Server Locators
-extensionPointModuleFactories=Module Factories
-extensionPointModuleArtifactAdapters=Module Artifact Adapters
-extensionPointLaunchableAdapters=Launchable Adapters
-extensionPointClients=Clients
-extensionPointServerTasks=Server Tasks
-extensionPointServerMonitors=Server Monitors
-
-# --------------- Tasks (progress monitors) ---------------
-
-# General tasks
-copyingTask=Copying from {0} to {1}
-unZippingTask=Unzipping {0}
-expandingTask=Expanding {0}
-savingTask=Saving {0}
-deletingTask=Deleting {0}
-copyingTask=File copied successfully to {0}
-
-taskPerforming=Performing Tasks
-taskModifyModules=Adding and/or removing projects.
-
-publishing=Publishing to {0}...
-publishingStatus=Publishing results
-publishingStop=Disconnecting from server
-
-publishingModule=Publishing: {0}
-publishedModule={0} published successfully
-
-publishingCancelled=Publishing cancelled
-
-# --------------- Misc UI ---------------
-
-# Error Messages
-errorPublishing=Could not publish to the server.
-errorNoConfiguration=The server has no configuration.
-errorLoading=Error loading from {0}.
-errorSaving=Could not save to {0}.
-errorCopyingFile=Error copying file to {0}: {1}
-errorModuleRestartFailed=Could not restart the module.
-errorWorkingCopyTimestamp=Could not save because the file has been modified since the start of editting.
-errorRuntimeName=Enter a name for the runtime.
-errorDuplicateRuntimeName=Name is already in use.
-errorStartTimeout=Timeout waiting for {0} to start. Server did not start after {1}s.
-errorStartFailed=Server {0} failed to start.
-
-# Default server creation names
-# {0} will be replaced by a number if the given name is already being used
-defaultServerProjectName=Servers{0}
-defaultRuntimeName={0}
-defaultRuntimeName2={0} ({1})
-defaultServerName={0} @ {1}
-defaultServerName2={0} @ {1} ({2})
-defaultServerName3={0}
-defaultServerName4={0} ({1})
-
-# Used when a name can't be found
-defaultVendor=Basic
-defaultVersion=Basic
-moduleTypeUnknown=Unknown module
-
-# null launchable
-nullLaunchableClient=Do nothing
-nullLaunchableClientDescription=Do not launch anything after starting the server.
-
-canStartOk=The server can be started.
-canStartErrorState=The server cannot be started because it is current starting or stopping.
-errorLaunchMode=The server does not support the given launch mode.
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/plugin.xml b/plugins/org.eclipse.wst.server.core/plugin.xml
deleted file mode 100644
index 35f1821..0000000
--- a/plugins/org.eclipse.wst.server.core/plugin.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-
-<plugin id="org.eclipse.wst.server.core"
- name="%pluginName"
- version="1.0.0"
- provider-name="%providerName"
- class="org.eclipse.wst.server.core.internal.ServerPlugin">
-
- <requires>
- <import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.eclipse.core.resources"/>
- <import plugin="org.eclipse.core.expressions"/>
- <import plugin="org.eclipse.debug.core"/>
- </requires>
-
- <runtime>
- <library name="servercore.jar">
- <export name="*"/>
- </library>
- </runtime>
-
- <extension-point id="internalStartup" name="%extensionPointServerStartup" schema="schema/startup.exsd"/>
- <extension-point id="moduleTypes" name="%extensionPointModuleTypes" schema="schema/moduleTypes.exsd"/>
- <extension-point id="runtimeTypes" name="%extensionPointRuntimeTypes" schema="schema/runtimeTypes.exsd"/>
- <extension-point id="runtimeTargetHandlers" name="%extensionPointRuntimeTargetHandlers" schema="schema/runtimeTargetHandlers.exsd"/>
- <extension-point id="runtimeLocators" name="%extensionPointRuntimeLocators" schema="schema/runtimeLocators.exsd"/>
- <extension-point id="serverTypes" name="%extensionPointServerTypes" schema="schema/serverTypes.exsd"/>
- <extension-point id="serverLocators" name="%extensionPointServerLocators" schema="schema/serverLocators.exsd"/>
- <extension-point id="moduleFactories" name="%extensionPointModuleFactories" schema="schema/moduleFactories.exsd"/>
- <extension-point id="moduleArtifactAdapters" name="%extensionPointModuleArtifactAdapters" schema="schema/moduleArtifactAdapters.exsd"/>
- <extension-point id="launchableAdapters" name="%extensionPointLaunchableAdapters" schema="schema/launchableAdapters.exsd"/>
- <extension-point id="clients" name="%extensionPointClients" schema="schema/clients.exsd"/>
- <extension-point id="serverTasks" name="%extensionPointServerTasks" schema="schema/serverTasks.exsd"/>
- <extension-point id="internalServerMonitors" name="%extensionPointServerMonitors" schema="schema/serverMonitors.exsd"/>
-
- <extension point="org.eclipse.wst.server.core.moduleTypes">
- <moduleType
- id="*"
- name="%moduleTypeUnknown"/>
- </extension>
-</plugin>
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/schema/clients.exsd b/plugins/org.eclipse.wst.server.core/schema/clients.exsd
deleted file mode 100644
index e1c586f..0000000
--- a/plugins/org.eclipse.wst.server.core/schema/clients.exsd
+++ /dev/null
@@ -1,132 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.server.core">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.server.core" id="clients" name="Clients"/>
- </appInfo>
- <documentation>
- This extension point provides a way to launch a client for a specific type of resource that is being run on a server.
- </documentation>
- </annotation>
-
- <include schemaLocation="schema://org.eclipse.core.expressions/schema/expressionLanguage.exsd"/>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="client" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="client">
- <annotation>
- <appInfo>
- <meta.element labelAttribute="name"/>
- </appInfo>
- </annotation>
- <complexType>
- <sequence>
- <element ref="enablement"/>
- </sequence>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- specifies a unique identifier for this extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- specifies the fully qualified name of the Java class that extend <samp>ClientDelegate</samp>.
-Clieint instances of this type will delegate to instances of this class to launch.
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.wst.server.core.model.ClientDelegate"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- a translatable name used to identify the client
- </documentation>
- </annotation>
- </attribute>
- <attribute name="description" type="string">
- <annotation>
- <documentation>
- a translatable description of this client
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following is an example of a client extension point:
-
-<p>
-<pre>
-<extension point="org.eclipse.wst.server.core.clients">
- <client
- id="com.example.clients"
- name="%clientName"
- description="%clientDescription"
- class="com.example.ExampleClient"/>
-</extension>
-</pre>
-</p>
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- Value of the attribute <b>class</b> must be a fully qualified name of a Java class that extends <b>org.eclipse.wst.server.core.model.ClientDelegate</b> and contains a public 0-arg constructor.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2000, 2003 IBM Corporation and others.<br>
-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
-<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/org.eclipse.wst.server.core/schema/launchableAdapters.exsd b/plugins/org.eclipse.wst.server.core/schema/launchableAdapters.exsd
deleted file mode 100644
index ca8f1b0..0000000
--- a/plugins/org.eclipse.wst.server.core/schema/launchableAdapters.exsd
+++ /dev/null
@@ -1,120 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.server.core">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.server.core" id="launchableAdapters" name="Launchable Adapters"/>
- </appInfo>
- <documentation>
- This extension point provides a way for a server to support the Run on Server scenario.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="launchableAdapter" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="launchableAdapter">
- <annotation>
- <appInfo>
- <meta.element labelAttribute="name"/>
- </appInfo>
- </annotation>
- <complexType>
- <sequence>
- </sequence>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- specifies a unique identifier for this extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- specifies the fully qualified name of the Java class that extends <samp>LaunchableAdapterDelegate</samp>.
-Launchable adapter instances of this type will delegate to instances of this class.
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.wst.server.core.model.LaunchableAdapterDelegate"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="typeIds" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following is an example of a launchable adapter extension point:
-
-<p>
-<pre>
- <extension point="org.eclipse.wst.server.core.launchableAdapters">
- <launchableAdapter
- id="com.example.launchableAdapter"
- class="com.example.ExampleLaunchableAdapterDelegate"/>
- </extension>
-</pre>
-</p>
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- Value of the attribute <b>class</b> must be a fully qualified name of a Java class that extends <b>org.eclipse.wst.server.core.model.LaunchableAdapterDelegate</b> and contains a public 0-arg constructor.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2000, 2003 IBM Corporation and others.<br>
-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
-<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/org.eclipse.wst.server.core/schema/moduleArtifactAdapters.exsd b/plugins/org.eclipse.wst.server.core/schema/moduleArtifactAdapters.exsd
deleted file mode 100644
index 0993da3..0000000
--- a/plugins/org.eclipse.wst.server.core/schema/moduleArtifactAdapters.exsd
+++ /dev/null
@@ -1,111 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.server.ui">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.server.ui" id="moduleArtifactAdapters" name="Module Artifact Adapters"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <include schemaLocation="schema://org.eclipse.core.expressions/schema/expressionLanguage.exsd"/>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="moduleArtifactAdapter" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="moduleArtifactAdapter">
- <annotation>
- <appInfo>
- <meta.element labelAttribute="name"/>
- </appInfo>
- </annotation>
- <complexType>
- <sequence>
- <element ref="enablement"/>
- </sequence>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- specifies a unique identifier for this extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string">
- <annotation>
- <documentation>
- specifies the fully qualified name of the Java class that implements <samp>org.eclipse.wst.server.core.model.ModuleArtifactAdapterDelegate</samp>.
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.wst.server.core.model.ModuleArtifactAdapterDelegate"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following is an example of a module object adapter extension point:
-
-<p>
-<pre>
-
-</pre>
-</p>
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- Value of the attribute <b>class</b> must be a fully qualified name of a Java class that extends <b>org.eclipse.wst.server.core.model.ModuleArtifactAdapterDelegate</b> and contains a public 0-arg constructor.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2000, 2003 IBM Corporation and others.<br>
-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
-<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/org.eclipse.wst.server.core/schema/moduleFactories.exsd b/plugins/org.eclipse.wst.server.core/schema/moduleFactories.exsd
deleted file mode 100644
index 8c5fad8..0000000
--- a/plugins/org.eclipse.wst.server.core/schema/moduleFactories.exsd
+++ /dev/null
@@ -1,143 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.server.core">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.server.core" id="moduleFactories" name="Module Factories"/>
- </appInfo>
- <documentation>
- This extension point is used to provide a factory for modules that can be used by servers.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="moduleFactory" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="moduleFactory">
- <annotation>
- <appInfo>
- <meta.element labelAttribute="name"/>
- </appInfo>
- </annotation>
- <complexType>
- <sequence>
- <element ref="moduleType" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- specifies a unique identifier for this extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- specifies the fully qualified name of the Java class that extends <samp>ModuleFactoryDelegate</samp>.
-Module factory instances of this type will delegate to instances of this class.
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.wst.server.core.model.ModuleFactoryDelegate"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="projects" type="boolean">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="order" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="moduleType">
- <complexType>
- <attribute name="types" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="versions" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following is an example of a module factory extension point:
-
-<p>
-<pre>
-
-</pre>
-</p>
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- Value of the attribute <b>class</b> must be a fully qualified name of a Java class that extends <b>org.eclipse.wst.server.core.model.ModuleFactoryDelegate</b> and contains a public 0-arg constructor.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2000, 2003 IBM Corporation and others.<br>
-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
-<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/org.eclipse.wst.server.core/schema/moduleTypes.exsd b/plugins/org.eclipse.wst.server.core/schema/moduleTypes.exsd
deleted file mode 100644
index 21c803c..0000000
--- a/plugins/org.eclipse.wst.server.core/schema/moduleTypes.exsd
+++ /dev/null
@@ -1,110 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.server.core">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.server.core" id="moduleTypes" name="Module Types"/>
- </appInfo>
- <documentation>
- This extension point is used to provide a new module type.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="moduleType" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="moduleType">
- <annotation>
- <appInfo>
- <meta.element labelAttribute="name"/>
- </appInfo>
- </annotation>
- <complexType>
- <sequence>
- </sequence>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- specifies a unique identifier for this extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string" use="required">
- <annotation>
- <documentation>
- a translatable name used to identify the module type
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following is an example of a module type extension point:
-
-<p>
-<pre>
- <extension point="org.eclipse.wst.server.core.moduleTypes">
- <moduleType
- id="com.example"
- name="%moduleTypeName"
- description="%moduleTypeDescription"/>
- </extension>
-</pre>
-</p>
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2000, 2003 IBM Corporation and others.<br>
-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
-<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/org.eclipse.wst.server.core/schema/runtimeLocators.exsd b/plugins/org.eclipse.wst.server.core/schema/runtimeLocators.exsd
deleted file mode 100644
index 1a6b633..0000000
--- a/plugins/org.eclipse.wst.server.core/schema/runtimeLocators.exsd
+++ /dev/null
@@ -1,120 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.server.core">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.server.core" id="runtimeLocators" name="Runtime Locators"/>
- </appInfo>
- <documentation>
- This extension point is used to locate new runtimes on the local machine.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="runtimeLocator" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="runtimeLocator">
- <annotation>
- <appInfo>
- <meta.element labelAttribute="name"/>
- </appInfo>
- </annotation>
- <complexType>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- specifies a unique identifier for this extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- specifies the fully qualified name of the Java class that extends <samp>RuntimeLocatorDelegate</samp>.
-Runtime locator instances of this type will delegate to instances of this class.
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.wst.server.core.model.RuntimeLocatorDelegate"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="typeIds" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following is an example of a runtime locator extension point:
-
-<p>
-<pre>
- <extension point="org.eclipse.wst.server.core.runtimeLocators">
- <runtimeLocator
- id="com.example.locator"
- name="%runtimeLocatorName"
- description="%runtimeLocatorDescription"
- class="com.example.ExampleRuntimeLocator"/>
- </extension>
-</pre>
-</p>
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- Value of the attribute <b>class</b> must be a fully qualified name of a Java class that extends <b>org.eclipse.wst.server.core.model.RuntimeLocatorDelegate</b> and contains a public 0-arg constructor.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2000, 2003 IBM Corporation and others.<br>
-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
-<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/org.eclipse.wst.server.core/schema/runtimeTargetHandlers.exsd b/plugins/org.eclipse.wst.server.core/schema/runtimeTargetHandlers.exsd
deleted file mode 100644
index ec0946f..0000000
--- a/plugins/org.eclipse.wst.server.core/schema/runtimeTargetHandlers.exsd
+++ /dev/null
@@ -1,128 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.server.core">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.server.core" id="runtimeTypes" name="Runtime Types"/>
- </appInfo>
- <documentation>
- This extension point is used to provide a new runtime target handler. Runtime target handlers are called whenever a runtime target is added or removed from a project. They can be used to switch Java classpaths, setup default resources, etc.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="runtimeTargetHandler" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="runtimeTargetHandler">
- <annotation>
- <appInfo>
- <meta.element labelAttribute="name"/>
- </appInfo>
- </annotation>
- <complexType>
- <sequence>
- </sequence>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- specifies a unique identifier for this extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="runtimeTypeIds" type="string" use="required">
- <annotation>
- <documentation>
- a comma separated list of runtime type ids that this handler may support. Used for memory & performance reasons
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- specifies the fully qualified name of the Java class that extends <samp>RuntimeTargetHandlerDelegate</samp>.
-Runtime target handler instances of this type will delegate to instances of this class.
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.wst.server.core.model.RuntimeTargetHandlerDelegate"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="order" type="string">
- <annotation>
- <documentation>
- an integer order used to sort handlers relative to each other
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following is an example of a runtime target handler extension point:
-
-<p>
-<pre>
- <extension point="org.eclipse.wst.server.core.runtimeTargetHandlers">
- <runtimeTargetHandler
- id="com.example.runtimeTargetHandler"
- runtimeTypeIds="com.example.runtime, com.example2.*"
- class="com.example.ExampleRuntimeTargetHandler"/>
- </extension>
-</pre>
-</p>
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- Value of the attribute <b>class</b> must be a fully qualified name of a Java class that extends <b>org.eclipse.wst.server.core.model.RuntimeTargetHandlerDelegate</b> and contains a public 0-arg constructor.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2000, 2003 IBM Corporation and others.<br>
-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
-<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/org.eclipse.wst.server.core/schema/runtimeTypes.exsd b/plugins/org.eclipse.wst.server.core/schema/runtimeTypes.exsd
deleted file mode 100644
index 7c3b18a..0000000
--- a/plugins/org.eclipse.wst.server.core/schema/runtimeTypes.exsd
+++ /dev/null
@@ -1,180 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.server.core">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.server.core" id="runtimeTypes" name="Runtime Types"/>
- </appInfo>
- <documentation>
- This extension point is used to provide a new runtime type.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="runtimeType" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="runtimeType">
- <annotation>
- <appInfo>
- <meta.element labelAttribute="name"/>
- </appInfo>
- </annotation>
- <complexType>
- <sequence>
- <element ref="moduleType" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- specifies a unique identifier for this extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string" use="required">
- <annotation>
- <documentation>
- a translatable name used to identify the runtime type
- </documentation>
- </annotation>
- </attribute>
- <attribute name="description" type="string" use="required">
- <annotation>
- <documentation>
- a translatable description of the runtime type
- </documentation>
- </annotation>
- </attribute>
- <attribute name="vendor" type="string">
- <annotation>
- <documentation>
- a translatable vendor name
- </documentation>
- </annotation>
- </attribute>
- <attribute name="version" type="string">
- <annotation>
- <documentation>
- a translatable version number
- </documentation>
- </annotation>
- </attribute>
- <attribute name="vendorId" type="string">
- <annotation>
- <documentation>
- an id used to identify the vendor
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string">
- <annotation>
- <documentation>
- specifies the fully qualified name of the Java class that extends <samp>RuntimeDelegate</samp>.
-Runtime instances of this type will delegate to instances of this class. Delegates must also have a public 0-arg constructor.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="order" type="string">
- <annotation>
- <documentation>
- an integer order specifying the relative importance of this runtime
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="moduleType">
- <complexType>
- <attribute name="types" type="string" use="required">
- <annotation>
- <documentation>
- a comma separated list of the module types that this runtime supports
- </documentation>
- </annotation>
- </attribute>
- <attribute name="versions" type="string" use="required">
- <annotation>
- <documentation>
- a comma separated list of the module versions that this runtime supports
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following is an example of a runtime type extension point:
-
-<p>
-<pre>
- <extension point="org.eclipse.wst.server.core.runtimeTypes">
- <runtimeType
- id="com.example.runtime"
- name="%runtimeTypeName"
- description="%runtimeTypeDescription"
- vendor="%runtimeTypeVendor"
- version="1.0"
- class="com.example.ExampleRuntimeDelegate">
- <moduleType
- types="j2ee.web"
- versions="1.2, 1.3, 1.4"/>
- </runtimeType>
- </extension>
-</pre>
-</p>
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- Value of the attribute <b>class</b> must be a fully qualified name of a Java class that extends <b>org.eclipse.wst.server.core.model.RuntimeDelegate</b> and contains a public 0-arg constructor.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2000, 2003 IBM Corporation and others.<br>
-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
-<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/org.eclipse.wst.server.core/schema/serverLocators.exsd b/plugins/org.eclipse.wst.server.core/schema/serverLocators.exsd
deleted file mode 100644
index 82cd3ec..0000000
--- a/plugins/org.eclipse.wst.server.core/schema/serverLocators.exsd
+++ /dev/null
@@ -1,127 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.server.core">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.server.core" id="serverLocators" name="Server Locators"/>
- </appInfo>
- <documentation>
- This extension point is used to locate new servers on the local or remote machines.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="serverLocator" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="serverLocator">
- <annotation>
- <appInfo>
- <meta.element labelAttribute="name"/>
- </appInfo>
- </annotation>
- <complexType>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- specifies a unique identifier for this extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- specifies the fully qualified name of the Java class that implements <samp>ServerLocatorDelegate</samp>.
-Server locator instances of this type will delegate to instances of this class.
- </documentation>
- <appInfo>
- <meta.attribute kind="java"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="supportsRemoteHosts" type="string" use="required">
- <annotation>
- <documentation>
- local and/or remote
- </documentation>
- </annotation>
- </attribute>
- <attribute name="typeIds" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following is an example of a server locator extension point:
-
-<p>
-<pre>
- <extension point="org.eclipse.wst.server.core.serverLocators">
- <serverLocator
- id="com.example.locator"
- name="%serverLocatorName"
- description="%serverLocatorDescription"
- class="com.example.ExampleServerLocator"/>
- </extension>
-</pre>
-</p>
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- Value of the attribute <b>class</b> must be a fully qualified name of a Java class that implements the interface <b>org.eclipse.wst.server.core.model.ServerLocatorDelegate</b>.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2000, 2003 IBM Corporation and others.<br>
-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
-<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/org.eclipse.wst.server.core/schema/serverMonitors.exsd b/plugins/org.eclipse.wst.server.core/schema/serverMonitors.exsd
deleted file mode 100644
index eef073e..0000000
--- a/plugins/org.eclipse.wst.server.core/schema/serverMonitors.exsd
+++ /dev/null
@@ -1,124 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.server.core">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.server.core" id="internalServerMonitor" name="Server Monitor"/>
- </appInfo>
- <documentation>
- This extension point is used to provide a new monitor for servers.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="monitor" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="monitor">
- <annotation>
- <appInfo>
- <meta.element labelAttribute="name"/>
- </appInfo>
- </annotation>
- <complexType>
- <sequence>
- </sequence>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- specifies a unique identifier for this extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- a translatable name used to identify this monitor
- </documentation>
- </annotation>
- </attribute>
- <attribute name="description" type="string">
- <annotation>
- <documentation>
- a translatable description of this monitor
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- specifies the fully qualified name of the Java class that implements <samp>org.eclipse.wst.server.core.internal.ServerMonitorDelegate</samp>
-
-This extension point is internal and should not be used by any other plugins.
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.wst.server.core.internal.ServerMonitorDelegate"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following is an example of a server monitor extension point:
-
-<p>
-<pre>
-
-</pre>
-</p>
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- Value of the attribute <b>class</b> must be a fully qualified name of a Java class that implements the interface <b>org.eclipse.wst.server.core.internal.ServerMonitorDelegate</b>.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2000, 2003 IBM Corporation and others.<br>
-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
-<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/org.eclipse.wst.server.core/schema/serverTasks.exsd b/plugins/org.eclipse.wst.server.core/schema/serverTasks.exsd
deleted file mode 100644
index c769e81..0000000
--- a/plugins/org.eclipse.wst.server.core/schema/serverTasks.exsd
+++ /dev/null
@@ -1,116 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.server.core">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.server.core" id="serverTasks" name="Server Tasks"/>
- </appInfo>
- <documentation>
- This extension point is used to provide a task that can/should be run before server publishing, startup, etc.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="serverTask" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="serverTask">
- <annotation>
- <appInfo>
- <meta.element labelAttribute="name"/>
- </appInfo>
- </annotation>
- <complexType>
- <sequence>
- </sequence>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- specifies a unique identifier for this extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- specifies the fully qualified name of the Java class that implements <samp>org.eclipse.wst.server.core.model.ServerTaskDelegate</samp>.
-Server task instances of this type will delegate to instances of this class.
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.wst.server.core.model.ServerTaskDelegate"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="typeIds" type="string" use="required">
- <annotation>
- <documentation>
- a comma separated list of server type ids that this task may apply to. Used for memory & performance reasons
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following is an example of a server task extension point:
-
-<p>
-<pre>
-
-</pre>
-</p>
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- Value of the attribute <b>class</b> must be a fully qualified name of a Java class that implements the interface <b>org.eclipse.wst.server.core.model.ServerTaskDelegate</b>.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2000, 2003 IBM Corporation and others.<br>
-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
-<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/org.eclipse.wst.server.core/schema/serverTypes.exsd b/plugins/org.eclipse.wst.server.core/schema/serverTypes.exsd
deleted file mode 100644
index 4838bb7..0000000
--- a/plugins/org.eclipse.wst.server.core/schema/serverTypes.exsd
+++ /dev/null
@@ -1,230 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.server.core">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.server.core" id="serverTypes" name="Server Types"/>
- </appInfo>
- <documentation>
- This extension point is used to provide support for a new server type.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="serverType"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="serverType">
- <complexType>
- <sequence>
- </sequence>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string" use="required">
- <annotation>
- <documentation>
- a translatable name used to identify this server type
- </documentation>
- </annotation>
- </attribute>
- <attribute name="description" type="string" use="required">
- <annotation>
- <documentation>
- a translatable description of this server type
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- specifies the fully qualified name of the Java class that extends <samp>org.eclipse.wst.server.core.model.ServerDelegate</samp>.
-Server instances of this type will delegate to instances of this class. Delegates must also have a public 0-arg constructor.
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.wst.server.core.model.ServerDelegate"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="behaviourClass" type="string">
- <annotation>
- <documentation>
- specifies the fully qualified name of the Java class that implements <samp>org.eclipse.wst.server.core.model.ServerBehaviourDelegate</samp>.
-Server instances of this type will delegate to instances of this class. Delegates must also have a public 0-arg constructor.
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.wst.server.core.model.ServerBehaviourDelegate"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="hasConfiguration" type="boolean">
- <annotation>
- <documentation>
- true if this server has server configuration files
- </documentation>
- </annotation>
- </attribute>
- <attribute name="runtimeTypeId" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="startable" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="order" type="string">
- <annotation>
- <documentation>
- an integer order specifying the relative importance of this server type
- </documentation>
- </annotation>
- </attribute>
- <attribute name="launchConfigId" type="string">
- <annotation>
- <documentation>
- the launch configuration id for the launch configuration that is able to start this server
- </documentation>
- </annotation>
- </attribute>
- <attribute name="supportsRemoteHosts" type="string">
- <annotation>
- <documentation>
- true if this server type can work with remote host names, false if this server type can only work on localhost. if unspecified, false is assumed
- </documentation>
- </annotation>
- </attribute>
- <attribute name="runtime" type="string">
- <annotation>
- <documentation>
- "true" if this server requires a runtime, "false" otherwise
- </documentation>
- </annotation>
- </attribute>
- <attribute name="launchModes" type="string">
- <annotation>
- <documentation>
- the launch modes that this server supports
- </documentation>
- </annotation>
- </attribute>
- <attribute name="initialState" type="string">
- <annotation>
- <documentation>
- the intial state of the server, either "started", or "stopped". if this attribute is not specified, the server state will be "unknown"
- </documentation>
- </annotation>
- </attribute>
- <attribute name="stateSet" type="string">
- <annotation>
- <documentation>
- the state set of the server (changes menu options and UI). values are "managed", "attach", and "publish"
- </documentation>
- </annotation>
- </attribute>
- <attribute name="startTimeout" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="stopTimeout" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following is an example of a server type extension point:
-
-<p>
-<pre>
-<extension point="org.eclipse.wst.server.core.serverTypes">
- <serverType
- id="com.example.serverType"
- name="%serverTypeName"
- description="%serverTypeDescription"
- hosts="localhost, remote"
- runtime="true"
- monitorable="true"
- initialState="stopped"
- configurationTypeId="com.example.serverConfiguration"
- launchConfigId="com.example.launchConfigurationType"
- runtimeTypeId="com.example.runtime"
- class="com.example.ExampleServerDelegate"
- workingCopyClass="com.example.ExampleServerWorkingCopyDelegate">
- </serverType>
- </extension>
-</pre>
-</p>
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- Value of the attribute <b>class</b> must be a fully qualified name of a Java class that extends the abstract class <b>org.eclipse.wst.server.core.model.ServerDelegate</b> and has a public 0-arg constructor.
-
-Value of the attribute <b>behaviourClass</b> must be a fully qualified name of a Java class that extends the abstract class <b>org.eclipse.wst.server.core.model.ServerBehaviourDelegate</b> and has a public 0-arg constructor.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2000, 2003 IBM Corporation and others.<br>
-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
-<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/org.eclipse.wst.server.core/schema/startup.exsd b/plugins/org.eclipse.wst.server.core/schema/startup.exsd
deleted file mode 100644
index c419faf..0000000
--- a/plugins/org.eclipse.wst.server.core/schema/startup.exsd
+++ /dev/null
@@ -1,116 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.server.core">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.server.core" id="internalStartup" name="Startup"/>
- </appInfo>
- <documentation>
- This extension point provides a way to invoke code during the server core plugin startup. Use sparingly.
-
-This extension point is internal and should not be used by any other plugins.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="startup" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="startup">
- <annotation>
- <appInfo>
- <meta.element labelAttribute="name"/>
- </appInfo>
- </annotation>
- <complexType>
- <sequence>
- </sequence>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- specifies a unique identifier for this extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- specifies the fully qualified name of the Java class that extends <samp>org.eclipse.wst.server.core.internal.IStartup</samp>.
-
-This extension point is internal and should not be used by any other plugins.
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.wst.server.core.internal.IStartup"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following is an example of a startup extension point:
-
-<p>
-<pre>
- <extension point="org.eclipse.wst.server.core.startup">
- <startup
- id="com.example.startup"
- class="com.example.ExampleStartup"/>
- </extension>
-</pre>
-</p>
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- Value of the attribute <b>class</b> must be a fully qualified name of a Java class that extends <b>org.eclipse.wst.server.core.model.IStartup</b> and contains a public 0-arg constructor.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2000, 2003 IBM Corporation and others.<br>
-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
-<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/ILaunchable.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/ILaunchable.java
deleted file mode 100644
index 1416df2..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/ILaunchable.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.core;
-/**
- * A launchable is a "reference" to a module artifact. The
- * module artifact is the actual resource on the server; the
- * launchable is the information necessary to access that
- * resource. Examples may include HTTP requests and JNDI names.
- *
- * [issue: rename to avoid confusion with debug.ui.ILaunchable]
- *
- * @since 1.0
- */
-public interface ILaunchable {
- // no content
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IModule.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IModule.java
deleted file mode 100644
index 7e96ca5..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IModule.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.core;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.wst.server.core.model.IModuleListener;
-/**
- * A module is a unit of "content" that can be published to a
- * server.
- * <p>
- * All modules have a module type, which is fixed for the
- * lifetime of the module. The set of module types (or
- * "kinds") is open-ended.
- * </p>
- * <p>
- * All modules are created by module factories using the moduleFactories
- * extension point.
- * </p>
- * <p>
- * The content of a module is a collection of file and folder
- * resources in the workspace.
- * </p>
- * <p>
- * In principle, a module exists independent of any
- * particular server. The same module instance can be associated
- * with multiple server instances at the same time. That is
- * why you cannot ask the module which server it's associated
- * with.
- * </p>
- * <p>
- * [issue: Equality/identify for modules?]
- * </p>
- * <p>
- * Concrete module types are represented by concrete classes
- * implementing this interface. The only legitimate reason
- * to declare a subclass is to implement a module factory.
- * </p>
- * <p>
- * <it>Caveat: The server core API is still in an early form, and is
- * likely to change significantly before the initial release.</it>
- * </p>
- *
- * @since 1.0
- */
-public interface IModule extends IAdaptable {
- /**
- * Returns the id of this module.
- * Each module has a distinct id, used to distinguish this
- * module from all other modules in the workspace (and
- * within a server). Ids are intended to be used internally
- * as keys; they are not intended to be shown to end users.
- *
- * @return the module id
- */
- public String getId();
-
- /**
- * Returns the displayable name for this module.
- * <p>
- * Note that this name is appropriate for the current locale.
- * </p>
- *
- * @return a displayable name for this module
- */
- public String getName();
-
- /**
- * Returns the type of this module.
- *
- * @return the module type
- */
- public IModuleType getModuleType();
-
- /**
- * Returns whether this module currently exists.
- * <p>
- * [issue: The method touches on the important problem
- * of when a module ceases to exist. Need to explain
- * the full lifecycle of a module.
- * Should it be synonymous with the module root
- * IContainer.exists()? That is, the module exists
- * as long as the IContainer that holds all its module
- * resources exists()?]
- * </p>
- *
- * @return <code>true</code> this module currently exists, and
- * <code>false</code> if it has been deleted or moved
- */
- //public boolean exists();
-
- /**
- * Returns the workbench project that this module is contained in,
- * or null if the module is outside of the workspace.
- *
- * @return org.eclipse.core.resources.IProject
- */
- public IProject getProject();
-
- /**
- * Add a listener for child modules that are added/removed from this
- * module.
- * Has no effect if an identical listener is already registered.
- *
- * @param listener org.eclipse.wst.server.core.model.IModuleListener
- */
- public void addModuleListener(IModuleListener listener);
-
- /**
- * Add a listener for child modules that are added/removed from this
- * module.
- * Has no effect if the listener is not registered.
- *
- * @param listener org.eclipse.wst.server.core.model.IModuleListener
- */
- public void removeModuleListener(IModuleListener listener);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IModuleArtifact.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IModuleArtifact.java
deleted file mode 100644
index f52307e..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IModuleArtifact.java
+++ /dev/null
@@ -1,30 +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.core;
-/**
- * A module artifact is a resource within a module, which can be launched
- * on the server. Examples of module artifacts are servlets, HTML pages,
- * or EJB beans.
- * <p>
- * Objects that provide an adapter of this type will be considered by the
- * contextual Run on Server launch support.
- * </p>
- *
- * @since 1.0
- */
-public interface IModuleArtifact {
- /**
- * Returns the module that this artifact is a part of.
- *
- * @return the module that this artifact is contained in
- */
- public IModule getModule();
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IModuleType.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IModuleType.java
deleted file mode 100644
index 2dcb5b3..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IModuleType.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.core;
-/**
- * Represents the type of a module.
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- * <p>
- * <it>Caveat: The server core API is still in an early form, and is
- * likely to change significantly before the initial release.</it>
- * </p>
- *
- * @since 1.0
- */
-public interface IModuleType {
- /**
- * Returns the module type id.
- *
- * @return the module type id
- */
- public String getId();
-
- /**
- * Returns the displayable name for this module type.
- * <p>
- * Note that this name is appropriate for the current locale.
- * </p>
- *
- * @return a displayable name for this module type
- */
- public String getName();
-
- /**
- * Returns the version (spec level), e.g., "1.0", "1.3.2".
- * <p>
- * [issue: This notion of a module type "version" appears here.
- * There is no counterpart elsewhere (and certainly not in
- * IModuleType). The phrase "spec level" suggests something
- * a little more J2EE-centric (what would be the spec level for
- * a static html web module?) It feels like this should be folded
- * in to the module type/kind id.]
- * </p>
- * <p>
- * [issue: Spec format of version string?]
- * </p>
- *
- * @return the version
- */
- public String getVersion();
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IOptionalTask.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IOptionalTask.java
deleted file mode 100644
index 09a29a7..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IOptionalTask.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.core;
-/**
- * An optional task.
- *
- * [issue: EY It is not clear to me that when this task will be run. Is this task be used for
- * both the server task and the module task? Will the place where the
- * task is being run depends on the server, e.g. the TDC tasks for the v6 server should be run
- * after the server is started the modules are added to the server; however, the EJB deploy task
- * makes more sense to be run before adding the project to the server.]
- *
- * @since 1.0
- */
-public interface IOptionalTask extends ITask {
- /**
- * Optional task status constant (value 0) indicating that the task
- * should not be run.
- *
- * @see #getStatus()
- */
- public static final int TASK_UNNECESSARY = 0;
- /**
- * Optional task status constant (value 1) indicating that the task
- * is completed.
- *
- * @see #getStatus()
- */
- public static final int TASK_COMPLETED = 1;
- /**
- * Optional task status constant (value 2) indicating that the task
- * is ready to be run.
- *
- * @see #getStatus()
- */
- public static final int TASK_READY = 2;
- /**
- * Optional task status constant (value 3) indicating that the task
- * should be selected to be run by default.
- *
- * @see #getStatus()
- */
- public static final int TASK_PREFERRED = 3;
- /**
- * Optional task status constant (value 4) indicating that the task
- * must be run.
- *
- * @see #getStatus()
- */
- public static final int TASK_MANDATORY = 4;
-
- /**
- * Returns the status of this task.
- *
- * issue: EY Should this status can return any of the TASK_XXX? The TASK_XXX looks
- * like a mix of status, e.g. for TASK_COMPLETED and TASK_READY. The other TASK_XXX
- * look like a nature of the task, e.g. TASK_UNNECESSARY, TASK_PREFERRED, TASK_MANDATORY.
- * Is this being used for both status and deciding whether the task should be shown?
- *
- * @return one of the status of the task (<code>TASK_XXX</code>)
- * constants declared on {@link IOptionalTask}
- */
- public int getStatus();
-
- /**
- * Returns the order (index/priority) of the task that will be run. The task with
- * a smaller order value will be run before the task with a bigger order value.
- * For tasks that have the same order value, the order of running those task are
- * not guaranteed.
- *
- * @return the order (index/priority) of the task that will be run.
- */
- public int getOrder();
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IProjectProperties.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IProjectProperties.java
deleted file mode 100644
index 75af19c..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IProjectProperties.java
+++ /dev/null
@@ -1,105 +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.core;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-/**
- * This interface holds information on the properties of a given project.
- *
- * <p>This interface is not intended to be implemented by clients.</p>
- *
- * @see IProjectPropertiesListener
- * @since 1.0
- */
-public interface IProjectProperties {
- /**
- * Returns the preferred runtime server for the project. This method
- * returns null if the server was never chosen or does not currently exist. (if the
- * server is recreated or was in a closed project, etc. this method will return
- * the original value if it becomes available again)
- *
- * @return the current default server, or <code>null</code> if there is no
- * default server
- */
- public IServer getDefaultServer();
-
- /**
- * Sets the preferred runtime server for the project. Set the server to
- * null to clear the setting. If there is a problem saving the file, a CoreException
- * will be thrown.
- *
- * @param server the server to set the default server, or <code>null</code>
- * to unset the default
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @throws CoreException if there is a problem setting the default server
- */
- public void setDefaultServer(IServer server, IProgressMonitor monitor) throws CoreException;
-
- /**
- * Returns the current runtime target for this project.
- *
- * @return the current runtime target, or <code>null</code> if the project has
- * no runtime target
- */
- public IRuntime getRuntimeTarget();
-
- /**
- * Sets the runtime target for the project.
- *
- * @param runtime the runtime to use as the target, or <code>null</code> to
- * unset the target
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @throws CoreException if there is a problem setting the runtime target
- */
- public void setRuntimeTarget(IRuntime runtime, IProgressMonitor monitor) throws CoreException;
-
- /**
- * Returns <code>true</code> if this project can contain server artifacts, and
- * <code>false</code> otherwise.
- *
- * @return <code>true</code> if this project can contain server artifacts, and
- * <code>false</code> otherwise
- */
- //public boolean isServerProject();
-
- /**
- * Sets whether the project can contain server resources.
- *
- * @param sp <code>true</code> to allow the project to contain server
- * resources, or <code>false</code> to not allow the project to contain
- * servers
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @throws CoreException if there is a problem setting the server project
- */
- //public void setServerProject(boolean sp, IProgressMonitor monitor) throws CoreException;
-
- /**
- * Adds a new project properties listener.
- * Has no effect if an identical listener is already registered.
- *
- * @param listener the properties listener
- * @see #removeProjectPropertiesListener(IProjectPropertiesListener)
- */
- public void addProjectPropertiesListener(IProjectPropertiesListener listener);
-
- /**
- * Removes an existing project properties listener.
- * Has no effect if the listener is not registered.
- *
- * @param listener the properties listener
- * @see #addProjectPropertiesListener(IProjectPropertiesListener)
- */
- public void removeProjectPropertiesListener(IProjectPropertiesListener listener);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IProjectPropertiesListener.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IProjectPropertiesListener.java
deleted file mode 100644
index 4418aa2..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IProjectPropertiesListener.java
+++ /dev/null
@@ -1,47 +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.core;
-
-import org.eclipse.core.resources.IProject;
-/**
- * A project properties listener. Fires events when the default server or
- * runtime target changes.
- * <p>
- * This interface should be used for informational purposes only. If (e.g.)
- * you have code that needs to respond to a specific runtime target, you should
- * use the runtimeTargetHandler extension point. The extension point will allow
- * your code to be automatically loaded when necessary (instead of having to
- * preload and add a listener), will not cause unnecessary plugin loading, and
- * will allow ordering of setting/unsetting the runtime target.
- * </p>
- *
- * @see IProjectProperties
- * @since 1.0
- */
-public interface IProjectPropertiesListener {
- /**
- * Fired when the default server for the project changes.
- *
- * @param project the project that has changed
- * @param server the new default server, or <code>null</code> if the default
- * server has been removed
- */
- public void defaultServerChanged(IProject project, IServer server);
-
- /**
- * Fired when the runtime target for the project changes.
- *
- * @param project the project that has changed
- * @param runtime the new runtime target, or <code>null</code> if the runtime
- * target has been removed
- */
- public void runtimeTargetChanged(IProject project, IRuntime runtime);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IRuntime.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IRuntime.java
deleted file mode 100644
index f9eea9b..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IRuntime.java
+++ /dev/null
@@ -1,208 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.core;
-
-import org.eclipse.core.runtime.*;
-/**
- * Represents a runtime instance. Every runtime is an instance of a
- * particular, fixed runtime type.
- * <p>
- * Servers have a runtime. The server runtime corresponds to the
- * installed code base for the server. The main role played by the server
- * runtime is in identifying code libraries to compile or build against.
- * In the case of local servers, the server runtime may play a secondary role
- * of being used to launch the server for testing. Having the server runtimes
- * identified as an entity separate from the server itself facilitates sharing
- * server runtimes between several servers.
- * </p>
- * <p>
- * IRuntime implements IAdaptable to allow users to obtain a runtime-type-specific
- * class. By casting the runtime extension to the type prescribed in the API
- * documentation for that particular runtime type, the client can access
- * runtime-type-specific properties and methods. getAdapter() may involve plugin
- * loading, and should not be called from popup menus, etc.
- * </p>
- * <p>
- * [issue: As mentioned in IRuntimeType, the term "runtime"
- * is misleading, given that the main reason is for build time classpath
- * contributions, not for actually running anything. "libraries" might be a
- * better choice.]
- * </p>
- * <p>
- * The server framework maintains a global list of all known runtime instances
- * ({@link ServerCore#getRuntimes()}).
- * </p>
- * <p>
- * All runtimes have a unique id. Two runtimes (or more likely a runtime and it's
- * working copy) with the same id are equal, and two runtimes with different ids
- * are never equal.
- * </p>
- *
- * [issue: Why are attributes exposed? The attribute ids and
- * values are passed to property change listeners. However,
- * they are not useful unless there is a spec'd correlation
- * between methods like getName and an attribute "name". The
- * constants are declared on Base, which is internal.]
- * <p>
- * Two runtimes are identical if and only if they have the same id.
- * </p>
- * <p>This interface is not intended to be implemented by clients.</p>
- * <p>
- * <it>Caveat: The server core API is still in an early form, and is
- * likely to change significantly before the initial release.</it>
- * </p>
- *
- * @see IRuntimeWorkingCopy
- * @since 1.0
- */
-public interface IRuntime extends IAdaptable {
- /**
- * Returns the displayable name for this runtime.
- * <p>
- * Note that this name is appropriate for the current locale.
- * </p>
- *
- * @return a displayable name
- */
- public String getName();
-
- /**
- * Returns the id of this runtime.
- * Each runtime (of a given type) has a distinct id, fixed for
- * its lifetime. Ids are intended to be used internally as keys;
- * they are not intended to be shown to end users.
- *
- * @return the runtime id
- */
- public String getId();
-
- /**
- * Deletes the persistent representation of this runtime.
- *
- * @throws CoreException if there was any error received while deleting the runtime
- */
- public void delete() throws CoreException;
-
- /**
- * Returns whether this runtime is marked read only.
- * When a runtime is read only, working copies can be created but
- * they cannot be saved.
- *
- * @return <code>true</code> if this runtime is marked as read only,
- * and <code>false</code> otherwise
- */
- public boolean isReadOnly();
-
- /**
- * Returns <code>true</code> if this runtime is private (not shown
- * in the UI to the users), and <code>false</code> otherwise.
- *
- * @return <code>true</code> if this runtime is private,
- * and <code>false</code> otherwise
- */
- public boolean isPrivate();
-
- /**
- * Returns true if this is a working copy.
- *
- * @return <code>true</code> if this runtime is a working copy
- * (can be cast to IRuntimeWorkingCopy), and
- * <code>false</code> otherwise
- */
- public boolean isWorkingCopy();
-
- /**
- * Returns true if the delegate has been loaded.
- *
- * @return <code>true</code> if the delegate is loaded, and <code>false</code>
- * otherwise
- */
- public boolean isDelegateLoaded();
-
- /**
- * Returns the timestamp of this runtime.
- * Timestamps are monotonically increased each time the runtime is saved
- * and can be used to determine if any changes have been made on disk
- * since the runtime was loaded.
- *
- * @return the runtime's timestamp
- */
- public int getTimestamp();
-
- /**
- * Returns the type of this runtime instance.
- *
- * @return the runtime type
- */
- public IRuntimeType getRuntimeType();
-
- /**
- * Returns a runtime working copy for modifying this runtime instance.
- * If this instance is already a working copy, it is returned.
- * If this instance is not a working copy, a new runtime working copy
- * is created with the same id and attributes.
- * Clients are responsible for saving or releasing the working copy when
- * they are done with it.
- * <p>
- * The runtime working copy is related to this runtime instance
- * in the following ways:
- * <pre>
- * this.getWorkingCopy().getId() == this.getId()
- * this.getWorkingCopy().getOriginal() == this
- * </pre>
- * </p>
- * <p>
- * [issue: IRuntimeWorkingCopy extends IRuntime.
- * Runtime.getWorkingCopy() create a new working copy;
- * RuntimeWorkingCopy.getWorkingCopy() returns this.
- * This may be convenient in code that is ignorant of
- * whether they are dealing with a working copy or not.
- * However, it is hard for clients to manage working copies
- * with this design.
- * </p>
- *
- * @return a new working copy
- */
- public IRuntimeWorkingCopy createWorkingCopy();
-
- /**
- * Returns the absolute path in the local file system to the root of the runtime,
- * typically the installation directory.
- *
- * @return the location of this runtime, or <code>null</code> if none
- */
- public IPath getLocation();
-
- /**
- * Returns whether this runtime is a stub (used for compilation only)
- * or a full runtime.
- *
- * @return <code>true</code> if this runtime is a stub, and
- * <code>false</code> otherwise
- */
- public boolean isStub();
-
- /**
- * Validates this runtime instance. This method returns an error if the runtime
- * is pointing to a null or invalid location (e.g. not pointing to the correct
- * installation directory), or if the runtime-type-specific properties are missing
- * or invalid.
- * <p>
- * This method is not on the working copy so that the runtime can be validated at
- * any time.
- * </p>
- *
- * @return a status object with code <code>IStatus.OK</code> if this
- * runtime is valid, otherwise a status object indicating what is
- * wrong with it
- */
- public IStatus validate(IProgressMonitor monitor);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IRuntimeLifecycleListener.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IRuntimeLifecycleListener.java
deleted file mode 100644
index 2d7a009..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IRuntimeLifecycleListener.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.core;
-/**
- * Listener interface for runtime changes.
- *
- * @since 1.0
- */
-public interface IRuntimeLifecycleListener {
- /**
- * A new runtime has been created.
- *
- * @param runtime org.eclipse.wst.server.core.IRuntime
- */
- public void runtimeAdded(IRuntime runtime);
-
- /**
- * An existing runtime has been updated or modified.
- *
- * @param runtime org.eclipse.wst.server.core.IRuntime
- */
- public void runtimeChanged(IRuntime runtime);
-
- /**
- * A existing runtime has been removed.
- *
- * @param runtime org.eclipse.wst.server.core.IRuntime
- */
- public void runtimeRemoved(IRuntime runtime);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IRuntimeTargetHandler.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IRuntimeTargetHandler.java
deleted file mode 100644
index ae92015..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IRuntimeTargetHandler.java
+++ /dev/null
@@ -1,69 +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.core;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-/**
- * A runtime target handler is used to apply some properties to a project
- * this is being targeted to a given runtime. For instance, the handler
- * might update the classpath of a Java project to include the runtime's
- * classes, add validation for the given runtime, or restrict the type of
- * resources that can be created.
- *
- * <p>This interface is not intended to be implemented by clients.</p>
- *
- * @since 1.0
- */
-public interface IRuntimeTargetHandler extends IAdaptable {
- /**
- * Returns the id of this runtime target handler.
- * Each known runtime target handler has a distinct id.
- * Ids are intended to be used internally as keys; they are not
- * intended to be shown to end users.
- *
- * @return the runtime target handler id
- */
- public String getId();
-
- /**
- * Returns <code>true</code> if this runtime target handler supports
- * (can work with) the given runtime.
- *
- * @param runtimeType a runtime type
- * @return <code>true</code> if the handler can accept the given runtime type,
- * and <code>false</code> otherwise
- */
- public boolean supportsRuntimeType(IRuntimeType runtimeType);
-
- /**
- * Set the runtime target on the given project.
- *
- * @param project
- * @param runtime
- * @param monitor
- * @throws CoreException
- */
- public void setRuntimeTarget(IProject project, IRuntime runtime, IProgressMonitor monitor) throws CoreException;
-
- /**
- * Remove the runtime target from the given project. This method will undo
- * all changes made in setRuntimeTarget().
- *
- * @param project
- * @param runtime
- * @param monitor
- * @throws CoreException
- */
- public void removeRuntimeTarget(IProject project, IRuntime runtime, IProgressMonitor monitor) throws CoreException;
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IRuntimeType.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IRuntimeType.java
deleted file mode 100644
index bdb4564..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IRuntimeType.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.core;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-/**
- * Represents a (server) runtime type from which runtime instances can be
- * created.
- * <p>
- * The server core framework supports
- * an open-ended set of runtime types, which are contributed via
- * the <code>runtimeTypes</code> extension point in the server core
- * plug-in. Runtime type objects carry no state (all information is
- * read-only and is supplied by the server runtime type declaration).
- * The global list of known runtime types is available via
- * {@link ServerCore#getRuntimeTypes()}.
- * </p>
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- * <p>
- * [issue: The term "runtime" is misleading, given that the main
- * reason is for build time classpath contributions, not for actually
- * running anything. "libraries" might be a better choice.]
- * </p>
- * <p>
- * [issue: What value do runtimes add?
- * It's main role is for setting up the Java build classpath
- * for projects holding modules that must be Java compiled.
- * If the notion of module is to transcend the vagaries of particular
- * types of server, and, indeed, be published to multiple servers
- * simultaneously, then matters of build classpath had better not
- * be tied to the particular servers involved.]
- * </p>
- * <p>
- * Two runtime types are identical if and only if they have the same id.
- * </p>
- * <p>
- * <it>Caveat: The server core API is still in an early form, and is
- * likely to change significantly before the initial release.</it>
- * </p>
- *
- * @since 1.0
- */
-public interface IRuntimeType {
- /**
- * Returns the id of this runtime type.
- * Each known server runtime type has a distinct id.
- * Ids are intended to be used internally as keys; they are not
- * intended to be shown to end users.
- *
- * @return the runtime type id
- */
- public String getId();
-
- /**
- * Returns the displayable name for this runtime type.
- * <p>
- * Note that this name is appropriate for the current locale.
- * </p>
- *
- * @return a displayable name for this runtime type
- */
- public String getName();
-
- /**
- * Returns the displayable description for this runtime type.
- * <p>
- * Note that this description is appropriate for the current locale.
- * </p>
- *
- * @return a displayable description for this runtime type
- */
- public String getDescription();
-
- /**
- * Returns the displayable vendor name for this runtime type. If the
- * runtime type did not specific a vendor, an empty string is returned.
- * <p>
- * Note that this description is appropriate for the current locale.
- * </p>
- *
- * @return a displayable vendor name for this runtime type
- */
- public String getVendor();
-
- /**
- * Returns the displayable version name for this runtime type. If the
- * runtime type did not specific a vendor, an empty string is returned.
- * <p>
- * Note that this description is appropriate for the current locale.
- * </p>
- *
- * @return a displayable version name for this runtime type
- */
- public String getVersion();
-
- /**
- * Returns an array of module types that this runtime type can support.
- * <p>
- * A new array is returned on each call, so clients may store or modify the result.
- * </p>
- *
- * @return the array of module types {@link IModuleType}
- */
- public IModuleType[] getModuleTypes();
-
- /**
- * Returns whether this runtime type can be instantiated.
- * <p>
- * [issue: It's unclear what this method is for.
- * The implementation checks whether the "class"
- * and "workingCopyClass" attributes (both optional) were specified.
- * What would be the point of a runtime type that didn't
- * have both of these attributes and could not be "created"?]
- * </p>
- *
- * @return <code>true</code> if this type of runtime can be
- * instantiated, and <code>false</code> if it cannot
- * @see #createRuntime(String, IProgressMonitor)
- */
- public boolean canCreate();
-
- /**
- * Creates a working copy instance of this runtime type.
- * After setting various properties of the working copy,
- * the client should call {@link IRuntimeWorkingCopy#save(boolean, IProgressMonitor)}
- * to bring the runtime instance into existence.
- * <p>
- * Default values are set by calling the instance's delegate.
- * Clients should assume that the location and other properties are
- * not set and must be explicitly set by the client.
- * </p>
- *
- * @param id the id to assign to the runtime instance; a generated
- * id is used if id is <code>null</code> or an empty string
- * @return a new runtime working copy with the given id
- * @throws CoreException if an exception occurs while creating this runtime
- * or setting it's default values
- */
- public IRuntimeWorkingCopy createRuntime(String id, IProgressMonitor monitor) throws CoreException;
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IRuntimeWorkingCopy.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IRuntimeWorkingCopy.java
deleted file mode 100644
index cba8e1f..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IRuntimeWorkingCopy.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.core;
-
-import java.beans.PropertyChangeListener;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-/**
- * A working copy runtime object used for formulating changes
- * to a runtime instance ({@link IRuntime}). Changes made on a
- * working copy do not occur (and are not persisted) until a
- * save() is performed.
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- * <p>
- * <it>Caveat: The server core API is still in an early form, and is
- * likely to change significantly before the initial release.</it>
- * </p>
- *
- * @see IRuntime
- * @since 1.0
- */
-public interface IRuntimeWorkingCopy extends IRuntime {
- public static final int TIMESTAMP_ERROR = 5;
-
- /**
- * Sets the displayable name for this runtime.
- * <p>
- * The name should be appropriate for the current locale.
- * </p>
- *
- * @param name a displayable name
- * @see IRuntime#getName()
- */
- public void setName(String name);
-
- /**
- * Sets or unsets whether this runtime is marked as read only.
- * When a runtime is read only, working copies can be created but
- * they cannot be saved.
- *
- * @param readOnly <code>true</code> to set this runtime to be marked
- * read only, and <code>false</code> to unset
- */
- public void setReadOnly(boolean readOnly);
-
- /**
- * Sets whether this runtime is private.
- * Generally speaking, runtimes marked private are internal ones
- * that should not be shown to users (because they won't know
- * anything about them).
- *
- * @param p <code>true</code> if this runtime is private,
- * and <code>false</code> otherwise
- * @see IRuntime#isPrivate()
- */
- public void setPrivate(boolean p);
-
- /**
- * Returns whether this working copy has unsaved changes.
- *
- * @return <code>true</code> if this working copy has unsaved
- * changes, and <code>false</code> otherwise
- */
- public boolean isDirty();
-
- /**
- * Adds a property change listener to this server.
- *
- * @param listener java.beans.PropertyChangeListener
- */
- public void addPropertyChangeListener(PropertyChangeListener listener);
-
- /**
- * Removes a property change listener from this server.
- *
- * @param listener java.beans.PropertyChangeListener
- */
- public void removePropertyChangeListener(PropertyChangeListener listener);
-
- /**
- * Fires a property change event.
- */
- public void firePropertyChangeEvent(String propertyName, Object oldValue, Object newValue);
-
- /**
- * Returns the runtime instance that this working copy is
- * associated with.
- * <p>
- * For a runtime working copy created by a call to
- * {@link IRuntime#createWorkingCopy()},
- * <code>this.getOriginal()</code> returns the original
- * runtime object. For a runtime working copy just created by
- * a call to {@link IRuntimeType#createRuntime(String, IProgressMonitor)},
- * <code>this.getOriginal()</code> returns <code>null</code>.
- * </p>
- *
- * @return the associated runtime instance, or <code>null</code> if none
- */
- public IRuntime getOriginal();
-
- /**
- * Returns the extension for this runtime working copy.
- * The runtime working copy extension is a
- * runtime-type-specific object. By casting the runtime working copy
- * extension to the type prescribed in the API documentation for that
- * particular runtime working copy type, the client can access
- * runtime-type-specific properties and methods.
- *
- * @return the extension for the runtime working copy
- */
- //public IServerExtension getWorkingCopyExtension(IProgressMonitor monitor);
-
- /**
- * Sets the absolute path in the local file system to the root of the runtime,
- * typically the installation directory.
- *
- * @param path the location of this runtime, or <code>null</code> if none
- * @see IRuntime#getLocation()
- */
- public void setLocation(IPath path);
-
- /**
- * Commits the changes made in this working copy. If there is
- * no extant runtime instance with a matching id and runtime
- * type, this will create a runtime instance with attributes
- * taken from this working copy, and return that object.
- * <p>
- * If there an existing runtime instance with a matching id and
- * runtime type, this will change the runtime instance accordingly.
- * The returned runtime will be the same runtime this is returned
- * from getOriginal(), after the changes have been applied.
- * Otherwise, this method will return a newly created runtime.
- * </p>
- * Runtimes can be saved even when they have invalid properties. It
- * is the clients responsibility to call validate() or check the
- * properties before saving.
- * <p>
- * [issue: What is lifecycle for RuntimeWorkingCopyDelegate
- * associated with this working copy?]
- * </p>
- *
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @return a new runtime instance
- * @throws CoreException if the save could not be completed
- */
- public IRuntime save(boolean force, IProgressMonitor monitor) throws CoreException;
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IServer.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IServer.java
deleted file mode 100644
index bd93fff..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IServer.java
+++ /dev/null
@@ -1,594 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2004, 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.core;
-
-import org.eclipse.core.runtime.*;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfiguration;
-/**
- * Represents a server instance. Every server is an instance of a
- * particular, fixed server type.
- * <p>
- * Not surprisingly, the notion of <b>server</b> is central in the web tools
- * server infrastructure. In this context, understand that a server is
- * a web server of some ilk. It could be a simple web server lacking Java
- * support, or an J2EE based server, or perhaps even some kind of database
- * server. A more exact definition is not required for the purposes of this API.
- * From a tool-centric point of view, a server
- * is something that the developer is writing "content" for.
- * The unit of content is termed a module.
- * In a sense, the server exists, but lacks useful content. The
- * development task is to provide that content. The content can include
- * anything from simple, static HTML web pages to complex, highly dynamic
- * web applications.
- * In the course of writing and debugging this content,
- * the developer will want to test their content on a web server, to see how it
- * gets served up. For this they will need to launch a server process running on
- * some host machine (often the local host on which the IDE is running), or
- * attach to a server that's already running on a remote (or local) host.
- * The newly developed content sitting in the developer's workspace needs to
- * end up in a location and format that the running server can use for its
- * serving purposes.
- * </p>
- * <p>
- * In this picture, an <code>IServer</code> object is a proxy for the real web
- * server. Through this proxy, a client can configure the server, and start,
- * stop, and restart it.
- * </p>
- * <p>
- * The server framework maintains a global list of all known server instances
- * ({@link ServerCore#getServers()}).
- * </p>
- * <p>
- * [rough notes:
- * Server has a state.
- * Server can be started, stopped, and restarted.
- * To modify server attributes, get a working copy, modify it, and then save it
- * to commit the changes.
- * Server attributes. Serialization.
- * Chained working copies for runtime, server configuration.
- * Server has a set of root modules.
- * Modules have state wrt a server.
- * Restarting modules.
- * ]
- * </p>
- * <p>
- * Two servers are identical if and only if they have the same id.
- * </p>
- *
- * <p>This interface is not intended to be implemented by clients.</p>
- * <p>
- * <it>Caveat: The server core API is still in an early form, and is
- * likely to change significantly before the initial release.</it>
- * </p>
- *
- * @since 1.0
- */
-public interface IServer extends IServerAttributes {
- /**
- * Server state constant (value 0) indicating that the
- * server is in an unknown state.
- *
- * @see #getServerState()
- * @see #getModuleState(IModule)
- */
- public static final int STATE_UNKNOWN = 0;
-
- /**
- * Server state constant (value 1) indicating that the
- * server is starting, but not yet ready to serve content.
- *
- * @see #getServerState()
- * @see #getModuleState(IModule)
- */
- public static final int STATE_STARTING = 1;
-
- /**
- * Server state constant (value 2) indicating that the
- * server is ready to serve content.
- *
- * @see #getServerState()
- * @see #getModuleState(IModule)
- */
- public static final int STATE_STARTED = 2;
-
- /**
- * Server state constant (value 3) indicating that the
- * server is shutting down.
- *
- * @see #getServerState()
- * @see #getModuleState(IModule)
- */
- public static final int STATE_STOPPING = 3;
-
- /**
- * Server state constant (value 4) indicating that the
- * server is stopped.
- *
- * @see #getServerState()
- * @see #getModuleState(IModule)
- */
- public static final int STATE_STOPPED = 4;
-
- /**
- * Publish state constant (value 0) indicating that it's
- * in an unknown state.
- *
- * @see #getServerPublishState()
- * @see #getModulePublishState(IModule)
- */
- public static final int PUBLISH_STATE_UNKNOWN = 0;
-
- /**
- * Publish state constant (value 1) indicating that there
- * is no publish required.
- *
- * @see #getServerPublishState()
- * @see #getModulePublishState(IModule)
- */
- public static final int PUBLISH_STATE_NONE = 1;
-
- /**
- * Publish state constant (value 2) indicating that an
- * incremental publish is required.
- *
- * @see #getServerPublishState()
- * @see #getModulePublishState(IModule)
- */
- public static final int PUBLISH_STATE_INCREMENTAL = 2;
-
- /**
- * Publish state constant (value 3) indicating that a
- * full publish is required.
- *
- * @see #getServerPublishState()
- * @see #getModulePublishState(IModule)
- */
- public static final int PUBLISH_STATE_FULL = 3;
-
- /**
- * Publish kind constant (value 1) indicating an incremental publish request.
- *
- * @see #publish(int, IProgressMonitor)
- */
- public static final int PUBLISH_INCREMENTAL = 1;
-
- /**
- * Publish kind constant (value 2) indicating a full publish request.
- *
- * @see #publish(int, IProgressMonitor)
- */
- public static final int PUBLISH_FULL = 2;
-
- /**
- * Publish kind constant (value 3) indicating an automatic publish request.
- *
- * @see #publish(int, IProgressMonitor)
- */
- public static final int PUBLISH_AUTO = 3;
-
- /**
- * Publish kind constant (value 4) indicating a publish clean request
- *
- * @see #publish(int, IProgressMonitor)
- */
- public static final int PUBLISH_CLEAN = 4;
-
- /**
- * Publish kind constants
- */
- public static final int NO_CHANGE = 0;
- public static final int ADDED = 1;
- public static final int CHANGED = 2;
- public static final int REMOVED = 3;
-
- /**
- * Returns the current state of this server.
- * <p>
- * Note that this operation is guaranteed to be fast
- * (it does not actually communicate with any actual
- * server).
- * </p>
- *
- * @return one of the server state (<code>SERVER_XXX</code>)
- * constants declared on {@link IServer}
- */
- public int getServerState();
-
- /**
- * Returns the ILaunchManager mode that the server is in. This method will
- * return null if the server is not running.
- *
- * @return the mode in which a server is running, one of the mode constants
- * defined by {@link org.eclipse.debug.core.ILaunchManager}, or
- * <code>null</code> if the server is stopped.
- */
- public String getMode();
-
- /**
- * Returns the server's sync state.
- *
- * @return one of the PUBLISH_XXX state flags
- */
- public int getServerPublishState();
-
- /**
- * Returns the module's sync state.
- *
- * @return one of the PUBLISH_XXX state flags
- */
- public int getModulePublishState(IModule module);
-
- /**
- * Adds the given server state listener to this server.
- * Once registered, a listener starts receiving notification of
- * state changes to this server. The listener continues to receive
- * notifications until it is removed.
- * Has no effect if an identical listener is already registered.
- *
- * @param listener the server listener
- * @see #removeServerListener(IServerListener)
- */
- public void addServerListener(IServerListener listener);
-
- /**
- * Removes the given server state listener from this server. Has no
- * effect if the listener is not registered.
- *
- * @param listener the listener
- * @see #addServerListener(IServerListener)
- */
- public void removeServerListener(IServerListener listener);
-
- /**
- * Returns whether this server is in a state that it can
- * be published to.
- *
- * @return a status object with code <code>IStatus.OK</code> if the server can
- * be published to, otherwise a status object indicating what is wrong
- */
- public IStatus canPublish();
-
- /**
- * Returns true if the server may have any projects or it's
- * configuration out of sync.
- *
- * @return boolean
- */
- public boolean shouldPublish();
-
- /**
- * Publish to the server using the progress monitor. The result of the
- * publish operation is returned as an IStatus.
- *
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @return status indicating what (if anything) went wrong
- */
- public IStatus publish(IProgressMonitor monitor);
-
- /**
- * Publish to the server using the progress monitor. The result of the
- * publish operation is returned as an IStatus.
- *
- * @param kind the kind of publish being requested. Valid values are
- * <ul>
- * <li><code>PUBLSIH_FULL</code>- indicates a full publish.</li>
- * <li><code>PUBLISH_INCREMENTAL</code>- indicates a incremental publish.
- * <li><code>PUBLISH_CLEAN</code>- indicates a clean request. Clean throws
- * out all state and cleans up the module on the server before doing a
- * full publish.
- * </ul>
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @return status indicating what (if anything) went wrong
- */
- public IStatus publish(int kind, IProgressMonitor monitor);
-
- /**
- * Returns whether this server is in a state that it can
- * be started in the given mode.
- *
- * @param launchMode a mode in which a server can be launched,
- * one of the mode constants defined by
- * {@link org.eclipse.debug.core.ILaunchManager}
- * @return a status object with code <code>IStatus.OK</code> if the server can
- * be started, otherwise a status object indicating why it can't
- */
- public IStatus canStart(String launchMode);
-
- /**
- * Returns an existing launch for this server, or null if there is
- * no existing launch.
- *
- * @return
- */
- //public ILaunch getExistingLaunch();
-
- /**
- * Return the launch configuration for this server. If one does not exist, it
- * will be created if "create" is true, and otherwise will return null.
- *
- * @param create
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @return the launch configuration, no <code>null</code> if there was no
- * existing launch configuration and <code>create</code> was false
- * @throws CoreException
- */
- public ILaunchConfiguration getLaunchConfiguration(boolean create, IProgressMonitor monitor) throws CoreException;
-
- /**
- * Configure the given launch configuration to start this server. This method is called whenever
- * the server is started to ensure that the launch configuration is accurate and up to date.
- *
- * @param workingCopy
- * @param monitor
- * @throws CoreException
- */
- //public void setupLaunchConfiguration(ILaunchConfigurationWorkingCopy workingCopy, IProgressMonitor monitor) throws CoreException;
-
- /**
- * Asynchronously starts this server in the given launch mode.
- * Returns the debug launch object that can be used in a debug
- * session.
- * <p>
- * If canStart(launchMode) is false, this method will throw an
- * exception.
- * </p>
- * <p>
- * [issue: There is no way to communicate failure to the
- * client for the async portion of this operation. Given that
- * this operation can go awry, there probably should be a mechanism
- * that allows failing asynch operations to be diagnosed.]
- * </p>
- *
- * @param launchMode a mode in which a server can be launched,
- * one of the mode constants defined by
- * {@link org.eclipse.debug.core.ILaunchManager}
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @return a debug launch object
- * @exception CoreException if an error occurs while trying to start the server
- */
- public ILaunch start(String launchMode, IProgressMonitor monitor) throws CoreException;
-
- /**
- * Starts this server in the given launch mode and waits until the server
- * has finished starting.
- * <p>
- * This convenience method uses {@link #start(String, IProgressMonitor)}
- * to start the server, and an internal thread and listener to detect
- * when the server has finished starting.
- * </p>
- *
- * @param launchMode a mode in which a server can be launched,
- * one of the mode constants defined by
- * {@link org.eclipse.debug.core.ILaunchManager}
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @exception CoreException if an error occurs while trying to start the server
- */
- public ILaunch synchronousStart(String launchMode, IProgressMonitor monitor) throws CoreException;
-
- /**
- * Returns whether this server is in a state that it can
- * be restarted in the given mode. Note that only servers
- * that are currently running can be restarted.
- *
- * @param mode a mode in which a server can be launched,
- * one of the mode constants defined by
- * {@link org.eclipse.debug.core.ILaunchManager}
- * @return a status object with code <code>IStatus.OK</code> if the server can
- * be restarted, otherwise a status object indicating why it can't
- */
- public IStatus canRestart(String mode);
-
- /**
- * Returns whether this server is out of sync and needs to be
- * restarted. This method will return false when the
- * server is not running.
- * <p>
- * [issue: Need to explain what is it that can get out of
- * "out of sync" here, and how this can happen.]
- * </p>
- *
- * @return <code>true</code> if this server is out of sync and needs to be
- * restarted, and <code>false</code> otherwise (e.g., if the contents have
- * not been modified and the server process is still in sync); the
- * result is unspecified if the server is not currently running
- */
- public boolean getServerRestartState();
-
- /**
- * Asynchronously restarts this server. This operation does
- * nothing if this server cannot be stopped ({@link #canRestart(String)}
- * returns <code>false</code>.
- * This method cannot be used to start the server from a stopped state.
- * <p>
- * [issue: There is no way to communicate failure to the
- * client. Given that this operation can go awry, there probably
- * should be a mechanism that allows failing asynch operations
- * to be diagnosed.]
- * </p>
- *
- * @param mode a mode in which a server can be launched,
- * one of the mode constants defined by
- * {@link org.eclipse.debug.core.ILaunchManager}
- */
- public void restart(String mode);
-
- /**
- * Synchronously restarts this server. This operation does
- * nothing if this server cannot be stopped ({@link #canRestart(String)}
- * returns <code>false</code>.
- * <p>
- * [issue: There is no way to communicate failure to the
- * client. Given that this operation can go awry, there probably
- * should be a mechanism that allows failing asynch operations
- * to be diagnosed.]
- * </p>
- *
- * @param launchMode a mode in which a server can be launched,
- * one of the mode constants defined by
- * {@link org.eclipse.debug.core.ILaunchManager}
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- */
- public void synchronousRestart(String launchMode, IProgressMonitor monitor) throws CoreException;
-
- /**
- * Returns whether this server is in a state that it can
- * be stopped.
- * Servers can be stopped if they are not already stopped and if
- * they belong to a state-set that can be stopped.
- *
- * @return a status object with code <code>IStatus.OK</code> if the server can
- * be stopped, otherwise a status object indicating why it can't
- */
- public IStatus canStop();
-
- /**
- * Asynchronously stops this server. This operation does
- * nothing if this server cannot be stopped ({@link #canStop()}
- * returns <code>false</code>.
- * <p>
- * If force is <code>false</code>, it will attempt to stop the server
- * normally/gracefully. If force is <code>true</code>, then the server
- * process will be terminated any way that it can.
- * </p>
- * <p>
- * [issue: There is no way to communicate failure to the
- * client. Given that this operation can go awry, there probably
- * should be a mechanism that allows failing asynch operations
- * to be diagnosed.]
- * </p>
- *
- * @param force <code>true</code> to kill the server, or <code>false</code>
- * to stop normally
- */
- public void stop(boolean force);
-
- /**
- * Stops this server and waits until the server has completely stopped.
- * <p>
- * This convenience method uses {@link #stop(boolean)}
- * to stop the server, and an internal thread and listener to detect
- * when the server has complied.
- * </p>
- *
- * @param force <code>true</code> to kill the server, or <code>false</code>
- * to stop normally
- */
- public void synchronousStop(boolean force);
-
- /**
- * Returns whether the given module can be restarted.
- * <p>
- * [issue: It's unclear whether this operations is guaranteed to be fast
- * or whether it could involve communication with any actual
- * server. If it is not fast, the method should take a progress
- * monitor.]
- * </p>
- *
- * @param module the module
- * @return a status object with code <code>IStatus.OK</code> if the module can
- * be restarted, otherwise a status object indicating why it can't
- */
- public IStatus canRestartModule(IModule module);
-
- /**
- * Check if the given module is in sync on the server. It should
- * return true if the module should be restarted (is out of
- * sync) or false if the module does not need to be restarted.
- *
- * @param module org.eclipse.wst.server.core.model.IModule
- * @return boolean
- */
- public boolean getModuleRestartState(IModule module);
-
- /**
- * Asynchronously restarts the given module on the server.
- * See the specification of
- * {@link IServer#synchronousRestartModule(IModule, IProgressMonitor)}
- * for further details.
- * <p>
- * The implementation should update the module sync state and fire
- * an event for the module. If the module does not exist on the server,
- * an exception will be thrown.
- * </p>
- * <p>
- * [issue: Since this method is ascynchronous, is there
- * any need for the progress monitor?]
- * </p>
- * <p>
- * [issue: Since this method is ascynchronous, how can
- * it return a meaningful IStatus?
- * And IServer.synchronousModuleRestart throws CoreException
- * if anything goes wrong.]
- * </p>
- * <p>
- * [issue: If the module was just published to the server
- * and had never been started, would is be ok to "start"
- * the module using this method?]
- * </p>
- *
- * @param module the module to be started
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @return status object
- * @exception CoreException if an error occurs while trying to restart the module
- */
- public void restartModule(IModule module, IProgressMonitor monitor) throws CoreException;
-
- /**
- * Restarts the given module and waits until it has finished restarting.
- * If the module does not exist on the server, an exception will be thrown.
- * <p>
- * This method may not be used to initially start a module.
- * </p>
- *
- * @param module the module to be restarted
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @exception CoreException if an error occurs while trying to restart the module
- */
- public void synchronousRestartModule(IModule module, IProgressMonitor monitor) throws CoreException;
-
- /**
- * Returns the current state of the given module on this server.
- * Returns <code>STATE_UNKNOWN</code> if the module
- * is not among the ones associated with this server.
- *
- * @param module the module
- * @return one of the state (<code>STATE_XXX</code>)
- * constants declared on {@link IServer}
- */
- public int getModuleState(IModule module);
-
- /**
- * Returns an array of modules that are deployed to this server. This
- * list may contain user applications as well as any other applications
- * (e.g. published from a different workspace) that are running on the
- * server.
- * <p>
- * This method returns the root modules, which are not parented within
- * another modules. Each of these may contain child modules, which are
- * also deployed to this server.
- * </p>
- *
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @return a possibly-empty array of modules
- * @see IServerAttributes#getModules()
- */
- public IModule[] getServerModules(IProgressMonitor monitor);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IServerAttributes.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IServerAttributes.java
deleted file mode 100644
index 6ff5e49..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IServerAttributes.java
+++ /dev/null
@@ -1,386 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2004, 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.core;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.runtime.*;
-/**
- * Represents a server instance. Every server is an instance of a
- * particular, fixed server type.
- * <p>
- * Not surprisingly, the notion of <b>server</b> is central in the web tools
- * server infrastructure. In this context, understand that a server is
- * a web server of some ilk. It could be a simple web server lacking Java
- * support, or an J2EE based server, or perhaps even some kind of database
- * server. A more exact definition is not required for the purposes of this API.
- * From a tool-centric point of view, a server
- * is something that the developer is writing "content" for.
- * The unit of content is termed a module.
- * In a sense, the server exists, but lacks useful content. The
- * development task is to provide that content. The content can include
- * anything from simple, static HTML web pages to complex, highly dynamic
- * web applications.
- * In the course of writing and debugging this content,
- * the developer will want to test their content on a web server, to see how it
- * gets served up. For this they will need to launch a server process running on
- * some host machine (often the local host on which the IDE is running), or
- * attach to a server that's already running on a remote (or local) host.
- * The newly developed content sitting in the developer's workspace needs to
- * end up in a location and format that the running server can use for its
- * serving purposes.
- * </p>
- * <p>
- * In this picture, an <code>IServer</code> object is a proxy for the real web
- * server. Through this proxy, a client can configure the server, and start,
- * stop, and restart it.
- * </p>
- * <p>
- * IServerAttributes implements IAdaptable to allow users to obtain a
- * server-type-specific class. By casting the runtime extension to the type
- * prescribed in the API documentation for that particular server type, the
- * client can access server-type-specific properties and methods.
- * getAdapter() may involve plugin loading, and should not be called from
- * popup menus, etc.
- * </p>
- * <p>
- * The server framework maintains a global list of all known server instances
- * ({@link ServerCore#getServers()}).
- * </p>
- * <p>
- * [rough notes:
- * Server has a state.
- * Server can be started, stopped, and restarted.
- * To modify server attributes, get a working copy, modify it, and then save it
- * to commit the changes.
- * Server attributes. Serialization.
- * Chained working copies for runtime, server configuration.
- * Server has a set of root modules.
- * Modules have state wrt a server.
- * Restarting modules.
- * ]
- * </p>
- * <p>
- * [issue: The information actually stored in the (.server) file is:
- * server id and name, server type id, runtime id, server configuration id,
- * and test-environment. It's unclear what's gained by storing this
- * information in a workspace file. Is it so that this information
- * can be shared between users via a repository? Or is it just so that
- * there would be something to open in the resource navigator view?]
- * </p>
- * <p>
- * Two servers are identical if and only if they have the same id.
- * </p>
- *
- * <p>This interface is not intended to be implemented by clients.</p>
- * <p>
- * <it>Caveat: The server core API is still in an early form, and is
- * likely to change significantly before the initial release.</it>
- * </p>
- *
- * @since 1.0
- */
-public interface IServerAttributes extends IAdaptable {
- /**
- * File extension (value "server") for serialized representation of
- * server instances.
- * <p>
- * [issue: What is relationship between this file extension and
- * the file passed to IServerType.create(...) or returned by
- * IServer.getFile()? That is, are server files expected to end
- * in ".server", or is this just a default? If the former
- * (as I suspect), then IServerType.create needs to say so,
- * and the implementation should enforce the restriction.]
- * </p>
- */
- public static final String FILE_EXTENSION = "server";
-
- /**
- * Server id attribute (value "server-id") of launch configurations.
- * This attribute is used to tag a launch configuration with th
- * id of the corresponding server.
- * <p>
- * [issue: This feels like an implementation detail. If it is to
- * remain API, need to explain how a client uses this attribute.]
- * </p>
- */
- public static final String ATTR_SERVER_ID = "server-id";
-
- /**
- * Returns the displayable name for this server.
- * <p>
- * Note that this name is appropriate for the current locale.
- * </p>
- *
- * @return a displayable name
- */
- public String getName();
-
- /**
- * Returns the id of this server.
- * Each server (of a given type) has a distinct id, fixed for
- * its lifetime. Ids are intended to be used internally as keys;
- * they are not intended to be shown to end users.
- *
- * @return the server id
- */
- public String getId();
-
- /**
- * Deletes the persistent representation of this server.
- *
- * @throws CoreException if there was any error received while deleting the server
- */
- public void delete() throws CoreException;
-
- /**
- * Returns whether this server is marked read only.
- * When a server is read only, working copies can be created but
- * they cannot be saved.
- *
- * @return <code>true</code> if this server is marked as read only,
- * and <code>false</code> otherwise
- */
- public boolean isReadOnly();
-
- /**
- * Returns true if this server is private (not shown in the UI).
- *
- * @return <code>true</code> if this server is private,
- * and <code>false</code> otherwise
- */
- public boolean isPrivate();
-
- /**
- * Returns true if this is a working copy.
- *
- * @return <code>true</code> if this server is a working copy,
- * and <code>false</code> otherwise
- */
- public boolean isWorkingCopy();
-
- /**
- * Returns true if the delegate has been loaded.
- *
- * @return <code>true</code> if the delegate has been loaded, and
- * <code>false</code> otherwise
- */
- public boolean isDelegateLoaded();
-
- /**
- * Validates whether this server can be editted.
- *
- * @param context
- * @return a status object with code <code>IStatus.OK</code> if the server
- * can be edited, otherwise a status object indicating what when wrong
- * with the checkout
- */
- public IStatus validateEdit(Object context);
-
- /**
- * Returns the timestamp of this server.
- * Timestamps are monotonically increased each time the server is saved
- * and can be used to determine if any changes have been made on disk
- * since the server was loaded.
- *
- * @return the server's timestamp
- */
- public int getTimestamp();
-
- /**
- * Returns the host for the server.
- * The format of the host can be either a qualified or unqualified hostname,
- * or an IP address and must conform to RFC 2732.
- *
- * @return a host string conforming to RFC 2732
- * @see java.net.URL#getHost()
- */
- public String getHost();
-
- /**
- * Returns the file where this server instance is serialized.
- *
- * @return the file in the workspace where the server instance
- * is serialized, or <code>null</code> if the information is
- * instead to be persisted with the workspace but not with any
- * particular workspace resource
- */
- public IFile getFile();
-
- /**
- * Returns the runtime associated with this server.
- * <p>
- * Note: The runtime of a server working copy may or may not
- * be a working copy. For a server instance that is not a
- * working copy, the runtime instance is not a working copy
- * either.
- * </p>
- * <p>
- * [issue: According to serverType extension point,
- * runtimeTypeId is a mandatory attribute. It seems odd
- * then to have server runtime instance being an
- * optional property of server instance. What does it mean
- * for a server to not have a runtime?]
- * </p>
- *
- * @return the runtime, or <code>null</code> if none
- */
- public IRuntime getRuntime();
-
- /**
- * Returns the type of this server.
- *
- * @return the server type
- */
- public IServerType getServerType();
-
- /**
- * Returns the server configuration associated with this server.
- * <p>
- * Note: The server configuration of a server working copy may
- * or may not be a working copy. For a server instance that is
- * not a working copy, the server configuration instance is not
- * a working copy either.
- * </p>
- * <p>
- * [issue: According to serverType extension point,
- * configurationTypeId is an optional attribute. If a server type
- * has no server configuration type, then it seems reasonable to
- * expect this method to return null for all instances of that server
- * type. But what about a server type that explicitly specifies
- * a server configuration type. Does that mean that all server
- * instances of that server type must have a server configuration
- * instance of that server configuration type, and that this method
- * never returns null in those cases?]
- * </p>
- *
- * @return the server configuration, or <code>null</code> if none
- */
- public IFolder getServerConfiguration();
-
- /**
- * Returns a server working copy for modifying this server instance.
- * If this instance is already a working copy, it is returned.
- * If this instance is not a working copy, a new server working copy
- * is created with the same id and attributes.
- * Clients are responsible for saving or releasing the working copy when
- * they are done with it.
- * <p>
- * The server working copy is related to this server instance
- * in the following ways:
- * <pre>
- * this.getWorkingCopy().getId() == this.getId()
- * this.getWorkingCopy().getFile() == this.getFile()
- * this.getWorkingCopy().getOriginal() == this
- * this.getWorkingCopy().getRuntime() == this.getRuntime()
- * this.getWorkingCopy().getServerConfiguration() == this.getServerConfiguration()
- * </pre>
- * </p>
- * <p>
- * [issue: IServerWorkingCopy extends IServer.
- * Server.getWorkingCopy() create a new working copy;
- * ServerWorkingCopy.getWorkingCopy() returns this.
- * This may be convenient in code that is ignorant of
- * whether they are dealing with a working copy or not.
- * However, it is hard for clients to manage working copies
- * with this design.]
- * </p>
- *
- * @return a new working copy
- */
- public IServerWorkingCopy createWorkingCopy();
-
- /**
- * Returns an array of user modules that are currently being published to
- * this server.
- * <p>
- * This method returns the root modules, which are not parented within
- * another modules. Each of these may contain child modules, which are
- * also deployed to this server.
- * </p>
- *
- * @return a possibly-empty array of modules
- * @see IServer#getServerModules()
- */
- public IModule[] getModules();
-
- /**
- * Returns whether the specified module modifications could be made to this
- * server at this time.
- * <p>
- * This method may decide based on the type of module
- * or refuse simply due to reaching a maximum number of
- * modules or other criteria.
- * </p>
- * <p>
- * [issue: This seems odd to have a pre-flight method.
- * I should expect that the client can propose making
- * any set of module changes they desire (via a server
- * working copy). If the server doesn't like it, the operation
- * should fail.]
- * </p>
- *
- * @param add a possibly-empty list of modules to add
- * @param remove a possibly-empty list of modules to remove
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @return <code>true</code> if the proposed modifications
- * look feasible, and <code>false</code> otherwise
- */
- public IStatus canModifyModules(IModule[] add, IModule[] remove, IProgressMonitor monitor);
-
- /**
- * Returns the child module(s) of this module. If this
- * module contains other modules, it should list those
- * modules. If not, it should return an empty list.
- *
- * <p>This method should only return the direct children.
- * To obtain the full module tree, this method may be
- * recursively called on the children.</p>
- *
- * @param module org.eclipse.wst.server.core.IModule
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @return array
- */
- public IModule[] getChildModules(IModule module, IProgressMonitor monitor);
-
- /**
- * Returns the parent module(s) of this module. When determining if a given
- * project can run on a server, this method will be used to find the actual
- * module(s) that may be run on the server. For instance, a Web module may
- * return a list of EAR modules that it is contained in if the server only
- * supports configuring EAR modules.
- *
- * <p>If the module type is not supported, this method will return null.
- * If the type is normally supported but there is a configuration
- * problem or missing parent, etc., this method will fire a CoreException
- * that may then be presented to the user.</p>
- *
- * <p>If it does return valid parent(s), this method will always return
- * the topmost parent module(s), even if there are a few levels
- * (a heirarchy) of modules.</p>
- *
- * @param module org.eclipse.wst.server.core.IModule
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @return an array of possible root modules
- * @throws org.eclipse.core.runtime.CoreException
- */
- public IModule[] getRootModules(IModule module, IProgressMonitor monitor) throws CoreException;
-
- /**
- * Returns an array of IServerPorts that this server has.
- *
- * @return a possibly empty array of servers ports
- */
- public IServerPort[] getServerPorts();
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IServerLifecycleListener.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IServerLifecycleListener.java
deleted file mode 100644
index cbac7f3..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IServerLifecycleListener.java
+++ /dev/null
@@ -1,38 +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.core;
-/**
- * Listener interface for server changes.
- *
- * @since 1.0
- */
-public interface IServerLifecycleListener {
- /**
- * A new server has been created.
- *
- * @param server org.eclipse.wst.server.core.IServer
- */
- public void serverAdded(IServer server);
-
- /**
- * An existing server has been updated or modified.
- *
- * @param server org.eclipse.wst.server.core.IServer
- */
- public void serverChanged(IServer server);
-
- /**
- * A existing server has been removed.
- *
- * @param server org.eclipse.wst.server.core.IServer
- */
- public void serverRemoved(IServer server);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IServerListener.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IServerListener.java
deleted file mode 100644
index 844ceea..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IServerListener.java
+++ /dev/null
@@ -1,66 +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.core;
-/**
- * This interface is used by the server to broadcast a change of state.
- * Usually, the change of state will be caused by some user action,
- * (e.g. requesting to start a server) however, it is equally fine for
- * a server to broadcast a change of state through no direct user action.
- * (e.g. stopping because the server crashed) This information can be
- * used to inform the user of the change or update the UI.
- *
- * <p>Note: The server listener event MUST NOT directly be used to modify
- * the server's state via one of the server's method. For example, a server
- * stopped event cannot directly trigger a start(). Doing this may cause
- * the thread to hang.</p>
- *
- * @since 1.0
- */
-public interface IServerListener {
- /**
- * Called when the server configuration's sync state changes.
- *
- * @param server the affected server
- */
- public void configurationSyncStateChange(IServer server);
-
- /**
- * Called when the server isRestartNeeded() property changes.
- *
- * @param server the affected server
- */
- public void restartStateChange(IServer server);
-
- /**
- * Notification when the server state has changed.
- *
- * @param server the affected server
- */
- public void serverStateChange(IServer server);
-
- /**
- * Called when the modules tree of this server has changed.
- *
- * @param server the affected server
- */
- public void modulesChanged(IServer server);
-
- /**
- * Fired when a module on this server needs to be published
- * or no longer needs to be published, or it's state has
- * changed.
- *
- * @param server the affected server
- * @param parents the module's parents
- * @param module the module
- */
- public void moduleStateChange(IServer server, IModule[] parents, IModule module);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IServerPort.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IServerPort.java
deleted file mode 100644
index 4b8daaa..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IServerPort.java
+++ /dev/null
@@ -1,60 +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.core;
-/**
- * An abstract port on a server.
- *
- * @since 1.0
- */
-public interface IServerPort {
- /**
- * Return an optional internal id used to identify this port.
- *
- * @return java.lang.String
- */
- public String getId();
-
- /**
- * Return the name of the port.
- * @return java.lang.String
- */
- public String getName();
-
- /**
- * Return the actual port number.
- * @return int
- */
- public int getPort();
-
- /**
- * Returns the protocol, e.g. HTTP of this port. Returns null
- * if the protocol is unknown.
- *
- * @return java.lang.String
- */
- public String getProtocol();
-
- /**
- * Returns the content types that this port would normally serve, or null
- * if the content is unknown.
- *
- * @return java.lang.String[]
- */
- public String[] getContentTypes();
-
- /**
- * Returns true if this port is an "advanced" port and should not be shown
- * to novice users.
- *
- * @return boolean
- */
- public boolean isAdvanced();
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IServerType.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IServerType.java
deleted file mode 100644
index 1a7852a..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IServerType.java
+++ /dev/null
@@ -1,299 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.core;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-/**
- * Represents a server type from which server instances can be created.
- * <p>
- * The server core framework supports
- * an open-ended set of server types, which are contributed via
- * the <code>serverTypes</code> extension point in the server core
- * plug-in. Server type objects carry no state (all information is
- * read-only and is supplied by the server type declaration).
- * The global list of known server types is available via
- * {@link ServerCore#getServerTypes()}.
- * </p>
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- * <p>
- * Two server types are identical if and only if they have the same id.
- * </p>
- * <p>
- * <it>Caveat: The server core API is still in an early form, and is
- * likely to change significantly before the initial release.</it>
- * </p>
- *
- * @since 1.0
- */
-public interface IServerType {
- /**
- * Constant (value 0) indicating that a type of server that can be
- * directly started and stopped.
- *
- * @see #getServerStateSet()
- */
- public static final int SERVER_STATE_SET_MANAGED = 0;
-
- /**
- * Constant (value 1) indicating that a type of server that can be
- * attached to, typically for debugging.
- *
- * @see #getServerStateSet()
- */
- public static final int SERVER_STATE_SET_ATTACHED = 1;
-
- /**
- * Constant (value 2) indicating that a type of server that
- * can only be used for publishing.
- *
- * @see #getServerStateSet()
- */
- public static final int SERVER_STATE_SET_PUBLISHED = 2;
-
- /**
- * Returns the id of this server type.
- * Each known server type has a distinct id.
- * Ids are intended to be used internally as keys; they are not
- * intended to be shown to end users.
- *
- * @return the server type id
- */
- public String getId();
-
- /**
- * Returns the displayable name for this server type.
- * <p>
- * Note that this name is appropriate for the current locale.
- * </p>
- *
- * @return a displayable name for this server type
- */
- public String getName();
-
- /**
- * Returns the displayable description for this server type.
- * <p>
- * Note that this description is appropriate for the current locale.
- * </p>
- *
- * @return a displayable description for this server type
- */
- public String getDescription();
-
- /**
- * Returns the type of server runtime that this type
- * of server requires.
- * <p>
- * [issue: "runtimeTypeId" is mandatory according the
- * serverTypes schema. This suggests that all types
- * of servers have a server runtime. But there is also
- * a boolean "runtime" attribute indicating whether the
- * server requires a runtime. I supect that server type
- * has an optional server runtime, in which case you
- * can make "runtimeTypeId" optional and dispense with
- * "runtime".]
- * </p>
- * <p>
- * [issue: Does it really make sense for
- * runtimeTypes and serverTypes be separate extension
- * points? Would it not be sufficient to have the party declaring
- * the server type also declare the server runtime type?
- * Having runtimeType as a separate extension point
- * only makes sense if it would be possible in principle to
- * declare a server runtime type that could actually be
- * used on serveral server types. If server runtimes
- * always end up being server-type specific, it would be better
- * to combine them.]
- * </p>
- * <p>
- * [issue: What should happen when a server type mentions
- * the id of a server runtime type that is not known
- * to the system?]
- * </p>
- *
- * @return a server runtime type
- */
- public IRuntimeType getRuntimeType();
-
- /**
- * Returns whether this type of server requires a server
- * runtime.
- * <p>
- * [issue: See issues on getRuntimeType(). I suspect this
- * method is unnecessary, and that
- * this.getRuntimeType() != null will do.]
- * </p>
- *
- * @return <code>true</code> if this type of server requires
- * a server runtime, and <code>false</code> if it does not
- * @see #getRuntimeType()
- */
- public boolean hasRuntime();
-
- /**
- * Returns whether this type of server supports the given launch mode.
- * <p>
- * [issue: It also seems odd that this is part of the server type
- * declaration. This means that any server type has to commit
- * so early on which modes it supports.]
- * </p>
- * <p>
- * [issue: Because the spec for this method piggy-backs off the
- * debug API, this method is vulnerable to any expansion that may
- * happen there. For instance, a 3rd mode (PROFILE_MODE) was added in 3.0.
- * As spec'd, clients can reasonably expect to launch servers
- * in this mode as well. It may also make sense for the server
- * core to define its own notion of legal modes.]
- * </p>
- *
- * @param launchMode a mode in which a server can be launched,
- * one of the mode constants defined by
- * {@link org.eclipse.debug.core.ILaunchManager}
- * @return whether this type of server supports the given mode
- */
- public boolean supportsLaunchMode(String launchMode);
-
- /**
- * Returns the server state set that should for instances of this server type.
- * If the state set is {@link #SERVER_STATE_SET_MANAGED}, this is
- * a runnable server that may be directly started and stopped
- * (i.e., it should be represented as starting, started in debug mode,
- * etc.) If the state set is {@link #SERVER_STATE_SET_ATTACHED}, this is a
- * server that can be attached to, typically for debugging purposes
- * (i.e., it should be represented as attaching, attached for
- * debugging, etc.).
- * If the state set is {@link #SERVER_STATE_SET_PUBLISHED}, this is a
- * server that only be published to (i.e., it should be represented as
- * not having states).
- * <p>
- * [issue: The notion of a "server state set" is a little abstruce.
- * It feels like the main thing to capture in the server type
- * is that there are 3 different styles of servers, and this
- * has a bearing on how you control them. That would suggest
- * there will be different rules for operating on them, and
- * that they might cycle through different sets of states.]
- * </p>
- * <p>
- * [issue: It also seems odd that this is part of the server type
- * declaration. This means that any server type has to commit
- * so early on which one it is.]
- * </p>
- *
- * @return one of {@link #SERVER_STATE_SET_MANAGED},
- * {@link #SERVER_STATE_SET_ATTACHED}, or
- * {@link #SERVER_STATE_SET_PUBLISHED}
- */
- public int getServerStateSet();
-
- /**
- * Returns whether this type of server requires a server
- * configuration.
- * <p>
- * [issue: It's not clear how this method differs from
- * this.getServerConfigurationType() != null]
- * </p>
- *
- * @return <code>true</code> if this type of server requires
- * a server configuration, and <code>false</code> if it does not
- */
- public boolean hasServerConfiguration();
-
- /**
- * Returns <code>true</code> if this type of server can run on a remote host.
- * Returns <code>false</code> if the server type can only be run on "localhost"
- * (the local machine).
- * <p>
- * [issue: Should be renamed "supportsRemoteHost" (no "s").]
- * </p>
- * <p>
- * [issue: Again, it seems odd to me that this is something
- * hard-wired to a server type.]
- * </p>
- *
- * @return <code>true</code> if this type of server can run on
- * a remote host, and <code>false</code> if it cannot
- */
- public boolean supportsRemoteHosts();
-
- /**
- * Creates an working copy instance of this server type.
- * After setting various properties of the working copy,
- * the client should call {@link IServerWorkingCopy#save(boolean, IProgressMonitor)}
- * to bring the server instance into existence.
- * <p>
- * [issue: Why is a runtime passed in?
- * IServerWorkingCopy.setRuntime(runtime) could be called on
- * the result to accomplish the same thing.]
- * </p>
- * <p>
- * [issue: The implementation of this method never creates a server
- * config working copy, whereas the other one does!?]
- * Consider combining the method with the other.]
- * </p>
- * <p>
- * The server returned from this method will have it's host set to
- * "localhost". Other defaults will be set by calling the server
- * delegate's setDefaults() method.
- * </p>
- *
- * @param id the id to assign to the server instance; a generated
- * id is used if id is <code>null</code> or an empty string
- * @param file the file in the workspace where the server instance
- * is to be serialized, or <code>null</code> if the information is
- * instead to be persisted with the workspace but not with any
- * particular workspace resource
- * @param runtime the runtime to associate with the server instance,
- * or <code>null</code> if none
- * @return a new server working copy with the given id
- * @throws CoreException if an exception occurs while creating this runtime
- * or setting it's default values
- */
- public IServerWorkingCopy createServer(String id, IFile file, IRuntime runtime, IProgressMonitor monitor) throws CoreException;
-
- /**
- * Creates a working copy instance of this server type.
- * After setting various properties of the working copy,
- * the client should call {@link IServerWorkingCopy#save(boolean, IProgressMonitor)}
- * to bring the server instance into existence.
- * <p>
- * [issue: Since this method just creates a working copy,
- * it's not clear the operation is long-running and in need
- * of a progress monitor.]
- * </p>
- * <p>
- * The server returned from this method will have it's host set to
- * "localhost". Other defaults will be set by calling the server
- * delegate's setDefaults() method.
- * </p>
- * <p>
- * [issue: The implementation of this method creates a server
- * config working copy, whereas the other one does not!?
- * Consider combining the method with the other.]
- * </p>
- *
- * @param id the id to assign to the server instance; a generated
- * id is used if id is <code>null</code> or an empty string
- * @param file the file in the workspace where the server instance
- * is to be serialized, or <code>null</code> if the information is
- * instead to be persisted with the workspace but not with any
- * particular workspace resource
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @return a new server working copy with the given id
- * @throws CoreException if an exception occurs while creating this runtime
- * or setting it's default values
- */
- public IServerWorkingCopy createServer(String id, IFile file, IProgressMonitor monitor) throws CoreException;
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IServerWorkingCopy.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IServerWorkingCopy.java
deleted file mode 100644
index 94b1e8e..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IServerWorkingCopy.java
+++ /dev/null
@@ -1,293 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2004, 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.core;
-
-import java.beans.PropertyChangeListener;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-/**
- * A working copy server object used for formulating changes
- * to a server instance ({@link IServer}).
- *
- * <p>This interface is not intended to be implemented by clients.</p>
- * <p>
- * <it>Caveat: The server core API is still in an early form, and is
- * likely to change significantly before the initial release.</it>
- * </p>
- *
- * @since 1.0
- */
-public interface IServerWorkingCopy extends IServerAttributes {
- public static final int TIMESTAMP_ERROR = 5;
-
- /**
- * Sets the displayable name for this server.
- * <p>
- * The name should be appropriate for the current locale.
- * </p>
- *
- * @param name a displayable name
- * @see IServerAttributes#getName()
- */
- public void setName(String name);
-
- /**
- * Sets or unsets whether this server is marked as read only.
- * When a server is read only, working copies can be created but
- * they cannot be saved.
- *
- * @param readOnly <code>true</code> to set this server to be marked
- * read only, and <code>false</code> to unset
- */
- public void setReadOnly(boolean readOnly);
-
- /**
- * Sets whether this element is private.
- * Generally speaking, elements marked private are internal ones
- * that should not be shown to users (because they won't know
- * anything about them).
- *
- * @param b <code>true</code> if this element is private,
- * and <code>false</code> otherwise
- * @see IServerAttributes#isPrivate()
- */
- public void setPrivate(boolean b);
-
- /**
- * Returns whether this working copy has unsaved changes.
- *
- * @return <code>true</code> if this working copy has unsaved
- * changes, and <code>false</code> otherwise
- */
- public boolean isDirty();
-
- /**
- * Adds a property change listener to this server.
- *
- * @param listener java.beans.PropertyChangeListener
- */
- public void addPropertyChangeListener(PropertyChangeListener listener);
-
- /**
- * Removes a property change listener from this server.
- *
- * @param listener java.beans.PropertyChangeListener
- */
- public void removePropertyChangeListener(PropertyChangeListener listener);
-
- /**
- * Fires a property change event.
- */
- public void firePropertyChangeEvent(String propertyName, Object oldValue, Object newValue);
-
- /**
- * Sets the server configuration associated with this server working copy.
- * <p>
- * Note: The server configuration of a server working copy may
- * or may not be a working copy.
- * </p>
- * <p>
- * [issue: According to serverType extension point,
- * configurationTypeId is an optional attribute. What happens if the
- * server configuration passed is null but the server must have a
- * server configuration? What happens of the server configuration
- * has the wrong type? Do the errors get detected and reported now, or
- * upon save()?]
- * </p>
- *
- * @param configuration the server configuration, or <code>null</code> if none
- */
- public void setServerConfiguration(IFolder configuration);
-
- /**
- * Returns the server instance that this working copy is
- * associated with.
- * <p>
- * For a server working copy created by a call to
- * {@link IServer#createWorkingCopy()},
- * <code>this.getOriginal()</code> returns the original
- * server object. For a server working copy just created by
- * a call to {@link IServerType#createServer(String, IFile, IProgressMonitor)},
- * <code>this.getOriginal()</code> returns <code>null</code>.
- * </p>
- *
- * @return the associated server instance, or <code>null</code> if none
- */
- public IServer getOriginal();
-
- /**
- * Commits the changes made in this working copy. If there is
- * no extant server instance with a matching id and server
- * type, this will create a server instance with attributes
- * taken from this working copy. If there an existing server
- * instance with a matching id and server type, this will
- * change the server instance accordingly.
- * <p>
- * If there an existing server instance with a matching id and
- * server type, this will change the server instance accordingly.
- * The returned server will be the same server this is returned
- * from getOriginal(), after the changes have been applied.
- * Otherwise, this method will return a newly created server.
- * </p>
- * <p>
- * Servers can be saved even when they have invalid properties. It
- * is the clients responsibility to validate or check the
- * properties before saving.
- * </p>
- * <p>
- * This method does not apply changes to the server. A publish()
- * must be completed to push out after the save to push out any
- * changes to the server.
- * </p>
- * <p>
- * [issue: What is lifecycle for ServerWorkingCopyDelegate
- * associated with this working copy?]
- * </p>
- * <p>
- * [issue: Since it does not make sense to commit a server
- * working copy without first committing any associated
- * runtime and server config working copies, the semantics
- * of saveAll should be part and parcel of the
- * normal save, and the saveAll method eliminated.]
- * </p>
- *
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @return a new server instance
- * @throws CoreException [missing]
- */
- public IServer save(boolean force, IProgressMonitor monitor) throws CoreException;
-
- /**
- * Commits the changes made in this server working copy after
- * first committing any associated server configuration or
- * server runtime working copies.
- * <p>
- * This convenience method is equivalent to:
- * <pre>
- * IRuntime rt = this.getRuntime();
- * if (rt != null && rt.isWorkingCopy()) {
- * ((IRuntimeWorkingCopy) rt).save(monitor);
- * }
- * IServerConfiguration cf = this.getServerConfiguration();
- * if (cf != null && cf.isWorkingCopy()) {
- * ((IServerConfigurationWorkingCopy) cf).save(monitor);
- * }
- * return save(monitor);
- * </pre>
- * </p>
- * <p>
- * [issue: Since it does not make sense to commit a server
- * working copy without first committing any associated
- * runtime and server config working copies, the semantics
- * of this operation should be part and parcel of the
- * normal save, and the saveAll method eliminated.]
- * </p>
- *
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @return a new server instance
- * @throws CoreException [missing]
- */
- public IServer saveAll(boolean force, IProgressMonitor monitor) throws CoreException;
-
- /**
- * Sets the file where this server instance is serialized.
- *
- * @param file the file in the workspace where the server instance
- * is serialized, or <code>null</code> if the information is
- * instead to be persisted with the workspace but not with any
- * particular workspace resource
- */
- public void setFile(IFile file);
-
- /**
- * Sets the runtime associated with this server working copy.
- * <p>
- * Note: The runtime of a server working copy may
- * or may not be a working copy.
- * </p>
- * <p>
- * [issue: According to serverType extension point,
- * runtimeTypeId is a mandatory attribute. But IServer.getRuntime()
- * is allowed to return null, suggesting that it is optional for instances.
- * What happens if the runtime passed is null but the server must
- * have a runtime? What happens if the runtime has the wrong
- * type? Do the errors get detected and reported now, or upon save()?]
- * </p>
- *
- * @param runtime the runtime, or <code>null</code> if none
- */
- public void setRuntime(IRuntime runtime);
-
- /**
- * Changes the host for the server.
- * The format of the host can be either a qualified or unqualified hostname,
- * or an IP address and must conform to RFC 2732.
- *
- * <p>
- * [issue: This is a questionable operation if there is a running
- * server associated with the original. When a host name
- * change is committed, the server instance loses contact with
- * the running server because of the host name change.]
- * </p>
- *
- * @param host a host string conforming to RFC 2732
- * @see IServer#getHost()
- * @see java.net.URL#getHost()
- */
- public void setHost(String host);
-
- /**
- * Modifies the list of modules associated with the server.
- * The modules included in the <code>add</code> list
- * must exist in the workspace and must not already be associated
- * with the server.
- * The modules included in the <code>remove</code> list
- * must be associated with the server, but may or may not exist
- * in the workspace.
- * <p>
- * This method will not communicate with the server. After saving,
- * publish() can be used to sync up with the server.
- * </p>
- * <p>
- * [issue: How to formulate what it means
- * to say "the module must exist in the workspace"?]
- * </p>
- * <p>
- * [issue: The spec should be more lax. Attempting to add
- * a module that's already include should be quietly ignore;
- * ditto removing a module that's not on this list. This
- * simplifies the handling of various other wacko cases
- * such as duplication within and between the add and remove
- * lists.]
- * </p>
- * <p>
- * [issue: The spec had also said: "...canModifyModules()
- * should have returned true. The configuration must assume
- * any default settings and add the module without any UI."]
- * </p>
- * <p>
- * [issue: What error checking should be performed by this
- * operation, and what needs to be performed by save() if
- * the client tries to commit these hypothetisized changes?]
- * </p>
- *
- * @param add a possibly-empty list of modules to add
- * @param remove a possibly-empty list of modules to remove
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @throws CoreException [missing]
- */
- public void modifyModules(IModule[] add, IModule[] remove, IProgressMonitor monitor) throws CoreException;
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/ITask.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/ITask.java
deleted file mode 100644
index 5ea62a0..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/ITask.java
+++ /dev/null
@@ -1,83 +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.core;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-/**
- * This interface represents a task that can be executed (and then possibly
- * undone). To tie together multiple tasks, a common task model can be used
- * to pass parameters to the task or have the output of one task feed into
- * another task.
- *
- * <p>This interface is not intended to be implemented by clients.</p>
- *
- * @since 1.0
- */
-public interface ITask {
- /**
- * Returns the label for this command.
- *
- * @return java.lang.String
- */
- public String getName();
-
- /**
- * Returns a description of this command.
- *
- * @return java.lang.String
- */
- public String getDescription();
-
- /**
- * Return the task model.
- *
- * @return the task model
- */
- public TaskModel getTaskModel();
-
- /**
- * Set the task model.
- *
- * @param taskModel the task model
- */
- public void setTaskModel(TaskModel taskModel);
-
- /**
- * Returns whether the task can be executed.
- *
- * @return <code>true</code> if the task can be executed, and
- * <code>false</code> otherwise
- */
- public boolean canExecute();
-
- /**
- * Execute (perform) the task.
- *
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @throws CoreException if there was an error while executing the task
- */
- public void execute(IProgressMonitor monitor) throws CoreException;
-
- /**
- * Returns whether the task can be undone.
- *
- * @return <code>true</code> if the task can be undone, and
- * <code>false</code> otherwise
- */
- public boolean canUndo();
-
- /**
- * Undo the task.
- */
- public void undo();
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/ServerCore.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/ServerCore.java
deleted file mode 100644
index fa854e4..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/ServerCore.java
+++ /dev/null
@@ -1,435 +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.core;
-
-import java.util.*;
-
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
-import org.eclipse.wst.server.core.internal.*;
-/**
- * Main class for server core API.
- * <p>
- * This class provides API to access most of the types in the server
- * framework, including server runtimes and servers. Methods **
- * The methods on this class are thread safe.
- * </p>
- * <p>
- * This class provides all its functionality through static members.
- * It is not intended to be subclassed or instantiated.
- * </p>
- * <p>
- * <it>Caveat: The server core API is still in an early form, and is
- * likely to change significantly before the initial release.</it>
- * </p>
- *
- * @since 1.0
- */
-public class ServerCore {
- // cached copy of all runtime types
- private static List runtimeTypes;
-
- // cached copy of all runtime target handlers
- private static List runtimeTargetHandlers;
-
- // cached copy of all server and configuration types
- private static List serverTypes;
-
- static {
- executeStartups();
- }
-
- /**
- * Cannot create ServerCore - use static methods.
- */
- private ServerCore() {
- // can't create
- }
-
- /**
- * Returns the resource manager.
- *
- * @return org.eclipse.wst.server.core.internal.ResourceManager
- */
- private static ResourceManager getResourceManager() {
- return ResourceManager.getInstance();
- }
-
- /**
- * Returns the preference information for the project. The project may not
- * be null.
- *
- * @return org.eclipse.wst.server.core.IServerProjectPreferences
- */
- public static IProjectProperties getProjectProperties(IProject project) {
- if (project == null)
- throw new IllegalArgumentException();
- return new ProjectProperties(project);
- }
-
- /**
- * Returns an array of all known runtime types.
- * <p>
- * A new array is returned on each call, so clients may store or modify the result.
- * </p>
- *
- * @return the array of runtime types {@link IRuntimeType}
- */
- public static IRuntimeType[] getRuntimeTypes() {
- if (runtimeTypes == null)
- loadRuntimeTypes();
-
- IRuntimeType[] rt = new IRuntimeType[runtimeTypes.size()];
- runtimeTypes.toArray(rt);
- return rt;
- }
-
- /**
- * Returns the runtime type with the given id, or <code>null</code>
- * if none. This convenience method searches the list of known
- * runtime types ({@link #getRuntimeTypes()}) for the one with a matching
- * runtime type id ({@link IRuntimeType#getId()}). The id may not be null.
- *
- * @param id the runtime type id
- * @return the runtime type, or <code>null</code> if there is no runtime type
- * with the given id
- */
- public static IRuntimeType findRuntimeType(String id) {
- if (id == null)
- throw new IllegalArgumentException();
-
- if (runtimeTypes == null)
- loadRuntimeTypes();
-
- Iterator iterator = runtimeTypes.iterator();
- while (iterator.hasNext()) {
- IRuntimeType runtimeType = (IRuntimeType) iterator.next();
- if (id.equals(runtimeType.getId()))
- return runtimeType;
- }
- return null;
- }
-
- /**
- * Returns an array of all known runtime target handler instances.
- * <p>
- * A new array is returned on each call, so clients may store or modify the result.
- * </p>
- *
- * @return a possibly-empty array of runtime target handler instances
- * {@link IRuntimeTargetHandler}
- */
- public static IRuntimeTargetHandler[] getRuntimeTargetHandlers() {
- if (runtimeTargetHandlers == null)
- loadRuntimeTargetHandlers();
-
- IRuntimeTargetHandler[] rth = new IRuntimeTargetHandler[runtimeTargetHandlers.size()];
- runtimeTargetHandlers.toArray(rth);
- return rth;
- }
-
- /**
- * Returns the runtime target handler with the given id, or <code>null</code>
- * if none. This convenience method searches the list of known runtime
- * target handlers ({@link #getRuntimeTargetHandlers()}) for the one with
- * a matching runtime target handler id ({@link IRuntimeTargetHandler#getId()}).
- * The id may not be null.
- *
- * @param id the runtime target handler id
- * @return the runtime target handler instance, or <code>null</code> if
- * there is no runtime target handler with the given id
- */
- public static IRuntimeTargetHandler findRuntimeTargetHandler(String id) {
- if (id == null)
- throw new IllegalArgumentException();
-
- if (runtimeTargetHandlers == null)
- loadRuntimeTargetHandlers();
-
- Iterator iterator = runtimeTargetHandlers.iterator();
- while (iterator.hasNext()) {
- IRuntimeTargetHandler runtimeTargetListener = (IRuntimeTargetHandler) iterator.next();
- if (id.equals(runtimeTargetListener.getId()))
- return runtimeTargetListener;
- }
- return null;
- }
-
- /**
- * Returns an array of all known server types.
- * <p>
- * A new array is returned on each call, so clients may store or modify the result.
- * </p>
- *
- * @return the array of server types {@link IServerType}
- */
- public static IServerType[] getServerTypes() {
- if (serverTypes == null)
- loadServerTypes();
-
- IServerType[] st = new IServerType[serverTypes.size()];
- serverTypes.toArray(st);
- return st;
- }
-
- /**
- * Returns the server type with the given id, or <code>null</code>
- * if none. This convenience method searches the list of known
- * server types ({@link #getServerTypes()}) for the one with a matching
- * server type id ({@link IServerType#getId()}). The id may not be null.
- *
- * @param id the server type id
- * @return the server type, or <code>null</code> if there is no server type
- * with the given id
- */
- public static IServerType findServerType(String id) {
- if (id == null)
- throw new IllegalArgumentException();
-
- if (serverTypes == null)
- loadServerTypes();
-
- Iterator iterator = serverTypes.iterator();
- while (iterator.hasNext()) {
- IServerType serverType = (IServerType) iterator.next();
- if (id.equals(serverType.getId()))
- return serverType;
- }
- return null;
- }
-
- /**
- * Execute the server startup extension points.
- */
- private static synchronized void executeStartups() {
- Trace.trace(Trace.EXTENSION_POINT, "->- Loading .startup extension point ->-");
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IConfigurationElement[] cf = registry.getConfigurationElementsFor(ServerPlugin.PLUGIN_ID, "internalStartup");
-
- int size = cf.length;
- for (int i = 0; i < size; i++) {
- try {
- IStartup startup = (IStartup) cf[i].createExecutableExtension("class");
- try {
- startup.startup();
- } catch (Exception ex) {
- Trace.trace(Trace.SEVERE, "Startup failed" + startup.toString(), ex);
- }
- Trace.trace(Trace.EXTENSION_POINT, " Loaded startup: " + cf[i].getAttribute("id"));
- } catch (Throwable t) {
- Trace.trace(Trace.SEVERE, " Could not load startup: " + cf[i].getAttribute("id"), t);
- }
- }
-
- Trace.trace(Trace.EXTENSION_POINT, "-<- Done loading .startup extension point -<-");
- }
-
- /**
- * Load the runtime types.
- */
- private static synchronized void loadRuntimeTypes() {
- if (runtimeTypes != null)
- return;
- Trace.trace(Trace.EXTENSION_POINT, "->- Loading .runtimeTypes extension point ->-");
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IConfigurationElement[] cf = registry.getConfigurationElementsFor(ServerPlugin.PLUGIN_ID, "runtimeTypes");
-
- int size = cf.length;
- runtimeTypes = new ArrayList(size);
- for (int i = 0; i < size; i++) {
- try {
- RuntimeType runtimeType = new RuntimeType(cf[i]);
- runtimeTypes.add(runtimeType);
- Trace.trace(Trace.EXTENSION_POINT, " Loaded runtimeType: " + cf[i].getAttribute("id"));
- } catch (Throwable t) {
- Trace.trace(Trace.SEVERE, " Could not load runtimeType: " + cf[i].getAttribute("id"), t);
- }
- }
- sortOrderedList(runtimeTypes);
-
- Trace.trace(Trace.EXTENSION_POINT, "-<- Done loading .runtimeTypes extension point -<-");
- }
-
- /**
- * Load the runtime target handlers.
- */
- private static synchronized void loadRuntimeTargetHandlers() {
- if (runtimeTargetHandlers != null)
- return;
- Trace.trace(Trace.EXTENSION_POINT, "->- Loading .runtimeTargetHandlers extension point ->-");
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IConfigurationElement[] cf = registry.getConfigurationElementsFor(ServerPlugin.PLUGIN_ID, "runtimeTargetHandlers");
-
- int size = cf.length;
- runtimeTargetHandlers = new ArrayList(size);
- for (int i = 0; i < size; i++) {
- try {
- RuntimeTargetHandler runtimeTargetListener = new RuntimeTargetHandler(cf[i]);
- runtimeTargetHandlers.add(runtimeTargetListener);
- Trace.trace(Trace.EXTENSION_POINT, " Loaded runtimeTargetHandler: " + cf[i].getAttribute("id"));
- } catch (Throwable t) {
- Trace.trace(Trace.SEVERE, " Could not load runtimeTargetHandler: " + cf[i].getAttribute("id"), t);
- }
- }
- sortOrderedList(runtimeTargetHandlers);
-
- Trace.trace(Trace.EXTENSION_POINT, "-<- Done loading .runtimeTargetHandlers extension point -<-");
- }
-
- /**
- * Load the server types.
- */
- private static synchronized void loadServerTypes() {
- if (serverTypes != null)
- return;
- Trace.trace(Trace.EXTENSION_POINT, "->- Loading .serverTypes extension point ->-");
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IConfigurationElement[] cf = registry.getConfigurationElementsFor(ServerPlugin.PLUGIN_ID, "serverTypes");
-
- int size = cf.length;
- serverTypes = new ArrayList(size);
- for (int i = 0; i < size; i++) {
- try {
- ServerType serverType = new ServerType(cf[i]);
- serverTypes.add(serverType);
- Trace.trace(Trace.EXTENSION_POINT, " Loaded serverType: " + cf[i].getAttribute("id"));
- } catch (Throwable t) {
- Trace.trace(Trace.SEVERE, " Could not load serverType: " + cf[i].getAttribute("id"), t);
- }
- }
- sortOrderedList(serverTypes);
-
- Trace.trace(Trace.EXTENSION_POINT, "-<- Done loading .serverTypes extension point -<-");
- }
-
- /**
- * Returns the runtime with the given id, or <code>null</code>
- * if none. This convenience method searches the list of known
- * runtimes ({@link #getRuntimes()}) for the one with a matching
- * runtime id ({@link IRuntime#getId()}). The id may not be null.
- *
- * @param id the runtime id
- * @return the runtime instance, or <code>null</code> if there is no runtime
- * with the given id
- */
- public static IRuntime findRuntime(String id) {
- return getResourceManager().getRuntime(id);
- }
-
- /**
- * Returns an array of all known runtime instances. The list will not contain any
- * working copies.
- * <p>
- * A new array is returned on each call, so clients may store or modify the result.
- * </p>
- *
- * @return a possibly-empty array of runtime instances {@link IRuntime}
- */
- public static IRuntime[] getRuntimes() {
- return getResourceManager().getRuntimes();
- }
-
- /**
- * Returns the server with the given id, or <code>null</code>
- * if none. This convenience method searches the list of known
- * servers ({@link #getServers()}) for the one with a matching
- * server id ({@link IServer#getId()}). The id must not be null.
- *
- * @param id the server id
- * @return the server instance, or <code>null</code> if there is no server
- * with the given id
- */
- public static IServer findServer(String id) {
- return getResourceManager().getServer(id);
- }
-
- /**
- * Returns an array of all known server instances. The array will not include any
- * working copies.
- * <p>
- * A new array is returned on each call, so clients may store or modify the result.
- * </p>
- *
- * @return a possibly-empty array of server instances {@link IServer}
- */
- public static IServer[] getServers() {
- return getResourceManager().getServers();
- }
-
- /**
- * Adds a new runtime lifecycle listener.
- * Has no effect if an identical listener is already registered.
- *
- * @param listener a runtime lifecycle listener
- * @see #removeRuntimeLifecycleListener(IRuntimeLifecycleListener)
- */
- public static void addRuntimeLifecycleListener(IRuntimeLifecycleListener listener) {
- getResourceManager().addRuntimeLifecycleListener(listener);
- }
-
- /**
- * Removes a runtime lifecycle listener.
- * Has no effect if the listener is not registered.
- *
- * @param listener a runtime lifecycle listener
- * @see #addRuntimeLifecycleListener(IRuntimeLifecycleListener)
- */
- public static void removeRuntimeLifecycleListener(IRuntimeLifecycleListener listener) {
- getResourceManager().removeRuntimeLifecycleListener(listener);
- }
-
- /**
- * Adds a new server lifecycle listener.
- * Has no effect if an identical listener is already registered.
- *
- * @param listener a server lifecycle listener
- * @see #removeServerLifecycleListener(IServerLifecycleListener)
- */
- public static void addServerLifecycleListener(IServerLifecycleListener listener) {
- getResourceManager().addServerLifecycleListener(listener);
- }
-
- /**
- * Removes a server lifecycle listener.
- * Has no effect if the listener is not registered.
- *
- * @param listener a server lifecycle listener
- * #addServerLifecycleListener(IServerLifecycleListener)
- */
- public static void removeServerLifecycleListener(IServerLifecycleListener listener) {
- getResourceManager().removeServerLifecycleListener(listener);
- }
-
- /**
- * Sort the given list of IOrdered items into indexed order.
- *
- * @param list java.util.List
- * @return java.util.List
- */
- private static List sortOrderedList(List list) {
- if (list == null)
- return null;
-
- int size = list.size();
- for (int i = 0; i < size - 1; i++) {
- for (int j = i + 1; j < size; j++) {
- IOrdered a = (IOrdered) list.get(i);
- IOrdered b = (IOrdered) list.get(j);
- if (a.getOrder() > b.getOrder()) {
- Object temp = a;
- list.set(i, b);
- list.set(j, temp);
- }
- }
- }
- return list;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/ServerUtil.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/ServerUtil.java
deleted file mode 100644
index d9381d0..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/ServerUtil.java
+++ /dev/null
@@ -1,677 +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.core;
-
-import java.util.*;
-
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-
-import org.eclipse.wst.server.core.internal.ModuleFactory;
-import org.eclipse.wst.server.core.internal.ServerPlugin;
-import org.eclipse.wst.server.core.internal.Trace;
-/**
- * Server utility methods.
- *
- * @since 1.0
- */
-public class ServerUtil {
- /**
- * Static class - cannot create an instance.
- */
- private ServerUtil() {
- // do nothing
- }
-
- /**
- * Returns the project modules attached to a project.
- */
- public static IModule[] getModules(IProject project) {
- if (project == null)
- return null;
-
- List list = new ArrayList();
- IModule[] modules = getModules();
- if (modules != null) {
- int size = modules.length;
- for (int i = 0; i < size; i++) {
- if (modules[i] != null && project.equals(modules[i].getProject()))
- list.add(modules[i]);
- }
- }
-
- IModule[] modules2 = new IModule[list.size()];
- list.toArray(modules2);
- return modules2;
- }
-
- /**
- * Returns a module from the given moduleId. The moduleId must not be null.
- *
- * @param moduleId
- * @return the module
- */
- public static IModule getModule(String moduleId) {
- if (moduleId == null)
- throw new IllegalArgumentException();
-
- int index = moduleId.indexOf(":");
- if (index <= 0)
- return null;
-
- String factoryId = moduleId.substring(0, index);
- ModuleFactory moduleFactory = ServerPlugin.findModuleFactory(factoryId);
- if (moduleFactory == null)
- return null;
-
- String moduleSubId = moduleId.substring(index+1);
- IModule module = moduleFactory.getModule(moduleSubId);
- if (module != null)
- return module;
- return null;
- }
-
- /**
- * Return all the available modules from all factories whose
- * type matches the given module types.
- *
- * @param moduleTypes
- * @return a possibly empty array of modules
- */
- public static IModule[] getModules(IModuleType[] moduleTypes) {
- List list = new ArrayList();
-
- ModuleFactory[] factories = ServerPlugin.getModuleFactories();
- if (factories != null) {
- int size = factories.length;
- for (int i = 0; i < size; i++) {
- if (isSupportedModule(factories[i].getModuleTypes(), moduleTypes)) {
- IModule[] modules = factories[i].getModules();
- if (modules != null) {
- int size2 = modules.length;
- for (int j = 0; j < size2; j++)
- list.add(modules[j]);
- }
- }
- }
- }
- IModule[] modules = new IModule[list.size()];
- list.toArray(modules);
- return modules;
- }
-
- /**
- * Return all the available modules from all factories whose
- * type matches the given module type id.
- *
- * @param type
- * @return a possibly empty array of modules
- */
- public static IModule[] getModules(String type) {
- List list = new ArrayList();
-
- ModuleFactory[] factories = ServerPlugin.getModuleFactories();
- if (factories != null) {
- int size = factories.length;
- for (int i = 0; i < size; i++) {
- if (isSupportedModule(factories[i].getModuleTypes(), type, null)) {
- IModule[] modules = factories[i].getModules();
- if (modules != null) {
- int size2 = modules.length;
- for (int j = 0; j < size2; j++)
- list.add(modules[j]);
- }
- }
- }
- }
- IModule[] modules = new IModule[list.size()];
- list.toArray(modules);
- return modules;
- }
-
- /**
- * Returns <code>true</code> if any of the given moduleTypes have the given
- * module type id and version id.
- *
- * @param moduleTypes
- * @param typeId
- * @param versionId
- * @return <code>true</code> if the module type is supported, and
- * <code>false</code> otherwise
- */
- public static boolean isSupportedModule(IModuleType[] moduleTypes, String typeId, String versionId) {
- if (moduleTypes != null) {
- int size = moduleTypes.length;
- for (int i = 0; i < size; i++) {
- if (isSupportedModule(moduleTypes[i], typeId, versionId))
- return true;
- }
- }
- return false;
- }
-
- private static boolean isSupportedModule(IModuleType[] moduleTypes, IModuleType[] mt) {
- if (mt != null) {
- int size = mt.length;
- for (int i = 0; i < size; i++) {
- if (isSupportedModule(moduleTypes, mt[i]))
- return true;
- }
- }
- return false;
- }
-
- /**
- * Returns <code>true</code> if any of the given moduleTypes match the given
- * module type.
- *
- * @param moduleTypes
- * @param mt
- * @return <code>true</code> if the module type is supported, and
- * <code>false</code> otherwise
- */
- public static boolean isSupportedModule(IModuleType[] moduleTypes, IModuleType mt) {
- if (moduleTypes != null) {
- int size = moduleTypes.length;
- for (int i = 0; i < size; i++) {
- if (isSupportedModule(moduleTypes[i], mt))
- return true;
- }
- }
- return false;
- }
-
- private static boolean isSupportedModule(IModuleType moduleType, String type, String version) {
- String type2 = moduleType.getId();
- if (matches(type, type2)) {
- String version2 = moduleType.getVersion();
- if (matches(version, version2))
- return true;
- }
- return false;
- }
-
- /**
- * Returns true if the two given module types are compatible. The moduleTypes may not
- * be null.
- *
- * @param moduleType
- * @param mt
- * @return <code>true</code> if the module type is supported, and
- * <code>false</code> otherwise
- */
- public static boolean isSupportedModule(IModuleType moduleType, IModuleType mt) {
- if (moduleType == null || mt == null)
- throw new IllegalArgumentException();
-
- String type2 = moduleType.getId();
- if (matches(mt.getId(), type2)) {
- String version2 = moduleType.getVersion();
- if (matches(mt.getVersion(), version2))
- return true;
- }
- return false;
- }
-
- private static boolean matches(String a, String b) {
- if (a == null || b == null || "*".equals(a) || "*".equals(b) || a.startsWith(b) || b.startsWith(a))
- return true;
- return false;
- }
-
- /**
- * Return all the available modules from all factories.
- *
- * @return IModule[]
- */
- private static IModule[] getModules() {
- List list = new ArrayList();
-
- ModuleFactory[] factories = ServerPlugin.getModuleFactories();
- if (factories != null) {
- int size = factories.length;
- for (int i = 0; i < size; i++) {
- IModule[] modules = factories[i].getModules();
- if (modules != null) {
- int size2 = modules.length;
- for (int j = 0; j < size2; j++) {
- if (!list.contains(modules[j]))
- list.add(modules[j]);
- }
- }
- }
- }
- IModule[] modules = new IModule[list.size()];
- list.toArray(modules);
- return modules;
- }
-
- /**
- * Adds or removes modules from a server. Will search for the first parent module
- * of each module and add it to the server instead. This method will handle multiple
- * modules having the same parent (the parent will only be added once), but may not
- * handle the case where the same module or parent is being both added and removed.
- *
- * @param server
- * @param add
- * @param remove
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @throws CoreException
- */
- public static void modifyModules(IServerWorkingCopy server, IModule[] add, IModule[] remove, IProgressMonitor monitor) throws CoreException {
- if (server == null)
- throw new IllegalArgumentException();
-
- if (add == null)
- add = new IModule[0];
- if (remove == null)
- remove = new IModule[0];
-
- int size = add.length;
- List addParentModules = new ArrayList();
- for (int i = 0; i < size; i++) {
- boolean found = false;
- try {
- IModule[] parents = server.getRootModules(add[i], monitor);
- if (parents != null) {
- found = true;
- if (parents.length > 0) {
- Object parent = parents[0];
- found = true;
- if (!addParentModules.contains(parent))
- addParentModules.add(parent);
- }
- }
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Could not find parent module", e);
- }
-
- if (!found)
- addParentModules.add(add[i]);
- }
-
- size = remove.length;
- List removeParentModules = new ArrayList();
- for (int i = 0; i < size; i++) {
- boolean found = false;
- try {
- IModule[] parents = server.getRootModules(remove[i], monitor);
- if (parents != null) {
- found = true;
- if (parents.length > 0) {
- Object parent = parents[0];
- found = true;
- if (!removeParentModules.contains(parent))
- removeParentModules.add(parent);
- }
- }
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Could not find parent module 2", e);
- }
-
- if (!found)
- removeParentModules.add(remove[i]);
- }
-
- IModule[] add2 = new IModule[addParentModules.size()];
- addParentModules.toArray(add2);
- IModule[] remove2 = new IModule[removeParentModules.size()];
- removeParentModules.toArray(remove2);
-
- server.modifyModules(add2, remove2, monitor);
- }
-
- /**
- * Sets a default name on the given runtime.
- *
- * @param wc
- */
- public static void setRuntimeDefaultName(IRuntimeWorkingCopy wc) {
- String typeName = wc.getRuntimeType().getName();
-
- String name = ServerPlugin.getResource("%defaultRuntimeName", new String[] {typeName});
- int i = 2;
- while (isNameInUse(name)) {
- name = ServerPlugin.getResource("%defaultRuntimeName2", new String[] {typeName, i + ""});
- i++;
- }
- wc.setName(name);
- }
-
- /**
- * Sets a default name on the given server.
- *
- * @param wc
- */
- public static void setServerDefaultName(IServerWorkingCopy wc) {
- if (wc == null)
- throw new IllegalArgumentException();
-
- String typeName = wc.getServerType().getName();
- String host = wc.getHost();
-
- String name = ServerPlugin.getResource("%defaultServerName", new String[] {typeName, host});
- int i = 2;
- while (isNameInUse(name)) {
- name = ServerPlugin.getResource("%defaultServerName2", new String[] {typeName, host, i + ""});
- i++;
- }
- wc.setName(name);
- }
-
- private static boolean isValidFilename(String name) {
- IStatus status = ResourcesPlugin.getWorkspace().validateName(name, IResource.FILE);
- if (status != null && !status.isOK())
- return false;
-
- status = ResourcesPlugin.getWorkspace().validateName(name, IResource.FOLDER);
- if (status != null && !status.isOK())
- return false;
-
- return true;
- }
-
- private static String getValidFileName(String name) {
- if (isValidFilename(name))
- return name;
-
- // remove invalid characters
- String[] s = new String[] {".", "\\", "/", "?", ":", "*", "\"", "|", "<", ">"};
- int ind = 0;
- while (ind < s.length) {
- int index = name.indexOf(s[ind]);
- while (index >= 0) {
- name = name.substring(0, index) + name.substring(index+1);
- index = name.indexOf(s[ind]);
- }
- ind++;
- }
- return name;
- }
-
- /**
- * Returns an unused file in the given project.
- *
- * @param project
- * @param type
- * @return an unused file within the given project
- */
- public static IFile getUnusedServerFile(IProject project, IServerType type) {
- if (project == null || type == null)
- throw new IllegalArgumentException();
-
- String typeName = getValidFileName(type.getName());
- String name = ServerPlugin.getResource("%defaultServerName3", new String[] {typeName})+ "." + IServerAttributes.FILE_EXTENSION;
- int i = 2;
- while (isFileNameInUse(project, name)) {
- name = ServerPlugin.getResource("%defaultServerName4", new String[] {typeName, i + ""}) + "." + IServerAttributes.FILE_EXTENSION;
- i++;
- }
- return project.getFile(name);
- }
-
- /**
- * Returns true if a server or runtime exists with the given name.
- *
- * @param name java.lang.String
- * @return <code>true</code> if the name is in use, and <code>false</code>
- * otherwise
- */
- private static boolean isNameInUse(String name) {
- if (name == null)
- return true;
-
- List list = new ArrayList();
-
- addAll(list, ServerCore.getRuntimes());
- addAll(list, ServerCore.getServers());
-
- Iterator iterator = list.iterator();
- while (iterator.hasNext()) {
- Object obj = iterator.next();
- if (obj instanceof IServerAttributes && name.equalsIgnoreCase(((IServerAttributes)obj).getName()))
- return true;
- if (obj instanceof IRuntime && name.equalsIgnoreCase(((IRuntime)obj).getName()))
- return true;
- }
-
- return false;
- }
-
- private static void addAll(List list, Object[] obj) {
- if (obj == null)
- return;
-
- int size = obj.length;
- for (int i = 0; i < size; i++) {
- list.add(obj[i]);
- }
- }
-
- /**
- * Returns true if an element exists with the given name.
- *
- * @param project
- * @param name
- * @return boolean
- */
- private static boolean isFileNameInUse(IProject project, String name) {
- if (name == null || project == null)
- return false;
-
- if (project.getFile(name).exists())
- return true;
- if (project.getFolder(name).exists())
- return true;
-
- return false;
- }
-
- /**
- * Return a list of all runtime targets that match the given type and version.
- * If type or version is null, it matches all of that type or version.
- *
- * @param type
- * @param version
- * @return a possibly-empty array of runtime instances {@link IRuntime}
- */
- public static IRuntime[] getRuntimes(String type, String version) {
- List list = new ArrayList();
- IRuntime[] runtimes = ServerCore.getRuntimes();
- if (runtimes != null) {
- int size = runtimes.length;
- for (int i = 0; i < size; i++) {
- IRuntimeType runtimeType = runtimes[i].getRuntimeType();
- if (runtimeType != null && isSupportedModule(runtimeType.getModuleTypes(), type, version)) {
- list.add(runtimes[i]);
- }
- }
- }
-
- IRuntime[] runtimes2 = new IRuntime[list.size()];
- list.toArray(runtimes2);
- return runtimes2;
- }
-
- /**
- * Return a list of all runtime types that match the given type and version.
- * If type or version is null, it matches all of that type or version.
- *
- * @param type
- * @param version
- * @return a possibly-empty array of runtime type instances {@link IRuntimeType}
- */
- public static IRuntimeType[] getRuntimeTypes(String type, String version) {
- List list = new ArrayList();
- IRuntimeType[] runtimeTypes = ServerCore.getRuntimeTypes();
- if (runtimeTypes != null) {
- int size = runtimeTypes.length;
- for (int i = 0; i < size; i++) {
- if (isSupportedModule(runtimeTypes[i].getModuleTypes(), type, version)) {
- list.add(runtimeTypes[i]);
- }
- }
- }
-
- IRuntimeType[] rt = new IRuntimeType[list.size()];
- list.toArray(rt);
- return rt;
- }
-
- /**
- * Return a list of all runtime types that match the given type, version,
- * and partial runtime type id. If type, version, or runtimeTypeId is null,
- * it matches all of that type or version.
- *
- * @param type
- * @param version
- * @return a possibly-empty array of runtime type instances {@link IRuntimeType}
- */
- public static IRuntimeType[] getRuntimeTypes(String type, String version, String runtimeTypeId) {
- List list = new ArrayList();
- IRuntimeType[] runtimeTypes = ServerCore.getRuntimeTypes();
- if (runtimeTypes != null) {
- int size = runtimeTypes.length;
- for (int i = 0; i < size; i++) {
- if (isSupportedModule(runtimeTypes[i].getModuleTypes(), type, version)) {
- if (runtimeTypeId == null || runtimeTypes[i].getId().startsWith(runtimeTypeId))
- list.add(runtimeTypes[i]);
- }
- }
- }
-
- IRuntimeType[] rt = new IRuntimeType[list.size()];
- list.toArray(rt);
- return rt;
- }
-
- /**
- * Returns a list of all servers that this deployable is not currently
- * configured on, but could be added to. If includeErrors is true, this
- * method return servers where the parent deployable may throw errors. For
- * instance, this deployable may be the wrong spec level.
- *
- * @param module com.ibm.etools.server.core.IModule
- * @param includeErrors
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @return com.ibm.etools.server.core.IServer[]
- */
- public static IServer[] getAvailableServersForModule(IModule module, boolean includeErrors, IProgressMonitor monitor) {
- if (module == null)
- return new IServer[0];
-
- // do it the slow way - go through all servers and
- // see if this deployable is not configured in it
- // but could be added
- List list = new ArrayList();
- IServer[] servers = ServerCore.getServers();
- if (servers != null) {
- int size = servers.length;
- for (int i = 0; i < size; i++) {
- if (!containsModule(servers[i], module, monitor)) {
- try {
- IModule[] parents = servers[i].getRootModules(module, monitor);
- if (parents != null && parents.length > 0) {
- boolean found = false;
- if (parents != null) {
- int size2 = parents.length;
- for (int j = 0; !found && j < size2; j++) {
- IModule parent = parents[j];
- IStatus status = servers[i].canModifyModules(new IModule[] { parent }, new IModule[0], monitor);
- if (status == null || status.isOK()){
- list.add(servers[i]);
- found = true;
- }
- }
- }
- }
- } catch (Exception se) {
- if (includeErrors)
- list.add(servers[i]);
- }
- }
- }
- }
-
- // make sure that the preferred server is the first one
- //IServer server = ServerCore.getServerPreferences().getDeployableServerPreference(deployable);
- //if (server != null && list.contains(server) && list.indexOf(server) != 0) {
- // list.remove(server);
- // list.add(0, server);
- //}
-
- IServer[] allServers = new IServer[list.size()];
- list.toArray(allServers);
- return allServers;
- }
-
- /**
- * Returns a list of all servers that this module is configured on.
- *
- * @param module org.eclipse.wst.server.core.model.IModule
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @return a possibly-empty array of server instances {@link IServer}
- */
- public static IServer[] getServersByModule(IModule module, IProgressMonitor monitor) {
- if (module == null)
- return new IServer[0];
-
- // do it the slow way - go through all servers and
- // see if this module is configured in it
- List list = new ArrayList();
- IServer[] servers = ServerCore.getServers();
- if (servers != null) {
- int size = servers.length;
- for (int i = 0; i < size; i++) {
- if (containsModule(servers[i], module, monitor))
- list.add(servers[i]);
- }
- }
-
- IServer[] allServers = new IServer[list.size()];
- list.toArray(allServers);
- return allServers;
- }
-
- /**
- * Returns true if the given server currently contains the given module.
- *
- * @param server org.eclipse.wst.server.core.IServer
- * @param module org.eclipse.wst.server.core.IModule
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @return boolean
- */
- public static boolean containsModule(IServer server, IModule module, IProgressMonitor monitor) {
- if (server == null)
- return false;
- Trace.trace(Trace.FINEST, "containsModule() " + server + " " + module);
- try {
- IModule[] modules = ServerPlugin.getAllContainedModules(server, monitor);
- if (modules != null) {
- int size = modules.length;
- for (int i = 0; i < size; i++) {
- Trace.trace(Trace.FINEST, "module: " + modules[i] + " " + module.equals(modules[i]));
- if (module.equals(modules[i]))
- return true;
- }
- }
- } catch (Throwable t) {
- // ignore
- }
- return false;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/TaskModel.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/TaskModel.java
deleted file mode 100644
index 93673c8..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/TaskModel.java
+++ /dev/null
@@ -1,76 +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.core;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * This interface represents a task model that can be shared between multiple
- * tasks in a common workflow.
- *
- * <p>This interface is not intended to be implemented by clients.</p>
- *
- * @since 1.0
- */
-public class TaskModel {
- /**
- * Task model id for an IRuntime.
- */
- public static final String TASK_RUNTIME = "runtime";
-
- /**
- * Task model id for an IServer.
- */
- public static final String TASK_SERVER = "server";
-
- /**
- * Task model id for an array of module parents.
- */
- public static final String TASK_MODULE_PARENTS = "module-parents";
-
- /**
- * Task model id for an array of modules.
- */
- public static final String TASK_MODULES = "modules";
-
- /**
- * Task model id for a launch mode.
- */
- public static final String TASK_LAUNCH_MODE = "launch-mode";
-
- private Map map = new HashMap();
-
- /**
- * Returns the object in the task model with the given id.
- *
- * @param id an id for the object
- * @return the object with the given id, or <code>null</code>
- * if no object could be found with that id
- */
- public Object getObject(String id) {
- try {
- return map.get(id);
- } catch (Exception e) {
- return null;
- }
- }
-
- /**
- * Put an object into the task model with the given id.
- *
- * @param id the id to associate the object with
- * @param obj an object, or <code>null</code> to reset the id
- */
- public void putObject(String id, Object obj) {
- map.put(id, obj);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Base.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Base.java
deleted file mode 100644
index c404bbb..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Base.java
+++ /dev/null
@@ -1,349 +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.core.internal;
-
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.*;
-/**
- * Helper class for storing runtime and server attributes.
- */
-public abstract class Base {
- protected static final String PROP_LOCKED = "locked";
- protected static final String PROP_PRIVATE = "private";
- protected static final String PROP_NAME = "name";
- protected static final String PROP_ID = "id";
-
- protected Map map = new HashMap();
-
- // file loaded from, or null if it is saved in metadata
- protected IFile file;
-
- public Base(IFile file) {
- this.file = file;
- }
-
- public Base(IFile file, String id) {
- this.file = file;
- //this.map = map;
- map.put(PROP_ID, id);
- }
-
- public int getTimestamp() {
- return getAttribute("timestamp", -1);
- }
-
- public IFile getFile() {
- return file;
- }
-
- public String getAttribute(String attributeName, String defaultValue) {
- try {
- Object obj = map.get(attributeName);
- if (obj == null)
- return defaultValue;
- return (String) obj;
- } catch (Exception e) {
- // ignore
- }
- return defaultValue;
- }
-
- public int getAttribute(String attributeName, int defaultValue) {
- try {
- Object obj = map.get(attributeName);
- if (obj == null)
- return defaultValue;
- return Integer.parseInt((String) obj);
- } catch (Exception e) {
- // ignore
- }
- return defaultValue;
- }
-
- public boolean getAttribute(String attributeName, boolean defaultValue) {
- try {
- Object obj = map.get(attributeName);
- if (obj == null)
- return defaultValue;
- return Boolean.valueOf((String) obj).booleanValue();
- } catch (Exception e) {
- // ignore
- }
- return defaultValue;
- }
-
- public List getAttribute(String attributeName, List defaultValue) {
- try {
- Object obj = map.get(attributeName);
- if (obj == null)
- return defaultValue;
- List list = (List) obj;
- if (list != null)
- return list;
- } catch (Exception e) {
- // ignore
- }
- return defaultValue;
- }
-
- public Map getAttribute(String attributeName, Map defaultValue) {
- try {
- Object obj = map.get(attributeName);
- if (obj == null)
- return defaultValue;
- Map map2 = (Map) obj;
- if (map2 != null)
- return map2;
- } catch (Exception e) {
- // ignore
- }
- return defaultValue;
- }
-
- public String getId() {
- return getAttribute(PROP_ID, "");
- }
-
- public String getName() {
- return getAttribute(PROP_NAME, "");
- }
-
- public boolean isReadOnly() {
- return getAttribute(PROP_LOCKED, false);
- }
-
- public boolean isPrivate() {
- return getAttribute(PROP_PRIVATE, false);
- }
-
- public boolean isWorkingCopy() {
- return false;
- }
-
- protected abstract String getXMLRoot();
-
- protected void save(IMemento memento) {
- //IMemento child = memento.createChild("properties");
- IMemento child = memento;
- Iterator iterator = map.keySet().iterator();
- while (iterator.hasNext()) {
- String key = (String) iterator.next();
- Object obj = map.get(key);
- if (obj instanceof String)
- child.putString(key, (String) obj);
- else if (obj instanceof Integer) {
- Integer in = (Integer) obj;
- child.putInteger(key, in.intValue());
- } else if (obj instanceof Boolean) {
- Boolean bool = (Boolean) obj;
- child.putBoolean(key, bool.booleanValue());
- } else if (obj instanceof List) {
- List list = (List) obj;
- saveList(child, key, list);
- } else if (obj instanceof Map) {
- Map map2 = (Map) obj;
- saveMap(child, key, map2);
-
- }
- }
- saveState(child);
- }
- protected void saveMap(IMemento memento, String key, Map map2) {
- IMemento child = memento.createChild("map");
- child.putString("key", key);
- Iterator iterator = map2.keySet().iterator();
- while (iterator.hasNext()) {
- String s = (String) iterator.next();
- child.putString(s, (String)map2.get(s));
- }
- }
-
- protected void saveList(IMemento memento, String key, List list) {
- IMemento child = memento.createChild("list");
- child.putString("key", key);
- int i = 0;
- Iterator iterator = list.iterator();
- while (iterator.hasNext()) {
- String s = (String) iterator.next();
- child.putString("value" + (i++), s);
- }
- }
-
- protected void saveToFile(IProgressMonitor monitor) throws CoreException {
- try {
- XMLMemento memento = XMLMemento.createWriteRoot(getXMLRoot());
- save(memento);
-
- InputStream in = memento.getInputStream();
- if (file.exists())
- file.setContents(in, true, true, ProgressUtil.getSubMonitorFor(monitor, 1000));
- else
- file.create(in, true, ProgressUtil.getSubMonitorFor(monitor, 1000));
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not save " + getXMLRoot(), e);
- throw new CoreException(new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0, ServerPlugin.getResource("%errorSaving", getFile().toString()), e));
- }
- }
-
- protected void doSave(IProgressMonitor monitor) throws CoreException {
- if (file != null)
- saveToFile(monitor);
- else
- saveToMetadata(monitor);
- ResourceManager.getInstance().resolveServers();
- }
-
- protected void saveToMetadata(IProgressMonitor monitor) {
- // do nothing
- }
-
- protected abstract void saveState(IMemento memento);
-
- protected void load(IMemento memento) {
- map = new HashMap();
-
- Iterator iterator = memento.getNames().iterator();
- while (iterator.hasNext()) {
- String key = (String) iterator.next();
- map.put(key, memento.getString(key));
- }
- IMemento[] children = memento.getChildren("list");
- if (children != null) {
- int size = children.length;
- for (int i = 0; i < size; i++) {
- loadList(children[i]);
- }
- }
- IMemento[] maps = memento.getChildren("map");
- if (maps != null) {
- for (int i = 0; i <maps.length ; i++) {
- loadMap(maps[i]);
- }
- }
-
- loadState(memento);
- }
-
-
- protected void loadMap(IMemento memento) {
- String key = memento.getString("key");
- Map vMap = new HashMap();
- List keys = memento.getNames();
- Iterator iterator = keys.iterator();
- while(iterator.hasNext()) {
- String s = (String)iterator.next();
- String v = memento.getString(s);
- vMap.put(s,v);
- }
- map.put(key, vMap);
- }
-
-
- protected void loadList(IMemento memento) {
- String key = memento.getString("key");
- List list = new ArrayList();
- int i = 0;
- String key2 = memento.getString("value" + (i++));
- while (key2 != null) {
- list.add(key2);
- key2 = memento.getString("value" + (i++));
- }
- map.put(key, list);
- }
-
- protected abstract void loadState(IMemento memento);
-
- protected void resolve() {
- // do nothing
- }
-
- public void delete() throws CoreException {
- if (file != null)
- file.delete(true, true, new NullProgressMonitor());
- else
- deleteFromMetadata();
- }
-
- protected void deleteFromMetadata() {
- // do nothing
- }
-
- public boolean equals(Object obj) {
- if (!(obj instanceof Base))
- return false;
-
- Base base = (Base) obj;
- if (getId() == null)
- return false;
- return getId().equals(base.getId());
- }
-
- /**
- *
- */
- protected void loadFromFile(IProgressMonitor monitor) throws CoreException {
- InputStream in = null;
- try {
- in = file.getContents();
- IMemento memento = XMLMemento.loadMemento(in);
- load(memento);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not load from file" + e.getMessage(), e);
- throw new CoreException(new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0, ServerPlugin.getResource("%errorLoading", getFile().toString()), e));
- } finally {
- try {
- in.close();
- } catch (Exception e) {
- // ignore
- }
- }
- }
-
- protected void loadFromMemento(IMemento memento, IProgressMonitor monitor) {
- load(memento);
- }
-
- /**
- *
- */
- protected void loadFromPath(IPath path, IProgressMonitor monitor) throws CoreException {
- FileInputStream fin = null;
- try {
- fin = new FileInputStream(path.toFile());
- IMemento memento = XMLMemento.loadMemento(fin);
- load(memento);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not load from path: " + e.getMessage(), e);
- throw new CoreException(new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0, ServerPlugin.getResource("%errorLoading", path.toString()), e));
- } finally {
- try {
- fin.close();
- } catch (Exception e) {
- // ignore
- }
- }
- }
-
- public IStatus validateEdit(Object context) {
- if (file == null)
- return null;
-
- return file.getWorkspace().validateEdit(new IFile[] { file }, context);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Client.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Client.java
deleted file mode 100644
index bf8db09..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Client.java
+++ /dev/null
@@ -1,108 +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.core.internal;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.debug.core.ILaunch;
-
-import org.eclipse.wst.server.core.ILaunchable;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.model.ClientDelegate;
-/**
- *
- * @since 1.0
- */
-public class Client implements IClient {
- private IConfigurationElement element;
- private ClientDelegate delegate;
-
- /**
- * LaunchableClient constructor comment.
- */
- public Client(IConfigurationElement element) {
- super();
- this.element = element;
- }
-
- /**
- * Returns the id of this LaunchableClient.
- *
- * @return java.lang.String
- */
- public String getId() {
- return element.getAttribute("id");
- }
-
- /*
- * @see IPublishManager#getDescription()
- */
- public String getDescription() {
- return element.getAttribute("description");
- }
-
- /*
- * @see IPublishManager#getLabel()
- */
- public String getName() {
- String label = element.getAttribute("name");
- if (label == null)
- return "n/a";
- return label;
- }
-
- /*
- * @see IPublishManager#getDelegate()
- */
- public ClientDelegate getDelegate() {
- if (delegate == null) {
- try {
- delegate = (ClientDelegate) element.createExecutableExtension("class");
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not create delegate" + toString() + ": " + e.getMessage());
- }
- }
- return delegate;
- }
-
- /**
- *
- */
- public boolean supports(IServer server, ILaunchable launchable, String launchMode) {
- try {
- return getDelegate().supports(server, launchable, launchMode);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error calling delegate " + toString() + ": " + e.getMessage());
- return false;
- }
- }
-
- /**
- * Opens or executes on the launchable.
- */
- public IStatus launch(IServer server, ILaunchable launchable, String launchMode, ILaunch launch) {
- try {
- return getDelegate().launch(server, launchable, launchMode, launch);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error calling delegate " + toString() + ": " + e.getMessage());
- }
- return null;
- }
-
- /**
- * Return a string representation of this object.
- *
- * @return java.lang.String
- */
- public String toString() {
- return "Client[" + getId() + "]";
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/DeletedModule.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/DeletedModule.java
deleted file mode 100644
index 5d63f37..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/DeletedModule.java
+++ /dev/null
@@ -1,80 +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 Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.server.core.internal;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IModuleType;
-import org.eclipse.wst.server.core.model.IModuleListener;
-/**
- *
- * @since 1.0
- */
-public class DeletedModule implements IModule {
- protected String id;
-
- public DeletedModule(String id) {
- this.id = id;
- }
-
- public String getId() {
- return id;
- }
-
- public IStatus validate(IProgressMonitor monitor) {
- return null;
- }
-
- public String getName() {
- return null;
- }
-
- public IModuleType getModuleType() {
- return null;
- }
-
- public IProject getProject() {
- return null;
- }
-
- public void addModuleListener(IModuleListener listener) {
- // ignore
- }
-
- public void removeModuleListener(IModuleListener listener) {
- // ignore
- }
-
- public IModule[] getChildModules(IProgressMonitor monitor) {
- return null;
- }
-
- public Object getAdapter(Class adapter) {
- return null;
- }
-
- public boolean equals(Object obj) {
- if (!(obj instanceof IModule))
- return false;
-
- IModule m = (IModule) obj;
- if (!getId().equals(m.getId()))
- return false;
-
- return true;
- }
-
- public String toString() {
- return "Deleted module (" + getId() + ")";
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/IClient.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/IClient.java
deleted file mode 100644
index d834917..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/IClient.java
+++ /dev/null
@@ -1,77 +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.core.internal;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.wst.server.core.ILaunchable;
-import org.eclipse.wst.server.core.IServer;
-/**
- * A launchable client is a client side application or test
- * harness that can be launched (run) against a resource
- * running on a server.
- *
- * <p>This interface is not intended to be implemented by clients.</p>
- *
- * @since 1.0
- */
-public interface IClient {
- /**
- * Returns the id of this client. Each known client has a distinct id.
- * Ids are intended to be used internally as keys; they are not
- * intended to be shown to end users.
- *
- * @return the client id
- */
- public String getId();
-
- /**
- * Returns the displayable name for this client.
- * <p>
- * Note that this name is appropriate for the current locale.
- * </p>
- *
- * @return a displayable name for this client
- */
- public String getName();
-
- /**
- * Returns the displayable description for this client.
- * <p>
- * Note that this description is appropriate for the current locale.
- * </p>
- *
- * @return a displayable description for this client
- */
- public String getDescription();
-
- /**
- * Returns true if this launchable can be run by this client.
- *
- * @param server the server
- * @param launchable the launchable object
- * @param launchMode the mode
- * @return boolean
- */
- public boolean supports(IServer server, ILaunchable launchable, String launchMode);
-
- /**
- * Launches the client.
- *
- * @param server the server
- * @param launchable the launchable object
- * @param launchMode the mode
- * @param launch the launch
- * @return a status object with code <code>IStatus.OK</code> if the launch was
- * successful, otherwise a status object indicating what went wrong
- */
- public IStatus launch(IServer server, ILaunchable launchable, String launchMode, ILaunch launch);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ILaunchableAdapter.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ILaunchableAdapter.java
deleted file mode 100644
index a92749c..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ILaunchableAdapter.java
+++ /dev/null
@@ -1,45 +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.core.internal;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.server.core.ILaunchable;
-import org.eclipse.wst.server.core.IModuleArtifact;
-import org.eclipse.wst.server.core.IServer;
-/**
- * This interface, typically implemented by the server
- * code, converts from an IModuleArtifact to an
- * ILaunchable.
- *
- * <p>This interface is not intended to be implemented by clients.</p>
- *
- * @since 1.0
- */
-public interface ILaunchableAdapter {
- /**
- * Returns the id of this adapter. Each known adapter has a distinct id.
- * Ids are intended to be used internally as keys; they are not
- * intended to be shown to end users.
- *
- * @return the adapter id
- */
- public String getId();
-
- /**
- * Returns a launchable object from this module object.
- *
- * @param server the server
- * @param moduleArtifact an artifact in the module
- * @return a launchable object
- * @exception CoreException thrown if there is a problem returning the launchable
- */
- public ILaunchable getLaunchable(IServer server, IModuleArtifact moduleArtifact) throws CoreException;
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/IMemento.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/IMemento.java
deleted file mode 100644
index a082439..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/IMemento.java
+++ /dev/null
@@ -1,189 +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.core.internal;
-
-import java.util.List;
-/**
- * Interface to a memento used for saving the important state of an object
- * in a form that can be persisted in the file system.
- * <p>
- * Mementos were designed with the following requirements in mind:
- * <ol>
- * <li>Certain objects need to be saved and restored across platform sessions.
- * </li>
- * <li>When an object is restored, an appropriate class for an object might not
- * be available. It must be possible to skip an object in this case.</li>
- * <li>When an object is restored, the appropriate class for the object may be
- * different from the one when the object was originally saved. If so, the
- * new class should still be able to read the old form of the data.</li>
- * </ol>
- * </p>
- * <p>
- * Mementos meet these requirements by providing support for storing a
- * mapping of arbitrary string keys to primitive values, and by allowing
- * mementos to have other mementos as children (arranged into a tree).
- * A robust external storage format based on XML is used.
- * </p><p>
- * The key for an attribute may be any alpha numeric value. However, the
- * value of <code>TAG_ID</code> is reserved for internal use.
- * </p><p>
- * This interface is not intended to be implemented by clients.
- * </p>
- */
-public interface IMemento {
- /**
- * Special reserved key used to store the memento id
- * (value <code>"org.eclipse.ui.id"</code>).
- *
- * @see #getId
- */
- public static final String TAG_ID = "IMemento.internal.id"; //$NON-NLS-1$
-
- /**
- * Creates a new child of this memento with the given type.
- * <p>
- * The <code>getChild</code> and <code>getChildren</code> methods
- * are used to retrieve children of a given type.
- * </p>
- *
- * @param type the type
- * @return a new child memento
- * @see #getChild
- * @see #getChildren
- */
- public IMemento createChild(String type);
-
- /**
- * Creates a new child of this memento with the given type and id.
- * The id is stored in the child memento (using a special reserved
- * key, <code>TAG_ID</code>) and can be retrieved using <code>getId</code>.
- * <p>
- * The <code>getChild</code> and <code>getChildren</code> methods
- * are used to retrieve children of a given type.
- * </p>
- *
- * @param type the type
- * @param id the child id
- * @return a new child memento with the given type and id
- * @see #getId
- */
- public IMemento createChild(String type, String id);
-
- /**
- * Returns the first child with the given type id.
- *
- * @param type the type id
- * @return the first child with the given type
- */
- public IMemento getChild(String type);
-
- /**
- * Returns all children with the given type id.
- *
- * @param type the type id
- * @return the list of children with the given type
- */
- public IMemento[] getChildren(String type);
-
- /**
- * Returns the floating point value of the given key.
- *
- * @param key the key
- * @return the value, or <code>null</code> if the key was not found or was found
- * but was not a floating point number
- */
- public Float getFloat(String key);
-
- /**
- * Returns the id for this memento.
- *
- * @return the memento id, or <code>null</code> if none
- * @see #createChild(java.lang.String,java.lang.String)
- */
- public String getId();
-
- /**
- * Returns the name for this memento.
- *
- * @return the memento name, or <code>null</code> if none
- * @see #createChild(java.lang.String,java.lang.String)
- */
- public String getName();
-
- /**
- * Returns the integer value of the given key.
- *
- * @param key the key
- * @return the value, or <code>null</code> if the key was not found or was found
- * but was not an integer
- */
- public Integer getInteger(String key);
-
- /**
- * Returns the string value of the given key.
- *
- * @param key the key
- * @return the value, or <code>null</code> if the key was not found or was found
- * but was not an integer
- */
- public String getString(String key);
-
- /**
- * Returns the boolean value of the given key.
- *
- * @param key the key
- * @return the value, or <code>null</code> if the key was not found or was found
- * but was not a boolean
- */
- public Boolean getBoolean(String key);
-
- public List getNames();
-
- /**
- * Sets the value of the given key to the given floating point number.
- *
- * @param key the key
- * @param value the value
- */
- public void putFloat(String key, float value);
-
- /**
- * Sets the value of the given key to the given integer.
- *
- * @param key the key
- * @param value the value
- */
- public void putInteger(String key, int value);
-
- /**
- * Sets the value of the given key to the given boolean value.
- *
- * @param key the key
- * @param value the value
- */
- public void putBoolean(String key, boolean value);
-
- /**
- * Copy the attributes and children from <code>memento</code>
- * to the receiver.
- *
- * @param memento the IMemento to be copied.
- */
- public void putMemento(IMemento memento);
-
- /**
- * Sets the value of the given key to the given string.
- *
- * @param key the key
- * @param value the value
- */
- public void putString(String key, String value);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/IModuleVisitor.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/IModuleVisitor.java
deleted file mode 100644
index f2bdf96..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/IModuleVisitor.java
+++ /dev/null
@@ -1,29 +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.core.internal;
-
-import org.eclipse.wst.server.core.IModule;
-/**
- * A visitor on a server's modules.
- *
- * @since 1.0
- */
-public interface IModuleVisitor {
- /**
- * Visit a single module. Returns true to keep visiting, and
- * false if it should stop visiting the module.
- *
- * @param parents org.eclipse.wst.server.core.IModule[]
- * @param module org.eclipse.wst.server.core.IModule
- * @return boolean
- */
- public boolean visit(IModule[] parents, IModule module);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/IMonitoredServerPort.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/IMonitoredServerPort.java
deleted file mode 100644
index 2050b0e..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/IMonitoredServerPort.java
+++ /dev/null
@@ -1,58 +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.core.internal;
-
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.IServerPort;
-
-/**
- * An monitored port on a server.
- *
- * <p>This interface is not intended to be implemented by clients.</p>
- *
- * @since 1.0
- */
-public interface IMonitoredServerPort {
- /**
- * Returns the server that it being monitored.
- *
- * @return org.eclipse.wst.server.core.IServer
- */
- public IServer getServer();
-
- /**
- * Returns the server port.
- *
- * @return org.eclipse.wst.server.model.IServerPort
- */
- public IServerPort getServerPort();
-
- /**
- * Return the port that is being used to monitor.
- *
- * @return int
- */
- public int getMonitorPort();
-
- /**
- * Returns the content types that are being monitored, or null for all content.
- *
- * @return java.lang.String[]
- */
- public String[] getContentTypes();
-
- /**
- * Returns true if the monitor is currently running/active.
- *
- * @return boolean
- */
- public boolean isStarted();
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/IOrdered.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/IOrdered.java
deleted file mode 100644
index b4639d5..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/IOrdered.java
+++ /dev/null
@@ -1,35 +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.core.internal;
-/**
- * An object that has an absolute ordering, and can be ordered against other objects.
- *
- * <p>
- * [issue: It is notoriously difficult to place any kind of
- * useful order on objects that are contributed independently by
- * non-collaborating parties. The IOrdered mechanism is weak, and
- * can't really solve the problem. Issues of presentation are usually
- * best left to the UI, which can sort objects based on arbitrary
- * properties.]
- * </p>
- *
- * <p>This interface is not intended to be implemented by clients.</p>
- *
- * @since 1.0
- */
-public interface IOrdered {
- /**
- * Returns the order (index/priority).
- *
- * @return int
- */
- public int getOrder();
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/IPublishListener.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/IPublishListener.java
deleted file mode 100644
index 86da530..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/IPublishListener.java
+++ /dev/null
@@ -1,68 +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.core.internal;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IServer;
-/**
- * A publish listener is used to listen for publishing events from a server.
- * The events are typically received in the following order:
- *
- * publishStarted() - The publish operation is starting
- * publishModuleStarted() - This section is fired for each module in the server
- * publishModuleFinished() - This module is finished publishing
- * publishModuleStarted() - The next module is publishing
- * ...
- * publishFinished() - The publish operation is finished
- * <p>
- * Publish listeners are added to a server via IServer.addPublishListener().
- * </p>
- * @see IServer
- * @since 1.0
- */
-public interface IPublishListener {
- /**
- * Fired to notify that publishing has begun.
- *
- * @param server
- */
- public void publishStarted(IServer server);
-
- /**
- * Fired with the module to notify that publishing of this module
- * is starting.
- *
- * @param server
- * @param parents
- * @param module
- */
- public void publishModuleStarted(IServer server, IModule[] parents, IModule module);
-
- /**
- * The event is fired when the module has finished publishing,
- * and includes the status.
- *
- * @param server
- * @param parents
- * @param module
- * @param status
- */
- public void publishModuleFinished(IServer server, IModule[] parents, IModule module, IStatus status);
-
- /**
- * Publishing has finished. Returns the overall status.
- *
- * @param server
- * @param status
- */
- public void publishFinished(IServer server, IStatus status);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/IRuntimeLocator.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/IRuntimeLocator.java
deleted file mode 100644
index 43a7f29..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/IRuntimeLocator.java
+++ /dev/null
@@ -1,71 +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.core.internal;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.wst.server.core.IRuntimeWorkingCopy;
-/**
- * A runtime locator provides the ability to locate or search for additional
- * runtimes of a particular type.
- * <p>
- * Runtime locators are found via ServerCore.getRuntimeLocators().
- * </p>
- *
- * <p>This interface is not intended to be implemented by clients.</p>
- *
- * @since 1.0
- */
-public interface IRuntimeLocator {
- public interface IRuntimeSearchListener {
- /**
- * Called when a new runtime is found by the locator.
- * The runtime must never be null.
- *
- * @param runtime the runtime that was found.
- */
- public void runtimeFound(IRuntimeWorkingCopy runtime);
- }
-
- /**
- * Returns the id of this runtime locator.
- * Each known runtime locator has a distinct id.
- * Ids are intended to be used internally as keys; they are not
- * intended to be shown to end users.
- *
- * @return the runtime locator id
- */
- public String getId();
-
- /**
- * Returns true if the runtime locator can find runtimes of the given type.
- * The id should never be null.
- *
- * @param runtimeTypeId the id of a runtime type
- * @return boolean
- */
- public boolean supportsType(String runtimeTypeId);
-
- /**
- * Searches for local runtimes.
- * It uses the callback listener to report runtimes that are found.
- * The path contains the absolute path of the folder to search in,
- * or <code>null</code> to search the entire machine.
- *
- * @param path the path to search for runtimes in
- * @param listener a listener to report status to
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @throws CoreException
- */
- public void searchForRuntimes(IPath path, IRuntimeSearchListener listener, IProgressMonitor monitor) throws CoreException;
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/IServerLocator.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/IServerLocator.java
deleted file mode 100644
index 60ba1d8..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/IServerLocator.java
+++ /dev/null
@@ -1,85 +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.core.internal;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.wst.server.core.IServerWorkingCopy;
-/**
- * A server locator provides the ability to locate or search for additional
- * servers of a particular type, on a particular host.
- * <p>
- * Server locators are found via ServerCore.getServerLocators().
- * </p>
- *
- * <p>This interface is not intended to be implemented by clients.</p>
- *
- * @since 1.0
- */
-public interface IServerLocator {
- public interface IServerSearchListener {
- /**
- * Called when a new server is found by the locator.
- * The server must never be null.
- *
- * @param server the runtime that was found.
- */
- public void serverFound(IServerWorkingCopy server);
- }
-
- /**
- * Returns the id of this server locator.
- * Each known server locator has a distinct id.
- * Ids are intended to be used internally as keys; they are not
- * intended to be shown to end users.
- *
- * @return the server locator id
- */
- public String getId();
-
- /**
- * Returns true if the server locator can find servers of the given type.
- * The id should never be null.
- *
- * @param serverTypeId the id of a server type
- * @return boolean
- */
- public boolean supportsType(String serverTypeId);
-
- /**
- * Returns <code>true</code> if this type of server can run on a remote host.
- * Returns <code>false</code> if the server type can only be run on "localhost"
- * (the local machine).
- * <p>
- * [issue: Should be renamed "supportsRemoteHost" (no "s").]
- * </p>
- * <p>
- * [issue: Again, it seems odd to me that this is something
- * hard-wired to a server type.]
- * </p>
- *
- * @return <code>true</code> if this type of server can run on
- * a remote host, and <code>false</code> if it cannot
- */
- public boolean supportsRemoteHosts();
-
- /**
- * Searches for servers.
- * It uses the callback listener to report servers that are found.
- *
- * @param host a host string conforming to RFC 2732
- * @param listener a listener to report status to
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @throws CoreException
- */
- public void searchForServers(String host, IServerSearchListener listener, IProgressMonitor monitor) throws CoreException;
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/IServerMonitor.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/IServerMonitor.java
deleted file mode 100644
index 1741aff..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/IServerMonitor.java
+++ /dev/null
@@ -1,57 +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.core.internal;
-/**
- * An interface to a TCP/IP monitor.
- *
- * <p>This interface is not intended to be implemented by clients.</p>
- *
- * @since 1.0
- */
-public interface IServerMonitor {
- /**
- * Returns the id of the monitor.
- *
- * @return java.lang.String
- */
- public String getId();
-
- /**
- * Returns the label (name) of this monitor.
- *
- * @return java.lang.String
- */
- public String getName();
-
- /**
- * Returns the description of this monitor.
- *
- * @return java.lang.String
- */
- public String getDescription();
-
- /**
- * Start monitoring the given port, and return the port number to
- * tunnel requests through. The monitorPort is the new port to use, or
- * -1 to pick a random port.
- *
- * @param port
- * @return
- */
- //public int startMonitoring(IServer server, IServerPort port, int monitorPort) throws CoreException;
-
- /**
- * Stop monitoring the given port.
- *
- * @param port
- */
- //public void stopMonitoring(IServer server, IServerPort port);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/IServerMonitorManager.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/IServerMonitorManager.java
deleted file mode 100644
index 390eac3..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/IServerMonitorManager.java
+++ /dev/null
@@ -1,75 +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.core.internal;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.IServerPort;
-/**
- *
- * <p>This interface is not intended to be implemented by clients.</p>
- *
- * @since 1.0
- */
-public interface IServerMonitorManager {
- /**
- * Returns the array of ports that are currently being monitored.
- *
- * @return an array containing the monitored ports for this server
- */
- public IMonitoredServerPort[] getMonitoredPorts(IServer server);
-
- /**
- * Starts monitoring the given port, and returns the new port # to use that will
- * route to the monitored port.
- *
- * @param server
- * @param port
- * @param monitorPort - the new port number to use for monitoring, or -1 to pick a new port
- * @param content
- * @return monitor port number
- */
- public IMonitoredServerPort createMonitor(IServer server, IServerPort port, int monitorPort, String[] content);
-
- /**
- * Stop monitoring the given port. Throws a CoreException if there was a problem
- * stopping the monitoring
- *
- * @param msp the monitored port
- */
- public void removeMonitor(IMonitoredServerPort msp);
-
- /**
- * Start the monitor. If the msp port is -1, it will be updated to the port that is actually in use.
- *
- * @param msp the monitored port
- * @throws CoreException
- */
- public void startMonitor(IMonitoredServerPort msp) throws CoreException;
-
- /**
- * Stop monitoring.
- *
- * @param msp the monitored port
- */
- public void stopMonitor(IMonitoredServerPort msp);
-
- /**
- * Returns the monitored port to use when making requests to the given server, port number,
- * and content. Returns the existing port number if the port is not being monitored.
- *
- * @param server
- * @param port
- * @param contentType
- * @return the monitored port number
- */
- public int getMonitoredPort(IServer server, int port, String contentType);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/IServerTask.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/IServerTask.java
deleted file mode 100644
index fba7803..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/IServerTask.java
+++ /dev/null
@@ -1,50 +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.core.internal;
-
-import java.util.List;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IOptionalTask;
-import org.eclipse.wst.server.core.IServer;
-/**
- * A task for a server.
- *
- * <p>This interface is not intended to be implemented by clients.</p>
- *
- * @since 1.0
- */
-public interface IServerTask {
- /**
- * Returns the id of the adapter.
- *
- * @return java.lang.String
- */
- public String getId();
-
- /**
- * Returns true if the given type (given by the id) can use this task. This
- * result is based on the result of the getTypeIds() method.
- *
- * @return boolean
- */
- public boolean supportsType(String id);
-
- /**
- * Lets the task know that it is about to be used. This method should
- * be used to clean out any previously cached information, or start to
- * create a new cache.
- *
- * @param server org.eclipse.wst.server.core.IServer
- * @param parents java.util.List[]
- * @param modules org.eclipse.wst.server.core.IModule[]
- */
- public IOptionalTask[] getTasks(IServer server, List[] parents, IModule[] modules);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/IStartup.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/IStartup.java
deleted file mode 100644
index 43e2312..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/IStartup.java
+++ /dev/null
@@ -1,25 +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.core.internal;
-/**
- * An interface for the startup extension point.
- * Plug-ins that register a startup extension will be activated when the server
- * core plug-in initializes and have an opportunity to run code that can't be
- * implemented using the normal contribution mechanisms.
- *
- * @since 1.0
- */
-public interface IStartup {
- /**
- * Will be called on server core startup.
- */
- public void startup();
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/LaunchableAdapter.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/LaunchableAdapter.java
deleted file mode 100644
index dc0ca9b..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/LaunchableAdapter.java
+++ /dev/null
@@ -1,74 +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.core.internal;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-
-import org.eclipse.wst.server.core.ILaunchable;
-import org.eclipse.wst.server.core.IModuleArtifact;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.model.*;
-/**
- *
- */
-public class LaunchableAdapter implements ILaunchableAdapter {
- private IConfigurationElement element;
- private LaunchableAdapterDelegate delegate;
-
- /**
- * LaunchableAdapter constructor comment.
- */
- public LaunchableAdapter(IConfigurationElement element) {
- super();
- this.element = element;
- }
-
- /**
- * Returns the id of this LaunchableAdapter.
- *
- * @return java.lang.String
- */
- public String getId() {
- return element.getAttribute("id");
- }
-
- public LaunchableAdapterDelegate getDelegate() {
- if (delegate == null) {
- try {
- delegate = (LaunchableAdapterDelegate) element.createExecutableExtension("class");
- } catch (Throwable t) {
- Trace.trace(Trace.SEVERE, "Could not create delegate" + toString() + ": " + t.getMessage());
- }
- }
- return delegate;
- }
-
- /**
- *
- */
- public ILaunchable getLaunchable(IServer server, IModuleArtifact object) {
- try {
- return getDelegate().getLaunchable(server, object);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error calling delegate " + toString() + ": " + e.getMessage());
- return null;
- }
- }
-
- /**
- * Return a string representation of this object.
- *
- * @return java.lang.String
- */
- public String toString() {
- return "LaunchableAdapter[" + getId() + "]";
- }
-}
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Module.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Module.java
deleted file mode 100644
index 9e5e27c..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Module.java
+++ /dev/null
@@ -1,257 +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.core.internal;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.wst.server.core.*;
-import org.eclipse.wst.server.core.model.IModuleListener;
-import org.eclipse.wst.server.core.model.ModuleDelegate;
-import org.eclipse.wst.server.core.model.ModuleEvent;
-/**
- *
- */
-public class Module implements IModule {
- protected String id;
- protected String name;
- protected ModuleFactory factory;
- protected String type;
- protected String version;
- protected IProject project;
- protected ModuleDelegate delegate;
-
- // change listeners
- private transient List listeners;
-
- /**
- * Module constructor comment.
- */
- public Module(ModuleFactory factory, String id, String name, String type, String version, IProject project) {
- super();
- this.factory = factory;
- this.project = project;
- this.type = type;
- this.version = version;
- this.id = id;
- this.name = name;
- }
-
- /**
- * Returns the id of this module.
- *
- * @return java.lang.String
- */
- public String getId() {
- return factory.getId() + ":" + id;
- }
-
- /**
- * Returns the internal (partial) id of this module.
- *
- * @return the id
- */
- public String getInternalId() {
- return id;
- }
-
- /**
- * Returns the type of this module.
- *
- * @return the module type
- */
- public IModuleType getModuleType() {
- return new ModuleType(type, version);
- }
-
- /**
- * Returns the workbench project that this module is contained in,
- * or null if the module is outside of the workspace.
- *
- * @return the project that the module is contained in
- */
- public IProject getProject() {
- return project;
- }
-
- /*
- * @see IModule#getName()
- */
- public String getName() {
- return name;
- }
-
- protected ModuleDelegate getDelegate() {
- if (delegate == null) {
- try {
- delegate = factory.getDelegate().getModuleDelegate(this);
- delegate.initialize(this);
- } catch (Throwable t) {
- Trace.trace(Trace.SEVERE, "Could not create delegate" + toString() + ": " + t.getMessage());
- }
- }
- return delegate;
- }
-
- /**
- * Returns the child modules of this module.
- *
- * @return org.eclipse.wst.server.core.model.IModule[]
- */
- public IModule[] getChildModules(IProgressMonitor monitor) {
- try {
- return getDelegate().getChildModules();
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error calling delegate getChildModules() " + toString(), e);
- return null;
- }
- }
-
- /**
- * Validates this module.
- * <p>
- * [issue: Conjecture: Each different type of module prescribes
- * legal arrangements of, and the significance of, the files within
- * it. This would be spelled out in the spec for the particular
- * module types.
- * This validate operation is suppose to check the actual
- * arrangement of files in this module to see whether they
- * meet expectations.
- * It's an open question as to how "strenuous" a check this
- * is.]
- * </p>
- * <p>
- * [issue: Old comment said: "If there is an error
- * that should block the server from starting (e.g. major errors)
- * it should be returned from this method. This method can also be used to
- * return warning for such things as an open (and dirty) editor."]
- * </p>
- * <p>
- * [issue: All existing implementations of this return null,
- * which is illegal.]
- * </p>
- * <p>
- * [issue: Old comment said: "Returns an IStatus that is used to determine if this object can
- * be published to the server." Since the same module can
- * be associated with any number of servers, "the server" is
- * ill-defined.]
- * </p>
- * <p>
- * [issue: Old comment said: "Should return an error if there
- * is a major problem with the resources, or can be used to
- * return warnings on unsaved files, etc." It is usually
- * difficult in principle for core-level infrastructure to
- * detect whether there are open editors with unsaved changes.]
- * </p>
- *
- * @return a status object with code <code>IStatus.OK</code> if the given
- * module is valid, otherwise a status object indicating what is
- * wrong with it
- */
- public IStatus validate(IProgressMonitor monitor) {
- try {
- return getDelegate().validate();
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error calling delegate validate() " + toString(), e);
- return null;
- }
- }
-
- /**
- * Add a listener for the module.
- *
- * @param listener org.eclipse.wst.server.core.model.IModuleListener
- */
- public void addModuleListener(IModuleListener listener) {
- Trace.trace(Trace.FINEST, "Adding module listener " + listener + " to " + this);
-
- if (listeners == null)
- listeners = new ArrayList();
- else if (listeners.contains(listener))
- return;
- listeners.add(listener);
- }
-
- /**
- * Add a listener for the module.
- *
- * @param listener org.eclipse.wst.server.core.model.IModuleListener
- */
- public void removeModuleListener(IModuleListener listener) {
- Trace.trace(Trace.FINEST, "Removing module listener " + listener + " from " + this);
-
- if (listeners != null)
- listeners.remove(listener);
- }
-
- /**
- * Fire a module change event.
- */
- protected void fireModuleChangeEvent(boolean isChange, IModule[] added, IModule[] changed, IModule[] removed) {
- Trace.trace(Trace.FINEST, "->- Firing module change event: " + getName() + " (" + isChange + ") ->-");
-
- if (listeners == null || listeners.isEmpty())
- return;
-
- int size = listeners.size();
- IModuleListener[] dcl = new IModuleListener[size];
- listeners.toArray(dcl);
-
- ModuleEvent event = new ModuleEvent(this, isChange, added, changed, removed);
-
- for (int i = 0; i < size; i++) {
- try {
- Trace.trace(Trace.FINEST, " Firing module change event to: " + dcl[i]);
- dcl[i].moduleChanged(event);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, " Error firing module change event", e);
- }
- }
- Trace.trace(Trace.FINEST, "-<- Done firing module change event -<-");
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
- */
- public Object getAdapter(Class adapter) {
- ModuleDelegate delegate2 = getDelegate();
- if (adapter.isInstance(delegate2))
- return delegate;
- return null;
- }
-
- public boolean equals(Object obj) {
- if (!(obj instanceof IModule))
- return false;
-
- IModule m = (IModule) obj;
- if (!getId().equals(m.getId()))
- return false;
- //if (!project.equals(m.getProject()))
- // return false;
- //if (!getModuleType().equals(m.getModuleType()))
- // return false;
-
- return true;
- }
-
- /**
- * Return a string representation of this object.
- *
- * @return java.lang.String
- */
- public String toString() {
- return "Module[" + getId() + "]";
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ModuleArtifactAdapter.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ModuleArtifactAdapter.java
deleted file mode 100644
index ec29085..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ModuleArtifactAdapter.java
+++ /dev/null
@@ -1,171 +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.core.internal;
-
-import org.eclipse.core.expressions.*;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.server.core.IModuleArtifact;
-import org.eclipse.wst.server.core.model.ModuleArtifactAdapterDelegate;
-import org.osgi.framework.Bundle;
-/**
- *
- */
-public class ModuleArtifactAdapter {
- private IConfigurationElement element;
- private Expression fContextualLaunchExpr = null;
- private ModuleArtifactAdapterDelegate delegate;
-
- /**
- * ModuleArtifactAdapter constructor comment.
- */
- public ModuleArtifactAdapter(IConfigurationElement element) {
- super();
- this.element = element;
- }
-
- /**
- * Returns the id of this ModuleArtifactAdapter.
- *
- * @return java.lang.String
- */
- public String getId() {
- return element.getAttribute("id");
- }
-
- /**
- * Returns true if the plugin that loaded this class has been loaded.
- *
- * @return boolean
- */
- public boolean isPluginActivated() {
- String pluginId = element.getDeclaringExtension().getNamespace();
- return Platform.getBundle(pluginId).getState() == Bundle.ACTIVE;
- }
-
- /**
- * Returns an expression that represents the enablement logic for the
- * contextual launch element of this launch shortcut description or
- * <code>null</code> if none.
- * @return an evaluatable expression or <code>null</code>
- * @throws CoreException if the configuration element can't be
- * converted. Reasons include: (a) no handler is available to
- * cope with a certain configuration element or (b) the XML
- * expression tree is malformed.
- */
- public Expression getContextualLaunchEnablementExpression() throws CoreException {
- if (fContextualLaunchExpr == null) {
- IConfigurationElement[] elements = element.getChildren(ExpressionTagNames.ENABLEMENT);
- IConfigurationElement enablement = elements.length > 0 ? elements[0] : null;
-
- if (enablement != null)
- fContextualLaunchExpr = ExpressionConverter.getDefault().perform(enablement);
- }
- return fContextualLaunchExpr;
- }
-
- /**
- * Evaluate the given expression within the given context and return
- * the result. Returns <code>true</code> iff result is either TRUE or NOT_LOADED.
- * This allows optimistic inclusion of shortcuts before plugins are loaded.
- * Returns <code>false</code> if exp is <code>null</code>.
- *
- * @param exp the enablement expression to evaluate or <code>null</code>
- * @param context the context of the evaluation. Usually, the
- * user's selection.
- * @return the result of evaluating the expression
- * @throws CoreException
- */
- protected boolean evalEnablementExpression(IEvaluationContext context, Expression exp) throws CoreException {
- return (exp != null) ? ((exp.evaluate(context)) != EvaluationResult.FALSE) : false;
- }
-
- /**
- * @return an Evaluation context with default variable = selection
- */
- /*protected IEvaluationContext createContext(Object obj) {
- List list = null;
- IWorkbenchWindow window = DebugUIPlugin.getActiveWorkbenchWindow();
- if (window != null) {
- IWorkbenchPage page = window.getActivePage();
- if (page != null) {
- IWorkbenchPart activePart = page.getActivePart();
- if (activePart instanceof IEditorPart) {
- list = new ArrayList();
- list.add(((IEditorPart)activePart).getEditorInput());
- } else if (activePart != null) {
- IWorkbenchPartSite site = activePart.getSite();
- if (site != null) {
- ISelectionProvider selectionProvider = site.getSelectionProvider();
- if (selectionProvider != null) {
- ISelection selection = selectionProvider.getSelection();
- if (selection instanceof IStructuredSelection) {
- list = ((IStructuredSelection)selection).toList();
- }
- }
- }
- }
- }
- }
- // create a default evaluation context with default variable
- // of the user selection or editor input
- if (list == null) {
- list = Collections.EMPTY_LIST;
- }
- IEvaluationContext context = new EvaluationContext(null, list);
- context.addVariable("selection", list); //$NON-NLS-1$
-
- return context;
- }*/
-
- public boolean isEnabled(Object obj) throws CoreException {
- IEvaluationContext context = new EvaluationContext(null, obj);
- context.addVariable("selection", obj);
- return evalEnablementExpression(context, getContextualLaunchEnablementExpression());
- }
-
- public ModuleArtifactAdapterDelegate getDelegate() {
- if (delegate == null) {
- try {
- delegate = (ModuleArtifactAdapterDelegate) element.createExecutableExtension("class");
- } catch (Throwable t) {
- Trace.trace(Trace.SEVERE, "Could not create delegate" + toString() + ": " + t.getMessage());
- }
- }
- return delegate;
- }
-
- public boolean isDelegateLoaded() {
- return (delegate != null);
- }
-
- /**
- *
- */
- public IModuleArtifact getModuleArtifact(Object obj) {
- try {
- return getDelegate().getModuleArtifact(obj);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error calling delegate " + toString() + ": " + e.getMessage());
- return null;
- }
- }
-
- /**
- * Return a string representation of this object.
- *
- * @return java.lang.String
- */
- public String toString() {
- return "ModuleArtifactAdapter[" + getId() + "]";
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ModuleFactory.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ModuleFactory.java
deleted file mode 100644
index 88c8f31..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ModuleFactory.java
+++ /dev/null
@@ -1,178 +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.core.internal;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IModuleType;
-import org.eclipse.wst.server.core.model.ModuleFactoryDelegate;
-import org.eclipse.wst.server.core.model.IModuleFactoryListener;
-/**
- *
- */
-public class ModuleFactory implements IOrdered {
- private IConfigurationElement element;
- private ModuleFactoryDelegate delegate;
- private List moduleTypes;
-
- private List modules;
-
- /**
- * ModuleFactory constructor comment.
- */
- public ModuleFactory(IConfigurationElement element) {
- super();
- this.element = element;
- }
-
- /**
- * Returns the id of this factory.
- *
- * @return java.lang.String
- */
- public String getId() {
- return element.getAttribute("id");
- }
-
- /**
- * Returns the index (ordering) of this task.
- *
- * @return int
- */
- public int getOrder() {
- try {
- return Integer.parseInt(element.getAttribute("order"));
- } catch (NumberFormatException e) {
- return -1;
- }
- }
-
- /**
- * Return the supported module types.
- *
- * @return an array of module types
- */
- public IModuleType[] getModuleTypes() {
- if (moduleTypes == null)
- moduleTypes = ServerPlugin.getModuleTypes(element.getChildren("moduleType"));
-
- IModuleType[] mt = new IModuleType[moduleTypes.size()];
- moduleTypes.toArray(mt);
- return mt;
- }
-
- /**
- * Returns true if this modules factory produces project modules.
- *
- * @return boolean
- */
- public boolean isProjectModuleFactory() {
- return "true".equalsIgnoreCase(element.getAttribute("projects"));
- }
-
- /*
- * @see IModuleFactoryDelegate#getDelegate()
- */
- public ModuleFactoryDelegate getDelegate() {
- if (delegate == null) {
- try {
- delegate = (ModuleFactoryDelegate) element.createExecutableExtension("class");
- delegate.initialize(this);
- ResourceManager.getInstance().addModuleFactoryListener(delegate);
- } catch (Throwable t) {
- Trace.trace(Trace.SEVERE, "Could not create delegate " + toString() + ": " + t.getMessage());
- }
- }
- return delegate;
- }
-
- /*
- * @see
- */
- public IModule getModule(String id) {
- IModule[] modules2 = getModules();
- if (modules2 != null) {
- int size = modules2.length;
- for (int i = 0; i < size; i++) {
- Module module = (Module) modules2[i];
- if (id.equals(module.getInternalId()))
- return module;
- }
- }
- return null;
- }
-
- /*
- * @see
- */
- public IModule[] getModules() {
- modules = null;
- if (modules == null) {
- try {
- modules = new ArrayList();
- IModule[] modules2 = getDelegate().getModules();
- if (modules2 != null) {
- int size = modules2.length;
- for (int i = 0; i < size; i++)
- modules.add(modules2[i]);
- }
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error calling delegate " + toString() + ": " + e.getMessage());
- return null;
- }
- }
-
- IModule[] m = new IModule[modules.size()];
- modules.toArray(m);
- return m;
- }
-
- /**
- * Add a listener for modules that are added/removed from this
- * factory.
- *
- * @param listener org.eclipse.wst.server.core.model.IModuleFactoryListener
- */
- public void addModuleFactoryListener(IModuleFactoryListener listener) {
- try {
- getDelegate().addModuleFactoryListener(listener);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error calling delegate " + toString() + ": " + e.getMessage());
- }
- }
-
- /**
- * Add a listener for modules that are added/removed from this
- * factory.
- *
- * @param listener org.eclipse.wst.server.core.model.IModuleFactoryListener
- */
- public void removeModuleFactoryListener(IModuleFactoryListener listener) {
- try {
- getDelegate().removeModuleFactoryListener(listener);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error calling delegate " + toString() + ": " + e.getMessage());
- }
- }
-
- /**
- * Return a string representation of this object.
- *
- * @return java.lang.String
- */
- public String toString() {
- return "ModuleFactory[" + getId() + "]";
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ModuleFile.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ModuleFile.java
deleted file mode 100644
index 5350304..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ModuleFile.java
+++ /dev/null
@@ -1,66 +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.core.internal;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.wst.server.core.model.IModuleFile;
-/**
- *
- * @since 1.0
- */
-public class ModuleFile implements IModuleFile {
- protected String name;
- protected IPath path;
- protected long stamp;
-
- public ModuleFile(String name, IPath path, long stamp) {
- this.name = name;
- this.path = path;
- this.stamp = stamp;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.server.core.model.IModuleFile#getModificationStamp()
- */
- public long getModificationStamp() {
- return stamp;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.server.core.model.IModuleResource#getModuleRelativePath()
- */
- public IPath getModuleRelativePath() {
- return path;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.server.core.model.IModuleResource#getName()
- */
- public String getName() {
- return name;
- }
-
- public boolean equals(Object obj) {
- if (!(obj instanceof ModuleFile))
- return false;
-
- ModuleFile mf = (ModuleFile) obj;
- if (!name.equals(mf.name))
- return false;
- if (!path.equals(mf.path))
- return false;
- return true;
- }
-
- public String toString() {
- return "ModuleFile [" + name + ", " + path + ", " + stamp + "]";
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ModuleFolder.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ModuleFolder.java
deleted file mode 100644
index ef97302..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ModuleFolder.java
+++ /dev/null
@@ -1,70 +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.core.internal;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.wst.server.core.model.IModuleFolder;
-import org.eclipse.wst.server.core.model.IModuleResource;
-/**
- *
- * @since 1.0
- */
-public class ModuleFolder implements IModuleFolder {
- protected String name;
- protected IPath path;
- protected IModuleResource[] members;
-
- public ModuleFolder(String name, IPath path) {
- this.name = name;
- this.path = path;
- }
-
- public void setMembers(IModuleResource[] members) {
- this.members = members;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.server.core.model.IModuleResource#getModuleRelativePath()
- */
- public IPath getModuleRelativePath() {
- return path;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.server.core.model.IModuleResource#getName()
- */
- public String getName() {
- return name;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.server.core.model.IModuleFolder#members()
- */
- public IModuleResource[] members() {
- return members;
- }
-
- public boolean equals(Object obj) {
- if (!(obj instanceof ModuleFolder))
- return false;
-
- ModuleFolder mf = (ModuleFolder) obj;
- if (!name.equals(mf.name))
- return false;
- if (!path.equals(mf.path))
- return false;
- return true;
- }
-
- public String toString() {
- return "ModuleFolder [" + name + ", " + path + "]";
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ModuleKind.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ModuleKind.java
deleted file mode 100644
index 7bd8184..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ModuleKind.java
+++ /dev/null
@@ -1,44 +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.core.internal;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-/**
- *
- */
-public class ModuleKind {
- protected String id;
- protected String name;
-
- public ModuleKind(IConfigurationElement ce) {
- super();
- this.id = ce.getAttribute("id");
- this.name = ce.getAttribute("name");
- }
-
- public ModuleKind(String id, String name) {
- super();
- this.id = id;
- this.name = name;
- }
-
- public String getId() {
- return id;
- }
-
- public String getName() {
- return name;
- }
-
- public String toString() {
- return "ModuleType[" + id + ", " + name + "]";
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ModulePublishInfo.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ModulePublishInfo.java
deleted file mode 100644
index 07f77e1..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ModulePublishInfo.java
+++ /dev/null
@@ -1,157 +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.core.internal;
-
-import java.util.*;
-import org.eclipse.core.runtime.*;
-import org.eclipse.wst.server.core.model.IModuleFile;
-import org.eclipse.wst.server.core.model.IModuleFolder;
-import org.eclipse.wst.server.core.model.IModuleResource;
-/**
- * Publish information for a specific module on a specific server.
- */
-public class ModulePublishInfo {
- private static final String MODULE_ID = "module-id";
- private static final String PARENT_IDS = "parent-ids";
- private static final String NAME = "name";
- private static final String PATH = "path";
- private static final String STAMP = "stamp";
- private static final String FILE = "file";
- private static final String FOLDER = "folder";
-
- private String moduleId;
- private String parentsId;
- private IModuleResource[] resources = new IModuleResource[0];
-
- /**
- * ModulePublishInfo constructor comment.
- */
- public ModulePublishInfo(String parentsId, String moduleId) {
- super();
-
- this.parentsId = parentsId;
- this.moduleId = moduleId;
- }
-
- /**
- * ModulePublishInfo constructor comment.
- */
- public ModulePublishInfo(IMemento memento) {
- super();
-
- load(memento);
- }
-
- public String getModuleId() {
- return moduleId;
- }
-
- public String getParentsId() {
- return parentsId;
- }
-
- public IModuleResource[] getResources() {
- return resources;
- }
-
- public void setResources(IModuleResource[] res) {
- resources = res;
- }
-
- /**
- *
- */
- protected void load(IMemento memento) {
- Trace.trace(Trace.FINEST, "Loading module publish info for: " + memento);
-
- try {
- moduleId = memento.getString(MODULE_ID);
- parentsId = memento.getString(PARENT_IDS);
-
- resources = loadResource(memento);
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Could not load module publish info information: " + e.getMessage());
- }
- }
-
- protected IModuleResource[] loadResource(IMemento memento) {
- if (memento == null)
- return new IModuleResource[0];
-
- List list = new ArrayList(5);
- IMemento[] children = memento.getChildren(FILE);
- if (children != null) {
- int size = children.length;
- for (int i = 0; i < size; i++) {
- String name = children[i].getString(NAME);
- IPath path = new Path(children[i].getString(PATH));
- long stamp = Long.parseLong(children[i].getString(STAMP));
- ModuleFile file = new ModuleFile(name, path, stamp);
- list.add(file);
- }
- }
- children = memento.getChildren(FOLDER);
- if (children != null) {
- int size = children.length;
- for (int i = 0; i < size; i++) {
- String name = children[i].getString(NAME);
- IPath path = new Path(children[i].getString(PATH));
- ModuleFolder folder = new ModuleFolder(name, path);
- folder.setMembers(loadResource(children[i]));
- list.add(folder);
- }
- }
-
- IModuleResource[] resources2 = new IModuleResource[list.size()];
- list.toArray(resources2);
- return resources;
- }
-
- /**
- *
- */
- protected void save(IMemento memento) {
- try {
- memento.putString(MODULE_ID, moduleId);
- memento.putString(PARENT_IDS, parentsId);
-
- saveResource(memento, resources);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not save module publish info", e);
- }
- }
-
- protected void saveResource(IMemento memento, IModuleResource[] resources2) {
- if (resources2 == null)
- return;
- int size = resources2.length;
- for (int i = 0; i < size; i++) {
- if (resources2[i] instanceof IModuleFile) {
- IModuleFile file = (IModuleFile) resources2[i];
- IMemento child = memento.createChild(FILE);
- child.putString(NAME, file.getName());
- child.putString(PATH, file.getModuleRelativePath().toPortableString());
- child.putString(STAMP, "" + file.getModificationStamp());
- } else {
- IModuleFolder folder = (IModuleFolder) resources2[i];
- IMemento child = memento.createChild(FOLDER);
- child.putString(NAME, folder.getName());
- child.putString(PATH, folder.getModuleRelativePath().toPortableString());
- IModuleResource[] resources3 = folder.members();
- saveResource(child, resources3);
- }
- }
- }
-
- public String toString() {
- return "ModulePublishInfo [" + moduleId + "]";
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ModuleResourceDelta.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ModuleResourceDelta.java
deleted file mode 100644
index 8479c78..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ModuleResourceDelta.java
+++ /dev/null
@@ -1,75 +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.core.internal;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.wst.server.core.model.IModuleResource;
-import org.eclipse.wst.server.core.model.IModuleResourceDelta;
-/**
- *
- */
-public class ModuleResourceDelta implements IModuleResourceDelta {
- protected IModuleResource resource;
- protected int kind;
-
- protected IModuleResourceDelta[] children;
-
- public ModuleResourceDelta(IModuleResource resource, int kind) {
- this.resource = resource;
- this.kind = kind;
- }
-
- public void setChildren(IModuleResourceDelta[] children) {
- this.children = children;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.server.core.model.IModuleResource#getModuleRelativePath()
- */
- public IPath getModuleRelativePath() {
- return resource.getModuleRelativePath();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.server.core.model.IModuleResourceDelta#getModuleResource()
- */
- public IModuleResource getModuleResource() {
- return resource;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.server.core.model.IModuleResourceDelta#getKind()
- */
- public int getKind() {
- return kind;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.server.core.model.IModuleResourceDelta#getAffectedChildren()
- */
- public IModuleResourceDelta[] getAffectedChildren() {
- return children;
- }
-
- public String toString() {
- return "ModuleResourceDelta [" + resource + ", " + kind + "]";
- }
-
- public void trace(String indent) {
- System.out.println(indent + toString());
- if (children != null) {
- int size = children.length;
- for (int i = 0; i < size; i++) {
- ((ModuleResourceDelta)children[i]).trace(indent + " ");
- }
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ModuleType.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ModuleType.java
deleted file mode 100644
index cce5a89..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ModuleType.java
+++ /dev/null
@@ -1,123 +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.core.internal;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.server.core.IModuleType;
-/**
- *
- */
-public class ModuleType implements IModuleType {
- protected String id;
- protected String version;
-
- // cached copy of all module types
- private static List moduleTypes;
-
- public ModuleType(String id, String version) {
- super();
- this.id = id;
- this.version = version;
- }
-
- public String getId() {
- return id;
- }
-
- public String getName() {
- ModuleKind mt = findModuleType(id);
- if (mt != null)
- return mt.getName();
- return null;
- }
-
- public String getVersion() {
- return version;
- }
-
- /**
- * Returns an array of all known module types.
- * <p>
- * A new array is returned on each call, so clients may store or modify the result.
- * </p>
- *
- * @return the array of module types {@link IModuleType}
- */
- /*public static IModuleType[] getModuleTypes() {
- if (moduleTypes == null)
- loadModuleTypes();
-
- IModuleType[] mt = new IModuleType[moduleTypes.size()];
- moduleTypes.toArray(mt);
- return mt;
- }*/
-
- /**
- * Returns the module type with the given id, or <code>null</code>
- * if none. This convenience method searches the list of known
- * module types for the one a matching
- * module type id ({@link ModuleType#getId()}). The id may not be null.
- *
- * @param id the module type id
- * @return the module type, or <code>null</code> if there is no module type
- * with the given id
- */
- public static ModuleKind findModuleType(String id) {
- if (id == null)
- throw new IllegalArgumentException();
-
- if (moduleTypes == null)
- loadModuleTypes();
-
- Iterator iterator = moduleTypes.iterator();
- while (iterator.hasNext()) {
- ModuleKind moduleType = (ModuleKind) iterator.next();
- if (id.equals(moduleType.getId()))
- return moduleType;
- }
- return null;
- }
-
- /**
- * Load the module types.
- */
- private static synchronized void loadModuleTypes() {
- if (moduleTypes != null)
- return;
- Trace.trace(Trace.EXTENSION_POINT, "->- Loading .moduleTypes extension point ->-");
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IConfigurationElement[] cf = registry.getConfigurationElementsFor(ServerPlugin.PLUGIN_ID, "moduleTypes");
-
- int size = cf.length;
- moduleTypes = new ArrayList(size);
- for (int i = 0; i < size; i++) {
- try {
- ModuleKind moduleType = new ModuleKind(cf[i]);
- moduleTypes.add(moduleType);
- Trace.trace(Trace.EXTENSION_POINT, " Loaded moduleType: " + cf[i].getAttribute("id"));
- } catch (Throwable t) {
- Trace.trace(Trace.SEVERE, " Could not load moduleType: " + cf[i].getAttribute("id"), t);
- }
- }
-
- Trace.trace(Trace.EXTENSION_POINT, "-<- Done loading .moduleTypes extension point -<-");
- }
-
- public String toString() {
- return "ModuleType[" + id + ", " + version + "]";
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ProgressUtil.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ProgressUtil.java
deleted file mode 100644
index 822b330..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ProgressUtil.java
+++ /dev/null
@@ -1,70 +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.core.internal;
-
-import org.eclipse.core.runtime.*;
-/**
- * Progress Monitor utility.
- *
- * @since 1.0
- */
-public class ProgressUtil {
- /**
- * ProgressUtil constructor comment.
- */
- private ProgressUtil() {
- super();
- }
-
- /**
- * Return a valid progress monitor.
- *
- * @param monitor org.eclipse.core.runtime.IProgressMonitor
- * @return org.eclipse.core.runtime.IProgressMonitor
- */
- public static IProgressMonitor getMonitorFor(IProgressMonitor monitor) {
- if (monitor == null)
- return new NullProgressMonitor();
- return monitor;
- }
-
- /**
- * Return a sub-progress monitor with the given amount on the
- * current progress monitor.
- *
- * @param monitor org.eclipse.core.runtime.IProgressMonitor
- * @param ticks int
- * @return org.eclipse.core.runtime.IProgressMonitor
- */
- public static IProgressMonitor getSubMonitorFor(IProgressMonitor monitor, int ticks) {
- if (monitor == null)
- return new NullProgressMonitor();
- if (monitor instanceof NullProgressMonitor)
- return monitor;
- return new SubProgressMonitor(monitor, ticks);
- }
-
- /**
- * Return a sub-progress monitor with the given amount on the
- * current progress monitor.
- *
- * @param monitor org.eclipse.core.runtime.IProgressMonitor
- * @param ticks int
- * @return org.eclipse.core.runtime.IProgressMonitor
- */
- public static IProgressMonitor getSubMonitorFor(IProgressMonitor monitor, int ticks, int style) {
- if (monitor == null)
- return new NullProgressMonitor();
- if (monitor instanceof NullProgressMonitor)
- return monitor;
- return new SubProgressMonitor(monitor, ticks, style);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ProjectProperties.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ProjectProperties.java
deleted file mode 100644
index efda1d3..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ProjectProperties.java
+++ /dev/null
@@ -1,346 +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.core.internal;
-
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
-
-import org.eclipse.wst.server.core.*;
-/**
- * Helper class that stores preference information for the server tools.
- */
-public class ProjectProperties implements IProjectProperties {
- private static final String PROJECT_PREFERENCE_FILE = ".runtime";
-
- protected IProject project;
-
- protected String serverId;
- protected String runtimeId;
- protected boolean serverProject = false;
-
- // project properties listeners
- protected transient List listeners;
-
- /**
- * ProjectProperties constructor comment.
- */
- public ProjectProperties(IProject project) {
- super();
- this.project = project;
- }
-
- /**
- * Load the preferences.
- */
- private void loadPreferences() {
- Trace.trace(Trace.FINEST, "Loading project preferences: " + project);
-
- InputStream in = null;
- try {
- IMemento memento = null;
- if (!project.exists() || !project.isOpen())
- return;
- IFile file = project.getFile(PROJECT_PREFERENCE_FILE);
- if (file != null && file.exists()) {
- in = file.getContents();
- memento = XMLMemento.loadMemento(in);
- }
-
- if (memento == null)
- return;
-
- serverId = memento.getString("server-id");
- runtimeId = memento.getString("runtime-id");
- String s = memento.getString("servers");
- if (s != null && "true".equals(s))
- serverProject = true;
- else
- serverProject = false;
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not load preferences: " + e.getMessage());
- } finally {
- try {
- in.close();
- } catch (Exception e) {
- // ignore
- }
- }
- }
-
- private void savePreferences(IProgressMonitor monitor) throws CoreException {
- if (project.exists() && project.isOpen()) {
- IFile file = project.getFile(PROJECT_PREFERENCE_FILE);
-
- if (file.exists() && file.isReadOnly()) {
- IStatus status = ResourcesPlugin.getWorkspace().validateEdit(new IFile[] { file }, null);
- if (status.getSeverity() == IStatus.ERROR)
- // didn't work or not under source control
- throw new CoreException(status);
- }
-
- InputStream in = null;
- try {
- XMLMemento memento = XMLMemento.createWriteRoot("runtime");
-
- if (runtimeId != null)
- memento.putString("runtime-id", runtimeId);
- if (serverId != null)
- memento.putString("server-id", serverId);
- if (serverProject)
- memento.putString("servers", "true");
- else
- memento.putString("servers", "false");
- in = memento.getInputStream();
-
- if (file.exists())
- file.setContents(in, true, true, monitor);
- else
- file.create(in, true, monitor);
- } catch (Exception e) {
- throw new CoreException(new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0, "", e));
- } finally {
- try {
- in.close();
- } catch (Exception e) {
- // ignore
- }
- }
- return;
- }
- }
-
- /**
- * Returns the preferred runtime server for the project. This method
- * returns null if the server was never chosen or does not currently exist. (if the
- * server is recreated or was in a closed project, etc. this method will return
- * the original value if it becomes available again)
- *
- * @return server org.eclipse.wst.server.core.IServer
- */
- public IServer getDefaultServer() {
- loadPreferences();
-
- if (serverId == null || serverId.length() == 0)
- return null;
-
- IServer server = ServerCore.findServer(serverId);
- /*if (server != null && ServerUtil.containsModule(server, module))
- return server;
- else
- return null;*/
- return server;
- }
-
- /**
- * Sets the preferred runtime server for the project.
- *
- * @param server org.eclipse.wst.server.core.IServer
- */
- public void setDefaultServer(IServer server, IProgressMonitor monitor) throws CoreException {
- loadPreferences();
-
- String newServerId = null;
- if (server != null)
- newServerId = server.getId();
- if (serverId == null && newServerId == null)
- return;
- if (serverId != null && serverId.equals(newServerId))
- return;
-
- serverId = newServerId;
- savePreferences(monitor);
- fireDefaultServerChanged(server);
- }
-
- protected String getRuntimeTargetId() {
- loadPreferences();
- return runtimeId;
- }
-
- protected void setRuntimeTargetId(String newRuntimeId, IProgressMonitor monitor) throws CoreException {
- loadPreferences();
- runtimeId = newRuntimeId;
- savePreferences(monitor);
- }
-
- /**
- * Returns the current runtime target type for the given project.
- *
- * @return the runtime target
- */
- public IRuntime getRuntimeTarget() {
- loadPreferences();
- if (runtimeId == null)
- return null;
- return ServerCore.findRuntime(runtimeId);
- }
-
- /**
- * Sets the runtime target for the project.
- *
- * @param runtime the target runtime
- * @param monitor a progress monitor
- */
- public void setRuntimeTarget(IRuntime runtime, IProgressMonitor monitor) throws CoreException {
- loadPreferences();
- IRuntime oldRuntime = null;
- if (runtimeId != null)
- oldRuntime = ServerCore.findRuntime(runtimeId);
- setRuntimeTarget(oldRuntime, runtime, true, monitor);
- }
-
- protected void setRuntimeTarget(IRuntime oldRuntime, IRuntime newRuntime, boolean save, IProgressMonitor monitor) throws CoreException {
- Trace.trace(Trace.RUNTIME_TARGET, "setRuntimeTarget : " + oldRuntime + " -> " + newRuntime);
-
- if (oldRuntime == null && newRuntime == null)
- return;
- if (oldRuntime != null && oldRuntime.equals(newRuntime))
- return;
-
- IRuntimeTargetHandler[] handlers = ServerCore.getRuntimeTargetHandlers();
- if (handlers == null)
- return;
-
- int size = handlers.length;
- // remove old target
- if (oldRuntime != null) {
- IRuntimeType runtimeType = oldRuntime.getRuntimeType();
- for (int i = 0; i < size; i++) {
- IRuntimeTargetHandler handler = handlers[i];
- long time = System.currentTimeMillis();
- boolean supports = handler.supportsRuntimeType(runtimeType);
- Trace.trace(Trace.RUNTIME_TARGET, " < " + handler + " " + supports);
- if (supports)
- handler.removeRuntimeTarget(project, oldRuntime, monitor);
- Trace.trace(Trace.PERFORMANCE, "Runtime target: <" + (System.currentTimeMillis() - time) + "> " + handler.getId());
- }
- }
-
- // add new target
- if (newRuntime != null) {
- runtimeId = newRuntime.getId();
- if (save)
- savePreferences(monitor);
- IRuntimeType runtimeType = newRuntime.getRuntimeType();
- for (int i = 0; i < size; i++) {
- IRuntimeTargetHandler handler = handlers[i];
- long time = System.currentTimeMillis();
- boolean supports = handler.supportsRuntimeType(runtimeType);
- Trace.trace(Trace.RUNTIME_TARGET, " > " + handler + " " + supports);
- if (supports)
- handler.setRuntimeTarget(project, newRuntime, monitor);
- Trace.trace(Trace.PERFORMANCE, "Runtime target: <" + (System.currentTimeMillis() - time) + "> " + handler.getId());
- }
- } else {
- runtimeId = null;
- if (save)
- savePreferences(monitor);
- }
-
- fireRuntimeTargetChanged(newRuntime);
- Trace.trace(Trace.RUNTIME_TARGET, "setRuntimeTarget <");
- }
-
- public void addProjectPropertiesListener(IProjectPropertiesListener listener) {
- Trace.trace(Trace.LISTENERS, "Adding project properties listener " + listener + " to " + this);
-
- if (listeners == null)
- listeners = new ArrayList();
- listeners.add(listener);
- }
-
- public void removeProjectPropertiesListener(IProjectPropertiesListener listener) {
- Trace.trace(Trace.LISTENERS, "Removing project properties listener " + listener + " from " + this);
-
- if (listeners != null)
- listeners.remove(listener);
- }
-
- /**
- * Fire a event because the default server changed.
- *
- * @param server org.eclipse.wst.server.core.IServer
- */
- private void fireDefaultServerChanged(IServer server) {
- Trace.trace(Trace.LISTENERS, "->- Firing defaultServerChanged event: " + server + " ->-");
-
- if (listeners == null || listeners.isEmpty())
- return;
-
- int size = listeners.size();
- IProjectPropertiesListener[] ppl = new IProjectPropertiesListener[size];
- listeners.toArray(ppl);
-
- for (int i = 0; i < size; i++) {
- Trace.trace(Trace.LISTENERS, " Firing defaultServerChanged event to " + ppl[i]);
- try {
- ppl[i].defaultServerChanged(project, server);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, " Error firing defaultServerChanged event to " + ppl[i], e);
- }
- }
-
- Trace.trace(Trace.LISTENERS, "-<- Done firing defaultServerChanged event -<-");
- }
-
- /**
- * Fire a event because the runtime target changed.
- *
- * @param server org.eclipse.wst.server.core.IRuntime
- */
- private void fireRuntimeTargetChanged(IRuntime runtime) {
- Trace.trace(Trace.LISTENERS, "->- Firing runtimeTargetChanged event: " + runtime + " ->-");
-
- if (listeners == null || listeners.isEmpty())
- return;
-
- int size = listeners.size();
- IProjectPropertiesListener[] ppl = new IProjectPropertiesListener[size];
- listeners.toArray(ppl);
-
- for (int i = 0; i < size; i++) {
- Trace.trace(Trace.LISTENERS, " Firing runtimeTargetChanged event to " + ppl[i]);
- try {
- ppl[i].runtimeTargetChanged(project, runtime);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, " Error firing runtimeTargetChanged event to " + ppl[i], e);
- }
- }
-
- Trace.trace(Trace.LISTENERS, "-<- Done firing runtimeTargetChanged event -<-");
- }
-
- /**
- *
- */
- public boolean isServerProject() {
- loadPreferences();
- return serverProject;
- }
-
- /**
- *
- * @param b
- */
- public void setServerProject(boolean b, IProgressMonitor monitor) throws CoreException {
- loadPreferences();
- serverProject = b;
- savePreferences(monitor);
- }
-
- public String toString() {
- return "ProjectProperties[" + project + ", " + serverId + ", " + runtimeId + "]";
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/PublishAdapter.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/PublishAdapter.java
deleted file mode 100644
index 0000cd8..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/PublishAdapter.java
+++ /dev/null
@@ -1,39 +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.core.internal;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IServer;
-/**
- * Helper class which implements the IPublishListener interface
- * with empty methods.
- *
- * @see org.eclipse.wst.server.core.internal.IPublishListener
- * @since 1.0
- */
-public class PublishAdapter implements IPublishListener {
- public void publishStarted(IServer server) {
- // do nothing
- }
-
- public void publishModuleStarted(IServer server, IModule[] parents, IModule module) {
- // do nothing
- }
-
- public void publishModuleFinished(IServer server, IModule[] parents, IModule module, IStatus status) {
- // do nothing
- }
-
- public void publishFinished(IServer server, IStatus status) {
- // do nothing
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/PublishInfo.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/PublishInfo.java
deleted file mode 100644
index cba07a7..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/PublishInfo.java
+++ /dev/null
@@ -1,153 +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.core.internal;
-
-import java.util.*;
-import java.io.File;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.wst.server.core.IServer;
-/**
- * Helper to obtain and store the global publish information.
- * (what files were published and when) Delegates to PublishState
- * for all server specific publishing information.
- */
-public class PublishInfo {
- protected static PublishInfo instance;
-
- protected static final String PUBLISH_DIR = "publish";
-
- // map of server ids to Strings of filename containing publish data
- protected Map serverIdToPath;
-
- // map of loaded serverIds to publish info
- protected Map serverIdToPublishInfo;
-
- /**
- * PublishInfo constructor comment.
- */
- private PublishInfo() {
- super();
-
- serverIdToPath = new HashMap();
- serverIdToPublishInfo = new HashMap();
- load();
- }
-
- /**
- * Return the publish info.
- *
- * @return org.eclipse.wst.server.core.internal.PublishInfo
- */
- public static PublishInfo getInstance() {
- if (instance == null)
- instance = new PublishInfo();
- return instance;
- }
-
- /**
- * Return the publish state.
- *
- * @return org.eclipse.wst.server.core.internal.PublishState
- * @param server org.eclipse.wst.server.core.IServer
- */
- public ServerPublishInfo getServerPublishInfo(IServer server) {
- // have we tried loading yet?
- String serverId = server.getId();
- if (serverIdToPath.containsKey(serverId)) {
- if (!serverIdToPublishInfo.containsKey(serverId)) {
- String partialPath = (String) serverIdToPath.get(serverId);
- IPath path = ServerPlugin.getInstance().getStateLocation().append(PUBLISH_DIR).append(partialPath);
- ServerPublishInfo spi = new ServerPublishInfo(path);
- serverIdToPublishInfo.put(serverId, spi);
- return spi;
- }
- // already loaded
- return (ServerPublishInfo) serverIdToPublishInfo.get(serverId);
- }
-
- // first time server is being used
- IPath path = ServerPlugin.getInstance().getStateLocation().append(PUBLISH_DIR);
- File file = new File(path.toOSString());
- if (!file.exists())
- file.mkdir();
-
- file = null;
- int i = 0;
- String partialPath = null;
- while (file == null || file.exists()) {
- partialPath = "publish" + i + ".xml";
- path = ServerPlugin.getInstance().getStateLocation().append(PUBLISH_DIR).append(partialPath);
- if (serverIdToPath.get(partialPath) == null)
- file = new File(path.toOSString());
- i++;
- }
-
- ServerPublishInfo spi = new ServerPublishInfo(path);
- serverIdToPath.put(serverId, partialPath);
- serverIdToPublishInfo.put(serverId, spi);
- save();
- return spi;
- }
-
- /**
- *
- */
- protected void load() {
- Trace.trace(Trace.FINEST, "Loading publish info");
- String filename = ServerPlugin.getInstance().getStateLocation().append("publish.xml").toOSString();
-
- try {
- IMemento memento = XMLMemento.loadMemento(filename);
-
- IMemento[] serverChild = memento.getChildren("server");
- int size = serverChild.length;
- serverIdToPath = new HashMap(size + 2);
-
- for (int i = 0; i < size; i++) {
- String id = serverChild[i].getString("id");
- String partialPath = serverChild[i].getString("path");
- serverIdToPath.put(id, partialPath);
- }
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Could not load global publish info: " + e.getMessage());
- }
- }
-
- /**
- *
- */
- protected void save() {
- String filename = ServerPlugin.getInstance().getStateLocation().append("publish.xml").toOSString();
-
- try {
- XMLMemento memento = XMLMemento.createWriteRoot("publish-info");
-
- Iterator iterator = serverIdToPath.keySet().iterator();
- while (iterator.hasNext()) {
- String serverId = (String) iterator.next();
- String partialPath = (String) serverIdToPath.get(serverId);
-
- IMemento server = memento.createChild("server");
- server.putString("id", serverId);
- server.putString("path", partialPath);
- }
-
- memento.saveToFile(filename);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not save global publish info", e);
- }
- }
-
- public void save(IServer server) {
- ServerPublishInfo spi = getServerPublishInfo(server);
- spi.save();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/PublishServerJob.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/PublishServerJob.java
deleted file mode 100644
index 113ecda..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/PublishServerJob.java
+++ /dev/null
@@ -1,54 +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.core.internal;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.wst.server.core.IServer;
-/**
- * Job to publish to a particular server.
- */
-public class PublishServerJob extends Job {
- protected IServer server;
- protected int kind;
- protected boolean check;
-
- public PublishServerJob(IServer server, int kind, boolean check) {
- super(ServerPlugin.getResource("%publishing", server.getName()));
- this.server = server;
- this.kind = kind;
- this.check = check;
- setRule(new ServerSchedulingRule(server));
- if (kind != IServer.PUBLISH_AUTO)
- setUser(true);
- }
-
- public PublishServerJob(IServer server) {
- this(server, IServer.PUBLISH_INCREMENTAL, true);
- }
-
- /*
- * Returns whether this job should be run.
- */
- public boolean shouldRun() {
- if (!check)
- return true;
- return ServerPreferences.getInstance().isAutoPublishing() && server.shouldPublish();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.internal.jobs.InternalJob#run(org.eclipse.core.runtime.IProgressMonitor)
- */
- protected IStatus run(IProgressMonitor monitor) {
- return server.publish(kind, monitor);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/PublishStatusItem.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/PublishStatusItem.java
deleted file mode 100644
index 2d32b89..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/PublishStatusItem.java
+++ /dev/null
@@ -1,166 +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.core.internal;
-
-import org.eclipse.core.runtime.IStatus;
-/**
- * IStatus used as child of a PublishStatus. It is just a
- * wrapper around another IStatus, used to give information
- * about the contained IStatus.
- */
-public class PublishStatusItem implements IStatus {
- // Unique identifier of plug-in.
- private String pluginId;
-
- // Message, localized to the current locale.
- private String message;
-
- private IStatus child;
-
- /**
- * PublishStatus constructor comment.
- */
- public PublishStatusItem(String pluginId, String message, IStatus child) {
- super();
- this.pluginId = pluginId;
- this.message = message;
- this.child = child;
- }
-
- /**
- * Returns a list of status object immediately contained in this
- * multi-status, or an empty list if this is not a multi-status.
- *
- * @return an array of status objects
- * @see #isMultiStatus
- */
- public IStatus[] getChildren() {
- if (child == null)
- return new IStatus[0];
- return new IStatus[] { child };
- }
-
- /**
- * Returns the plug-in-specific status code describing the outcome.
- *
- * @return plug-in-specific status code
- */
- public int getCode() {
- return 0;
- }
-
- /**
- * Returns the relevant low-level exception, or <code>null</code> if none.
- * For example, when an operation fails because of a network communications
- * failure, this might return the <code>java.io.IOException</code>
- * describing the exact nature of that failure.
- *
- * @return the relevant low-level exception, or <code>null</code> if none
- */
- public Throwable getException() {
- return null;
- }
-
- /**
- * Returns the message describing the outcome.
- * The message is localized to the current locale.
- *
- * @return a localized message
- */
- public String getMessage() {
- return message;
- }
-
- /**
- * Returns the unique identifier of the plug-in associated with this status
- * (this is the plug-in that defines the meaning of the status code).
- *
- * @return the unique identifier of the relevant plug-in
- */
- public String getPlugin() {
- return pluginId;
- }
-
- /**
- * Returns the severity. The severities are as follows (in
- * descending order):
- * <ul>
- * <li><code>ERROR</code> - a serious error (most severe)</li>
- * <li><code>WARNING</code> - a warning (less severe)</li>
- * <li><code>INFO</code> - an informational ("fyi") message (least severe)</li>
- * <li><code>OK</code> - everything is just fine</li>
- * </ul>
- * <p>
- * The severity of a multi-status is defined to be the maximum
- * severity of any of its children, or <code>OK</code> if it has
- * no children.
- * </p>
- *
- * @return the severity: one of <code>OK</code>,
- * <code>ERROR</code>, <code>INFO</code>, or <code>WARNING</code>
- * @see #matches
- */
- public int getSeverity() {
- if (child == null)
- return IStatus.OK;
- return child.getSeverity();
- }
-
- /**
- * Returns whether this status is a multi-status.
- * A multi-status describes the outcome of an operation
- * involving multiple operands.
- * <p>
- * The severity of a multi-status is derived from the severities
- * of its children; a multi-status with no children is
- * <code>OK</code> by definition.
- * A multi-status carries a plug-in identifier, a status code,
- * a message, and an optional exception. Clients may treat
- * multi-status objects in a multi-status unaware way.
- * </p>
- *
- * @return <code>true</code> for a multi-status,
- * <code>false</code> otherwise
- * @see #getChildren
- */
- public boolean isMultiStatus() {
- return true;
- }
-
- /**
- * Returns whether this status indicates everything is okay
- * (neither info, warning, nor error).
- *
- * @return <code>true</code> if this status has severity
- * <code>OK</code>, and <code>false</code> otherwise
- */
- public boolean isOK() {
- return (getSeverity() == IStatus.OK);
- }
-
- /**
- * Returns whether the severity of this status matches the given
- * specification.
- *
- * @param severityMask a mask formed by bitwise or'ing severity mask
- * constants (<code>ERROR</code>, <code>WARNING</code>,
- * <code>INFO</code>)
- * @return <code>true</code> if there is at least one match,
- * <code>false</code> if there are no matches
- * @see #getSeverity
- * @see #ERROR
- * @see #WARNING
- * @see #INFO
- */
- public boolean matches(int severityMask) {
- return (getSeverity() & severityMask) != 0;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ResourceManager.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ResourceManager.java
deleted file mode 100644
index 6b8df71..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ResourceManager.java
+++ /dev/null
@@ -1,1135 +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.core.internal;
-
-import java.io.ByteArrayInputStream;
-import java.util.*;
-
-import org.eclipse.core.runtime.*;
-import org.eclipse.core.resources.*;
-
-import org.eclipse.wst.server.core.*;
-import org.eclipse.wst.server.core.model.*;
-/**
- * ResourceManager handles the mappings between resources
- * and servers or server configurations, and creates
- * notification of servers or server configurations
- * being added and removed.
- *
- * <p>Servers and server configurations may be a single
- * resource, or they may be a folder that contains a group
- * of files. Folder-resource may not contain other servers
- * or configurations.</p>
- */
-public class ResourceManager {
- private static final String SERVER_DATA_FILE = "servers.xml";
-
- private static final byte EVENT_ADDED = 0;
- private static final byte EVENT_CHANGED = 1;
- private static final byte EVENT_REMOVED = 2;
-
- private static ResourceManager instance;
-
- // currently active runtimes, servers, and server configurations
- protected List runtimes;
- protected List servers;
- protected List configurations;
- protected IRuntime defaultRuntime;
-
- // lifecycle listeners
- protected transient List runtimeListeners;
- protected transient List serverListeners;
- protected transient List serverConfigurationListeners;
-
- // resource change listeners
- private IResourceChangeListener modelResourceChangeListener;
- private IResourceChangeListener publishResourceChangeListener;
- private Preferences.IPropertyChangeListener pcl;
- protected boolean ignorePreferenceChanges = false;
-
- // module factory listener
- private IModuleFactoryListener moduleFactoryListener;
- protected List moduleFactoryEvents = new ArrayList(5);
-
- // module listener
- protected IModuleListener moduleListener;
- protected List moduleEvents = new ArrayList(5);
-
- // module events listeners
- protected transient List moduleEventListeners;
-
- /**
- * Resource listener - tracks changes on server resources so that
- * we can reload/drop server instances and configurations that
- * may change outside of our control.
- * Listens for two types of changes:
- * 1. Servers or configurations being added or removed
- * from their respective folders. (in the future, including
- * the addition or removal of a full server project, which
- * we currently can't listen for because there is no nature
- * attached to the project at this point - OTI defect)
- * 2. Projects being deleted.
- */
- public class ServerModelResourceChangeListener implements IResourceChangeListener {
- /**
- * Create a new ServerModelResourceChangeListener.
- */
- public ServerModelResourceChangeListener() {
- super();
- }
-
- /**
- * Listen for projects being added or removed and act accordingly.
- *
- * @param event org.eclipse.core.resources.IResourceChangeEvent
- */
- public void resourceChanged(IResourceChangeEvent event) {
- IResourceDelta delta = event.getDelta();
- if (delta == null)
- return;
-
- Trace.trace(Trace.RESOURCES, "->- ServerModelResourceManager responding to resource change: " + event.getType() + " ->-");
- IResourceDelta[] children = delta.getAffectedChildren();
- if (children != null) {
- int size = children.length;
- for (int i = 0; i < size; i++) {
- IResource resource = children[i].getResource();
- if (resource != null && resource instanceof IProject) {
- projectChanged((IProject) resource, children[i]);
- }
- }
- }
-
- Trace.trace(Trace.RESOURCES, "-<- Done ServerModelResourceManager responding to resource change -<-");
- }
-
- /**
- * React to a change within a possible server project.
- *
- * @param delta org.eclipse.core.resources.IResourceDelta
- */
- protected void projectChanged(IProject project, IResourceDelta delta) {
- if (!((ProjectProperties)ServerCore.getProjectProperties(project)).isServerProject()) {
- Trace.trace(Trace.RESOURCES, "Not a server project: " + project.getName());
- return;
- }
-
- IResourceDelta[] children = delta.getAffectedChildren();
-
- int size = children.length;
- for (int i = 0; i < size; i++) {
- IResourceDelta child = children[i];
-
- // look for servers and server configurations
- try {
- child.accept(new IResourceDeltaVisitor() {
- public boolean visit(IResourceDelta delta2) {
- return handleResourceDelta(delta2);
- }
- });
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error responding to resource change", e);
- }
- }
- }
- }
-
- /**
- * Publish resource listener
- */
- public class PublishResourceChangeListener implements IResourceChangeListener {
- /**
- * Create a new PublishResourceChangeListener.
- */
- public PublishResourceChangeListener() {
- super();
- }
-
- /**
- * Listen for projects being added or removed and act accordingly.
- *
- * @param event org.eclipse.core.resources.IResourceChangeEvent
- */
- public void resourceChanged(IResourceChangeEvent event) {
- IResourceDelta delta = event.getDelta();
- if (delta == null)
- return;
-
- Trace.trace(Trace.FINEST, "->- PublishResourceManager responding to resource change: " + event.getType() + " ->-");
- // search for changes to any project using a visitor
- try {
- delta.accept(new IResourceDeltaVisitor() {
- public boolean visit(IResourceDelta visitorDelta) {
- IResource resource = visitorDelta.getResource();
-
- // only respond to project changes
- if (resource != null && resource instanceof IProject) {
- publishHandleProjectChange(visitorDelta);
- return false;
- }
- return true;
- }
- });
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error responding to resource change", e);
- }
- Trace.trace(Trace.FINEST, "-<- Done PublishResourceManager responding to resource change -<-");
- }
- }
-
- public class ModuleFactoryListener implements IModuleFactoryListener {
- public void moduleFactoryChanged(ModuleFactoryEvent event) {
- Trace.trace(Trace.FINEST, "Module factory changed");
- moduleFactoryEvents.add(event);
-
- // add new listeners
- IModule[] modules = event.getAddedModules();
- if (modules != null) {
- int size = modules.length;
- for (int i = 0; i < size; i++) {
- Trace.trace(Trace.FINEST, "Adding module listener to: " + modules[i]);
- modules[i].addModuleListener(moduleListener);
- }
- }
-
- // remove old listeners
- modules = event.getRemovedModules();
- if (modules != null) {
- int size = modules.length;
- for (int i = 0; i < size; i++) {
- Trace.trace(Trace.FINEST, "Removing module listener from: " + modules[i]);
- modules[i].removeModuleListener(moduleListener);
- }
- }
- }
- }
-
- public class ModuleListener implements IModuleListener {
- public void moduleChanged(ModuleEvent event) {
- Trace.trace(Trace.FINEST, "Module changed: " + event);
- if (!moduleEvents.contains(event))
- moduleEvents.add(event);
- }
- }
-
- protected List moduleServerEventHandlers;
- protected List moduleServerEventHandlerIndexes;
-
- /**
- * Cannot directly create a ResourceManager. Use
- * ServersCore.getResourceManager().
- */
- private ResourceManager() {
- super();
- instance = this;
-
- init();
- }
-
- protected void init() {
- servers = new ArrayList();
- configurations = new ArrayList();
- loadRuntimesList();
- loadServersList();
-
- pcl = new Preferences.IPropertyChangeListener() {
- public void propertyChange(Preferences.PropertyChangeEvent event) {
- if (ignorePreferenceChanges)
- return;
- String property = event.getProperty();
- if (property.equals("runtimes")) {
- loadRuntimesList();
- saveRuntimesList();
- }
- }
- };
-
- ServerPlugin.getInstance().getPluginPreferences().addPropertyChangeListener(pcl);
-
- resolveServers();
-
- // keep track of future changes to the file system
- modelResourceChangeListener = new ServerModelResourceChangeListener();
- ResourcesPlugin.getWorkspace().addResourceChangeListener(modelResourceChangeListener, IResourceChangeEvent.POST_CHANGE | IResourceChangeEvent.PRE_CLOSE | IResourceChangeEvent.PRE_DELETE);
-
- // add listener for future changes
- publishResourceChangeListener = new PublishResourceChangeListener();
- ResourcesPlugin.getWorkspace().addResourceChangeListener(publishResourceChangeListener, IResourceChangeEvent.POST_CHANGE | IResourceChangeEvent.PRE_DELETE);
-
- /*configurationListener = new IServerConfigurationListener() {
- public void childProjectChange(IServerConfiguration configuration) {
- handleConfigurationChildProjectsChange(configuration);
- }
- };*/
-
- Trace.trace(Trace.FINER, "Loading workspace servers and server configurations");
- IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
- if (projects != null) {
- int size = projects.length;
- for (int i = 0; i < size; i++) {
- if (((ProjectProperties)ServerCore.getProjectProperties(projects[i])).isServerProject())
- loadFromProject(projects[i]);
- }
- }
-
- moduleFactoryListener = new ModuleFactoryListener();
- moduleListener = new ModuleListener();
-
- addServerLifecycleListener(ServerListener.getInstance());
- }
-
- /**
- * Load all of the servers and server configurations from the given project.
- */
- protected static void loadFromProject(IProject project) {
- Trace.trace(Trace.FINER, "Initial server resource load for " + project.getName(), null);
- final ResourceManager rm = ResourceManager.getInstance();
-
- try {
- project.accept(new IResourceVisitor() {
- public boolean visit(IResource resource) {
- try {
- if (resource instanceof IFile) {
- IFile file = (IFile) resource;
- rm.handleNewFile(file, new NullProgressMonitor());
- return false;
- }
- return true;
- //return !rm.handleNewServerResource(resource, new NullProgressMonitor());
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error during initial server resource load", e);
- }
- return true;
- }
- });
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not load server project " + project.getName(), e);
- }
- }
-
- public static ResourceManager getInstance() {
- if (instance == null)
- new ResourceManager();
-
- return instance;
- }
-
- public static void shutdown() {
- if (instance == null)
- return;
-
- try {
- instance.shutdownImpl();
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error during shutdown", e);
- }
- }
-
- protected void shutdownImpl() {
- // stop all running servers
- // REMOVING FEATURE - can't be supported since we can't reload downstream plugins
- // during shutdown. Individual downstream plugins should contain their own similar
- // code to stop the servers.
- /*Iterator iterator = getServers().iterator();
- while (iterator.hasNext()) {
- IServer server = (IServer) iterator.next();
- try {
- if (server.getServerState() != IServer.STATE_STOPPED) {
- ServerDelegate delegate = server.getDelegate();
- if (delegate instanceof IStartableServer && ((IStartableServer)delegate).isTerminateOnShutdown())
- ((IStartableServer) delegate).terminate();
- }
- } catch (Exception e) { }
- }*/
-
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- if (workspace != null) {
- workspace.removeResourceChangeListener(modelResourceChangeListener);
- workspace.removeResourceChangeListener(publishResourceChangeListener);
- }
-
- ServerPlugin.getInstance().getPluginPreferences().removePropertyChangeListener(pcl);
-
- removeServerLifecycleListener(ServerListener.getInstance());
- }
-
- /*
- *
- */
- public void addRuntimeLifecycleListener(IRuntimeLifecycleListener listener) {
- Trace.trace(Trace.LISTENERS, "Adding server resource listener " + listener + " to " + this);
-
- if (runtimeListeners == null)
- runtimeListeners = new ArrayList(3);
- runtimeListeners.add(listener);
- }
-
- /*
- *
- */
- public void removeRuntimeLifecycleListener(IRuntimeLifecycleListener listener) {
- Trace.trace(Trace.LISTENERS, "Removing server resource listener " + listener + " from " + this);
-
- if (runtimeListeners != null)
- runtimeListeners.remove(listener);
- }
-
- /*
- *
- */
- public void addServerLifecycleListener(IServerLifecycleListener listener) {
- Trace.trace(Trace.LISTENERS, "Adding server resource listener " + listener + " to " + this);
-
- if (serverListeners == null)
- serverListeners = new ArrayList(3);
- serverListeners.add(listener);
- }
-
- /*
- *
- */
- public void removeServerLifecycleListener(IServerLifecycleListener listener) {
- Trace.trace(Trace.LISTENERS, "Removing server resource listener " + listener + " from " + this);
-
- if (serverListeners != null)
- serverListeners.remove(listener);
- }
-
- /**
- * Deregister an existing runtime.
- *
- * @param runtime
- */
- protected void deregisterRuntime(IRuntime runtime) {
- if (runtime == null)
- return;
-
- Trace.trace(Trace.RESOURCES, "Deregistering runtime: " + runtime.getName());
-
- ((Runtime)runtime).dispose();
- fireRuntimeEvent(runtime, EVENT_REMOVED);
- runtimes.remove(runtime);
- }
-
- /**
- * Deregister an existing server resource.
- *
- * @param server
- */
- protected void deregisterServer(IServer server) {
- if (server == null)
- return;
-
- Trace.trace(Trace.RESOURCES, "Deregistering server: " + server.getName());
-
- ((Server) server).deleteLaunchConfigurations();
- ServerPlugin.getInstance().removeTempDirectory(server.getId());
-
- ((Server)server).dispose();
- fireServerEvent(server, EVENT_REMOVED);
- servers.remove(server);
- }
-
- /**
- * Fire a runtime event.
- */
- private void fireRuntimeEvent(final IRuntime runtime, byte b) {
- Trace.trace(Trace.LISTENERS, "->- Firing runtime event: " + runtime.getName() + " ->-");
-
- if (runtimeListeners == null || runtimeListeners.isEmpty())
- return;
-
- int size = runtimeListeners.size();
- IRuntimeLifecycleListener[] srl = new IRuntimeLifecycleListener[size];
- runtimeListeners.toArray(srl);
-
- for (int i = 0; i < size; i++) {
- Trace.trace(Trace.LISTENERS, " Firing runtime event to " + srl[i]);
- try {
- if (b == EVENT_ADDED)
- srl[i].runtimeAdded(runtime);
- else if (b == EVENT_CHANGED)
- srl[i].runtimeChanged(runtime);
- else
- srl[i].runtimeRemoved(runtime);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, " Error firing runtime event to " + srl[i], e);
- }
- }
- Trace.trace(Trace.LISTENERS, "-<- Done firing runtime event -<-");
- }
-
- /**
- * Fire a server event.
- */
- private void fireServerEvent(final IServer server, byte b) {
- Trace.trace(Trace.LISTENERS, "->- Firing server event: " + server.getName() + " ->-");
-
- if (serverListeners == null || serverListeners.isEmpty())
- return;
-
- int size = serverListeners.size();
- IServerLifecycleListener[] srl = new IServerLifecycleListener[size];
- serverListeners.toArray(srl);
-
- for (int i = 0; i < size; i++) {
- Trace.trace(Trace.LISTENERS, " Firing server event to " + srl[i]);
- try {
- if (b == EVENT_ADDED)
- srl[i].serverAdded(server);
- else if (b == EVENT_CHANGED)
- srl[i].serverChanged(server);
- else
- srl[i].serverRemoved(server);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, " Error firing server event to " + srl[i], e);
- }
- }
- Trace.trace(Trace.LISTENERS, "-<- Done firing server event -<-");
- }
-
- protected void saveRuntimesList() {
- try {
- ignorePreferenceChanges = true;
- XMLMemento memento = XMLMemento.createWriteRoot("runtimes");
-
- if (defaultRuntime != null) {
- int ind = runtimes.indexOf(defaultRuntime);
- if (ind >= 0)
- memento.putString("default", ind + "");
- }
-
- Iterator iterator = runtimes.iterator();
- while (iterator.hasNext()) {
- Runtime runtime = (Runtime) iterator.next();
-
- IMemento child = memento.createChild("runtime");
- runtime.save(child);
- }
-
- String xmlString = memento.saveToString();
- Preferences prefs = ServerPlugin.getInstance().getPluginPreferences();
- prefs.setValue("runtimes", xmlString);
- ServerPlugin.getInstance().savePluginPreferences();
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not save runtimes", e);
- }
- ignorePreferenceChanges = false;
- }
-
- protected void saveServersList() {
- String filename = ServerPlugin.getInstance().getStateLocation().append(SERVER_DATA_FILE).toOSString();
-
- try {
- XMLMemento memento = XMLMemento.createWriteRoot("servers");
-
- Iterator iterator = servers.iterator();
- while (iterator.hasNext()) {
- Server server = (Server) iterator.next();
-
- IMemento child = memento.createChild("server");
- server.save(child);
- }
-
- memento.saveToFile(filename);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not save servers", e);
- }
- }
-
- protected void loadRuntimesList() {
- Trace.trace(Trace.FINEST, "Loading runtime info");
- Preferences prefs = ServerPlugin.getInstance().getPluginPreferences();
- String xmlString = prefs.getString("runtimes");
-
- runtimes = new ArrayList();
- if (xmlString != null && xmlString.length() > 0) {
- try {
- ByteArrayInputStream in = new ByteArrayInputStream(xmlString.getBytes());
- IMemento memento = XMLMemento.loadMemento(in);
-
- IMemento[] children = memento.getChildren("runtime");
- int size = children.length;
-
- for (int i = 0; i < size; i++) {
- Runtime runtime = new Runtime(null);
- runtime.loadFromMemento(children[i], new NullProgressMonitor());
- runtimes.add(runtime);
- }
-
- String s = memento.getString("default");
- try {
- int ind = Integer.parseInt(s);
- defaultRuntime = (IRuntime) runtimes.get(ind);
- } catch (Exception ex) {
- // ignore
- }
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Could not load runtimes: " + e.getMessage());
- }
- }
- }
-
- protected void loadServersList() {
- Trace.trace(Trace.FINEST, "Loading server info");
- String filename = ServerPlugin.getInstance().getStateLocation().append(SERVER_DATA_FILE).toOSString();
-
- try {
- IMemento memento = XMLMemento.loadMemento(filename);
-
- IMemento[] children = memento.getChildren("server");
- int size = children.length;
-
- for (int i = 0; i < size; i++) {
- Server server = new Server(null);
- server.loadFromMemento(children[i], new NullProgressMonitor());
- servers.add(server);
- }
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Could not load servers: " + e.getMessage());
- }
- }
-
- protected void addRuntime(IRuntime runtime) {
- if (runtime == null)
- return;
- if (!runtimes.contains(runtime))
- registerRuntime(runtime);
- else
- fireRuntimeEvent(runtime, EVENT_CHANGED);
- saveRuntimesList();
- resolveServers();
- RuntimeWorkingCopy.rebuildRuntime(runtime, true);
- }
-
- protected void removeRuntime(IRuntime runtime) {
- if (runtimes.contains(runtime)) {
- deregisterRuntime(runtime);
- saveRuntimesList();
- resolveServers();
- RuntimeWorkingCopy.rebuildRuntime(runtime, false);
- }
- }
-
- protected void addServer(IServer server) {
- if (!servers.contains(server))
- registerServer(server);
- else
- fireServerEvent(server, EVENT_CHANGED);
- saveServersList();
- resolveServers();
- }
-
- protected void removeServer(IServer server) {
- if (servers.contains(server)) {
- deregisterServer(server);
- saveServersList();
- resolveServers();
- }
- }
-
- /**
- * Returns an array of all runtimes.
- *
- * @return an array of runtimes
- */
- public IRuntime[] getRuntimes() {
- List list = new ArrayList(runtimes);
-
- int size = list.size();
- for (int i = 0; i < size - 1; i++) {
- for (int j = i + 1; j < size; j++) {
- IRuntime a = (IRuntime) list.get(i);
- IRuntime b = (IRuntime) list.get(j);
- if (a.getRuntimeType() != null && b.getRuntimeType() != null &&
- ((RuntimeType)a.getRuntimeType()).getOrder() < ((RuntimeType)b.getRuntimeType()).getOrder()) {
- Object temp = a;
- list.set(i, b);
- list.set(j, temp);
- }
- }
- }
-
- if (defaultRuntime != null) {
- list.remove(defaultRuntime);
- list.add(0, defaultRuntime);
- }
-
- IRuntime[] r = new IRuntime[list.size()];
- list.toArray(r);
- return r;
- }
-
- /**
- * Returns the runtime with the given id.
- *
- * @return IRuntime
- */
- public IRuntime getRuntime(String id) {
- if (id == null)
- throw new IllegalArgumentException();
-
- Iterator iterator = runtimes.iterator();
- while (iterator.hasNext()) {
- IRuntime runtime = (IRuntime) iterator.next();
- if (runtime.getId().equals(id))
- return runtime;
- }
- return null;
- }
-
- /**
- * Returns the default runtime. Test API - do not use.
- *
- * @return java.util.List
- */
- public IRuntime getDefaultRuntime() {
- return defaultRuntime;
- }
-
- /**
- * Sets the default runtime. Test API - do not use.
- *
- * @return java.util.List
- */
- public void setDefaultRuntime(IRuntime runtime) {
- defaultRuntime = runtime;
- saveRuntimesList();
- }
-
- protected void resolveServers() {
- Iterator iterator = servers.iterator();
- while (iterator.hasNext()) {
- Server server = (Server) iterator.next();
- server.resolve();
- }
- }
-
- /**
- * Returns an array containing all servers.
- *
- * @return an array containing all servers
- */
- public IServer[] getServers() {
- IServer[] servers2 = new IServer[servers.size()];
- servers.toArray(servers2);
-
- Arrays.sort(servers2, new Comparator() {
- public int compare(Object o1, Object o2) {
- IServer a = (IServer) o1;
- IServer b = (IServer) o2;
- return a.getName().compareToIgnoreCase(b.getName());
- }
- });
-
- return servers2;
- }
-
- /**
- * Returns the server with the given id.
- *
- * @return a server
- */
- public IServer getServer(String id) {
- if (id == null)
- throw new IllegalArgumentException();
-
- Iterator iterator = servers.iterator();
- while (iterator.hasNext()) {
- Server server = (Server) iterator.next();
- if (id.equals(server.getId()))
- return server;
- }
- return null;
- }
-
- /**
- * Returns true if the resource change was handled.
- *
- * @param delta org.eclipse.core.resources.IResourceDelta
- * @return boolean
- */
- protected boolean handleResourceDelta(IResourceDelta delta) {
- int kind = delta.getKind();
- IResource resource2 = delta.getResource();
-
- // ignore markers
- if (kind == IResourceDelta.CHANGED && (delta.getFlags() & IResourceDelta.MARKERS) != 0)
- return false;
-
- Trace.trace(Trace.RESOURCES, "Resource changed: " + resource2 + " " + kind);
-
- if (resource2 instanceof IFile) {
- IFile file = (IFile) resource2;
- IProgressMonitor monitor = new NullProgressMonitor();
- if (kind == IResourceDelta.ADDED) {
- handleNewFile(file, monitor);
- } else if (kind == IResourceDelta.REMOVED) {
- handleRemovedFile(file);
- } else
- handleChangedFile(file, monitor);
- monitor.done();
- return false;
- }
- IFolder folder = (IFolder) resource2;
- Iterator iterator = servers.iterator();
- while (iterator.hasNext()) {
- IServer server = (IServer) iterator.next();
- if (server.getServerType().hasServerConfiguration() && folder.equals(server.getServerConfiguration())
- && server.isDelegateLoaded()) {
- try {
- ((Server)server).getDelegate().configurationChanged();
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Server failed on configuration change");
- }
- }
- }
- return true;
-
- /*IProgressMonitor monitor = new NullProgressMonitor();
- List list = getResourceParentList(resource2);
- monitor.beginTask("", list.size() * 1000);
-
- Iterator iterator = list.iterator();
- while (iterator.hasNext()) {
- IResource resource = (IResource) iterator.next();
- if (!visited.contains(resource.getFullPath())) {
- visited.add(resource.getFullPath());
- if (kind == IResourceDelta.REMOVED) {
- boolean b = handleRemovedFile(resource);
- if (b) {
- if (resource instanceof IContainer)
- removeServerResourcesBelow((IContainer) resource);
- return false;
- } else
- return true;
- } else if (kind == IResourceDelta.ADDED) {
- return !handleNewServerResource(resource, monitor);
- } else {
- boolean b = handleChangedServerResource(resource, monitor);
- if (!b) {
- handleRemovedFile(resource);
- }
- return true;
- }
- }
- }
-
- monitor.done();
- Trace.trace(Trace.RESOURCES, "Ignored resource change: " + resource2);
- return true;*/
- }
-
- protected IServer loadServer(IFile file, IProgressMonitor monitor) throws CoreException {
- Server server = new Server(file);
- server.loadFromFile(monitor);
- return server;
- }
-
- /**
- * Tries to load a new server resource from the given resource.
- * Returns true if the load and register were successful.
- *
- * @param file
- * @param monitor
- * @return boolean
- */
- protected boolean handleNewFile(IFile file, IProgressMonitor monitor) {
- Trace.trace(Trace.RESOURCES, "handleNewFile: " + file);
- monitor = ProgressUtil.getMonitorFor(monitor);
- monitor.beginTask("", 2000);
-
- // try loading a server
- if (file.getFileExtension().equals(IServerAttributes.FILE_EXTENSION)) {
- try {
- IServer server = loadServer(file, ProgressUtil.getSubMonitorFor(monitor, 1000));
- if (server != null) {
- registerServer(server);
- monitor.done();
- return true;
- }
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error loading server", e);
- }
- }
-
- monitor.done();
- return false;
- }
-
- /**
- * Returns the server that came from the given file, or <code>null</code>
- * if none. This convenience method searches the list of known
- * servers ({@link #getServers()}) for the one with a matching
- * location ({@link IServer#getFile()}). The file may not be null.
- *
- * @param file a server file
- * @return the server instance, or <code>null</code> if
- * there is no server associated with the given file
- */
- public static IServer findServer(IFile file) {
- if (file == null)
- throw new IllegalArgumentException();
-
- IServer[] servers = ServerCore.getServers();
- if (servers != null) {
- int size = servers.length;
- for (int i = 0; i < size; i++) {
- if (file.equals(servers[i].getFile()))
- return servers[i];
- }
- }
- return null;
- }
-
- /**
- * Tries to handle a resource change. Returns true if the reload
- * was successful.
- *
- * @param file a file
- * @param monitor
- * @return boolean
- */
- protected boolean handleChangedFile(IFile file, IProgressMonitor monitor) {
- Trace.trace(Trace.RESOURCES, "handleChangedFile: " + file);
- monitor = ProgressUtil.getMonitorFor(monitor);
- monitor.beginTask("", 1000);
- boolean found = false;
-
- IServer server = findServer(file);
- if (server != null) {
- found = true;
- try {
- Trace.trace(Trace.RESOURCES, "Reloading server: " + server);
- ((Server) server).loadFromFile(monitor);
- fireServerEvent(server, EVENT_CHANGED);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error reloading server " + server.getName() + " from " + file + ": " + e.getMessage());
- deregisterServer(server);
- }
- }
-
- Trace.trace(Trace.RESOURCES, "No server resource found at: " + file);
-
- monitor.done();
- return found;
- }
-
- /**
- * Tries to remove a current resource. Returns true if the
- * deregistering was successful.
- *
- * @param file a file
- * @return boolean
- */
- protected boolean handleRemovedFile(IFile file) {
- Trace.trace(Trace.RESOURCES, "handleRemovedServerResource: " + file);
-
- IServer server = findServer(file);
- if (server != null) {
- deregisterServer(server);
- return true;
- }
-
- Trace.trace(Trace.RESOURCES, "No server resource found at: " + file);
- return false;
- }
-
- /**
- * A project has changed. If this is an add or remove, check
- * to see if it is part of a current server configuration.
- *
- * @param delta org.eclipse.core.resources.IResourceDelta
- */
- protected void publishHandleProjectChange(IResourceDelta delta) {
- Trace.trace(Trace.FINEST, "> publishHandleProjectChange " + delta.getResource());
- IProject project = (IProject) delta.getResource();
-
- if (project == null)
- return;
-
- if (isDeltaOnlyMarkers(delta))
- return;
-
- final IModule[] modules = ServerUtil.getModules(project);
- if (modules == null)
- return;
-
- Trace.trace(Trace.FINEST, "- publishHandleProjectChange");
-
- if (modules != null) {
- int size2 = modules.length;
- for (int j = 0; j < size2; j++) {
- IServer[] servers2 = getServers();
- if (servers2 != null) {
- int size = servers2.length;
- for (int i = 0; i < size; i++) {
- if (servers2[i].isDelegateLoaded())
- ((Server) servers2[i]).handleModuleProjectChange(modules[j]);
- }
- }
- }
- }
- Trace.trace(Trace.FINEST, "< publishHandleProjectChange");
- }
-
- protected boolean isDeltaOnlyMarkers(IResourceDelta delta) {
- class Temp {
- boolean b = true;
- }
- final Temp t = new Temp();
- try {
- delta.accept(new IResourceDeltaVisitor() {
- public boolean visit(IResourceDelta delta2) throws CoreException {
- if (!t.b)
- return false;
- int flags = delta2.getFlags();
- if (flags != 0 && flags != IResourceDelta.MARKERS) {
- t.b = false;
- return false;
- }
- return true;
- }
- });
- } catch (Exception e) {
- // ignore
- }
- return t.b;
- }
-
- /**
- * Registers a new runtime.
- *
- * @param runtime org.eclipse.wst.server.core.IRuntime
- */
- protected void registerRuntime(IRuntime runtime) {
- if (runtime == null)
- return;
-
- Trace.trace(Trace.RESOURCES, "Registering runtime: " + runtime.getName());
-
- runtimes.add(runtime);
- fireRuntimeEvent(runtime, EVENT_ADDED);
- }
-
- /**
- * Registers a new server.
- *
- * @param server org.eclipse.wst.server.core.IServer
- */
- protected void registerServer(IServer server) {
- if (server == null)
- return;
-
- Trace.trace(Trace.RESOURCES, "Registering server: " + server.getName());
-
- servers.add(server);
- fireServerEvent(server, EVENT_ADDED);
- }
-
- /**
- *
- */
- protected void addModuleFactoryListener(ModuleFactoryDelegate delegate) {
- if (delegate == null)
- return;
-
- Trace.trace(Trace.LISTENERS, "Adding module factory listener to: " + delegate);
- delegate.addModuleFactoryListener(moduleFactoryListener);
-
- IModule[] modules = delegate.getModules();
- if (modules != null) {
- int size = modules.length;
- for (int i = 0; i < size; i++) {
- Trace.trace(Trace.LISTENERS, "Adding module listener to: " + modules[i]);
- modules[i].addModuleListener(moduleListener);
- }
- }
- }
-
- /**
- * Adds a new module events listener.
- *
- * @param listener org.eclipse.wst.server.core.model.IModuleEventsListener
- */
- public void addModuleEventsListener(IModuleEventsListener listener) {
- Trace.trace(Trace.LISTENERS, "Adding moduleEvents listener " + listener + " to " + this);
-
- if (moduleEventListeners == null)
- moduleEventListeners = new ArrayList();
- moduleEventListeners.add(listener);
- }
-
- /**
- * Removes an existing module events listener.
- *
- * @param listener org.eclipse.wst.server.core.model.IModuleEventsListener
- */
- public void removeModuleEventsListener(IModuleEventsListener listener) {
- Trace.trace(Trace.LISTENERS, "Removing moduleEvents listener " + listener + " to " + this);
-
- if (moduleEventListeners != null)
- moduleEventListeners.remove(listener);
- }
-
- /**
- * Module events have momentarily stopped firing and should be
- * handled appropriately.
- */
- public void syncModuleEvents() {
- if (moduleEvents.isEmpty() && moduleFactoryEvents.isEmpty())
- return;
-
- Trace.trace(Trace.LISTENERS, "->- Firing moduleEvents " + moduleEvents.size() + " " + moduleFactoryEvents.size());
- Iterator iterator = moduleEvents.iterator();
- while (iterator.hasNext()) {
- ModuleEvent event = (ModuleEvent) iterator.next();
- Trace.trace(Trace.LISTENERS, " 1> " + event);
- }
- iterator = moduleFactoryEvents.iterator();
- while (iterator.hasNext()) {
- ModuleFactoryEvent event = (ModuleFactoryEvent) iterator.next();
- Trace.trace(Trace.LISTENERS, " 2> " + event);
- }
-
- ModuleEvent[] events = new ModuleEvent[moduleEvents.size()];
- moduleEvents.toArray(events);
-
- ModuleFactoryEvent[] factoryEvents = new ModuleFactoryEvent[moduleFactoryEvents.size()];
- moduleFactoryEvents.toArray(factoryEvents);
-
- if (moduleEventListeners != null) {
- iterator = moduleEventListeners.iterator();
- while (iterator.hasNext()) {
- IModuleEventsListener listener = (IModuleEventsListener) iterator.next();
- try {
- Trace.trace(Trace.LISTENERS, " Firing moduleEvents to " + listener);
- listener.moduleEvents(factoryEvents, events);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, " Error firing moduleEvents to " + listener);
- }
- }
- }
-
- // fire module server events
- fireModuleServerEvent(factoryEvents, events);
-
- // clear cache
- moduleEvents = new ArrayList(5);
- moduleFactoryEvents = new ArrayList(5);
-
- Trace.trace(Trace.LISTENERS, "-<- Firing moduleEvents " + moduleEvents.size() + " " + moduleFactoryEvents.size());
- }
-
- protected void fireModuleServerEvent(ModuleFactoryEvent[] factoryEvents, ModuleEvent[] events) {
- // do nothing
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Runtime.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Runtime.java
deleted file mode 100644
index 1b1fe08..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Runtime.java
+++ /dev/null
@@ -1,178 +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.core.internal;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.*;
-import org.eclipse.wst.server.core.*;
-import org.eclipse.wst.server.core.model.RuntimeDelegate;
-/**
- *
- */
-public class Runtime extends Base implements IRuntime {
- protected static final String PROP_RUNTIME_TYPE_ID = "runtime-type-id";
- protected static final String PROP_LOCATION = "location";
- protected static final String PROP_TEST_ENVIRONMENT = "test-environment";
- protected static final String PROP_STUB = "stub";
-
- protected IRuntimeType runtimeType;
- protected RuntimeDelegate delegate;
-
- public Runtime(IFile file) {
- super(file);
- }
-
- public Runtime(IFile file, String id, IRuntimeType runtimeType) {
- super(file, id);
- this.runtimeType = runtimeType;
- map.put(PROP_NAME, runtimeType.getName());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.server.core.model.IRuntime#getRuntimeType()
- */
- public IRuntimeType getRuntimeType() {
- return runtimeType;
- }
-
- /**
- * Return the validation status of the runtime.
- *
- * @return the status
- */
- public IStatus validate(IProgressMonitor monitor) {
- try {
- return getDelegate(monitor).validate();
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error calling delegate validate() " + toString(), e);
- return null;
- }
- }
-
- public RuntimeDelegate getDelegate(IProgressMonitor monitor) {
- if (delegate != null)
- return delegate;
-
- synchronized (this) {
- if (delegate == null) {
- try {
- long time = System.currentTimeMillis();
- RuntimeType runtimeType2 = (RuntimeType) runtimeType;
- delegate = (RuntimeDelegate) runtimeType2.getElement().createExecutableExtension("class");
- delegate.initialize(this);
- Trace.trace(Trace.PERFORMANCE, "Runtime.getDelegate(): <" + (System.currentTimeMillis() - time) + "> " + getRuntimeType().getId());
- } catch (Throwable t) {
- Trace.trace(Trace.SEVERE, "Could not create delegate " + toString(), t);
- }
- }
- }
- return delegate;
- }
-
- /**
- * Returns true if the delegate has been loaded.
- *
- * @return <code>true</code> if the delegate has been loaded, and
- * <code>false</code> otherwise
- */
- public boolean isDelegateLoaded() {
- return delegate != null;
- }
-
- public void dispose() {
- if (delegate != null)
- delegate.dispose();
- }
-
- public IRuntimeWorkingCopy createWorkingCopy() {
- return new RuntimeWorkingCopy(this);
- }
-
- public boolean isWorkingCopy() {
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.server.core.model.IRuntime#getLocation()
- */
- public IPath getLocation() {
- String temp = getAttribute(PROP_LOCATION, (String)null);
- if (temp == null)
- return null;
- return new Path(temp);
- }
-
- protected void deleteFromMetadata() {
- ResourceManager.getInstance().removeRuntime(this);
- }
-
- protected void saveToMetadata(IProgressMonitor monitor) {
- super.saveToMetadata(monitor);
- ResourceManager.getInstance().addRuntime(this);
- }
-
- protected String getXMLRoot() {
- return "runtime";
- }
-
- public boolean isTestEnvironment() {
- return getAttribute(PROP_TEST_ENVIRONMENT, false);
- }
-
- public boolean isStub() {
- return getAttribute(PROP_STUB, false);
- }
-
- protected void setInternal(RuntimeWorkingCopy wc) {
- map = wc.map;
- runtimeType = wc.runtimeType;
- file = wc.file;
- delegate = wc.delegate;
-
- int timestamp = wc.getTimestamp();
- map.put("timestamp", Integer.toString(timestamp+1));
- }
-
- protected void loadState(IMemento memento) {
- String runtimeTypeId = memento.getString(PROP_RUNTIME_TYPE_ID);
- if (runtimeTypeId != null)
- runtimeType = ServerCore.findRuntimeType(runtimeTypeId);
- else
- runtimeType = null;
- }
-
- protected void saveState(IMemento memento) {
- if (runtimeType != null)
- memento.putString(PROP_RUNTIME_TYPE_ID, runtimeType.getId());
- }
-
- public boolean equals(Object obj) {
- if (!(obj instanceof Runtime))
- return false;
-
- Runtime runtime = (Runtime) obj;
- return runtime.getId().equals(getId());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
- */
- public Object getAdapter(Class adapter) {
- RuntimeDelegate delegate2 = getDelegate(null);
- if (adapter.isInstance(delegate2))
- return delegate;
- return null;
- }
-
- public String toString() {
- return "Runtime[" + getId() + ", " + getName() + ", " + getLocation() + ", " + getRuntimeType() + "]";
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/RuntimeLocator.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/RuntimeLocator.java
deleted file mode 100644
index 0f83e78..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/RuntimeLocator.java
+++ /dev/null
@@ -1,89 +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.core.internal;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.wst.server.core.IRuntimeWorkingCopy;
-import org.eclipse.wst.server.core.model.RuntimeLocatorDelegate;
-/**
- *
- */
-public class RuntimeLocator implements IRuntimeLocator {
- private IConfigurationElement element;
- private RuntimeLocatorDelegate delegate;
-
- public RuntimeLocator(IConfigurationElement element) {
- super();
- this.element = element;
- }
-
- protected IConfigurationElement getElement() {
- return element;
- }
-
- /*
- * @see IRuntimeLocator#getId()
- */
- public String getId() {
- return element.getAttribute("id");
- }
-
- /*
- * @see IRuntimeLocator
- */
- protected String[] getTypeIds() {
- try {
- return ServerPlugin.tokenize(element.getAttribute("typeIds"), ",");
- } catch (Exception e) {
- return null;
- }
- }
-
- /*
- * @see IRuntimeLocator
- */
- public boolean supportsType(String id) {
- return ServerPlugin.supportsType(getTypeIds(), id);
- }
-
- protected RuntimeLocatorDelegate getDelegate() {
- if (delegate == null) {
- try {
- delegate = (RuntimeLocatorDelegate) element.createExecutableExtension("class");
- } catch (Throwable t) {
- Trace.trace(Trace.SEVERE, "Could not create delegate " + toString() + ": " + t.getMessage());
- }
- }
- return delegate;
- }
-
- /*
- * @see IRuntimeLocator#searchForRuntimes()
- */
- public void searchForRuntimes(IPath path, final IRuntimeSearchListener found, IProgressMonitor monitor) {
- try {
- //getDelegate().searchForRuntimes(path, found, monitor);
- getDelegate().searchForRuntimes(path, new RuntimeLocatorDelegate.IRuntimeSearchListener() {
- public void runtimeFound(IRuntimeWorkingCopy runtime) {
- found.runtimeFound(runtime);
- }
- }, monitor);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error calling delegate " + toString() + ": " + e.getMessage());
- }
- }
-
- public String toString() {
- return "RuntimeLocator[" + getId() + "]";
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/RuntimeTargetHandler.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/RuntimeTargetHandler.java
deleted file mode 100644
index 194d7b9..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/RuntimeTargetHandler.java
+++ /dev/null
@@ -1,161 +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.core.internal;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.StringTokenizer;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.wst.server.core.*;
-import org.eclipse.wst.server.core.model.RuntimeTargetHandlerDelegate;
-/**
- *
- */
-public class RuntimeTargetHandler implements IRuntimeTargetHandler, IOrdered {
- private IConfigurationElement element;
- private RuntimeTargetHandlerDelegate delegate;
-
- public RuntimeTargetHandler(IConfigurationElement element) {
- super();
- this.element = element;
- }
-
- protected IConfigurationElement getElement() {
- return element;
- }
-
- /**
- *
- * @return the id
- */
- public String getId() {
- return element.getAttribute("id");
- }
-
- /**
- * Returns the order.
- *
- * @return the order
- */
- public int getOrder() {
- try {
- String o = element.getAttribute("order");
- return Integer.parseInt(o);
- } catch (NumberFormatException e) {
- return -1;
- }
- }
-
- public String[] getRuntimeTypeIds() {
- try {
- List list = new ArrayList();
- StringTokenizer st = new StringTokenizer(element.getAttribute("runtimeTypeIds"), ",");
- while (st.hasMoreTokens()) {
- String str = st.nextToken();
- if (str != null && str.length() > 0)
- list.add(str.trim());
- }
- String[] s = new String[list.size()];
- list.toArray(s);
- return s;
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not parse runtime type ids: " + element);
- return null;
- }
- }
-
- /**
- * Returns true if the given server resource type (given by the
- * id) can be opened with this editor. This result is based on
- * the result of the getServerResources() method.
- *
- * @return boolean
- */
- public boolean supportsRuntimeType(IRuntimeType runtimeType) {
- if (runtimeType == null)
- return false;
- String id = runtimeType.getId();
- if (id == null || id.length() == 0)
- return false;
-
- String[] s = getRuntimeTypeIds();
- if (s == null)
- return false;
-
- int size = s.length;
- for (int i = 0; i < size; i++) {
- if (s[i].endsWith("*")) {
- if (id.length() >= s[i].length() && id.startsWith(s[i].substring(0, s[i].length() - 1)))
- return true;
- } else if (id.equals(s[i]))
- return true;
- }
- return false;
- }
-
- /*
- * @see IPublishManager#getDelegate()
- */
- public RuntimeTargetHandlerDelegate getDelegate() {
- if (delegate == null) {
- try {
- delegate = (RuntimeTargetHandlerDelegate) element.createExecutableExtension("class");
- delegate.initialize(this);
- } catch (Throwable t) {
- Trace.trace(Trace.SEVERE, "Could not create delegate " + toString() + ": " + t.getMessage());
- }
- }
- return delegate;
- }
-
- /**
- *
- */
- public void setRuntimeTarget(IProject project, IRuntime runtime, IProgressMonitor monitor) {
- if (project == null || runtime == null)
- return;
- try {
- getDelegate().setRuntimeTarget(project, runtime, monitor);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error calling delegate " + toString() + ": " + e.getMessage());
- }
- }
-
- /**
- *
- */
- public void removeRuntimeTarget(IProject project, IRuntime runtime, IProgressMonitor monitor) {
- if (project == null || runtime == null)
- return;
- try {
- getDelegate().removeRuntimeTarget(project, runtime, monitor);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error calling delegate " + toString() + ": " + e.getMessage());
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
- */
- public Object getAdapter(Class adapter) {
- RuntimeTargetHandlerDelegate delegate2 = getDelegate();
- if (adapter.isInstance(delegate2))
- return delegate;
- return null;
- }
-
- public String toString() {
- return "RuntimeTargetHandler[" + getId() + "]";
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/RuntimeType.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/RuntimeType.java
deleted file mode 100644
index 066381f..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/RuntimeType.java
+++ /dev/null
@@ -1,114 +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.core.internal;
-
-import java.util.List;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.wst.server.core.*;
-/**
- *
- */
-public class RuntimeType implements IRuntimeType, IOrdered {
- private IConfigurationElement element;
- private List moduleTypes;
-
- public RuntimeType(IConfigurationElement element) {
- super();
- this.element = element;
- }
-
- protected IConfigurationElement getElement() {
- return element;
- }
-
- /**
- *
- * @return the id
- */
- public String getId() {
- return element.getAttribute("id");
- }
-
- /**
- *
- * @return the name
- */
- public String getName() {
- return element.getAttribute("name");
- }
-
- /**
- *
- * @return the description
- */
- public String getDescription() {
- return element.getAttribute("description");
- }
-
- /**
- * Returns the order.
- *
- * @return the order
- */
- public int getOrder() {
- try {
- String o = element.getAttribute("order");
- return Integer.parseInt(o);
- } catch (NumberFormatException e) {
- return -1;
- }
- }
-
- public String getVendor() {
- String vendor = element.getAttribute("vendor");
- if (vendor == null)
- return ServerPlugin.getResource("%defaultVendor");
- return vendor;
- }
-
- public String getVersion() {
- String version = element.getAttribute("version");
- if (version == null)
- return ServerPlugin.getResource("%defaultVersion");
- return version;
- }
-
- /**
- * Return the supported module types.
- *
- * @return an array of module types
- */
- public IModuleType[] getModuleTypes() {
- if (moduleTypes == null)
- moduleTypes = ServerPlugin.getModuleTypes(element.getChildren("moduleType"));
-
- IModuleType[] mt = new IModuleType[moduleTypes.size()];
- moduleTypes.toArray(mt);
- return mt;
- }
-
- public boolean canCreate() {
- String a = element.getAttribute("class");
- return a != null && a.length() > 0;
- }
-
- public IRuntimeWorkingCopy createRuntime(String id, IProgressMonitor monitor) {
- RuntimeWorkingCopy rwc = new RuntimeWorkingCopy(null, id, this);
- rwc.setDefaults(monitor);
- return rwc;
- }
-
- public String toString() {
- return "RuntimeType[" + getId() + ", " + getName() + "]";
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/RuntimeWorkingCopy.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/RuntimeWorkingCopy.java
deleted file mode 100644
index 780d682..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/RuntimeWorkingCopy.java
+++ /dev/null
@@ -1,305 +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.core.internal;
-
-import java.beans.PropertyChangeListener;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IncrementalProjectBuilder;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.*;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.wst.server.core.*;
-import org.eclipse.wst.server.core.model.RuntimeDelegate;
-/**
- *
- */
-public class RuntimeWorkingCopy extends Runtime implements IRuntimeWorkingCopy {
- protected String PROP_ID_SET = "id-set";
- protected Runtime runtime;
- protected WorkingCopyHelper wch;
-
- protected RuntimeDelegate workingCopyDelegate;
-
- // from existing runtime
- public RuntimeWorkingCopy(Runtime runtime) {
- super(runtime.getFile());
- this.runtime = runtime;
-
- runtimeType = runtime.getRuntimeType();
-
- map = new HashMap(runtime.map);
- wch = new WorkingCopyHelper(this);
- }
-
- // new runtime
- public RuntimeWorkingCopy(IFile file, String id, IRuntimeType runtimeType) {
- super(file, id, runtimeType);
- wch = new WorkingCopyHelper(this);
- wch.setDirty(true);
-
- if (id == null || id.length() == 0) {
- id = ServerPlugin.generateId();
- map.put(PROP_ID, id);
- } else
- setAttribute(PROP_ID_SET, true);
-
- // throw CoreException if the id already exists
- }
-
- public boolean isWorkingCopy() {
- return true;
- }
-
- public IRuntimeWorkingCopy createWorkingCopy() {
- return this;
- }
-
- public void setAttribute(String attributeName, int value) {
- wch.setAttribute(attributeName, value);
- }
-
- public void setAttribute(String attributeName, boolean value) {
- wch.setAttribute(attributeName, value);
- }
-
- public void setAttribute(String attributeName, String value) {
- wch.setAttribute(attributeName, value);
- }
-
- public void setAttribute(String attributeName, List value) {
- wch.setAttribute(attributeName, value);
- }
-
- public void setAttribute(String attributeName, Map value) {
- wch.setAttribute(attributeName, value);
- }
-
- public void setName(String name) {
- wch.setName(name);
- boolean set = getAttribute(PROP_ID_SET, false);
- if (runtime == null && !set)
- setAttribute("id", name);
- }
-
- public void setTestEnvironment(boolean b) {
- setAttribute(PROP_TEST_ENVIRONMENT, b);
- }
-
- public boolean isDirty() {
- return wch.isDirty();
- }
-
- public IRuntime getOriginal() {
- return runtime;
- }
-
- public void setReadOnly(boolean b) {
- wch.setLocked(b);
- }
-
- public void setPrivate(boolean b) {
- wch.setPrivate(b);
- }
-
- public void setLocation(IPath path) {
- if (path == null)
- setAttribute(PROP_LOCATION, (String)null);
- else
- setAttribute(PROP_LOCATION, path.toString());
- }
-
- public IRuntime save(boolean force, IProgressMonitor monitor) throws CoreException {
- monitor = ProgressUtil.getMonitorFor(monitor);
- monitor.subTask(ServerPlugin.getResource("%savingTask", getName()));
-
- if (!force && getOriginal() != null)
- wch.validateTimestamp(getOriginal().getTimestamp());
-
- IRuntime origRuntime = runtime;
- if (runtime == null)
- runtime = new Runtime(file);
-
- String oldId = getId();
- String name = getName();
- boolean set = getAttribute(PROP_ID_SET, false);
- if (!oldId.equals(name) && !set) {
- setAttribute("id", name);
- } else
- oldId = null;
-
- runtime.setInternal(this);
- runtime.saveToMetadata(monitor);
- wch.setDirty(false);
-
- if (oldId != null)
- updateRuntimeReferences(oldId, name, origRuntime);
-
- return runtime;
- }
-
- protected void updateRuntimeReferences(final String oldId, final String newId, final IRuntime origRuntime) {
- class UpdateRuntimeReferencesJob extends Job {
- public UpdateRuntimeReferencesJob() {
- super(ServerPlugin.getResource("%savingTask", newId));
- }
-
- public IStatus run(IProgressMonitor monitor) {
- // fix .runtime files
- IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
- if (projects != null) {
- int size = projects.length;
- for (int i = 0; i < size; i++) {
- ProjectProperties props = (ProjectProperties) ServerCore.getProjectProperties(projects[i]);
- if (oldId.equals(props.getRuntimeTargetId())) {
- try {
- props.setRuntimeTargetId(newId, monitor);
- } catch (Exception e) {
- // ignore
- }
- }
- }
- }
-
- // save servers
- if (runtime != null) {
- ResourceManager rm = ResourceManager.getInstance();
- IServer[] servers = rm.getServers();
- if (servers != null) {
- int size = servers.length;
- for (int i = 0; i < size; i++) {
- if (oldId.equals(((Server)servers[i]).getRuntimeId())) {
- try {
- ServerWorkingCopy wc = (ServerWorkingCopy) servers[i].createWorkingCopy();
- wc.setRuntimeId(newId);
- wc.save(false, monitor);
- } catch (Exception e) {
- // ignore
- }
- }
- }
- }
- }
-
- return new Status(IStatus.OK, ServerPlugin.PLUGIN_ID, 0, "", null);
- }
- }
- UpdateRuntimeReferencesJob job = new UpdateRuntimeReferencesJob();
- job.schedule();
- }
-
- /**
- * Rebuild any projects that are targetted to this runtime.
- *
- * @param runtime
- * @param add
- */
- protected static void rebuildRuntime(final IRuntime runtime, final boolean add) {
- if (runtime == null)
- return;
-
- class RebuildRuntimeReferencesJob extends Job {
- public RebuildRuntimeReferencesJob() {
- super(ServerPlugin.getResource("%taskPerforming"));
- }
-
- public IStatus run(IProgressMonitor monitor) {
- String id = runtime.getId();
-
- IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
- if (projects != null) {
- int size = projects.length;
- for (int i = 0; i < size; i++) {
- ProjectProperties props = (ProjectProperties) ServerCore.getProjectProperties(projects[i]);
- if (id.equals(props.getRuntimeTargetId())) {
- try {
- if (add)
- props.setRuntimeTarget(null, runtime, false, monitor);
- else
- props.setRuntimeTarget(runtime, null, false, monitor);
- projects[i].build(IncrementalProjectBuilder.FULL_BUILD, monitor);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
- }
-
- return new Status(IStatus.OK, ServerPlugin.PLUGIN_ID, 0, "", null);
- }
- }
- RebuildRuntimeReferencesJob job = new RebuildRuntimeReferencesJob();
- job.schedule();
- }
-
- public RuntimeDelegate getWorkingCopyDelegate(IProgressMonitor monitor) {
- if (workingCopyDelegate != null)
- return workingCopyDelegate;
-
- synchronized (this) {
- if (workingCopyDelegate == null) {
- try {
- long time = System.currentTimeMillis();
- RuntimeType runtimeType2 = (RuntimeType) runtimeType;
- workingCopyDelegate = (RuntimeDelegate) runtimeType2.getElement().createExecutableExtension("class");
- workingCopyDelegate.initialize(this);
- Trace.trace(Trace.PERFORMANCE, "RuntimeWorkingCopy.getWorkingCopyDelegate(): <" + (System.currentTimeMillis() - time) + "> " + getRuntimeType().getId());
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not create delegate " + toString(), e);
- }
- }
- }
- return workingCopyDelegate;
- }
-
- public void dispose() {
- super.dispose();
- if (workingCopyDelegate != null)
- workingCopyDelegate.dispose();
- }
-
- /**
- * Add a property change listener to this server.
- *
- * @param listener java.beans.PropertyChangeListener
- */
- public void addPropertyChangeListener(PropertyChangeListener listener) {
- wch.addPropertyChangeListener(listener);
- }
-
- /**
- * Remove a property change listener from this server.
- *
- * @param listener java.beans.PropertyChangeListener
- */
- public void removePropertyChangeListener(PropertyChangeListener listener) {
- wch.removePropertyChangeListener(listener);
- }
-
- /**
- * Fire a property change event.
- */
- public void firePropertyChangeEvent(String propertyName, Object oldValue, Object newValue) {
- wch.firePropertyChangeEvent(propertyName, oldValue, newValue);
- }
-
- public void setDefaults(IProgressMonitor monitor) {
- try {
- getWorkingCopyDelegate(monitor).setDefaults();
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error calling delegate setDefaults() " + toString(), e);
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Server.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Server.java
deleted file mode 100644
index 0c6f855..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Server.java
+++ /dev/null
@@ -1,1987 +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.core.internal;
-
-import java.util.*;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.*;
-import org.eclipse.debug.core.*;
-
-import org.eclipse.wst.server.core.*;
-import org.eclipse.wst.server.core.model.*;
-import org.eclipse.wst.server.core.util.ServerAdapter;
-import org.eclipse.wst.server.core.util.SocketUtil;
-/**
- *
- */
-public class Server extends Base implements IServer {
- protected static final List EMPTY_LIST = new ArrayList(0);
-
- protected static final String PROP_HOSTNAME = "hostname";
- protected static final String SERVER_ID = "server-id";
- protected static final String RUNTIME_ID = "runtime-id";
- protected static final String CONFIGURATION_ID = "configuration-id";
- protected static final String MODULE_LIST = "modules";
- protected static final String PROP_AUTO_PUBLISH_TIME = "auto-publish-time";
- protected static final String PROP_AUTO_PUBLISH_DEFAULT = "auto-publish-default";
-
- protected static final char[] INVALID_CHARS = new char[] {'\\', '/', ':', '*', '?', '"', '<', '>', '|', '\0', '@', '&'};
-
- protected IServerType serverType;
- protected ServerDelegate delegate;
- protected ServerBehaviourDelegate behaviourDelegate;
-
- protected IRuntime runtime;
- protected IFolder configuration;
-
- // the list of modules that are to be published to the server
- protected List modules;
-
- // transient fields
- protected transient String mode = ILaunchManager.RUN_MODE;
- protected transient IModule[] serverModules;
- protected transient int serverState = STATE_UNKNOWN;
- protected transient int serverSyncState;
- protected transient boolean serverRestartNeeded;
-
- protected transient Map moduleState = new HashMap();
- protected transient Map modulePublishState = new HashMap();
- protected transient Map moduleRestartState = new HashMap();
-
- protected transient ServerPublishInfo publishInfo;
- protected transient AutoPublishThread autoPublishThread;
-
-/* private static final String[] stateStrings = new String[] {
- "unknown", "starting", "started", "started_debug",
- "stopping", "stopped", "started_unsupported", "started_profile"
- };*/
-
- // publish listeners
- protected transient List publishListeners;
-
- // server listeners
- protected transient List serverListeners;
-
- public class AutoPublishThread extends Thread {
- public boolean stop;
- public int time = 0;
-
- public void run() {
- Trace.trace(Trace.FINEST, "Auto-publish thread starting for " + Server.this + " - " + time + "s");
- if (stop)
- return;
-
- try {
- sleep(time * 1000);
- } catch (Exception e) {
- // ignore
- }
-
- if (stop)
- return;
-
- Trace.trace(Trace.FINEST, "Auto-publish thread publishing " + Server.this);
-
- PublishServerJob publishJob = new PublishServerJob(Server.this, IServer.PUBLISH_AUTO, false);
- publishJob.schedule();
- }
- }
-
- // working copy, loaded resource
- public Server(IFile file) {
- super(file);
- map.put(PROP_HOSTNAME, "localhost");
- }
-
- // creation (working copy)
- public Server(String id, IFile file, IRuntime runtime, IServerType serverType) {
- super(file, id);
- this.runtime = runtime;
- this.serverType = serverType;
- map.put("server-type-id", serverType.getId());
- map.put(PROP_HOSTNAME, "localhost");
- if (runtime != null && runtime.getRuntimeType() != null) {
- String name = runtime.getRuntimeType().getName();
- map.put(PROP_NAME, name);
- }
- serverState = ((ServerType)serverType).getInitialState();
- }
-
- public IServerType getServerType() {
- return serverType;
- }
-
- public IServerWorkingCopy createWorkingCopy() {
- return new ServerWorkingCopy(this);
- }
-
- public boolean isWorkingCopy() {
- return false;
- }
-
- protected void deleteFromMetadata() {
- ResourceManager.getInstance().removeServer(this);
- }
-
- protected void saveToMetadata(IProgressMonitor monitor) {
- super.saveToMetadata(monitor);
- ResourceManager.getInstance().addServer(this);
- }
-
- /* (non-Javadoc)
- * @see com.ibm.wtp.server.core.IServer2#getRuntime()
- */
- public IRuntime getRuntime() {
- return runtime;
- }
-
- protected String getRuntimeId() {
- return getAttribute(RUNTIME_ID, (String) null);
- }
-
- /* (non-Javadoc)
- * @see com.ibm.wtp.server.core.IServer2#getServerConfiguration()
- */
- public IFolder getServerConfiguration() {
- return configuration;
- }
-
- protected ServerDelegate getDelegate() {
- if (delegate != null)
- return delegate;
-
- if (serverType != null) {
- synchronized (this) {
- if (delegate == null) {
- try {
- long time = System.currentTimeMillis();
- IConfigurationElement element = ((ServerType) serverType).getElement();
- delegate = (ServerDelegate) element.createExecutableExtension("class");
- delegate.initialize(this);
- Trace.trace(Trace.PERFORMANCE, "Server.getDelegate(): <" + (System.currentTimeMillis() - time) + "> " + getServerType().getId());
- } catch (Throwable t) {
- Trace.trace(Trace.SEVERE, "Could not create delegate " + toString(), t);
- }
- }
- }
- }
- return delegate;
- }
-
- protected ServerBehaviourDelegate getBehaviourDelegate() {
- if (behaviourDelegate != null)
- return behaviourDelegate;
-
- if (serverType != null) {
- synchronized (this) {
- if (behaviourDelegate == null) {
- try {
- long time = System.currentTimeMillis();
- IConfigurationElement element = ((ServerType) serverType).getElement();
- behaviourDelegate = (ServerBehaviourDelegate) element.createExecutableExtension("behaviourClass");
- behaviourDelegate.initialize(this);
- Trace.trace(Trace.PERFORMANCE, "Server.getDelegate(): <" + (System.currentTimeMillis() - time) + "> " + getServerType().getId());
- } catch (Throwable t) {
- Trace.trace(Trace.SEVERE, "Could not create delegate " + toString(), t);
- }
- }
- }
- }
- return behaviourDelegate;
- }
-
- /**
- * Returns true if the delegate has been loaded.
- *
- * @return <code>true</code> if the delegate has been loaded, and
- * <code>false</code> otherwise
- */
- public boolean isDelegateLoaded() {
- return delegate != null;
- }
-
- public void dispose() {
- if (delegate != null)
- delegate.dispose();
- }
-
- public String getHost() {
- return getAttribute(PROP_HOSTNAME, "localhost");
- }
-
- public int getAutoPublishTime() {
- return getAttribute(PROP_AUTO_PUBLISH_TIME, -1);
- }
-
- public boolean getAutoPublishDefault() {
- return getAttribute(PROP_AUTO_PUBLISH_DEFAULT, true);
- }
-
- /**
- * Returns the current state of the server. (see SERVER_XXX constants)
- *
- * @return int
- */
- public int getServerState() {
- return serverState;
- }
-
- public String getMode() {
- return mode;
- }
-
- public void setServerState(int state) {
- if (state == serverState)
- return;
-
- this.serverState = state;
- fireServerStateChangeEvent();
- }
-
- /**
- * Add a listener to this server.
- *
- * @param listener org.eclipse.wst.server.model.IServerListener
- */
- public void addServerListener(IServerListener listener) {
- Trace.trace(Trace.LISTENERS, "Adding server listener " + listener + " to " + this);
-
- if (serverListeners == null)
- serverListeners = new ArrayList();
- serverListeners.add(listener);
- }
-
- /**
- * Remove a listener from this server.
- *
- * @param listener org.eclipse.wst.server.model.IServerListener
- */
- public void removeServerListener(IServerListener listener) {
- Trace.trace(Trace.LISTENERS, "Removing server listener " + listener + " from " + this);
-
- if (serverListeners != null)
- serverListeners.remove(listener);
- }
-
- /**
- * Fire a server listener configuration sync state change event.
- */
- protected void fireConfigurationSyncStateChangeEvent() {
- Trace.trace(Trace.LISTENERS, "->- Firing server configuration change event: " + getName() + " ->-");
-
- if (serverListeners == null || serverListeners.isEmpty())
- return;
-
- int size = serverListeners.size();
- IServerListener[] sil = new IServerListener[size];
- serverListeners.toArray(sil);
-
- for (int i = 0; i < size; i++) {
- try {
- Trace.trace(Trace.LISTENERS, " Firing server configuration change event to: " + sil[i]);
- sil[i].configurationSyncStateChange(this);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, " Error firing server configuration change event", e);
- }
- }
- Trace.trace(Trace.LISTENERS, "-<- Done firing server configuration change event -<-");
- }
-
- /**
- * Fire a server listener restart state change event.
- */
- protected void fireRestartStateChangeEvent() {
- Trace.trace(Trace.LISTENERS, "->- Firing server restart change event: " + getName() + " ->-");
-
- if (serverListeners == null || serverListeners.isEmpty())
- return;
-
- int size = serverListeners.size();
- IServerListener[] sil = new IServerListener[size];
- serverListeners.toArray(sil);
-
- for (int i = 0; i < size; i++) {
- try {
- Trace.trace(Trace.LISTENERS, " Firing server restart change event to: " + sil[i]);
- sil[i].restartStateChange(this);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, " Error firing server restart change event", e);
- }
- }
- Trace.trace(Trace.LISTENERS, "-<- Done firing server restart change event -<-");
- }
-
- /**
- * Fire a server listener state change event.
- */
- protected void fireServerStateChangeEvent() {
- Trace.trace(Trace.LISTENERS, "->- Firing server state change event: " + getName() + ", " + getServerState() + " ->-");
-
- if (serverListeners == null || serverListeners.isEmpty())
- return;
-
- int size = serverListeners.size();
- IServerListener[] sil = new IServerListener[size];
- serverListeners.toArray(sil);
-
- for (int i = 0; i < size; i++) {
- try {
- Trace.trace(Trace.LISTENERS, " Firing server state change event to: " + sil[i]);
- sil[i].serverStateChange(this);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, " Error firing server state change event", e);
- }
- }
- Trace.trace(Trace.LISTENERS, "-<- Done firing server state change event -<-");
- }
-
- /**
- * Fire a server listener module change event.
- */
- protected void fireServerModuleChangeEvent() {
- Trace.trace(Trace.LISTENERS, "->- Firing server module change event: " + getName() + ", " + getServerState() + " ->-");
-
- if (serverListeners == null || serverListeners.isEmpty())
- return;
-
- int size = serverListeners.size();
- IServerListener[] sil = new IServerListener[size];
- serverListeners.toArray(sil);
-
- for (int i = 0; i < size; i++) {
- try {
- Trace.trace(Trace.LISTENERS, " Firing server module change event to: " + sil[i]);
- sil[i].modulesChanged(this);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, " Error firing server module change event", e);
- }
- }
- Trace.trace(Trace.LISTENERS, "-<- Done firing server module change event -<-");
- }
-
- /**
- * Fire a server listener module state change event.
- */
- protected void fireServerModuleStateChangeEvent(IModule module) {
- Trace.trace(Trace.LISTENERS, "->- Firing server module state change event: " + getName() + ", " + getServerState() + " ->-");
-
- if (serverListeners == null || serverListeners.isEmpty())
- return;
-
- int size = serverListeners.size();
- IServerListener[] sil = new IServerListener[size];
- IModule[] parents = new IModule[0];
- try {
- parents = getRootModules(module, null);
- } catch (Exception e) {
- // ignore
- }
- serverListeners.toArray(sil);
-
- for (int i = 0; i < size; i++) {
- try {
- Trace.trace(Trace.LISTENERS, " Firing server module state change event to: " + sil[i]);
- sil[i].moduleStateChange(this, parents, module);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, " Error firing server module state change event", e);
- }
- }
- Trace.trace(Trace.LISTENERS, "-<- Done firing server module state change event -<-");
- }
-
- public void setMode(String m) {
- this.mode = m;
- }
-
- public void setModules(IModule[] modules) {
- this.serverModules = modules;
- }
-
- public void setModuleState(IModule module, int state) {
- Integer in = new Integer(state);
- moduleState.put(module.getId(), in);
- fireServerModuleStateChangeEvent(module);
- }
-
- public void setModulePublishState(IModule module, int state) {
- Integer in = new Integer(state);
- modulePublishState.put(module.getId(), in);
- //fireServerModuleStateChangeEvent(module);
- }
-
- public void setModuleRestartState(IModule module, boolean r) {
- Boolean b = new Boolean(r);
- moduleState.put(module.getId(), b);
- //fireServerModuleStateChangeEvent(module);
- }
-
- protected void handleModuleProjectChange(final IModule module) {
- Trace.trace(Trace.FINEST, "> handleDeployableProjectChange() " + this + " " + module);
-
- class Helper {
- boolean changed;
- }
- final Helper helper = new Helper();
-
- IModuleVisitor visitor = new IModuleVisitor() {
- public boolean visit(IModule[] parents2, IModule module2) {
- if (module2.getProject() == null)
- return true;
-
- if (module.equals(module2)) {
- IModuleResourceDelta[] delta2 = getPublishedResourceDelta(parents2, module2);
- if (delta2.length > 0)
- helper.changed = true;
-
- // TODO
- /*if (deployableDelta[i] == null)
- deployableDelta[i] = moduleProjects[i].getModuleResourceDelta(delta);
-
- if (deployableDelta[i] != null) {
- // updateDeployable(module, deployableDelta[i]);
-
- ModulePublishInfo control = PublishInfo.getPublishInfo().getPublishControl(Server.this, parents, module);
- if (control.isDirty())
- return true;
-
- control.setDirty(true);
- firePublishStateChange(parents, module);
- }*/
- return true;
- }
- return true;
- }
- };
-
- visit(visitor, null);
-
- if (!helper.changed)
- return;
-
- // check for auto-publish
- if (autoPublishThread != null) {
- autoPublishThread.stop = true;
- autoPublishThread.interrupt();
- autoPublishThread = null;
- }
-
- int time = 0;
- if (getAutoPublishDefault()) {
- boolean local = SocketUtil.isLocalhost(getHost());
- if (local && ServerPreferences.getInstance().getAutoPublishLocal())
- time = ServerPreferences.getInstance().getAutoPublishLocalTime();
- else if (!local && ServerPreferences.getInstance().getAutoPublishRemote())
- time = ServerPreferences.getInstance().getAutoPublishRemoteTime();
- } else {
- time = getAutoPublishTime();
- }
-
- if (time > 5) {
- autoPublishThread = new AutoPublishThread();
- autoPublishThread.time = time;
- autoPublishThread.setPriority(Thread.MIN_PRIORITY + 1);
- autoPublishThread.start();
- }
-
- //Trace.trace(Trace.FINEST, "< handleDeployableProjectChange()");
- }
-
- /**
- * Returns the configuration's sync state.
- *
- * @return int
- */
- public int getServerPublishState() {
- return serverSyncState;
- }
-
- /**
- * Sets the configuration sync state.
- *
- * @param state int
- */
- public void setServerPublishState(int state) {
- if (state == serverSyncState)
- return;
- serverSyncState = state;
- fireConfigurationSyncStateChangeEvent();
- }
-
- /**
- * Adds a publish listener to this server.
- * Has no effect if an identical listener is already registered.
- *
- * @param listener the publish listener
- * @see #removePublishListener(IPublishListener)
- */
- public void addPublishListener(IPublishListener listener) {
- Trace.trace(Trace.LISTENERS, "Adding publish listener " + listener + " to " + this);
-
- if (publishListeners == null)
- publishListeners = new ArrayList();
- publishListeners.add(listener);
- }
-
- /**
- * Removes a publish listener from this server.
- * Has no effect if the listener is not registered.
- *
- * @param listener the publish listener
- * @see #addPublishListener(IPublishListener)
- */
- public void removePublishListener(IPublishListener listener) {
- Trace.trace(Trace.LISTENERS, "Removing publish listener " + listener + " from " + this);
-
- if (publishListeners != null)
- publishListeners.remove(listener);
- }
-
- /**
- * Fire a publish start event.
- *
- * @param
- */
- private void firePublishStarted() {
- Trace.trace(Trace.FINEST, "->- Firing publish started event ->-");
-
- if (publishListeners == null || publishListeners.isEmpty())
- return;
-
- int size = publishListeners.size();
- IPublishListener[] srl = new IPublishListener[size];
- publishListeners.toArray(srl);
-
- for (int i = 0; i < size; i++) {
- Trace.trace(Trace.FINEST, " Firing publish started event to " + srl[i]);
- try {
- srl[i].publishStarted(this);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, " Error firing publish started event to " + srl[i], e);
- }
- }
-
- Trace.trace(Trace.FINEST, "-<- Done firing publish started event -<-");
- }
-
- /**
- * Fire a publish target event.
- *
- * @param
- */
- private void fireModulePublishStarted(IModule[] parents, IModule module) {
- Trace.trace(Trace.FINEST, "->- Firing module publish started event: " + module + " ->-");
-
- if (publishListeners == null || publishListeners.isEmpty())
- return;
-
- int size = publishListeners.size();
- IPublishListener[] srl = new IPublishListener[size];
- publishListeners.toArray(srl);
-
- for (int i = 0; i < size; i++) {
- Trace.trace(Trace.FINEST, " Firing module publish started event to " + srl[i]);
- try {
- srl[i].publishModuleStarted(this, parents, module);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, " Error firing module publish started event to " + srl[i], e);
- }
- }
-
- Trace.trace(Trace.FINEST, "-<- Done firing module publish started event -<-");
- }
-
- /**
- * Fire a publish target event.
- *
- * @param
- */
- private void fireModulePublishFinished(IModule[] parents, IModule module, IStatus status) {
- Trace.trace(Trace.FINEST, "->- Firing module finished event: " + module + " " + status + " ->-");
-
- if (publishListeners == null || publishListeners.isEmpty())
- return;
-
- int size = publishListeners.size();
- IPublishListener[] srl = new IPublishListener[size];
- publishListeners.toArray(srl);
-
- for (int i = 0; i < size; i++) {
- Trace.trace(Trace.FINEST, " Firing module finished event to " + srl[i]);
- try {
- srl[i].publishModuleFinished(this, parents, module, status);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, " Error firing module finished event to " + srl[i], e);
- }
- }
-
- Trace.trace(Trace.FINEST, "-<- Done firing module finished event -<-");
- }
-
- /**
- * Fire a publish stop event.
- *
- * @param
- */
- private void firePublishFinished(IStatus status) {
- Trace.trace(Trace.FINEST, "->- Firing publishing finished event: " + status + " ->-");
-
- if (publishListeners == null || publishListeners.isEmpty())
- return;
-
- int size = publishListeners.size();
- IPublishListener[] srl = new IPublishListener[size];
- publishListeners.toArray(srl);
-
- for (int i = 0; i < size; i++) {
- Trace.trace(Trace.FINEST, " Firing publishing finished event to " + srl[i]);
- try {
- srl[i].publishFinished(this, status);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, " Error firing publishing finished event to " + srl[i], e);
- }
- }
-
- Trace.trace(Trace.FINEST, "-<- Done firing publishing finished event -<-");
- }
-
- /**
- * Fire a publish state change event.
- */
- protected void firePublishStateChange(IModule[] parents, IModule module) {
- Trace.trace(Trace.FINEST, "->- Firing publish state change event: " + module + " ->-");
-
- if (serverListeners == null || serverListeners.isEmpty())
- return;
-
- int size = serverListeners.size();
- IServerListener[] sl = new IServerListener[size];
- serverListeners.toArray(sl);
-
- for (int i = 0; i < size; i++) {
- Trace.trace(Trace.FINEST, " Firing publish state change event to " + sl[i]);
- try {
- sl[i].moduleStateChange(this, parents, module);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, " Error firing publish state change event to " + sl[i], e);
- }
- }
-
- Trace.trace(Trace.FINEST, "-<- Done firing publish state change event -<-");
- }
-
- /**
- * Returns true if the server is in a state that it can
- * be published to.
- *
- * @return boolean
- * TODO: fix return strings
- */
- public IStatus canPublish() {
- // can't publish if the server is starting or stopping
- int state = getServerState();
- if (state == STATE_STARTING || state == STATE_STOPPING)
- return new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0, ServerPlugin.getResource("%errorLaunchMode"), null);
-
- // can't publish if there is no configuration
- if (getServerType() == null || getServerType().hasServerConfiguration() && configuration == null)
- return new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0, ServerPlugin.getResource("%errorLaunchMode"), null);
-
- // return true if the configuration can be published
- if (getServerPublishState() != PUBLISH_STATE_NONE)
- return new Status(IStatus.OK, ServerPlugin.PLUGIN_ID, 0, ServerPlugin.getResource("%errorLaunchMode"), null);
-
- // return true if any modules can be published
- class Temp {
- boolean found = false;
- }
- //final Temp temp = new Temp();
-
- return new Status(IStatus.OK, ServerPlugin.PLUGIN_ID, 0, ServerPlugin.getResource("%errorLaunchMode"), null);
-
- /*IModuleVisitor visitor = new IModuleVisitor() {
- public boolean visit(IModule[] parents, IModule module) {
- if (getModulePublishState(module) != PUBLISH_STATE_NONE) {
- temp.found = true;
- return false;
- }
- return true;
- }
- };
- ServerUtil.visit(this, visitor, null);
-
- return temp.found;*/
- }
-
- /**
- * Returns true if the server is in a state that it can
- * be published to.
- *
- * @return boolean
- */
- public boolean shouldPublish() {
- if (!canPublish().isOK())
- return false;
-
- if (getServerPublishState() != PUBLISH_STATE_NONE)
- return true;
-
- //if (getUnpublishedModules().length > 0)
- return true;
-
- //return false;
- }
-
-
- /**
- * Returns a list of the projects that have not been published
- * since the last modification. (i.e. the projects that are
- * out of sync with the server.
- *
- * @return java.util.List
- */
- /*public IModule[] getUnpublishedModules() {
- final List modules = new ArrayList();
- IModuleVisitor visitor = new IModuleVisitor() {
- public boolean visit(IModule[] parents, IModule module) {
- if (getModulePublishState(module) != PUBLISH_STATE_NONE && !modules.contains(module)) {
- ModulePublishInfo control = PublishInfo.getPublishInfo().getPublishControl(Server.this, parents, module);
- if (control.isDirty)
- modules.add(module);
- }
- return true;
- }
- };
- ServerUtil.visit(this, visitor, null);
-
- Trace.trace(Trace.FINEST, "Unpublished modules: " + modules);
-
- IModule[] m = new IModule[modules.size()];
- modules.toArray(m);
- return m;
- }*/
-
- protected ServerPublishInfo getServerPublishInfo() {
- if (publishInfo == null) {
- publishInfo = PublishInfo.getInstance().getServerPublishInfo(this);
- }
- return publishInfo;
- }
-
- /*
- * Publish to the server using the progress monitor. The result of the
- * publish operation is returned as an IStatus.
- */
- public IStatus publish(IProgressMonitor monitor) {
- return publish(PUBLISH_INCREMENTAL, monitor);
- }
-
- /*
- * Publish to the server using the progress monitor. The result of the
- * publish operation is returned as an IStatus.
- */
- public IStatus publish(final int kind, IProgressMonitor monitor) {
- if (getServerType() == null)
- return new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0, ServerPlugin.getResource("%errorPublishing"), null);
-
- // check what is out of sync and publish
- if (getServerType().hasServerConfiguration() && configuration == null)
- return new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0, ServerPlugin.getResource("%errorNoConfiguration"), null);
-
- return doPublish(kind, monitor);
- }
-
- protected IStatus doPublish(int kind, IProgressMonitor monitor) {
- Trace.trace(Trace.FINEST, "-->-- Publishing to server: " + toString() + " -->--");
-
- final List parentList = new ArrayList();
- final List moduleList = new ArrayList();
- final List taskParentList = new ArrayList();
- final List kindList = new ArrayList();
-
- final ServerPublishInfo spi = getServerPublishInfo();
-
- IModuleVisitor visitor = new IModuleVisitor() {
- public boolean visit(IModule[] parents, IModule module) {
- int size = parents.length;
- List list = new ArrayList(size);
- for (int i = 0; i < size; i++)
- list.add(parents[i]);
-
- taskParentList.add(list);
- if (parents != null)
- parentList.add(parents);
- else
- parentList.add(EMPTY_LIST);
- moduleList.add(module);
-
- if (spi.hasModulePublishInfo(parents, module)) {
- if (getPublishedResourceDelta(parents, module).length == 0)
- kindList.add(new Integer(NO_CHANGE));
- else
- kindList.add(new Integer(CHANGED));
- } else
- kindList.add(new Integer(ADDED));
- return true;
- }
- };
-
- visit(visitor, monitor);
-
- // build arrays & lists
- List[] taskParents = new List[taskParentList.size()];
- taskParentList.toArray(taskParents);
- List parents = parentList;
- IModule[] modules2 = new IModule[moduleList.size()];
- moduleList.toArray(modules2);
-
- List tasks = getTasks(taskParents, modules2);
-
- spi.addRemovedModules(parentList, moduleList, kindList);
-
- parents = parentList;
- modules2 = new IModule[moduleList.size()];
- moduleList.toArray(modules2);
-
- int size = parents.size();
- int[] deltaKind = new int[size];
- for (int i = 0; i < size; i++) {
- Integer in = (Integer) kindList.get(i);
- deltaKind[i] = in.intValue();
- }
-
- size = 2000 + 3500 * parentList.size();
-
- // find tasks
- size += tasks.size() * 500;
-
- monitor = ProgressUtil.getMonitorFor(monitor);
- monitor.beginTask(ServerPlugin.getResource("%publishing", toString()), size);
-
- // TODO - group up status until the end and use better message based on success or failure
- MultiStatus multi = new MultiStatus(ServerPlugin.PLUGIN_ID, 0, ServerPlugin.getResource("%publishingStatus"), null);
-
- // perform tasks
- IStatus taskStatus = performTasks(tasks, monitor);
- if (taskStatus != null)
- multi.add(taskStatus);
-
- if (monitor.isCanceled())
- return new Status(IStatus.INFO, ServerPlugin.PLUGIN_ID, 0, ServerPlugin.getResource("%publishingCancelled"), null);
-
- // start publishing
- Trace.trace(Trace.FINEST, "Calling publishStart()");
- firePublishStarted();
- try {
- getBehaviourDelegate().publishStart(ProgressUtil.getSubMonitorFor(monitor, 1000));
- } catch (CoreException ce) {
- Trace.trace(Trace.INFO, "CoreException publishing to " + toString(), ce);
- firePublishFinished(ce.getStatus());
- return ce.getStatus();
- }
-
- // publish the server
- try {
- if (!monitor.isCanceled() && serverType.hasServerConfiguration()) {
- getBehaviourDelegate().publishServer(kind, ProgressUtil.getSubMonitorFor(monitor, 1000));
- }
- } catch (CoreException ce) {
- Trace.trace(Trace.INFO, "CoreException publishing to " + toString(), ce);
- multi.add(ce.getStatus());
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error publishing configuration to " + toString(), e);
- multi.add(new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0, ServerPlugin.getResource("%errorPublishing"), e));
- }
-
- // publish modules
- if (!monitor.isCanceled()) {
- try {
- publishModules(kind, parents, modules2, deltaKind, multi, monitor);
- } catch (Exception e) {
- multi.add(new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0, ServerPlugin.getResource("%errorPublishing"), e));
- }
- }
-
- // end the publishing
- Trace.trace(Trace.FINEST, "Calling publishFinish()");
- try {
- getBehaviourDelegate().publishFinish(ProgressUtil.getSubMonitorFor(monitor, 500));
- } catch (CoreException ce) {
- Trace.trace(Trace.INFO, "CoreException publishing to " + toString(), ce);
- multi.add(ce.getStatus());
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error stopping publish to " + toString(), e);
- multi.add(new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0, ServerPlugin.getResource("%errorPublishing"), e));
- }
-
- if (monitor.isCanceled()) {
- IStatus status = new Status(IStatus.INFO, ServerPlugin.PLUGIN_ID, 0, ServerPlugin.getResource("%publishingCancelled"), null);
- multi.add(status);
- }
-
- MultiStatus ps = new MultiStatus(ServerPlugin.PLUGIN_ID, 0, ServerPlugin.getResource("%publishingStop"), null);
- ps.add(multi);
- firePublishFinished(multi);
-
- spi.save();
-
- monitor.done();
-
- Trace.trace(Trace.FINEST, "--<-- Done publishing --<--");
-
- if (multi.getChildren().length == 1)
- return multi.getChildren()[0];
-
- return multi;
- }
-
- /**
- * Publish a single module.
- */
- protected IStatus publishModule(int kind, IModule[] parents, IModule module, int deltaKind, IProgressMonitor monitor) {
- Trace.trace(Trace.FINEST, "Publishing module: " + module);
-
- monitor.beginTask(ServerPlugin.getResource("%publishingModule", module.getName()), 1000);
-
- fireModulePublishStarted(parents, module);
-
- IStatus status = new Status(IStatus.OK, ServerPlugin.PLUGIN_ID, 0, ServerPlugin.getResource("%publishedModule", module.getName()), null);
- try {
- getBehaviourDelegate().publishModule(kind, deltaKind, parents, module, monitor);
- } catch (CoreException ce) {
- status = ce.getStatus();
- }
- fireModulePublishFinished(parents, module, status);
-
- /*Trace.trace(Trace.FINEST, "Delta:");
- IModuleResourceDelta[] delta = getServerPublishInfo().getDelta(parents, module);
- int size = delta.length;
- for (int i = 0; i < size; i++) {
- ((ModuleResourceDelta)delta[i]).trace("> ");
- }*/
- if (deltaKind == REMOVED)
- getServerPublishInfo().removeModulePublishInfo(parents, module);
- else
- getServerPublishInfo().fill(parents, module);
-
- monitor.done();
-
- Trace.trace(Trace.FINEST, "Done publishing: " + module);
- return status;
- }
-
- /**
- * Publishes the given modules. Returns true if the publishing
- * should continue, or false if publishing has failed or is cancelled.
- *
- * Uses 500 ticks plus 3500 ticks per module
- */
- protected void publishModules(int kind, List parents, IModule[] modules2, int[] deltaKind, MultiStatus multi, IProgressMonitor monitor) {
- if (parents == null)
- return;
-
- int size = parents.size();
- if (size == 0)
- return;
-
- if (monitor.isCanceled())
- return;
-
- // publish modules
- for (int i = 0; i < size; i++) {
- IStatus status = publishModule(kind, (IModule[]) parents.get(i), modules2[i], deltaKind[i], ProgressUtil.getSubMonitorFor(monitor, 3000));
- multi.add(status);
- }
- }
-
- /*
- * Returns the module resources that have been published.
- *
- * @see ServerBehaviourDelegate.getPublishedResources(IModule[], IModule)
- */
- public IModuleResource[] getPublishedResources(IModule[] parents, IModule module) {
- return getServerPublishInfo().getModulePublishInfo(parents, module).getResources();
- }
-
- /*
- * Returns the delta of the current module resources that have been
- * published compared to the current state of the module.
- *
- * @see ServerBehaviourDelegate.getPublishedResourceDelta(IModule[], IModule)
- */
- public IModuleResourceDelta[] getPublishedResourceDelta(IModule[] parents, IModule module) {
- return getServerPublishInfo().getDelta(parents, module);
- }
-
- protected List getTasks(List[] parents, IModule[] modules2) {
- List tasks = new ArrayList();
-
- String serverTypeId = getServerType().getId();
-
- IServerTask[] serverTasks = ServerPlugin.getServerTasks();
- if (serverTasks != null) {
- int size = serverTasks.length;
- for (int i = 0; i < size; i++) {
- IServerTask task = serverTasks[i];
- if (task.supportsType(serverTypeId)) {
- IOptionalTask[] tasks2 = task.getTasks(this, parents, modules2);
- if (tasks2 != null) {
- int size2 = tasks2.length;
- for (int j = 0; j < size2; j++) {
- if (tasks2[j].getStatus() == IOptionalTask.TASK_MANDATORY)
- tasks.add(tasks2[j]);
- }
- }
- }
- }
- }
-
- int size = tasks.size();
- for (int i = 0; i < size - 1; i++) {
- for (int j = i + 1; j < size; j++) {
- IOrdered a = (IOrdered) tasks.get(i);
- IOrdered b = (IOrdered) tasks.get(j);
- if (a.getOrder() > b.getOrder()) {
- Object temp = a;
- tasks.set(i, b);
- tasks.set(j, temp);
- }
- }
- }
-
- return tasks;
- }
-
- protected IStatus performTasks(List tasks, IProgressMonitor monitor) {
- Trace.trace(Trace.FINEST, "Performing tasks: " + tasks.size());
-
- if (tasks.isEmpty())
- return null;
-
- Status multi = new MultiStatus(ServerPlugin.PLUGIN_ID, 0, ServerPlugin.getResource("%taskPerforming"), null);
-
- Iterator iterator = tasks.iterator();
- while (iterator.hasNext()) {
- IOptionalTask task = (IOptionalTask) iterator.next();
- monitor.subTask(ServerPlugin.getResource("%taskPerforming", task.toString()));
- try {
- task.execute(ProgressUtil.getSubMonitorFor(monitor, 500));
- } catch (CoreException ce) {
- Trace.trace(Trace.SEVERE, "Task failed", ce);
- }
- if (monitor.isCanceled())
- return multi;
- }
-
- // save server and configuration
- /*try {
- ServerUtil.save(server, ProgressUtil.getSubMonitorFor(monitor, 1000));
- ServerUtil.save(configuration, ProgressUtil.getSubMonitorFor(monitor, 1000));
- } catch (CoreException se) {
- Trace.trace(Trace.SEVERE, "Error saving server and/or configuration", se);
- multi.addChild(se.getStatus());
- }*/
-
- return multi;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
- */
- public Object getAdapter(Class adapter) {
- ServerDelegate delegate2 = getDelegate();
- if (adapter.isInstance(delegate2))
- return delegate2;
- ServerBehaviourDelegate delegate3 = getBehaviourDelegate();
- if (adapter.isInstance(delegate3))
- return delegate3;
- return Platform.getAdapterManager().getAdapter(this, adapter);
- }
-
- public String toString() {
- return getName();
- }
-
- /**
- * Returns true if the server is in a state that it can
- * be started, and supports the given mode.
- *
- * @param mode2
- * @return status
- */
- public IStatus canStart(String mode2) {
- int state = getServerState();
- if (state != STATE_STOPPED && state != STATE_UNKNOWN)
- return new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0, ServerPlugin.getResource("%canStartErrorState"), null);
-
- if (getServerType() == null || !getServerType().supportsLaunchMode(mode2))
- return new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0, ServerPlugin.getResource("%errorLaunchMode"), null);
-
- return new Status(IStatus.OK, ServerPlugin.PLUGIN_ID, 0, ServerPlugin.getResource("%canStartOk"), null);
- }
-
- public ILaunch getExistingLaunch() {
- ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
-
- ILaunch[] launches = launchManager.getLaunches();
- int size = launches.length;
- for (int i = 0; i < size; i++) {
- ILaunchConfiguration launchConfig = launches[i].getLaunchConfiguration();
- try {
- if (launchConfig != null) {
- String serverId = launchConfig.getAttribute(SERVER_ID, (String) null);
- if (getId().equals(serverId)) {
- if (!launches[i].isTerminated())
- return launches[i];
- }
- }
- } catch (CoreException e) {
- // ignore
- }
- }
-
- return null;
- }
-
- public void setupLaunchConfiguration(ILaunchConfigurationWorkingCopy workingCopy, IProgressMonitor monitor) throws CoreException {
- try {
- getBehaviourDelegate().setupLaunchConfiguration(workingCopy, monitor);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error calling delegate setLaunchDefaults() " + toString(), e);
- }
- }
-
- public void importConfiguration(IRuntime runtime2, IProgressMonitor monitor) {
- try {
- getDelegate().importConfiguration(runtime2, monitor);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error calling delegate setLaunchDefaults() " + toString(), e);
- }
- }
-
- public ILaunchConfiguration getLaunchConfiguration(boolean create, IProgressMonitor monitor) throws CoreException {
- ILaunchConfigurationType launchConfigType = ((ServerType) getServerType()).getLaunchConfigurationType();
-
- ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
- ILaunchConfiguration[] launchConfigs = null;
- try {
- launchConfigs = launchManager.getLaunchConfigurations(launchConfigType);
- } catch (CoreException e) {
- // ignore
- }
-
- if (launchConfigs != null) {
- int size = launchConfigs.length;
- for (int i = 0; i < size; i++) {
- try {
- String serverId = launchConfigs[i].getAttribute(SERVER_ID, (String) null);
- if (getId().equals(serverId)) {
- ILaunchConfigurationWorkingCopy wc = launchConfigs[i].getWorkingCopy();
- setupLaunchConfiguration(wc, monitor);
- if (wc.isDirty())
- return wc.doSave();
- return launchConfigs[i];
- }
- } catch (CoreException e) {
- // ignore
- }
- }
- }
-
- if (!create)
- return null;
-
- // create a new launch configuration
- String launchName = getValidLaunchConfigurationName(getName());
- launchName = launchManager.generateUniqueLaunchConfigurationNameFrom(launchName);
- ILaunchConfigurationWorkingCopy wc = launchConfigType.newInstance(null, launchName);
- wc.setAttribute(SERVER_ID, getId());
- setupLaunchConfiguration(wc, monitor);
- return wc.doSave();
- }
-
- protected String getValidLaunchConfigurationName(String s) {
- if (s == null || s.length() == 0)
- return "1";
- int size = INVALID_CHARS.length;
- for (int i = 0; i < size; i++) {
- s = s.replace(INVALID_CHARS[i], '_');
- }
- return s;
- }
-
- /**
- * Start the server in the given mode.
- *
- * @param mode2
- * @param monitor a progress monitor
- * @return a launch
- */
- public ILaunch start(String mode2, IProgressMonitor monitor) throws CoreException {
- Trace.trace(Trace.FINEST, "Starting server: " + toString() + ", launchMode: " + mode2);
-
- try {
- ILaunchConfiguration launchConfig = getLaunchConfiguration(true, monitor);
- ILaunch launch = launchConfig.launch(mode2, monitor);
- Trace.trace(Trace.FINEST, "Launch: " + launch);
- return launch;
- } catch (CoreException e) {
- Trace.trace(Trace.SEVERE, "Error starting server " + toString(), e);
- throw e;
- }
- }
-
- /**
- * Clean up any old launch configurations with the current server's id.
- */
- protected void deleteLaunchConfigurations() {
- if (getServerType() == null)
- return;
- ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
- ILaunchConfigurationType launchConfigType = ((ServerType) getServerType()).getLaunchConfigurationType();
-
- ILaunchConfiguration[] configs = null;
- try {
- configs = launchManager.getLaunchConfigurations(launchConfigType);
- int size = configs.length;
- for (int i = 0; i < size; i++) {
- try {
- if (getId().equals(configs[i].getAttribute(SERVER_ID, (String) null)))
- configs[i].delete();
- } catch (Exception e) {
- // ignore
- }
- }
- } catch (Exception e) {
- // ignore
- }
- }
-
- /**
- * Returns true if the server is in a state that it can
- * be restarted.
- *
- * @return boolean
- * TODO: fix return strings
- */
- public IStatus canRestart(String mode2) {
- if (!getServerType().supportsLaunchMode(mode2))
- return new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0, ServerPlugin.getResource("%errorLaunchMode"), null);
-
- int state = getServerState();
- if (state == STATE_STARTED)
- return new Status(IStatus.OK, ServerPlugin.PLUGIN_ID, 0, ServerPlugin.getResource("%errorLaunchMode"), null);
-
- return new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0, ServerPlugin.getResource("%errorLaunchMode"), null);
- }
-
- /**
- * Returns the current restart state of the server. This
- * implementation will always return false when the server
- * is stopped.
- *
- * @return boolean
- */
- public boolean getServerRestartState() {
- if (getServerState() == STATE_STOPPED)
- return false;
- return serverRestartNeeded;
- }
-
- /**
- * Sets the server restart state.
- *
- * @param state boolean
- */
- public synchronized void setServerRestartState(boolean state) {
- if (state == serverRestartNeeded)
- return;
- serverRestartNeeded = state;
- fireRestartStateChangeEvent();
- }
-
- /**
- * Restart the server with the given debug mode.
- * A server may only be restarted when it is currently running.
- * This method is asynchronous.
- */
- public void restart(final String mode2) {
- if (getServerState() == STATE_STOPPED)
- return;
-
- Trace.trace(Trace.FINEST, "Restarting server: " + getName());
-
- try {
- try {
- getBehaviourDelegate().restart(mode2);
- return;
- } catch (CoreException ce) {
- Trace.trace(Trace.SEVERE, "Error calling delegate restart() " + toString());
- }
-
- // add listener to start it as soon as it is stopped
- addServerListener(new ServerAdapter() {
- public void serverStateChange(IServer server) {
- if (server.getServerState() == STATE_STOPPED) {
- server.removeServerListener(this);
-
- // restart in a quarter second (give other listeners a chance
- // to hear the stopped message)
- Thread t = new Thread() {
- public void run() {
- try {
- Thread.sleep(250);
- } catch (Exception e) {
- // ignore
- }
- try {
- Server.this.start(mode2, new NullProgressMonitor());
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error while restarting server", e);
- }
- }
- };
- t.setDaemon(true);
- t.setPriority(Thread.NORM_PRIORITY - 2);
- t.start();
- }
- }
- });
-
- // stop the server
- stop(false);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error restarting server", e);
- }
- }
-
-
- /**
- * Returns true if the server is in a state that it can
- * be stopped.
- *
- * @return boolean
- * TODO: fix return strings
- */
- public IStatus canStop() {
- if (getServerState() == STATE_STOPPED)
- return new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0, ServerPlugin.getResource("%errorLaunchMode"), null);
-
- return new Status(IStatus.OK, ServerPlugin.PLUGIN_ID, 0, ServerPlugin.getResource("%errorLaunchMode"), null);
- }
-
- /**
- * Stop the server if it is running.
- */
- public void stop(boolean force) {
- if (getServerState() == STATE_STOPPED)
- return;
-
- Trace.trace(Trace.FINEST, "Stopping server: " + toString());
-
- try {
- getBehaviourDelegate().stop(force);
- } catch (Throwable t) {
- Trace.trace(Trace.SEVERE, "Error calling delegate stop() " + toString(), t);
- }
- }
-
- /**
- * Start the server in the given start mode and waits until the server
- * has finished started.
- *
- * @param mode2 the launch mode
- * @param monitor a progress monitor
- * @exception org.eclipse.core.runtime.CoreException - thrown if an error occurs while trying to start the server
- */
- public ILaunch synchronousStart(String mode2, IProgressMonitor monitor) throws CoreException {
- Trace.trace(Trace.FINEST, "synchronousStart 1");
- final Object mutex = new Object();
-
- // add listener to the server
- IServerListener listener = new ServerAdapter() {
- public void serverStateChange(IServer server) {
- int state = server.getServerState();
- if (state == IServer.STATE_STARTED || state == IServer.STATE_STOPPED) {
- // notify waiter
- synchronized (mutex) {
- try {
- Trace.trace(Trace.FINEST, "synchronousStart notify");
- mutex.notifyAll();
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error notifying server start", e);
- }
- }
- }
- }
- };
- addServerListener(listener);
-
- final int serverTimeout = ((ServerType) getServerType()).getStartTimeout();
- class Timer {
- boolean timeout;
- boolean alreadyDone;
- }
- final Timer timer = new Timer();
-
- Thread thread = new Thread() {
- public void run() {
- try {
- Thread.sleep(serverTimeout * 1000);
- if (!timer.alreadyDone) {
- timer.timeout = true;
- // notify waiter
- synchronized (mutex) {
- Trace.trace(Trace.FINEST, "synchronousStart notify timeout");
- mutex.notifyAll();
- }
- }
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error notifying server start timeout", e);
- }
- }
- };
- thread.setDaemon(true);
- thread.start();
-
- Trace.trace(Trace.FINEST, "synchronousStart 2");
-
- // start the server
- ILaunch launch;
- try {
- launch = start(mode2, monitor);
- } catch (CoreException e) {
- removeServerListener(listener);
- timer.alreadyDone = true;
- throw e;
- }
-
- Trace.trace(Trace.FINEST, "synchronousStart 3");
-
- // wait for it! wait for it! ...
- synchronized (mutex) {
- try {
- while (!timer.timeout && !(getServerState() == IServer.STATE_STARTED || getServerState() == IServer.STATE_STOPPED))
- mutex.wait();
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error waiting for server start", e);
- }
- }
- removeServerListener(listener);
- timer.alreadyDone = true;
-
- if (timer.timeout)
- throw new CoreException(new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0, ServerPlugin.getResource("%errorStartTimeout", new String[] { getName(), serverTimeout + "" }), null));
- timer.alreadyDone = true;
-
- if (getServerState() == IServer.STATE_STOPPED)
- throw new CoreException(new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0, ServerPlugin.getResource("%errorStartFailed", getName()), null));
-
- Trace.trace(Trace.FINEST, "synchronousStart 4");
-
- return launch;
- }
-
- /*
- * @see IServer#synchronousRestart(String, IProgressMonitor)
- */
- public void synchronousRestart(String mode2, IProgressMonitor monitor) throws CoreException {
- synchronousStop(true);
- synchronousStart(mode2, monitor);
- }
-
- /*
- * @see IServer#synchronousStop()
- */
- public void synchronousStop(boolean force) {
- if (getServerState() == IServer.STATE_STOPPED)
- return;
-
- final Object mutex = new Object();
-
- // add listener to the server
- IServerListener listener = new ServerAdapter() {
- public void serverStateChange(IServer server) {
- int state = server.getServerState();
- if (Server.this == server && state == IServer.STATE_STOPPED) {
- // notify waiter
- synchronized (mutex) {
- try {
- mutex.notifyAll();
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error notifying server stop", e);
- }
- }
- }
- }
- };
- addServerListener(listener);
-
- class Timer {
- boolean timeout;
- boolean alreadyDone;
- }
- final Timer timer = new Timer();
-
- Thread thread = new Thread() {
- public void run() {
- try {
- Thread.sleep(120000);
- if (!timer.alreadyDone) {
- timer.timeout = true;
- // notify waiter
- synchronized (mutex) {
- Trace.trace(Trace.FINEST, "stop notify timeout");
- mutex.notifyAll();
- }
- }
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error notifying server stop timeout", e);
- }
- }
- };
- thread.setDaemon(true);
- thread.start();
-
- // stop the server
- stop(force);
-
- // wait for it! wait for it!
- synchronized (mutex) {
- try {
- while (!timer.timeout && getServerState() != IServer.STATE_STOPPED)
- mutex.wait();
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error waiting for server stop", e);
- }
- }
- removeServerListener(listener);
-
- /*
- //can't throw exceptions
- if (timer.timeout)
- throw new CoreException(new Status(IStatus.ERROR, ServerCore.PLUGIN_ID, 0, ServerPlugin.getResource("%errorStartFailed", getName()), null));
- else
- timer.alreadyDone = true;
-
- if (getServerState() == IServer.STATE_STOPPED)
- throw new CoreException(new Status(IStatus.ERROR, ServerCore.PLUGIN_ID, 0, ServerPlugin.getResource("%errorStartFailed", getName()), null));*/
- }
-
- /**
- * Trigger a restart of the given module and wait until it has finished restarting.
- *
- * @param module org.eclipse.wst.server.core.IModule
- * @param monitor org.eclipse.core.runtime.IProgressMonitor
- * @exception org.eclipse.core.runtime.CoreException - thrown if an error occurs while trying to restart the module
- */
- public void synchronousRestartModule(final IModule module, IProgressMonitor monitor) throws CoreException {
- Trace.trace(Trace.FINEST, "synchronousModuleRestart 1");
-
- final Object mutex = new Object();
-
- // add listener to the module
- IServerListener listener = new ServerAdapter() {
- public void moduleStateChange(IServer server) {
- int state = server.getModuleState(module);
- if (state == IServer.STATE_STARTED || state == IServer.STATE_STOPPED) {
- // notify waiter
- synchronized (mutex) {
- try {
- Trace.trace(Trace.FINEST, "synchronousModuleRestart notify");
- mutex.notifyAll();
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error notifying module restart", e);
- }
- }
- }
- }
- };
- addServerListener(listener);
-
- // make sure it times out after 30s
- class Timer {
- boolean timeout;
- boolean alreadyDone;
- }
- final Timer timer = new Timer();
-
- Thread thread = new Thread() {
- public void run() {
- try {
- Thread.sleep(30000);
- if (!timer.alreadyDone) {
- timer.timeout = true;
- // notify waiter
- synchronized (mutex) {
- Trace.trace(Trace.FINEST, "synchronousModuleRestart notify timeout");
- mutex.notifyAll();
- }
- }
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error notifying module restart timeout", e);
- }
- }
- };
- thread.setDaemon(true);
- thread.start();
-
- Trace.trace(Trace.FINEST, "synchronousModuleRestart 2");
-
- // restart the module
- try {
- getBehaviourDelegate().restartModule(module, monitor);
- } catch (CoreException e) {
- removeServerListener(listener);
- throw e;
- }
-
- Trace.trace(Trace.FINEST, "synchronousModuleRestart 3");
-
- // wait for it! wait for it! ...
- synchronized (mutex) {
- try {
- while (!timer.timeout && !(getModuleState(module) == IServer.STATE_STARTED || getModuleState(module) == IServer.STATE_STOPPED))
- mutex.wait();
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error waiting for server start", e);
- }
- }
- removeServerListener(listener);
- if (timer.timeout)
- throw new CoreException(new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0, ServerPlugin.getResource("%errorModuleRestartFailed", getName()), null));
- timer.alreadyDone = true;
-
- if (getModuleState(module) == IServer.STATE_STOPPED)
- throw new CoreException(new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0, ServerPlugin.getResource("%errorModuleRestartFailed", getName()), null));
-
- Trace.trace(Trace.FINEST, "synchronousModuleRestart 4");
- }
-
- public IPath getTempDirectory() {
- return ServerPlugin.getInstance().getTempDirectory(getId());
- }
-
- protected String getXMLRoot() {
- return "server";
- }
-
- protected void loadState(IMemento memento) {
- /*String serverTypeId = memento.getString("server-type-id");
- serverType = ServerCore.getServerType(serverTypeId);
-
- String runtimeId = memento.getString("runtime-id");
- runtime = ServerCore.getResourceManager().getRuntime(runtimeId);
-
- String configurationId = memento.getString("configuration-id");
- configuration = ServerCore.getResourceManager().getServerConfiguration(configurationId);*/
- resolve();
- }
-
- protected void resolve() {
- IServerType oldServerType = serverType;
- String serverTypeId = getAttribute("server-type-id", (String)null);
- if (serverTypeId != null)
- serverType = ServerCore.findServerType(serverTypeId);
- else
- serverType = null;
- if (serverType != null && !serverType.equals(oldServerType))
- serverState = ((ServerType)serverType).getInitialState();
-
- String runtimeId = getAttribute(RUNTIME_ID, (String)null);
- if (runtimeId != null)
- runtime = ServerCore.findRuntime(runtimeId);
-
- String configPath = getAttribute(CONFIGURATION_ID, (String)null);
- configuration = null;
- if (configPath != null)
- configuration = ResourcesPlugin.getWorkspace().getRoot().getFolder(new Path(configPath));
- }
-
- protected void setInternal(ServerWorkingCopy wc) {
- map = wc.map;
- configuration = wc.configuration;
- runtime = wc.runtime;
- serverSyncState = wc.serverSyncState;
- //restartNeeded = wc.restartNeeded;
- serverType = wc.serverType;
- modules = wc.modules;
-
- // can never modify the following properties via the working copy
- //serverState = wc.serverState;
- delegate = wc.delegate;
- }
-
- protected void saveState(IMemento memento) {
- if (serverType != null)
- memento.putString("server-type", serverType.getId());
-
- if (configuration != null)
- memento.putString(CONFIGURATION_ID, configuration.getFullPath().toString());
- else
- memento.putString(CONFIGURATION_ID, null);
-
- if (runtime != null)
- memento.putString(RUNTIME_ID, runtime.getId());
- else
- memento.putString(RUNTIME_ID, null);
- }
-
- /*public void updateConfiguration() {
- try {
- getDelegate(null).updateConfiguration();
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error calling delegate updateConfiguration() " + toString(), e);
- }
- }*/
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.server.core.IServerConfiguration#canModifyModule(org.eclipse.wst.server.core.model.IModule)
- */
- public IStatus canModifyModules(IModule[] add, IModule[] remove, IProgressMonitor monitor) {
- try {
- return getDelegate().canModifyModules(add, remove);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error calling delegate canModifyModules() " + toString(), e);
- return null;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.server.core.IServer#getModules()
- */
- public IModule[] getModules() {
- if (modules == null) {
- // convert from attribute
- List list = getAttribute(MODULE_LIST, (List) null);
- if (list == null)
- list = new ArrayList(1);
-
- modules = new ArrayList(list.size() + 1);
- Iterator iterator = list.iterator();
- while (iterator.hasNext()) {
- String moduleStr = (String) iterator.next();
- IModule module = ServerUtil.getModule(moduleStr);
- if (module != null)
- modules.add(module);
- }
- } else {
- // verify modules are still available
- List remove = new ArrayList();
- Iterator iterator = modules.iterator();
- while (iterator.hasNext()) {
- IModule module = (IModule) iterator.next();
- if (ServerUtil.getModule(module.getId()) == null)
- remove.add(module);
- }
-
- iterator = remove.iterator();
- while (iterator.hasNext()) {
- modules.remove(iterator.next());
- }
- }
-
- IModule[] modules2 = new IModule[modules.size()];
- modules.toArray(modules2);
- return modules2;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.server.core.IServer#getServerModules()
- */
- public IModule[] getServerModules(IProgressMonitor monitor) {
- try {
- return serverModules;
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error calling delegate getModules() " + toString(), e);
- return new IModule[0];
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.server.core.IServer#getModuleState()
- */
- public int getModuleState(IModule module) {
- try {
- Integer in = (Integer) moduleState.get(module.getId());
- if (in != null)
- return in.intValue();
- } catch (Exception e) {
- // ignore
- }
- return STATE_UNKNOWN;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.server.core.IServer#getModuleState()
- */
- public int getModulePublishState(IModule module) {
- try {
- Integer in = (Integer) modulePublishState.get(module.getId());
- if (in != null)
- return in.intValue();
- } catch (Exception e) {
- // ignore
- }
- return PUBLISH_STATE_UNKNOWN;
- }
-
- /*
- * @see IServer#getChildModule(IModule)
- */
- public IModule[] getChildModules(IModule module, IProgressMonitor monitor) {
- try {
- return getDelegate().getChildModules(module);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error calling delegate getChildModules() " + toString(), e);
- return null;
- }
- }
-
- /*
- * @see IServer#getRootModules(IModule)
- */
- public IModule[] getRootModules(IModule module, IProgressMonitor monitor) throws CoreException {
- try {
- return getDelegate().getRootModules(module);
- } catch (CoreException se) {
- //Trace.trace(Trace.FINER, "CoreException calling delegate getParentModules() " + toString() + ": " + se.getMessage());
- throw se;
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error calling delegate getParentModules() " + toString(), e);
- return null;
- }
- }
-
- /*
- *
- */
- /*public boolean hasRuntime() {
- try {
- return getDelegate().requiresRuntime();
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error calling delegate requiresRuntime() " + toString(), e);
- return false;
- }
- }*/
-
- /**
- * Returns whether the given module can be restarted.
- *
- * @param module the module
- * @return <code>true</code> if the given module can be
- * restarted, and <code>false</code> otherwise
- * TODO: fix return strings
- */
- public IStatus canRestartModule(IModule module) {
- try {
- boolean b = getBehaviourDelegate().canRestartModule(module);
- if (b)
- return new Status(IStatus.OK, ServerPlugin.PLUGIN_ID, 0, ServerPlugin.getResource("%errorLaunchMode"), null);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error calling delegate canRestartRuntime() " + toString(), e);
- }
- return new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0, ServerPlugin.getResource("%errorLaunchMode"), null);
- }
-
- /**
- * Check if the given module is in sync on the server. It should
- * return true if the module should be restarted (is out of
- * sync) or false if the module does not need to be restarted.
- *
- * @param module org.eclipse.wst.server.core.model.IModule
- * @return boolean
- */
- public boolean getModuleRestartState(IModule module) {
- try {
- Boolean b = (Boolean) moduleRestartState.get(module.getId());
- if (b != null)
- return b.booleanValue();
- } catch (Exception e) {
- // ignore
- }
- return false;
- }
-
- /*
- * @see IServer#restartModule(IModule, IProgressMonitor)
- */
- public void restartModule(IModule module, IProgressMonitor monitor) throws CoreException {
- try {
- getBehaviourDelegate().restartModule(module, monitor);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error calling delegate restartModule() " + toString(), e);
- }
- }
-
- /**
- * Returns an array of IServerPorts that this server has.
- *
- * @return a possibly empty array of servers ports
- */
- public IServerPort[] getServerPorts() {
- try {
- return getDelegate().getServerPorts();
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error calling delegate getServerPorts() " + toString(), e);
- return null;
- }
- }
-
- /**
- * Visit all the modules in the server with the given module visitor.
- *
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- */
- public void visit(IModuleVisitor visitor, IProgressMonitor monitor) {
- IModule[] modules2 = getModules();
- if (modules2 != null) {
- int size = modules2.length;
- for (int i = 0; i < size; i++) {
- if (!visitModule(new IModule[0], modules2[i], visitor, monitor))
- return;
- }
- }
- }
-
- /**
- * Returns true to keep visiting, and false to stop.
- *
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- */
- private boolean visitModule(IModule[] parents, IModule module, IModuleVisitor visitor, IProgressMonitor monitor) {
- if (module == null || parents == null)
- return true;
-
- if (!visitor.visit(parents, module))
- return false;
-
- IModule[] children = getChildModules(module, monitor);
- if (children != null) {
- int size = children.length;
- for (int i = 0; i < size; i++) {
- IModule module2 = children[i];
- IModule[] parents2 = new IModule[parents.length + 1];
- System.arraycopy(parents, 0, parents2, 0, parents.length);
- parents2[parents.length] = module;
-
- if (!visitModule(parents2, module2, visitor, monitor))
- return false;
- }
- }
-
- return true;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerListener.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerListener.java
deleted file mode 100644
index 4d00841..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerListener.java
+++ /dev/null
@@ -1,124 +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.core.internal;
-
-import org.eclipse.wst.server.core.*;
-import org.eclipse.wst.server.core.util.ServerLifecycleAdapter;
-/**
- * Listens for messages from the servers. This class keeps
- * track of server instances current state and any clients
- * that are waiting to run on the server.
- */
-public class ServerListener extends ServerLifecycleAdapter implements IServerListener {
- // static instance
- protected static ServerListener listener;
-
- /**
- * ServerListener constructor comment.
- */
- private ServerListener() {
- super();
- }
-
- /**
- * Get the static instance.
- *
- * @return org.eclipse.wst.server.core.internal.plugin.ServerListener
- */
- public static ServerListener getInstance() {
- if (listener == null)
- listener = new ServerListener();
- return listener;
- }
-
- /**
- * Called when the server configuration's sync state changes.
- *
- * @param server org.eclipse.wst.server.model.IServer
- */
- public void configurationSyncStateChange(IServer server) {
- // do nothing
- }
-
- /**
- * Notification when the server state has changed.
- *
- * @param server org.eclipse.wst.server.model.IServer
- */
- public void serverStateChange(IServer server) {
- // do nothing
- }
-
- /**
- * Notification when the server state has changed.
- *
- * @param server org.eclipse.wst.server.model.IServer
- */
- public void modulesChanged(IServer server) {
- // do nothing
- }
-
- /**
- * Notification when the state of a module has changed.
- *
- * @param server org.eclipse.wst.server.model.IServer
- */
- public void moduleStateChange(IServer server, IModule module) {
- // do nothing
- }
-
- /**
- * Called when the server isRestartNeeded() property changes.
- *
- * @param server org.eclipse.wst.server.core.IServer
- */
- public void restartStateChange(IServer server) {
- /*if (server.isRestartNeeded() == false)
- return;
-
- byte state = server.getServerState();
- if (state != IServer2.STATE_STARTED && state != IServer2.STATE_STARTED_DEBUG && state != IServer.STATE_STARTED_PROFILE)
- return;
-
- if (ServerCore.getServerPreferences().isAutoRestarting()) {
- try {
- server.restart();
- } catch (CoreException e) {
- Trace.trace(Trace.SEVERE, "Error restarting server", e);
- }
- }*/
- }
-
- /**
- * A new resource has been added.
- *
- * @param server org.eclipse.wst.server.core.IServer
- */
- public void serverAdded(IServer server) {
- server.addServerListener(this);
- }
-
- /**
- * A existing resource has been removed.
- *
- * @param server org.eclipse.wst.server.core.IServer
- */
- public void serverRemoved(IServer server) {
- server.removeServerListener(this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.server.core.model.IPublishListener#moduleStateChange(org.eclipse.wst.server.core.IServer2, java.util.List, org.eclipse.wst.server.core.model.IModule)
- */
- public void moduleStateChange(IServer server, IModule[] parents, IModule module) {
- // do nothing
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerMonitor.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerMonitor.java
deleted file mode 100644
index 9aa0c1b..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerMonitor.java
+++ /dev/null
@@ -1,110 +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.core.internal;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.IServerPort;
-/**
- *
- */
-public class ServerMonitor implements IServerMonitor {
- private IConfigurationElement element;
- private ServerMonitorDelegate delegate;
-
- /**
- * Monitor constructor comment.
- */
- public ServerMonitor(IConfigurationElement element) {
- super();
- this.element = element;
- }
-
- /**
- * Returns the id of this default server.
- *
- * @return java.lang.String
- */
- public String getId() {
- return element.getAttribute("id");
- }
-
- /*
- * @see IMonitor#getDescription()
- */
- public String getDescription() {
- return element.getAttribute("description");
- }
-
- /*
- * @see IMonitor#getLabel()
- */
- public String getName() {
- String label = element.getAttribute("name");
- if (label == null)
- return "n/a";
- return label;
- }
-
- /*
- * @see IMonitor#getDelegate()
- */
- public ServerMonitorDelegate getDelegate() {
- if (delegate == null) {
- try {
- delegate = (ServerMonitorDelegate) element.createExecutableExtension("class");
- } catch (Throwable t) {
- Trace.trace(Trace.SEVERE, "Could not create delegate" + toString() + ": " + t.getMessage());
- }
- }
- return delegate;
- }
-
- /**
- * Start monitoring the given port, and return the port number to
- * tunnel requests through.
- * @param port
- * @return the port used for monitoring
- */
- public int startMonitoring(IServer server, IServerPort port, int monitorPort) throws CoreException {
- try {
- return getDelegate().startMonitoring(server, port, monitorPort);
- } catch (CoreException ce) {
- throw ce;
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error calling delegate " + toString() + ": " + e.getMessage());
- return -1;
- }
- }
-
- /**
- * Stop monitoring the given port.
- * @param port
- */
- public void stopMonitoring(IServer server, IServerPort port) {
- try {
- getDelegate().stopMonitoring(server, port);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error calling delegate " + toString() + ": " + e.getMessage());
- }
- }
-
- /**
- * Return a string representation of this object.
- *
- * @return java.lang.String
- */
- public String toString() {
- return "Monitor[" + getId() + "]";
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerMonitorDelegate.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerMonitorDelegate.java
deleted file mode 100644
index 3c5a05b..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerMonitorDelegate.java
+++ /dev/null
@@ -1,36 +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.core.internal;
-
-import org.eclipse.core.runtime.CoreException;
-
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.IServerPort;
-/**
- * An interface to a TCP/IP monitor.
- */
-public abstract class ServerMonitorDelegate {
- /**
- * Start monitoring the given port, and return the port number to
- * tunnel requests through. The monitorPort is the new port to use, or
- * -1 to pick a random port.
- *
- * @param port
- * @return the port used for monitoring
- */
- public abstract int startMonitoring(IServer server, IServerPort port, int monitorPort) throws CoreException;
-
- /**
- * Stop monitoring the given port.
- * @param port
- */
- public abstract void stopMonitoring(IServer server, IServerPort port);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerMonitorManager.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerMonitorManager.java
deleted file mode 100644
index 3fb6b0a..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerMonitorManager.java
+++ /dev/null
@@ -1,367 +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.core.internal;
-
-import java.util.*;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.server.core.*;
-/**
- *
- */
-public class ServerMonitorManager implements IServerMonitorManager {
- private static final String MONITOR_DATA_FILE = "monitors.xml";
-
- protected static ServerMonitorManager instance;
-
- protected List ports = new ArrayList();
- protected ServerMonitor monitor;
-
- class MonitoredPort implements IMonitoredServerPort {
- protected IServer server;
- protected IServerPort port;
- protected int newPort = -1;
- protected String[] content;
- public boolean started;
-
- public MonitoredPort(IServer server, IServerPort port, int newPort, String[] content) {
- this.server = server;
- this.port = port;
- this.newPort = newPort;
- this.content = content;
- }
-
- public MonitoredPort(IMemento memento, IProgressMonitor monitor) {
- load(memento, monitor);
- }
-
- public IServer getServer() {
- return server;
- }
-
- public IServerPort getServerPort() {
- return port;
- }
-
- public int getMonitorPort() {
- return newPort;
- }
-
- public void setMonitorPort(int p) {
- newPort = p;
- }
-
- public String[] getContentTypes() {
- if (content == null)
- return new String[0];
- return content;
- }
-
- public boolean isStarted() {
- return started;
- }
-
- protected void setStarted(boolean s) {
- started = s;
- }
-
- public boolean equals(Object obj) {
- if (!(obj instanceof MonitoredPort))
- return false;
- MonitoredPort mp = (MonitoredPort) obj;
- if (!mp.server.equals(server))
- return false;
- if (!mp.port.equals(port))
- return false;
- if (newPort != mp.newPort)
- return false;
- if (content == null && mp.content != null)
- return false;
- if (content != null && mp.content == null)
- return false;
- if (content != null) {
- int size = content.length;
- if (size != mp.content.length)
- return false;
- for (int i = 0; i < size; i++)
- if (!content[i].equals(mp.content[i]))
- return false;
- }
- return true;
- }
-
- protected boolean canSave() {
- return (port.getId() != null);
- }
-
- protected void save(IMemento memento) {
- memento.putString("serverId", server.getId());
- if (newPort != -1)
- memento.putString("port", newPort + "");
- memento.putString("portId", port.getId());
- memento.putBoolean("started", started);
-
- if (content != null) {
- StringBuffer sb = new StringBuffer();
- int size = content.length;
- for (int i = 0; i < size; i++) {
- if (i > 0)
- sb.append(",");
- sb.append(content[i]);
- }
- memento.putString("contentTypes", sb.toString());
- }
- }
-
- protected void load(IMemento memento, IProgressMonitor monitor2) {
- String serverId = memento.getString("serverId");
- server = null;
- if (serverId != null)
- server = ServerCore.findServer(serverId);
- if (server == null)
- throw new RuntimeException("Server could not be found: " + serverId + " " + server);
- String newPortStr = memento.getString("port");
- if (newPortStr != null && newPortStr.length() > 0)
- newPort = Integer.parseInt(newPortStr);
- String portId = memento.getString("portId");
-
- IServerPort[] ports2 = server.getServerPorts();
- if (ports2 != null) {
- int size = ports2.length;
- for (int i = 0; port == null && i < size; i++) {
- IServerPort sp = ports2[i];
- if (sp.getId() != null && sp.getId().equals(portId))
- port = sp;
- }
- }
- if (port == null)
- throw new RuntimeException("Could not relocate port: " + serverId + " " + server + " " + portId);
-
- String s = memento.getString("contentTypes");
- if (s != null)
- content = ServerPlugin.tokenize(s, ",");
-
- Boolean b = memento.getBoolean("started");
- if (b != null && b.booleanValue()) {
- try {
- newPort = monitor.startMonitoring(server, port, newPort);
- started = true;
- } catch (CoreException e) {
- Trace.trace(Trace.WARNING, "Could not restart server monitor", e);
- }
- }
- }
- }
-
- public ServerMonitorManager() {
- IServerMonitor[] monitors = ServerPlugin.getServerMonitors();
- if (monitors != null && monitors.length > 0)
- monitor = (ServerMonitor) monitors[0];
-
- instance = this;
- loadMonitors();
- }
-
- public static ServerMonitorManager getInstance() {
- if (instance == null)
- new ServerMonitorManager();
- return instance;
- }
-
- public static void shutdown() {
- if (instance == null)
- return;
- instance.saveMonitors();
- }
-
- /**
- * Returns the monitor that is currently being used.
- *
- * @return the current server monitor
- */
- public IServerMonitor getCurrentServerMonitor() {
- return monitor;
- }
-
- /**
- * Switch to use a different server monitor. All existing monitors will be
- * removed from the current monitor and added to the new monitor.
- *
- * @param newMonitor
- * @throws org.eclipse.core.runtime.CoreException
- */
- public void setServerMonitor(IServerMonitor newMonitor) throws CoreException {
- throw new CoreException(new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0, "Not implemented yet", null));
- }
-
- /**
- * Returns the list of ports that are currently being monitored.
- *
- * @return a possibly empty array of monitored server ports
- */
- public IMonitoredServerPort[] getMonitoredPorts(IServer server) {
- List list = new ArrayList();
- Iterator iterator = ports.iterator();
- while (iterator.hasNext()) {
- MonitoredPort mp = (MonitoredPort) iterator.next();
- if (mp.server.equals(server))
- list.add(mp);
- }
-
- IMonitoredServerPort[] msp = new IMonitoredServerPort[list.size()];
- list.toArray(msp);
- return msp;
- }
-
- /**
- * Starts monitoring the given port, and returns the new port # to use that will
- * route to the monitored port.
- *
- * @param port
- * @return a monitored server port
- * @throws org.eclipse.core.runtime.CoreException
- */
- public IMonitoredServerPort createMonitor(IServer server, IServerPort port, int monitorPort, String[] content) {
- if (port == null || monitor == null)
- return null;
-
- MonitoredPort mp = new MonitoredPort(server, port, monitorPort, content);
- ports.add(mp);
- return mp;
- }
-
- /**
- * Stop monitoring the given port. Throws a CoreException if there was a problem
- * stopping the monitoring
- *
- * @param port
- * @throws org.eclipse.core.runtime.CoreException
- */
- public void removeMonitor(IMonitoredServerPort port) {
- if (port == null)
- return;
-
- try {
- ports.remove(port);
- if (port.isStarted())
- monitor.stopMonitoring(port.getServer(), port.getServerPort());
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not remove monitor", e);
- }
- }
-
- /**
- * Start the monitor. If the msp port is -1, it will be updated to the port that is actually in use.
- *
- * @param msp
- * @throws CoreException
- */
- public void startMonitor(IMonitoredServerPort msp) throws CoreException {
- if (msp == null || msp.isStarted())
- return;
-
- MonitoredPort port = (MonitoredPort) msp;
- port.setMonitorPort(monitor.startMonitoring(msp.getServer(), msp.getServerPort(), msp.getMonitorPort()));
- port.setStarted(true);
- }
-
- /**
- * Stop monitoring.
- *
- * @param msp
- */
- public void stopMonitor(IMonitoredServerPort msp) {
- if (msp == null || !msp.isStarted())
- return;
- MonitoredPort port = (MonitoredPort) msp;
- monitor.stopMonitoring(msp.getServer(), msp.getServerPort());
- port.setStarted(false);
- }
-
- /**
- * Returns the mapped port to use when making requests to the given server
- * and port number. Returns the existing port number if the port is not being
- * monitored.
- *
- * @param port
- * @return the port used for monitoring
- */
- public int getMonitoredPort(IServer server, int port, String content) {
- try {
- Iterator iterator = ports.iterator();
- while (iterator.hasNext()) {
- MonitoredPort mp = (MonitoredPort) iterator.next();
- if (mp.isStarted() && mp.server.equals(server) && mp.port.getPort() == port) {
- String[] contentTypes = mp.getContentTypes();
- boolean found = false;
- if (content == null || contentTypes != null) {
- int size = contentTypes.length;
- for (int i = 0; i < size; i++)
- if (content.equals(contentTypes[i]))
- found = true;
- } else
- found = true;
- if (found && mp.newPort != -1)
- return mp.newPort;
- }
- }
- } catch (Exception e) {
- // ignore
- }
- return port;
- }
-
- protected void saveMonitors() {
- String filename = ServerPlugin.getInstance().getStateLocation().append(MONITOR_DATA_FILE).toOSString();
- try {
- XMLMemento memento = XMLMemento.createWriteRoot("monitors");
-
- Iterator iterator = ports.iterator();
- while (iterator.hasNext()) {
- MonitoredPort mp = (MonitoredPort) iterator.next();
- if (mp.canSave()) {
- IMemento child = memento.createChild("monitor");
- mp.save(child);
- }
- }
-
- memento.saveToFile(filename);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error saving monitor info", e);
- }
- }
-
- protected void loadMonitors() {
- Trace.trace(Trace.FINEST, "Loading monitor info");
- String filename = ServerPlugin.getInstance().getStateLocation().append(MONITOR_DATA_FILE).toOSString();
-
- try {
- IMemento memento = XMLMemento.loadMemento(filename);
-
- IMemento[] children = memento.getChildren("monitor");
- int size = children.length;
-
- for (int i = 0; i < size; i++) {
- try {
- MonitoredPort mp = new MonitoredPort(children[i], null);
- ports.add(mp);
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Could not load monitor: " + e);
- }
- }
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Could not load monitor info: " + e.getMessage());
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerPlugin.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerPlugin.java
deleted file mode 100644
index 8928dd4..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerPlugin.java
+++ /dev/null
@@ -1,883 +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.core.internal;
-
-import java.io.*;
-import java.util.*;
-import java.text.DateFormat;
-import java.text.MessageFormat;
-
-import org.eclipse.core.runtime.*;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IModuleArtifact;
-import org.eclipse.wst.server.core.IServer;
-import org.osgi.framework.BundleContext;
-/**
- * The main server plugin class.
- */
-public class ServerPlugin extends Plugin {
- public static final String PROJECT_PREF_FILE = ".serverPreference";
-
- protected static final DateFormat df = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);
- protected static int num = 0;
-
- // cached copy of all launchable adapters
- private static List launchableAdapters;
-
- // cached copy of all launchable clients
- private static List clients;
-
- // cached copy of all module factories
- private static List moduleFactories;
-
- // singleton instance of this class
- private static ServerPlugin singleton;
-
- // cached copy of all server tasks
- private static List serverTasks;
-
- // cached copy of all server monitors
- private static List monitors;
-
- // cached copy of all runtime locators
- private static List runtimeLocators;
-
- // cached copy of all module artifact adapters
- private static List moduleArtifactAdapters;
-
- private static final String TEMP_DATA_FILE = "tmp-data.xml";
-
- class TempDir {
- String path;
- int age;
- }
-
- // temp directories - String key to TempDir
- protected Map tempDirHash;
-
- /**
- * server core plugin id
- */
- public static final String PLUGIN_ID = "org.eclipse.wst.server.core";
-
- /**
- * Create the ServerPlugin.
- */
- public ServerPlugin() {
- super();
- singleton = this;
- }
-
- /**
- * Returns the singleton instance of this plugin.
- *
- * @return org.eclipse.wst.server.core.internal.plugin.ServerPlugin
- */
- public static ServerPlugin getInstance() {
- return singleton;
- }
-
- /**
- * Returns the translated String found with the given key.
- *
- * @param key a key
- * @return a translated string
- */
- public static String getResource(String key) {
- try {
- return Platform.getResourceString(getInstance().getBundle(), key);
- } catch (Exception e) {
- return key;
- }
- }
-
- /**
- * Returns the translated String found with the given key,
- * and formatted with the given arguments using java.text.MessageFormat.
- *
- * @param key a key
- * @param args substitution arguments
- * @return a translated string
- */
- public static String getResource(String key, Object[] args) {
- try {
- String text = getResource(key);
- return MessageFormat.format(text, args);
- } catch (Exception e) {
- return key;
- }
- }
-
- /**
- * Returns the translated String found with the given key,
- * and formatted with the given arguments using java.text.MessageFormat.
- *
- * @param key a key
- * @param arg an argument
- * @return a translated string
- */
- public static String getResource(String key, String arg) {
- return getResource(key, new String[] { arg });
- }
-
- /**
- * Returns a temporary directory that the requestor can use
- * throughout it's lifecycle. This is primary to be used by
- * server instances for working directories, instance specific
- * files, etc.
- *
- * <p>As long as the same key is used to call this method on
- * each use of the workbench, this method directory will return
- * the same directory. If the directory is not requested over a
- * period of time, the directory may be deleted and a new one
- * will be assigned on the next request. For this reason, a
- * server instance should request the temp directory on startup
- * if it wants to store files there. In all cases, the instance
- * should have a backup plan anyway, as this directory may be
- * deleted accidentally.</p>
- *
- * @param key
- * @return java.io.File
- */
- public IPath getTempDirectory(String key) {
- if (key == null)
- return null;
-
- // first, look through hash of current directories
- IPath statePath = ServerPlugin.getInstance().getStateLocation();
- try {
- TempDir dir = (TempDir) tempDirHash.get(key);
- if (dir != null) {
- dir.age = 0;
- return statePath.append(dir.path);
- }
- } catch (Exception e) {
- // ignore
- }
-
- // otherwise, create a new directory
-
- // find first free directory
- String path = null;
- File dir = null;
- int count = 0;
- while (dir == null || dir.exists()) {
- path = "tmp" + count;
- dir = statePath.append(path).toFile();
- count ++;
- }
-
- dir.mkdirs();
-
- TempDir d = new TempDir();
- d.path = path;
- tempDirHash.put(key, d);
- saveTempDirInfo();
- return statePath.append(path);
- }
-
- /**
- * Remove a temp directory.
- * @param key
- */
- public void removeTempDirectory(String key) {
- if (key == null)
- return;
-
- IPath statePath = ServerPlugin.getInstance().getStateLocation();
- try {
- TempDir dir = (TempDir) tempDirHash.get(key);
- if (dir != null) {
- tempDirHash.remove(key);
- saveTempDirInfo();
- deleteDirectory(statePath.append(dir.path).toFile(), null);
- }
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Could not remove temp directory", e);
- }
- }
-
- /**
- * Load the temporary directory information.
- */
- private void loadTempDirInfo() {
- Trace.trace(Trace.FINEST, "Loading temporary directory information");
- IPath statePath = ServerPlugin.getInstance().getStateLocation();
- String filename = statePath.append(TEMP_DATA_FILE).toOSString();
-
- tempDirHash = new HashMap();
- try {
- IMemento memento = XMLMemento.loadMemento(filename);
-
- IMemento[] children = memento.getChildren("temp-directory");
- int size = children.length;
- for (int i = 0; i < size; i++) {
- String key = children[i].getString("key");
-
- TempDir d = new TempDir();
- d.path = children[i].getString("path");
- d.age = children[i].getInteger("age").intValue();
- d.age++;
-
- tempDirHash.put(key, d);
- }
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not load temporary directory information: " + e.getMessage());
- }
- }
-
- /**
- * Convenience method for logging.
- *
- * @param status org.eclipse.core.runtime.IStatus
- */
- public static void log(IStatus status) {
- getInstance().getLog().log(status);
- }
-
- /**
- * Save the temporary directory information.
- */
- private void saveTempDirInfo() {
- // save remaining directories
- IPath statePath = ServerPlugin.getInstance().getStateLocation();
- String filename = statePath.append(TEMP_DATA_FILE).toOSString();
-
- try {
- XMLMemento memento = XMLMemento.createWriteRoot("temp-directories");
-
- Iterator iterator = tempDirHash.keySet().iterator();
- while (iterator.hasNext()) {
- String key = (String) iterator.next();
- TempDir d = (TempDir) tempDirHash.get(key);
-
- if (d.age < 5) {
- IMemento child = memento.createChild("temp-directory");
- child.putString("key", key);
- child.putString("path", d.path);
- child.putInteger("age", d.age);
- } else
- deleteDirectory(statePath.append(d.path).toFile(), null);
- }
-
- memento.saveToFile(filename);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not save temporary directory information", e);
- }
- }
-
- protected void initializeDefaultPluginPreferences() {
- ServerPreferences.getInstance().setDefaults();
- }
-
- /**
- * Start up this plug-in.
- */
- public void start(BundleContext context) throws Exception {
- Trace.trace(Trace.CONFIG, "----->----- Server Core plugin startup ----->-----");
- super.start(context);
-
- initializeDefaultPluginPreferences();
-
- // load temp directory information
- loadTempDirInfo();
- }
-
- /**
- * Shuts down this plug-in and saves all plug-in state.
- */
- public void stop(BundleContext context) throws Exception {
- Trace.trace(Trace.CONFIG, "-----<----- Server Core plugin shutdown -----<-----");
- super.stop(context);
-
- ResourceManager.shutdown();
- ServerMonitorManager.shutdown();
- }
-
- public static String[] tokenize(String param, String delim) {
- if (param == null)
- return new String[0];
-
- List list = new ArrayList();
-
- StringTokenizer st = new StringTokenizer(param, delim);
- while (st.hasMoreTokens()) {
- String str = st.nextToken();
- if (str != null && str.length() > 0)
- list.add(str.trim());
- }
-
- String[] s = new String[list.size()];
- list.toArray(s);
- return s;
- }
-
- protected static List getModuleTypes(IConfigurationElement[] elements) {
- List list = new ArrayList();
- if (elements == null)
- return list;
-
- int size = elements.length;
- for (int i = 0; i < size; i++) {
- String[] types = tokenize(elements[i].getAttribute("types"), ",");
- String[] versions = tokenize(elements[i].getAttribute("versions"), ",");
- int sizeT = types.length;
- int sizeV = versions.length;
- for (int j = 0; j < sizeT; j++) {
- for (int k = 0; k < sizeV; k++) {
- ModuleType module = new ModuleType(types[j], versions[k]);
- list.add(module);
- }
- }
- }
- return list;
- }
-
- public static String generateId() {
- String s = df.format(new Date()).toString() + num++;
- s = s.replace(' ', '_');
- s = s.replace(':', '_');
- s = s.replace('/', '_');
- s = s.replace('\\', '_');
- return s;
- }
-
- /**
- * Returns true if ids contains id.
- *
- * @param ids
- * @param id
- * @return true if the id is supported
- */
- public static boolean supportsType(String[] ids, String id) {
- if (id == null || id.length() == 0)
- return false;
-
- if (ids == null)
- return true;
-
- int size = ids.length;
- for (int i = 0; i < size; i++) {
- if (ids[i].endsWith("*")) {
- if (id.length() >= ids[i].length() && id.startsWith(ids[i].substring(0, ids[i].length() - 1)))
- return true;
- } else if (id.equals(ids[i]))
- return true;
- }
- return false;
- }
-
- /**
- * Recursively delete a directory.
- *
- * @param dir java.io.File
- */
- public static void deleteDirectory(File dir, IProgressMonitor monitor) {
- try {
- if (!dir.exists() || !dir.isDirectory())
- return;
-
- File[] files = dir.listFiles();
- int size = files.length;
- monitor = ProgressUtil.getMonitorFor(monitor);
- monitor.beginTask(ServerPlugin.getResource("%deletingTask", new String[] {dir.getAbsolutePath()}), size * 10);
-
- // cycle through files
- for (int i = 0; i < size; i++) {
- File current = files[i];
- if (current.isFile()) {
- current.delete();
- monitor.worked(10);
- } else if (current.isDirectory()) {
- monitor.subTask(ServerPlugin.getResource("%deletingTask", new String[] {current.getAbsolutePath()}));
- deleteDirectory(current, ProgressUtil.getSubMonitorFor(monitor, 10));
- }
- }
- dir.delete();
- monitor.done();
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error deleting directory " + dir.getAbsolutePath(), e);
- }
- }
-
- /**
- * Returns an array of all known launchable adapters.
- * <p>
- * A new array is returned on each call, so clients may store or modify the result.
- * </p>
- *
- * @return a possibly-empty array of launchable adapters {@link ILaunchableAdapter}
- */
- public static ILaunchableAdapter[] getLaunchableAdapters() {
- if (launchableAdapters == null)
- loadLaunchableAdapters();
- ILaunchableAdapter[] la = new ILaunchableAdapter[launchableAdapters.size()];
- launchableAdapters.toArray(la);
- return la;
- }
-
- /**
- * Returns an array of all known client instances.
- * <p>
- * A new array is returned on each call, so clients may store or modify the result.
- * </p>
- *
- * @return a possibly-empty array of client instances {@link IClient}
- */
- public static IClient[] getClients() {
- if (clients == null)
- loadClients();
- IClient[] c = new IClient[clients.size()];
- clients.toArray(c);
- return c;
- }
-
- /**
- * Load the launchable adapters extension point.
- */
- private static synchronized void loadLaunchableAdapters() {
- if (launchableAdapters != null)
- return;
- Trace.trace(Trace.EXTENSION_POINT, "->- Loading .launchableAdapters extension point ->-");
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IConfigurationElement[] cf = registry.getConfigurationElementsFor(ServerPlugin.PLUGIN_ID, "launchableAdapters");
-
- int size = cf.length;
- launchableAdapters = new ArrayList(size);
- for (int i = 0; i < size; i++) {
- try {
- launchableAdapters.add(new LaunchableAdapter(cf[i]));
- Trace.trace(Trace.EXTENSION_POINT, " Loaded launchableAdapter: " + cf[i].getAttribute("id"));
- } catch (Throwable t) {
- Trace.trace(Trace.SEVERE, " Could not load launchableAdapter: " + cf[i].getAttribute("id"), t);
- }
- }
- Trace.trace(Trace.EXTENSION_POINT, "-<- Done loading .launchableAdapters extension point -<-");
- }
-
- /**
- * Load the client extension point.
- */
- private static synchronized void loadClients() {
- if (clients != null)
- return;
- Trace.trace(Trace.EXTENSION_POINT, "->- Loading .clients extension point ->-");
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IConfigurationElement[] cf = registry.getConfigurationElementsFor(ServerPlugin.PLUGIN_ID, "clients");
-
- int size = cf.length;
- clients = new ArrayList(size);
- for (int i = 0; i < size; i++) {
- try {
- clients.add(new Client(cf[i]));
- Trace.trace(Trace.EXTENSION_POINT, " Loaded clients: " + cf[i].getAttribute("id"));
- } catch (Throwable t) {
- Trace.trace(Trace.SEVERE, " Could not load clients: " + cf[i].getAttribute("id"), t);
- }
- }
- Trace.trace(Trace.EXTENSION_POINT, "-<- Done loading .clients extension point -<-");
- }
-
- /**
- * Returns an array of all known server tasks.
- * <p>
- * A new array is returned on each call, so clients may store or modify the result.
- * </p>
- *
- * @return a possibly-empty array of server tasks instances {@link IServerTask}
- */
- public static IServerTask[] getServerTasks() {
- if (serverTasks == null)
- loadServerTasks();
- IServerTask[] st = new IServerTask[serverTasks.size()];
- serverTasks.toArray(st);
- return st;
- }
-
- /**
- * Load the server task extension point.
- */
- private static synchronized void loadServerTasks() {
- if (serverTasks != null)
- return;
- Trace.trace(Trace.EXTENSION_POINT, "->- Loading .serverTasks extension point ->-");
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IConfigurationElement[] cf = registry.getConfigurationElementsFor(ServerPlugin.PLUGIN_ID, "serverTasks");
-
- int size = cf.length;
- serverTasks = new ArrayList(size);
- for (int i = 0; i < size; i++) {
- try {
- serverTasks.add(new ServerTask(cf[i]));
- Trace.trace(Trace.EXTENSION_POINT, " Loaded serverTask: " + cf[i].getAttribute("id"));
- } catch (Throwable t) {
- Trace.trace(Trace.SEVERE, " Could not load serverTask: " + cf[i].getAttribute("id"), t);
- }
- }
-
- sortOrderedList(serverTasks);
-
- Trace.trace(Trace.EXTENSION_POINT, "-<- Done loading .serverTasks extension point -<-");
- }
-
- /**
- * Sort the given list of IOrdered items into indexed order.
- *
- * @param list java.util.List
- * @return java.util.List
- */
- private static List sortOrderedList(List list) {
- if (list == null)
- return null;
-
- int size = list.size();
- for (int i = 0; i < size - 1; i++) {
- for (int j = i + 1; j < size; j++) {
- IOrdered a = (IOrdered) list.get(i);
- IOrdered b = (IOrdered) list.get(j);
- if (a.getOrder() > b.getOrder()) {
- Object temp = a;
- list.set(i, b);
- list.set(j, temp);
- }
- }
- }
- return list;
- }
-
- /**
- * Returns an array of all known module module factories.
- * <p>
- * A new array is returned on each call, so clients may store or modify the result.
- * </p>
- *
- * @return the array of module factories {@link ModuleFactory}
- */
- public static ModuleFactory[] getModuleFactories() {
- if (moduleFactories == null)
- loadModuleFactories();
-
- ModuleFactory[] mf = new ModuleFactory[moduleFactories.size()];
- moduleFactories.toArray(mf);
- return mf;
- }
-
- /**
- * Returns the module factory with the given id, or <code>null</code>
- * if none. This convenience method searches the list of known
- * module factories ({@link #getModuleFactories()}) for the one a matching
- * module factory id ({@link ModuleFactory#getId()}). The id may not be null.
- *
- * @param id the module factory id
- * @return the module factory, or <code>null</code> if there is no module factory
- * with the given id
- */
- public static ModuleFactory findModuleFactory(String id) {
- if (id == null)
- throw new IllegalArgumentException();
-
- if (moduleFactories == null)
- loadModuleFactories();
-
- Iterator iterator = moduleFactories.iterator();
- while (iterator.hasNext()) {
- ModuleFactory factory = (ModuleFactory) iterator.next();
- if (id.equals(factory.getId()))
- return factory;
- }
- return null;
- }
-
- /**
- * Load the module factories extension point.
- */
- private static synchronized void loadModuleFactories() {
- if (moduleFactories != null)
- return;
- Trace.trace(Trace.EXTENSION_POINT, "->- Loading .moduleFactories extension point ->-");
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IConfigurationElement[] cf = registry.getConfigurationElementsFor(ServerPlugin.PLUGIN_ID, "moduleFactories");
-
- int size = cf.length;
- moduleFactories = new ArrayList(size);
- for (int i = 0; i < size; i++) {
- try {
- moduleFactories.add(new ModuleFactory(cf[i]));
- Trace.trace(Trace.EXTENSION_POINT, " Loaded moduleFactories: " + cf[i].getAttribute("id"));
- } catch (Throwable t) {
- Trace.trace(Trace.SEVERE, " Could not load moduleFactories: " + cf[i].getAttribute("id"), t);
- }
- }
- sortOrderedList(moduleFactories);
-
- Trace.trace(Trace.EXTENSION_POINT, "-<- Done loading .moduleFactories extension point -<-");
- }
-
- /**
- * Returns all projects contained by the server. This included the
- * projects that are in the configuration, as well as their
- * children, and their children...
- *
- * @param server org.eclipse.wst.server.core.IServer
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @return a possibly-empty array of module instances {@link IModule}
- */
- public static IModule[] getAllContainedModules(IServer server, IProgressMonitor monitor) {
- //Trace.trace("> getAllContainedModules: " + getName(configuration));
- List modules = new ArrayList();
- if (server == null)
- return new IModule[0];
-
- // get all of the directly contained projects
- IModule[] deploys = server.getModules();
- if (deploys == null || deploys.length == 0)
- return new IModule[0];
-
- int size = deploys.length;
- for (int i = 0; i < size; i++) {
- if (deploys[i] != null && !modules.contains(deploys[i]))
- modules.add(deploys[i]);
- }
-
- //Trace.trace(" getAllContainedModules: root level done");
-
- // get all of the module's children
- int count = 0;
- while (count < modules.size()) {
- IModule module = (IModule) modules.get(count);
- try {
- IModule[] children = server.getChildModules(module, monitor);
- if (children != null) {
- size = children.length;
- for (int i = 0; i < size; i++) {
- if (children[i] != null && !modules.contains(children[i]))
- modules.add(children[i]);
- }
- }
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error getting child modules for: " + module.getName(), e);
- }
- count ++;
- }
-
- //Trace.trace("< getAllContainedModules");
-
- IModule[] modules2 = new IModule[modules.size()];
- modules.toArray(modules2);
- return modules2;
- }
-
- /**
- * Returns an array of all known server monitor instances.
- * <p>
- * A new array is returned on each call, so clients may store or modify the result.
- * </p>
- *
- * @return a possibly-empty array of server monitor instances {@link IServerMonitor}
- */
- public static IServerMonitor[] getServerMonitors() {
- if (monitors == null)
- loadServerMonitors();
- IServerMonitor[] sm = new IServerMonitor[monitors.size()];
- monitors.toArray(sm);
- return sm;
- }
-
- /**
- * Load the server monitor extension point.
- */
- private static synchronized void loadServerMonitors() {
- if (monitors != null)
- return;
- Trace.trace(Trace.EXTENSION_POINT, "->- Loading .serverMonitors extension point ->-");
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IConfigurationElement[] cf = registry.getConfigurationElementsFor(ServerPlugin.PLUGIN_ID, "internalServerMonitors");
-
- int size = cf.length;
- monitors = new ArrayList(size);
- for (int i = 0; i < size; i++) {
- try {
- monitors.add(new ServerMonitor(cf[i]));
- Trace.trace(Trace.EXTENSION_POINT, " Loaded serverMonitor: " + cf[i].getAttribute("id"));
- } catch (Throwable t) {
- Trace.trace(Trace.SEVERE, " Could not load serverMonitor: " + cf[i].getAttribute("id"), t);
- }
- }
-
- Trace.trace(Trace.EXTENSION_POINT, "-<- Done loading .serverMonitors extension point -<-");
- }
-
- /**
- * Returns an array of all known runtime locator instances.
- * <p>
- * A new array is returned on each call, so clients may store or modify the result.
- * </p>
- *
- * @return a possibly-empty array of runtime locator instances {@link IRuntimeLocator}
- */
- public static IRuntimeLocator[] getRuntimeLocators() {
- if (runtimeLocators == null)
- loadRuntimeLocators();
- IRuntimeLocator[] rl = new IRuntimeLocator[runtimeLocators.size()];
- runtimeLocators.toArray(rl);
- return rl;
- }
-
- /**
- * Load the runtime locators.
- */
- private static synchronized void loadRuntimeLocators() {
- if (runtimeLocators != null)
- return;
- Trace.trace(Trace.EXTENSION_POINT, "->- Loading .runtimeLocators extension point ->-");
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IConfigurationElement[] cf = registry.getConfigurationElementsFor(ServerPlugin.PLUGIN_ID, "runtimeLocators");
-
- int size = cf.length;
- runtimeLocators = new ArrayList(size);
- for (int i = 0; i < size; i++) {
- try {
- RuntimeLocator runtimeLocator = new RuntimeLocator(cf[i]);
- runtimeLocators.add(runtimeLocator);
- Trace.trace(Trace.EXTENSION_POINT, " Loaded runtimeLocator: " + cf[i].getAttribute("id"));
- } catch (Throwable t) {
- Trace.trace(Trace.SEVERE, " Could not load runtimeLocator: " + cf[i].getAttribute("id"), t);
- }
- }
-
- Trace.trace(Trace.EXTENSION_POINT, "-<- Done loading .runtimeLocators extension point -<-");
- }
-
- /**
- * Returns an array of all module artifact adapters.
- *
- * @return a possibly empty array of module artifact adapters
- */
- protected static ModuleArtifactAdapter[] getModuleArtifactAdapters() {
- if (moduleArtifactAdapters == null)
- loadModuleArtifactAdapters();
-
- ModuleArtifactAdapter[] moa = new ModuleArtifactAdapter[moduleArtifactAdapters.size()];
- moduleArtifactAdapters.toArray(moa);
- return moa;
- }
-
- /**
- * Load the module artifact adapters extension point.
- */
- private static synchronized void loadModuleArtifactAdapters() {
- if (moduleArtifactAdapters != null)
- return;
- Trace.trace(Trace.EXTENSION_POINT, "->- Loading .moduleArtifactAdapters extension point ->-");
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IConfigurationElement[] cf = registry.getConfigurationElementsFor(ServerPlugin.PLUGIN_ID, "moduleArtifactAdapters");
-
- int size = cf.length;
- moduleArtifactAdapters = new ArrayList(size);
- for (int i = 0; i < size; i++) {
- try {
- moduleArtifactAdapters.add(new ModuleArtifactAdapter(cf[i]));
- Trace.trace(Trace.EXTENSION_POINT, " Loaded moduleArtifactAdapter: " + cf[i].getAttribute("id"));
- } catch (Throwable t) {
- Trace.trace(Trace.SEVERE, " Could not load moduleArtifactAdapter: " + cf[i].getAttribute("id"), t);
- }
- }
- Trace.trace(Trace.EXTENSION_POINT, "-<- Done loading .moduleArtifactAdapters extension point -<-");
- }
-
- /**
- * Returns <code>true</code> if a module artifact may be available for the given object,
- * and <code>false</code> otherwise.
- *
- * @return IModuleArtifact
- */
- public static boolean hasModuleArtifact(Object obj) {
- Trace.trace(Trace.FINEST, "ServerUIPlugin.hasModuleArtifact() " + obj);
- ModuleArtifactAdapter[] adapters = getModuleArtifactAdapters();
- if (adapters != null) {
- int size = adapters.length;
- for (int i = 0; i < size; i++) {
- try {
- if (adapters[i].isEnabled(obj)) {
- Trace.trace(Trace.FINER, "Run On Server for " + obj + " is enabled by " + adapters[i].getId());
- return true;
- }
- } catch (CoreException ce) {
- Trace.trace(Trace.WARNING, "Could not use moduleArtifactAdapter", ce);
- }
- }
- }
-
- return false;
- }
-
- /**
- * Returns a module artifact if one can be found without loading plugins.
- *
- * @param obj
- * @return a module artifact, or null
- * @throws Exception
- */
- public static IModuleArtifact getModuleArtifact(Object obj) {
- Trace.trace(Trace.FINEST, "ServerUIPlugin.getModuleArtifact() " + obj);
- ModuleArtifactAdapter[] adapters = getModuleArtifactAdapters();
- if (adapters != null) {
- int size = adapters.length;
- for (int i = 0; i < size; i++) {
- try {
- if (adapters[i].isEnabled(obj)) {
- IModuleArtifact ma = adapters[i].getModuleArtifact(obj);
- if (ma != null)
- return ma;
- /*if (Platform.getAdapterManager().hasAdapter(obj, MODULE_ARTIFACT_CLASS)) {
- return (IModuleArtifact) Platform.getAdapterManager().getAdapter(obj, MODULE_ARTIFACT_CLASS);
- }*/
- }
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Could not use moduleArtifactAdapter " + adapters[i], e);
- }
- }
- }
-
- return null;
- }
-
- /**
- * Returns a module artifact if possible, loading any plugins required.
- *
- * @param obj
- * @return a module artifact, or null
- */
- public static IModuleArtifact loadModuleArtifact(Object obj) {
- Trace.trace(Trace.FINEST, "ServerUIPlugin.loadModuleArtifact() " + obj);
- ModuleArtifactAdapter[] adapters = getModuleArtifactAdapters();
- if (adapters != null) {
- int size = adapters.length;
- for (int i = 0; i < size; i++) {
- try {
- if (adapters[i].isEnabled(obj)) {
- IModuleArtifact ma = adapters[i].getModuleArtifact(obj);
- if (ma != null)
- return ma;
- /*if (Platform.getAdapterManager().hasAdapter(obj, MODULE_ARTIFACT_CLASS)) {
- return (IModuleArtifact) Platform.getAdapterManager().loadAdapter(obj, MODULE_ARTIFACT_CLASS);
- }*/
- }
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Could not use moduleArtifactAdapter " + adapters[i], e);
- }
- }
- }
-
- return null;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerPreferences.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerPreferences.java
deleted file mode 100644
index d75255c..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerPreferences.java
+++ /dev/null
@@ -1,291 +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.core.internal;
-
-import org.eclipse.core.runtime.*;
-/**
- * Helper class that stores preference information for server tools.
- */
-public class ServerPreferences {
- private static final String PREF_AUTO_RESTART = "auto-restart";
- private static final String PREF_AUTO_PUBLISH = "auto-publish";
- private static final String PREF_CREATE_IN_WORKSPACE = "create-workspace";
- private static final String PREF_STARTUP_TIMEOUT = "start-timeout";
- private static final String PREF_RESTART_MODULE_TIMEOUT = "restart-module-timeout";
- private static final String PREF_MODULE_START_TIMEOUT = "module-start-timeout";
-
- private static final String PREF_AUTO_PUBLISH_LOCAL = "auto-publish-local";
- private static final String PREF_AUTO_PUBLISH_LOCAL_TIME = "auto-publish-local-time";
- private static final String PREF_AUTO_PUBLISH_REMOTE = "auto-publish-remote";
- private static final String PREF_AUTO_PUBLISH_REMOTE_TIME = "auto-publish-remote-time";
-
- private Preferences preferences;
-
- protected static ServerPreferences instance;
-
- /**
- * ServerPreference constructor comment.
- */
- private ServerPreferences() {
- super();
- preferences = ServerPlugin.getInstance().getPluginPreferences();
- }
-
- public static ServerPreferences getInstance() {
- if (instance == null)
- instance = new ServerPreferences();
- return instance;
- }
-
- /**
- * Returns whether servers will be automatically restarted when
- * required.
- *
- * @return boolean
- */
- public boolean isAutoRestarting() {
- return preferences.getBoolean(PREF_AUTO_RESTART);
- }
-
- /**
- * Returns whether servers will be automatically restarted when
- * required.
- *
- * @return boolean
- */
- public boolean isDefaultAutoRestarting() {
- return false;
- }
-
- /**
- * Returns whether publishing should occur before starting the
- * server.
- *
- * @return boolean
- */
- public boolean isAutoPublishing() {
- return preferences.getBoolean(PREF_AUTO_PUBLISH);
- }
-
- /**
- * Returns whether publishing should occur before starting the
- * server.
- *
- * @return boolean
- */
- public boolean isDefaultAutoPublishing() {
- return true;
- }
-
- /**
- * Returns whether servers and configurations should be created in the
- * workspace (as opposed to in metadata).
- *
- * @return boolean
- */
- public boolean isCreateResourcesInWorkspace() {
- return preferences.getBoolean(PREF_CREATE_IN_WORKSPACE);
- }
-
- /**
- * Returns whether servers and configurations should be created in the
- * workspace (as opposed to in metadata) by default.
- *
- * @return boolean
- */
- public boolean isDefaultCreateResourcesInWorkspace() {
- return false;
- }
-
- /**
- * Set whether servers and configurations should be created in the
- * workspace (as opposed to in metadata).
- *
- * @param b
- */
- public void setCreateResourcesInWorkspace(boolean b) {
- preferences.setValue(PREF_CREATE_IN_WORKSPACE, b);
- ServerPlugin.getInstance().savePluginPreferences();
- }
-
- /**
- * Set whether servers will be automatically restarted when
- * they need a restart.
- *
- * @param value
- */
- public void setAutoRestarting(boolean value) {
- preferences.setValue(PREF_AUTO_RESTART, value);
- ServerPlugin.getInstance().savePluginPreferences();
- }
-
- /**
- * Set whether publishing should happen before the server starts.
- *
- * @param value
- */
- public void setAutoPublishing(boolean value) {
- preferences.setValue(PREF_AUTO_PUBLISH, value);
- ServerPlugin.getInstance().savePluginPreferences();
- }
-
- public int getStartupTimeout() {
- return preferences.getInt(PREF_STARTUP_TIMEOUT);
- }
-
- public int getRestartModuleTimeout() {
- return preferences.getInt(PREF_RESTART_MODULE_TIMEOUT);
- }
-
- public int getModuleStartTimeout() {
- return preferences.getInt(PREF_MODULE_START_TIMEOUT);
- }
-
- /**
- * Returns the default setting for local auto-publishing.
- *
- * @return int
- */
- public boolean getDefaultAutoPublishLocal() {
- return false;
- }
-
- /**
- * Returns the setting for local auto-publishing.
- *
- * @return int
- */
- public boolean getAutoPublishLocal() {
- return preferences.getBoolean(PREF_AUTO_PUBLISH_LOCAL);
- }
-
- /**
- * Sets the value for local auto-publishing.
- *
- * @param auto
- */
- public void setAutoPublishLocal(boolean auto) {
- preferences.setValue(PREF_AUTO_PUBLISH_LOCAL, auto);
- ServerPlugin.getInstance().savePluginPreferences();
- }
-
- /**
- * Returns the default setting for local auto-publishing.
- *
- * @return int
- */
- public int getDefaultAutoPublishLocalTime() {
- return 15;
- }
-
- /**
- * Returns the setting for local auto-publishing.
- *
- * @return int
- */
- public int getAutoPublishLocalTime() {
- return preferences.getInt(PREF_AUTO_PUBLISH_LOCAL_TIME);
- }
-
- /**
- * Sets the value for local auto-publishing.
- *
- * @param auto
- */
- public void setAutoPublishLocalTime(int auto) {
- preferences.setValue(PREF_AUTO_PUBLISH_LOCAL_TIME, auto);
- ServerPlugin.getInstance().savePluginPreferences();
- }
-
- /**
- * Returns the default setting for remote auto-publishing.
- *
- * @return int
- */
- public boolean getDefaultAutoPublishRemote() {
- return false;
- }
-
- /**
- * Returns the setting for remote auto-publishing.
- *
- * @return int
- */
- public boolean getAutoPublishRemote() {
- return preferences.getBoolean(PREF_AUTO_PUBLISH_REMOTE);
- }
-
- /**
- * Sets the value for remote auto-publishing.
- *
- * @param auto
- */
- public void setAutoPublishRemote(boolean auto) {
- preferences.setValue(PREF_AUTO_PUBLISH_REMOTE, auto);
- ServerPlugin.getInstance().savePluginPreferences();
- }
-
- /**
- * Returns the default setting for remote auto-publishing.
- *
- * @return int
- */
- public int getDefaultAutoPublishRemoteTime() {
- return 60;
- }
-
- /**
- * Returns the setting for remote auto-publishing.
- *
- * @return int
- */
- public int getAutoPublishRemoteTime() {
- return preferences.getInt(PREF_AUTO_PUBLISH_REMOTE_TIME);
- }
-
- /**
- * Sets the value for remote auto-publishing.
- *
- * @param auto
- */
- public void setAutoPublishRemoteTime(int auto) {
- preferences.setValue(PREF_AUTO_PUBLISH_REMOTE_TIME, auto);
- ServerPlugin.getInstance().savePluginPreferences();
- }
-
- public void setDefaults() {
- preferences.setDefault(PREF_AUTO_PUBLISH, isDefaultAutoPublishing());
- preferences.setDefault(PREF_AUTO_RESTART, isDefaultAutoRestarting());
- preferences.setDefault(PREF_STARTUP_TIMEOUT, 210001);
-
- preferences.setDefault(PREF_AUTO_PUBLISH_LOCAL, getDefaultAutoPublishLocal());
- preferences.setDefault(PREF_AUTO_PUBLISH_LOCAL_TIME, getDefaultAutoPublishLocalTime());
- preferences.setDefault(PREF_AUTO_PUBLISH_REMOTE, getDefaultAutoPublishRemote());
- preferences.setDefault(PREF_AUTO_PUBLISH_REMOTE_TIME, getDefaultAutoPublishRemoteTime());
-
- preferences.setDefault(PREF_RESTART_MODULE_TIMEOUT, 120001);
- preferences.setDefault(PREF_MODULE_START_TIMEOUT, 300001);
- boolean save = false;
- if (preferences.isDefault(PREF_STARTUP_TIMEOUT)) {
- preferences.setValue(PREF_STARTUP_TIMEOUT, 210000);
- save = true;
- }
- if (preferences.isDefault(PREF_RESTART_MODULE_TIMEOUT)) {
- preferences.setValue(PREF_RESTART_MODULE_TIMEOUT, 120000);
- save = true;
- } if (preferences.isDefault(PREF_MODULE_START_TIMEOUT)) {
- preferences.setValue(PREF_MODULE_START_TIMEOUT, 300000);
- save = true;
- }
- if (save)
- ServerPlugin.getInstance().savePluginPreferences();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerPublishInfo.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerPublishInfo.java
deleted file mode 100644
index ec1634c..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerPublishInfo.java
+++ /dev/null
@@ -1,337 +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.core.internal;
-
-import java.io.File;
-import java.util.*;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.ServerUtil;
-import org.eclipse.wst.server.core.model.*;
-/**
- * Helper to obtain and store the publishing information (what files
- * were published and when) for a single server.
- */
-public class ServerPublishInfo {
- protected IPath path;
-
- // map of module ids to ModulePublishInfo
- protected Map modulePublishInfo;
-
- /**
- * ServerPublishInfo constructor comment.
- */
- protected ServerPublishInfo(IPath path) {
- super();
-
- this.path = path;
- modulePublishInfo = new HashMap();
- load();
- }
-
- private String getKey(IModule[] parents, IModule module) {
- StringBuffer sb = new StringBuffer();
-
- if (parents != null) {
- int size = parents.length;
- for (int i = 0; i < size; i++) {
- sb.append(parents[i].getId());
- sb.append("#");
- }
- }
-
- sb.append(module.getId());
- return sb.toString();
- }
-
- private String getKey(String parentIds, String moduleId) {
- StringBuffer sb = new StringBuffer();
-
- if (parentIds != null && parentIds.length() > 0) {
- sb.append(parentIds);
- sb.append("#");
- }
-
- sb.append(moduleId);
- return sb.toString();
- }
-
- private String getParentsId(IModule[] parents) {
- StringBuffer sb = new StringBuffer();
-
- if (parents != null) {
- int size = parents.length;
- for (int i = 0; i < size; i++) {
- sb.append(parents[i].getId());
- sb.append("#");
- }
- }
-
- return sb.toString();
- }
-
- private IModule[] getParents(String parentIds) {
- if (parentIds == null || parentIds.length() == 0)
- return new IModule[0];
-
- List list = new ArrayList();
- StringTokenizer st = new StringTokenizer(parentIds, "#");
- while (st.hasMoreTokens()) {
- String parentId = st.nextToken();
- if (parentId != null && parentId.length() > 0) {
- list.add(ServerUtil.getModule(parentId));
- }
- }
-
- IModule[] parents = new IModule[list.size()];
- list.toArray(parents);
- return parents;
- }
-
- public boolean hasModulePublishInfo(IModule[] parents, IModule module) {
- String key = getKey(parents, module);
- return modulePublishInfo.containsKey(key);
- }
-
- public void removeModulePublishInfo(IModule[] parents, IModule module) {
- String key = getKey(parents, module);
- modulePublishInfo.remove(key);
- }
-
- /**
- * Return the publish state.
- */
- public ModulePublishInfo getModulePublishInfo(IModule[] parents, IModule module) {
- String key = getKey(parents, module);
-
- // check if it now exists
- if (modulePublishInfo.containsKey(key))
- return (ModulePublishInfo) modulePublishInfo.get(key);
-
- // have to create a new one
- ModulePublishInfo mpi = new ModulePublishInfo(getParentsId(parents), module.getId());
- modulePublishInfo.put(key, mpi);
- return mpi;
- }
-
- public void addRemovedModules(List parentList, List moduleList, List kindList) {
- int size = parentList.size();
- List removed = new ArrayList();
- Iterator iterator = modulePublishInfo.keySet().iterator();
- while (iterator.hasNext()) {
- String key = (String) iterator.next();
-
- boolean found = false;
- for (int i = 0; i < size; i++) {
- IModule[] parents = (IModule[]) parentList.get(i);
- IModule module = (IModule) moduleList.get(i);
- String key2 = getKey(parents, module);
- if (key.equals(key2))
- found = true;
- }
- if (!found) {
- ModulePublishInfo mpi = (ModulePublishInfo) modulePublishInfo.get(key);
- removed.add(mpi);
- }
- }
-
- iterator = removed.iterator();
- while (iterator.hasNext()) {
- ModulePublishInfo mpi = (ModulePublishInfo) iterator.next();
- IModule[] parents2 = getParents(mpi.getParentsId());
- String moduleId = mpi.getModuleId();
- IModule module2 = ServerUtil.getModule(moduleId);
- if (module2 == null) {
- module2 = new DeletedModule(moduleId);
- /*int index = moduleId.indexOf(":");
- if (index > 0) {
- String moduleSubId = moduleId.substring(index+1);
- module2 = new DeletedModule(moduleSubId);
- }*/
- }
- if (module2 != null) {
- parentList.add(parents2);
- moduleList.add(module2);
- kindList.add(new Integer(IServer.REMOVED));
- }
- }
- }
-
- /**
- *
- */
- public void load() {
- String filename = path.toOSString();
- if (!(new File(filename).exists()))
- return;
-
- Trace.trace(Trace.FINEST, "Loading publish info from " + filename);
-
- try {
- IMemento memento2 = XMLMemento.loadMemento(filename);
- IMemento[] children = memento2.getChildren("module");
-
- int size = children.length;
- for (int i = 0; i < size; i++) {
- ModulePublishInfo mpi = new ModulePublishInfo(children[i]);
- modulePublishInfo.put(getKey(mpi.getParentsId(), mpi.getModuleId()), mpi);
- }
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Could not load publish information: " + e.getMessage());
- }
- }
-
- /**
- *
- */
- public void save() {
- String filename = path.toOSString();
- Trace.trace(Trace.FINEST, "Saving publish info to " + filename);
-
- try {
- XMLMemento memento = XMLMemento.createWriteRoot("server");
-
- Iterator iterator = modulePublishInfo.keySet().iterator();
- while (iterator.hasNext()) {
- String controlRef = (String) iterator.next();
- ModulePublishInfo mpi = (ModulePublishInfo) modulePublishInfo.get(controlRef);
- IMemento child = memento.createChild("module");
- mpi.save(child);
- }
- memento.saveToFile(filename);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not save publish information", e);
- }
- }
-
- public void fill(IModule[] parents, IModule module) {
- ModulePublishInfo mpi = getModulePublishInfo(parents, module);
- ModuleDelegate pm = (ModuleDelegate) module.getAdapter(ModuleDelegate.class);
- try {
- mpi.setResources(pm.members());
- } catch (CoreException ce) {
- // ignore
- }
- }
-
- public IModuleResourceDelta[] getDelta(IModule[] parents, IModule module) {
- ModulePublishInfo mpi = getModulePublishInfo(parents, module);
- ModuleDelegate pm = (ModuleDelegate) module.getAdapter(ModuleDelegate.class);
- IModuleResource[] resources = null;
- try {
- resources = pm.members();
- } catch (CoreException ce) {
- // ignore
- }
- if (resources == null)
- resources = new IModuleResource[0];
- return getDelta(mpi.getResources(), resources);
- }
-
- protected IModuleResourceDelta[] getDelta(IModuleResource[] original, IModuleResource[] current) {
- if (original == null || current == null)
- return new IModuleResourceDelta[0];
-
- List list = new ArrayList();
-
- // look for duplicates
- List found = new ArrayList();
- int size = original.length;
- int size2 = current.length;
- for (int i = 0; i < size; i++) {
- for (int j = 0; j < size2; j++) {
- if (!found.contains(original[i]) && !found.contains(current[j]) && original[i].equals(current[j])) {
- // found a match
- found.add(original[i]);
- if (original[i] instanceof IModuleFile) {
- // include files only if the modification stamp has changed
- IModuleFile mf1 = (IModuleFile) original[i];
- IModuleFile mf2 = (IModuleFile) current[j];
- if (mf1.getModificationStamp() != mf2.getModificationStamp()) {
- list.add(new ModuleResourceDelta(original[i], IModuleResourceDelta.CHANGED));
- }
- } else {
- // include folders only if their contents have changed
- IModuleFolder mf1 = (IModuleFolder) original[i];
- IModuleFolder mf2 = (IModuleFolder) current[j];
- IModuleResourceDelta[] mrdc = getDelta(mf1.members(), mf2.members());
- if (mrdc.length > 0) {
- ModuleResourceDelta mrd = new ModuleResourceDelta(original[i], IModuleResourceDelta.NO_CHANGE);
- mrd.setChildren(mrdc);
- list.add(mrd);
- }
- }
- }
- }
- }
-
- // add deletions (unfound items in the original list)
- for (int i = 0; i < size; i++) {
- if (!found.contains(original[i])) {
- if (original[i] instanceof IModuleFile) {
- list.add(new ModuleResourceDelta(original[i], IModuleResourceDelta.REMOVED));
- } else {
- IModuleFolder mf = (IModuleFolder) original[i];
- ModuleResourceDelta mrd = new ModuleResourceDelta(original[i], IModuleResourceDelta.REMOVED);
- IModuleResourceDelta[] mrdc = getDeltaTree(mf.members(), IModuleResourceDelta.REMOVED);
- mrd.setChildren(mrdc);
- list.add(mrd);
- }
- }
- }
-
- // add additions (unfound items in the current list)
- for (int j = 0; j < size2; j++) {
- if (!found.contains(current[j])) {
- if (current[j] instanceof IModuleFile) {
- list.add(new ModuleResourceDelta(current[j], IModuleResourceDelta.ADDED));
- } else {
- IModuleFolder mf = (IModuleFolder) current[j];
- ModuleResourceDelta mrd = new ModuleResourceDelta(current[j], IModuleResourceDelta.ADDED);
- IModuleResourceDelta[] mrdc = getDeltaTree(mf.members(), IModuleResourceDelta.ADDED);
- mrd.setChildren(mrdc);
- list.add(mrd);
- }
- }
- }
-
- IModuleResourceDelta[] delta = new IModuleResourceDelta[list.size()];
- list.toArray(delta);
- return delta;
- }
-
- /**
- * Create a resource delta for an entire tree.
- */
- protected IModuleResourceDelta[] getDeltaTree(IModuleResource[] resources, int kind) {
- if (resources == null)
- return new IModuleResourceDelta[0];
-
- List list = new ArrayList();
-
- // look for duplicates
- int size = resources.length;
- for (int i = 0; i < size; i++) {
- ModuleResourceDelta mrd = new ModuleResourceDelta(resources[i], kind);
- if (resources[i] instanceof IModuleFolder) {
- IModuleFolder mf = (IModuleFolder) resources[i];
- mrd.setChildren(getDeltaTree(mf.members(), kind));
- }
- list.add(mrd);
- }
-
- IModuleResourceDelta[] delta = new IModuleResourceDelta[list.size()];
- list.toArray(delta);
- return delta;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerSchedulingRule.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerSchedulingRule.java
deleted file mode 100644
index 9a5aaf2..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerSchedulingRule.java
+++ /dev/null
@@ -1,44 +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.core.internal;
-
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.wst.server.core.IServer;
-/**
- * Simple job scheduling rule that stops a server from starting,
- * publishing, or stopping at the same time.
- */
-public class ServerSchedulingRule implements ISchedulingRule {
- protected IServer server;
-
- public ServerSchedulingRule(IServer server) {
- this.server = server;
- }
-
- public boolean contains(ISchedulingRule rule) {
- if (!(rule instanceof ServerSchedulingRule))
- return false;
-
- return true;
- }
-
- public boolean isConflicting(ISchedulingRule rule) {
- if (!(rule instanceof ServerSchedulingRule))
- return false;
-
- ServerSchedulingRule ssrule = (ServerSchedulingRule) rule;
- return ssrule.server.equals(server);
- }
-
- public String toString() {
- return "Server scheduling rule for " + server;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerTask.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerTask.java
deleted file mode 100644
index 9466c19..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerTask.java
+++ /dev/null
@@ -1,94 +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.core.internal;
-
-import java.util.List;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-
-import org.eclipse.wst.server.core.*;
-import org.eclipse.wst.server.core.model.*;
-/**
- *
- */
-public class ServerTask implements IServerTask {
- private IConfigurationElement element;
- private ServerTaskDelegate delegate;
-
- /**
- * ServerTask constructor comment.
- */
- public ServerTask(IConfigurationElement element) {
- super();
- this.element = element;
- }
-
- /*
- * @see
- */
- public String getId() {
- return element.getAttribute("id");
- }
-
- /*
- * @see
- */
- protected String[] getTypeIds() {
- try {
- return ServerPlugin.tokenize(element.getAttribute("typeIds"), ",");
- } catch (Exception e) {
- return null;
- }
- }
-
- /*
- * @see
- */
- public boolean supportsType(String id) {
- return ServerPlugin.supportsType(getTypeIds(), id);
- }
-
- /*
- * @see IServerTask#getDelegate()
- */
- public ServerTaskDelegate getDelegate() {
- if (delegate == null) {
- try {
- delegate = (ServerTaskDelegate) element.createExecutableExtension("class");
- } catch (Throwable t) {
- Trace.trace(Trace.SEVERE, "Could not create delegate" + toString() + ": " + t.getMessage());
- }
- }
- return delegate;
- }
-
- /*
- * @see
- */
- public IOptionalTask[] getTasks(IServer server, List[] parents, IModule[] modules) {
- try {
- Trace.trace(Trace.FINEST, "Task.init " + this);
- return getDelegate().getTasks(server, parents, modules);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error calling delegate " + toString() + ": " + e.getMessage());
- }
- return new IOptionalTask[0];
- }
-
- /**
- * Return a string representation of this object.
- *
- * @return java.lang.String
- */
- public String toString() {
- return "ServerTask[" + getId() + "]";
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerType.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerType.java
deleted file mode 100644
index 41b2452..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerType.java
+++ /dev/null
@@ -1,298 +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.core.internal;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.debug.core.ILaunchManager;
-
-import org.eclipse.wst.server.core.*;
-/**
- *
- */
-public class ServerType implements IServerType, IOrdered {
- protected IConfigurationElement element;
-
- /**
- * ServerType constructor comment.
- */
- public ServerType(IConfigurationElement element) {
- super();
- this.element = element;
- }
-
- protected IConfigurationElement getElement() {
- return element;
- }
-
- /**
- * Returns the id of this factory.
- *
- * @return java.lang.String
- */
- public String getId() {
- return element.getAttribute("id");
- }
-
- public String getName() {
- return element.getAttribute("name");
- }
-
- public String getDescription() {
- return element.getAttribute("description");
- }
-
- public IRuntimeType getRuntimeType() {
- String typeId = element.getAttribute("runtimeTypeId");
- if (typeId == null)
- return null;
- return ServerCore.findRuntimeType(typeId);
- }
-
- public boolean hasRuntime() {
- String s = element.getAttribute("runtime");
- return "true".equals(s);
- }
-
- /**
- * Returns the order.
- *
- * @return int
- */
- public int getOrder() {
- try {
- String o = element.getAttribute("order");
- return Integer.parseInt(o);
- } catch (NumberFormatException e) {
- return -1;
- }
- }
-
- protected ILaunchConfigurationType getLaunchConfigurationType() {
- String launchConfigId = element.getAttribute("launchConfigId");
- if (launchConfigId == null)
- return null;
- ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
- return launchManager.getLaunchConfigurationType(launchConfigId);
- }
-
- /**
- * Returns true if this server can start or may already be started
- * in the given mode, and false if not. Uses the launchMode attribute,
- * which may contain the strings "run", "debug", and/or "profile".
- *
- * @param launchMode String
- * @return boolean
- */
- public boolean supportsLaunchMode(String launchMode) {
- ILaunchConfigurationType configType = getLaunchConfigurationType();
- if (configType == null) {
- String mode = element.getAttribute("launchModes");
- if (mode == null)
- return false;
- return mode.indexOf(launchMode) >= 0;
- }
- return configType.supportsMode(launchMode);
- }
-
- /*public IServerConfigurationType getServerConfigurationType() {
- String configurationTypeId = element.getAttribute("configurationTypeId");
- return ServerCore.findServerConfigurationType(configurationTypeId);
- }*/
-
- public boolean supportsRemoteHosts() {
- String hosts = element.getAttribute("supportsRemoteHosts");
- return (hosts != null && hosts.toLowerCase().equals("true"));
- }
-
- public byte getInitialState() {
- String stateString = element.getAttribute("initialState");
- if (stateString != null)
- stateString = stateString.toLowerCase();
- if ("stopped".equals(stateString))
- return IServer.STATE_STOPPED;
- else if ("started".equals(stateString))
- return IServer.STATE_STARTED;
- return IServer.STATE_UNKNOWN;
- }
-
- public int getServerStateSet() {
- String stateSet = element.getAttribute("stateSet");
- if (stateSet == null)
- return SERVER_STATE_SET_MANAGED;
- else if (stateSet.toLowerCase().indexOf("attach") >= 0)
- return SERVER_STATE_SET_ATTACHED;
- else if (stateSet.toLowerCase().indexOf("publish") >= 0)
- return SERVER_STATE_SET_PUBLISHED;
- else
- return SERVER_STATE_SET_MANAGED;
- }
-
- public boolean hasServerConfiguration() {
- return ("true".equalsIgnoreCase(element.getAttribute("hasConfiguration")));
- }
-
- public IServerWorkingCopy createServer(String id, IFile file, IRuntime runtime, IProgressMonitor monitor) throws CoreException {
- if (id == null || id.length() == 0)
- id = ServerPlugin.generateId();
- ServerWorkingCopy swc = new ServerWorkingCopy(id, file, runtime, this);
- swc.setDefaults(monitor);
- swc.setRuntime(runtime);
-
- // TODO
- if (swc.getServerType().hasServerConfiguration())
- ((Server)swc).importConfiguration(runtime, null);
-
- return swc;
- }
-
- /**
- * Returns an array of all known runtime instances of
- * the given runtime type. This convenience method filters the list of known
- * runtime ({@link ServerCore#getRuntimes()}) for ones with a matching
- * runtime type ({@link IRuntime#getRuntimeType()}). The array will not
- * contain any working copies.
- * <p>
- * A new array is returned on each call, so clients may store or modify the result.
- * </p>
- *
- * @param runtimeType the runtime type
- * @return a possibly-empty list of runtime instances {@link IRuntime}
- * of the given runtime type
- */
- protected static IRuntime[] getRuntimes(IRuntimeType runtimeType) {
- List list = new ArrayList();
- IRuntime[] runtimes = ServerCore.getRuntimes();
- if (runtimes != null) {
- int size = runtimes.length;
- for (int i = 0; i < size; i++) {
- if (runtimes[i].getRuntimeType() != null && runtimes[i].getRuntimeType().equals(runtimeType))
- list.add(runtimes[i]);
- }
- }
-
- IRuntime[] r = new IRuntime[list.size()];
- list.toArray(r);
- return r;
- }
-
- public IServerWorkingCopy createServer(String id, IFile file, IProgressMonitor monitor) throws CoreException {
- if (id == null || id.length() == 0)
- id = ServerPlugin.generateId();
-
- IRuntime runtime = null;
- if (hasRuntime()) {
- // look for existing runtime
- IRuntimeType runtimeType = getRuntimeType();
- IRuntime[] runtimes = getRuntimes(runtimeType);
- if (runtimes != null && runtimes.length > 0)
- runtime = runtimes[0];
- else {
- // create runtime
- try {
- IRuntimeWorkingCopy runtimeWC = runtimeType.createRuntime(id + "-runtime", monitor);
- ServerUtil.setRuntimeDefaultName(runtimeWC);
- runtime = runtimeWC;
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Couldn't create runtime", e);
- }
- }
- }
-
- ServerWorkingCopy swc = new ServerWorkingCopy(id, file, runtime, this);
- ServerUtil.setServerDefaultName(swc);
- if (runtime != null)
- swc.setRuntime(runtime);
-
- if (swc.getServerType().hasServerConfiguration())
- ((Server)swc).importConfiguration(runtime, null);
-
- swc.setDefaults(monitor);
-
- return swc;
- }
-
- public static IProject getServerProject() throws CoreException {
- IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
- if (projects != null) {
- int size = projects.length;
- for (int i = 0; i < size; i++) {
- if (((ProjectProperties)ServerCore.getProjectProperties(projects[i])).isServerProject())
- return projects[i];
- }
- }
-
- String s = findUnusedServerProjectName();
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(s);
- project.create(null);
- project.open(null);
- ((ProjectProperties)ServerCore.getProjectProperties(project)).setServerProject(true, null);
- return project;
- }
-
- /**
- * Finds an unused project name to use as a server project.
- *
- * @return java.lang.String
- */
- protected static String findUnusedServerProjectName() {
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- String name = ServerPlugin.getResource("%defaultServerProjectName", "");
- int count = 1;
- while (root.getProject(name).exists()) {
- name = ServerPlugin.getResource("%defaultServerProjectName", ++count + "");
- }
- return name;
- }
-
- /**
- * Return the timeout (in ms) that should be used to wait for the server to start.
- * Returns -1 if there is no timeout.
- *
- * @return the server startup timeout
- */
- public int getStartTimeout() {
- try {
- return Integer.parseInt(element.getAttribute("startTimeout"));
- } catch (NumberFormatException e) {
- return -1;
- }
- }
-
- /**
- * Return the timeout (in ms) to wait before assuming that the server
- * has failed to stop. Returns -1 if there is no timeout.
- *
- * @return the server shutdown timeout
- */
- public int getStopTimeout() {
- try {
- return Integer.parseInt(element.getAttribute("stopTimeout"));
- } catch (NumberFormatException e) {
- return -1;
- }
- }
-
- /**
- * Return a string representation of this object.
- *
- * @return java.lang.String
- */
- public String toString() {
- return "ServerType[" + getId() + "]";
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerWorkingCopy.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerWorkingCopy.java
deleted file mode 100644
index d17f8a9..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerWorkingCopy.java
+++ /dev/null
@@ -1,380 +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.core.internal;
-
-import java.beans.PropertyChangeListener;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.*;
-import org.eclipse.wst.server.core.*;
-import org.eclipse.wst.server.core.model.ServerDelegate;
-/**
- *
- */
-public class ServerWorkingCopy extends Server implements IServerWorkingCopy {
- protected Server server;
- protected WorkingCopyHelper wch;
-
- protected ServerDelegate workingCopyDelegate;
-
- // working copy
- public ServerWorkingCopy(Server server) {
- super(server.getFile());
- this.server = server;
-
- map = new HashMap(server.map);
- wch = new WorkingCopyHelper(this);
-
- resolve();
- }
-
- // creation
- public ServerWorkingCopy(String id, IFile file, IRuntime runtime, IServerType serverType) {
- super(id, file, runtime, serverType);
- //server = this;
- wch = new WorkingCopyHelper(this);
- wch.setDirty(true);
- serverState = ((ServerType)serverType).getInitialState();
- }
-
- public boolean isWorkingCopy() {
- return true;
- }
-
- public IServer getOriginal() {
- return server;
- }
-
- public IServerWorkingCopy createWorkingCopy() {
- return this;
- }
-
- public int getServerState() {
- if (server != null)
- return server.getServerState();
- return serverState;
- }
-
- public void setServerState(int state) {
- if (server != null)
- server.setServerState(state);
- else
- super.setServerState(state);
- }
-
- public int getServerPublishState() {
- if (server != null)
- return server.getServerPublishState();
- return serverState;
- }
-
- public void setServerPublishState(int state) {
- if (server != null)
- server.setServerPublishState(state);
- else
- super.setServerPublishState(state);
- }
-
- public String getMode() {
- if (server != null)
- return server.getMode();
- return mode;
- }
-
- public void setMode(String mode) {
- if (server != null)
- server.setMode(mode);
- else
- super.setMode(mode);
- }
-
- public void setAttribute(String attributeName, int value) {
- wch.setAttribute(attributeName, value);
- }
-
- public void setAttribute(String attributeName, boolean value) {
- wch.setAttribute(attributeName, value);
- }
-
- public void setAttribute(String attributeName, String value) {
- wch.setAttribute(attributeName, value);
- }
-
- public void setAttribute(String attributeName, List value) {
- wch.setAttribute(attributeName, value);
- }
-
- public void setAttribute(String attributeName, Map value) {
- wch.setAttribute(attributeName, value);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.server.core.IServerWorkingCopy#setName(java.lang.String)
- */
- public void setName(String name) {
- setAttribute(PROP_NAME, name);
- }
-
- public void setReadOnly(boolean b) {
- setAttribute(PROP_LOCKED, b);
- }
-
- public void setPrivate(boolean b) {
- setAttribute(PROP_PRIVATE, b);
- }
-
- public void setHost(String host) {
- setAttribute(PROP_HOSTNAME, host);
- }
-
- public void setAutoPublishTime(int p) {
- setAttribute(PROP_AUTO_PUBLISH_TIME, p);
- }
-
- public void setAutoPublishDefault(boolean p) {
- setAttribute(PROP_AUTO_PUBLISH_DEFAULT, p);
- }
-
- public void setServerConfiguration(IFolder config) {
- this.configuration = config;
- if (configuration == null)
- setAttribute(CONFIGURATION_ID, (String)null);
- else
- setAttribute(CONFIGURATION_ID, configuration.getFullPath().toString());
- }
-
- public void setFile(IFile file) {
- this.file = file;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.server.core.IServerWorkingCopy#isDirty()
- */
- public boolean isDirty() {
- return wch.isDirty();
- }
-
- public ServerDelegate getWorkingCopyDelegate(IProgressMonitor monitor) {
- // make sure that the regular delegate is loaded
- //getDelegate();
-
- if (workingCopyDelegate != null)
- return workingCopyDelegate;
-
- if (serverType != null) {
- synchronized (this) {
- if (workingCopyDelegate == null) {
- try {
- long time = System.currentTimeMillis();
- IConfigurationElement element = ((ServerType) serverType).getElement();
- workingCopyDelegate = (ServerDelegate) element.createExecutableExtension("class");
- workingCopyDelegate.initialize(this);
- Trace.trace(Trace.PERFORMANCE, "ServerWorkingCopy.getWorkingCopyDelegate(): <" + (System.currentTimeMillis() - time) + "> " + getServerType().getId());
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not create delegate " + toString(), e);
- }
- }
- }
- }
- return workingCopyDelegate;
- }
-
- public void dispose() {
- super.dispose();
- if (workingCopyDelegate != null)
- workingCopyDelegate.dispose();
- }
-
- public IServer save(boolean force, IProgressMonitor monitor) throws CoreException {
- monitor = ProgressUtil.getMonitorFor(monitor);
- monitor.subTask(ServerPlugin.getResource("%savingTask", getName()));
-
- if (!force && getOriginal() != null)
- wch.validateTimestamp(getOriginal().getTimestamp());
-
- if (server == null) {
- server = new Server(file);
- server.setServerState(serverState);
- server.publishListeners = publishListeners;
- server.serverListeners = serverListeners;
- }
-
- if (getServerType().hasServerConfiguration()) {
- IFolder folder = getServerConfiguration();
- if (folder == null) {
- folder = ServerType.getServerProject().getFolder(getName() + "-config");
- if (!folder.exists())
- folder.create(true, true, null);
- setServerConfiguration(folder);
- }
- }
-
- server.setInternal(this);
- server.doSave(monitor);
- if (getServerType().hasServerConfiguration()) {
- IFolder folder = getServerConfiguration();
- if (folder != null) {
- IProject project = folder.getProject();
- if (project != null && !project.exists()) {
- project.create(null);
- project.open(null);
- ((ProjectProperties)ServerCore.getProjectProperties(project)).setServerProject(true, monitor);
- }
- if (!folder.exists())
- folder.create(IResource.FORCE, true, null);
- }
- }
- getDelegate().saveConfiguration(monitor);
- wch.setDirty(false);
-
- return server;
- }
-
- public IServer saveAll(boolean force, IProgressMonitor monitor) throws CoreException {
- if (runtime != null && runtime.isWorkingCopy()) {
- IRuntimeWorkingCopy wc = (IRuntimeWorkingCopy) runtime;
- wc.save(force, monitor);
- }
-
- return save(force, monitor);
- }
-
- /**
- * Add a property change listener to this server.
- *
- * @param listener java.beans.PropertyChangeListener
- */
- public void addPropertyChangeListener(PropertyChangeListener listener) {
- wch.addPropertyChangeListener(listener);
- }
-
- /**
- * Remove a property change listener from this server.
- *
- * @param listener java.beans.PropertyChangeListener
- */
- public void removePropertyChangeListener(PropertyChangeListener listener) {
- wch.removePropertyChangeListener(listener);
- }
-
- /**
- * Fire a property change event.
- */
- public void firePropertyChangeEvent(String propertyName, Object oldValue, Object newValue) {
- wch.firePropertyChangeEvent(propertyName, oldValue, newValue);
- }
-
- public void addServerListener(IServerListener listener) {
- if (server != null)
- server.addServerListener(listener);
- else
- super.addServerListener(listener);
- }
-
- public void removeServerListener(IServerListener listener) {
- if (server != null)
- server.removeServerListener(listener);
- else
- super.removeServerListener(listener);
- }
-
- public void addPublishListener(IPublishListener listener) {
- if (server != null)
- server.addPublishListener(listener);
- else
- super.addPublishListener(listener);
- }
-
- public void removePublishListener(IPublishListener listener) {
- if (server != null)
- server.removePublishListener(listener);
- else
- super.removePublishListener(listener);
- }
-
- public void setRuntime(IRuntime runtime) {
- this.runtime = runtime;
- if (runtime != null)
- setAttribute(RUNTIME_ID, runtime.getId());
- else
- setAttribute(RUNTIME_ID, (String)null);
- }
-
- public void setRuntimeId(String runtimeId) {
- setAttribute(RUNTIME_ID, runtimeId);
- resolve();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.server.core.IServer#modifyModule(org.eclipse.wst.server.core.model.IModule)
- */
- public void modifyModules(IModule[] add, IModule[] remove, IProgressMonitor monitor) throws CoreException {
- try {
- monitor = ProgressUtil.getMonitorFor(monitor);
- monitor.subTask(ServerPlugin.getResource("%taskModifyModules"));
- getWorkingCopyDelegate(monitor).modifyModules(add, remove, monitor);
- wch.setDirty(true);
-
- // trigger load of modules list
- getModules();
-
- if (add != null) {
- int size = add.length;
- for (int i = 0; i < size; i++) {
- if (!modules.contains(add[i]))
- modules.add(add[i]);
- }
- }
-
- if (remove != null) {
- int size = remove.length;
- for (int i = 0; i < size; i++) {
- if (modules.contains(remove[i]))
- modules.remove(remove[i]);
- }
- }
-
- // convert to attribute
- List list = new ArrayList();
- Iterator iterator = modules.iterator();
- while (iterator.hasNext()) {
- IModule module = (IModule) iterator.next();
- list.add(module.getId());
- }
- setAttribute(MODULE_LIST, list);
- } catch (CoreException ce) {
- throw ce;
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error calling delegate modifyModule() " + toString(), e);
- throw new CoreException(new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0, e.getLocalizedMessage(), e));
- }
- }
-
- public void setDefaults(IProgressMonitor monitor) {
- try {
- getWorkingCopyDelegate(monitor).setDefaults();
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error calling delegate setDefaults() " + toString(), e);
- }
- }
-
- public String toString() {
- return "ServerWorkingCopy " + getId();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Trace.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Trace.java
deleted file mode 100644
index daf2ba5..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Trace.java
+++ /dev/null
@@ -1,97 +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.core.internal;
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-/**
- * Helper class to route trace output.
- */
-public class Trace {
- public static int CONFIG = 0;
- public static int INFO = 1;
- public static int WARNING = 2;
- public static int SEVERE = 3;
- public static int FINER = 4;
- public static int FINEST = 5;
-
- public static int RESOURCES = 6;
- public static int EXTENSION_POINT = 7;
- public static int LISTENERS = 8;
- public static int RUNTIME_TARGET = 9;
- public static int PERFORMANCE = 10;
-
- private static final String[] levelNames = new String[] {
- "CONFIG ", "INFO ", "WARNING ", "SEVERE ", "FINER ", "FINEST ",
- "RESOURCES", "EXTENSION", "LISTENERS", "TARGET ", "PERF "};
- private static final String spacer = " ";
-
- private static final SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yy HH:mm.ss.SSS");
-
- protected static int pluginLength = -1;
-
- /**
- * Trace constructor comment.
- */
- private Trace() {
- super();
- }
-
- /**
- * Trace the given text.
- *
- * @param s java.lang.String
- */
- public static void trace(int level, String s) {
- trace(level, s, null);
- }
-
- /**
- * Trace the given message and exception.
- *
- * @param s java.lang.String
- * @param t java.lang.Throwable
- */
- public static void trace(int level, String s, Throwable t) {
- trace(ServerPlugin.PLUGIN_ID, level, s, t);
- }
-
- /**
- * Trace the given message and exception.
- *
- * @param s java.lang.String
- * @param t java.lang.Throwable
- */
- private static void trace(String pluginId, int level, String s, Throwable t) {
- if (pluginId == null || s == null)
- return;
-
- if (!ServerPlugin.getInstance().isDebugging())
- return;
-
- StringBuffer sb = new StringBuffer(pluginId);
- if (pluginId.length() > pluginLength)
- pluginLength = pluginId.length();
- else if (pluginId.length() < pluginLength)
- sb.append(spacer.substring(0, pluginLength - pluginId.length()));
- sb.append(" ");
- sb.append(levelNames[level]);
- sb.append(" ");
- sb.append(sdf.format(new Date()));
- sb.append(" ");
- sb.append(s);
- //Platform.getDebugOption(ServerCore.PLUGIN_ID + "/" + "resources");
-
- System.out.println(sb.toString());
- if (t != null)
- t.printStackTrace();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/WorkingCopyHelper.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/WorkingCopyHelper.java
deleted file mode 100644
index 5592828..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/WorkingCopyHelper.java
+++ /dev/null
@@ -1,166 +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.core.internal;
-
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.server.core.IServerWorkingCopy;
-/**
- *
- */
-public class WorkingCopyHelper {
- protected Base base;
- protected boolean isDirty;
-
- // property change listeners
- private transient List propertyListeners;
-
- public WorkingCopyHelper(Base base) {
- this.base = base;
- }
-
- public void setAttribute(String attributeName, int value) {
- int current = base.getAttribute(attributeName, 0);
- if (current != 0 && current == value)
- return;
-
- isDirty = true;
- base.map.put(attributeName, Integer.toString(value));
- firePropertyChangeEvent(attributeName, new Integer(current), new Integer(value));
- }
-
- public void setAttribute(String attributeName, boolean value) {
- boolean current = base.getAttribute(attributeName, false);
-
- isDirty = true;
- base.map.put(attributeName, Boolean.toString(value));
- firePropertyChangeEvent(attributeName, new Boolean(current), new Boolean(value));
- }
-
- public void setAttribute(String attributeName, String value) {
- String current = base.getAttribute(attributeName, (String)null);
- if (current != null && current.equals(value))
- return;
-
- isDirty = true;
- if (value == null)
- base.map.remove(attributeName);
- else
- base.map.put(attributeName, value);
- firePropertyChangeEvent(attributeName, current, value);
- }
-
- public void setAttribute(String attributeName, List value) {
- List current = base.getAttribute(attributeName, (List)null);
- if (current != null && current.equals(value))
- return;
-
- isDirty = true;
- if (value == null)
- base.map.remove(attributeName);
- else
- base.map.put(attributeName, value);
- firePropertyChangeEvent(attributeName, current, value);
- }
-
- public void setAttribute(String attributeName, Map value) {
- Map current = base.getAttribute(attributeName, (Map)null);
- if (current != null && current.equals(value))
- return;
-
- isDirty = true;
- if (value == null)
- base.map.remove(attributeName);
- else
- base.map.put(attributeName, value);
- firePropertyChangeEvent(attributeName, current, value);
- }
-
- public void setName(String name) {
- setAttribute(Base.PROP_NAME, name);
- }
-
- public void setLocked(boolean b) {
- setAttribute(Base.PROP_LOCKED, b);
- }
-
- public void setPrivate(boolean b) {
- setAttribute(Base.PROP_PRIVATE, b);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.server.core.IServerWorkingCopy#isDirty()
- */
- public boolean isDirty() {
- return isDirty;
- }
-
- protected void validateTimestamp(int timestamp) throws CoreException {
- if (base.getTimestamp() != timestamp)
- throw new CoreException(new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, IServerWorkingCopy.TIMESTAMP_ERROR, ServerPlugin.getResource("%errorWorkingCopyTimestamp"), null));
- }
-
- /**
- * Add a property change listener to this server.
- *
- * @param listener java.beans.PropertyChangeListener
- */
- public void addPropertyChangeListener(PropertyChangeListener listener) {
- if (propertyListeners == null)
- propertyListeners = new ArrayList(2);
- propertyListeners.add(listener);
- }
-
- /**
- * Remove a property change listener from this server.
- *
- * @param listener java.beans.PropertyChangeListener
- */
- public void removePropertyChangeListener(PropertyChangeListener listener) {
- if (propertyListeners != null)
- propertyListeners.remove(listener);
- }
-
- /**
- * Fire a property change event.
- */
- public void firePropertyChangeEvent(String propertyName, Object oldValue, Object newValue) {
- if (propertyListeners == null)
- return;
-
- PropertyChangeEvent event = new PropertyChangeEvent(this, propertyName, oldValue, newValue);
- try {
- Iterator iterator = propertyListeners.iterator();
- while (iterator.hasNext()) {
- try {
- PropertyChangeListener listener = (PropertyChangeListener) iterator.next();
- listener.propertyChange(event);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error firing property change event", e);
- }
- }
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error in property event", e);
- }
- }
-
- protected void setDirty(boolean dirty) {
- isDirty = dirty;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/XMLMemento.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/XMLMemento.java
deleted file mode 100644
index e92b3de..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/XMLMemento.java
+++ /dev/null
@@ -1,453 +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.core.internal;
-
-import java.io.*;
-import java.util.*;
-import java.net.URL;
-import org.w3c.dom.*;
-import org.xml.sax.*;
-
-import javax.xml.parsers.*;
-import javax.xml.transform.*;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-/**
- * A Memento is a class independent container for persistence
- * info. It is a reflection of 3 storage requirements.
- *
- * 1) We need the ability to persist an object and restore it.
- * 2) The class for an object may be absent. If so we would
- * like to skip the object and keep reading.
- * 3) The class for an object may change. If so the new class
- * should be able to read the old persistence info.
- *
- * We could ask the objects to serialize themselves into an
- * ObjectOutputStream, DataOutputStream, or Hashtable. However
- * all of these approaches fail to meet the second requirement.
- *
- * Memento supports binary persistance with a version ID.
- */
-public final class XMLMemento implements IMemento {
- private Document factory;
- private Element element;
-
- /**
- * Answer a memento for the document and element. For simplicity
- * you should use createReadRoot and createWriteRoot to create the initial
- * mementos on a document.
- */
- public XMLMemento(Document doc, Element el) {
- factory = doc;
- element = el;
- }
-
- /*
- * @see IMemento
- */
- public IMemento createChild(String type) {
- Element child = factory.createElement(type);
- element.appendChild(child);
- return new XMLMemento(factory, child);
- }
-
- /*
- * @see IMemento
- */
- public IMemento createChild(String type, String id) {
- Element child = factory.createElement(type);
- child.setAttribute(TAG_ID, id);
- element.appendChild(child);
- return new XMLMemento(factory, child);
- }
-
- /**
- * Create a Document from a Reader and answer a root memento for reading
- * a document.
- */
- protected static XMLMemento createReadRoot(Reader reader) {
- Document document = null;
- try {
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- DocumentBuilder parser = factory.newDocumentBuilder();
- document = parser.parse(new InputSource(reader));
- Node node = document.getFirstChild();
- if (node instanceof Element)
- return new XMLMemento(document, (Element) node);
- } catch (Exception e) {
- // ignore
- } finally {
- try {
- reader.close();
- } catch (Exception e) {
- // ignore
- }
- }
- return null;
- }
-
- /**
- * Answer a root memento for writing a document.
- */
- public static XMLMemento createWriteRoot(String type) {
- Document document;
- try {
- document = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
- Element element = document.createElement(type);
- document.appendChild(element);
- return new XMLMemento(document, element);
- } catch (ParserConfigurationException e) {
- throw new Error(e);
- }
- }
-
- /*
- * @see IMemento
- */
- public IMemento getChild(String type) {
- // Get the nodes.
- NodeList nodes = element.getChildNodes();
- int size = nodes.getLength();
- if (size == 0)
- return null;
-
- // Find the first node which is a child of this node.
- for (int nX = 0; nX < size; nX ++) {
- Node node = nodes.item(nX);
- if (node instanceof Element) {
- Element element2 = (Element)node;
- if (element2.getNodeName().equals(type))
- return new XMLMemento(factory, element2);
- }
- }
-
- // A child was not found.
- return null;
- }
-
- /*
- * @see IMemento
- */
- public IMemento [] getChildren(String type) {
- // Get the nodes.
- NodeList nodes = element.getChildNodes();
- int size = nodes.getLength();
- if (size == 0)
- return new IMemento[0];
-
- // Extract each node with given type.
- ArrayList list = new ArrayList(size);
- for (int nX = 0; nX < size; nX ++) {
- Node node = nodes.item(nX);
- if (node instanceof Element) {
- Element element2 = (Element)node;
- if (element2.getNodeName().equals(type))
- list.add(element2);
- }
- }
-
- // Create a memento for each node.
- size = list.size();
- IMemento [] results = new IMemento[size];
- for (int x = 0; x < size; x ++) {
- results[x] = new XMLMemento(factory, (Element)list.get(x));
- }
- return results;
- }
-
- /**
- * Return the contents of this memento as a byte array.
- *
- * @return byte[]
- */
- public byte[] getContents() throws IOException {
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- save(out);
- return out.toByteArray();
- }
-
- /**
- * Returns an input stream for writing to the disk with a local locale.
- *
- * @return java.io.InputStream
- */
- public InputStream getInputStream() throws IOException {
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- save(out);
- return new ByteArrayInputStream(out.toByteArray());
- }
-
- /*
- * @see IMemento
- */
- public Float getFloat(String key) {
- Attr attr = element.getAttributeNode(key);
- if (attr == null)
- return null;
- String strValue = attr.getValue();
- try {
- return new Float(strValue);
- } catch (NumberFormatException e) {
- return null;
- }
- }
-
- /*
- * @see IMemento
- */
- public String getId() {
- return element.getAttribute(TAG_ID);
- }
-
- /*
- * @see IMemento
- */
- public String getName() {
- return element.getNodeName();
- }
-
- /*
- * @see IMemento
- */
- public Integer getInteger(String key) {
- Attr attr = element.getAttributeNode(key);
- if (attr == null)
- return null;
- String strValue = attr.getValue();
- try {
- return new Integer(strValue);
- } catch (NumberFormatException e) {
- return null;
- }
- }
-
- /*
- * @see IMemento
- */
- public String getString(String key) {
- Attr attr = element.getAttributeNode(key);
- if (attr == null)
- return null;
- return attr.getValue();
- }
-
- public List getNames() {
- NamedNodeMap map = element.getAttributes();
- int size = map.getLength();
- List list = new ArrayList();
- for (int i = 0; i < size; i++) {
- Node node = map.item(i);
- String name = node.getNodeName();
- list.add(name);
- }
- return list;
- }
-
- /**
- * Loads a memento from the given filename.
- *
- * @param in java.io.InputStream
- * @return org.eclipse.ui.IMemento
- * @exception java.io.IOException
- */
- public static IMemento loadMemento(InputStream in) {
- return createReadRoot(new InputStreamReader(in));
- }
-
- /**
- * Loads a memento from the given filename.
- *
- * @param in java.io.InputStream
- * @return org.eclipse.ui.IMemento
- * @exception java.io.IOException
- */
- public static IMemento loadCorruptMemento(InputStream in) {
- Document document = null;
- try {
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- DocumentBuilder parser = factory.newDocumentBuilder();
- document = parser.parse(in);
- Node node = document.getFirstChild();
- if (node instanceof Element)
- return new XMLMemento(document, (Element) node);
- } catch (Exception e) {
- // ignore
- } finally {
- try {
- in.close();
- } catch (Exception e) {
- // ignore
- }
- }
- return null;
- }
-
- /**
- * Loads a memento from the given filename.
- *
- * @param filename java.lang.String
- * @return org.eclipse.ui.IMemento
- * @exception java.io.IOException
- */
- public static IMemento loadMemento(String filename) throws IOException {
- return XMLMemento.createReadRoot(new FileReader(filename));
- }
-
- /**
- * Loads a memento from the given filename.
- *
- * @param url java.net.URL
- * @return org.eclipse.ui.IMemento
- * @exception java.io.IOException
- */
- public static IMemento loadMemento(URL url) throws IOException {
- return XMLMemento.createReadRoot(new InputStreamReader(url.openStream()));
- }
-
- /*
- * @see IMemento
- */
- private void putElement(Element element2) {
- NamedNodeMap nodeMap = element2.getAttributes();
- int size = nodeMap.getLength();
- for (int i = 0; i < size; i++){
- Attr attr = (Attr)nodeMap.item(i);
- putString(attr.getName(),attr.getValue());
- }
-
- NodeList nodes = element2.getChildNodes();
- size = nodes.getLength();
- for (int i = 0; i < size; i ++) {
- Node node = nodes.item(i);
- if (node instanceof Element) {
- XMLMemento child = (XMLMemento)createChild(node.getNodeName());
- child.putElement((Element)node);
- }
- }
- }
-
- /*
- * @see IMemento
- */
- public void putFloat(String key, float f) {
- element.setAttribute(key, String.valueOf(f));
- }
-
- /*
- * @see IMemento
- */
- public void putInteger(String key, int n) {
- element.setAttribute(key, String.valueOf(n));
- }
-
- /*
- * @see IMemento
- */
- public void putMemento(IMemento memento) {
- XMLMemento xmlMemento = (XMLMemento) memento;
- putElement(xmlMemento.element);
- }
-
- /*
- * @see IMemento
- */
- public void putString(String key, String value) {
- if (value == null)
- return;
- element.setAttribute(key, value);
- }
-
- /**
- * Save this Memento to a Writer.
- */
- public void save(Writer writer) throws IOException {
- Result result = new StreamResult(writer);
- Source source = new DOMSource(factory);
- try {
- Transformer transformer = TransformerFactory.newInstance().newTransformer();
- transformer.setOutputProperty(OutputKeys.INDENT, "yes");
- transformer.setOutputProperty(OutputKeys.METHOD, "xml");
- transformer.setOutputProperty("{http://xml.apache.org/xalan}indent-amount", "2");
- transformer.transform(source, result);
- } catch (Exception e) {
- throw (IOException) (new IOException().initCause(e));
- }
- }
-
- /**
- * Save this Memento to a Writer.
- */
- public void save(OutputStream os) throws IOException {
- Result result = new StreamResult(os);
- Source source = new DOMSource(factory);
- try {
- Transformer transformer = TransformerFactory.newInstance().newTransformer();
- transformer.setOutputProperty(OutputKeys.INDENT, "yes");
- transformer.setOutputProperty(OutputKeys.METHOD, "xml");
- transformer.setOutputProperty("{http://xml.apache.org/xalan}indent-amount", "2");
- transformer.transform(source, result);
- } catch (Exception e) {
- throw (IOException) (new IOException().initCause(e));
- }
- }
-
- /**
- * Saves the memento to the given file.
- *
- * @param filename java.lang.String
- * @exception java.io.IOException
- */
- public void saveToFile(String filename) throws IOException {
- Writer w = null;
- try {
- w = new FileWriter(filename);
- save(w);
- } catch (IOException e) {
- throw e;
- } catch (Exception e) {
- throw new IOException(e.getLocalizedMessage());
- } finally {
- if (w != null) {
- try {
- w.close();
- } catch (Exception e) {
- // ignore
- }
- }
- }
- }
-
- public String saveToString() throws IOException {
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- save(out);
- return out.toString("UTF-8");
- }
-
- /*
- * @see IMemento#getBoolean(String)
- */
- public Boolean getBoolean(String key) {
- Attr attr = element.getAttributeNode(key);
- if (attr == null)
- return null;
- String strValue = attr.getValue();
- if ("true".equalsIgnoreCase(strValue))
- return new Boolean(true);
- return new Boolean(false);
- }
-
- /*
- * @see IMemento#putBoolean(String, boolean)
- */
- public void putBoolean(String key, boolean value) {
- element.setAttribute(key, value ? "true" : "false");
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ClientDelegate.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ClientDelegate.java
deleted file mode 100644
index e45e806..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ClientDelegate.java
+++ /dev/null
@@ -1,49 +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.core.model;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.wst.server.core.ILaunchable;
-import org.eclipse.wst.server.core.IServer;
-/**
- * A launchable client is a client side application or test harness that can
- * be launched (run) against a resource running on a server.
- * <p>
- * This abstract class is intended to be extended only by clients
- * to extend the <code>clients</code> extension point.
- * </p>
- *
- * @since 1.0
- */
-public abstract class ClientDelegate {
- /**
- * Returns true if this launchable can be run by this client.
- *
- * @param server
- * @param launchable
- * @param launchMode
- * @return <code>true</code> if the client supports this combination, and <code>false</code>
- * otherwise
- */
- public abstract boolean supports(IServer server, ILaunchable launchable, String launchMode);
-
- /**
- * Opens or executes on the launchable.
- *
- * @param server
- * @param launchable
- * @param launchMode
- * @param launch
- * @return status indicating what (if anything) went wrong
- */
- public abstract IStatus launch(IServer server, ILaunchable launchable, String launchMode, ILaunch launch);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/IModuleEventsListener.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/IModuleEventsListener.java
deleted file mode 100644
index 64a2854..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/IModuleEventsListener.java
+++ /dev/null
@@ -1,25 +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.core.model;
-/**
- *
- *
- * @since 1.0
- */
-public interface IModuleEventsListener {
- /**
- * A module or factory has been changed as specified in the event.
- *
- * @param factoryEvent org.eclipse.wst.server.core.model.ModuleFactoryEvent[]
- * @param event org.eclipse.wst.server.core.model.ModuleEvent[]
- */
- public void moduleEvents(ModuleFactoryEvent[] factoryEvent, ModuleEvent[] event);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/IModuleFactoryListener.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/IModuleFactoryListener.java
deleted file mode 100644
index fb77448..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/IModuleFactoryListener.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.core.model;
-/**
- *
- *
- * @since 1.0
- */
-public interface IModuleFactoryListener {
- /**
- * Fired when modules have been added or removed from this factory.
- *
- * @param event org.eclipse.wst.server.core.model.ModuleFactoryEvent
- */
- public void moduleFactoryChanged(ModuleFactoryEvent event);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/IModuleFile.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/IModuleFile.java
deleted file mode 100644
index 6b8f0ea..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/IModuleFile.java
+++ /dev/null
@@ -1,25 +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.core.model;
-/**
- * A file within a module.
- *
- * @since 1.0
- */
-public interface IModuleFile extends IModuleResource {
- /**
- * Returns a modification stamp. Whenever the modification
- * stamp changes, there may have been a change to the file.
- *
- * @return the modification stamp
- */
- public long getModificationStamp();
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/IModuleFolder.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/IModuleFolder.java
deleted file mode 100644
index b8c0820..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/IModuleFolder.java
+++ /dev/null
@@ -1,24 +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.core.model;
-/**
- * A folder within a module.
- *
- * @since 1.0
- */
-public interface IModuleFolder extends IModuleResource {
- /**
- * Returns the members (contents) of this folder.
- *
- * @return an array containing the module resources contained in this folder
- */
- public IModuleResource[] members();
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/IModuleListener.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/IModuleListener.java
deleted file mode 100644
index 532ceb7..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/IModuleListener.java
+++ /dev/null
@@ -1,23 +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.core.model;
-/**
- *
- * @since 1.0
- */
-public interface IModuleListener {
- /**
- * A module has been changed as specified in the event.
- *
- * @param event org.eclipse.wst.server.core.model.ModuleEvent
- */
- public void moduleChanged(ModuleEvent event);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/IModuleResource.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/IModuleResource.java
deleted file mode 100644
index 949c7d4..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/IModuleResource.java
+++ /dev/null
@@ -1,33 +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.core.model;
-
-import org.eclipse.core.runtime.IPath;
-/**
- * A resource (file or folder) within a module.
- *
- * @since 1.0
- */
-public interface IModuleResource {
- /**
- * Returns the module relative path to this resource.
- *
- * @return the module relative path to this resource
- */
- public IPath getModuleRelativePath();
-
- /**
- * Returns the name of this resource.
- *
- * @return the name of this resource
- */
- public String getName();
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/IModuleResourceDelta.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/IModuleResourceDelta.java
deleted file mode 100644
index 8327fdf..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/IModuleResourceDelta.java
+++ /dev/null
@@ -1,137 +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.core.model;
-
-import org.eclipse.core.runtime.IPath;
-/**
- *
- * @since 1.0
- */
-public interface IModuleResourceDelta {
- public static final int NO_CHANGE = 0;
- public static final int ADDED = 1;
- public static final int CHANGED = 2;
- public static final int REMOVED = 3;
-
- /**
- * Returns the module resource represented by this delta.
- *
- * @return the corresponding module resource
- */
- public IModuleResource getModuleResource();
-
- /**
- * Returns the kind of this resource delta.
- * Normally, one of <code>ADDED</code>,
- * <code>REMOVED</code>, <code>CHANGED</code>.
- *
- * @return the kind of this resource delta
- *
- * @see IModuleResourceDelta#ADDED
- * @see IModuleResourceDelta#REMOVED
- * @see IModuleResourceDelta#CHANGED
- */
- public int getKind();
-
- /**
- * Returns module resource deltas for all children of this resource
- * which were added, removed, or changed. Returns an empty
- * array if there are no affected children.
- * <p>
- * This is a convenience method, fully equivalent to:
- * <pre>
- * getAffectedChildren(ADDED | REMOVED | CHANGED, IResource.NONE);
- * </pre>
- * </p>
- *
- * @return the resource deltas for all affected children
- * @see IModuleResourceDelta#ADDED
- * @see IModuleResourceDelta#REMOVED
- * @see IModuleResourceDelta#CHANGED
- */
- public IModuleResourceDelta[] getAffectedChildren();
-
- /**
- * Returns the module-relative path of this resource delta.
- * Returns the empty path for resources in the module root.
- * <p>
- * A resource's module-relative path indicates the route from the module
- * to the resource. Within a module, there is exactly one such path
- * for any given resource. The returned path never has a trailing separator.
- * </p>
- * @return the module-relative path of this resource delta
- * @see IModuleResource#getModuleRelativePath()
- */
- public IPath getModuleRelativePath();
-
- /**
- * Finds and returns the descendent delta identified by the given path in
- * this delta, or <code>null</code> if no such descendent exists.
- * The supplied path may be absolute or relative; in either case, it is
- * interpreted as relative to this delta. Trailing separators are ignored.
- * If the path is empty this delta is returned.
- * <p>
- * This is a convenience method to avoid manual traversal of the delta
- * tree in cases where the listener is only interested in changes to
- * particular resources. Calling this method will generally be
- * faster than manually traversing the delta to a particular descendent.
- * </p>
- * @param path the path of the desired descendent delta
- * @return the descendent delta, or <code>null</code> if no such
- * descendent exists in the delta
- * @since 2.0
- */
- //public IModuleResourceDelta findMember(IPath path);
-
- /**
- * Returns resource deltas for all children of this resource
- * whose kind is included in the given mask. Kind masks are formed
- * by the bitwise or of <code>IResourceDelta</code> kind constants.
- * Returns an empty array if there are no affected children.
- * <p>
- * This is a convenience method, fully equivalent to:
- * <pre>
- * getAffectedChildren(kindMask, IResource.NONE);
- * </pre>
- * Team-private member resources are <b>not</b> included in the result.
- * </p>
- *
- * @param kindMask a mask formed by the bitwise or of <code>IResourceDelta </code>
- * delta kind constants
- * @return the resource deltas for all affected children
- * @see IResourceDelta#ADDED
- * @see IResourceDelta#REMOVED
- * @see IResourceDelta#CHANGED
- * @see #getAffectedChildren(int)
- */
- //public IModuleResourceDelta[] getAffectedChildren(int kindMask);
-
- /**
- * Accepts the given visitor.
- * The only kinds of resource deltas visited
- * are <code>ADDED</code>, <code>REMOVED</code>,
- * and <code>CHANGED</code>.
- * The visitor's <code>visit</code> method is called with this
- * resource delta if applicable. If the visitor returns <code>true</code>,
- * the resource delta's children are also visited.
- * <p>
- * This is a convenience method, fully equivalent to
- * <code>accept(visitor, IResource.NONE)</code>.
- * Although the visitor will be invoked for this resource delta, it will not be
- * invoked for any team-private member resources.
- * </p>
- *
- * @param visitor the visitor
- * @exception CoreException if the visitor failed with this exception.
- * @see IResourceDeltaVisitor#visit(IResourceDelta)
- */
- //public void accept(IModuleResourceDeltaVisitor visitor) throws CoreException;
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/IModuleResourceDeltaVisitor.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/IModuleResourceDeltaVisitor.java
deleted file mode 100644
index b971472..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/IModuleResourceDeltaVisitor.java
+++ /dev/null
@@ -1,56 +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.core.model;
-
-import org.eclipse.core.runtime.CoreException;
-/**
- * An objects that visits module resource deltas.
- * <p>
- * Usage:
- * <pre>
- * class Visitor implements IModuleResourceDeltaVisitor {
- * public boolean visit(IModuleResourceDelta delta) {
- * switch (delta.getKind()) {
- * case IModuleResourceDelta.ADDED :
- * // handle added resource
- * break;
- * case IModuleResourceDelta.REMOVED :
- * // handle removed resource
- * break;
- * case IModuleResourceDelta.CHANGED :
- * // handle changed resource
- * break;
- * }
- * return true;
- * }
- * }
- * IModuleResourceDelta rootDelta = ...;
- * rootDelta.accept(new Visitor());
- * </pre>
- * </p>
- * <p>
- * Clients may implement this interface.
- * </p>
- *
- * [issue: @see IModuleResourceDelta#accept(IModuleResourceVisitor)]
- *
- * @since 1.0
- */
-public interface IModuleResourceDeltaVisitor {
- /**
- * Visits the given module resource delta.
- *
- * @return <code>true</code> if the resource delta's children should
- * be visited; <code>false</code> if they should be skipped.
- * @exception CoreException if the visit fails for some reason.
- */
- public boolean visit(IModuleResourceDelta delta) throws CoreException;
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/IRunningActionServer.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/IRunningActionServer.java
deleted file mode 100644
index 86889f0..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/IRunningActionServer.java
+++ /dev/null
@@ -1,21 +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.core.model;
-/**
- * This interface is a tag for a server that should be running before calling
- * modifyModules(). It will be implemented by delegate classes of servers that
- * should be started before calling API.
- *
- * @since 1.0
- */
-public interface IRunningActionServer {
- // marker interface
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/IURLProvider.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/IURLProvider.java
deleted file mode 100644
index c0d9d5e..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/IURLProvider.java
+++ /dev/null
@@ -1,44 +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.core.model;
-
-import java.net.URL;
-
-import org.eclipse.wst.server.core.IModule;
-/**
- *
- * @since 1.0
- */
-public interface IURLProvider {
- /**
- * Return the base URL of this module on the server. (e.g.
- * "http://localhost:8080/myProject")
- * <p>
- * This method may return null if this server does not have a valid configuration
- * or if the server is not running. The returned URL must not end in a trailing
- * slash.
- * </p>
- * <p>
- * If the module is null, the returned URL will just be to the root of
- * the server (e.g. "http://localhost:8080")
- * </p>
- * <p>
- * If the module is not already added to the server, the method will return
- * as close an approximation as possible. (for instance, for a J2EE web project
- * it may use the project's context root, which may not be the same when deployed
- * to a server)
- * </p>
- *
- * @param module com.ibm.etools.server.core.IModule
- * @return java.net.URL
- */
- public URL getModuleRootURL(IModule module);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/LaunchableAdapterDelegate.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/LaunchableAdapterDelegate.java
deleted file mode 100644
index 289df10..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/LaunchableAdapterDelegate.java
+++ /dev/null
@@ -1,35 +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.core.model;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.server.core.ILaunchable;
-import org.eclipse.wst.server.core.IModuleArtifact;
-import org.eclipse.wst.server.core.IServer;
-/**
- * This interface, typically implemented by the server code, converts from
- * an IModuleArtifact to an ILaunchable.
- *
- * <p>This is the implementation of a launchableAdapter extension point.</p>
- *
- * @since 1.0
- */
-public abstract class LaunchableAdapterDelegate {
- /**
- * Returns a launchable object from this module artifact.
- *
- * @param server the server
- * @param moduleArtifact a module artifact
- * @return the launchable object
- * @exception if there was an error doing the conversion
- */
- public abstract ILaunchable getLaunchable(IServer server, IModuleArtifact moduleArtifact) throws CoreException;
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ModuleArtifactAdapterDelegate.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ModuleArtifactAdapterDelegate.java
deleted file mode 100644
index effa897..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ModuleArtifactAdapterDelegate.java
+++ /dev/null
@@ -1,33 +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.core.model;
-
-import org.eclipse.wst.server.core.IModuleArtifact;
-/**
- * A module artifact adapter converts from some view's model
- * object into a module artifact that is recognized by one or
- * more server types.
- *
- * <p>This is the implementation of a moduleArtifactAdapter
- * extension point.</p>
- *
- * @since 1.0
- */
-public abstract class ModuleArtifactAdapterDelegate {
- /**
- * Converts from an arbitrary object to an module artifact.
- *
- * @param obj an arbitrary object from a view or editor
- * @return an module artifact, or <code>null</code> if this
- * adapter does not recognize or cannot adapt the object
- */
- public abstract IModuleArtifact getModuleArtifact(Object obj);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ModuleDelegate.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ModuleDelegate.java
deleted file mode 100644
index 300178f..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ModuleDelegate.java
+++ /dev/null
@@ -1,116 +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.core.model;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.wst.server.core.IModule;
-/**
- * A module delegate provides a mechanism for discovering information
- * about individual modules. Modules are returned from module factory
- * delegates; their delegates are created when
- * ModuleFactoryDelegate.createModule() is called.
- * <p>
- * When the module needs to be given a delegate, the delegate class
- * specified for the module is instantiated with a 0-argument
- * constructor.
- * </p>
- * <p>
- * Module delegates may keep state in instance fields, but that state is
- * transient and will not be persisted across workbench sessions.
- * </p>
- * <p>
- * This interface is intended to be implemented by clients.
- * </p>
- * <p>
- * <it>Caveat: The server core API is still in an early form, and is
- * likely to change significantly before the initial release.</it>
- * </p>
- *
- * @see org.eclipse.wst.server.core.IModule
- * @see ModuleFactoryDelegate
- * @since 1.0
- */
-public abstract class ModuleDelegate {
- private IModule module;
-
- /**
- * Delegates must have a public 0-arg constructor.
- */
- public ModuleDelegate() {
- // do nothing
- }
-
- /**
- * Initializes this module delegate with its life-long module instance.
- * <p>
- * This method is called by the server core framework.
- * Clients should never call this method.
- * </p>
- *
- * @param newModule the module instance
- */
- public final void initialize(IModule newModule) {
- this.module = newModule;
- initialize();
- }
-
- /**
- * Initializes this module delegate. This method gives delegates a chance
- * to do their own initialization.
- * <p>
- * This method is called by the server core framework.
- * Clients should never call this method.
- * </p>
- */
- public void initialize() {
- // do nothing
- }
-
- /**
- * Returns the module that this module delegate corresponds to.
- *
- * @return the module
- */
- public IModule getModule() {
- return module;
- }
-
- /**
- * Validates this module instance. See the specification of
- * {@link IModule#validate(IProgressMonitor)} for further details. Subclasses should
- * override and call super.validate() for basic validation.
- * <p>
- * This method is called by the web server core framework,
- * in response to a call to <code>IModule.validate(IProgressMonitor)</code>.
- * Clients should never call this method.
- * </p>
- *
- * @return a status object with code <code>IStatus.OK</code> if this
- * runtime is valid, otherwise a status object indicating what is
- * wrong with it
- */
- public abstract IStatus validate();
-
- /**
- * Returns the child modules of this module.
- *
- * @return a possibly empty array of child modules
- */
- public abstract IModule[] getChildModules();
-
- /**
- * Returns the current array of module artifacts.
- *
- * @return a possibly empty array containing the module resources
- */
- public abstract IModuleResource[] members() throws CoreException;
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ModuleEvent.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ModuleEvent.java
deleted file mode 100644
index 4c42f56..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ModuleEvent.java
+++ /dev/null
@@ -1,102 +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.core.model;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.wst.server.core.IModule;
-/**
- * An event fired when a module changes.
- *
- * @since 1.0
- */
-public class ModuleEvent {
- protected IModule module;
- protected boolean isChanged;
- protected IModule[] added;
- protected IModule[] changed;
- protected IModule[] removed;
-
- class IModuleArtifact {
- IPath path;
- long timestamp;
- }
-
- /**
- * Create a new module event.
- *
- * @param module
- * @param isChanged
- * @param added
- * @param changed
- * @param removed
- */
- public ModuleEvent(IModule module, boolean isChanged, IModule[] added, IModule[] changed, IModule[] removed) {
- this.module = module;
- this.isChanged = isChanged;
- this.added = added;
- this.changed = changed;
- this.removed = removed;
- }
-
- /**
- * Returns the module that has been changed.
- *
- * @return the module
- */
- public IModule getModule() {
- return module;
- }
-
- /**
- * Returns true if this module's settings have changed.
- *
- * @return boolean
- */
- public boolean isChanged() {
- return isChanged;
- }
-
- /**
- * Returns any child modules that have been added.
- *
- * @return the added child modules, or null if no modules have been added
- */
- public IModule[] getAddedChildModules() {
- return added;
- }
-
- /**
- * Returns any child modules that have been changed.
- *
- * @return the changed child modules, or null if no modules have been changed
- */
- public IModule[] getChangedChildModules() {
- return changed;
- }
-
- /**
- * Returns any child modules that have been removed.
- *
- * @return the removed child modules, or null if no modules have been removed
- */
- public IModule[] getRemovedChildModules() {
- return removed;
- }
-
- /**
- * Returns the module artifacts that have changed.
- *
- * @return the changed module artifacts
- */
- public IModuleArtifact[] getChangedArtifacts() {
- return null;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ModuleFactoryDelegate.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ModuleFactoryDelegate.java
deleted file mode 100644
index 549998f..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ModuleFactoryDelegate.java
+++ /dev/null
@@ -1,219 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.core.model;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.internal.Module;
-import org.eclipse.wst.server.core.internal.ModuleFactory;
-import org.eclipse.wst.server.core.internal.Trace;
-/**
- * A module factory delegate provides a mechanism for discovering
- * modules. A module factory delegate is specified by the
- * <code>class</code> attribute of a <code>moduleFactories</code> extension.
- * <p>
- * When the module factory needs to be given a delegate, the delegate class
- * specified for the module factory is instantiated with a 0-argument
- * constructor.
- * </p>
- * <p>
- * Module factory delegates may keep state in instance fields, but that state is
- * transient and will not be persisted across workbench sessions.
- * </p>
- * <p>
- * This interface is intended to be implemented by clients.
- * </p>
- * <p>
- * <it>Caveat: The server core API is still in an early form, and is
- * likely to change significantly before the initial release.</it>
- * </p>
- *
- * @see org.eclipse.wst.server.core.IModule
- * @see ModuleDelegate
- * @since 1.0
- */
-public abstract class ModuleFactoryDelegate {
- // module factory listeners
- private transient List listeners;
-
- private ModuleFactory factory;
-
- /**
- * Delegates must have a public 0-arg constructor.
- */
- public ModuleFactoryDelegate() {
- // do nothing
- }
-
- /**
- * Initializes this module factory delegate with its life-long module
- * factory instance.
- * <p>
- * This method is called by the server core framework.
- * Clients should never call this method.
- * </p>
- *
- * @param newFactory the module factory instance
- */
- public final void initialize(ModuleFactory newFactory) {
- factory = newFactory;
- }
-
- /**
- * Returns the id of this factory.
- * Each factory has a distinct id, fixed for its lifetime. Ids are intended to
- * be used internally as keys; they are not intended to be shown to end users.
- *
- * @return the factory id
- */
- protected String getId() {
- return factory.getId();
- }
-
- /**
- * Creates a module instance with the given static information. This method is used
- * by module factory delegates to create module instances.
- *
- * @param id the module id
- * @param name the module name
- * @param type the module type id
- * @param version the module version id
- * @param project the project that the module is contained in
- * @return a module instance
- */
- public IModule createModule(String id, String name, String type, String version, IProject project) {
- return new Module(factory, id, name, type, version, project);
- }
-
- /**
- * Finds a module create by this factory with the given id.
- * See the specification of
- * {@link org.eclipse.wst.server.core.IModuleFactory#getModule(String)}
- * for further details.
- * <p>
- * This method is normally called by the web server core framework,
- * in response to a call to {@link IModuleFactory#getModule(String)}.
- * Clients (other than the delegate) should never call this method.
- * </p>
- *
- * @param id the module id
- * @return the module with the given id, or <code>null</code>
- * if none
- */
- //public abstract IModule getModule(String memento);
-
- /**
- * Creates the module delegate for a module with the given information.
- * This method is called when a client needs to access the module delegate
- * associated with the given module.
- *
- * @param module a module
- * @return the module delegate
- */
- public abstract ModuleDelegate getModuleDelegate(IModule module);
-
- /**
- * Return all modules created by this factory.
- * See the specification of
- * {@link org.eclipse.wst.server.core.IModuleFactory#getModules()}
- * for further details.
- * <p>
- * This method is normally called by the web server core framework,
- * in response to a call to {@link IModuleFactory#getModules()}.
- * Clients (other than the delegate) should never call this method.
- * </p>
- * <p>
- * A new array is returned on each call, so clients may store or modify the result.
- * </p>
- *
- * @return a possibly-empty array of modules {@link IModule}
- */
- public abstract IModule[] getModules();
-
- /**
- * Adds the given listener to this module factory.
- * Once registered, a listener starts receiving notification of
- * modules are added/removed. The listener continues to receive
- * notifications until it is removed.
- * Has no effect if an identical listener is already registered.
- * <p>
- * This method is normally called by the web server core framework,
- * in response to a call to
- * {@link IModuleFactory#addModuleFactoryListener(IModuleFactoryListener)}.
- * Clients (other than the delegate) should never call this method.
- * </p>
- *
- * @param listener the module factory listener to add
- * @see #removeModuleFactoryListener(IModuleFactoryListener)
- */
- public void addModuleFactoryListener(IModuleFactoryListener listener) {
- Trace.trace(Trace.FINEST, "Adding module factory listener " + listener + " to " + this);
-
- if (listeners == null)
- listeners = new ArrayList();
- else if (listeners.contains(listener))
- return;
- listeners.add(listener);
- }
-
- /**
- * Removes the given listener from this module factory.
- * Has no effect if the listener is not registered.
- * <p>
- * This method is normally called by the web server core framework,
- * in response to a call to
- * {@link IModuleFactory#removeModuleFactoryListener(IModuleFactoryListener)}.
- * Clients (other than the delegate) should never call this method.
- * </p>
- *
- * @param listener the module factory listener to remove
- * @see #addModuleFactoryListener(IModuleFactoryListener)
- */
- public void removeModuleFactoryListener(IModuleFactoryListener listener) {
- Trace.trace(Trace.FINEST, "Removing module factory listener " + listener + " from " + this);
-
- if (listeners != null)
- listeners.remove(listener);
- }
-
- /**
- * Fire a module factory event. This method is used by the factory delegate to
- * fire events about module changes.
- *
- * @param added a non-null array of modules that have been added
- * @param removed a non-null array of modules that have been removed
- */
- protected void fireModuleFactoryEvent(IModule[] added, IModule[] removed) {
- Trace.trace(Trace.FINEST, "->- Firing module factory event: " + toString() + " ->-");
-
- if (listeners == null || listeners.isEmpty())
- return;
-
- int size = listeners.size();
- IModuleFactoryListener[] dfl = new IModuleFactoryListener[size];
- listeners.toArray(dfl);
-
- ModuleFactoryEvent event = new ModuleFactoryEvent(added, removed);
-
- for (int i = 0; i < size; i++) {
- try {
- Trace.trace(Trace.FINEST, " Firing module factory event to: " + dfl[i]);
- dfl[i].moduleFactoryChanged(event);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, " Error firing module factory event", e);
- }
- }
- Trace.trace(Trace.FINEST, "-<- Done firing module factory event -<-");
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ModuleFactoryEvent.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ModuleFactoryEvent.java
deleted file mode 100644
index 5695d94..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ModuleFactoryEvent.java
+++ /dev/null
@@ -1,45 +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.core.model;
-
-import org.eclipse.wst.server.core.IModule;
-/**
- * An event fired when a module factory changes.
- *
- * @since 1.0
- */
-public class ModuleFactoryEvent {
- protected IModule[] added;
- protected IModule[] removed;
-
- public ModuleFactoryEvent(IModule[] added, IModule[] removed) {
- this.added = added;
- this.removed = removed;
- }
-
- /**
- * Returns any modules that have been added.
- *
- * @return org.eclipse.wst.server.core.model.IModule[]
- */
- public IModule[] getAddedModules() {
- return added;
- }
-
- /**
- * Returns any modules that have been removed.
- *
- * @return org.eclipse.wst.server.core.model.IModule[]
- */
- public IModule[] getRemovedModules() {
- return removed;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/RuntimeDelegate.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/RuntimeDelegate.java
deleted file mode 100644
index a345ce3..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/RuntimeDelegate.java
+++ /dev/null
@@ -1,258 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.core.model;
-
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.IRuntimeWorkingCopy;
-import org.eclipse.wst.server.core.ServerCore;
-import org.eclipse.wst.server.core.internal.Runtime;
-import org.eclipse.wst.server.core.internal.RuntimeWorkingCopy;
-import org.eclipse.wst.server.core.internal.ServerPlugin;
-/**
- * A runtime delegate provides the implementation for various
- * generic and server-type-specific operations for a specific type of runtime.
- * A runtime delegate is specified by the
- * <code>class</code> attribute of a <code>runtimeTypes</code> extension.
- * <p>
- * When the runtime instance needs to be given a delegate, the delegate class
- * specified for the runtime type is instantiated with a 0-argument constructor
- * and primed with <code>delegate.initialize(runtime)</code>,
- * which it is expected to hang on to. Later, when
- * <code>delegate.dispose()</code> is called as the runtime instance is
- * being discarded, the delegate is expected to let go of the runtime instance.
- * </p>
- * <p>
- * RuntimeDelegate supports an open-ended set of attribute-value pairs. All
- * state stored in this manner will be saved when the runtime working copy is
- * saved, and persisted across workbench sessions.
- * Runtime delegates may keep state in instance fields, but that state is
- * transient and will not be persisted across workbench sessions. To save state
- * across workbench sessions, it must be persisted using the attributes.
- * </p>
- * <p>
- * This abstract class is intended to be extended only by clients
- * to extend the <code>runtimeTypes</code> extension point.
- * </p>
- * <p>
- * <it>Caveat: The server core API is still in an early form, and is
- * likely to change significantly before the initial release.</it>
- * </p>
- *
- * @see IRuntime
- * @see IRuntimeWorkingCopy
- * @since 1.0
- */
-public abstract class RuntimeDelegate {
- private Runtime runtime;
- private RuntimeWorkingCopy runtimeWC;
-
- /**
- * Delegates must have a public 0-arg constructor.
- */
- public RuntimeDelegate() {
- // do nothing
- }
-
- /**
- * Initializes this runtime delegate with its life-long runtime instance.
- * <p>
- * This method is called by the server core framework.
- * Clients should never call this method.
- * </p>
- *
- * @param newRuntime the runtime instance
- */
- public final void initialize(Runtime newRuntime) {
- runtime = newRuntime;
- if (runtime instanceof RuntimeWorkingCopy)
- runtimeWC = (RuntimeWorkingCopy) runtime;
- initialize();
- }
-
- /**
- * Initializes this runtime delegate. This method gives delegates a chance
- * to do their own initialization.
- * <p>
- * This method is called by the server core framework.
- * Clients should never call this method.
- * </p>
- */
- public void initialize() {
- // do nothing
- }
-
- /**
- * Returns the runtime that this runtime delegate corresponds to.
- *
- * @return the runtime
- */
- public IRuntime getRuntime() {
- return runtime;
- }
-
- /**
- * Returns the runtime working copy that this runtime delegate corresponds to.
- *
- * @return the runtime
- */
- public final IRuntimeWorkingCopy getRuntimeWorkingCopy() {
- return runtimeWC;
- }
-
- /**
- * Validates this runtime instance. See the specification of
- * {@link IRuntime#validate(IProgressMonitor)} for further details. Subclasses should
- * override and call super.validate() for basic validation.
- * <p>
- * This method is called by the web server core framework,
- * in response to a call to <code>IRuntime.validate(IProgressMonitor)</code>.
- * Clients should never call this method.
- * </p>
- *
- * @return a status object with code <code>IStatus.OK</code> if this
- * runtime is valid, otherwise a status object indicating what is
- * wrong with it
- */
- public IStatus validate() {
- if (runtime.getName() == null || runtime.getName().length() == 0)
- return new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0, ServerPlugin.getResource("%errorRuntimeName"), null);
-
- if (isNameInUse())
- return new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0, ServerPlugin.getResource("%errorDuplicateRuntimeName"), null);
-
- IPath path = runtime.getLocation();
- if (path == null || path.isEmpty())
- return new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0, "", null);
-
- return new Status(IStatus.OK, ServerPlugin.PLUGIN_ID, 0, "", null);
- }
-
- private boolean isNameInUse() {
- IRuntime orig = runtime;
- if (runtimeWC != null)
- orig = runtimeWC.getOriginal();
-
- IRuntime[] runtimes = ServerCore.getRuntimes();
- if (runtimes != null) {
- int size = runtimes.length;
- for (int i = 0; i < size; i++) {
- if (orig != runtimes[i] && runtime.getName().equals(runtimes[i].getName()))
- return true;
- }
- }
- return false;
- }
-
- public final int getAttribute(String attributeName, int defaultValue) {
- return runtime.getAttribute(attributeName, defaultValue);
- }
-
- public final boolean getAttribute(String attributeName, boolean defaultValue) {
- return runtime.getAttribute(attributeName, defaultValue);
- }
-
- public final String getAttribute(String attributeName, String defaultValue) {
- return runtime.getAttribute(attributeName, defaultValue);
- }
-
- public final List getAttribute(String attributeName, List defaultValue) {
- return runtime.getAttribute(attributeName, defaultValue);
- }
-
- public final Map getAttribute(String attributeName, Map defaultValue) {
- return runtime.getAttribute(attributeName, defaultValue);
- }
-
- /**
- * Disposes of this runtime delegate.
- * <p>
- * This method is called by the web server core framework.
- * Clients should never call this method.
- * </p>
- * <p>
- * Implementations are expected to let go of the delegate's reference
- * to the runtime, deregister listeners, etc.
- * </p>
- */
- public void dispose() {
- // do nothing
- }
-
- /**
- * Initializes this runtime with default values. This method is called when
- * a new runtime is created so that the runtime can be initialized with
- * meaningful values.
- */
- public void setDefaults() {
- // do nothing
- }
-
- /**
- * Sets the value of the specified integer-valued attribute of this
- * element.
- *
- * @param id the attribute id
- * @param value the value of the specified attribute
- */
- public final void setAttribute(String id, int value) {
- runtimeWC.setAttribute(id, value);
- }
-
- /**
- * Sets the value of the specified boolean-valued attribute of this
- * element.
- *
- * @param id the attribute id
- * @param value the value of the specified attribute
- */
- public final void setAttribute(String id, boolean value) {
- runtimeWC.setAttribute(id, value);
- }
-
- /**
- * Sets the value of the specified string-valued attribute of this
- * element.
- *
- * @param id the attribute id
- * @param value the value of the specified attribute
- */
- public final void setAttribute(String id, String value) {
- runtimeWC.setAttribute(id, value);
- }
-
- /**
- * Sets the value of the specified list-valued attribute of this
- * element. The list may only contain String values.
- *
- * @param id the attribute id
- * @param value the value of the specified attribute
- */
- public final void setAttribute(String id, List value) {
- runtimeWC.setAttribute(id, value);
- }
-
- /**
- * Sets the value of the specified map-valued attribute of this
- * element. The map may only contain String values.
- *
- * @param id the attribute id
- * @param value the value of the specified attribute
- */
- public final void setAttribute(String id, Map value) {
- runtimeWC.setAttribute(id, value);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/RuntimeLocatorDelegate.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/RuntimeLocatorDelegate.java
deleted file mode 100644
index 0daeeac..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/RuntimeLocatorDelegate.java
+++ /dev/null
@@ -1,49 +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.core.model;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.wst.server.core.IRuntimeWorkingCopy;
-/**
- * A runtime locator provides the ability to locate or search for additional
- * runtimes of a particular type.
- * <p>
- * This abstract class is intended to be extended only by clients
- * to extend the <code>runtimeLocators</code> extension point.
- * </p>
- *
- * @since 1.0
- */
-public abstract class RuntimeLocatorDelegate {
- public interface IRuntimeSearchListener {
- /**
- * Called when a new runtime is found by the locator.
- * The runtime must never be null.
- *
- * @param runtime the runtime that was found.
- */
- public void runtimeFound(IRuntimeWorkingCopy runtime);
- }
-
- /**
- * Searches for local runtimes.
- * It uses the callback listener to report runtimes that are found.
- * The path contains the absolute path of the folder to search in,
- * or <code>null</code> to search the entire machine.
- *
- * @param path the path to search for runtimes in
- * @param listener a listener to report status to
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- */
- public abstract void searchForRuntimes(IPath path, IRuntimeSearchListener listener, IProgressMonitor monitor);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/RuntimeTargetHandlerDelegate.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/RuntimeTargetHandlerDelegate.java
deleted file mode 100644
index 5fe2c55..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/RuntimeTargetHandlerDelegate.java
+++ /dev/null
@@ -1,64 +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.core.model;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.IRuntimeTargetHandler;
-/**
- *
- * @since 1.0
- */
-public abstract class RuntimeTargetHandlerDelegate {
- private IRuntimeTargetHandler handler;
-
- /**
- * Initializes the runtime target handler.
- *
- * @param newHandler the new handler
- */
- public final void initialize(IRuntimeTargetHandler newHandler) {
- handler = newHandler;
- }
-
- /**
- * Returns the runtime target handler that this delegate is associated with.
- *
- * @return the runtime target handler
- */
- public IRuntimeTargetHandler getRuntimeTargetHandler() {
- return handler;
- }
-
- /**
- * Set the runtime target on the given project.
- *
- * @param project the project to set the runtime on
- * @param runtime the target runtime
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @throws CoreException thrown if there is a problem setting the runtime
- */
- public abstract void setRuntimeTarget(IProject project, IRuntime runtime, IProgressMonitor monitor) throws CoreException;
-
- /**
- * Remove the runtime target from the given project.
- *
- * @param project the project to remove the runtime from
- * @param runtime the target runtime
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @throws CoreException thrown if there is a problem removing the runtime
- */
- public abstract void removeRuntimeTarget(IProject project, IRuntime runtime, IProgressMonitor monitor) throws CoreException;
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ServerBehaviourDelegate.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ServerBehaviourDelegate.java
deleted file mode 100644
index 94f30c7..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ServerBehaviourDelegate.java
+++ /dev/null
@@ -1,429 +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.core.model;
-
-import org.eclipse.core.runtime.*;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-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.core.internal.ServerPlugin;
-/**
- * A server delegate provides the implementation for various
- * generic and server-type-specific operations for a specific type of server.
- * A server delegate is specified by the
- * <code>class</code> attribute of a <code>serverTypes</code> extension.
- * <p>
- * When the server instance needs to be given a delegate, the delegate class
- * specified for the server type is instantiated with a 0-argument constructor
- * and primed with <code>delegate.initialize(((IServerState)server)</code>,
- * which it is expected to hang on to. Later, when
- * <code>delegate.dispose()</code> is called as the server instance is
- * being discarded, the delegate is expected to let go of the server instance.
- * </p>
- * <p>
- * Server delegates may keep state in instance fields, but that state is
- * transient and will not be persisted across workbench sessions.
- * </p>
- * <p>
- * This abstract class is intended to be extended only by clients
- * to extend the <code>serverTypes</code> extension point.
- * </p>
- * <p>
- * <it>Caveat: The server core API is still in an early form, and is
- * likely to change significantly before the initial release.</it>
- * </p>
- *
- * @see org.eclipse.wst.server.core.IServer
- * @see org.eclipse.wst.server.core.IServerWorkingCopy
- * @since 1.0
- */
-public abstract class ServerBehaviourDelegate {
- private Server server;
-
- /**
- * Delegates must have a public 0-arg constructor.
- */
- public ServerBehaviourDelegate() {
- // do nothing
- }
-
- /**
- * Initializes this server delegate with its life-long server instance.
- * <p>
- * This method is called by the server core framework.
- * Clients should never call this method.
- * </p>
- *
- * @param newServer the server instance
- */
- public final void initialize(Server newServer) {
- server = newServer;
- initialize();
- }
-
- /**
- * Initializes this server delegate. This method gives delegates a chance
- * to do their own initialization.
- * <p>
- * This method is called by the server core framework.
- * Clients should never call this method.
- * </p>
- */
- public void initialize() {
- // do nothing
- }
-
- /**
- * Returns the server that this server delegate corresponds to.
- *
- * @return the server
- */
- public final IServer getServer() {
- return server;
- }
-
- /**
- * Sets the current state of this server.
- *
- * @param state one of the server state (<code>STATE_XXX</code>)
- * constants declared on {@link IServer}
- * @see IServer#getServerState()
- */
- public final void setServerState(int state) {
- server.setServerState(state);
- }
-
- /**
- * Sets the ILaunchManager mode that the server is running in. The server
- * implementation will automatically return <code>null</code> to clients
- * when the server is stopped, so you only need to update the mode when
- * it changes.
- *
- * @param mode the mode in which a server is running, one of the mode constants
- * defined by {@link org.eclipse.debug.core.ILaunchManager}
- */
- public final void setMode(String mode) {
- server.setMode(mode);
- }
-
- /**
- *
- * @param modules
- */
- public final void setModules(IModule[] modules) {
- server.setModules(modules);
- }
-
- /**
- * Sets the server restart state.
- *
- * @param state boolean
- */
- public final void setServerRestartState(boolean state) {
- server.setServerRestartState(state);
- }
-
- /**
- * Sets the server publish state.
- *
- * @param state int
- */
- public final void setServerPublishState(int state) {
- server.setServerPublishState(state);
- }
-
- /**
- * Hook to fire an event when a module state changes.
- *
- * @param module
- * @param state
- */
- public final void setModuleState(IModule module, int state) {
- server.setModuleState(module, state);
- }
-
- /**
- * Sets the module publish state.
- *
- * @param state int
- */
- public final void setModulePublishState(IModule module, int state) {
- server.setModulePublishState(module, state);
- }
-
- /**
- * Sets the module restart state.
- *
- * @param state int
- */
- public final void setModuleRestartState(IModule module, boolean state) {
- server.setModuleRestartState(module, state);
- }
-
- /**
- * Disposes of this server delegate.
- * <p>
- * This method is called by the web server core framework.
- * Clients should never call this method.
- * </p>
- * <p>
- * Implementations are expected to let go of the delegate's reference
- * to the server, deregister listeners, etc.
- * </p>
- */
- public void dispose() {
- // do nothing
- }
-
- /**
- * Methods called to notify that publishing is about to begin.
- * This allows the server to open a connection to the server
- * or get any global information ready.
- * <p>
- * This method is called by the server core framework,
- * in response to a call to <code>IServer.publish()</code>.
- * Clients should never call this method.
- * </p>
- *
- * @param monitor org.eclipse.core.runtime.IProgressMonitor
- * @throws CoreException
- */
- public void publishStart(IProgressMonitor monitor) throws CoreException {
- // do nothing
- }
-
- /**
- * Publish the server.
- * <p>
- * This method is called by the server core framework,
- * in response to a call to <code>IServer.publish()</code>.
- * Clients should never call this method.
- * </p>
- *
- * @param kind one of the IServer.PUBLISH_XX constants. Valid values are
- * <ul>
- * <li><code>PUBLSIH_FULL</code>- indicates a full publish.</li>
- * <li><code>PUBLISH_INCREMENTAL</code>- indicates a incremental publish.
- * <li><code>PUBLSIH_AUTO</code>- indicates an automatic incremental publish.</li>
- * <li><code>PUBLISH_CLEAN</code>- indicates a clean request. Clean throws
- * out all state and cleans up the module on the server before doing a
- * full publish.
- * </ul>
- * @param monitor
- * @throws CoreException
- */
- public abstract void publishServer(int kind, IProgressMonitor monitor) throws CoreException;
-
- /**
- * Publish a single module to the server.
- * <p>
- * This method is called by the server core framework,
- * in response to a call to <code>IServer.publish()</code>.
- * Clients should never call this method directly.
- * </p>
- * <p>
- * If the deltaKind is IServer.REMOVED, the module may have been completely
- * deleted and does not exist anymore. In this case, a dummy module (with the
- * correct id) will be passed to this method.
- * </p>
- *
- * @param kind one of the IServer.PUBLISH_XX constants. Valid values are
- * <ul>
- * <li><code>PUBLSIH_FULL</code>- indicates a full publish.</li>
- * <li><code>PUBLISH_INCREMENTAL</code>- indicates a incremental publish.
- * <li><code>PUBLSIH_AUTO</code>- indicates an automatic incremental publish.</li>
- * <li><code>PUBLISH_CLEAN</code>- indicates a clean request. Clean throws
- * out all state and cleans up the module on the server before doing a
- * full publish.
- * </ul>
- * @param parents the parent modules of this module
- * @param module the module to publish
- * @param deltaKind one of the IServer publish change constants. Valid values are
- * <ul>
- * <li><code>ADDED</code>- indicates the module has just been added to the server
- * and this is the first publish.
- * <li><code>NO_CHANGE</code>- indicates that nothing has changed in the module
- * since the last publish.</li>
- * <li><code>CHANGED</code>- indicates that the module has been changed since
- * the last publish. Call <code>getPublishedResourceDelta()</code> for
- * details of the change.
- * <li><code>REMOVED</code>- indicates the module has been removed and should be
- * removed/cleaned up from the server.
- * </ul>
- * @param monitor
- * @throws CoreException
- */
- public abstract void publishModule(int kind, int deltaKind, IModule[] parents, IModule module, IProgressMonitor monitor) throws CoreException;
-
- /**
- * Methods called to notify that publishing has finished.
- * The server can close any open connections to the server
- * and do any cleanup operations.
- * <p>
- * This method is called by the server core framework,
- * in response to a call to <code>IServer.publish()</code>.
- * Clients should never call this method.
- * </p>
- *
- * @param monitor org.eclipse.core.runtime.IProgressMonitor
- * @throws CoreException
- */
- public void publishFinish(IProgressMonitor monitor) throws CoreException {
- // do nothing
- }
-
- /**
- * Configure the given launch configuration to start this server. This method is called whenever
- * the server is started to ensure that the launch configuration is accurate and up to date.
- * This method should not blindly update the launch configuration in cases where the user has
- * access to change the launch configuration by hand.
- *
- * @param workingCopy
- * @param monitor
- * @throws CoreException
- */
- public void setupLaunchConfiguration(ILaunchConfigurationWorkingCopy workingCopy, IProgressMonitor monitor) throws CoreException {
- // do nothing
- }
-
- /**
- * Restart this server. The server should use the server
- * listener to notify progress. It must use the same debug
- * flags as was originally passed into the start() method.
- *
- * This method is used if there is a quick/better way to restart
- * the server. If it throws a CoreException, the normal stop/start
- * actions will be used.
- */
- public void restart(String launchMode) throws CoreException {
- throw new CoreException(new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0, "Could not restart", null));
- }
-
- /**
- * Returns whether the given module can be restarted.
- * <p>
- * [issue: It's unclear whether this operations is guaranteed to be fast
- * or whether it could involve communication with any actual
- * server. If it is not fast, the method should take a progress
- * monitor.]
- * </p>
- *
- * @param module the module
- * @return <code>true</code> if the given module can be
- * restarted, and <code>false</code> otherwise
- */
- public boolean canRestartModule(IModule module) {
- return false;
- }
-
- /**
- * Asynchronously restarts the given module on the server.
- * See the specification of
- * {@link IServer#synchronousRestartModule(IModule, IProgressMonitor)}
- * for further details.
- * <p>
- * The implementation should update the module sync state and fire
- * an event for the module.
- * </p>
- * <p>
- * This method will throw an exception if the module does not exist on
- * the server.
- * </p>
- * <p>
- * [issue: Since this method is ascynchronous, is there
- * any need for the progress monitor?]
- * </p>
- * <p>
- * [issue: If the module was just published to the server
- * and had never been started, would is be ok to "start"
- * the module using this method?]
- * </p>
- *
- * @param module the module to be started
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @exception CoreException if an error occurs while trying to restart the module
- */
- public void restartModule(IModule module, IProgressMonitor monitor) throws CoreException {
- // do nothing
- }
-
- /**
- * Shuts down and stops this server. The server should return from this method
- * quickly and use the server listener to notify shutdown progress.
- * <p>
- * If force is <code>false</code>, it will attempt to stop the server
- * normally/gracefully. If force is <code>true</code>, then the server
- * process will be terminated any way that it can.
- * </p>
- * <p>
- * [issue: There is no way to communicate failure to the
- * client. Given that this operation can go awry, there probably
- * should be a mechanism that allows failing asynch operations
- * to be diagnosed.]
- * </p>
- * @param force <code>true</code> to kill the server, or <code>false</code>
- * to stop normally
- */
- public abstract void stop(boolean force);
-
- /**
- * Returns the module resources that have been published to the server.
- *
- * <p>
- * If the module has just been added to the server, an empty list will
- * be returned. If the module has never existed on the server, a CoreException
- * will be thrown.
- * </p>
- *
- * @param parents
- * @param module
- * @return an array containing the published module resource
- */
- public IModuleResource[] getPublishedResources(IModule[] parents, IModule module) {
- return server.getPublishedResources(parents, module);
- }
-
- /**
- * Returns the delta of the current module resources that have been
- * published compared to the current state of the module.
- *
- * @param parents
- * @param module
- * @return an array containing the publish resource delta
- */
- public IModuleResourceDelta[] getPublishedResourceDelta(IModule[] parents, IModule module) {
- return server.getPublishedResourceDelta(parents, module);
- }
-
- /**
- * Returns a temporary directory that the requestor can use
- * throughout it's lifecycle. This is primary to be used by
- * servers for working directories, server specific
- * files, etc.
- *
- * <p>As long as the same key is used to call this method on
- * each use of the workbench, this method directory will return
- * the same directory. If the directory is not requested over a
- * period of time, the directory may be deleted and a new one
- * will be assigned on the next request. For this reason, a
- * server should request the temp directory on startup
- * if it wants to store files there. In all cases, the server
- * should have a backup plan to refill the directory
- * in case it has been deleted since last use.</p>
- *
- * @return org.eclipse.core.runtime.IPath
- */
- public IPath getTempDirectory() {
- return server.getTempDirectory();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ServerDelegate.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ServerDelegate.java
deleted file mode 100644
index 7d2c4c7..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ServerDelegate.java
+++ /dev/null
@@ -1,345 +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.core.model;
-
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.wst.server.core.*;
-import org.eclipse.wst.server.core.internal.Server;
-import org.eclipse.wst.server.core.internal.ServerWorkingCopy;
-/**
- * A server delegate provides the implementation for various
- * generic and server-type-specific operations for a specific type of server.
- * A server delegate is specified by the
- * <code>class</code> attribute of a <code>serverTypes</code> extension.
- * <p>
- * When the server instance needs to be given a delegate, the delegate class
- * specified for the server type is instantiated with a 0-argument constructor
- * and primed with <code>delegate.initialize(((IServerState)server)</code>,
- * which it is expected to hang on to. Later, when
- * <code>delegate.dispose()</code> is called as the server instance is
- * being discarded, the delegate is expected to let go of the server instance.
- * </p>
- * <p>
- * ServerDelegate supports an open-ended set of attribute-value pairs. All
- * state stored in this manner will be saved when the server working copy is
- * saved, and persisted across workbench sessions.
- * Server delegates may keep state in instance fields, but that state is
- * transient and will not be persisted across workbench sessions. To save
- * state across workbench sessions, it must be persisted using the
- * attributes.
- * </p>
- * <p>
- * This abstract class is intended to be extended only by clients
- * to extend the <code>serverTypes</code> extension point.
- * </p>
- * <p>
- * <it>Caveat: The server core API is still in an early form, and is
- * likely to change significantly before the initial release.</it>
- * </p>
- *
- * @see IServer
- * @see IServerWorkingCopy
- * @since 1.0
- */
-public abstract class ServerDelegate {
- private Server server;
- private ServerWorkingCopy serverWC;
-
- /**
- * Delegates must have a public 0-arg constructor.
- */
- public ServerDelegate() {
- // do nothing
- }
-
- /**
- * Initializes this server delegate with its life-long server instance.
- * <p>
- * This method is called by the server core framework.
- * Clients should never call this method.
- * </p>
- *
- * @param newServer the server instance
- */
- public final void initialize(Server newServer) {
- server = newServer;
- if (newServer instanceof ServerWorkingCopy)
- serverWC = (ServerWorkingCopy) newServer;
- initialize();
- }
-
- /**
- * Initializes this server delegate. This method gives delegates a chance
- * to do their own initialization.
- * <p>
- * This method is called by the server core framework.
- * Clients should never call this method.
- * </p>
- */
- public void initialize() {
- // do nothing
- }
-
- /**
- * Returns the server that this server delegate corresponds to.
- *
- * @return the server
- */
- public final IServer getServer() {
- return server;
- }
-
- /**
- * Returns the server working copy that this server delegate corresponds to.
- *
- * @return the server
- */
- public final IServerWorkingCopy getServerWorkingCopy() {
- return serverWC;
- }
-
- public final int getAttribute(String attributeName, int defaultValue) {
- return server.getAttribute(attributeName, defaultValue);
- }
-
- public final boolean getAttribute(String attributeName, boolean defaultValue) {
- return server.getAttribute(attributeName, defaultValue);
- }
-
- public final String getAttribute(String attributeName, String defaultValue) {
- return server.getAttribute(attributeName, defaultValue);
- }
-
- public final List getAttribute(String attributeName, List defaultValue) {
- return server.getAttribute(attributeName, defaultValue);
- }
-
- public final Map getAttribute(String attributeName, Map defaultValue) {
- return server.getAttribute(attributeName, defaultValue);
- }
-
- /**
- * Disposes of this server delegate.
- * <p>
- * This method is called by the web server core framework.
- * Clients should never call this method.
- * </p>
- * <p>
- * Implementations are expected to let go of the delegate's reference
- * to the server, deregister listeners, etc.
- * </p>
- */
- public void dispose() {
- // do nothing
- }
-
- /**
- * Returns whether the specified module modifications could be made to this
- * server at this time. See the specification of
- * {@link IServerAttributes#canModifyModules(IModule[], IModule[], IProgressMonitor)}
- * for further details.
- * <p>
- * This method is called by the web server core framework,
- * in response to a call to <code>IServer.canModifyModules</code>.
- * Clients should never call this method.
- * </p>
- * <p>
- * [issue: See IServerAttributes.canModifyModules(IModule[], IModule[], IProgressMonitor).]
- * </p>
- *
- * @param add a possibly-empty list of modules to add
- * @param remove a possibly-empty list of modules to remove
- * @return a status object with code <code>IStatus.OK</code> if the modules
- * can be modified, otherwise a status object indicating why they can't
- */
- public abstract IStatus canModifyModules(IModule[] add, IModule[] remove);
-
- /**
- * Returns the child module(s) of this module. If this
- * module contains other modules, it should list those
- * modules. If not, it should return an empty list.
- *
- * <p>This method should only return the direct children.
- * To obtain the full module tree, this method may be
- * recursively called on the children.</p>
- *
- * @see org.eclipse.wst.server.core.IServerAttributes#getChildModules(IModule, IProgressMonitor)
- */
- public abstract IModule[] getChildModules(IModule module);
-
- /**
- * Returns the parent module(s) of this module. When determining if a given
- * project can run on a server, this method will be used to find the actual
- * module(s) that may be run on the server. For instance, a Web module may
- * return a list of EAR modules that it is contained in if the server only
- * supports configuring EAR modules.
- *
- * <p>If the module type is not supported, this method will return null.
- * If the type is normally supported but there is a configuration
- * problem or missing parent, etc., this method will fire a CoreException
- * that may then be presented to the user.</p>
- *
- * <p>If it does return valid parent(s), this method will always return
- * the topmost parent module(s), even if there are a few levels
- * (a heirarchy) of modules.</p>
- *
- * @param module org.eclipse.wst.server.core.IModule
- * @return an array of possible root modules
- * @throws org.eclipse.core.runtime.CoreException
- *
- * @see org.eclipse.wst.server.core.IServerAttributes#getRootModules(IModule, IProgressMonitor)
- */
- public abstract IModule[] getRootModules(IModule module) throws CoreException;
-
- /**
- * Returns an array of IServerPorts that this server has.
- *
- * @return the server's ports
- */
- public IServerPort[] getServerPorts() {
- return null;
- }
-
- /**
- * Initializes this server with default values. This method is called when
- * a new server is created so that the server can be initialized with
- * meaningful values.
- */
- public void setDefaults() {
- // do nothing
- }
-
- /**
- * Sets the value of the specified integer-valued attribute of this
- * element.
- *
- * @param id the attribute id
- * @param value the value of the specified attribute
- * @see #getAttribute(String, int)
- */
- public final void setAttribute(String id, int value) {
- serverWC.setAttribute(id, value);
- }
-
- /**
- * Sets the value of the specified boolean-valued attribute of this
- * element.
- *
- * @param id the attribute id
- * @param value the value of the specified attribute
- * @see #getAttribute(String, boolean)
- */
- public final void setAttribute(String id, boolean value) {
- serverWC.setAttribute(id, value);
- }
-
- /**
- * Sets the value of the specified string-valued attribute of this
- * element.
- *
- * @param id the attribute id
- * @param value the value of the specified attribute
- * @see #getAttribute(String, String)
- */
- public final void setAttribute(String id, String value) {
- serverWC.setAttribute(id, value);
- }
-
- /**
- * Sets the value of the specified list-valued attribute of this
- * element. The list may only contain String values.
- *
- * @param id the attribute id
- * @param value the value of the specified attribute
- * @see #getAttribute(String, List)
- */
- public final void setAttribute(String id, List value) {
- serverWC.setAttribute(id, value);
- }
-
- /**
- * Sets the value of the specified map-valued attribute of this
- * element. The map may only contain String values.
- *
- * @param id the attribute id
- * @param value the value of the specified attribute
- * @see #getAttribute(String, Map)
- */
- public final void setAttribute(String id, Map value) {
- serverWC.setAttribute(id, value);
- }
-
- /**
- * Modifies the list of modules associated with the server.
- * See the specification of
- * {@link IServerWorkingCopy#modifyModules(IModule[], IModule[], IProgressMonitor)}
- * for further details.
- * <p>
- * This method is called by the web server core framework,
- * in response to a call to <code>IServerWorkingCopy.modifyModules</code>.
- * Clients should never call this method.
- * </p>
- * <p>
- * This method is called to update the server configuration (if any)
- * or update the delegates internal state. Note that the actual list
- * of modules is stored on the server and can be accessed at any time
- * using server.getModules(). getModules() will not be updated until
- * after this method successfully returns.
- * </p>
- * <p>
- * This method will not communicate with the server. After saving,
- * publish() can be used to sync up with the server.
- * </p>
- *
- * @param add a possibly-empty list of modules to add
- * @param remove a possibly-empty list of modules to remove
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @throws CoreException [missing]
- */
- public abstract void modifyModules(IModule[] add, IModule[] remove, IProgressMonitor monitor) throws CoreException;
-
- /**
- * This method is called to import the server configuration from the given
- * runtime.
- *
- * @param runtime
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- */
- public void importConfiguration(IRuntime runtime, IProgressMonitor monitor) {
- // do nothing
- }
-
- /**
- * This method is called whenever the server configuration should be saved.
- *
- * @param monitor
- * @throws CoreException
- */
- public void saveConfiguration(IProgressMonitor monitor) throws CoreException {
- // do nothing
- }
-
- /**
- * This method is called whenever the server configuration folder has changed.
- * It gives the server a chance to throw out any old data and be ready to
- * reload the server configuration when it is needed next.
- */
- public void configurationChanged() {
- // do nothing
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ServerLocatorDelegate.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ServerLocatorDelegate.java
deleted file mode 100644
index 49d64b4..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ServerLocatorDelegate.java
+++ /dev/null
@@ -1,46 +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.core.model;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.wst.server.core.IServerWorkingCopy;
-/**
- * A server locator provides the ability to locate or search for additional
- * server of a particular type, on a particular host.
- * <p>
- * This abstract class is intended to be extended only by clients
- * to extend the <code>serverLocators</code> extension point.
- * </p>
- *
- * @since 1.0
- */
-public abstract class ServerLocatorDelegate {
- public interface IServerSearchListener {
- /**
- * Called when a new server is found by the locator.
- * The server must never be null.
- *
- * @param server the runtime that was found.
- */
- public void serverFound(IServerWorkingCopy server);
- }
-
- /**
- * Searches for servers.
- * It uses the callback listener to report servers that are found.
- *
- * @param host a host string conforming to RFC 2732
- * @param listener a listener to report status to
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- */
- public abstract void searchForServers(String host, IServerSearchListener listener, IProgressMonitor monitor);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ServerTaskDelegate.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ServerTaskDelegate.java
deleted file mode 100644
index c204dc5..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ServerTaskDelegate.java
+++ /dev/null
@@ -1,32 +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.core.model;
-
-import java.util.List;
-
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IOptionalTask;
-import org.eclipse.wst.server.core.IServer;
-/**
- * A server task delegate.
- *
- * <p>This is the implementation of a serverTask extension point.</p>
- *
- * @since 1.0
- */
-public abstract class ServerTaskDelegate {
- /**
- * Returns the tasks that should be performed on the server.
- *
- * @return the tasks that should be performed on the server.
- */
- public abstract IOptionalTask[] getTasks(IServer server, List[] parents, IModule[] modules);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/package.xml b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/package.xml
deleted file mode 100644
index 66c45c7..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/package.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<html>
-<head>
- <!-- Escape to the root of your source folder -->
- <meta
- name="root"
- content="../../../../../../" />
- <title>WTP API overview</title>
-</head>
-
-<body>
-
-<p>SPI support for the server tools framework.</p>
-
-<p>The classes in this package would typically be extended or used by
-SPI clients of the server tools framework who are providing a new server
-type, runtime type, or other extension. These delegates are never visible
-to regular API clients unless explicitly exposed by the provider.</p>
-
-<p>The majority of these classes are delegates to implement one of the
-extension points. View the extension point documentation for further
-details.</p>
-
-</body>
-</html>
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/package.xml b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/package.xml
deleted file mode 100644
index 6805ddb..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/package.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<html>
-<head>
- <!-- Escape to the root of your source folder -->
- <meta
- name="root"
- content="../../../../../../" />
- <title>WTP API overview</title>
-</head>
-
-<body>
-
-<p>The main server tools framework client API.</p>
-
-<p>ServerCore is the main entry-point and provides access to most of the
-remaining API. From here, you can get the existing server runtimes and
-servers, get the available server types, and access interfaces for all
-extension points.</p>
-
-<p>ServerUtil provides utility and convenience methods for dealing with
-server tools. It provides easy access to modules, server runtimes, and
-what combinations are supported (e.g. which runtimes can be used to
-target a particular project).</p>
-
-<p>IRuntime and IServer are the two main API objects. IRuntime is used
-to target projects to a particular server installation and compile/build
-against them. When a runtime is targetted to a particular runtime,
-all of the applicable IRuntimeTargetHandler extensions are called to
-set the classpath or modify other project settings for the runtime.</p>
-
-<p>IServer is the main server class that clients can use to start/stop
-and publish to servers.</p>
-
-<p>IModules provide the "content" that can be published to servers.
-See the server tools API overview for more information.</p>
-
-</body>
-</html>
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/HttpLaunchable.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/HttpLaunchable.java
deleted file mode 100644
index e163c79..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/HttpLaunchable.java
+++ /dev/null
@@ -1,47 +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.core.util;
-
-import java.net.URL;
-
-import org.eclipse.wst.server.core.ILaunchable;
-/**
- *
- * @since 1.0
- */
-public class HttpLaunchable implements ILaunchable {
- private URL url;
-
- /**
- * Create a reference to something accessible via HTTP.
- *
- * @param url the URL to the object
- */
- public HttpLaunchable(URL url) {
- this.url = url;
- }
-
- /**
- * Return the URL to the object.
- *
- * @return the URL to the object
- */
- public URL getURL() {
- return url;
- }
-
- /*
- * @see Object#toString()
- */
- public String toString() {
- return "HttpLaunchable[url=" + url.toString() + "]";
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/IStaticWeb.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/IStaticWeb.java
deleted file mode 100644
index 97471a4..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/IStaticWeb.java
+++ /dev/null
@@ -1,25 +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.core.util;
-/**
- * A static Web module that could be deployed to Apache or another
- * HTTP server.
- *
- * @since 1.0
- */
-public interface IStaticWeb {
- /**
- * Returns the context root of the Web.
- *
- * @return java.lang.String
- */
- public String getContextRoot();
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/NullModuleArtifact.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/NullModuleArtifact.java
deleted file mode 100644
index 80cc6cf..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/NullModuleArtifact.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.core.util;
-
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IModuleArtifact;
-/**
- *
- * @since 1.0
- */
-public class NullModuleArtifact implements IModuleArtifact {
- private IModule module;
-
- public NullModuleArtifact(IModule module) {
- this.module = module;
- }
-
- public IModule getModule() {
- return module;
- }
-
- public String toString() {
- return "NullModuleArtifact [module=" + module + "]";
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/PingThread.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/PingThread.java
deleted file mode 100644
index beadfef..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/PingThread.java
+++ /dev/null
@@ -1,125 +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.core.util;
-
-import java.io.FileNotFoundException;
-import java.net.HttpURLConnection;
-import java.net.URL;
-import java.net.URLConnection;
-
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.internal.Trace;
-import org.eclipse.wst.server.core.model.ServerBehaviourDelegate;
-/**
- * Thread used to ping server to test when it is started.
- *
- * @since 1.0
- */
-public class PingThread {
- // delay before pinging starts
- private static final int PING_DELAY = 2000;
-
- // delay between pings
- private static final int PING_INTERVAL = 250;
-
- // maximum number of pings before giving up
- private int maxPings = 56; // total: 16 seconds + connection time
-
- private boolean stop = false;
- private String url;
- private ServerBehaviourDelegate server;
- private IServer server2;
-
- /**
- * Create a new PingThread.
- *
- * @param server2
- * @param server
- * @param url
- * @param maxPings
- */
- public PingThread(IServer server2, ServerBehaviourDelegate server, String url, int maxPings) {
- super();
- this.server = server;
- this.server2 = server2;
- this.url = url;
- this.maxPings = maxPings;
- Thread t = new Thread() {
- public void run() {
- ping();
- }
- };
- t.setDaemon(true);
- t.start();
- }
-
- /**
- * Ping the server until it is started. Then set the server
- * state to STATE_STARTED.
- */
- protected void ping() {
- int count = 0;
- try {
- Thread.sleep(PING_DELAY);
- } catch (Exception e) {
- // ignore
- }
- while (!stop) {
- try {
- if (count == maxPings) {
- server2.stop(false);
- stop = true;
- break;
- }
- count++;
-
- Trace.trace(Trace.FINEST, "Ping: pinging");
- URL pingUrl = new URL(url);
- URLConnection conn = pingUrl.openConnection();
- ((HttpURLConnection)conn).getResponseCode();
-
- // ping worked - server is up
- if (!stop) {
- Trace.trace(Trace.FINEST, "Ping: success");
- Thread.sleep(200);
- server.setServerState(IServer.STATE_STARTED);
- }
- stop = true;
- } catch (FileNotFoundException fe) {
- try {
- Thread.sleep(200);
- } catch (Exception e) {
- // ignore
- }
- server.setServerState(IServer.STATE_STARTED);
- stop = true;
- } catch (Exception e) {
- Trace.trace(Trace.FINEST, "Ping: failed");
- // pinging failed
- if (!stop) {
- try {
- Thread.sleep(PING_INTERVAL);
- } catch (InterruptedException e2) {
- // ignore
- }
- }
- }
- }
- }
-
- /**
- * Tell the pinging to stop.
- */
- public void stopPinging() {
- Trace.trace(Trace.FINEST, "Ping: stopping");
- stop = true;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/ProjectModule.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/ProjectModule.java
deleted file mode 100644
index 5adcf86..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/ProjectModule.java
+++ /dev/null
@@ -1,330 +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.core.util;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
-
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.internal.ModuleFile;
-import org.eclipse.wst.server.core.internal.ModuleFolder;
-import org.eclipse.wst.server.core.internal.Trace;
-import org.eclipse.wst.server.core.model.*;
-/**
- * A simple IModuleProject that maps a folder within a project
- * (or the root of the project itself) to the module.
- *
- * @since 1.0
- */
-public abstract class ProjectModule extends ModuleDelegate {
- protected IProject project;
- protected IPath root;
-
- // change listeners
- private transient List listeners;
-
- public ProjectModule() {
- // do nothing
- }
-
- public ProjectModule(IProject project) {
- this.project = project;
- }
-
- /*
- * @see IModuleProject#getProject()
- */
- public IProject getProject() {
- return project;
- }
-
- /**
- * Returns the root folder. The root folder is the project relative path
- * that points to the root directory of the module. All resources contained
- * within this folder belong to the module.
- *
- * @return the root project-relative folder that contains the contents
- * of the module
- */
- public IPath getRootFolder() {
- return root;
- }
-
- /*
- * @see IModuleProject#getModuleResourceDelta(IResourceDelta)
- */
- /*public IModuleResourceDelta getModuleResourceDelta(IResourceDelta delta) {
- Trace.trace(Trace.FINEST, "> getModuleResourceDelta");
- IPath root2 = null;
- try {
- root2 = getRootFolder();
- } catch (Exception e) {
- Trace.trace(Trace.FINEST, "Error getting root2");
- }
- if (root2 == null) {
- return convertChildren(delta, null);
- }
- class Helper {
- boolean found = false;
- IModuleResourceDelta delta2;
- }
- final Helper helper = new Helper();
- final IPath root3 = root2;
- try {
- delta.accept(new IResourceDeltaVisitor() {
- public boolean visit(IResourceDelta visitDelta) {
- if (!helper.found && root3.equals(visitDelta.getProjectRelativePath())) {
- helper.delta2 = convertChildren(visitDelta, null);
- helper.found = true;
- return false;
- }
- return true;
- }
- });
- Trace.trace(Trace.FINEST, "< getModuleResourceDelta");
- return helper.delta2;
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not get module resource delta");
- }
- Trace.trace(Trace.FINEST, "< getModuleResourceDelta null");
- return null;
- }*/
-
- /**
- *
- */
- /*protected IModuleResourceDelta convertChildren(IResourceDelta delta, IModuleFolder parent) {
- int flags = delta.getKind();
- int kind = IModuleResourceDelta.NO_CHANGE;
- if (flags == IResourceDelta.ADDED)
- kind = IModuleResourceDelta.ADDED;
- else if (flags == IResourceDelta.REMOVED)
- kind = IModuleResourceDelta.REMOVED;
- else if (flags == IResourceDelta.CHANGED)
- kind = IModuleResourceDelta.CHANGED;
-
- IResource resource = delta.getResource();
-
- IModuleResource pubResource = null;
- if (resource instanceof IContainer)
- pubResource = new ProjectModuleFolder(this, parent, (IContainer) resource);
- else if (resource instanceof IFile) {
- if (delta.getFlags() == IResourceDelta.MARKERS)
- return null;
- pubResource = new ProjectModuleFile(this, parent, (IFile) resource);
- }
-
- ModuleResourceDelta deployDelta = new ModuleResourceDelta(pubResource, kind);
-
- IResourceDelta[] children = delta.getAffectedChildren();
- if (children != null && pubResource instanceof IModuleFolder) {
- int size = children.length;
- for (int i = 0; i < size; i++) {
- IModuleResourceDelta childDelta = convertChildren(children[i], (IModuleFolder) pubResource);
- if (childDelta != null)
- deployDelta.addChild(childDelta);
- }
- }
- return deployDelta;
- }*/
-
- /*
- * Helper method - returns the module's id.
- *
- * @see ModuleDelegate#getId()
- */
- public String getId() {
- return getProject().getName();
- //return getModule().getId();
- }
-
- /*
- * @see ModuleDelegate#validate()
- */
- public IStatus validate() {
- return null;
- }
-
- /*
- * @see ModuleDelegate#members()
- */
- public IModuleResource[] members() throws CoreException {
- IPath root2 = null;
- try {
- root2 = getRootFolder();
- } catch (Exception e) {
- // ignore
- }
- try {
- if (root2 == null || root2.isRoot() || root2.equals(new Path("")) || root2.equals(new Path("/")))
- return getModuleResources(Path.EMPTY, getProject());
-
- IFolder folder = project.getFolder(root2);
- return getModuleResources(Path.EMPTY, folder);
- } catch (CoreException e) {
- throw e;
- }
- }
-
- protected IModuleResource[] getModuleResources(IPath path, IContainer container) throws CoreException {
- List list = new ArrayList();
-
- IResource[] resources = container.members();
- if (resources != null) {
- int size = resources.length;
- for (int i = 0; i < size; i++) {
- IResource resource = resources[i];
- if (resource instanceof IContainer) {
- IContainer container2 = (IContainer) resource;
- ModuleFolder mf = new ModuleFolder(container2.getName(), path);
- mf.setMembers(getModuleResources(path.append(container2.getName()), container2));
- list.add(mf);
- } else if (resource instanceof IFile) {
- IFile file = (IFile) resource;
- list.add(new ModuleFile(file.getName(), path, file.getModificationStamp()));
- }
- }
- }
-
- IModuleResource[] moduleResources = new IModuleResource[list.size()];
- list.toArray(moduleResources);
- return moduleResources;
- }
-
- /**
- * Helper method - returns the module's name.
- */
- public String getName() {
- return getProject().getName();
- //return getModule().getName();
- }
-
- /**
- * Returns true if this module currently exists, and false if it has
- * been deleted or moved and is no longer represented by this module.
- *
- * @return boolean
- */
- public boolean exists() {
- return (getProject() != null && getProject().exists());
- }
-
- /**
- *
- */
- public boolean equals(Object obj) {
- if (obj == null || !(obj instanceof ProjectModule))
- return false;
-
- ProjectModule dp = (ProjectModule) obj;
- //if (getFactoryId() != null && !getFactoryId().equals(dp.getFactoryId()))
- // return false;
-
- IPath root2 = null;
- try {
- root2 = getRootFolder();
- } catch (Exception e) {
- // ignore
- }
-
- IPath root3 = null;
- try {
- root3 = dp.getRootFolder();
- } catch (Exception e) {
- // ignore
- }
-
- if (project != null && project.exists() && !project.equals(dp.getProject()))
- return false;
-
- if (getId() != null && !getId().equals(dp.getId()))
- return false;
-
- if (root2 == null && root3 != null)
- return false;
- if (root2 != null && !root2.equals(root3))
- return false;
-
- return true;
- }
-
- /**
- * Add a listener for the module.
- *
- * @param listener org.eclipse.wst.server.core.model.IModuleListener
- */
- public void addModuleListener(IModuleListener listener) {
- Trace.trace(Trace.FINEST, "Adding module listener " + listener + " to " + this);
-
- if (listeners == null)
- listeners = new ArrayList();
- else if (listeners.contains(listener))
- return;
- listeners.add(listener);
- }
-
- /**
- * Add a listener for the module.
- *
- * @param listener org.eclipse.wst.server.core.model.IModuleListener
- */
- public void removeModuleListener(IModuleListener listener) {
- Trace.trace(Trace.FINEST, "Removing module listener " + listener + " from " + this);
-
- if (listeners != null)
- listeners.remove(listener);
- }
-
- /**
- * Fire a module change event.
- */
- protected void fireModuleChangeEvent(boolean isChange, IModule[] added, IModule[] changed, IModule[] removed) {
- Trace.trace(Trace.FINEST, "->- Firing module change event: " + getModule().getName() + " (" + isChange + ") ->-");
-
- if (listeners == null || listeners.isEmpty())
- return;
-
- int size = listeners.size();
- IModuleListener[] dcl = new IModuleListener[size];
- listeners.toArray(dcl);
-
- ModuleEvent event = new ModuleEvent(getModule(), isChange, added, changed, removed);
-
- for (int i = 0; i < size; i++) {
- try {
- Trace.trace(Trace.FINEST, " Firing module change event to: " + dcl[i]);
- dcl[i].moduleChanged(event);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, " Error firing module change event", e);
- }
- }
- Trace.trace(Trace.FINEST, "-<- Done firing module change event -<-");
- }
-
- /**
- * Called when the listener paths from the module factory change.
- * Use this method to re-cache information about the module.
- */
- protected void update() {
- // do nothing
- }
-
- /**
- * Returns the child modules of this module.
- *
- * @return org.eclipse.wst.server.core.model.IModule[]
- */
- public IModule[] getChildModules() {
- return null;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/ProjectModuleFactoryDelegate.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/ProjectModuleFactoryDelegate.java
deleted file mode 100644
index 26ddeda..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/ProjectModuleFactoryDelegate.java
+++ /dev/null
@@ -1,352 +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.core.util;
-
-import java.util.*;
-
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.IPath;
-
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.internal.ResourceManager;
-import org.eclipse.wst.server.core.internal.Trace;
-import org.eclipse.wst.server.core.model.ModuleFactoryDelegate;
-/**
- *
- *
- * @since 1.0
- */
-public abstract class ProjectModuleFactoryDelegate extends ModuleFactoryDelegate {
- protected static IResourceChangeListener listener;
-
- protected static List factories = new ArrayList();
-
- protected List added;
- protected List removed;
-
- // map from IProject to IModuleProject
- protected Map projects;
-
- /**
- * Construct a new ProjectModuleFactoryDelegate.
- */
- public ProjectModuleFactoryDelegate() {
- super();
-
- factories.add(this);
-
- addListener();
- }
-
- /**
- * Cache any preexisting module.
- */
- protected void cacheModules() {
- projects = new HashMap();
- try {
- IProject[] projects2 = getWorkspaceRoot().getProjects();
- int size = projects2.length;
- for (int i = 0; i < size; i++) {
- //Trace.trace("caching: " + this + " " + projects[i] + " " + isValidModule(projects[i]));
- if (isValidModule(projects2[i])) {
- addModuleProject(projects2[i]);
- }
- }
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error caching modules", e);
- }
- fireEvents();
- }
-
- /**
- * Return the workspace root.
- *
- * @return org.eclipse.core.resources.IWorkspaceRoot
- */
- protected static IWorkspaceRoot getWorkspaceRoot() {
- return ResourcesPlugin.getWorkspace().getRoot();
- }
-
- /**
- * Returns the module project for the given project, or null
- * if this factory does not have a module for the given project.
- *
- * @param project org.eclipse.core.resources.IProject
- * @return org.eclipse.wst.server.core.model.IModuleProject
- */
- public IModule getModuleProject(IProject project) {
- try {
- return (IModule) projects.get(project);
- } catch (Exception e) {
- // ignore
- }
- return null;
- }
-
- /**
- * Add a resource listener to the workspace.
- */
- protected static void addListener() {
- if (listener != null)
- return;
-
- listener = new IResourceChangeListener() {
- public void resourceChanged(IResourceChangeEvent event) {
- Trace.trace(Trace.FINEST, "->- ProjectModuleFactoryDelegate listener responding to resource change: " + event.getType() + " ->-");
- try {
- IResourceDelta delta = event.getDelta();
-
- //if (delta.getFlags() == IResourceDelta.MARKERS || delta.getFlags() == IResourceDelta.NO_CHANGE)
- // return;
-
- delta.accept(new IResourceDeltaVisitor() {
- public boolean visit(IResourceDelta visitorDelta) {
- IResource resource = visitorDelta.getResource();
- //Trace.trace(Trace.FINEST, "resource: " + resource);
-
- // only respond changes within projects
- if (resource != null && resource instanceof IProject) {
- IProject project = (IProject) resource;
- handleGlobalProjectChange(project, visitorDelta);
- return true;
- } else if (resource != null && resource.getProject() != null) {
- return false;
- } else
- return true;
- }
- });
- } catch (Exception e) {
- //Trace.trace(Trace.SEVERE, "Error responding to resource change", e);
- }
- fireGlobalEvents();
- Trace.trace(Trace.FINEST, "-<- Done ProjectModuleFactoryDelegate responding to resource change -<-");
- }
- };
-
- ResourcesPlugin.getWorkspace().addResourceChangeListener(listener, IResourceChangeEvent.POST_CHANGE);
- }
-
- /**
- * Handle changes to a project.
- *
- * @param project org.eclipse.core.resources.IProject
- * @param delta org.eclipse.core.resources.IResourceDelta
- */
- protected static void handleGlobalProjectChange(final IProject project, IResourceDelta delta) {
- // handle project level changes
- Iterator iterator = factories.iterator();
- while (iterator.hasNext()) {
- ProjectModuleFactoryDelegate factory = (ProjectModuleFactoryDelegate) iterator.next();
- //Trace.trace("Firing to: " + factory);
- factory.handleProjectChange(project, delta);
- }
-
- // handle internal updates
- iterator = factories.iterator();
- while (iterator.hasNext()) {
- ProjectModuleFactoryDelegate factory = (ProjectModuleFactoryDelegate) iterator.next();
- //Trace.trace("Firing to: " + factory);
- factory.handleProjectInternalChange(project, delta);
- }
- }
-
- /**
- * Fire the accumulated module factory events.
- */
- protected static void fireGlobalEvents() {
- Trace.trace(Trace.FINEST, "Firing global module event");
- Iterator iterator = factories.iterator();
- while (iterator.hasNext()) {
- ProjectModuleFactoryDelegate factory = (ProjectModuleFactoryDelegate) iterator.next();
- factory.updateProjects();
- }
-
- iterator = factories.iterator();
- while (iterator.hasNext()) {
- ProjectModuleFactoryDelegate factory = (ProjectModuleFactoryDelegate) iterator.next();
- factory.fireEvents();
- }
-
- ResourceManager.getInstance().syncModuleEvents();
- }
-
- /**
- * Temporary to make sure that all project modules are updated.
- */
- private void updateProjects() {
- IModule[] modules2 = getModules();
- if (modules2 != null) {
- int size = modules2.length;
- for (int i = 0; i < size; i++) {
- if (modules2[i] instanceof ProjectModule)
- ((ProjectModule) modules2[i]).update();
- }
- }
- }
-
- /**
- * Handle changes to a project.
- *
- * @param project org.eclipse.core.resources.IProject
- * @param delta org.eclipse.core.resources.IResourceDelta
- */
- protected void handleProjectChange(final IProject project, IResourceDelta delta) {
- if (projects.containsKey(project)) {
- // already a module
- if (((delta.getKind() & IResourceDelta.REMOVED) != 0) || !isValidModule(project)) {
- removeModuleProject(project);
- }
- } else {
- // not a module
- if (isValidModule(project)) {
- addModuleProject(project);
- }
- }
- }
-
- /**
- * Handle changes to a project.
- *
- * @param project org.eclipse.core.resources.IProject
- * @param delta org.eclipse.core.resources.IResourceDelta
- */
- protected void handleProjectInternalChange(final IProject project, IResourceDelta delta) {
- final IPath[] paths = getListenerPaths();
- if (paths != null) {
- final IModule module = getModuleProject(project);
- if (module != null && module instanceof ProjectModule) {
- // check for any changes to the module
- final IPath root = ((ProjectModule) module).getRootFolder();
- IResourceDelta rootDelta = delta.findMember(root);
- if (rootDelta != null)
- ((ProjectModule) module).fireModuleChangeEvent(true, null, null, null);
-
- // check for listener paths
- final int size = paths.length;
- class Temp {
- boolean found = false;
- }
- final Temp temp = new Temp();
- try {
- delta.accept(new IResourceDeltaVisitor() {
- public boolean visit(IResourceDelta visitorDelta) {
- if (temp.found)
- return false;
- IPath path = visitorDelta.getProjectRelativePath();
-
- boolean prefix = false;
- for (int i = 0; i < size && !temp.found; i++) {
- if (paths[i].equals(path))
- temp.found = true;
- else if (path.isPrefixOf(paths[i]))
- prefix = true;
- }
- if (temp.found) {
- ((ProjectModule) module).update();
- return false;
- } else if (prefix)
- return true;
- else
- return false;
- }
- });
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error searching for listening paths", e);
- }
- }
- }
- }
-
- /**
- * Add a module for the given project.
- *
- * @param project org.eclipse.core.resources.IProject
- */
- protected void addModuleProject(IProject project) {
- IModule module = createModule(project);
- if (module == null)
- return;
- projects.put(project, module);
- //modules.put(module.getId(), module);
- if (added == null)
- added = new ArrayList(2);
- added.add(module);
- }
-
- /**
- * Remove the module that represents the given project.
- *
- * @param project org.eclipse.core.resources.IProject
- */
- protected void removeModuleProject(IProject project) {
- try {
- IModule module = (IModule) projects.get(project);
- projects.remove(project);
- //modules.remove(module.getId());
- if (removed == null)
- removed = new ArrayList(2);
- removed.add(module);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error removing module project", e);
- }
- }
-
- /**
- * Fire the accumulated module factory events.
- */
- protected void fireEvents() {
- if ((added == null || added.isEmpty()) && (removed == null || removed.isEmpty()))
- return;
-
- IModule[] add = null;
- if (added != null) {
- add = new IModule[added.size()];
- added.toArray(add);
- }
- IModule[] remove = null;
- if (removed != null) {
- remove = new IModule[removed.size()];
- removed.toArray(remove);
- }
-
- fireModuleFactoryEvent(add, remove);
- added = new ArrayList(2);
- removed = new ArrayList(2);
- }
-
- /**
- * Returns true if the project represents a module project
- * of this type.
- *
- * @param project org.eclipse.core.resources.IProject
- * @return boolean
- */
- protected abstract boolean isValidModule(IProject project);
-
- /**
- * Creates the module project for the given project.
- *
- * @param project org.eclipse.core.resources.IProject
- * @return org.eclipse.wst.server.core.model.IModuleProject
- */
- protected abstract IModule createModule(IProject project);
-
- /**
- * Returns the list of resources that the module should listen to
- * for state changes. The paths should be project relative paths.
- * Subclasses can override this method to provide the paths.
- *
- * @return org.eclipse.core.runtime.IPath[]
- */
- protected IPath[] getListenerPaths() {
- return null;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/RuntimeLifecycleAdapter.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/RuntimeLifecycleAdapter.java
deleted file mode 100644
index 63b55dd..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/RuntimeLifecycleAdapter.java
+++ /dev/null
@@ -1,34 +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.core.util;
-
-import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.IRuntimeLifecycleListener;
-/**
- * Helper class which implements the IRuntimeLifecycleListener interface
- * with empty methods.
- *
- * @see org.eclipse.wst.server.core.IRuntimeLifecycleListener
- * @since 1.0
- */
-public class RuntimeLifecycleAdapter implements IRuntimeLifecycleListener {
- public void runtimeAdded(IRuntime runtime) {
- // do nothing
- }
-
- public void runtimeChanged(IRuntime runtime) {
- // do nothing
- }
-
- public void runtimeRemoved(IRuntime runtime) {
- // do nothing
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/ServerAdapter.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/ServerAdapter.java
deleted file mode 100644
index bd95260..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/ServerAdapter.java
+++ /dev/null
@@ -1,43 +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.core.util;
-
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.IServerListener;
-/**
- * Helper class which implements the IServerListener interface
- * with empty methods.
- *
- * @see org.eclipse.wst.server.core.IServerListener
- * @since 1.0
- */
-public class ServerAdapter implements IServerListener {
- public void configurationSyncStateChange(IServer server) {
- // do nothing
- }
-
- public void restartStateChange(IServer server) {
- // do nothing
- }
-
- public void serverStateChange(IServer server) {
- // do nothing
- }
-
- public void modulesChanged(IServer server) {
- // do nothing
- }
-
- public void moduleStateChange(IServer server, IModule[] parents, IModule module) {
- // do nothing
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/ServerLifecycleAdapter.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/ServerLifecycleAdapter.java
deleted file mode 100644
index 581561b..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/ServerLifecycleAdapter.java
+++ /dev/null
@@ -1,34 +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.core.util;
-
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.IServerLifecycleListener;
-/**
- * Helper class which implements the IServerLifecycleListener interface
- * with empty methods.
- *
- * @see org.eclipse.wst.server.core.IServerLifecycleListener
- * @since 1.0
- */
-public class ServerLifecycleAdapter implements IServerLifecycleListener {
- public void serverAdded(IServer server) {
- // do nothing
- }
-
- public void serverChanged(IServer server) {
- // do nothing
- }
-
- public void serverRemoved(IServer server) {
- // do nothing
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/ServerPort.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/ServerPort.java
deleted file mode 100644
index 84cd41f..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/ServerPort.java
+++ /dev/null
@@ -1,125 +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.core.util;
-
-import org.eclipse.wst.server.core.IServerPort;
-/**
- * A default implementation of the IServerPort interface.
- *
- * @since 1.0
- */
-public class ServerPort implements IServerPort {
- private String id;
- private String name;
- private int port;
- private String protocol;
- private String[] contentTypes;
- private boolean advanced;
-
- /**
- * ServerPort constructor comment.
- */
- public ServerPort(String id, String name, int port, String protocol) {
- this(id, name, port, protocol, null, true);
- }
-
- public ServerPort(String id, String name, int port, String protocol, boolean advanced) {
- this(id, name, port, protocol, null, advanced);
- }
-
- public ServerPort(String id, String name, int port, String protocol, String[] contentTypes, boolean advanced) {
- super();
- this.id = id;
- this.name = name;
- this.port = port;
- this.protocol = protocol;
- this.contentTypes = contentTypes;
- this.advanced = advanced;
- }
-
- /**
- * ServerPort constructor comment.
- */
- public ServerPort(String name, int port, String protocol) {
- this(null, name, port, protocol);
- }
-
- /**
- * Return an optional internal id used to identify this port.
- *
- * @return java.lang.String
- */
- public String getId() {
- return id;
- }
-
- /**
- * Return the name of the port.
- *
- * @return java.lang.String
- */
- public String getName() {
- return name;
- }
-
- /**
- * Return the actual port number.
- * @return int
- */
- public int getPort() {
- return port;
- }
-
- /**
- * Returns the protocol, e.g. HTTP of this port. Returns null
- * if the protocol is unknown.
- *
- * @return java.lang.String
- */
- public String getProtocol() {
- return protocol;
- }
-
- /**
- * Returns the content that this port would normally serve, or null
- * if the content is unknown.
- *
- * @return java.lang.String[]
- */
- public String[] getContentTypes() {
- return contentTypes;
- }
-
- /**
- * Returns true if this port is an "advanced" port and should not be shown
- * to novice users.
- *
- * @return boolean
- */
- public boolean isAdvanced() {
- return advanced;
- }
-
- public boolean equals(Object obj) {
- if (!(obj instanceof ServerPort))
- return false;
- ServerPort sp = (ServerPort) obj;
- return (sp.port == port);
- }
-
- public int hashCode() {
- return port;
- }
-
- public String toString() {
- return "ServerPort [" + getName() + ", " + getId() + ", " + getPort() + ", " + getProtocol() + "]";
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/SocketUtil.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/SocketUtil.java
deleted file mode 100644
index 25de3ba..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/SocketUtil.java
+++ /dev/null
@@ -1,166 +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.core.util;
-
-import java.io.IOException;
-import java.net.InetAddress;
-import java.net.ServerSocket;
-import java.net.SocketException;
-import java.util.Random;
-
-import org.eclipse.wst.server.core.internal.Trace;
-
-import sun.net.spi.nameservice.dns.DNSNameService;
-/**
- * A utility class for socket-related function. It's main purposes are to find
- * unused ports, check whether a port is in use, and check whether a given
- * address is a local(host) address.
- *
- * @since 1.0
- */
-public class SocketUtil {
- private static final Random rand = new Random(System.currentTimeMillis());
-
- private static String dnsHostname;
-
- /**
- * Finds an unused port between the given from and to values.
- *
- * @param low lowest possible port number
- * @param high highest possible port number
- * @return an usused port number, or <code>-1</code> if no used ports could be found
- */
- public static int findUnusedPort(int low, int high) {
- if (high < low)
- return -1;
-
- for (int i = 0; i < 10; i++) {
- int port = getRandomPort(low, high);
- if (!isPortInUse(port))
- return port;
- }
- return -1;
- }
-
- /**
- * Return a random port number in the given range.
- *
- * @param low lowest possible port number
- * @param high highest possible port number
- * @return a random port number in the given range
- */
- private static int getRandomPort(int low, int high) {
- return rand.nextInt(high - low) + low;
- }
-
- /**
- * Checks to see if the given port number is being used.
- * Returns <code>true</code> if the given port is in use, and <code>false</code>
- * otherwise. Retries every 500ms for "count" tries.
- *
- * @param port the port number to check
- * @param count the number of times to retry
- * @return boolean <code>true</code> if the port is in use, and
- * <code>false</code> otherwise
- */
- public static boolean isPortInUse(int port, int count) {
- boolean inUse = isPortInUse(port);
- while (inUse && count > 0) {
- try {
- Thread.sleep(500);
- } catch (Exception e) {
- // ignore
- }
- inUse = isPortInUse(port);
- count --;
- }
-
- return inUse;
- }
-
- /**
- * Checks to see if the given port number is being used.
- * Returns <code>true</code> if the given port is in use, and <code>false</code>
- * otherwise.
- *
- * @param port the port number to check
- * @return boolean <code>true</code> if the port is in use, and
- * <code>false</code> otherwise
- */
- public static boolean isPortInUse(int port) {
- ServerSocket s = null;
- try {
- s = new ServerSocket(port);
- } catch (SocketException e) {
- return true;
- } catch (IOException e) {
- return true;
- } catch (Exception e) {
- return true;
- } finally {
- if (s != null) {
- try {
- s.close();
- } catch (Exception e) {
- // ignore
- }
- }
- }
-
- return false;
- }
-
- /**
- * Checks if the given host (name or IP address) is pointing to the local
- * machine.
- * Although this method is not foolproof (especially if the network
- * configuration of the current machine is incorrect or failing), it will
- * correctly identify just about all loopback adapters and the local hostname
- * or IP address.
- * <p>
- * This method will not attempt to make an external network connection, so
- * it returns quickly and is safe to use in UI interfaces.
- * </p>
- *
- * @param host a hostname or IP address
- * @return <code>true</code> if the given host is localhost, and
- * <code>false</code> otherwise
- */
- public static boolean isLocalhost(String host) {
- if (host == null)
- return false;
- try {
- if ("localhost".equals(host) || "127.0.0.1".equals(host))
- return true;
-
- InetAddress localHostaddr = InetAddress.getLocalHost();
- if (localHostaddr.getHostName().equals(host) || host.equals(localHostaddr.getCanonicalHostName()))
- return true;
-
- if (localHostaddr.getHostAddress().equals(host))
- return true;
-
- if (dnsHostname == null)
- try {
- DNSNameService dns = new DNSNameService();
- dnsHostname = dns.getHostByAddr(localHostaddr.getAddress());
- } catch (Throwable t) {
- dnsHostname = "*****************";
- }
-
- if (dnsHostname != null && dnsHostname.equals(host))
- return true;
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Error checking for localhost", e);
- }
- return false;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/Task.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/Task.java
deleted file mode 100644
index c0f4d4e..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/Task.java
+++ /dev/null
@@ -1,91 +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.core.util;
-
-import org.eclipse.wst.server.core.*;
-/**
- * An abstract implementation of the org.eclipse.wst.server.core.ITask interface
- * that provides default implementation of the methods.
- *
- * @since 1.0
- */
-public abstract class Task implements ITask {
- private TaskModel model;
- private String name;
- private String description;
-
- /**
- * Create a new task with no name or description.
- */
- public Task() {
- // do nothing
- }
-
- /**
- * Create a new task with the given label and description.
- *
- * @param name
- * @param description
- */
- public Task(String name, String description) {
- this.name = name;
- this.description = description;
- }
-
- /*
- * @see org.eclipse.wst.server.core.ITask.getName()
- */
- public String getName() {
- return name;
- }
-
- /*
- * @see org.eclipse.wst.server.core.ITask.getDescription()
- */
- public String getDescription() {
- return description;
- }
-
- /*
- * @see org.eclipse.wst.server.core.ITask.getTaskModel()
- */
- public TaskModel getTaskModel() {
- return model;
- }
-
- /*
- * @see org.eclipse.wst.server.core.ITask.setTaskModel(org.eclipse.wst.server.core.TaskModel)
- */
- public void setTaskModel(TaskModel taskModel) {
- this.model = taskModel;
- }
-
- /*
- * @see org.eclipse.wst.server.core.ITask.canExecute()
- */
- public boolean canExecute() {
- return true;
- }
-
- /*
- * @see org.eclipse.wst.server.core.ITask.canUndo()
- */
- public boolean canUndo() {
- return false;
- }
-
- /*
- * @see org.eclipse.wst.server.core.ITask.undo()
- */
- public void undo() {
- // do nothing
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/WebResource.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/WebResource.java
deleted file mode 100644
index 6e9d123..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/WebResource.java
+++ /dev/null
@@ -1,41 +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.core.util;
-
-import org.eclipse.core.runtime.IPath;
-
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IModuleArtifact;
-/**
- *
- * @since 1.0
- */
-public class WebResource implements IModuleArtifact {
- private IModule module;
- private IPath path;
-
- public WebResource(IModule module, IPath path) {
- this.module = module;
- this.path = path;
- }
-
- public IModule getModule() {
- return module;
- }
-
- public IPath getPath() {
- return path;
- }
-
- public String toString() {
- return "WebResource [module=" + module + ", path=" + path + "]";
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/package.xml b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/package.xml
deleted file mode 100644
index 7df1938..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/package.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<html>
-<head>
- <!-- Escape to the root of your source folder -->
- <meta
- name="root"
- content="../../../../../../" />
- <title>WTP API overview</title>
-</head>
-
-<body>
-
-<p>Utility classes for the server tools framework.</p>
-
-<p>PingThread is a utility class for pinging a server to determine if
-it is running and updating the server's state.</p>
-
-<p>SocketUtil contains utility methods for determining if ports are
-free and whether a given hostname is a local hostname.</p>
-
-<p>The four XXXAdapter classes are implementations of server tools
-listener interfaces with the method bodies stubbed in; they can be
-subclassed by clients who only want to implement a single listener
-interface method.</p>
-
-<p>ServerPort, Task, and TaskModel are standard implementations of
-other interface classes.</p>
-
-</body>
-</html>
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/.classpath b/plugins/org.eclipse.wst.server.ui/.classpath
deleted file mode 100644
index 4cb0786..0000000
--- a/plugins/org.eclipse.wst.server.ui/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="serverui/"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/plugins/org.eclipse.wst.server.ui/.cvsignore b/plugins/org.eclipse.wst.server.ui/.cvsignore
deleted file mode 100644
index 3644936..0000000
--- a/plugins/org.eclipse.wst.server.ui/.cvsignore
+++ /dev/null
@@ -1,5 +0,0 @@
-bin
-serverui.jar
-build.xml
-temp.folder
-org.eclipse.wst.server.ui_3.0.0.jar
diff --git a/plugins/org.eclipse.wst.server.ui/.options b/plugins/org.eclipse.wst.server.ui/.options
deleted file mode 100644
index b6047e1..0000000
--- a/plugins/org.eclipse.wst.server.ui/.options
+++ /dev/null
@@ -1,7 +0,0 @@
-# Debugging options for the org.eclipse.wst.server.ui plugin
-
-# Turn on general debugging
-org.eclipse.wst.server.ui/debug=true
-
-# Prints out values
-org.eclipse.wst.server.ui/editor=false
diff --git a/plugins/org.eclipse.wst.server.ui/.project b/plugins/org.eclipse.wst.server.ui/.project
deleted file mode 100644
index eeeba70..0000000
--- a/plugins/org.eclipse.wst.server.ui/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.server.ui</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/plugins/org.eclipse.wst.server.ui/build.properties b/plugins/org.eclipse.wst.server.ui/build.properties
deleted file mode 100644
index aa9726f..0000000
--- a/plugins/org.eclipse.wst.server.ui/build.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-###############################################################################
-# Copyright (c) 2004 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
-###############################################################################
-bin.includes = plugin.xml,\
- *.jar,\
- plugin.properties,\
- serverui.jar,\
- icons/,\
- .options
-jars.compile.order =
-source.serverui.jar = serverui/
-src.includes = schema/,\
- build.properties
-output.serverui.jar = bin/
diff --git a/plugins/org.eclipse.wst.server.ui/icons/clcl16/launch_debug.gif b/plugins/org.eclipse.wst.server.ui/icons/clcl16/launch_debug.gif
deleted file mode 100644
index 5714d7a..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/clcl16/launch_debug.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/clcl16/launch_disconnect.gif b/plugins/org.eclipse.wst.server.ui/icons/clcl16/launch_disconnect.gif
deleted file mode 100644
index 6e0d383..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/clcl16/launch_disconnect.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/clcl16/launch_profile.gif b/plugins/org.eclipse.wst.server.ui/icons/clcl16/launch_profile.gif
deleted file mode 100644
index 89c3340..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/clcl16/launch_profile.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/clcl16/launch_publish.gif b/plugins/org.eclipse.wst.server.ui/icons/clcl16/launch_publish.gif
deleted file mode 100644
index 87827af..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/clcl16/launch_publish.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/clcl16/launch_restart.gif b/plugins/org.eclipse.wst.server.ui/icons/clcl16/launch_restart.gif
deleted file mode 100644
index bc0ac6e..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/clcl16/launch_restart.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/clcl16/launch_run.gif b/plugins/org.eclipse.wst.server.ui/icons/clcl16/launch_run.gif
deleted file mode 100644
index 57f4102..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/clcl16/launch_run.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/clcl16/launch_stop.gif b/plugins/org.eclipse.wst.server.ui/icons/clcl16/launch_stop.gif
deleted file mode 100644
index fbf1686..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/clcl16/launch_stop.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/ctool16/debug_on_server.gif b/plugins/org.eclipse.wst.server.ui/icons/ctool16/debug_on_server.gif
deleted file mode 100644
index d4650bb..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/ctool16/debug_on_server.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/ctool16/profile_on_server.gif b/plugins/org.eclipse.wst.server.ui/icons/ctool16/profile_on_server.gif
deleted file mode 100644
index aca9522..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/ctool16/profile_on_server.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/ctool16/run_on_server.gif b/plugins/org.eclipse.wst.server.ui/icons/ctool16/run_on_server.gif
deleted file mode 100644
index 5ed7d98..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/ctool16/run_on_server.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/ctool16/wiz_import_configuration.gif b/plugins/org.eclipse.wst.server.ui/icons/ctool16/wiz_import_configuration.gif
deleted file mode 100644
index a4f6b31..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/ctool16/wiz_import_configuration.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/ctool16/wiz_modify_modules.gif b/plugins/org.eclipse.wst.server.ui/icons/ctool16/wiz_modify_modules.gif
deleted file mode 100644
index d507012..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/ctool16/wiz_modify_modules.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/ctool16/wiz_new_server.gif b/plugins/org.eclipse.wst.server.ui/icons/ctool16/wiz_new_server.gif
deleted file mode 100644
index 55bacb2..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/ctool16/wiz_new_server.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/ctool16/wiz_new_server_project.gif b/plugins/org.eclipse.wst.server.ui/icons/ctool16/wiz_new_server_project.gif
deleted file mode 100644
index 1cfd11a..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/ctool16/wiz_new_server_project.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/cview16/server_perspective.gif b/plugins/org.eclipse.wst.server.ui/icons/cview16/server_perspective.gif
deleted file mode 100644
index 88b648c..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/cview16/server_perspective.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/cview16/servers_view.gif b/plugins/org.eclipse.wst.server.ui/icons/cview16/servers_view.gif
deleted file mode 100644
index fbabfbb..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/cview16/servers_view.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/dlcl16/launch_debug.gif b/plugins/org.eclipse.wst.server.ui/icons/dlcl16/launch_debug.gif
deleted file mode 100644
index 02f9c3a..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/dlcl16/launch_debug.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/dlcl16/launch_disconnect.gif b/plugins/org.eclipse.wst.server.ui/icons/dlcl16/launch_disconnect.gif
deleted file mode 100644
index 0956095..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/dlcl16/launch_disconnect.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/dlcl16/launch_profile.gif b/plugins/org.eclipse.wst.server.ui/icons/dlcl16/launch_profile.gif
deleted file mode 100644
index 8309b0d..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/dlcl16/launch_profile.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/dlcl16/launch_publish.gif b/plugins/org.eclipse.wst.server.ui/icons/dlcl16/launch_publish.gif
deleted file mode 100644
index 78ba7cb..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/dlcl16/launch_publish.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/dlcl16/launch_restart.gif b/plugins/org.eclipse.wst.server.ui/icons/dlcl16/launch_restart.gif
deleted file mode 100644
index 49d908e..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/dlcl16/launch_restart.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/dlcl16/launch_run.gif b/plugins/org.eclipse.wst.server.ui/icons/dlcl16/launch_run.gif
deleted file mode 100644
index 9362e67..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/dlcl16/launch_run.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/dlcl16/launch_stop.gif b/plugins/org.eclipse.wst.server.ui/icons/dlcl16/launch_stop.gif
deleted file mode 100644
index 13c5faf..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/dlcl16/launch_stop.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/dtool16/debug_on_server.gif b/plugins/org.eclipse.wst.server.ui/icons/dtool16/debug_on_server.gif
deleted file mode 100644
index 3b4cf27..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/dtool16/debug_on_server.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/dtool16/profile_on_server.gif b/plugins/org.eclipse.wst.server.ui/icons/dtool16/profile_on_server.gif
deleted file mode 100644
index d14c89d..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/dtool16/profile_on_server.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/dtool16/run_on_server.gif b/plugins/org.eclipse.wst.server.ui/icons/dtool16/run_on_server.gif
deleted file mode 100644
index b422a86..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/dtool16/run_on_server.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/dtool16/wiz_import_configuration.gif b/plugins/org.eclipse.wst.server.ui/icons/dtool16/wiz_import_configuration.gif
deleted file mode 100644
index 45f57b3..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/dtool16/wiz_import_configuration.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/dtool16/wiz_modify_modules.gif b/plugins/org.eclipse.wst.server.ui/icons/dtool16/wiz_modify_modules.gif
deleted file mode 100644
index 314fed1..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/dtool16/wiz_modify_modules.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/dtool16/wiz_new_server.gif b/plugins/org.eclipse.wst.server.ui/icons/dtool16/wiz_new_server.gif
deleted file mode 100644
index 116fcb0..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/dtool16/wiz_new_server.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/dtool16/wiz_new_server_project.gif b/plugins/org.eclipse.wst.server.ui/icons/dtool16/wiz_new_server_project.gif
deleted file mode 100644
index fc52314..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/dtool16/wiz_new_server_project.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/elcl16/launch_debug.gif b/plugins/org.eclipse.wst.server.ui/icons/elcl16/launch_debug.gif
deleted file mode 100644
index 5714d7a..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/elcl16/launch_debug.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/elcl16/launch_disconnect.gif b/plugins/org.eclipse.wst.server.ui/icons/elcl16/launch_disconnect.gif
deleted file mode 100644
index 6e0d383..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/elcl16/launch_disconnect.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/elcl16/launch_profile.gif b/plugins/org.eclipse.wst.server.ui/icons/elcl16/launch_profile.gif
deleted file mode 100644
index 89c3340..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/elcl16/launch_profile.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/elcl16/launch_publish.gif b/plugins/org.eclipse.wst.server.ui/icons/elcl16/launch_publish.gif
deleted file mode 100644
index 87827af..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/elcl16/launch_publish.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/elcl16/launch_restart.gif b/plugins/org.eclipse.wst.server.ui/icons/elcl16/launch_restart.gif
deleted file mode 100644
index bc0ac6e..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/elcl16/launch_restart.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/elcl16/launch_run.gif b/plugins/org.eclipse.wst.server.ui/icons/elcl16/launch_run.gif
deleted file mode 100644
index 57f4102..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/elcl16/launch_run.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/elcl16/launch_stop.gif b/plugins/org.eclipse.wst.server.ui/icons/elcl16/launch_stop.gif
deleted file mode 100644
index fbf1686..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/elcl16/launch_stop.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/etool16/debug_on_server.gif b/plugins/org.eclipse.wst.server.ui/icons/etool16/debug_on_server.gif
deleted file mode 100644
index d4650bb..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/etool16/debug_on_server.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/etool16/profile_on_server.gif b/plugins/org.eclipse.wst.server.ui/icons/etool16/profile_on_server.gif
deleted file mode 100644
index aca9522..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/etool16/profile_on_server.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/etool16/run_on_server.gif b/plugins/org.eclipse.wst.server.ui/icons/etool16/run_on_server.gif
deleted file mode 100644
index 5ed7d98..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/etool16/run_on_server.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/etool16/wiz_import_configuration.gif b/plugins/org.eclipse.wst.server.ui/icons/etool16/wiz_import_configuration.gif
deleted file mode 100644
index a4f6b31..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/etool16/wiz_import_configuration.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/etool16/wiz_modify_modules.gif b/plugins/org.eclipse.wst.server.ui/icons/etool16/wiz_modify_modules.gif
deleted file mode 100644
index d507012..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/etool16/wiz_modify_modules.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/etool16/wiz_new_server.gif b/plugins/org.eclipse.wst.server.ui/icons/etool16/wiz_new_server.gif
deleted file mode 100644
index 55bacb2..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/etool16/wiz_new_server.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/etool16/wiz_new_server_project.gif b/plugins/org.eclipse.wst.server.ui/icons/etool16/wiz_new_server_project.gif
deleted file mode 100644
index 1cfd11a..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/etool16/wiz_new_server_project.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/eview16/server_perspective.gif b/plugins/org.eclipse.wst.server.ui/icons/eview16/server_perspective.gif
deleted file mode 100644
index 88b648c..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/eview16/server_perspective.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/eview16/servers_view.gif b/plugins/org.eclipse.wst.server.ui/icons/eview16/servers_view.gif
deleted file mode 100644
index fbabfbb..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/eview16/servers_view.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/obj16/configuration_missing.gif b/plugins/org.eclipse.wst.server.ui/icons/obj16/configuration_missing.gif
deleted file mode 100644
index f0ef4c9..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/obj16/configuration_missing.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/obj16/configuration_none.gif b/plugins/org.eclipse.wst.server.ui/icons/obj16/configuration_none.gif
deleted file mode 100644
index cbd2756..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/obj16/configuration_none.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/obj16/monitorOff.gif b/plugins/org.eclipse.wst.server.ui/icons/obj16/monitorOff.gif
deleted file mode 100644
index 42e5f31..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/obj16/monitorOff.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/obj16/monitorOn.gif b/plugins/org.eclipse.wst.server.ui/icons/obj16/monitorOn.gif
deleted file mode 100644
index 2ff3974..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/obj16/monitorOn.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/obj16/project_missing.gif b/plugins/org.eclipse.wst.server.ui/icons/obj16/project_missing.gif
deleted file mode 100644
index 0cb4c16..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/obj16/project_missing.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/obj16/publish_disabled.gif b/plugins/org.eclipse.wst.server.ui/icons/obj16/publish_disabled.gif
deleted file mode 100644
index 519b846..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/obj16/publish_disabled.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/obj16/publish_enabled.gif b/plugins/org.eclipse.wst.server.ui/icons/obj16/publish_enabled.gif
deleted file mode 100644
index bb900ed..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/obj16/publish_enabled.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/obj16/repair_config.gif b/plugins/org.eclipse.wst.server.ui/icons/obj16/repair_config.gif
deleted file mode 100644
index e5690ec..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/obj16/repair_config.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/obj16/server.gif b/plugins/org.eclipse.wst.server.ui/icons/obj16/server.gif
deleted file mode 100644
index b51ae39..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/obj16/server.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/obj16/server_started.gif b/plugins/org.eclipse.wst.server.ui/icons/obj16/server_started.gif
deleted file mode 100644
index d370054..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/obj16/server_started.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/obj16/server_started_debug.gif b/plugins/org.eclipse.wst.server.ui/icons/obj16/server_started_debug.gif
deleted file mode 100644
index f1e1778..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/obj16/server_started_debug.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/obj16/server_started_profile.gif b/plugins/org.eclipse.wst.server.ui/icons/obj16/server_started_profile.gif
deleted file mode 100644
index 47e2584..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/obj16/server_started_profile.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/obj16/server_starting1.gif b/plugins/org.eclipse.wst.server.ui/icons/obj16/server_starting1.gif
deleted file mode 100644
index 66263aa..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/obj16/server_starting1.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/obj16/server_starting2.gif b/plugins/org.eclipse.wst.server.ui/icons/obj16/server_starting2.gif
deleted file mode 100644
index 703bbfe..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/obj16/server_starting2.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/obj16/server_starting3.gif b/plugins/org.eclipse.wst.server.ui/icons/obj16/server_starting3.gif
deleted file mode 100644
index 5151e54..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/obj16/server_starting3.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/obj16/server_stopped.gif b/plugins/org.eclipse.wst.server.ui/icons/obj16/server_stopped.gif
deleted file mode 100644
index d6c3b65..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/obj16/server_stopped.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/obj16/server_stopping1.gif b/plugins/org.eclipse.wst.server.ui/icons/obj16/server_stopping1.gif
deleted file mode 100644
index 306c57d..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/obj16/server_stopping1.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/obj16/server_stopping2.gif b/plugins/org.eclipse.wst.server.ui/icons/obj16/server_stopping2.gif
deleted file mode 100644
index d6c3b65..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/obj16/server_stopping2.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/obj16/server_stopping3.gif b/plugins/org.eclipse.wst.server.ui/icons/obj16/server_stopping3.gif
deleted file mode 100644
index 306c57d..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/obj16/server_stopping3.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/ovr16/default_server_ovr.gif b/plugins/org.eclipse.wst.server.ui/icons/ovr16/default_server_ovr.gif
deleted file mode 100644
index dbfcbc0..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/ovr16/default_server_ovr.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/ovr16/server_ovr.gif b/plugins/org.eclipse.wst.server.ui/icons/ovr16/server_ovr.gif
deleted file mode 100644
index aa8d52e..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/ovr16/server_ovr.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/wizban/import_configuration_wiz.gif b/plugins/org.eclipse.wst.server.ui/icons/wizban/import_configuration_wiz.gif
deleted file mode 100644
index f46e4e0..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/wizban/import_configuration_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/wizban/new_server_wiz.gif b/plugins/org.eclipse.wst.server.ui/icons/wizban/new_server_wiz.gif
deleted file mode 100644
index 30de91f..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/wizban/new_server_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/wizban/pub_resource_server_wiz.gif b/plugins/org.eclipse.wst.server.ui/icons/wizban/pub_resource_server_wiz.gif
deleted file mode 100644
index c74d61a..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/wizban/pub_resource_server_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/wizban/select_client_wiz.gif b/plugins/org.eclipse.wst.server.ui/icons/wizban/select_client_wiz.gif
deleted file mode 100644
index 5b13db2..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/wizban/select_client_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/wizban/select_server_wiz.gif b/plugins/org.eclipse.wst.server.ui/icons/wizban/select_server_wiz.gif
deleted file mode 100644
index 3a9dadb..0000000
--- a/plugins/org.eclipse.wst.server.ui/icons/wizban/select_server_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/plugin.properties b/plugins/org.eclipse.wst.server.ui/plugin.properties
deleted file mode 100644
index d373ff6..0000000
--- a/plugins/org.eclipse.wst.server.ui/plugin.properties
+++ /dev/null
@@ -1,452 +0,0 @@
-###############################################################################
-# Copyright (c) 2004, 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
-###############################################################################
-pluginName=Server UI
-providerName=Eclipse.org
-
-extensionPointEditorPages=Editor Pages
-extensionPointEditorPageSections=Editor Page Sections
-extensionPointEditorActions=Editor Actions
-extensionPointServerImages=Server Images
-extensionPointWizardFragments=Wizard Fragments
-
-# --------------- Wizards ---------------
-# (If the first two lines in a group do not start with "wiz", it is because
-# those lines are displayed in the workbench "New" wizard. The rest of the
-# text is displayed in each actual wizard)
-
-wizardCategoryTitle=Server
-
-# New Server (and Configuration) Wizard
-newServer=Server
-newServerDescription=Define a new server
-wizNewServerWizardTitle=New Server
-wizNewServerTitle=Define a New Server
-wizNewServerDescription=Choose the type of server to create.
-wizNewServerRuntime=Server runtime:
-
-wizNewServerSelect=How do you want to select the server?
-wizNewServerExisting=Choose an e&xisting server
-wizNewServerDetect=&Automatically detect servers
-wizNewServerManual=&Manually define a server
-wizNewServerSelectExisting=Select the server that you want to use:
-
-# Import Server Configuration wizard
-importServerConfiguration=Server Configuration
-wizImportConfigurationWizardTitle=Import a Server Configuration
-wizImportConfigurationTitle=Import a server configuration
-wizImportConfigurationDescription=Fill out the fields below to import the configuration.
-wizImportConfigurationType=Configuration type:
-wizImportConfigurationLocation=&Location:
-wizImportConfigurationFile=Choose the server configuration file
-wizImportConfigurationDirectory=Choose the directory containing the server configuration
-
-# Select Server wizard
-wizRunOnServerTitle=Run On Server
-wizDebugOnServerTitle=Debug On Server
-wizProfileOnServerTitle=Profile On Server
-wizSelectServerPreferred=Set server as project &default (do not prompt)
-
-# Select Server Client Wizard
-wizSelectClientWizardTitle=Select a Server Client
-wizSelectClientTitle=Select a server client
-wizSelectClientDescription=Select a client to use with this server.
-wizSelectClientMessage=Multiple clients can run on the current selection. Select a client from the list below:
-
-# Task Wizard
-wizTaskWizardTitle=Select Tasks
-wizTaskTitle=Select Tasks
-wizTaskDescription=Select the tasks to perform on the server.
-wizTaskDetail=Tasks for:
-wizTaskNone=There are currently no tasks that need to be performed.
-
-# New Runtime Wizard
-wizNewRuntimeWizardTitle=New Server Runtime
-wizNewRuntimeTitle=New Server Runtime
-wizNewRuntimeDescription=Define a new installed server runtime environment
-wizEditRuntimeWizardTitle=Edit Server Runtime
-
-# Add/Remove Modules
-wizModuleWizardTitle=Add and Remove Projects
-wizModuleTitle=Add and Remove Projects
-wizModuleDescription=Modify the projects that are configured on the server
-wizModuleMessage=Move projects to the right to configure them on the server
-wizModuleAvailableList=&Available projects:
-wizModuleDeployedList=&Configured projects:
-wizModuleAdd=A&dd >
-wizModuleAddAll=Add A&ll >>
-wizModuleRemove=< &Remove
-wizModuleRemoveAll=<< Re&move All
-
-# General text used in multiple wizards
-wizFolder=F&older:
-wizBrowse=B&rowse...
-wizDescription=Description:
-
-# Wizard info and error messages
-wizErrorInvalidFolder=The folder must be a server project or a folder within a server project
-wizErrorClosedProject=The folder must not be in a closed project
-wizErrorResourceAlreadyExists=The specified resource already exists
-wizErrorServerCreationError=Cannot create a server using the selected type
-wizErrorImport=Could not find a valid server configuration at the specified location
-
-
-# --------------- Views ---------------
-
-viewCategoryTitle=Server
-
-# --- Server Configuration view ---
-viewServers=Servers
-
-viewNoConfiguration=No configuration
-viewNoModules=Nothing deployed
-
-# Actions
-actionDelete=Delete
-actionOpen=Open
-actionSwitchConfiguration=Switch Configuration
-actionMonitor=Monitoring
-actionMonitorPort=Monitor port {0} ({1})
-actionMonitorProperties=Properties...
-actionNew=New
-actionNewServer=Server
-
-# --- Servers view ---
-viewServersTitle=Servers
-
-# Column titles
-viewServer=Server
-viewHost=Host name
-viewStatus=Status
-viewSync=State
-
-actionRestartProject=Restart Project
-
-# Actions
-actionStart=Start
-actionStartToolTip=Start the server
-actionDebug=Debug
-actionDebugToolTip=Start the server in debug mode
-actionProfile=Profile
-actionProfileToolTip=Start the server in profiling mode
-actionStop=Stop
-actionStopToolTip=Stop the server
-actionRestart=Restart
-actionRestartToolTip=Restart the server
-actionPublish=Publish
-actionPublishToolTip=Publish to the server
-actionModifyModules=Add and remove projects...
-actionModifyModulesToolTip=Add and remove projects
-
-# Status column text
-viewStatusStarting=Starting
-viewStatusStarted=Started
-viewStatusStartedDebug=Debugging
-viewStatusStartedProfile=Profiling
-viewStatusStopping=Stopping
-viewStatusStopped=Stopped
-viewStatusUnsupported=Unsupported
-
-viewStatusStarting1=Starting.
-viewStatusStarting2=Starting..
-viewStatusStarting3=Starting...
-
-viewStatusStopping1=Stopping.
-viewStatusStopping2=Stopping..
-viewStatusStopping3=Stopping...
-
-# Server State text
-viewSyncOkay=Synchronized
-viewSyncRestart=Restart
-viewSyncPublish=Republish
-viewSyncRestartPublish=Restart & republish
-viewSyncPublishing=Publishing...
-
-# --- set 2 ---
-# Actions
-actionStart2=Connect
-actionStartToolTip2=Connect the server
-actionDebug2=Debug
-actionDebugToolTip2=Connect to the server in debug mode
-actionProfile2=Profile
-actionProfileToolTip2=Connect to the server in profiling mode
-actionStop2=Disconnect
-actionStopToolTip2=Disconnect from the server
-actionRestart2=Reconnect
-actionRestartToolTip2=Reconnect to the server
-actionPublish2=Publish
-actionPublishToolTip2=Publish to the server
-
-# Status column text
-viewStatusStarting4=Connecting
-viewStatusStarted2=Connected
-viewStatusStartedDebug2=Debugging
-viewStatusStopping4=Disconnecting
-viewStatusStopped2=Disconnected
-viewStatusUnsupported2=Unsupported
-viewStatusStartedProfile2=Profiling
-
-# Server State text
-viewSyncOkay2=Synchronized
-viewSyncRestart2=Reconnect
-viewSyncPublish2=Republish
-viewSyncRestartPublish2=Reconnect and republish
-viewSyncPublishing2=Publishing...
-
-
-# --------------- Action Sets (toolbar icon groups) ---------------
-
-# Servers action set
-actionSetTitle=Server
-actionSetNewServer=Create Server and Server Configuration
-actionSetNewServer=Create Server
-
-# Run on Server actions
-actionRunOnServer=Run on Server...
-actionDebugOnServer=Debug on Server...
-actionProfileOnServer=Profile on Server...
-
-
-# --------------- Preferences ---------------
-
-# Names of the preference pages
-preferenceServersTitle=Server
-preferenceRuntimesTitle=Installed Runtimes
-preferenceRuntimesTitleLong=Installed Server Runtime Environments
-
-# Server preferences
-prefAutoPublish=Automatically p&ublish before starting servers
-prefAutoPublishLocal=Automatically publish to local servers every:
-prefAutoPublishRemote=Automatically publish to remote servers every:
-prefAutoPublishSeconds=s
-prefAutoRestart=Automatically &restart servers when necessary
-prefPromptIrreversible=Prompt before making &irreversible changes within an editor
-prefCreateInWorkspace=Create server resources in workspace
-prefShowOnActivity=Show Servers view when server state changes
-
-prefSaveEditorsGroup=Save dirty editors before starting server
-prefSaveEditorsNever=&Never
-prefSaveEditorsPrompt=Pro&mpt
-prefSaveEditorsAutosave=Auto-sav&e
-
-# Project properties preferences
-propertiesServer=Server
-prefProjectDescription=Set the runtime target and the default server for the project.
-prefProject=Project:
-prefProjectDefaultServer=Default server:
-prefProjectNotModule=This project cannot be deployed to a server.
-prefProjectNotConfigured=Not currently deployed to any servers
-prefProjectNoServer=<None>
-
-# Installed runtimes
-preferenceRuntimesDescription=Add, remove, or edit installed server runtime definitions.\nThe checked runtime will be used by default when creating new projects.
-preferenceRuntimesTable=Installed server runtimes:
-
-
-# --------------- Tasks (progress monitors) ---------------
-
-# Creating default server project
-createServerProjectTask=Creating server project.
-
-# General tasks
-savingTask=Saving {0}.
-loadingTask=Loading {0}.
-performingTasks=Performing tasks.
-
-publishingStart=Connecting to server
-
-# --------------- Dialogs ---------------
-
-# Delete Server Resource dialog
-deleteServerResourceDialogTitle=Delete Server Resource
-deleteServerResourceDialogMessage=Are you sure you want to delete {0}?
-deleteServerResourceDialogMessageMany=Are you sure you want to delete the {0} server resources?
-deleteServerResourceDialogLooseConfigurations=Also delete unused server configuration {0}.
-deleteServerResourceDialogLooseConfigurationsMany=Also delete {0} unused server configurations.
-
-# Create Server Project dialog
-createServerProjectDialogTitle=Create Server Project
-createServerProjectDialogMessage=Do you want to create a new server project with the name {0}?
-
-# Terminate Server dialog
-terminateServerDialogTitle=Terminate Server
-terminateServerDialogMessage=Server {0} is not responding. Do you want to terminate this server? Click OK to terminate the server or click Cancel to continue waiting.
-
-# Server resource dirty dialog
-resourceDirtyDialogTitle=Server Resource Dirty
-resourceDirtyDialogMessage=The server resource {0} has unsaved changes. Do you want to continue?
-resourceDirtyDialogContinue=Continue
-
-runtimeTargetCombo=Target runtime:
-runtimeTargetNone=<None>
-runtimeTargetNewRuntime=New...
-runtimeTargetRuntimePreferences=Installed Runtimes...
-runtimeTargetChildren=Include child projects
-
-# General dialogs
-defaultDialogTitle=Server
-dialogStoppingServer=Stopping server {0}.
-dialogRestartingProject=Restarting project {0}.
-
-# restart warning dialog
-dialogModeWarningDebug=The server is not running in debug mode. You may restart the server in debug mode, continue without debugging, or cancel the operation.
-dialogModeWarningProfile=The server is not running in profiling mode. You may restart the server in profiling mode, continue without profiling, or cancel the operation.
-dialogModeWarningRestart=Restart
-dialogModeWarningContinue=Continue
-
-# Monitor dialog
-dialogMonitorTitle=Monitoring Ports
-dialogMonitorDescription=The following ports are being monitored on server {0}:
-dialogMonitorAddDescription=The server {0} has the following ports that can be monitored:
-dialogMonitorColumnPort=Server Port
-dialogMonitorColumnType=Type
-dialogMonitorColumnMonitorPort=Monitor Port
-dialogMonitorColumnContentType=Content Type
-dialogMonitorColumnStatus=Status
-dialogMonitorMonitorPort=Monitor port:
-dialogMonitorContentType=Content type:
-dialogMonitorContentTypeAll=All
-dialogMonitorContentTypeWeb=Web
-dialogMonitorContentTypeWebServices=WebServices
-
-start=Start
-stop=Stop
-started=Started
-stopped=Stopped
-
-# Confirm runtime removal
-dialogRuntimeInUse=The runtime is currently being used and deleting it will cause compilation or runtime problems. Delete the runtime anyway?
-
-# runtime locator search dialog
-dialogRuntimeSearchTitle=Search For Runtimes
-dialogRuntimeSearchMessage=Select the directory in which to search for server runtimes:
-dialogRuntimeSearchProgress=Searching for server runtimes...
-
-# Can't add remove
-dialogAddRemoveModulesNone=There are no projects that can be added or removed from the server.
-
-# --------------- Misc UI ---------------
-
-serverLaunchShortcut=Run on Server
-
-serverEditor=Server Editor
-
-# runtime composite
-runtimeTypeCompDescription=Runtimes are used at build time to compile projects.
-runtimeTypeCompTree=Select the type of &runtime that you want to define:
-serverTypeCompDescription=Select the &server type:
-name=Name
-vendor=Vendor
-version=Version
-host=Host name
-moduleSupport=Module Support
-viewBy=&View By:
-
-# misc composites
-hostnameTitle=Specify the host where you want to publish
-hostname=&Host name:
-
-# Server launch configuration tab
-serverLaunchConfigurationTab=Server
-serverLaunchServer=Server:
-serverLaunchRuntime=Runtime:
-serverLaunchHost=Host name:
-
-# Error Messages
-errorDialogTitle=Server Error
-errorServerAlreadyRunning=Server already running
-errorNoServerSelected=No server selected
-errorInvalidServer=Invalid server
-errorServerStartFailed=The server named {0} did not start correctly. Check the Console for error messages.
-errorPublishing=Could not publish to the server.
-errorCouldNotCreateServerProject=Could not create server project
-errorCouldNotCreateServerProjectStatus=Could not create server project: {0}
-errorNoModules=Did not find anything to deploy to a server
-errorNoServer=Could not find a server to run the selection
-errorNoClient=Could not find a client that is able to launch the selection
-errorCouldNotSavePreference=Could not save server preference information.
-errorEditorCantSave=Can't save the server resource for the following reason(s):
-errorEditor=Could not open editor because {0} is not a valid server or server configuration.
-errorVersionLevel=The selected server does not support version {1} of the {0} specification.
-
-# Info messages
-infoNoRuntimesFound=No server runtimes were found.
-
-# Default server creation names
-# {0} will be replaced by a number if the given name is already being used
-defaultServerProjectName=Servers{0}
-
-serverStartError=Error received while starting the server
-
-# Used when a name can't be found
-elementUnknownName=<unknown>
-
-columnName=Name
-columnType=Type
-
-add=Add...
-edit=Edit...
-remove=Remove
-search=Search...
-
-
-# --------------- Editor support ---------------
-
-serverEditorOverviewPage=Overview
-serverEditorOverviewPageTitle=Server Overview
-serverEditorOverviewSection=General
-serverEditorOverviewDescription=Specify the host name and other settings.
-serverEditorOverviewServerName=Server name:
-serverEditorOverviewServerNameCommand=set server name
-serverEditorOverviewServerNameDescription=Set the server name
-serverEditorOverviewServerConfigurationPath=Server configuration path:
-serverEditorOverviewServerHostname=Host name:
-serverEditorOverviewServerHostnameCommand=set host name
-serverEditorOverviewServerHostnameDescription=Set the host name
-serverEditorOverviewRuntime=Runtime:
-serverEditorOverviewRuntimeCommand=set runtime
-serverEditorOverviewRuntimeDescription=Set the runtime
-serverEditorOverviewAutoPublishDefault=Use default auto-publish settings
-serverEditorOverviewAutoPublishOverride=Auto-publish every:
-serverEditorOverviewAutoPublishCommand=modify auto-publish settings
-serverEditorOverviewAutoPublishDescription=Modify auto-publish settings
-
-# Menu items. {0} will be replaced by one of the xxxEditorActionXxx fields
-# from below. @Ctrl+Z is the menu mnemonic
-editorUndoEnabled=Undo {0}@Ctrl+Z
-editorUndoDisabled=Undo@Ctrl+Z
-editorRedoEnabled=Redo {0}@Ctrl+Y
-editorRedoDisabled=Redo@Ctrl+Y
-
-editorSaveErrorDialog=Save Problems
-editorSaveErrorMessage=Error while saving. {0}
-
-editorReadOnly=Read Only
-editorWritable=Writable
-editorReadOnlyFiles=Read Only files: {0}
-
-editorServerEditor=Server Editor
-editorPromptIrreversible=This operation cannot be undone. Do you want to proceed?
-
-# message if a dirty resource is deleted
-editorResourceDeleteTitle=Server Resource Deleted
-editorResourceDeleteServerMessage=The server {0} has been deleted from the file system. Do you want to save your changes or close the editor without saving?
-editorResourceDeleteServerConfigurationMessage=The server configuration {0} has been deleted from the file system. Do you want to save your changes or close the editor without saving?
-editorResourceDeleteSave=Save
-
-editorResourceModifiedTitle=File Changed
-editorServerModifiedMessage=The server has been changed on the file system. Do you want to load the changes?
-editorServerConfigurationModifiedMessage=The server configuration has been changed on the file system. Do you want to load the changes?
-
-editorValidateEditFailureMessage=The server resource cannot be edited.
-editorReadOnlyMessage=File(s) being edited have become read-only. The editor will become read-only and changes will be lost.
-
-editorResourceWarnTitle=Server Modification Warning
-editorResourceWarnMessage=The resource you are modifying is read-only. All changes will be lost because the resource cannot be saved.
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/plugin.xml b/plugins/org.eclipse.wst.server.ui/plugin.xml
deleted file mode 100644
index 9c2fd4b..0000000
--- a/plugins/org.eclipse.wst.server.ui/plugin.xml
+++ /dev/null
@@ -1,223 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-
-<plugin id="org.eclipse.wst.server.ui"
- name="%pluginName"
- version="1.0.0"
- provider-name="%providerName"
- class="org.eclipse.wst.server.ui.internal.ServerUIPlugin">
-
-<requires>
- <import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.eclipse.core.resources"/>
- <import plugin="org.eclipse.core.expressions"/>
- <import plugin="org.eclipse.ui"/>
- <import plugin="org.eclipse.ui.ide"/>
- <import plugin="org.eclipse.ui.forms"/>
- <import plugin="org.eclipse.ui.workbench.texteditor"/>
- <import plugin="org.eclipse.debug.core"/>
- <import plugin="org.eclipse.debug.ui"/>
- <import plugin="org.eclipse.wst.server.core"/>
-</requires>
-
-<runtime>
- <library name="serverui.jar">
- <export name="*"/>
- </library>
-</runtime>
-
- <extension-point id="editorPages" name="%extensionPointEditorPages" schema="schema/editorPages.exsd"/>
- <extension-point id="editorPageSections" name="%extensionPointEditorPageSections" schema="schema/editorPageSections.exsd"/>
- <extension-point id="editorActions" name="%extensionPointEditorActions" schema="schema/editorActions.exsd"/>
- <extension-point id="serverImages" name="%extensionPointServerImages" schema="schema/serverImages.exsd"/>
- <extension-point id="wizardFragments" name="%extensionPointWizardFragments" schema="schema/wizardFragments.exsd"/>
-
-<extension point="org.eclipse.ui.ide.projectNatureImages">
- <image
- id="org.eclipse.wst.server.ui.projectNatureImage"
- natureId="org.eclipse.wst.server.core.nature"
- icon="icons/ovr16/server_ovr.gif"/>
-</extension>
-
-<extension point="org.eclipse.ui.newWizards">
- <category
- id="org.eclipse.wst.server.ui"
- name="%wizardCategoryTitle"/>
-
- <wizard
- id="org.eclipse.wst.server.ui.new.server"
- name="%newServer"
- class="org.eclipse.wst.server.ui.internal.wizard.NewServerWizard"
- category="org.eclipse.wst.server.ui"
- icon="icons/ctool16/wiz_new_server.gif">
- <description>%newServerDescription</description>
- </wizard>
-</extension>
-
-<!--
-<extension point="org.eclipse.ui.importWizards">
- <wizard
- id="org.eclipse.wst.server.ui.import.configuration"
- name="%importServerConfiguration"
- class="org.eclipse.wst.server.ui.internal.wizard.ImportServerConfigurationWizard"
- icon="icons/ctool16/wiz_import_configuration.gif">
- <description>%importServerConfigurationDescription</description>
- </wizard>
-</extension>
--->
-
-<extension point="org.eclipse.ui.views">
- <category
- id="org.eclipse.wst.server.ui"
- name="%viewCategoryTitle"/>
-
- <view
- id="org.eclipse.wst.server.ui.ServersView"
- name="%viewServersTitle"
- category="org.eclipse.wst.server.ui"
- class="org.eclipse.wst.server.ui.internal.view.servers.ServersView"
- icon="icons/cview16/servers_view.gif"/>
-</extension>
-
-<extension point="org.eclipse.ui.perspectiveExtensions">
- <perspectiveExtension
- targetID="org.eclipse.debug.ui.DebugPerspective">
- <view
- relative="org.eclipse.debug.ui.DebugView"
- relationship="stack"
- id="org.eclipse.wst.server.ui.ServersView">
- </view>
- </perspectiveExtension>
-</extension>
-
-<extension point="org.eclipse.ui.preferencePages">
- <page
- id="org.eclipse.wst.server.ui.preferencePage"
- name="%preferenceServersTitle"
- class="org.eclipse.wst.server.ui.internal.ServerPreferencePage"/>
- <page
- id="org.eclipse.wst.server.ui.runtime.preferencePage"
- name="%preferenceRuntimesTitle"
- category="org.eclipse.wst.server.ui.preferencePage"
- class="org.eclipse.wst.server.ui.internal.RuntimePreferencePage"/>
-</extension>
-
-<extension point="org.eclipse.ui.editors">
- <editor id="org.eclipse.wst.server.ui.editor"
- name="%serverEditor"
- icon="icons/obj16/server.gif"
- extensions="server"
- default="true"
- class="org.eclipse.wst.server.ui.internal.editor.ServerEditor"
- contributorClass="org.eclipse.wst.server.ui.internal.editor.ServerEditorActionBarContributor"/>
-</extension>
-
-<extension point="org.eclipse.ui.elementFactories">
- <factory id="org.eclipse.wst.server.ui.editor.input.factory"
- class="org.eclipse.wst.server.ui.internal.editor.ServerEditorInputFactory"/>
-</extension>
-
-<extension point="org.eclipse.ui.propertyPages">
- <page
- id="org.eclipse.wst.server.ui.project.properties"
- name="%propertiesServer"
- objectClass="org.eclipse.core.resources.IProject"
- adaptable="true"
- class="org.eclipse.wst.server.ui.internal.ProjectPropertyPage"/>
-</extension>
-
-<extension point="org.eclipse.ui.actionSets">
- <actionSet
- id="org.eclipse.wst.server.ui.new.actionSet"
- label="%actionSetTitle"
- visible="false">
- <action
- id="org.eclipse.wst.server.ui.action.new.server"
- toolbarPath="servers"
- label="%actionSetNewServer"
- tooltip="%actionSetNewServer"
- icon="icons/ctool16/wiz_new_server.gif"
- class="org.eclipse.wst.server.ui.internal.actions.NewServerAction"/>
- </actionSet>
-</extension>
-
-<extension point="org.eclipse.debug.ui.launchShortcuts">
- <shortcut id="org.eclipse.wst.server.core.launchShortcut"
- label="%serverLaunchShortcut"
- class="org.eclipse.wst.server.ui.internal.ServerLaunchShortcut"
- modes="run, debug, profile"
- path="aa"
- icon="icons/etool16/run_on_server.gif">
- <contextualLaunch>
- <enablement>
- <with variable="selection">
- <count value="1"/>
- <iterate>
- <test property="org.eclipse.wst.server.ui.isRunnable" value="true"/>
- </iterate>
- </with>
- </enablement>
-
- <contextLabel
- mode="run"
- label="%actionRunOnServer"/>
- <contextLabel
- mode="debug"
- label="%actionDebugOnServer"/>
- <contextLabel
- mode="profile"
- label="%actionProfileOnServer"/>
- </contextualLaunch>
- <perspective id="org.eclipse.wst.server.ui.perspective"/>
- <perspective id="org.eclipse.jdt.ui.JavaPerspective"/>
- <perspective id="org.eclipse.jdt.ui.JavaHierarchyPerspective"/>
- <perspective id="org.eclipse.jdt.ui.JavaBrowsingPerspective"/>
- <perspective id="org.eclipse.debug.ui.DebugPerspective"/>
- <perspective id="com.ibm.etools.j2ee.J2EEPerspective"/>
- <perspective id="org.eclipse.ui.resourcePerspective"/>
- </shortcut>
-</extension>
-
-<extension point="org.eclipse.core.expressions.propertyTesters">
- <propertyTester
- id="org.eclipse.wst.server.ui.propertyTester"
- namespace="org.eclipse.wst.server.ui"
- properties="isRunnable"
- type="java.lang.Object"
- class="org.eclipse.wst.server.ui.internal.ServerPropertyTester">
- </propertyTester>
-</extension>
-
- <extension point="org.eclipse.ui.popupMenus">
- <objectContribution
- id="org.eclipse.wst.server.ui.popupMenu"
- objectClass="org.eclipse.wst.server.core.IServer"
- adaptable="true">
- <action
- id="org.eclipse.wst.server.ui.action.modifyModules"
- label="%actionModifyModules"
- icon="icons/ctool16/wiz_modify_modules.gif"
- class="org.eclipse.wst.server.ui.internal.actions.ModifyModulesAction">
- </action>
- </objectContribution>
- </extension>
-
- <extension point="org.eclipse.wst.server.ui.editorPages">
- <page
- id="org.eclipse.wst.server.editor.overview"
- order="-10000"
- name="%serverEditorOverviewPage"
- typeIds="*"
- insertionIds="org.eclipse.wst.server.editor.overview.left, org.eclipse.wst.server.editor.overview.right"
- class="org.eclipse.wst.server.ui.internal.editor.OverviewEditorFactory"/>
- </extension>
-
- <extension point="org.eclipse.core.runtime.adapters">
- <factory
- class="org.eclipse.wst.server.ui.internal.ServerAdapterFactory"
- adaptableType="org.eclipse.wst.server.core.IServer">
- <adapter type="org.eclipse.ui.IActionFilter"/>
- </factory>
- </extension>
-
-</plugin>
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/schema/editorActions.exsd b/plugins/org.eclipse.wst.server.ui/schema/editorActions.exsd
deleted file mode 100644
index c43857a..0000000
--- a/plugins/org.eclipse.wst.server.ui/schema/editorActions.exsd
+++ /dev/null
@@ -1,129 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.server.ui">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.server.ui" id="editorActions" name="Editor Actions"/>
- </appInfo>
- <documentation>
- This extension point provides a way to add actions to the toolbar of an existing server editor.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="editorAction" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="editorAction">
- <annotation>
- <appInfo>
- <meta.element labelAttribute="name"/>
- </appInfo>
- </annotation>
- <complexType>
- <sequence>
- </sequence>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- specifies a unique identifier for this extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- specifies the fully qualified name of the Java class that implements <samp>org.eclipse.wst.server.ui.editor.ServerEditorActionFactoryDelegate</samp>.
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.wst.server.ui.editor.ServerEditorActionFactoryDelegate"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="typeIds" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="order" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following is an example of an editor action extension point:
-
-<p>
-<pre>
-
-</pre>
-</p>
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2000, 2003 IBM Corporation and others.<br>
-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
-<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/org.eclipse.wst.server.ui/schema/editorPageSections.exsd b/plugins/org.eclipse.wst.server.ui/schema/editorPageSections.exsd
deleted file mode 100644
index 60d7ace..0000000
--- a/plugins/org.eclipse.wst.server.ui/schema/editorPageSections.exsd
+++ /dev/null
@@ -1,136 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.server.ui">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.server.ui" id="editorPageSections" name="Editor Page Sections"/>
- </appInfo>
- <documentation>
- This extension point provides a way to add additional sections into an existing server editor page that contains insertion points.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <choice>
- <element ref="section"/>
- </choice>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="section">
- <annotation>
- <appInfo>
- <meta.element labelAttribute="name"/>
- </appInfo>
- </annotation>
- <complexType>
- <sequence>
- </sequence>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- specifies a unique identifier for this extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- specifies the fully qualified name of the Java class that implements <samp>org.eclipse.wst.server.ui.editor.ServerEditorPageSectionFactoryDelegate</samp>.
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.wst.server.ui.editor.ServerEditorPageSectionFactoryDelegate"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="typeIds" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="order" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="insertionId" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following is an example of an editor page section extension point:
-
-<p>
-<pre>
- <extension point="org.eclipse.wst.server.ui.editorPageSections">
- <section
- id="com.example"
- order="0"
- insertionId="com.example.left"
- typeIds="com.example.*"
- class="com.example.ExampleEditorSectionFactory"/>
- </extension>
-</pre>
-</p>
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- Value of the attribute <b>class</b> must be a fully qualified name of a Java class that implements the interface <b>org.eclipse.wst.server.ui.editor.ServerEditorPageSectionFactoryDelegate</b>.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2000, 2003 IBM Corporation and others.<br>
-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
-<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/org.eclipse.wst.server.ui/schema/editorPages.exsd b/plugins/org.eclipse.wst.server.ui/schema/editorPages.exsd
deleted file mode 100644
index 0bc86e1..0000000
--- a/plugins/org.eclipse.wst.server.ui/schema/editorPages.exsd
+++ /dev/null
@@ -1,143 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.server.ui">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.server.ui" id="editorPages" name="Editor Pages"/>
- </appInfo>
- <documentation>
- This extension point provides a way to add an additional page to a server or server configuration editor.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <choice>
- <element ref="page"/>
- </choice>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="page">
- <annotation>
- <appInfo>
- <meta.element labelAttribute="name"/>
- </appInfo>
- </annotation>
- <complexType>
- <sequence>
- </sequence>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- specifies a unique identifier for this extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- specifies the fully qualified name of the Java class that implements <samp>org.eclipse.wst.server.ui.editor.ServerEditorPageSectionFactoryDelegate</samp>.
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.wst.server.ui.editor.ServerEditorPageFactoryDelegate"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="name" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="typeIds" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="order" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="insertionIds" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following is an example of an editor page extension point:
-
-<p>
-<pre>
- <extension point="org.eclipse.wst.server.ui.editorPages">
- <page
- id="com.example"
- order="20"
- name="%editorPage"
- typeIds="com.example.*"
- class="com.example.ExampleEditorFactory"/>
- </extension>
-</pre>
-</p>
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- Value of the attribute <b>class</b> must be a fully qualified name of a Java class that implements the interface <b>org.eclipse.wst.server.ui.editor.ServerEditorPartFactoryDelegate</b>.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2000, 2003 IBM Corporation and others.<br>
-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
-<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/org.eclipse.wst.server.ui/schema/serverImages.exsd b/plugins/org.eclipse.wst.server.ui/schema/serverImages.exsd
deleted file mode 100644
index cb5bb2e..0000000
--- a/plugins/org.eclipse.wst.server.ui/schema/serverImages.exsd
+++ /dev/null
@@ -1,120 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.server.ui">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.server.ui" id="serverImages" name="Server Images"/>
- </appInfo>
- <documentation>
- This extension point provides a way to provide an image for a runtime, server, server configuration or module type.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <choice>
- <element ref="image" minOccurs="0" maxOccurs="unbounded"/>
- </choice>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="image">
- <annotation>
- <appInfo>
- <meta.element labelAttribute="name"/>
- </appInfo>
- </annotation>
- <complexType>
- <sequence>
- </sequence>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- specifies a unique identifier for this extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="icon" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute kind="resource"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="typeIds" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following is an example of a server image extension point:
-
-<p>
-<pre>
- <extension point="org.eclipse.wst.server.ui.serverImages">
- <image
- id="com.example"
- icon="icons/obj16/runtime.gif"
- typeIds="com.example.runtime"/>
- </extension>
-</pre>
-</p>
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2000, 2003 IBM Corporation and others.<br>
-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
-<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/org.eclipse.wst.server.ui/schema/wizardFragments.exsd b/plugins/org.eclipse.wst.server.ui/schema/wizardFragments.exsd
deleted file mode 100644
index 694e566..0000000
--- a/plugins/org.eclipse.wst.server.ui/schema/wizardFragments.exsd
+++ /dev/null
@@ -1,120 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.server.ui">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.server.ui" id="WizardFragments" name="Wizard Fragments"/>
- </appInfo>
- <documentation>
- This extension point provides a way to add pages or logic into wizards for a specific runtime, server, or server configuration type.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="fragment" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="fragment">
- <annotation>
- <appInfo>
- <meta.element labelAttribute="name"/>
- </appInfo>
- </annotation>
- <complexType>
- <sequence>
- </sequence>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- specifies a unique identifier for this extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- specifies the fully qualified name of the Java class that implements <samp>org.eclipse.wst.server.ui.wizard.WizardFragment</samp>.
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.wst.server.ui.wizard.WizardFragment"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="typeIds" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following is an example of a wizard fragment extension point:
-
-<p>
-<pre>
- <extension point="org.eclipse.wst.server.ui.wizardFragments">
- <fragment
- id="com.example"
- typeIds="com.example.runtime"
- class="com.example.ExampleWizardFragment"/>
- </extension>
-</pre>
-</p>
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- Value of the attribute <b>class</b> must be a fully qualified name of a Java class that implements the interface <b>org.eclipse.wst.server.ui.wizard.WizardFragment</b>.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2000, 2003 IBM Corporation and others.<br>
-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
-<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/ServerLaunchConfigurationTab.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/ServerLaunchConfigurationTab.java
deleted file mode 100644
index 3077d24..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/ServerLaunchConfigurationTab.java
+++ /dev/null
@@ -1,284 +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;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.PlatformUI;
-
-import org.eclipse.wst.server.core.*;
-import org.eclipse.wst.server.core.internal.Server;
-import org.eclipse.wst.server.ui.internal.*;
-/**
- * Server launch configuration tab.
- *
- * @since 1.0
- */
-public class ServerLaunchConfigurationTab extends AbstractLaunchConfigurationTab {
- protected String[] serverTypeIds;
-
- protected Combo serverCombo;
-
- protected Label runtimeLabel;
- protected Label runtimeLocation;
-
- protected IServer server;
-
- // list of servers that are in combo
- protected List servers;
-
- // flag to be used to decide whether to enable combo in launch config dialog
- // after the user requests a launch, they cannot change it
- private static final String READ_ONLY = "read-only";
-
- public ServerLaunchConfigurationTab() {
- this(new String[] {"*"});
- }
-
- public ServerLaunchConfigurationTab(String[] serverTypeIds) {
- this.serverTypeIds = serverTypeIds;
- }
-
- /*
- * @see ILaunchConfigurationTab#createControl(Composite)
- */
- public void createControl(Composite parent) {
- Composite composite = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginWidth = 10;
- layout.marginHeight = 10;
- layout.numColumns = 1;
- composite.setLayout(layout);
-
- GridData data = new GridData(GridData.FILL_HORIZONTAL);
- composite.setLayoutData(data);
-
- Label label = new Label(composite, SWT.WRAP);
- label.setText(ServerUIPlugin.getResource("%serverLaunchServer"));
- label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- serverCombo = new Combo(composite, SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY);
- serverCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- serverCombo.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
- public void widgetSelected(SelectionEvent e) {
- handleServerSelection();
- }
- });
- PlatformUI.getWorkbench().getHelpSystem().setHelp(serverCombo, ContextIds.LAUNCH_CONFIGURATION_SERVER_COMBO);
-
- runtimeLabel = new Label(composite, SWT.NONE);
- runtimeLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- runtimeLocation = new Label(composite, SWT.NONE);
- runtimeLocation.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- // initialize
- IServer[] servers2 = ServerCore.getServers();
- servers = new ArrayList();
- if (servers2 != null) {
- int size = servers2.length;
- for (int i = 0; i < size; i++) {
- IServer server2 = servers2[i];
- if (isSupportedServer(server2.getServerType().getId())) {
- serverCombo.add(server2.getName());
- servers.add(server2);
- }
- }
- }
-
- // select first item in list
- if (serverCombo.getItemCount() > 0)
- serverCombo.select(0);
-
- handleServerSelection();
-
- serverCombo.forceFocus();
-
- Dialog.applyDialogFont(composite);
- setControl(composite);
- }
-
- private boolean isSupportedServer(String serverTypeId) {
- if (serverTypeIds == null)
- return true;
- int size = serverTypeIds.length;
- for (int i = 0; i < size; i++) {
- if (matches(serverTypeId, serverTypeIds[i]))
- return true;
- }
- return false;
- }
-
- private static boolean matches(String a, String b) {
- if (a == null || b == null || "*".equals(a) || "*".equals(b) || a.startsWith(b) || b.startsWith(a))
- return true;
- return false;
- }
-
- protected void handleServerSelection() {
- if (servers.isEmpty())
- server = null;
- else
- server = (IServer) servers.get(serverCombo.getSelectionIndex());
- IRuntime runtime = null;
- if (server != null) {
- runtime = server.getRuntime();
- runtimeLocation.setText(ServerUIPlugin.getResource("%serverLaunchHost") + " " + server.getHost());
- } else
- runtimeLocation.setText(ServerUIPlugin.getResource("%serverLaunchHost"));
-
- if (runtime != null)
- runtimeLabel.setText(ServerUIPlugin.getResource("%serverLaunchRuntime") + " " + runtime.getName());
- else
- runtimeLabel.setText(ServerUIPlugin.getResource("%serverLaunchRuntime"));
-
- if (server == null)
- setErrorMessage(ServerUIPlugin.getResource("%errorNoServerSelected"));
- else if (server.getServerState() != IServer.STATE_STOPPED)
- setErrorMessage(ServerUIPlugin.getResource("%errorServerAlreadyRunning"));
- else
- setErrorMessage(null);
- /*if (server != null) {
- server.setLaunchDefaults(configuration);
- }*/
- updateLaunchConfigurationDialog();
- }
-
- protected void setErrorMessage(String s) {
- super.setErrorMessage(s);
- }
-
- protected void updateLaunchConfigurationDialog() {
- super.updateLaunchConfigurationDialog();
- }
-
- /*
- * @see ILaunchConfigurationTab#setDefaults(ILaunchConfigurationWorkingCopy)
- */
- public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
- setErrorMessage(null);
- if (serverCombo != null) {
- serverCombo.setEnabled(true);
- if (serverCombo.getItemCount() > 0)
- serverCombo.select(0);
- }
-
- if (servers != null) {
- server = (IServer) servers.get(serverCombo.getSelectionIndex());
- if (server != null)
- try {
- ((Server) server).setupLaunchConfiguration(configuration, null);
- } catch (CoreException ce) {
- Trace.trace(Trace.SEVERE, "Error setting up launch configuration", ce);
- }
- }
- }
-
- /*
- * @see ILaunchConfigurationTab#initializeFrom(ILaunchConfiguration)
- */
- public void initializeFrom(ILaunchConfiguration configuration) {
- serverCombo.setEnabled(true);
- //remove error message that other instances may have set
- setErrorMessage(null);
-
- try {
- String serverId = configuration.getAttribute(IServerAttributes.ATTR_SERVER_ID, "");
- if (serverId != null && !serverId.equals("")) {
- server = ServerCore.findServer(serverId);
-
- if (server == null) { //server no longer exists
- setErrorMessage(ServerUIPlugin.getResource("%errorInvalidServer"));
- //serverCombo.clearSelection(); //appears to be broken...doesn't work with read only?
- serverCombo.setEnabled(false);
- return;
- }
-
- serverCombo.setText(server.getName());
- if (server.getServerState() != IServer.STATE_STOPPED)
- setErrorMessage(ServerUIPlugin.getResource("%errorServerAlreadyRunning"));
- } else {
- if (serverCombo.getItemCount() > 0)
- serverCombo.select(0);
- }
- //flag should only be set if launch has been attempted on the config
- if (configuration.getAttribute(READ_ONLY, false))
- serverCombo.setEnabled(false);
- } catch (CoreException e) {
- // ignore
- }
- }
-
- /*
- * @see ILaunchConfigurationTab#performApply(ILaunchConfigurationWorkingCopy)
- */
- public void performApply(ILaunchConfigurationWorkingCopy configuration) {
- if (server != null)
- configuration.setAttribute(IServerAttributes.ATTR_SERVER_ID, server.getId());
- else
- configuration.setAttribute(IServerAttributes.ATTR_SERVER_ID, (String)null);
- }
-
- /*
- * @see ILaunchConfigurationTab#isValid()
- */
- public boolean isValid() {
- if (serverCombo.getSelectionIndex() != -1)
- return true;
- return false;
- }
-
- /*
- * @see ILaunchConfigurationTab#isValid(ILaunchConfiguration)
- */
- public boolean isValid(ILaunchConfiguration launchConfig) {
- try {
- String id = launchConfig.getAttribute(IServerAttributes.ATTR_SERVER_ID, "");
- if (id != null && !id.equals("")) {
- IServer server2 = ServerCore.findServer(id);
- if (server2 == null)
- return false;
- if (server2.getServerState() == IServer.STATE_STOPPED)
- return true;
- }
- } catch (CoreException e) {
- // ignore
- }
- return false;
- }
-
- public Image getImage() {
- return ImageResource.getImage(ImageResource.IMG_SERVER);
- }
-
- /*
- * @see ILaunchConfigurationTab#getName()
- */
- public String getName() {
- return ServerUIPlugin.getResource("%serverLaunchConfigurationTab");
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/ServerUICore.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/ServerUICore.java
deleted file mode 100644
index 5a1bc0e..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/ServerUICore.java
+++ /dev/null
@@ -1,42 +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;
-
-import org.eclipse.jface.viewers.ILabelProvider;
-
-import org.eclipse.wst.server.ui.internal.ServerLabelProvider;
-/**
- * Server UI core.
- *
- * @since 1.0
- */
-public class ServerUICore {
- private static ServerLabelProvider labelProvider;
-
- /**
- * ServerUICore constructor comment.
- */
- private ServerUICore() {
- super();
- }
-
- /**
- * Returns a label provider that can be used for all server
- * objects in the UI.
- *
- * @return a label provider
- */
- public static ILabelProvider getLabelProvider() {
- if (labelProvider == null)
- labelProvider = new ServerLabelProvider();
- return labelProvider;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/ServerUIUtil.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/ServerUIUtil.java
deleted file mode 100644
index 927eb84..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/ServerUIUtil.java
+++ /dev/null
@@ -1,41 +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;
-
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-
-import org.eclipse.swt.widgets.Shell;
-/**
- * Server UI utility methods.
- *
- * @since 1.0
- */
-public class ServerUIUtil {
- /**
- * ServerUIUtil constructor comment.
- */
- private ServerUIUtil() {
- super();
- }
-
- /**
- * Open the new runtime wizard.
- *
- * @param shell a shell to use when creating the wizard
- * @param type the type of module to create a runtime for
- * @param version the version of module to create a runtime for
- * @return <code>true</code> if a runtime was created, or
- * <code>false</code> otherwise
- */
- public static boolean showNewRuntimeWizard(Shell shell, final String type, final String version) {
- return ServerUIPlugin.showNewRuntimeWizard(shell, type, version, null);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/actions/DebugOnServerAction.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/actions/DebugOnServerAction.java
deleted file mode 100644
index b49da43..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/actions/DebugOnServerAction.java
+++ /dev/null
@@ -1,55 +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.actions;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.wst.server.ui.internal.ImageResource;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-import org.eclipse.wst.server.ui.internal.actions.DebugOnServerActionDelegate;
-/**
- * "Debug on Server" menu action. Allows the user to select an
- * object, and have automatic server creation, launching, and
- * the appropriate client to appear. A new instance of this
- * action must be created for each object that the user selects.
- *
- * @since 1.0
- */
-public class DebugOnServerAction extends Action {
- protected DebugOnServerActionDelegate delegate;
-
- /**
- * DebugOnServerAction constructor comment.
- *
- * @param object the object to attempt to debug
- */
- public DebugOnServerAction(Object object) {
- super(ServerUIPlugin.getResource("%actionDebugOnServer"));
-
- setDisabledImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_DTOOL_DEBUG_ON_SERVER));
- setHoverImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_CTOOL_DEBUG_ON_SERVER));
- setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_ETOOL_DEBUG_ON_SERVER));
-
- delegate = new DebugOnServerActionDelegate();
- if (object != null) {
- StructuredSelection sel = new StructuredSelection(object);
- delegate.selectionChanged(this, sel);
- } else
- delegate.selectionChanged(this, null);
- }
-
- /**
- * Implementation of method defined on <code>IAction</code>.
- */
- public void run() {
- delegate.run(this);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/actions/LaunchWizardAction.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/actions/LaunchWizardAction.java
deleted file mode 100644
index 560c7ae..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/actions/LaunchWizardAction.java
+++ /dev/null
@@ -1,61 +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.actions;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkbenchWizard;
-import org.eclipse.ui.PlatformUI;
-/**
- * An abstract action that opens up a workbench wizard when run.
- *
- * @since 1.0
- */
-abstract class LaunchWizardAction extends Action {
- /**
- * LaunchWizardAction
- */
- public LaunchWizardAction() {
- super();
- }
-
- /**
- * Return the workbench wizard that should be opened.
- *
- * @return the wizard to open
- */
- protected abstract IWorkbenchWizard getWizard();
-
- /*
- * @see IAction.run()
- */
- public void run() {
- IWorkbench workbench = PlatformUI.getWorkbench();
- IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
- ISelection selection = workbenchWindow.getSelectionService().getSelection();
-
- IStructuredSelection selectionToPass = null;
- if (selection instanceof IStructuredSelection)
- selectionToPass = (IStructuredSelection) selection;
- else
- selectionToPass = StructuredSelection.EMPTY;
-
- IWorkbenchWizard wizard = getWizard();
- wizard.init(workbench, selectionToPass);
- WizardDialog dialog = new WizardDialog(workbench.getActiveWorkbenchWindow().getShell(), wizard);
- dialog.open();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/actions/NewServerAction.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/actions/NewServerAction.java
deleted file mode 100644
index 90d650d..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/actions/NewServerAction.java
+++ /dev/null
@@ -1,56 +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.actions;
-
-import org.eclipse.ui.IWorkbenchWizard;
-import org.eclipse.wst.server.ui.internal.ImageResource;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-import org.eclipse.wst.server.ui.internal.wizard.NewServerWizard;
-/**
- * An action to invoke the new server and server configuration wizard.
- *
- * @since 1.0
- */
-public class NewServerAction extends LaunchWizardAction {
- protected String[] ids;
- protected String[] values;
-
- /**
- * New server action.
- */
- public NewServerAction() {
- super();
-
- setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_CTOOL_NEW_SERVER));
- setText(ServerUIPlugin.getResource("%actionSetNewServer"));
- }
-
- /**
- * New server action.
- *
- * @param ids ids to pass into the action
- * @param values values to pass into the action
- */
- public NewServerAction(String[] ids, String[] values) {
- this();
- this.ids = ids;
- this.values = values;
- }
-
- /**
- * Return the wizard that should be opened.
- *
- * @return org.eclipse.ui.IWorkbenchWizard
- */
- protected IWorkbenchWizard getWizard() {
- return new NewServerWizard(ids, values);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/actions/ProfileOnServerAction.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/actions/ProfileOnServerAction.java
deleted file mode 100644
index daec566..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/actions/ProfileOnServerAction.java
+++ /dev/null
@@ -1,55 +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.actions;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.wst.server.ui.internal.ImageResource;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-import org.eclipse.wst.server.ui.internal.actions.ProfileOnServerActionDelegate;
-/**
- * "Profile on Server" menu action. Allows the user to select an
- * object, and have automatic server creation, launching, and
- * the appropriate client to appear. A new instance of this
- * action must be created for each object that the user selects.
- *
- * @since 1.0
- */
-public class ProfileOnServerAction extends Action {
- protected ProfileOnServerActionDelegate delegate;
-
- /**
- * Profile an object on server.
- *
- * @param object the object to attempt to debug
- */
- public ProfileOnServerAction(Object object) {
- super(ServerUIPlugin.getResource("%actionProfileOnServer"));
-
- setDisabledImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_DTOOL_PROFILE_ON_SERVER));
- setHoverImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_CTOOL_PROFILE_ON_SERVER));
- setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_ETOOL_PROFILE_ON_SERVER));
-
- delegate = new ProfileOnServerActionDelegate();
- if (object != null) {
- StructuredSelection sel = new StructuredSelection(object);
- delegate.selectionChanged(this, sel);
- } else
- delegate.selectionChanged(this, null);
- }
-
- /**
- * Implementation of method defined on <code>IAction</code>.
- */
- public void run() {
- delegate.run(this);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/actions/RestartProjectAction.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/actions/RestartProjectAction.java
deleted file mode 100644
index e03e6f4..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/actions/RestartProjectAction.java
+++ /dev/null
@@ -1,46 +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.actions;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-import org.eclipse.wst.server.ui.internal.actions.RestartProjectActionDelegate;
-/**
- * Action to restart an individual project on servers that
- * support it.
- *
- * @since 1.0
- */
-public class RestartProjectAction extends Action {
- protected RestartProjectActionDelegate delegate;
-
- /**
- * RestartProjectAction constructor comment.
- *
- * @param project the project to restart
- */
- public RestartProjectAction(IProject project) {
- super(ServerUIPlugin.getResource("%actionRestartProject"));
-
- delegate = new RestartProjectActionDelegate();
- StructuredSelection sel = new StructuredSelection(project);
- delegate.selectionChanged(this, sel);
- }
-
- /**
- * Implementation of method defined on <code>IAction</code>.
- */
- public void run() {
- delegate.run(this);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/actions/RunOnServerAction.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/actions/RunOnServerAction.java
deleted file mode 100644
index 70da368..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/actions/RunOnServerAction.java
+++ /dev/null
@@ -1,55 +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.actions;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.wst.server.ui.internal.ImageResource;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-import org.eclipse.wst.server.ui.internal.actions.RunOnServerActionDelegate;
-/**
- * "Run on Server" menu action. Allows the user to select an
- * object, and have automatic server creation, launching, and
- * the appropriate client to appear. A new instance of this
- * action must be created for each object that the user selects.
- *
- * @since 1.0
- */
-public class RunOnServerAction extends Action {
- protected RunOnServerActionDelegate delegate;
-
- /**
- * Run on server action.
- *
- * @param object the object to attempt to debug
- */
- public RunOnServerAction(Object object) {
- super(ServerUIPlugin.getResource("%actionRunOnServer"));
-
- setDisabledImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_DTOOL_RUN_ON_SERVER));
- setHoverImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_CTOOL_RUN_ON_SERVER));
- setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_ETOOL_RUN_ON_SERVER));
-
- delegate = new RunOnServerActionDelegate();
- if (object != null) {
- StructuredSelection sel = new StructuredSelection(object);
- delegate.selectionChanged(this, sel);
- } else
- delegate.selectionChanged(this, null);
- }
-
- /**
- * Implementation of method defined on <code>IAction</code>.
- */
- public void run() {
- delegate.run(this);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/actions/package.xml b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/actions/package.xml
deleted file mode 100644
index a750aa8..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/actions/package.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<html>
-<head>
- <!-- Escape to the root of your source folder -->
- <meta
- name="root"
- content="../../../../../../" />
- <title>WTP API overview</title>
-</head>
-
-<body>
-
-<p>Access to server tools actions.</p>
-
-<p>The actions contained in this package allow clients to launch the server
-wizards and run/debug/profile a specific server.</p>
-
-</body>
-</html>
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/editor/ICommandManager.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/editor/ICommandManager.java
deleted file mode 100644
index f283c29..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/editor/ICommandManager.java
+++ /dev/null
@@ -1,28 +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.editor;
-
-import org.eclipse.wst.server.core.ITask;
-/**
- * A command manager.
- *
- * @since 1.0
- */
-public interface ICommandManager {
- /**
- * Execute the given command and place it in the undo stack.
- * If the command cannot be undone, the user will be notifed
- * before it is executed.
- *
- * @param task a task to execute
- */
- public void executeCommand(ITask task);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/editor/IOrdered.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/editor/IOrdered.java
deleted file mode 100644
index ff05a36..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/editor/IOrdered.java
+++ /dev/null
@@ -1,35 +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.editor;
-/**
- * An object that has an absolute ordering, and can be ordered against other objects.
- *
- * <p>
- * [issue: It is notoriously difficult to place any kind of
- * useful order on objects that are contributed independently by
- * non-collaborating parties. The IOrdered mechanism is weak, and
- * can't really solve the problem. Issues of presentation are usually
- * best left to the UI, which can sort objects based on arbitrary
- * properties.]
- * </p>
- *
- * <p>This interface is not intended to be implemented by clients.</p>
- *
- * @since 1.0
- */
-public interface IOrdered {
- /**
- * Returns the order (index/priority).
- *
- * @return int
- */
- public int getOrder();
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/editor/IServerEditorPartInput.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/editor/IServerEditorPartInput.java
deleted file mode 100644
index 101b72f..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/editor/IServerEditorPartInput.java
+++ /dev/null
@@ -1,45 +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.editor;
-
-import org.eclipse.ui.IEditorInput;
-
-import org.eclipse.wst.server.core.IServerWorkingCopy;
-/**
- *
- *
- * @since 1.0
- */
-public interface IServerEditorPartInput extends IEditorInput {
- /**
- * Returns the server to be edited.
- *
- * @return a working copy of the server
- */
- public IServerWorkingCopy getServer();
-
- /**
- * Returns true if the server is read-only.
- *
- * @return boolean <code>true</code> if the server is read-only,
- * and <code>false</code> otherwise
- */
- public boolean isServerReadOnly();
-
- /**
- * Gets the command manager. The editor is only responsible for creating an
- * ICommand and passing it to the command manager, which actually performs
- * the action and updates the server.
- *
- * @return commandManager the command manager
- */
- public ICommandManager getServerCommandManager();
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/editor/IServerEditorSection.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/editor/IServerEditorSection.java
deleted file mode 100644
index f4f7ff6..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/editor/IServerEditorSection.java
+++ /dev/null
@@ -1,59 +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.editor;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorSite;
-/**
- *
- * @since 1.0
- */
-public interface IServerEditorSection {
- /**
- * Initialize the section.
- *
- * @param site the editor site
- * @param input the editor input
- */
- public void init(IEditorSite site, IEditorInput input);
-
- /**
- * Create the section.
- *
- * @param parent the parent composite
- */
- public void createSection(Composite parent);
-
- /**
- * Disposes of the section.
- */
- public void dispose();
-
- /**
- * Return the error message for this page.
- *
- * @return the error message
- */
- public String getErrorMessage();
-
- /**
- * Returns error or status messages that will be displayed when the
- * server resource is saved. If there are any error messages, the
- * user will be unable to save the editor.
- *
- * @return a status object with code <code>IStatus.OK</code> if this
- * server can be saved, otherwise a status object indicating why
- * it can't be
- */
- public IStatus[] getSaveStatus();
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/editor/ServerEditorActionFactoryDelegate.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/editor/ServerEditorActionFactoryDelegate.java
deleted file mode 100644
index ea00017..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/editor/ServerEditorActionFactoryDelegate.java
+++ /dev/null
@@ -1,37 +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.editor;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.ui.IEditorSite;
-
-import org.eclipse.wst.server.core.IServerWorkingCopy;
-/**
- *
- * @since 1.0
- */
-public abstract class ServerEditorActionFactoryDelegate {
- /**
- * Returns true if this editor action should be visible on the given
- * server. This allows actions to be filtered based on the server type
- * or server attributes.
- *
- * @param server
- */
- public boolean shouldDisplay(IServerWorkingCopy server) {
- return true;
- }
-
- /**
- * Create the action.
- */
- public abstract IAction createAction(IEditorSite site, IServerEditorPartInput input);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/editor/ServerEditorPageSectionFactoryDelegate.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/editor/ServerEditorPageSectionFactoryDelegate.java
deleted file mode 100644
index f823bae..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/editor/ServerEditorPageSectionFactoryDelegate.java
+++ /dev/null
@@ -1,33 +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.editor;
-
-import org.eclipse.wst.server.core.IServerWorkingCopy;
-/**
- *
- * @since 1.0
- */
-public abstract class ServerEditorPageSectionFactoryDelegate {
- /**
- * Returns true if this editor page section should be visible with the given
- * server and configuration combination. This allows (for
- * instance) complex configuration pages to only be shown when used
- * with non-unittest servers.
- */
- public boolean shouldCreateSection(IServerWorkingCopy server) {
- return true;
- }
-
- /**
- * Create the editor page section.
- */
- public abstract IServerEditorSection createSection();
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/editor/ServerEditorPart.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/editor/ServerEditorPart.java
deleted file mode 100644
index 9aaa2ac..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/editor/ServerEditorPart.java
+++ /dev/null
@@ -1,275 +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.editor;
-
-import java.util.*;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.ui.part.EditorPart;
-import org.eclipse.wst.server.core.IServerWorkingCopy;
-import org.eclipse.wst.server.ui.internal.editor.IServerEditorPageSectionFactory;
-import org.eclipse.wst.server.ui.internal.editor.IServerEditorPartFactory;
-import org.eclipse.wst.server.ui.internal.editor.ServerEditorCore;
-/**
- * An abstract server editor which implements the most common methods
- * from IEditorPart.
- *
- * This class also provides each editor page with an error message which
- * will be displayed on the status bar of the editor.
- *
- * @since 1.0
- */
-public abstract class ServerEditorPart extends EditorPart {
- public static final int PROP_ERROR = 5;
-
- private String errorMessage = null;
-
- private Map sectionToInsertionId = null;
- private List sections = null;
-
- protected IServerEditorPartFactory pageFactory;
- protected IServerWorkingCopy server;
- protected ICommandManager commandManager;
- protected boolean readOnly;
-
- private FormToolkit toolkit;
-
- public ServerEditorPart() {
- super();
- }
-
- public void setPageFactory(IServerEditorPartFactory pageFactory) {
- this.pageFactory = pageFactory;
- }
-
- /*
- * @see IEditorPart#doSave(IProgressMonitor)
- */
- public void doSave(IProgressMonitor monitor) {
- // do nothing
- }
-
- /*
- * @see IEditorPart#doSaveAs()
- */
- public void doSaveAs() {
- // do nothing
- }
-
- /*
- * @see IEditorPart#gotoMarker(IMarker)
- */
- public void gotoMarker(IMarker marker) {
- // do nothing
- }
-
- /*
- * @see IEditorPart#isDirty()
- */
- public boolean isDirty() {
- return false;
- }
-
- /*
- * @see IEditorPart#isSaveAsAllowed()
- */
- public boolean isSaveAsAllowed() {
- return false;
- }
-
- /**
- * Set an error message for this page.
- *
- * @param error java.lang.String
- */
- public void setErrorMessage(String error) {
- if (error == null && errorMessage == null)
- return;
-
- if (error != null && error.equals(errorMessage))
- return;
-
- errorMessage = error;
- super.firePropertyChange(PROP_ERROR);
- }
-
- public void updateErrorMessage() {
- super.firePropertyChange(PROP_ERROR);
- }
-
- /**
- * Return the error message for this page.
- *
- * @return java.lang.String
- */
- public String getErrorMessage() {
- if (errorMessage == null) {
- Iterator iterator = getSections().iterator();
- while (iterator.hasNext()) {
- IServerEditorSection section = (IServerEditorSection) iterator.next();
- String error = section.getErrorMessage();
- if (error != null)
- return error;
- }
- }
- return errorMessage;
- }
-
- /**
- * Returns error or status messages that will be displayed when the
- * server resource is saved. If there are any error messages, the
- * user will be unable to save the editor.
- *
- * @return org.eclipse.core.runtime.IStatus
- */
- public IStatus[] getSaveStatus() {
- Iterator iterator = getSections().iterator();
- List list = new ArrayList();
- while (iterator.hasNext()) {
- IServerEditorSection section = (IServerEditorSection) iterator.next();
- IStatus[] status = section.getSaveStatus();
- if (status != null) {
- int size = status.length;
- for (int i = 0; i < size; i++)
- list.add(status[i]);
- }
- }
-
- int size = list.size();
- IStatus[] status = new IStatus[size];
- list.toArray(status);
- return status;
- }
-
- private List getSections() {
- if (sections == null) {
- sections = new ArrayList();
- sectionToInsertionId = new HashMap();
- Iterator iterator = ServerEditorCore.getServerEditorPageSectionFactories().iterator();
- while (iterator.hasNext()) {
- IServerEditorPageSectionFactory factory = (IServerEditorPageSectionFactory) iterator.next();
- String insertionId = factory.getInsertionId();
-
- if (pageFactory.supportsInsertionId(insertionId)) {
- String serverTypeId = null;
- if (server != null)
- serverTypeId = server.getServerType().getId();
- if (serverTypeId != null && factory.supportsType(serverTypeId)
- && factory.shouldCreateSection(server)) {
- IServerEditorSection section = factory.createSection();
- if (section instanceof ServerEditorSection)
- ((ServerEditorSection) section).setServerResourceEditorPart(this);
- sections.add(section);
- List list = null;
- try {
- list = (List) sectionToInsertionId.get(insertionId);
- } catch (Exception e) {
- // ignore
- }
- if (list == null)
- list = new ArrayList();
- list.add(section);
- sectionToInsertionId.put(insertionId, list);
- }
- }
- }
- }
- return sections;
- }
-
- private List getSections(String insertionId) {
- if (insertionId == null)
- return null;
-
- getSections();
- List list = new ArrayList();
- try {
- List sections2 = (List) sectionToInsertionId.get(insertionId);
- Iterator iterator = sections2.iterator();
- while (iterator.hasNext()) {
- list.add(iterator.next());
- }
- } catch (Exception e) {
- // ignore
- }
- return list;
- }
-
- public void init(IEditorSite site, IEditorInput input) {
- setSite(site);
- setInput(input);
- if (input instanceof IServerEditorPartInput) {
- IServerEditorPartInput sepi = (IServerEditorPartInput) input;
- server = sepi.getServer();
- commandManager = sepi.getServerCommandManager();
- readOnly = sepi.isServerReadOnly();
- }
-
- Iterator iterator = getSections().iterator();
- while (iterator.hasNext()) {
- IServerEditorSection section = (IServerEditorSection) iterator.next();
- section.init(site, input);
- }
- }
-
- /**
- * Return the server that is being editted.
- *
- * @return a server working copy
- */
- public IServerWorkingCopy getServer() {
- return server;
- }
-
- public void insertSections(Composite parent, String id) {
- if (id == null)
- return;
-
- Iterator iterator = getSections(id).iterator();
- while (iterator.hasNext()) {
- IServerEditorSection section = (IServerEditorSection) iterator.next();
- section.createSection(parent);
- }
- }
-
- public void dispose() {
- super.dispose();
-
- Iterator iterator = getSections().iterator();
- while (iterator.hasNext()) {
- IServerEditorSection section = (IServerEditorSection) iterator.next();
- section.dispose();
- }
-
- if (toolkit != null)
- toolkit.dispose();
- }
-
- /**
- * Get a form toolkit to create widgets. It will automatically be disposed
- * when the editor is disposed.
- *
- * @param display
- * @return FormToolkit
- */
- protected FormToolkit getFormToolkit(Display display) {
- if (toolkit == null)
- toolkit = new FormToolkit(display);
- return toolkit;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/editor/ServerEditorPartFactoryDelegate.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/editor/ServerEditorPartFactoryDelegate.java
deleted file mode 100644
index b34063c..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/editor/ServerEditorPartFactoryDelegate.java
+++ /dev/null
@@ -1,35 +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.editor;
-
-import org.eclipse.ui.IEditorPart;
-
-import org.eclipse.wst.server.core.IServerWorkingCopy;
-/**
- *
- * @since 1.0
- */
-public abstract class ServerEditorPartFactoryDelegate {
- /**
- * Returns true if this editor page should be visible with the given
- * server and configuration combination. This allows (for
- * instance) complex configuration pages to only be shown when used
- * with non-unittest servers.
- */
- public boolean shouldCreatePage(IServerWorkingCopy server) {
- return true;
- }
-
- /**
- * Create the editor page.
- */
- public abstract IEditorPart createPage();
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/editor/ServerEditorSection.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/editor/ServerEditorSection.java
deleted file mode 100644
index 5bb025d..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/editor/ServerEditorSection.java
+++ /dev/null
@@ -1,106 +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.editor;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.wst.server.core.IServerWorkingCopy;
-/**
- *
- *
- * @since 1.0
- */
-public abstract class ServerEditorSection implements IServerEditorSection {
- private String errorMessage = null;
-
- public IServerWorkingCopy server;
- public ICommandManager commandManager;
- protected boolean readOnly;
- protected Composite parentComp;
- protected ServerEditorPart editor;
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.server.ui.editor.IServerEditorSection#init(org.eclipse.ui.IEditorSite, org.eclipse.ui.IEditorInput)
- */
- public void init(IEditorSite site, IEditorInput input) {
- if (input instanceof IServerEditorPartInput) {
- IServerEditorPartInput sepi = (IServerEditorPartInput) input;
- server = sepi.getServer();
- commandManager = sepi.getServerCommandManager();
- readOnly = sepi.isServerReadOnly();
- }
- }
-
- public void createSection(Composite parent) {
- this.parentComp = parent;
- }
-
- public Shell getShell() {
- return parentComp.getShell();
- }
-
- /**
- * Return the error message for this page.
- *
- * @return java.lang.String
- */
- public String getErrorMessage() {
- return errorMessage;
- }
-
- /**
- * Returns error or status messages that will be displayed when the
- * server resource is saved. If there are any error messages, the
- * user will be unable to save the editor.
- *
- * @return org.eclipse.core.runtime.IStatus
- */
- public IStatus[] getSaveStatus() {
- return null;
- }
-
- public void setServerResourceEditorPart(ServerEditorPart editor) {
- this.editor = editor;
- }
-
- /**
- * Set an error message for this page.
- *
- * @param error java.lang.String
- */
- public void setErrorMessage(String error) {
- if (error == null && errorMessage == null)
- return;
-
- if (error != null && error.equals(errorMessage))
- return;
-
- errorMessage = error;
- if (editor != null)
- editor.updateErrorMessage();
- }
-
- /**
- * Get a form toolkit to create widgets. It will automatically be disposed
- * when the editor is disposed.
- *
- * @param display
- * @return FormToolkit
- */
- public FormToolkit getFormToolkit(Display display) {
- return editor.getFormToolkit(display);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/editor/package.xml b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/editor/package.xml
deleted file mode 100644
index 862b08a..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/editor/package.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<html>
-<head>
- <!-- Escape to the root of your source folder -->
- <meta
- name="root"
- content="../../../../../../" />
- <title>WTP API overview</title>
-</head>
-
-<body>
-
-<p>Provides editor support for the server tools UI.</p>
-
-<p>Using extension points, clients can provide pages, sections, and
-actions to be added to the editor for a specific server type. This
-package contains the delegate classes for these extension points, as
-well as the API that they can use to put commands on the shared
-editor command history stack and interact with the editing framework.</p>
-
-</body>
-</html>
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ContextIds.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ContextIds.java
deleted file mode 100644
index 8d28a4a..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ContextIds.java
+++ /dev/null
@@ -1,87 +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;
-/**
- * Context help id constants.
- */
-public interface ContextIds {
- public static final String SELECT_SERVER_WIZARD = ServerUIPlugin.PLUGIN_ID + ".swsi0000";
- public static final String SELECT_SERVER_EXISTING = ServerUIPlugin.PLUGIN_ID + ".swsi0002";
- public static final String SELECT_SERVER_EXISTING_TABLE = ServerUIPlugin.PLUGIN_ID + ".swsi0004";
- public static final String SELECT_SERVER_CREATE = ServerUIPlugin.PLUGIN_ID + ".swsi0010";
- public static final String SELECT_SERVER_CREATE_TABLE = ServerUIPlugin.PLUGIN_ID + ".swsi0012";
- public static final String SELECT_SERVER_PREFERENCE = ServerUIPlugin.PLUGIN_ID + ".swsi0014";
-
- public static final String SELECT_CLIENT_WIZARD = ServerUIPlugin.PLUGIN_ID + ".swsc0000";
- public static final String SELECT_CLIENT = ServerUIPlugin.PLUGIN_ID + ".swsc0002";
-
- public static final String NEW_INSTANCE_WIZARD = ServerUIPlugin.PLUGIN_ID + ".swni0000";
- public static final String NEW_INSTANCE_NAME = ServerUIPlugin.PLUGIN_ID + ".swni0002";
- public static final String NEW_INSTANCE_FOLDER = ServerUIPlugin.PLUGIN_ID + ".swni0004";
- public static final String NEW_INSTANCE_FACTORY = ServerUIPlugin.PLUGIN_ID + ".swni0006";
-
- public static final String NEW_CONFIGURATION_WIZARD = ServerUIPlugin.PLUGIN_ID + ".swnc0000";
- public static final String NEW_CONFIGURATION_NAME = ServerUIPlugin.PLUGIN_ID + ".swnc0002";
- public static final String NEW_CONFIGURATION_FOLDER = ServerUIPlugin.PLUGIN_ID + ".swnc0004";
- public static final String NEW_CONFIGURATION_FACTORY = ServerUIPlugin.PLUGIN_ID + ".swnc0006";
-
- public static final String NEW_SERVER_WIZARD = ServerUIPlugin.PLUGIN_ID + ".swns0000";
- public static final String NEW_SERVER_NAME = ServerUIPlugin.PLUGIN_ID + ".swns0002";
- public static final String NEW_SERVER_FOLDER = ServerUIPlugin.PLUGIN_ID + ".swns0004";
- public static final String NEW_SERVER_INSTANCE_FACTORY = ServerUIPlugin.PLUGIN_ID + ".swns0006";
-
- public static final String LAUNCH_CONFIGURATION_SERVER_COMBO = ServerUIPlugin.PLUGIN_ID + ".swsl0000";
-
- public static final String SELECT_TASK_WIZARD = ServerUIPlugin.PLUGIN_ID + ".sstw0000";
-
- public static final String IMPORT_CONFIGURATION_WIZARD = ServerUIPlugin.PLUGIN_ID + ".swic0000";
- public static final String IMPORT_CONFIGURATION_NAME = ServerUIPlugin.PLUGIN_ID + ".swic0002";
- public static final String IMPORT_CONFIGURATION_FOLDER = ServerUIPlugin.PLUGIN_ID + ".swic0004";
- public static final String IMPORT_CONFIGURATION_FACTORY = ServerUIPlugin.PLUGIN_ID + ".swic0006";
- public static final String IMPORT_CONFIGURATION_LOCATION = ServerUIPlugin.PLUGIN_ID + ".swic0008";
- public static final String IMPORT_CONFIGURATION_LOCATION_BROWSE = ServerUIPlugin.PLUGIN_ID + ".swic0010";
-
- public static final String MODIFY_MODULES_COMPOSITE = ServerUIPlugin.PLUGIN_ID + ".swmm0000";
-
- public static final String NEW_SERVER_PROJECT_DIALOG = ServerUIPlugin.PLUGIN_ID + ".sdnp0000";
-
- public static final String TERMINATE_SERVER_DIALOG = ServerUIPlugin.PLUGIN_ID + ".sdti0000";
-
- public static final String PREF_GENERAL = ServerUIPlugin.PLUGIN_ID + ".spge0000";
- public static final String PREF_GENERAL_SHOW_PUBLISHING_DETAILS = ServerUIPlugin.PLUGIN_ID + ".spge0010";
- public static final String PREF_GENERAL_PUBLISH_BEFORE_START = ServerUIPlugin.PLUGIN_ID + ".spge0012";
- public static final String PREF_GENERAL_AUTO_RESTART = ServerUIPlugin.PLUGIN_ID + ".spge0014";
- public static final String PREF_GENERAL_SHOW_ON_ACTIVITY = ServerUIPlugin.PLUGIN_ID + ".spge0016";
- public static final String PREF_GENERAL_REPAIR = ServerUIPlugin.PLUGIN_ID + ".spge0018";
- public static final String PREF_GENERAL_PROMPT_IRREVERSIBLE = ServerUIPlugin.PLUGIN_ID + ".spge0020";
- public static final String PREF_GENERAL_CREATE_IN_WORKSPACE = ServerUIPlugin.PLUGIN_ID + ".spge0022";
- public static final String PREF_GENERAL_SAVE_EDITORS = ServerUIPlugin.PLUGIN_ID + ".spge0024";
-
- public static final String VIEW_CONFIG = ServerUIPlugin.PLUGIN_ID + ".svcf0000";
-
- public static final String VIEW_CONTROL = ServerUIPlugin.PLUGIN_ID + ".svcp0000";
-
- public static final String PUBLISH_DETAILS_DIALOG = ServerUIPlugin.PLUGIN_ID + ".sdpd0000";
- public static final String PUBLISH_DETAILS_DIALOG_STATUS = ServerUIPlugin.PLUGIN_ID + ".sdpd0002";
- public static final String PUBLISH_DETAILS_DIALOG_DETAILS_BUTTON = ServerUIPlugin.PLUGIN_ID + ".sdpd0004";
- public static final String PUBLISH_DETAILS_DIALOG_DETAILS = ServerUIPlugin.PLUGIN_ID + ".sdpd0006";
-
- public static final String PUBLISHER_DIALOG = ServerUIPlugin.PLUGIN_ID + ".sdpr0000";
- public static final String PUBLISHER_DIALOG_TREE = ServerUIPlugin.PLUGIN_ID + ".sdpr0002";
- public static final String PUBLISHER_DIALOG_SELECT_ALL = ServerUIPlugin.PLUGIN_ID + ".sdpr0004";
- public static final String PUBLISHER_DIALOG_DESELECT_ALL = ServerUIPlugin.PLUGIN_ID + ".sdpr0006";
- public static final String PUBLISHER_DIALOG_FILTER = ServerUIPlugin.PLUGIN_ID + ".sdpr0008";
- public static final String PUBLISHER_DIALOG_FILTER_DIALOG = ServerUIPlugin.PLUGIN_ID + ".sdpr0010";
-
- public static final String PROMPT_IRREVERSIBLE_DIALOG = ServerUIPlugin.PLUGIN_ID + ".sdpi0000";
-
- public static final String EDITOR_OVERVIEW_PAGE = ServerUIPlugin.PLUGIN_ID + ".seop0000";
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/DefaultServerImageDescriptor.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/DefaultServerImageDescriptor.java
deleted file mode 100644
index 3bcbadc..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/DefaultServerImageDescriptor.java
+++ /dev/null
@@ -1,95 +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.jface.resource.CompositeImageDescriptor;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.ImageData;
-import org.eclipse.swt.graphics.Point;
-/**
- * A OverlayImageDescriptor consists of a main icon and one or more overlays.
- * The overlays are computed according to flags set on creation of the descriptor.
- */
-public class DefaultServerImageDescriptor extends CompositeImageDescriptor {
- private Image fBaseImage;
- private Point fSize;
-
- /**
- * Create a new OverlayImageDescriptor.
- *
- * @param baseImage an image descriptor used as the base image
- */
- public DefaultServerImageDescriptor(Image baseImage) {
- setBaseImage(baseImage);
- }
-
- /**
- * @see CompositeImageDescriptor#getSize()
- */
- protected Point getSize() {
- if (fSize == null) {
- ImageData data = getBaseImage().getImageData();
- setSize(new Point(data.width, data.height));
- }
- return fSize;
- }
-
- /**
- * @see Object#equals(java.lang.Object)
- */
- public boolean equals(Object object) {
- if (!(object instanceof DefaultServerImageDescriptor))
- return false;
-
- DefaultServerImageDescriptor other = (DefaultServerImageDescriptor) object;
- return (getBaseImage().equals(other.getBaseImage()));
- }
-
- /**
- * @see Object#hashCode()
- */
- public int hashCode() {
- return getBaseImage().hashCode();
- }
-
- /**
- * @see CompositeImageDescriptor#drawCompositeImage(int, int)
- */
- protected void drawCompositeImage(int width, int height) {
- ImageData bg = getBaseImage().getImageData();
- if (bg == null)
- bg = DEFAULT_IMAGE_DATA;
-
- drawImage(bg, 0, 0);
- drawOverlays();
- }
-
- /**
- * Add any overlays to the image as specified in the flags.
- */
- protected void drawOverlays() {
- ImageData data = ImageResource.getImage(ImageResource.IMG_DEFAULT_SERVER_OVERLAY).getImageData();
- int x = getSize().x - data.width;
- drawImage(data, x, 0);
- }
-
- protected Image getBaseImage() {
- return fBaseImage;
- }
-
- protected void setBaseImage(Image baseImage) {
- fBaseImage = baseImage;
- }
-
- protected void setSize(Point size) {
- fSize = size;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/DefaultServerLabelDecorator.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/DefaultServerLabelDecorator.java
deleted file mode 100644
index 3447597..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/DefaultServerLabelDecorator.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 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 java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.jface.viewers.ILabelDecorator;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.swt.graphics.Image;
-/**
- *
- */
-public class DefaultServerLabelDecorator implements ILabelDecorator {
- protected Map map = new HashMap();
-
- //protected Image image2;
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ILabelDecorator#decorateImage(org.eclipse.swt.graphics.Image, java.lang.Object)
- */
- public Image decorateImage(Image image, Object element) {
- try {
- Image img = (Image) map.get(element);
- if (img != null)
- return img;
- } catch (Exception e) {
- // ignore
- }
-
- DefaultServerImageDescriptor dsid = new DefaultServerImageDescriptor(image);
- Image image2 = dsid.createImage();
- map.put(element, image2);
- return image2;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ILabelDecorator#decorateText(java.lang.String, java.lang.Object)
- */
- public String decorateText(String text, Object element) {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse.jface.viewers.ILabelProviderListener)
- */
- public void addListener(ILabelProviderListener listener) {
- // do nothing
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
- */
- public void dispose() {
- try {
- Iterator iterator = map.values().iterator();
- while (iterator.hasNext()) {
- Image image = (Image) iterator.next();
- image.dispose();
- }
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Could not dispose images", e);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(java.lang.Object, java.lang.String)
- */
- public boolean isLabelProperty(Object element, String property) {
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(org.eclipse.jface.viewers.ILabelProviderListener)
- */
- public void removeListener(ILabelProviderListener listener) {
- // do nothing
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/DeleteServerDialog.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/DeleteServerDialog.java
deleted file mode 100644
index dd9927b..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/DeleteServerDialog.java
+++ /dev/null
@@ -1,132 +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.IFolder;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.ProgressMonitorDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.actions.WorkspaceModifyOperation;
-
-import org.eclipse.wst.server.core.IServer;
-/**
- * Dialog that prompts a user to delete server(s) and/or server configuration(s).
- */
-public class DeleteServerDialog extends Dialog {
- protected IServer[] servers;
- protected IFolder[] configs;
-
- protected Button check;
-
- /**
- * DeleteServerDialog constructor comment.
- * @param parentShell org.eclipse.swt.widgets.Shell
- */
- public DeleteServerDialog(Shell parentShell, IServer[] servers, IFolder[] configs) {
- super(parentShell);
-
- if (servers == null || configs == null)
- throw new IllegalArgumentException();
-
- this.servers = servers;
- this.configs = configs;
-
- setBlockOnOpen(true);
- }
-
- /**
- *
- */
- protected void configureShell(Shell newShell) {
- super.configureShell(newShell);
- newShell.setText(ServerUIPlugin.getResource("%deleteServerResourceDialogTitle"));
- }
-
- /**
- *
- */
- protected Control createDialogArea(Composite parent) {
- // create a composite with standard margins and spacing
- Composite composite = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
- layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
- layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
- layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
- composite.setFont(parent.getFont());
- //WorkbenchHelp.setHelp(composite, ContextIds.TERMINATE_SERVER_DIALOG);
-
- Label label = new Label(composite, SWT.NONE);
- if (servers.length == 1) {
- label.setText(ServerUIPlugin.getResource("%deleteServerResourceDialogMessage", servers[0].getName()));
- } else
- label.setText(ServerUIPlugin.getResource("%deleteServerResourceDialogMessageMany", servers.length + ""));
- label.setLayoutData(new GridData());
-
- if (configs.length > 0) {
- check = new Button(composite, SWT.CHECK);
-
- if (configs.length == 1) {
- check.setText(ServerUIPlugin.getResource("%deleteServerResourceDialogLooseConfigurations", configs[0].getName()));
- } else
- check.setText(ServerUIPlugin.getResource("%deleteServerResourceDialogLooseConfigurationsMany", configs.length + ""));
- check.setSelection(true);
- check.setLayoutData(new GridData());
- }
-
- Dialog.applyDialogFont(composite);
-
- return composite;
- }
-
- protected void okPressed() {
- final boolean checked = (check != null && check.getSelection());
-
- try {
- WorkspaceModifyOperation op = new WorkspaceModifyOperation() {
- protected void execute(IProgressMonitor monitor) throws CoreException {
- try {
- int size = servers.length;
- for (int i = 0; i < size; i++) {
- servers[0].delete();
- }
-
- if (checked) {
- size = configs.length;
- for (int i = 0; i < size; i++) {
- configs[i].delete(true, true, monitor);
- }
- }
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error while deleting resources", e);
- }
- }
- };
- new ProgressMonitorDialog(getShell()).run(true, true, op);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error deleting resources", e);
- }
-
- super.okPressed();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/EclipseUtil.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/EclipseUtil.java
deleted file mode 100644
index 9842c77..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/EclipseUtil.java
+++ /dev/null
@@ -1,238 +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.IProject;
-import org.eclipse.core.resources.IProjectDescription;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.*;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.model.IWorkbenchAdapter;
-
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.ServerCore;
-import org.eclipse.wst.server.core.internal.ProjectProperties;
-/**
- * Eclipse utility methods.
- */
-public class EclipseUtil {
- /**
- * EclipseUtil constructor comment.
- */
- private EclipseUtil() {
- super();
- }
-
- /**
- * Creates a new server project with the given name. If path is
- * null, it will be created in the default location.
- *
- * @param name java.lang.String
- * @param path org.eclipse.core.resource.IPath
- * @param monitor
- * @return org.eclipse.core.runtime.IStatus
- */
- private static IStatus createServerProject(String name, IPath path, IProgressMonitor monitor) {
- //monitor = ProgressUtil.getMonitorFor(monitor);
- //monitor.beginTask(ServerPlugin.getResource("%createServerProjectTask"), 3000);
-
- try {
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- IProject project = workspace.getRoot().getProject(name);
-
- // get a project descriptor
- IProjectDescription description = workspace.newProjectDescription(name);
- description.setLocation(path);
-
- project.create(description, ProgressUtil.getSubMonitorFor(monitor, 1000));
- if (monitor.isCanceled())
- return null;
- project.open(ProgressUtil.getSubMonitorFor(monitor, 1000));
- if (monitor.isCanceled())
- return null;
-
- // add the server project nature
- ((ProjectProperties)ServerCore.getProjectProperties(project)).setServerProject(true, monitor);
-
- if (monitor.isCanceled())
- return null;
-
- return new Status(IStatus.OK, ServerUIPlugin.PLUGIN_ID, 0, ServerUIPlugin.getResource("%serverProjectCreated"), null);
- } catch (CoreException ce) {
- Trace.trace(Trace.SEVERE, "Could not create server project named " + name, ce);
- return new Status(IStatus.ERROR, ServerUIPlugin.PLUGIN_ID, 0, ServerUIPlugin.getResource("%errorCouldNotCreateServerProjectStatus", ce.getMessage()), ce);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not create server project (2) named " + name, e);
- return new Status(IStatus.ERROR, ServerUIPlugin.PLUGIN_ID, 0, ServerUIPlugin.getResource("%errorCouldNotCreateServerProject"), e);
- } finally {
- monitor.done();
- }
- }
-
- /**
- * Creates a new server project with the given name. If path is
- * null, it will be created in the default location.
- *
- * @param name java.lang.String
- * @param path org.eclipse.core.resource.IPath
- * @return org.eclipse.core.resources.IProject
- */
- public static IStatus createNewServerProject(final Shell shell, String name, IPath path, IProgressMonitor monitor) {
- final IStatus status = createServerProject(name, path, monitor);
- if (!status.isOK()) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- Shell shell2 = shell;
- if (shell == null)
- shell2 = getShell();
- openError(shell2, ServerUIPlugin.getResource("%errorCouldNotCreateServerProject"), status);
- }
- });
- }
- return status;
- }
-
- /**
- * Returns the image for a project.
- *
- * @param project org.eclipse.core.resources.IProject
- * @return org.eclipse.jface.resource.ImageDescriptor
- */
- public static ImageDescriptor getProjectImageDescriptor(IProject project) {
- if (project == null)
- return null;
-
- IWorkbenchAdapter adapter = (IWorkbenchAdapter) project.getAdapter(IWorkbenchAdapter.class);
-
- if (adapter != null)
- return adapter.getImageDescriptor(project);
-
- return null;
- }
-
- /**
- * Return a shell for the workbench.
- *
- * @return org.eclipse.swt.widgets.Shell
- */
- public static Shell getShell() {
- return getStandardDisplay().getActiveShell();
- }
-
- /**
- * Returns the standard display to be used. The method first checks, if
- * the thread calling this method has an associated display. If so, this
- * display is returned. Otherwise the method returns the default display.
- */
- public static Display getStandardDisplay() {
- Display display = Display.getCurrent();
- if (display == null)
- display = Display.getDefault();
-
- return display;
- }
-
- /**
- * Open a dialog window.
- *
- * @param message java.lang.String
- */
- public static void openError(final String message) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- Shell shell = getShell();
- MessageDialog.openError(shell, ServerUIPlugin.getResource("%errorDialogTitle"), message);
- }
- });
- }
-
- /**
- * Open a dialog window.
- *
- * @param message java.lang.String
- * @param status IStatus
- */
- public static void openError(final String message, final IStatus status) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- Shell shell = getShell();
- ErrorDialog.openError(shell, ServerUIPlugin.getResource("%errorDialogTitle"), message, status);
- }
- });
- }
-
- /**
- * Open a dialog window.
- *
- * @param shell the shell
- * @param message the message
- */
- public static void openError(Shell shell, String message) {
- MessageDialog.openError(shell, ServerUIPlugin.getResource("%errorDialogTitle"), message);
- }
-
- /**
- * Open a dialog window.
- *
- * @param message java.lang.String
- * @param status IStatus
- */
- public static void openError(Shell shell, String message, IStatus status) {
- ErrorDialog.openError(shell, ServerUIPlugin.getResource("%errorDialogTitle"), message, status);
- }
-
- /**
- * Start a server and display a dialog if it fails.
- */
- /*public static ILaunch startServer(final Shell shell, final IServer server, final String mode) throws CoreException {
- //, final ServerStartupListener listener) throws CoreException {
- // Eclipse v2 workaround to make sure that the debug UI listeners are setup
- DebugUIPlugin.getDefault();
-
- try {
- return server.start(mode, new NullProgressMonitor());
- } catch (final CoreException e) {
- Trace.trace(Trace.SEVERE, "Error starting server", e);
- Display.getDefault().syncExec(new Runnable() {
- public void run() {
- EclipseUtil.openError(shell, ServerUIPlugin.getResource("%serverStartError"), e.getStatus());
- listener.setEnabled(false);
- }
- });
- throw e;
- }
- }*/
-
- /**
- * Do a validateEdit() on the given server.
- */
- public static boolean validateEdit(Shell shell, IServer server) {
- IStatus status = server.validateEdit(shell);
- return validateEdit(shell, status);
- }
-
- protected static boolean validateEdit(Shell shell, IStatus status) {
- if (status != null && status.getSeverity() == IStatus.ERROR) {
- // inform user
- String message = ServerUIPlugin.getResource("%editorValidateEditFailureMessage");
- ErrorDialog.openError(shell, ServerUIPlugin.getResource("%errorDialogTitle"), message, status);
-
- // do not execute command
- 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/ImageResource.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ImageResource.java
deleted file mode 100644
index 3163c14..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ImageResource.java
+++ /dev/null
@@ -1,324 +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 java.net.URL;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-/**
- * Utility class to handle image resources.
- */
-public class ImageResource {
- // the image registry
- private static ImageRegistry imageRegistry;
-
- // map of image descriptors since these
- // will be lost by the image registry
- private static Map imageDescriptors;
-
- // base urls for images
- private static URL ICON_BASE_URL;
-
- static {
- try {
- String pathSuffix = "icons/";
- ICON_BASE_URL = ServerUIPlugin.getInstance().getBundle().getEntry(pathSuffix);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not set icon base URL", e);
- }
- }
-
- private static final String URL_CLCL = "clcl16/";
- private static final String URL_CTOOL = "ctool16/";
-
- private static final String URL_ELCL = "elcl16/";
- private static final String URL_ETOOL = "etool16/";
-
- private static final String URL_DLCL = "dlcl16/";
- private static final String URL_DTOOL = "dtool16/";
-
- private static final String URL_OBJ = "obj16/";
-
- private static final String URL_OVR = "ovr16/";
-
- private static final String URL_WIZBAN = "wizban/";
-
- // --- constants for images ---
-
- // Server State Images
- public static final String IMG_CLCL_START = "IMG_CLCL_START";
- public static final String IMG_CLCL_START_DEBUG = "IMG_CLCL_START_DEBUG";
- public static final String IMG_CLCL_START_PROFILE = "IMG_CLCL_START_PROFILE";
- public static final String IMG_CLCL_RESTART = "IMG_CLCL_RESTART";
- public static final String IMG_CLCL_STOP = "IMG_CLCL_STOP";
- public static final String IMG_CLCL_PUBLISH = "IMG_CLCL_PUBLISH";
- public static final String IMG_CLCL_DISCONNECT = "IMG_CLCL_DISCONNECT";
-
- public static final String IMG_ELCL_START = "IMG_ELCL_START";
- public static final String IMG_ELCL_START_DEBUG = "IMG_ELCL_START_DEBUG";
- public static final String IMG_ELCL_START_PROFILE = "IMG_ELCL_START_PROFILE";
- public static final String IMG_ELCL_RESTART = "IMG_ELCL_RESTART";
- public static final String IMG_ELCL_STOP = "IMG_ELCL_STOP";
- public static final String IMG_ELCL_PUBLISH = "IMG_ELCL_PUBLISH";
- public static final String IMG_ELCL_DISCONNECT = "IMG_ELCL_DISCONNECT";
-
- public static final String IMG_DLCL_START = "IMG_DLCL_START";
- public static final String IMG_DLCL_START_DEBUG = "IMG_DLCL_START_DEBUG";
- public static final String IMG_DLCL_START_PROFILE = "IMG_DLCL_START_PROFILE";
- public static final String IMG_DLCL_RESTART = "IMG_DLCL_RESTART";
- public static final String IMG_DLCL_STOP = "IMG_DLCL_STOP";
- public static final String IMG_DLCL_PUBLISH = "IMG_DLCL_PUBLISH";
- public static final String IMG_DLCL_DISCONNECT = "IMG_DLCL_DISCONNECT";
-
- // Wizard Banner Images
- public static final String IMG_WIZBAN_NEW_RUNTIME = "newServerWiz";
- public static final String IMG_WIZBAN_NEW_SERVER = "newServerWiz";
- public static final String IMG_WIZBAN_SELECT_SERVER_CLIENT = "wizClient";
- public static final String IMG_WIZBAN_SELECT_SERVER = "selectServer";
- public static final String IMG_WIZBAN_IMPORT_SERVER_CONFIGURATION = "importConfigWiz";
-
- public static final String IMG_SERVER_STATE_STARTED = "stateStarted";
- public static final String IMG_SERVER_STATE_STARTED_DEBUG = "stateStartedDebug";
- public static final String IMG_SERVER_STATE_STARTED_PROFILE = "stateStartedProfile";
- public static final String IMG_SERVER_STATE_STOPPED = "stateStopped";
-
- public static final String IMG_SERVER_STATE_STARTING_1 = "stateStarting1";
- public static final String IMG_SERVER_STATE_STARTING_2 = "stateStarting2";
- public static final String IMG_SERVER_STATE_STARTING_3 = "stateStarting3";
-
- public static final String IMG_SERVER_STATE_STOPPING_1 = "stateStopping1";
- public static final String IMG_SERVER_STATE_STOPPING_2 = "stateStopping2";
- public static final String IMG_SERVER_STATE_STOPPING_3 = "stateStopping3";
-
- // Server Client Images
- public static final String IMG_CTOOL_RUN_ON_SERVER = "IMG_CTOOL_CLIENT";
- public static final String IMG_CTOOL_DEBUG_ON_SERVER = "IMG_CTOOL_CLIENT2";
- public static final String IMG_CTOOL_PROFILE_ON_SERVER = "IMG_CTOOL_CLIENT3";
- public static final String IMG_CTOOL_NEW_SERVER = "IMG_CTOOL_NEW_SERVER";
- public static final String IMG_CTOOL_NEW_SERVER_INSTANCE = "IMG_CTOOL_NEW_SERVER_INSTANCE";
- public static final String IMG_CTOOL_MODIFY_MODULES = "IMG_CTOOL_MODIFY_MODULES";
-
- public static final String IMG_ETOOL_RUN_ON_SERVER = "IMG_ETOOL_CLIENT";
- public static final String IMG_ETOOL_DEBUG_ON_SERVER = "IMG_ETOOL_CLIENT2";
- public static final String IMG_ETOOL_PROFILE_ON_SERVER = "IMG_ETOOL_CLIENT3";
- public static final String IMG_ETOOL_MODIFY_MODULES = "IMG_ETOOL_MODIFY_MODULES";
-
- public static final String IMG_DTOOL_RUN_ON_SERVER = "IMG_DTOOL_CLIENT";
- public static final String IMG_DTOOL_DEBUG_ON_SERVER = "IMG_DTOOL_CLIENT2";
- public static final String IMG_DTOOL_PROFILE_ON_SERVER = "IMG_DTOOL_CLIENT3";
- public static final String IMG_DTOOL_MODIFY_MODULES = "IMG_DTOOL_MODIFY_MODULES";
-
- // General Object Images
- public static final String IMG_SERVER = "server";
- public static final String IMG_SERVER_CONFIGURATION_NONE = "noConfiguration";
- public static final String IMG_SERVER_CONFIGURATION_MISSING = "configurationMissing";
- public static final String IMG_PROJECT_MISSING = "projectMissing";
- public static final String IMG_REPAIR_CONFIGURATION = "repairConfiguration";
-
- public static final String IMG_PUBLISH_ENABLED = "publishEnabled";
- public static final String IMG_PUBLISH_DISABLED = "publishDisabled";
-
- public static final String IMG_MONITOR_ON = "monitorOn";
- public static final String IMG_MONITOR_OFF = "monitorOff";
-
- public static final String IMG_DEFAULT_SERVER_OVERLAY = "defaultServerOverlay";
-
- /**
- * Cannot construct an ImageResource. Use static methods only.
- */
- private ImageResource() {
- // do nothing
- }
-
- /**
- * Dispose of element images that were created.
- */
- protected static void dispose() {
- // do nothing
- }
-
- /**
- * Return the image with the given key.
- *
- * @param key java.lang.String
- * @return org.eclipse.swt.graphics.Image
- */
- public static Image getImage(String key) {
- if (imageRegistry == null)
- initializeImageRegistry();
- Image image = imageRegistry.get(key);
- if (image == null) {
- imageRegistry.put(key, ImageDescriptor.getMissingImageDescriptor());
- image = imageRegistry.get(key);
- }
- return image;
- }
-
- /**
- * Return the image descriptor with the given key.
- *
- * @param key java.lang.String
- * @return org.eclipse.jface.resource.ImageDescriptor
- */
- public static ImageDescriptor getImageDescriptor(String key) {
- if (imageRegistry == null)
- initializeImageRegistry();
- ImageDescriptor id = (ImageDescriptor) imageDescriptors.get(key);
- if (id != null)
- return id;
-
- return ImageDescriptor.getMissingImageDescriptor();
- }
-
- /**
- * Initialize the image resources.
- */
- protected static void initializeImageRegistry() {
- imageRegistry = new ImageRegistry();
- imageDescriptors = new HashMap();
-
- // wizard banners
- registerImage(IMG_WIZBAN_NEW_SERVER, URL_WIZBAN + "new_server_wiz.gif");
- registerImage(IMG_WIZBAN_IMPORT_SERVER_CONFIGURATION, URL_WIZBAN + "import_configuration_wiz.gif");
- registerImage(IMG_WIZBAN_SELECT_SERVER_CLIENT, URL_WIZBAN + "select_client_wiz.gif");
- registerImage(IMG_WIZBAN_SELECT_SERVER, URL_WIZBAN + "select_server_wiz.gif");
-
- // client images
- registerImage(IMG_ETOOL_RUN_ON_SERVER, URL_ETOOL + "run_on_server.gif");
- registerImage(IMG_ETOOL_DEBUG_ON_SERVER, URL_ETOOL + "debug_on_server.gif");
- registerImage(IMG_ETOOL_PROFILE_ON_SERVER, URL_ETOOL + "profile_on_server.gif");
- registerImage(IMG_ETOOL_MODIFY_MODULES, URL_ETOOL + "wiz_modify_modules.gif");
-
- registerImage(IMG_CTOOL_RUN_ON_SERVER, URL_CTOOL + "run_on_server.gif");
- registerImage(IMG_CTOOL_DEBUG_ON_SERVER, URL_CTOOL + "debug_on_server.gif");
- registerImage(IMG_CTOOL_PROFILE_ON_SERVER, URL_CTOOL + "profile_on_server.gif");
- registerImage(IMG_CTOOL_NEW_SERVER, URL_CTOOL + "wiz_new_server.gif");
- registerImage(IMG_CTOOL_NEW_SERVER_INSTANCE, URL_CTOOL + "wiz_new_instance.gif");
- registerImage(IMG_CTOOL_MODIFY_MODULES, URL_CTOOL + "wiz_modify_modules.gif");
-
- registerImage(IMG_DTOOL_RUN_ON_SERVER, URL_DTOOL + "run_on_server.gif");
- registerImage(IMG_DTOOL_DEBUG_ON_SERVER, URL_DTOOL + "debug_on_server.gif");
- registerImage(IMG_DTOOL_PROFILE_ON_SERVER, URL_DTOOL + "profile_on_server.gif");
- registerImage(IMG_DTOOL_MODIFY_MODULES, URL_DTOOL + "wiz_modify_modules.gif");
-
- // load server state images
- registerImage(IMG_SERVER_STATE_STARTED, URL_OBJ + "server_started.gif");
- registerImage(IMG_SERVER_STATE_STARTED_DEBUG, URL_OBJ + "server_started_debug.gif");
- registerImage(IMG_SERVER_STATE_STARTED_PROFILE, URL_OBJ + "server_started_profile.gif");
- registerImage(IMG_SERVER_STATE_STOPPED, URL_OBJ + "server_stopped.gif");
-
- registerImage(IMG_SERVER_STATE_STARTING_1, URL_OBJ + "server_starting1.gif");
- registerImage(IMG_SERVER_STATE_STARTING_2, URL_OBJ + "server_starting2.gif");
- registerImage(IMG_SERVER_STATE_STARTING_3, URL_OBJ + "server_starting3.gif");
-
- registerImage(IMG_SERVER_STATE_STOPPING_1, URL_OBJ + "server_stopping1.gif");
- registerImage(IMG_SERVER_STATE_STOPPING_2, URL_OBJ + "server_stopping2.gif");
- registerImage(IMG_SERVER_STATE_STOPPING_3, URL_OBJ + "server_stopping3.gif");
-
- // load action images
- registerImage(IMG_ELCL_PUBLISH, URL_ELCL + "launch_publish.gif");
- registerImage(IMG_ELCL_START, URL_ELCL + "launch_run.gif");
- registerImage(IMG_ELCL_START_DEBUG, URL_ELCL + "launch_debug.gif");
- registerImage(IMG_ELCL_START_PROFILE, URL_ELCL + "launch_profile.gif");
- registerImage(IMG_ELCL_RESTART, URL_ELCL + "launch_restart.gif");
- registerImage(IMG_ELCL_STOP, URL_ELCL + "launch_stop.gif");
- registerImage(IMG_ELCL_DISCONNECT, URL_ELCL + "launch_disconnect.gif");
-
- registerImage(IMG_CLCL_PUBLISH, URL_CLCL + "launch_publish.gif");
- registerImage(IMG_CLCL_START, URL_CLCL + "launch_run.gif");
- registerImage(IMG_CLCL_START_DEBUG, URL_CLCL + "launch_debug.gif");
- registerImage(IMG_CLCL_START_PROFILE, URL_CLCL + "launch_profile.gif");
- registerImage(IMG_CLCL_RESTART, URL_CLCL + "launch_restart.gif");
- registerImage(IMG_CLCL_STOP, URL_CLCL + "launch_stop.gif");
- registerImage(IMG_CLCL_DISCONNECT, URL_CLCL + "launch_disconnect.gif");
-
- registerImage(IMG_DLCL_PUBLISH, URL_DLCL + "launch_publish.gif");
- registerImage(IMG_DLCL_START, URL_DLCL + "launch_run.gif");
- registerImage(IMG_DLCL_START_DEBUG, URL_DLCL + "launch_debug.gif");
- registerImage(IMG_DLCL_START_PROFILE, URL_DLCL + "launch_profile.gif");
- registerImage(IMG_DLCL_RESTART, URL_DLCL + "launch_restart.gif");
- registerImage(IMG_DLCL_STOP, URL_DLCL + "launch_stop.gif");
- registerImage(IMG_DLCL_DISCONNECT, URL_DLCL + "launch_disconnect.gif");
-
- // load general object images
- registerImage(IMG_SERVER, URL_OBJ + "server.gif");
- registerImage(IMG_SERVER_CONFIGURATION_NONE, URL_OBJ + "configuration_none.gif");
- registerImage(IMG_SERVER_CONFIGURATION_MISSING, URL_OBJ + "configuration_missing.gif");
- registerImage(IMG_PROJECT_MISSING, URL_OBJ + "project_missing.gif");
- registerImage(IMG_REPAIR_CONFIGURATION, URL_OBJ + "repair_config.gif");
-
- registerImage(IMG_PUBLISH_ENABLED, URL_OBJ + "publish_enabled.gif");
- registerImage(IMG_PUBLISH_DISABLED, URL_OBJ + "publish_disabled.gif");
-
- registerImage(IMG_MONITOR_ON, URL_OBJ + "monitorOn.gif");
- registerImage(IMG_MONITOR_OFF, URL_OBJ + "monitorOff.gif");
-
- registerImage(IMG_DEFAULT_SERVER_OVERLAY, URL_OVR + "default_server_ovr.gif");
-
- loadServerImages();
- }
-
- /**
- * Register an image with the registry.
- *
- * @param key java.lang.String
- * @param partialURL java.lang.String
- */
- private static void registerImage(String key, String partialURL) {
- try {
- ImageDescriptor id = ImageDescriptor.createFromURL(new URL(ICON_BASE_URL, partialURL));
- imageRegistry.put(key, id);
- imageDescriptors.put(key, id);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error registering image " + key + " from " + partialURL, e);
- }
- }
-
- /**
- * Load the server images.
- */
- private static void loadServerImages() {
- Trace.trace(Trace.CONFIG, "->- Loading .serverImages extension point ->-");
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IConfigurationElement[] cf = registry.getConfigurationElementsFor(ServerUIPlugin.PLUGIN_ID, "serverImages");
-
- int size = cf.length;
- for (int i = 0; i < size; i++) {
- try {
- String pluginId = cf[i].getDeclaringExtension().getNamespace();
- String iconPath = cf[i].getAttribute("icon");
- ImageDescriptor imageDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin(pluginId, iconPath);
- if (imageDescriptor == null)
- ImageDescriptor.getMissingImageDescriptor();
-
- String typeId = cf[i].getAttribute("typeIds");
- if (typeId == null)
- typeId = cf[i].getAttribute("moduleId");
- imageRegistry.put(typeId, imageDescriptor);
- imageDescriptors.put(typeId, imageDescriptor);
- Trace.trace(Trace.CONFIG, " Loaded serverImage: " + cf[i].getAttribute("id"));
- } catch (Throwable t) {
- Trace.trace(Trace.SEVERE, " Could not load serverImage: " + cf[i].getAttribute("id"), t);
- }
- }
-
- Trace.trace(Trace.CONFIG, "-<- Done loading .serverImages extension point -<-");
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/LaunchClientJob.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/LaunchClientJob.java
deleted file mode 100644
index 00125ba..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/LaunchClientJob.java
+++ /dev/null
@@ -1,95 +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;
-
-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.swt.widgets.Display;
-import org.eclipse.wst.server.core.*;
-import org.eclipse.wst.server.core.internal.*;
-/**
- *
- */
-public class LaunchClientJob extends Job {
- protected IServer server;
- protected IModule module;
- protected IClient client;
- protected ILaunchableAdapter launchableAdapter;
- protected String launchMode;
- protected IModuleArtifact moduleArtifact;
-
- public static void launchClient(IServer server, IModule module, String launchMode, IModuleArtifact moduleArtifact, ILaunchableAdapter launchableAdapter, IClient client) {
- LaunchClientJob job = new LaunchClientJob(server, module, launchMode, moduleArtifact, launchableAdapter, client);
- //job.setUser(true);
- job.schedule();
- }
-
- public LaunchClientJob(IServer server, IModule module, String launchMode, IModuleArtifact moduleArtifact, ILaunchableAdapter launchableAdapter, IClient client) {
- super("Launch client");
- this.server = server;
- this.module = module;
- this.launchMode = launchMode;
- this.moduleArtifact = moduleArtifact;
- this.launchableAdapter = launchableAdapter;
- this.client = client;
- setRule(new ServerSchedulingRule(server));
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.internal.jobs.InternalJob#run(org.eclipse.core.runtime.IProgressMonitor)
- */
- protected IStatus run(IProgressMonitor monitor) {
- Trace.trace(Trace.FINER, "LaunchClient job");
- IStatus status = new Status(IStatus.OK, ServerUIPlugin.PLUGIN_ID, 0, "", null);
-
- // wait for up to 5 minutes
- int state = server.getModuleState(module);
- int count = ServerPreferences.getInstance().getModuleStartTimeout();
- while (state == IServer.STATE_STARTING && count > 0) {
- if (monitor.isCanceled())
- return status;
- try {
- Thread.sleep(2000);
- } catch (Exception e) {
- // ignore
- }
- count -= 2000;
- state = server.getModuleState(module);
- }
-
- Trace.trace(Trace.FINER, "LaunchClient job 2 " + state);
-
- if (monitor.isCanceled())
- return status;
-
- if (state == IServer.STATE_STARTING)
- return status;
-
- Trace.trace(Trace.FINER, "LaunchClient job 3");
-
- // display client on UI thread
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- Trace.trace(Trace.FINEST, "Attempting to load client: " + client);
- try {
- ILaunchable launchable = launchableAdapter.getLaunchable(server, moduleArtifact);
- client.launch(server, launchable, launchMode, ((Server) server).getExistingLaunch());
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Server client failed", e);
- }
- }
- });
- Trace.trace(Trace.FINER, "LaunchClient job 4");
- return status;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/OverlayImageDescriptor.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/OverlayImageDescriptor.java
deleted file mode 100644
index fa265e0..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/OverlayImageDescriptor.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;
-
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.resource.CompositeImageDescriptor;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.ImageData;
-import org.eclipse.swt.graphics.Point;
-/**
- * A OverlayImageDescriptor consists of a main icon and one or more overlays.
- * The overlays are computed according to flags set on creation of the descriptor.
- */
-public class OverlayImageDescriptor extends CompositeImageDescriptor {
- // flag to render the error overlay
- public final static int ERROR = 0x001;
-
- private Image fBaseImage;
- private int fFlags;
- private Point fSize;
-
- /**
- * Create a new OverlayImageDescriptor.
- *
- * @param baseImage an image descriptor used as the base image
- * @param flags flags indicating which adornments are to be rendered
- */
- public OverlayImageDescriptor(Image baseImage, int flags) {
- setBaseImage(baseImage);
- setFlags(flags);
- }
-
- /**
- * @see CompositeImageDescriptor#getSize()
- */
- protected Point getSize() {
- if (fSize == null) {
- ImageData data = getBaseImage().getImageData();
- setSize(new Point(data.width, data.height));
- }
- return fSize;
- }
-
- /**
- * @see Object#equals(java.lang.Object)
- */
- public boolean equals(Object object) {
- if (!(object instanceof OverlayImageDescriptor))
- return false;
-
- OverlayImageDescriptor other = (OverlayImageDescriptor) object;
- return (getBaseImage().equals(other.getBaseImage()) && getFlags() == other.getFlags());
- }
-
- /**
- * @see Object#hashCode()
- */
- public int hashCode() {
- return getBaseImage().hashCode() | getFlags();
- }
-
- /**
- * @see CompositeImageDescriptor#drawCompositeImage(int, int)
- */
- protected void drawCompositeImage(int width, int height) {
- ImageData bg = getBaseImage().getImageData();
- if (bg == null)
- bg = DEFAULT_IMAGE_DATA;
-
- drawImage(bg, 0, 0);
- drawOverlays();
- }
-
- /**
- * Add any overlays to the image as specified in the flags.
- */
- protected void drawOverlays() {
- int flags = getFlags();
- ImageData data = null;
- if ((flags & ERROR) != 0) {
- data = DebugUITools.getImage(IDebugUIConstants.IMG_OVR_ERROR).getImageData();
- int x = getSize().x - data.width;
- drawImage(data, x, 0);
- }
- }
-
- protected Image getBaseImage() {
- return fBaseImage;
- }
-
- protected void setBaseImage(Image baseImage) {
- fBaseImage = baseImage;
- }
-
- protected int getFlags() {
- return fFlags;
- }
-
- protected void setFlags(int flags) {
- fFlags = flags;
- }
-
- protected void setSize(Point size) {
- fSize = size;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ProgressUtil.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ProgressUtil.java
deleted file mode 100644
index f09667a..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ProgressUtil.java
+++ /dev/null
@@ -1,68 +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.runtime.*;
-/**
- * Progress Monitor utility.
- */
-public class ProgressUtil {
- /**
- * ProgressUtil constructor comment.
- */
- private ProgressUtil() {
- super();
- }
-
- /**
- * Return a valid progress monitor.
- *
- * @param monitor org.eclipse.core.runtime.IProgressMonitor
- * @return org.eclipse.core.runtime.IProgressMonitor
- */
- public static IProgressMonitor getMonitorFor(IProgressMonitor monitor) {
- if (monitor == null)
- return new NullProgressMonitor();
- return monitor;
- }
-
- /**
- * Return a sub-progress monitor with the given amount on the
- * current progress monitor.
- *
- * @param monitor org.eclipse.core.runtime.IProgressMonitor
- * @param ticks int
- * @return org.eclipse.core.runtime.IProgressMonitor
- */
- public static IProgressMonitor getSubMonitorFor(IProgressMonitor monitor, int ticks) {
- if (monitor == null)
- return new NullProgressMonitor();
- if (monitor instanceof NullProgressMonitor)
- return monitor;
- return new SubProgressMonitor(monitor, ticks);
- }
-
- /**
- * Return a sub-progress monitor with the given amount on the
- * current progress monitor.
- *
- * @param monitor org.eclipse.core.runtime.IProgressMonitor
- * @param ticks int
- * @return org.eclipse.core.runtime.IProgressMonitor
- */
- public static IProgressMonitor getSubMonitorFor(IProgressMonitor monitor, int ticks, int style) {
- if (monitor == null)
- return new NullProgressMonitor();
- if (monitor instanceof NullProgressMonitor)
- return monitor;
- return new SubProgressMonitor(monitor, ticks, style);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ProjectPropertyPage.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ProjectPropertyPage.java
deleted file mode 100644
index 466856c..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ProjectPropertyPage.java
+++ /dev/null
@@ -1,214 +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 java.util.ArrayList;
-import java.util.List;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.wst.server.core.*;
-import org.eclipse.wst.server.ui.ServerUICore;
-import org.eclipse.swt.SWT;
-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.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.ui.dialogs.PropertyPage;
-/**
- * PropertyPage for IProjects. It shows the server and runtime preference for the project.
- */
-public class ProjectPropertyPage extends PropertyPage {
- protected IProject project;
- protected IModule module;
- protected IServer server;
-
- protected RuntimeTargetComposite rtComp;
-
- /**
- * ProjectPropertyPage constructor comment.
- */
- public ProjectPropertyPage() {
- super();
- }
-
- /**
- * Create the body of the page.
- *
- * @param parent org.eclipse.swt.widgets.Composite
- * @return org.eclipse.swt.widgets.Control
- */
- protected Control createContents(Composite parent) {
- try {
- IAdaptable element = getElement();
- if (element instanceof IProject)
- project = (IProject) element;
-
- Composite composite = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- layout.numColumns = 3;
- layout.verticalSpacing = 10;
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- Label label = new Label(composite, SWT.WRAP);
- label.setText(ServerUIPlugin.getResource("%prefProjectDescription"));
- GridData data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 3;
- data.widthHint = 200;
- label.setLayoutData(data);
-
- IModule[] modules = ServerUtil.getModules(project);
- if (modules != null && modules.length > 0)
- module = modules[0];
-
- if (module == null) {
- label = new Label(composite, SWT.NONE);
- label.setText(ServerUIPlugin.getResource("%prefProjectNotModule"));
- data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- data.horizontalSpan = 3;
- label.setLayoutData(data);
- } else {
- IModuleType mt = module.getModuleType();
- if (mt != null) {
- label = new Label(composite, SWT.NONE);
- label.setText(ServerUIPlugin.getResource("%prefProject"));
- data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- label.setLayoutData(data);
-
- Label moduleKind = new Label(composite, SWT.NONE);
- data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- data.horizontalSpan = 2;
- moduleKind.setLayoutData(data);
- moduleKind.setText(module.getName() + " (" + mt.getName() + ")");
- }
-
- rtComp = new RuntimeTargetComposite(composite, project);
-
- IProjectProperties prefs = ServerCore.getProjectProperties(project);
- IServer prefServer = prefs.getDefaultServer();
-
- label = new Label(composite, SWT.NONE);
- label.setText(ServerUIPlugin.getResource("%prefProjectDefaultServer"));
- data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_BEGINNING);
- label.setLayoutData(data);
-
- final IServer[] servers = getServersBySupportedModule(module);
- if (servers == null || servers.length == 0) {
- label = new Label(composite, SWT.WRAP);
- label.setText(ServerUIPlugin.getResource("%prefProjectNotConfigured"));
- data = new GridData();
- data.horizontalSpan = 2;
- label.setLayoutData(data);
- } else {
- final Table table = new Table(composite, SWT.BORDER | SWT.SINGLE | SWT.V_SCROLL);
- data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 2;
- data.heightHint = 70;
- table.setLayoutData(data);
-
- // add none option
- TableItem item = new TableItem(table, SWT.NONE);
- item.setText(ServerUIPlugin.getResource("%prefProjectNoServer"));
- //item.setImage();
-
- int size2 = servers.length;
- int count = 0;
- for (int j = 0; j < size2; j++) {
- item = new TableItem(table, SWT.NONE);
- item.setText(ServerUICore.getLabelProvider().getText(servers[j]));
- item.setImage(ServerUICore.getLabelProvider().getImage(servers[j]));
- item.setData(servers[j]);
- if (servers[j].equals(prefServer))
- count = j + 1;
- }
-
- table.setSelection(count);
-
- table.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent event) {
- int index = table.getSelectionIndex();
- if (index == 0) {
- server = null;
- } else if (index > 0) {
- server = servers[index-1];
- }
- }
- });
- }
- }
-
- Dialog.applyDialogFont(composite);
-
- return composite;
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error creating project property page", e);
- return null;
- }
- }
-
- /**
- * Returns a list of all servers that this module is configured on.
- *
- * @param module org.eclipse.wst.server.core.IModule
- * @return java.util.List
- */
- protected static IServer[] getServersBySupportedModule(IModule module) {
- if (module == null)
- return new IServer[0];
-
- // do it the slow way - go through all servers and
- // see if this module is configured in it
- List list = new ArrayList();
- IServer[] servers = ServerCore.getServers();
- if (servers != null) {
- int size = servers.length;
- for (int i = 0; i < size; i++) {
- if (ServerUtil.isSupportedModule(servers[i].getServerType().getRuntimeType().getModuleTypes(), module.getModuleType()))
- list.add(servers[i]);
- }
- }
-
- IServer[] allServers = new IServer[list.size()];
- list.toArray(allServers);
- return allServers;
- }
-
- /**
- * Method declared on IPreferencePage.
- * Subclasses should override
- */
- public boolean performOk() {
- if (module != null) {
- try {
- if (rtComp.hasChanged())
- rtComp.apply(new NullProgressMonitor());
-
- IProjectProperties props = ServerCore.getProjectProperties(project);
- props.setDefaultServer(server, null);
- } catch (CoreException e) {
- Trace.trace(Trace.SEVERE, "Error setting preferred server", e);
- EclipseUtil.openError(ServerUIPlugin.getResource("%errorCouldNotSavePreference"), e.getStatus());
- return false;
- }
- }
- return super.performOk();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/RestartServerJob.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/RestartServerJob.java
deleted file mode 100644
index c04def5..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/RestartServerJob.java
+++ /dev/null
@@ -1,49 +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;
-
-import org.eclipse.core.runtime.*;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.internal.ServerSchedulingRule;
-/**
- *
- */
-public class RestartServerJob extends Job {
- protected IServer server;
- protected String launchMode;
-
- public static void restartServer(IServer server, String launchMode) {
- RestartServerJob job = new RestartServerJob(server, launchMode);
- job.setUser(true);
- job.schedule();
- }
-
- public RestartServerJob(IServer server, String launchMode) {
- super("Restart server");
- this.server = server;
- this.launchMode = launchMode;
- setRule(new ServerSchedulingRule(server));
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.internal.jobs.InternalJob#run(org.eclipse.core.runtime.IProgressMonitor)
- */
- protected IStatus run(IProgressMonitor monitor) {
- IStatus status = new Status(IStatus.OK, ServerUIPlugin.PLUGIN_ID, 0, "", null);
- try {
- server.synchronousRestart(launchMode, monitor);
- } catch (CoreException ce) {
- return ce.getStatus();
- }
- return status;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/RuntimePreferencePage.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/RuntimePreferencePage.java
deleted file mode 100644
index 23f6c82..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/RuntimePreferencePage.java
+++ /dev/null
@@ -1,399 +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 java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.dialogs.ProgressMonitorDialog;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-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.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.DirectoryDialog;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.server.core.*;
-import org.eclipse.wst.server.core.internal.IRuntimeLocator;
-import org.eclipse.wst.server.core.internal.ServerPlugin;
-import org.eclipse.wst.server.ui.internal.task.FinishWizardFragment;
-import org.eclipse.wst.server.ui.internal.task.SaveRuntimeTask;
-import org.eclipse.wst.server.ui.internal.viewers.RuntimeComposite;
-import org.eclipse.wst.server.ui.internal.wizard.ClosableWizardDialog;
-import org.eclipse.wst.server.ui.internal.wizard.fragment.NewRuntimeWizardFragment;
-import org.eclipse.wst.server.ui.wizard.WizardFragment;
-import org.eclipse.wst.server.ui.wizard.TaskWizard;
-/**
- * The preference page that holds server runtimes.
- */
-public class RuntimePreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
- protected Button edit;
- protected Button remove;
- protected Label pathLabel;
-
- /**
- * RuntimePreferencesPage constructor comment.
- */
- public RuntimePreferencePage() {
- super();
- noDefaultAndApplyButton();
- }
-
- /**
- * Create the preference options.
- *
- * @param parent org.eclipse.swt.widgets.Composite
- * @return org.eclipse.swt.widgets.Control
- */
- protected Control createContents(Composite parent) {
- initializeDialogUnits(parent);
-
- Composite composite = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.horizontalSpacing = convertHorizontalDLUsToPixels(4);
- layout.verticalSpacing = convertVerticalDLUsToPixels(3);
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- layout.numColumns = 2;
- composite.setLayout(layout);
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL);
- composite.setLayoutData(data);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, ContextIds.PREF_GENERAL);
-
- Label label = new Label(composite, SWT.WRAP);
- data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- data.horizontalSpan = 2;
- label.setLayoutData(data);
- label.setText(ServerUIPlugin.getResource("%preferenceRuntimesDescription"));
-
- label = new Label(composite, SWT.WRAP);
- data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- data.horizontalSpan = 2;
- label.setLayoutData(data);
- label.setText(ServerUIPlugin.getResource("%preferenceRuntimesTable"));
-
- final RuntimeComposite runtimeComp = new RuntimeComposite(composite, SWT.NONE, new RuntimeComposite.RuntimeSelectionListener() {
- public void runtimeSelected(IRuntime runtime) {
- if (runtime == null) {
- edit.setEnabled(false);
- remove.setEnabled(false);
- pathLabel.setText("");
- } else if (runtime.isReadOnly()) {
- edit.setEnabled(false);
- remove.setEnabled(false);
- pathLabel.setText(runtime.getLocation() + "");
- } else {
- edit.setEnabled(true);
- remove.setEnabled(true);
- pathLabel.setText(runtime.getLocation() + "");
- }
- }
- });
- runtimeComp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL));
-
- Composite buttonComp = new Composite(composite, SWT.NONE);
- layout = new GridLayout();
- layout.horizontalSpacing = 0;
- layout.verticalSpacing = convertVerticalDLUsToPixels(3);
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- layout.numColumns = 1;
- buttonComp.setLayout(layout);
- data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL);
- buttonComp.setLayoutData(data);
-
- Button add = SWTUtil.createButton(buttonComp, ServerUIPlugin.getResource("%add"));
- add.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- if (showWizard(null) == Window.CANCEL)
- return;
- runtimeComp.refresh();
- }
- });
-
- edit = SWTUtil.createButton(buttonComp, ServerUIPlugin.getResource("%edit"));
- edit.setEnabled(false);
- edit.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- IRuntime runtime = runtimeComp.getSelectedRuntime();
- if (runtime != null) {
- IRuntimeWorkingCopy runtimeWorkingCopy = runtime.createWorkingCopy();
- if (showWizard(runtimeWorkingCopy) != Window.CANCEL) {
- try {
- runtimeWorkingCopy.save(false, new NullProgressMonitor());
- runtimeComp.refresh(runtime);
- } catch (Exception ex) {
- // ignore
- }
- }
- }
- }
- });
-
- remove = SWTUtil.createButton(buttonComp, ServerUIPlugin.getResource("%remove"));
- remove.setEnabled(false);
- remove.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- IRuntime runtime = runtimeComp.getSelectedRuntime();
- if (shouldRemoveRuntime(runtime))
- try {
- runtime.delete();
- runtimeComp.remove(runtime);
- } catch (Exception ex) {
- // ignore
- }
- }
- });
-
- Button search = SWTUtil.createButton(buttonComp, ServerUIPlugin.getResource("%search"));
- data = (GridData) search.getLayoutData();
- data.verticalIndent = 9;
- search.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- try {
- // select a target directory for the search
- DirectoryDialog directoryDialog = new DirectoryDialog(getShell());
- directoryDialog.setMessage(ServerUIPlugin.getResource("%dialogRuntimeSearchMessage"));
- directoryDialog.setText(ServerUIPlugin.getResource("%dialogRuntimeSearchTitle"));
-
- String pathStr = directoryDialog.open();
- if (pathStr == null)
- return;
-
- final IPath path = new Path(pathStr);
-
- final ProgressMonitorDialog dialog = new ProgressMonitorDialog(getShell());
- dialog.setBlockOnOpen(false);
- dialog.setCancelable(true);
- dialog.open();
- final IProgressMonitor monitor = dialog.getProgressMonitor();
- final IRuntimeLocator[] locators = ServerPlugin.getRuntimeLocators();
- monitor.beginTask(ServerUIPlugin.getResource("%dialogRuntimeSearchProgress"), 100 * locators.length + 10);
- final List list = new ArrayList();
-
- final IRuntimeLocator.IRuntimeSearchListener listener = new IRuntimeLocator.IRuntimeSearchListener() {
- public void runtimeFound(final IRuntimeWorkingCopy runtime) {
- dialog.getShell().getDisplay().syncExec(new Runnable() {
- public void run() {
- monitor.subTask(runtime.getName());
- }
- });
- list.add(runtime);
- }
- };
-
- IRunnableWithProgress runnable = new IRunnableWithProgress() {
- public void run(IProgressMonitor monitor2) {
- if (locators != null) {
- int size = locators.length;
- for (int i = 0; i < size; i++) {
- if (!monitor2.isCanceled())
- try {
- locators[i].searchForRuntimes(path, listener, monitor2);
- } catch (CoreException ce) {
- Trace.trace(Trace.WARNING, "Error locating runtimes: " + locators[i].getId(), ce);
- }
- }
- }
- Trace.trace(Trace.INFO, "Done search");
- }
- };
- dialog.run(true, true, runnable);
-
- Trace.trace(Trace.FINER, "Found runtimes: " + list.size());
-
- if (!monitor.isCanceled()) {
- if (list.isEmpty()) {
- EclipseUtil.openError(getShell(), ServerUIPlugin.getResource("%infoNoRuntimesFound"));
- return;
- }
- monitor.worked(5);
- // remove duplicates from list (based on location)
- Trace.trace(Trace.FINER, "Removing duplicates");
- List good = new ArrayList();
- Iterator iterator2 = list.iterator();
- while (iterator2.hasNext()) {
- boolean dup = false;
- IRuntime wc = (IRuntime) iterator2.next();
-
- IRuntime[] runtimes = ServerCore.getRuntimes();
- if (runtimes != null) {
- int size = runtimes.length;
- for (int i = 0; i < size; i++) {
- if (runtimes[i].getLocation().equals(wc.getLocation()))
- dup = true;
- }
- }
- if (!dup)
- good.add(wc);
- }
- monitor.worked(5);
-
- // add to list
- Trace.trace(Trace.FINER, "Adding runtimes: " + good.size());
- Iterator iterator = good.iterator();
- while (iterator.hasNext()) {
- IRuntimeWorkingCopy wc = (IRuntimeWorkingCopy) iterator.next();
- wc.save(false, monitor);
- }
- monitor.done();
- }
- dialog.close();
- } catch (Exception ex) {
- Trace.trace(Trace.SEVERE, "Error finding runtimes", ex);
- }
- runtimeComp.refresh();
- }
- });
-
- pathLabel = new Label(parent, SWT.NONE);
- pathLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- Dialog.applyDialogFont(composite);
-
- return composite;
- }
-
- protected boolean shouldRemoveRuntime(IRuntime runtime) {
- if (runtime == null)
- return false;
-
- // check for use
- boolean inUse = false;
-
- IServer[] servers = ServerCore.getServers();
- if (servers != null) {
- int size = servers.length;
- for (int i = 0; i < size; i++) {
- if (runtime.equals(servers[i].getRuntime()))
- inUse = true;
- }
- }
-
- IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
- if (projects != null) {
- int size = projects.length;
- for (int i = 0; i < size; i++) {
- IProjectProperties props = ServerCore.getProjectProperties(projects[i]);
- if (runtime.equals(props.getRuntimeTarget()))
- inUse = true;
- }
- }
-
- if (inUse) {
- if (!MessageDialog.openConfirm(getShell(), ServerUIPlugin.getResource("%defaultDialogTitle"), ServerUIPlugin.getResource("%dialogRuntimeInUse")))
- return false;
- }
-
- return true;
- }
-
- protected int showWizard(final IRuntimeWorkingCopy runtimeWorkingCopy) {
- String title = null;
- WizardFragment fragment = null;
- if (runtimeWorkingCopy == null) {
- title = ServerUIPlugin.getResource("%wizNewRuntimeWizardTitle");
- fragment = new WizardFragment() {
- protected void createChildFragments(List list) {
- list.add(new NewRuntimeWizardFragment());
- list.add(new FinishWizardFragment(new SaveRuntimeTask()));
- }
- };
- } else {
- title = ServerUIPlugin.getResource("%wizEditRuntimeWizardTitle");
- final WizardFragment fragment2 = ServerUIPlugin.getWizardFragment(runtimeWorkingCopy.getRuntimeType().getId());
- if (fragment2 == null) {
- edit.setEnabled(false);
- return Window.CANCEL;
- }
- fragment = new WizardFragment() {
- protected void createChildFragments(List list) {
- list.add(new WizardFragment() {
- public void enter() {
- getTaskModel().putObject(TaskModel.TASK_RUNTIME, runtimeWorkingCopy);
- }
- });
- list.add(fragment2);
- list.add(new FinishWizardFragment(new SaveRuntimeTask()));
- }
- };
- }
- TaskWizard wizard = new TaskWizard(title, fragment);
- wizard.setForcePreviousAndNextButtons(true);
- ClosableWizardDialog dialog = new ClosableWizardDialog(getShell(), wizard);
- return dialog.open();
- }
-
- protected IRuntime getSelection(ISelection sel2) {
- IStructuredSelection sel = (IStructuredSelection) sel2;
- return (IRuntime) sel.getFirstElement();
- }
-
- /**
- * Initializes this preference page using the passed workbench.
- *
- * @param workbench the current workbench
- */
- public void init(IWorkbench workbench) {
- // do nothing
- }
-
- /**
- * Performs special processing when this page's Defaults button has been pressed.
- * <p>
- * This is a framework hook method for sublcasses to do special things when
- * the Defaults button has been pressed.
- * Subclasses may override, but should call <code>super.performDefaults</code>.
- * </p>
- */
- protected void performDefaults() {
- super.performDefaults();
- }
-
- /**
- * Method declared on IPreferencePage.
- * Subclasses should override
- */
- public boolean performOk() {
- // TODO - should not save until user hits ok
- return true;
- }
-
- /**
- *
- */
- public void setVisible(boolean visible) {
- super.setVisible(visible);
- if (visible)
- setTitle(ServerUIPlugin.getResource("%preferenceRuntimesTitleLong"));
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/RuntimeTargetComposite.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/RuntimeTargetComposite.java
deleted file mode 100644
index 7ca364d..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/RuntimeTargetComposite.java
+++ /dev/null
@@ -1,271 +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 java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.preference.IPreferenceNode;
-import org.eclipse.jface.preference.PreferenceDialog;
-import org.eclipse.jface.preference.PreferenceManager;
-import org.eclipse.jface.window.Window;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.server.core.*;
-import org.eclipse.wst.server.core.internal.Module;
-import org.eclipse.wst.server.ui.ServerUIUtil;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-/**
- * Dialog that prompts a user to change the target runtime.
- *
- * TODO - must support multiple modules per project (remove [0] from getModules(IProject))
- */
-public class RuntimeTargetComposite {
- protected IProject project;
- protected IProjectProperties props;
- protected IRuntime currentRuntime;
- protected IRuntime newRuntime;
- protected IRuntime[] targets;
- protected String[] items;
-
- protected List childProjects;
- protected boolean setChildren = true;
- protected int offset = 0;
-
- /**
- * RuntimeTargetComposite constructor comment.
- * @param parent Composite
- * @param project IProject
- */
- protected RuntimeTargetComposite(Composite parent, IProject project) {
- this.project = project;
- props = ServerCore.getProjectProperties(project);
- currentRuntime = props.getRuntimeTarget();
- if (currentRuntime == null)
- offset = 1;
-
- // get child modules
- IModule projectModule = ServerUtil.getModules(project)[0];
- childProjects = new ArrayList();
- if (projectModule != null) {
- List children = new ArrayList();
- IModule[] child = ((Module) projectModule).getChildModules(null);
- if (child != null) {
- int size = child.length;
- for (int i = 0; i < size; i++)
- children.add(child[i]);
- int a = 0;
- while (a < children.size()) {
- IModule module = (IModule) children.get(a);
- IModule[] child2 = ((Module) module).getChildModules(null);
- if (child2 != null) {
- size = child2.length;
- for (int i = 0; i < size; i++)
- children.add(child2[i]);
- }
- a++;
- }
- }
-
- Iterator iterator = children.iterator();
- while (iterator.hasNext()) {
- IModule module = (IModule) iterator.next();
- if (module.getProject() != null)
- childProjects.add(module);
- }
- }
-
- createContents(parent);
- }
-
- /**
- *
- */
- protected void createContents(final Composite parent) {
- Label label = new Label(parent, SWT.NONE);
- label.setText(ServerUIPlugin.getResource("%runtimeTargetCombo"));
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- label.setLayoutData(data);
-
- final Combo combo = new Combo(parent, SWT.DROP_DOWN | SWT.READ_ONLY);
- data = new GridData(GridData.FILL_HORIZONTAL);
- combo.setLayoutData(data);
-
- int sel = updateRuntimes();
- combo.setItems(items);
- if (items.length == 0)
- combo.setEnabled(false);
- else {
- combo.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- int select = combo.getSelectionIndex();
- if (offset > 0 && select == 0)
- newRuntime = null;
- else
- newRuntime = targets[select - offset];
- }
- });
- if (sel >= 0) {
- combo.select(sel);
- if (offset == 0 || sel > 0)
- newRuntime = targets[sel - offset];
- } else
- combo.select(0);
- }
-
- final IModule projectModule = ServerUtil.getModules(project)[0];
-
- Button newButton = SWTUtil.createButton(parent, ServerUIPlugin.getResource("%runtimeTargetNewRuntime"));
- newButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- String currentRuntime2 = combo.getText();
- String type = null;
- String version = null;
- if (projectModule != null) {
- IModuleType mt = projectModule.getModuleType();
- type = mt.getId();
- version = mt.getVersion();
- }
- if (ServerUIUtil.showNewRuntimeWizard(parent.getShell(), type, version)) {
- int sel2 = updateRuntimes();
- combo.setItems(items);
- combo.setText(currentRuntime2);
- if (combo.getSelectionIndex() == -1)
- combo.select(sel2);
- }
- }
- });
-
- // child module selection
- if (!childProjects.isEmpty()) {
- final Button includeChildren = new Button(parent, SWT.CHECK);
- includeChildren.setText(ServerUIPlugin.getResource("%runtimeTargetChildren"));
- data = new GridData();
- data.horizontalSpan = 2;
- includeChildren.setLayoutData(data);
- includeChildren.setSelection(true);
-
- includeChildren.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- setChildren = includeChildren.getSelection();
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
- });
- } else {
- new Label(parent, SWT.NONE);
- new Label(parent, SWT.NONE);
- }
-
- Button prefsButton = SWTUtil.createButton(parent, ServerUIPlugin.getResource("%runtimeTargetRuntimePreferences"));
- prefsButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- String currentRuntime2 = combo.getText();
- if (showRuntimePreferencePage(parent.getShell())) {
- int sel2 = updateRuntimes();
- combo.setItems(items);
- combo.setText(currentRuntime2);
- if (combo.getSelectionIndex() == -1)
- combo.select(sel2);
- }
- }
- });
- }
-
- protected static boolean showRuntimePreferencePage(Shell shell) {
- PreferenceManager manager = PlatformUI.getWorkbench().getPreferenceManager();
- IPreferenceNode node = manager.find("org.eclipse.wst.server.ui.preferencePage").findSubNode("org.eclipse.wst.server.ui.runtime.preferencePage");
- PreferenceManager manager2 = new PreferenceManager();
- manager2.addToRoot(node);
- final PreferenceDialog dialog = new PreferenceDialog(shell, manager2);
- final boolean[] result = new boolean[] { false };
- BusyIndicator.showWhile(shell.getDisplay(), new Runnable() {
- public void run() {
- dialog.create();
- if (dialog.open() == Window.OK)
- result[0] = true;
- }
- });
- return result[0];
- }
-
- protected int updateRuntimes() {
- IModule pm = ServerUtil.getModules(project)[0];
- if (pm != null) {
- IModuleType mt = pm.getModuleType();
- targets = ServerUtil.getRuntimes(mt.getId(), mt.getVersion());
- }
-
- items = new String[0];
- int sel = -1;
- if (targets != null) {
- int size = targets.length;
- items = new String[size + offset];
- if (offset > 0) {
- items[0] = ServerUIPlugin.getResource("%runtimeTargetNone");
- sel = 0;
- }
- for (int i = 0; i < size; i++) {
- IRuntime target = targets[i];
- items[i+offset] = target.getName();
- if (target.equals(currentRuntime))
- sel = i;
- }
- }
- return sel;
- }
-
- public IRuntime getSelectedRuntime() {
- return newRuntime;
- }
-
- public boolean hasChanged() {
- if (!childProjects.isEmpty())
- return true;
- if (newRuntime == null)
- return false;
- if (newRuntime.equals(currentRuntime))
- return false;
- return true;
- }
-
- public void apply(IProgressMonitor monitor) throws CoreException {
- if (newRuntime == null || !newRuntime.equals(props.getRuntimeTarget()))
- props.setRuntimeTarget(newRuntime, monitor);
-
- if (setChildren) {
- Iterator iterator = childProjects.iterator();
- while (iterator.hasNext()) {
- IModule module = (IModule) iterator.next();
- IProject proj = module.getProject();
- props = ServerCore.getProjectProperties(proj);
-
- if (newRuntime == null || !newRuntime.equals(props.getRuntimeTarget()))
- props.setRuntimeTarget(newRuntime, monitor);
- }
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/SWTUtil.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/SWTUtil.java
deleted file mode 100644
index a323850..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/SWTUtil.java
+++ /dev/null
@@ -1,67 +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.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.FontMetrics;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-/**
- * SWT Utility class.
- */
-public class SWTUtil {
- private static FontMetrics fontMetrics;
-
- protected static void initializeDialogUnits(Control testControl) {
- // Compute and store a font metric
- GC gc = new GC(testControl);
- gc.setFont(JFaceResources.getDialogFont());
- fontMetrics = gc.getFontMetrics();
- gc.dispose();
- }
-
- /**
- * Returns a width hint for a button control.
- */
- protected static int getButtonWidthHint(Button button) {
- int widthHint = Dialog.convertHorizontalDLUsToPixels(fontMetrics, IDialogConstants.BUTTON_WIDTH);
- return Math.max(widthHint, button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
- }
-
- public static Button createButton(Composite comp, String label) {
- Button b = new Button(comp, SWT.PUSH);
- b.setText(label);
- if (fontMetrics == null)
- initializeDialogUnits(comp);
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_BEGINNING);
- data.widthHint = getButtonWidthHint(b);
- b.setLayoutData(data);
- return b;
- }
-
- public static int convertHorizontalDLUsToPixels(Composite comp, int x) {
- if (fontMetrics == null)
- initializeDialogUnits(comp);
- return Dialog.convertHorizontalDLUsToPixels(fontMetrics, x);
- }
-
- public static int convertVerticalDLUsToPixels(Composite comp, int y) {
- if (fontMetrics == null)
- initializeDialogUnits(comp);
- return Dialog.convertVerticalDLUsToPixels(fontMetrics, y);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerAdapterFactory.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerAdapterFactory.java
deleted file mode 100644
index ad2a690..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerAdapterFactory.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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 java.util.ArrayList;
-import java.util.List;
-import java.util.StringTokenizer;
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.ui.IActionFilter;
-import org.eclipse.wst.server.core.IServer;
-/**
- * Adapter factory to adapt servers to IActionFilter.
- */
-public class ServerAdapterFactory implements IAdapterFactory {
- IActionFilter actionFilter = new IActionFilter() {
- public boolean testAttribute(Object target, String name, String value) {
- IServer server = (IServer) target;
- String[] typeIds = tokenize(value, ",");
- return supportsServerType(server.getServerType().getId(), typeIds);
- }
- };
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
- */
- public Object getAdapter(Object adaptableObject, Class adapterType) {
- if (adapterType != IActionFilter.class)
- return null;
-
- return actionFilter;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
- */
- public Class[] getAdapterList() {
- return new Class[] { IActionFilter.class };
- }
-
- protected static String[] tokenize(String param, String delim) {
- if (param == null)
- return new String[0];
-
- List list = new ArrayList();
-
- StringTokenizer st = new StringTokenizer(param, delim);
- while (st.hasMoreTokens()) {
- String str = st.nextToken();
- if (str != null && str.length() > 0)
- list.add(str.trim());
- }
-
- String[] s = new String[list.size()];
- list.toArray(s);
- return s;
- }
-
- /**
- * Returns true if the given server type (given by the id) can use this action.
- *
- * @return boolean
- */
- protected boolean supportsServerType(String id, String[] typeIds) {
- if (id == null || id.length() == 0)
- return false;
-
- if (typeIds == null)
- return false;
-
- int size = typeIds.length;
- for (int i = 0; i < size; i++) {
- if (typeIds[i].endsWith("*")) {
- if (id.length() >= typeIds[i].length() && id.startsWith(typeIds[i].substring(0, typeIds[i].length() - 1)))
- return true;
- } else if (id.equals(typeIds[i]))
- return true;
- }
- return false;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerLabelProvider.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerLabelProvider.java
deleted file mode 100644
index 01ee288..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerLabelProvider.java
+++ /dev/null
@@ -1,176 +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.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.model.IWorkbenchAdapter;
-
-import org.eclipse.wst.server.core.*;
-import org.eclipse.wst.server.core.internal.IClient;
-/**
- * A label provider for all server related objects.
- */
-public class ServerLabelProvider implements ILabelProvider {
- public ServerLabelProvider() {
- // do nothing
- }
-
- protected Image getModuleImage(String typeId) {
- if (typeId == null)
- return null;
-
- Image image = ImageResource.getImage(typeId);
- int ind = typeId.indexOf(".");
- while (image == null && ind >= 0) {
- typeId = typeId.substring(0, ind);
- image = ImageResource.getImage(typeId);
- }
- return image;
- }
-
- protected ImageDescriptor getModuleImageDescriptor(String typeId) {
- if (typeId == null)
- return null;
-
- ImageDescriptor image = ImageResource.getImageDescriptor(typeId);
- int ind = typeId.indexOf(".");
- while (image == null && ind >= 0) {
- typeId = typeId.substring(0, ind);
- image = ImageResource.getImageDescriptor(typeId);
- }
- return image;
- }
-
- /*
- * @see ILabelProvider#getImage(Object)
- */
- public ImageDescriptor getImageDescriptor(Object element) {
- try {
- if (element instanceof IRuntimeType) {
- IRuntimeType runtimeType = (IRuntimeType) element;
- return ImageResource.getImageDescriptor(runtimeType.getId());
- } else if (element instanceof IRuntime) {
- IRuntime runtime = (IRuntime) element;
- return ImageResource.getImageDescriptor(runtime.getRuntimeType().getId());
- } else if (element instanceof IServerType) {
- IServerType serverType = (IServerType) element;
- return ImageResource.getImageDescriptor(serverType.getId());
- } else if (element instanceof IServer) {
- IServer server = (IServer) element;
- return ImageResource.getImageDescriptor(server.getServerType().getId());
- } else if (element instanceof IModule) {
- IModule module = (IModule) element;
- IModuleType mt = module.getModuleType();
- return getModuleImageDescriptor(mt.getId());
- } else if (element instanceof IWorkbenchAdapter) {
- return ((IWorkbenchAdapter) element).getImageDescriptor(null);
- }
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not get image descriptor", e);
- }
- return null;
- }
-
- /*
- * @see ILabelProvider#getImage(Object)
- */
- public Image getImage(Object element) {
- try {
- if (element instanceof IRuntimeType) {
- IRuntimeType runtimeType = (IRuntimeType) element;
- return ImageResource.getImage(runtimeType.getId());
- } else if (element instanceof IRuntime) {
- IRuntime runtime = (IRuntime) element;
- return ImageResource.getImage(runtime.getRuntimeType().getId());
- } else if (element instanceof IServerType) {
- IServerType serverType = (IServerType) element;
- return ImageResource.getImage(serverType.getId());
- } else if (element instanceof IServer) {
- IServer server = (IServer) element;
- if (server.getServerType() == null)
- return null;
-
- return ImageResource.getImage(server.getServerType().getId());
- } else if (element instanceof IModule) {
- IModule module = (IModule) element;
- IModuleType mt = module.getModuleType();
- return getModuleImage(mt.getId());
- }
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not get image descriptor", e);
- }
- return null;
- }
-
- protected String getString(String s) {
- if (s == null)
- return "";
-
- return s;
- }
-
- /*
- * @see ILabelProvider#getText(Object)
- */
- public String getText(Object element) {
- if (element == null)
- return "";
-
- if (element instanceof IRuntime) {
- return getString(((IRuntime) element).getName());
- } else if (element instanceof IServer) {
- return getString(((IServer) element).getName());
- } else if (element instanceof IRuntimeType) {
- return ((IRuntimeType) element).getName();
- } else if (element instanceof IServerType) {
- return ((IServerType) element).getName();
- } else if (element instanceof IClient) {
- return ((IClient) element).getName();
- } else if (element instanceof IModule) {
- return ((IModule) element).getName();
- } else if (element instanceof IWorkbenchAdapter) {
- return ((IWorkbenchAdapter) element).getLabel(null);
- }
-
- return "";
- }
-
- /*
- * @see IBaseLabelProvider#addListener(ILabelProviderListener)
- */
- public void addListener(ILabelProviderListener listener) {
- // do nothing
- }
-
- /*
- * @see IBaseLabelProvider#isLabelProperty(Object, String)
- */
- public boolean isLabelProperty(Object element, String property) {
- return false;
- }
-
- /*
- * @see IBaseLabelProvider#removeListener(ILabelProviderListener)
- */
- public void removeListener(ILabelProviderListener listener) {
- // do nothing
- }
-
- /*
- * @see IBaseLabelProvider#dispose()
- */
- public void dispose() {
- // do nothing
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerLaunchShortcut.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerLaunchShortcut.java
deleted file mode 100644
index f122256..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerLaunchShortcut.java
+++ /dev/null
@@ -1,65 +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.IFile;
-import org.eclipse.debug.ui.ILaunchShortcut;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-
-import org.eclipse.wst.server.core.internal.ServerPlugin;
-import org.eclipse.wst.server.ui.internal.actions.RunOnServerActionDelegate;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IFileEditorInput;
-/**
- *
- */
-public class ServerLaunchShortcut implements ILaunchShortcut {
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchShortcut#launch(org.eclipse.jface.viewers.ISelection, java.lang.String)
- */
- public void launch(ISelection selection, final String mode) {
- RunOnServerActionDelegate del = new RunOnServerActionDelegate() {
- protected String getLaunchMode() {
- return mode;
- }
- };
- IAction action = new Action() {
- // dummy action
- };
- del.selectionChanged(action, selection);
- del.run(action);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchShortcut#launch(org.eclipse.ui.IEditorPart, java.lang.String)
- */
- public void launch(IEditorPart editor, String mode) {
- if (editor == null)
- return;
-
- // check if the editor input itself can be run. Otherwise, check if
- // the editor has a file input that can be run
- IEditorInput input = editor.getEditorInput();
-
- if (ServerPlugin.hasModuleArtifact(input)) {
- launch(new StructuredSelection(input), mode);
- } else if (input instanceof IFileEditorInput) {
- IFileEditorInput fei = (IFileEditorInput) input;
- IFile file = fei.getFile();
- if (ServerPlugin.hasModuleArtifact(file))
- launch(new StructuredSelection(file), mode);
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerPreferencePage.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerPreferencePage.java
deleted file mode 100644
index 02f8844..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerPreferencePage.java
+++ /dev/null
@@ -1,318 +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.jface.dialogs.Dialog;
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.ServerCore;
-import org.eclipse.wst.server.core.internal.ServerPreferences;
-import org.eclipse.swt.SWT;
-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.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Spinner;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.help.IWorkbenchHelpSystem;
-/**
- * The preference page that holds server properties.
- */
-public class ServerPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
- protected Button publishBeforeStart;
- protected Button autoRestart;
-
- protected Button promptIrreversible;
-
- protected Button showOnActivity;
-
- protected byte saveEditors;
-
- protected Button saveNever;
- protected Button savePrompt;
- protected Button saveAuto;
-
- protected Button createInWorkspace;
-
- protected ServerPreferences preferences;
- protected ServerUIPreferences uiPreferences;
-
- protected Button autoPublishOnAction;
- protected Button autoPublishLocal;
- protected Spinner autoPublishLocalTime;
- protected Button autoPublishRemote;
- protected Spinner autoPublishRemoteTime;
-
- /**
- * ServerPreferencesPage constructor comment.
- */
- public ServerPreferencePage() {
- super();
-
- preferences = ServerPreferences.getInstance();
- uiPreferences = ServerUIPlugin.getPreferences();
- }
-
- /**
- * Create the preference options.
- *
- * @param parent org.eclipse.swt.widgets.Composite
- * @return org.eclipse.swt.widgets.Control
- */
- protected Control createContents(Composite parent) {
- initializeDialogUnits(parent);
-
- Composite composite = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.horizontalSpacing = convertHorizontalDLUsToPixels(4);
- layout.verticalSpacing = convertVerticalDLUsToPixels(4);
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- layout.numColumns = 3;
- composite.setLayout(layout);
- GridData data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL);
- composite.setLayoutData(data);
- IWorkbenchHelpSystem whs = PlatformUI.getWorkbench().getHelpSystem();
- whs.setHelp(composite, ContextIds.PREF_GENERAL);
-
- publishBeforeStart = new Button(composite, SWT.CHECK);
- publishBeforeStart.setText(ServerUIPlugin.getResource("%prefAutoPublish"));
- data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- data.horizontalSpan = 3;
- publishBeforeStart.setLayoutData(data);
- publishBeforeStart.setSelection(preferences.isAutoPublishing());
- whs.setHelp(publishBeforeStart, ContextIds.PREF_GENERAL_PUBLISH_BEFORE_START);
-
- autoPublishLocal = new Button(composite, SWT.CHECK);
- autoPublishLocal.setText(ServerUIPlugin.getResource("%prefAutoPublishLocal"));
- data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 1;
- autoPublishLocal.setLayoutData(data);
- autoPublishLocal.setSelection(preferences.getAutoPublishLocal());
- //WorkbenchHelp.setHelp(savePrompt, ContextIds.);
-
- autoPublishLocalTime = new Spinner(composite, SWT.BORDER);
- autoPublishLocalTime.setMinimum(0);
- autoPublishLocalTime.setMaximum(120);
- autoPublishLocalTime.setSelection(preferences.getAutoPublishLocalTime());
- autoPublishLocalTime.setEnabled(autoPublishLocal.getSelection());
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- data.widthHint = 75;
- autoPublishLocalTime.setLayoutData(data);
-
- Label label = new Label(composite, SWT.NONE);
- label.setText(ServerUIPlugin.getResource("%prefAutoPublishSeconds"));
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- label.setLayoutData(data);
-
- autoPublishLocal.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- autoPublishLocalTime.setEnabled(autoPublishLocal.getSelection());
- }
- });
-
- autoPublishRemote = new Button(composite, SWT.CHECK);
- autoPublishRemote.setText(ServerUIPlugin.getResource("%prefAutoPublishRemote"));
- data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- data.horizontalSpan = 1;
- autoPublishRemote.setLayoutData(data);
- autoPublishRemote.setSelection(preferences.getAutoPublishRemote());
- //WorkbenchHelp.setHelp(autoPublishRemote, ContextIds.);
-
- autoPublishRemoteTime = new Spinner(composite, SWT.BORDER);
- autoPublishLocalTime.setMinimum(0);
- autoPublishLocalTime.setMaximum(120);
- autoPublishRemoteTime.setSelection(preferences.getAutoPublishRemoteTime());
- autoPublishRemoteTime.setEnabled(autoPublishRemote.getSelection());
- data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- data.widthHint = 75;
- autoPublishRemoteTime.setLayoutData(data);
-
- autoPublishRemote.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- autoPublishRemoteTime.setEnabled(autoPublishRemote.getSelection());
- }
- });
-
- label = new Label(composite, SWT.NONE);
- label.setText(ServerUIPlugin.getResource("%prefAutoPublishSeconds"));
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- label.setLayoutData(data);
-
- autoRestart = new Button(composite, SWT.CHECK);
- autoRestart.setText(ServerUIPlugin.getResource("%prefAutoRestart"));
- data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- data.horizontalSpan = 3;
- autoRestart.setLayoutData(data);
- autoRestart.setSelection(preferences.isAutoRestarting());
- whs.setHelp(autoRestart, ContextIds.PREF_GENERAL_AUTO_RESTART);
-
- promptIrreversible = new Button(composite, SWT.CHECK);
- promptIrreversible.setText(ServerUIPlugin.getResource("%prefPromptIrreversible"));
- data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- data.horizontalSpan = 3;
- promptIrreversible.setLayoutData(data);
- promptIrreversible.setSelection(uiPreferences.getPromptBeforeIrreversibleChange());
- whs.setHelp(promptIrreversible, ContextIds.PREF_GENERAL_PROMPT_IRREVERSIBLE);
-
- showOnActivity = new Button(composite, SWT.CHECK);
- showOnActivity.setText(ServerUIPlugin.getResource("%prefShowOnActivity"));
- data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- data.horizontalSpan = 3;
- showOnActivity.setLayoutData(data);
- showOnActivity.setSelection(uiPreferences.getShowOnActivity());
- whs.setHelp(showOnActivity, ContextIds.PREF_GENERAL_SHOW_ON_ACTIVITY);
-
- createInWorkspace = new Button(composite, SWT.CHECK);
- createInWorkspace.setText(ServerUIPlugin.getResource("%prefCreateInWorkspace"));
- data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- data.horizontalSpan = 3;
- createInWorkspace.setLayoutData(data);
- createInWorkspace.setSelection(preferences.isCreateResourcesInWorkspace());
- whs.setHelp(createInWorkspace, ContextIds.PREF_GENERAL_CREATE_IN_WORKSPACE);
-
- // save editors group
- Group saveEditorGroup = new Group(composite, SWT.NONE);
- saveEditorGroup.setText(ServerUIPlugin.getResource("%prefSaveEditorsGroup"));
-
- layout = new GridLayout();
- layout.numColumns = 3;
- saveEditorGroup.setLayout(layout);
- data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 3;
- saveEditorGroup.setLayoutData(data);
-
- saveNever = new Button(saveEditorGroup, SWT.RADIO);
- saveNever.setText(ServerUIPlugin.getResource("%prefSaveEditorsNever"));
- saveNever.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent event) {
- saveEditors = ServerUIPreferences.SAVE_EDITORS_NEVER;
- }
- });
- whs.setHelp(saveNever, ContextIds.PREF_GENERAL_SAVE_EDITORS);
-
- savePrompt = new Button(saveEditorGroup, SWT.RADIO);
- savePrompt.setText(ServerUIPlugin.getResource("%prefSaveEditorsPrompt"));
- savePrompt.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent event) {
- saveEditors = ServerUIPreferences.SAVE_EDITORS_PROMPT;
- }
- });
- whs.setHelp(savePrompt, ContextIds.PREF_GENERAL_SAVE_EDITORS);
-
- saveAuto = new Button(saveEditorGroup, SWT.RADIO);
- saveAuto.setText(ServerUIPlugin.getResource("%prefSaveEditorsAutosave"));
- saveAuto.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent event) {
- saveEditors = ServerUIPreferences.SAVE_EDITORS_AUTO;
- }
- });
- whs.setHelp(saveAuto, ContextIds.PREF_GENERAL_SAVE_EDITORS);
-
- setSaveEditorStatus(uiPreferences.getSaveEditors());
-
- Dialog.applyDialogFont(composite);
-
- return composite;
- }
-
- protected void setSaveEditorStatus(byte status) {
- saveEditors = status;
- saveNever.setSelection(saveEditors == ServerUIPreferences.SAVE_EDITORS_NEVER);
- savePrompt.setSelection(saveEditors == ServerUIPreferences.SAVE_EDITORS_PROMPT);
- saveAuto.setSelection(saveEditors == ServerUIPreferences.SAVE_EDITORS_AUTO);
- }
-
- /**
- * Initializes this preference page using the passed workbench.
- *
- * @param workbench the current workbench
- */
- public void init(IWorkbench workbench) {
- // do nothing
- }
-
- /**
- * Performs special processing when this page's Defaults button has been pressed.
- */
- protected void performDefaults() {
- autoRestart.setSelection(preferences.isDefaultAutoRestarting());
- publishBeforeStart.setSelection(preferences.isDefaultAutoPublishing());
- promptIrreversible.setSelection(uiPreferences.getDefaultPromptBeforeIrreversibleChange());
- showOnActivity.setSelection(uiPreferences.getDefaultShowOnActivity());
- createInWorkspace.setSelection(preferences.isDefaultCreateResourcesInWorkspace());
-
- autoPublishLocal.setSelection(preferences.getDefaultAutoPublishLocal());
- autoPublishLocalTime.setSelection(preferences.getDefaultAutoPublishLocalTime());
- autoPublishRemote.setSelection(preferences.getDefaultAutoPublishRemote());
- autoPublishRemoteTime.setSelection(preferences.getDefaultAutoPublishRemoteTime());
-
- setSaveEditorStatus(uiPreferences.getDefaultSaveEditors());
-
- super.performDefaults();
- }
-
- /**
- * Method declared on IPreferencePage.
- * Subclasses should override
- */
- public boolean performOk() {
- preferences.setAutoPublishing(publishBeforeStart.getSelection());
- preferences.setAutoRestarting(autoRestart.getSelection());
- uiPreferences.setSaveEditors(saveEditors);
- uiPreferences.setPromptBeforeIrreversibleChange(promptIrreversible.getSelection());
- uiPreferences.setShowOnActivity(showOnActivity.getSelection());
- preferences.setCreateResourcesInWorkspace(createInWorkspace.getSelection());
-
- preferences.setAutoPublishLocal(autoPublishLocal.getSelection());
- preferences.setAutoPublishLocalTime(autoPublishLocalTime.getSelection());
- preferences.setAutoPublishRemote(autoPublishRemote.getSelection());
- preferences.setAutoPublishRemoteTime(autoPublishRemoteTime.getSelection());
-
- // auto restart any servers that are ready for restart
- if (autoRestart.getSelection())
- autoRestartAll();
-
- return true;
- }
-
- /**
- * Automatically restart any servers that require it.
- */
- protected static void autoRestartAll() {
- Trace.trace(Trace.FINEST, "Auto restarting all dirty servers");
-
- IServer[] servers = ServerCore.getServers();
- if (servers != null) {
- int size = servers.length;
- for (int i = 0; i < size; i++) {
- IServer server = servers[i];
- if (server.getServerRestartState()) {
- String mode = server.getMode();
- if (server.canRestart(mode).isOK())
- try {
- Trace.trace(Trace.FINEST, "Attempting to auto restart " + server.getName());
- server.restart(mode);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error restarting: " + server, e);
- }
- }
- }
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerPropertyTester.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerPropertyTester.java
deleted file mode 100644
index e5e09d3..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerPropertyTester.java
+++ /dev/null
@@ -1,25 +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.expressions.PropertyTester;
-import org.eclipse.wst.server.core.internal.ServerPlugin;
-/**
- *
- */
-public class ServerPropertyTester extends PropertyTester {
- /* (non-Javadoc)
- * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
- */
- public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
- return ServerPlugin.hasModuleArtifact(receiver);
- }
-}
\ 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/ServerTree.java
deleted file mode 100644
index 85d9e0d..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerTree.java
+++ /dev/null
@@ -1,366 +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 java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.ui.actions.NewServerAction;
-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 {
- /**
- * Constants for actions
- */
- public static final byte ACTION_OPEN = 0;
- public static final byte ACTION_DELETE = 1;
- public static final byte ACTION_BOOKMARK = 2;
-
- private ServerTree() {
- // do nothing
- }
-
- public static void fillContextMenu(Shell shell, ISelection selection, IMenuManager menu) {
- MenuManager newMenu = new MenuManager(ServerUIPlugin.getResource("%actionNew"));
- fillNewContextMenu(shell, selection, newMenu);
- menu.add(newMenu);
- fillOtherContextMenu(shell, selection, menu);
- }
-
- public static void fillNewContextMenu(Shell shell, ISelection selection, IMenuManager menu) {
- IAction newServerAction = new NewServerAction();
- newServerAction.setText(ServerUIPlugin.getResource("%actionNewServer"));
- menu.add(newServerAction);
- }
-
- public static void fillOtherContextMenu(Shell shell, ISelection selection, IMenuManager menu) {
- if (selection == null)
- return;
-
- 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(ServerUIPlugin.getResource("%actionSwitchConfiguration"));
- menuManager.add(new SwitchConfigurationAction(shell, ServerUIPlugin.getResource("%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(ServerUIPlugin.getResource("%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(ServerUIPlugin.getResource("%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) {
- final ISelection selection = new StructuredSelection(server);
- ISelectionProvider provider = new ISelectionProvider() {
- public void addSelectionChangedListener(ISelectionChangedListener listener) {
- // do nothing
- }
- public ISelection getSelection() {
- return selection;
- }
- public void removeSelectionChangedListener(ISelectionChangedListener listener) {
- // do nothing
- }
- public void setSelection(ISelection sel) {
- // do nothing
- }
- };
-
- // create the debug action
- Action debugAction = new StartAction(shell, provider, "debug", ILaunchManager.DEBUG_MODE);
- debugAction.setToolTipText(ServerUIPlugin.getResource("%actionDebugToolTip"));
- debugAction.setText(ServerUIPlugin.getResource("%actionDebug"));
- debugAction.setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_ELCL_START_DEBUG));
- debugAction.setHoverImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_CLCL_START_DEBUG));
- debugAction.setDisabledImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_DLCL_START_DEBUG));
- menu.add(debugAction);
-
- // create the start action
- Action runAction = new StartAction(shell, provider, "start", ILaunchManager.RUN_MODE);
- runAction.setToolTipText(ServerUIPlugin.getResource("%actionStartToolTip"));
- runAction.setText(ServerUIPlugin.getResource("%actionStart"));
- runAction.setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_ELCL_START));
- runAction.setHoverImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_CLCL_START));
- runAction.setDisabledImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_DLCL_START));
- menu.add(runAction);
-
- // create the profile action
- Action profileAction = new StartAction(shell, provider, "profile", ILaunchManager.PROFILE_MODE);
- profileAction.setToolTipText(ServerUIPlugin.getResource("%actionProfileToolTip"));
- profileAction.setText(ServerUIPlugin.getResource("%actionProfile"));
- profileAction.setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_ELCL_START_PROFILE));
- profileAction.setHoverImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_CLCL_START_PROFILE));
- profileAction.setDisabledImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_DLCL_START_PROFILE));
- menu.add(profileAction);
-
- // create the restart action
- MenuManager menuManager = new MenuManager(ServerUIPlugin.getResource("%actionRestart"));
-
- Action restartAction = new RestartAction(shell, provider, "restart", ILaunchManager.RUN_MODE);
- restartAction.setToolTipText(ServerUIPlugin.getResource("%actionRestartToolTip"));
- restartAction.setText(ServerUIPlugin.getResource("%actionRestart"));
- restartAction.setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_ELCL_RESTART));
- restartAction.setHoverImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_CLCL_RESTART));
- restartAction.setDisabledImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_DLCL_RESTART));
- menuManager.add(restartAction);
- //menu.add(restartAction);
- menu.add(menuManager);
-
- // create the stop action
- /*Action stopAction = new StopAction(shell, provider, "stop", IServerFactory.SERVER_STATE_SET_MANAGED);
- stopAction.setToolTipText(ServerUIPlugin.getResource("%actionStopToolTip"));
- stopAction.setText(ServerUIPlugin.getResource("%actionStop"));
- stopAction.setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_ELCL_STOP));
- stopAction.setHoverImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_CLCL_STOP));
- stopAction.setDisabledImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_DLCL_STOP));
- menu.add(stopAction);
-
- // create the disconnect action
- Action disconnectAction = new StopAction(shell, provider, "disconnect", IServerFactory.SERVER_STATE_SET_ATTACHED);
- disconnectAction.setToolTipText(ServerUIPlugin.getResource("%actionStopToolTip2"));
- disconnectAction.setText(ServerUIPlugin.getResource("%actionStop2"));
- disconnectAction.setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_ELCL_DISCONNECT));
- disconnectAction.setHoverImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_CLCL_DISCONNECT));
- disconnectAction.setDisabledImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_DLCL_DISCONNECT));
- menu.add(disconnectAction);*/
-
- // create the publish action
- Action publishAction = new PublishAction(shell, provider, "publish");
- publishAction.setToolTipText(ServerUIPlugin.getResource("%actionPublishToolTip"));
- publishAction.setText(ServerUIPlugin.getResource("%actionPublish"));
- publishAction.setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_ELCL_PUBLISH));
- publishAction.setHoverImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_CLCL_PUBLISH));
- publishAction.setDisabledImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_DLCL_PUBLISH));
- menu.add(publishAction);
- }
-
- public static boolean isActionEnabled(ISelection selection, byte action) {
- if (selection == null || action < 0)
- return false;
-
- if (selection.isEmpty() || !(selection instanceof IStructuredSelection))
- return false;
-
- IStructuredSelection sel = (IStructuredSelection) selection;
-
- if (action == ACTION_OPEN) {
- if (sel.size() != 1)
- return false;
-
- Object obj = sel.getFirstElement();
-
- return (obj instanceof ServerElementAdapter);
- } else if (action == ACTION_DELETE) {
- if (sel.size() == 0)
- return false;
-
- Iterator iterator = sel.iterator();
- while (iterator.hasNext()) {
- Object obj = iterator.next();
-
- if (!(obj instanceof ServerElementAdapter) && !(obj instanceof IServer))
- return false;
- }
- return true;
- }
-
- return false;
- }
-
- public static boolean performAction(Shell shell, ISelection selection, byte action) {
- //if (!isActionEnabled(selection, action))
- // return false;
-
- if (selection == null || action < 0)
- return false;
-
- if (selection.isEmpty() || !(selection instanceof IStructuredSelection))
- return false;
-
- IStructuredSelection sel = (IStructuredSelection) selection;
-
- if (action == ACTION_OPEN) {
- if (sel.size() != 1)
- return false;
-
- Object obj = sel.getFirstElement();
- if (obj instanceof IServer) {
- 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) {
- if (sel.size() == 0)
- return false;
-
- List list = new ArrayList();
- Iterator iterator = sel.iterator();
- while (iterator.hasNext()) {
- Object obj = iterator.next();
-
- if (obj instanceof ServerElementAdapter)
- list.add(((ServerElementAdapter) obj).getObject());
- else if (obj instanceof IServer)
- list.add(obj);
- }
-
- IServer[] servers = new IServer[list.size()];
- list.toArray(servers);
-
- Action delete = new DeleteAction(shell, servers);
- delete.run();
- return true;
- }
-
- return false;
- }
-
- /**
- * Returns an action of the specified type, which can be used for global
- */
- public static IAction getAction(Shell shell, ISelectionProvider provider, byte action) {
- if (action == ACTION_DELETE) {
- return new ServerTreeAction(shell, provider, ServerUIPlugin.getResource("%actionDelete"), ServerTree.ACTION_DELETE);
- }
- return null;
- }
-}
\ No newline at end of file
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 c23ab28..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerTreeContentProvider.java
+++ /dev/null
@@ -1,322 +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.core.internal.ResourceManager;
-import org.eclipse.wst.server.core.model.ModuleEvent;
-import org.eclipse.wst.server.core.model.IModuleEventsListener;
-import org.eclipse.wst.server.core.model.ModuleFactoryEvent;
-import org.eclipse.wst.server.core.util.ServerAdapter;
-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;
- protected IModuleEventsListener moduleEventsListener;
-
- 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();
- addServerConfigurationListener();
- addModuleEventsListener();
- }
-
- 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);
-
- if (moduleEventsListener != null)
- ResourceManager.getInstance().removeModuleEventsListener(moduleEventsListener);
- }
-
- /**
- * 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 addServerConfigurationListener() {
- // add a listener for configuration child module changes
- serverListener = new ServerAdapter() {
- 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);
- }
-
- /**
- * Add listener to refresh when modules are added.
- */
- private void addModuleEventsListener() {
- moduleEventsListener = new IModuleEventsListener() {
- public void moduleEvents(ModuleFactoryEvent[] factoryEvent, ModuleEvent[] event) {
- Display.getDefault().syncExec(new Runnable() {
- public void run() {
- if (viewer != null)
- viewer.refresh(true);
- }
- });
- }
- };
-
- ResourceManager.getInstance().addModuleEventsListener(moduleEventsListener);
- }
-
- /**
- * 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/ServerUIPlugin.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerUIPlugin.java
deleted file mode 100644
index ed3537f..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerUIPlugin.java
+++ /dev/null
@@ -1,689 +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 java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.*;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.StructuredSelection;
-
-import org.eclipse.wst.server.core.*;
-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.core.internal.ServerType;
-import org.eclipse.wst.server.core.util.ServerAdapter;
-import org.eclipse.wst.server.ui.ServerUIUtil;
-import org.eclipse.wst.server.ui.internal.actions.RunOnServerActionDelegate;
-import org.eclipse.wst.server.ui.internal.editor.IServerEditorInput;
-import org.eclipse.wst.server.ui.internal.editor.ServerEditorInput;
-import org.eclipse.wst.server.ui.internal.task.FinishWizardFragment;
-import org.eclipse.wst.server.ui.internal.task.InputWizardFragment;
-import org.eclipse.wst.server.ui.internal.task.SaveRuntimeTask;
-import org.eclipse.wst.server.ui.internal.wizard.ClosableWizardDialog;
-import org.eclipse.wst.server.ui.internal.wizard.fragment.NewRuntimeWizardFragment;
-import org.eclipse.wst.server.ui.wizard.TaskWizard;
-import org.eclipse.wst.server.ui.wizard.WizardFragment;
-
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-/**
- * The server UI plugin class.
- */
-public class ServerUIPlugin extends AbstractUIPlugin {
- protected static final String VIEW_ID = "org.eclipse.wst.server.ui.ServersView";
-
- // server UI plugin id
- public static final String PLUGIN_ID = "org.eclipse.wst.server.ui";
-
- //public static final byte START = 0;
- public static final byte STOP = 1;
- //public static final byte RESTART = 2;
-
- // singleton instance of this class
- private static ServerUIPlugin singleton;
-
- protected Map imageDescriptors = new HashMap();
-
- // cached copy of all runtime wizards
- private static Map wizardFragments;
-
- static class WizardFragmentData {
- String id;
- IConfigurationElement ce;
- WizardFragment fragment;
-
- public WizardFragmentData(String id, IConfigurationElement ce) {
- this.id = id;
- this.ce = ce;
- }
- }
-
- protected static List terminationWatches = new ArrayList();
-
- protected IServerLifecycleListener serverLifecycleListener = new IServerLifecycleListener() {
- public void serverAdded(IServer server) {
- server.addServerListener(serverListener);
- ((Server) server).addPublishListener(publishListener);
- }
-
- public void serverChanged(IServer server) {
- // ignore
- }
-
- public void serverRemoved(IServer server) {
- server.removeServerListener(serverListener);
- ((Server) server).removePublishListener(publishListener);
- }
- };
-
- protected static IServerListener serverListener = new ServerAdapter() {
- public void serverStateChange(IServer server) {
- showServersView();
- }
-
- public void modulesChanged(IServer server) {
- showServersView();
- }
- };
-
- protected static IPublishListener publishListener = new PublishAdapter() {
- public void publishStarted(IServer server) {
- showServersView();
- }
-
- public void publishFinished(IServer server, IStatus status) {
- showServersView();
- }
- };
-
- /**
- * Create the ServerUIPlugin.
- */
- public ServerUIPlugin() {
- super();
- singleton = this;
- }
-
- /**
- * Returns the singleton instance of this plugin.
- *
- * @return org.eclipse.wst.server.ui.internal.plugin.ServerUIPlugin
- */
- public static ServerUIPlugin getInstance() {
- return singleton;
- }
-
- /**
- * Returns the translated String found with the given key.
- *
- * @param key java.lang.String
- * @return java.lang.String
- */
- public static String getResource(String key) {
- try {
- return Platform.getResourceString(getInstance().getBundle(), key);
- } catch (Exception e) {
- return key;
- }
- }
-
- /**
- * Returns the translated String found with the given key,
- * and formatted with the given arguments using java.text.MessageFormat.
- *
- * @param key java.lang.String
- * @param arg java.lang.String
- * @return java.lang.String
- */
- public static String getResource(String key, String arg) {
- return getResource(key, new String[] {arg});
- }
-
- /**
- * Returns the translated String found with the given key,
- * and formatted with the given arguments using java.text.MessageFormat.
- *
- * @param key java.lang.String
- * @param arguments java.lang.Object[]
- * @return java.lang.String
- */
- public static String getResource(String key, Object[] arguments) {
- try {
- String text = getResource(key);
- return MessageFormat.format(text, arguments);
- } catch (Exception e) {
- return key;
- }
- }
-
- /**
- * Convenience method for logging.
- *
- * @param status org.eclipse.core.runtime.IStatus
- */
- public static void log(IStatus status) {
- getInstance().getLog().log(status);
- }
-
- /**
- * Return the UI preferences.
- *
- * @return ServerUIPreferences
- */
- public static ServerUIPreferences getPreferences() {
- return new ServerUIPreferences();
- }
-
- /**
- * Start up this plug-in.
- *
- * @throws Exception
- */
- public void start(BundleContext context) throws Exception {
- Trace.trace(Trace.CONFIG, "----->----- Server UI plugin start ----->-----");
- super.start(context);
-
- ServerUIPreferences prefs = getPreferences();
- prefs.setDefaults();
-
- ServerCore.addServerLifecycleListener(serverLifecycleListener);
-
- IServer[] servers = ServerCore.getServers();
- if (servers != null) {
- int size = servers.length;
- for (int i = 0; i < size; i++) {
- servers[i].addServerListener(serverListener);
- ((Server) servers[i]).addPublishListener(publishListener);
- }
- }
- }
-
- /**
- * Shuts down this plug-in and saves all plug-in state.
- *
- * @exception Exception
- */
- public void stop(BundleContext context) throws Exception {
- Trace.trace(Trace.CONFIG, "-----<----- Server UI plugin stop -----<-----");
- super.stop(context);
-
- ImageResource.dispose();
-
- IServer[] servers = ServerCore.getServers();
- if (servers != null) {
- int size = servers.length;
- for (int i = 0; i < size; i++) {
- servers[i].removeServerListener(serverListener);
- ((Server) servers[i]).removePublishListener(publishListener);
- }
- }
-
- ServerCore.removeServerLifecycleListener(serverLifecycleListener);
- }
-
- /**
- * Adds a watch to this server. If it hasn't stopped in a
- * reasonable amount of time, the user will be prompted to
- * terminate the server.
- *
- * @param server org.eclipse.wst.server.core.IServer
- */
- public static void addTerminationWatch(final Shell shell, final IServer server, final int mode) {
- if (terminationWatches.contains(server))
- return;
-
- terminationWatches.add(server);
-
- class TerminateThread extends Thread {
- public boolean alive = true;
- public IServerListener listener;
-
- public void run() {
- while (alive) {
- ServerType serverType = (ServerType) server.getServerType();
- int delay = serverType.getStartTimeout();
- if (mode == 1)
- delay = serverType.getStopTimeout();
- else if (mode == 2)
- delay += serverType.getStopTimeout();
-
- if (delay < 0)
- return;
-
- try {
- Thread.sleep(delay);
- } catch (InterruptedException e) {
- // ignore
- }
-
- if (server.getServerState() == IServer.STATE_STOPPED)
- alive = false;
-
- if (alive) {
- Display.getDefault().syncExec(new Runnable() {
- public void run() {
- TerminationDialog dialog = new TerminationDialog(shell, server.getName());
- dialog.open();
- if (dialog.getReturnCode() == IDialogConstants.OK_ID) {
- // only try calling terminate once. Also, make sure that it didn't stop while
- // the dialog was open
- if (server.getServerState() != IServer.STATE_STOPPED)
- server.stop(true);
- alive = false;
- }
- }
- });
- }
- if (!alive) {
- if (listener != null)
- server.removeServerListener(listener);
- terminationWatches.remove(server);
- }
- }
- }
- }
-
- final TerminateThread t = new TerminateThread();
- t.setDaemon(true);
- t.setPriority(Thread.NORM_PRIORITY - 2);
-
- // add listener to stop the thread if/when the server stops
- IServerListener listener = new ServerAdapter() {
- public void serverStateChange(IServer server2) {
- if (server2.getServerState() == IServer.STATE_STOPPED && t != null)
- t.alive = false;
- }
- };
- t.listener = listener;
- server.addServerListener(listener);
-
- t.start();
- }
-
- //protected static final String MODULE_ARTIFACT_CLASS = "org.eclipse.wst.server.core.IModuleArtifact";
-
- /**
- * Returns the module artifact for the given object, or null if a module artifact
- * can't be found.
- *
- * @return the module artifact
- */
- /*public static boolean hasModuleArtifact(Object adaptable) {
- if (adaptable instanceof IModuleArtifact)
- return true;
-
- return Platform.getAdapterManager().hasAdapter(adaptable, MODULE_ARTIFACT_CLASS);
- }*/
-
- /**
- * Returns the module artifact for the given object, or null if a module artifact
- * can't be found.
- *
- * @return the module artifact
- */
- /*public static IModuleArtifact getModuleArtifact(Object adaptable) {
- if (adaptable instanceof IModuleArtifact)
- return (IModuleArtifact) adaptable;
-
- if (Platform.getAdapterManager().hasAdapter(adaptable, MODULE_ARTIFACT_CLASS)) {
- return (IModuleArtifact) Platform.getAdapterManager().getAdapter(adaptable, MODULE_ARTIFACT_CLASS);
- }
-
- return null;
- }*/
-
- /**
- * Returns the module artifact for the given object, or null if a module artifact
- * can't be found.
- *
- * @return the module artifact
- */
- /*public static IModuleArtifact loadModuleArtifact(Object obj) {
- if (obj instanceof IModuleArtifact)
- return (IModuleArtifact) obj;
-
- if (Platform.getAdapterManager().hasAdapter(obj, MODULE_ARTIFACT_CLASS)) {
- return (IModuleArtifact) Platform.getAdapterManager().loadAdapter(obj, MODULE_ARTIFACT_CLASS);
- }
-
- return null;
- }*/
-
- /**
- * Returns the server that came from the given file, or <code>null</code>
- * if none. This convenience method searches the list of known
- * servers ({@link ServerCore#getServers()}) for the one with a matching
- * location ({@link IServer#getFile()}). The file may not be null.
- *
- * @param file a server file
- * @return the server instance, or <code>null</code> if
- * there is no server associated with the given file
- */
- public static IServer findServer(IFile file) {
- if (file == null)
- throw new IllegalArgumentException();
-
- IServer[] servers = ServerCore.getServers();
- if (servers != null) {
- int size = servers.length;
- for (int i = 0; i < size; i++) {
- if (file.equals(servers[i].getFile()))
- return servers[i];
- }
- }
- return null;
- }
-
- /**
- * Returns an array of all known runtime instances of
- * the given runtime type. This convenience method filters the list of known
- * runtime ({@link ServerCore#getRuntimes()}) for ones with a matching
- * runtime type ({@link IRuntime#getRuntimeType()}). The array will not
- * contain any working copies.
- * <p>
- * A new array is returned on each call, so clients may store or modify the result.
- * </p>
- *
- * @param runtimeType the runtime type
- * @return a possibly-empty list of runtime instances {@link IRuntime}
- * of the given runtime type
- */
- public static IRuntime[] getRuntimes(IRuntimeType runtimeType) {
- List list = new ArrayList();
- IRuntime[] runtimes = ServerCore.getRuntimes();
- if (runtimes != null) {
- int size = runtimes.length;
- for (int i = 0; i < size; i++) {
- if (runtimes[i].getRuntimeType() != null && runtimes[i].getRuntimeType().equals(runtimeType))
- list.add(runtimes[i]);
- }
- }
-
- IRuntime[] r = new IRuntime[list.size()];
- list.toArray(r);
- return r;
- }
-
- /**
- * Open the given server with the server editor.
- *
- * @param server
- */
- public static void editServer(IServer server) {
- if (server == null)
- return;
-
- editServer(server.getId());
- }
-
- /**
- * Open the given server id with the server editor.
- *
- * @param serverId
- */
- protected static void editServer(String serverId) {
- if (serverId == null)
- return;
-
- IWorkbenchWindow workbenchWindow = ServerUIPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow();
- IWorkbenchPage page = workbenchWindow.getActivePage();
-
- try {
- IServerEditorInput input = new ServerEditorInput(serverId);
- page.openEditor(input, IServerEditorInput.EDITOR_ID);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error opening server editor", e);
- }
- }
-
- /**
- * Use the preference to prompt the user to save dirty editors, if applicable.
- *
- * @return boolean - Returns false if the user cancelled the operation
- */
- public static boolean saveEditors() {
- byte b = ServerUIPlugin.getPreferences().getSaveEditors();
- if (b == ServerUIPreferences.SAVE_EDITORS_NEVER)
- return true;
- return ServerUIPlugin.getInstance().getWorkbench().saveAllEditors(b == ServerUIPreferences.SAVE_EDITORS_PROMPT);
- }
-
- /**
- * Prompts the user if the server is dirty. Returns true if the server was
- * not dirty or if the user decided to continue anyway. Returns false if
- * the server is dirty and the user chose to cancel the operation.
- *
- * @return boolean
- */
- public static boolean promptIfDirty(Shell shell, IServer server) {
- if (server == null)
- return false;
-
- if (!(server instanceof IServerWorkingCopy))
- return true;
-
- String title = ServerUIPlugin.getResource("%resourceDirtyDialogTitle");
-
- IServerWorkingCopy wc = (IServerWorkingCopy) server;
- if (wc.isDirty()) {
- String message = ServerUIPlugin.getResource("%resourceDirtyDialogMessage", server.getName());
- String[] labels = new String[] {ServerUIPlugin.getResource("%resourceDirtyDialogContinue"), IDialogConstants.CANCEL_LABEL};
- MessageDialog dialog = new MessageDialog(shell, title, null, message, MessageDialog.INFORMATION, labels, 0);
-
- if (dialog.open() != 0)
- return false;
- }
-
- return true;
- }
-
- protected static void showServersView() {
- if (!getPreferences().getShowOnActivity())
- return;
-
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- try {
- IWorkbench workbench = ServerUIPlugin.getInstance().getWorkbench();
- IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
-
- IWorkbenchPage page = workbenchWindow.getActivePage();
-
- IViewPart view2 = page.findView(VIEW_ID);
-
- if (view2 != null)
- page.bringToTop(view2);
- else
- page.showView(VIEW_ID);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error opening TCP/IP view", e);
- }
- }
- });
- }
-
- /**
- * Returns true if the given server is already started in the given
- * mode, or could be (re)started in the start mode.
- *
- * @param server
- * @param launchMode
- * @return boolean
- */
- public static boolean isCompatibleWithLaunchMode(IServer server, String launchMode) {
- if (server == null || launchMode == null)
- return false;
-
- int state = server.getServerState();
- if (state == IServer.STATE_STARTED && launchMode.equals(server.getMode()))
- return true;
-
- if (server.getServerType().supportsLaunchMode(launchMode))
- return true;
- return false;
- }
-
- /**
- * Open the new runtime wizard.
- *
- * @param shell
- * @param type
- * @param version
- * @param runtimeTypeId
- * @return true if a new runtime was created
- */
- public static boolean showNewRuntimeWizard(Shell shell, final String type, final String version, final String runtimeTypeId) {
- WizardFragment fragment = new WizardFragment() {
- protected void createChildFragments(List list) {
- list.add(new NewRuntimeWizardFragment(type, version, runtimeTypeId));
- list.add(new FinishWizardFragment(new SaveRuntimeTask()));
- }
- };
- TaskWizard wizard = new TaskWizard(ServerUIPlugin.getResource("%wizNewRuntimeWizardTitle"), fragment);
- wizard.setForcePreviousAndNextButtons(true);
- ClosableWizardDialog dialog = new ClosableWizardDialog(shell, wizard);
- return (dialog.open() == IDialogConstants.OK_ID);
- }
-
- /**
- * Open the new runtime wizard.
- *
- * @param shell
- * @param runtimeTypeId
- * @return true if a new runtime was created
- */
- public static boolean showNewRuntimeWizard(Shell shell, final String runtimeTypeId) {
- IRuntimeType runtimeType = null;
- if (runtimeTypeId != null)
- runtimeType = ServerCore.findRuntimeType(runtimeTypeId);
- if (runtimeType != null) {
- try {
- final IRuntimeWorkingCopy runtime = runtimeType.createRuntime(null, null);
- WizardFragment fragment = new WizardFragment() {
- protected void createChildFragments(List list) {
- list.add(new InputWizardFragment(TaskModel.TASK_RUNTIME, runtime));
- list.add(getWizardFragment(runtimeTypeId));
- list.add(new FinishWizardFragment(new SaveRuntimeTask()));
- }
- };
- TaskWizard wizard = new TaskWizard(ServerUIPlugin.getResource("%wizNewRuntimeWizardTitle"), fragment);
- wizard.setForcePreviousAndNextButtons(true);
- ClosableWizardDialog dialog = new ClosableWizardDialog(shell, wizard);
- return (dialog.open() == IDialogConstants.OK_ID);
- } catch (Exception e) {
- return false;
- }
- }
- return showNewRuntimeWizard(shell, null, null, runtimeTypeId);
- }
-
- /**
- * Open the new runtime wizard.
- * @param shell
- * @return true if a new runtime was created
- */
- public static boolean showNewRuntimeWizard(Shell shell) {
- return ServerUIUtil.showNewRuntimeWizard(shell, null, null);
- }
-
- /**
- * Returns the wizard fragment with the given id.
- *
- * @param typeId the server or runtime type id
- * @return a wizard fragment, or <code>null</code> if none could be found
- */
- public static WizardFragment getWizardFragment(String typeId) {
- if (typeId == null)
- return null;
-
- if (wizardFragments == null)
- loadWizardFragments();
-
- Iterator iterator = wizardFragments.keySet().iterator();
- while (iterator.hasNext()) {
- String key = (String) iterator.next();
- if (typeId.equals(key)) {
- WizardFragmentData data = (WizardFragmentData) wizardFragments.get(key);
- return getWizardFragment(data);
- }
- }
- return null;
- }
-
- /**
- * Load the wizard fragments.
- */
- private static synchronized void loadWizardFragments() {
- if (wizardFragments != null)
- return;
- Trace.trace(Trace.CONFIG, "->- Loading .wizardFragments extension point ->-");
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IConfigurationElement[] cf = registry.getConfigurationElementsFor(ServerUIPlugin.PLUGIN_ID, "wizardFragments");
-
- int size = cf.length;
- wizardFragments = new HashMap(size);
- for (int i = 0; i < size; i++) {
- try {
- String id = cf[i].getAttribute("typeIds");
- wizardFragments.put(id, new WizardFragmentData(id, cf[i]));
- Trace.trace(Trace.CONFIG, " Loaded wizardFragment: " + id);
- } catch (Throwable t) {
- Trace.trace(Trace.SEVERE, " Could not load wizardFragment: " + cf[i].getAttribute("id"), t);
- }
- }
-
- Trace.trace(Trace.CONFIG, "-<- Done loading .wizardFragments extension point -<-");
- }
-
- protected static WizardFragment getWizardFragment(WizardFragmentData fragment) {
- if (fragment == null)
- return null;
-
- if (fragment.fragment == null) {
- try {
- fragment.fragment = (WizardFragment) fragment.ce.createExecutableExtension("class");
- } catch (Throwable t) {
- Trace.trace(Trace.SEVERE, "Could not create wizardFragment: " + fragment.ce.getAttribute("id"), t);
- }
- }
- return fragment.fragment;
- }
-
- public static void runOnServer(Object object, String launchMode) {
- RunOnServerActionDelegate delegate = new RunOnServerActionDelegate();
- Action action = new Action() {
- // dummy action
- };
- if (object != null) {
- StructuredSelection sel = new StructuredSelection(object);
- delegate.selectionChanged(action, sel);
- } else
- delegate.selectionChanged(action, null);
-
- delegate.run(action);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerUIPreferences.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerUIPreferences.java
deleted file mode 100644
index c0a55f3..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerUIPreferences.java
+++ /dev/null
@@ -1,203 +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 java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.StringTokenizer;
-
-import org.eclipse.core.runtime.Preferences;
-/**
- * Helper class that stores preference information for
- * the server tools.
- */
-public class ServerUIPreferences {
- private static final String PREF_PROMPT_IRREVERSIBLE = "prompt-irreversible";
- private static final String PREF_IMPORT_LOCATION = "import-location";
- private static final String PREF_SAVE_EDITORS = "save-editors";
- private static final String PREF_HOST_NAMES = "host-names";
- private static final String PREF_SHOW_ON_ACTIVITY = "show-on-activity";
-
- public static final byte SAVE_EDITORS_NEVER = 0;
- public static final byte SAVE_EDITORS_PROMPT = 1;
- public static final byte SAVE_EDITORS_AUTO = 2;
-
- private static final int MAX_HOSTNAMES = 10;
-
- private Preferences preferences;
-
- /**
- * ServerUIPreference constructor comment.
- */
- public ServerUIPreferences() {
- super();
- preferences = ServerUIPlugin.getInstance().getPluginPreferences();
- }
-
- public void setDefaults() {
- preferences.setDefault(PREF_PROMPT_IRREVERSIBLE, getDefaultPromptBeforeIrreversibleChange());
- preferences.setDefault(PREF_SAVE_EDITORS, getDefaultSaveEditors());
- preferences.setDefault(PREF_HOST_NAMES, "localhost");
- preferences.setDefault(PREF_SHOW_ON_ACTIVITY, true);
- }
-
- /**
- * Returns whether the user should be prompted before making an
- * irreversible change in the editor.
- *
- * @return boolean
- */
- public boolean getPromptBeforeIrreversibleChange() {
- return preferences.getBoolean(PREF_PROMPT_IRREVERSIBLE);
- }
-
- /**
- * Returns the default value of whether the user should be prompted
- * before making an irreversible change in the editor.
- *
- * @return boolean
- */
- public boolean getDefaultPromptBeforeIrreversibleChange() {
- return true;
- }
-
- /**
- * Sets whether the user should be prompted before making an
- * irreversible change in the editor.
- *
- * @return boolean
- */
- public void setPromptBeforeIrreversibleChange(boolean b) {
- preferences.setValue(PREF_PROMPT_IRREVERSIBLE, b);
- ServerUIPlugin.getInstance().savePluginPreferences();
- }
-
- /**
- * Returns the import location.
- *
- * @return java.lang.String
- */
- public String getImportLocation() {
- return preferences.getString(PREF_IMPORT_LOCATION);
- }
-
- /**
- * Sets the import location.
- *
- * @return java.lang.String
- */
- public void setImportLocation(String s) {
- preferences.setValue(PREF_IMPORT_LOCATION, s);
- ServerUIPlugin.getInstance().savePluginPreferences();
- }
-
- /**
- * Returns the default setting for saving editors before launching.
- *
- * @return byte
- */
- public byte getDefaultSaveEditors() {
- return SAVE_EDITORS_PROMPT;
- }
-
- /**
- * Returns the setting for saving editors before launching.
- *
- * @return byte
- */
- public byte getSaveEditors() {
- return (byte) preferences.getInt(PREF_SAVE_EDITORS);
- }
-
- /**
- * Sets the value for saving editors before launching.
- *
- * @param b
- */
- public void setSaveEditors(byte b) {
- preferences.setValue(PREF_SAVE_EDITORS, b);
- ServerUIPlugin.getInstance().savePluginPreferences();
- }
-
- /**
- * Returns the default setting for opening the servers view on activity.
- *
- * @return boolean
- */
- public boolean getDefaultShowOnActivity() {
- return true;
- }
-
- /**
- * Returns the setting for opening the servers view on activity.
- *
- * @return boolean
- */
- public boolean getShowOnActivity() {
- return preferences.getBoolean(PREF_SHOW_ON_ACTIVITY);
- }
-
- /**
- * Sets the value for opening the servers view on activity.
- *
- * @param b
- */
- public void setShowOnActivity(boolean b) {
- preferences.setValue(PREF_SHOW_ON_ACTIVITY, b);
- ServerUIPlugin.getInstance().savePluginPreferences();
- }
-
- /**
- * Return the list of most recently used hostnames.
- *
- * @return the hostnames
- */
- public List getHostnames() {
- String s = preferences.getString(PREF_HOST_NAMES);
- StringTokenizer st = new StringTokenizer(s, "|*|");
- List list = new ArrayList();
- while (st.hasMoreTokens()) {
- list.add(st.nextToken());
- }
- return list;
- }
-
- /**
- * Add a new hostname to the most recently used list.
- *
- * @param hostname
- */
- public void addHostname(String hostname) {
- List list = getHostnames();
-
- // remove duplicates
- if (list.contains(hostname))
- list.remove(hostname);
-
- // always add second (leave localhost first)
- list.add(1, hostname);
-
- // remove least used hostname
- if (list.size() > MAX_HOSTNAMES)
- list.remove(list.size() - 1);
-
- StringBuffer sb = new StringBuffer();
- Iterator iterator = list.iterator();
- while (iterator.hasNext()) {
- String s = (String) iterator.next();
- sb.append(s);
- sb.append("|*|");
- }
- preferences.setValue(PREF_HOST_NAMES, sb.toString());
- ServerUIPlugin.getInstance().savePluginPreferences();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/StartServerJob.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/StartServerJob.java
deleted file mode 100644
index 8f2db5e..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/StartServerJob.java
+++ /dev/null
@@ -1,49 +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;
-
-import org.eclipse.core.runtime.*;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.internal.ServerSchedulingRule;
-/**
- *
- */
-public class StartServerJob extends Job {
- protected IServer server;
- protected String launchMode;
-
- public static void startServer(IServer server, String launchMode) {
- StartServerJob job = new StartServerJob(server, launchMode);
- //job.setUser(true);
- job.schedule();
- }
-
- public StartServerJob(IServer server, String launchMode) {
- super("Starting server");
- this.server = server;
- this.launchMode = launchMode;
- setRule(new ServerSchedulingRule(server));
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.internal.jobs.InternalJob#run(org.eclipse.core.runtime.IProgressMonitor)
- */
- protected IStatus run(IProgressMonitor monitor) {
- IStatus status = new Status(IStatus.OK, ServerUIPlugin.PLUGIN_ID, 0, "", null);
- try {
- server.synchronousStart(launchMode, monitor);
- } catch (CoreException ce) {
- return ce.getStatus();
- }
- return status;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/TerminationDialog.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/TerminationDialog.java
deleted file mode 100644
index d6be4cc..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/TerminationDialog.java
+++ /dev/null
@@ -1,78 +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.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
-/**
- * Dialog that prompts a user to see if a server should
- * be terminated.
- */
-public class TerminationDialog extends Dialog {
- protected String serverName;
-
- /**
- * TerminationDialog constructor comment.
- * @param parentShell org.eclipse.swt.widgets.Shell
- */
- public TerminationDialog(Shell parentShell, String serverName) {
- super(parentShell);
- this.serverName = serverName;
- setBlockOnOpen(true);
- }
-
- /**
- *
- */
- protected void configureShell(Shell newShell) {
- super.configureShell(newShell);
- newShell.setText(ServerUIPlugin.getResource("%terminateServerDialogTitle"));
- }
-
- /**
- * Creates and returns the contents of the upper part
- * of this dialog (above the button bar).
- *
- * @param parent the parent composite to contain the dialog area
- * @return the dialog area control
- */
- protected Control createDialogArea(Composite parent) {
- // create a composite with standard margins and spacing
- Composite composite = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
- layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
- layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
- layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
- composite.setFont(parent.getFont());
- PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, ContextIds.TERMINATE_SERVER_DIALOG);
-
- Label label = new Label(composite, SWT.WRAP);
- label.setText(ServerUIPlugin.getResource("%terminateServerDialogMessage", new String[] {serverName}));
- GridData data = new GridData();
- data.widthHint = 400;
- label.setLayoutData(data);
-
- Dialog.applyDialogFont(composite);
-
- return composite;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/Trace.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/Trace.java
deleted file mode 100644
index 2505023..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/Trace.java
+++ /dev/null
@@ -1,78 +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 java.text.SimpleDateFormat;
-import java.util.Date;
-/**
- * Helper class to route trace output.
- */
-public class Trace {
- public static byte CONFIG = 0;
- public static byte INFO = 1;
- public static byte WARNING = 2;
- public static byte SEVERE = 3;
- public static byte FINEST = 4;
- public static byte FINER = 5;
- public static byte PERFORMANCE = 6;
- public static byte EXTENSION_POINT = 7;
-
- protected static int pluginLength = -1;
-
- private static final String[] levelNames = new String[] {
- "CONFIG ", "INFO ", "WARNING", "SEVERE ", "FINER ", "FINEST ", "PERF ", "EXTENSION"};
- private static final String spacer = " ";
-
- private static final SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yy HH:mm.ss.SSS");
-
- /**
- * Trace constructor comment.
- */
- private Trace() {
- super();
- }
-
- /**
- * Trace the given text.
- *
- * @param s java.lang.String
- */
- public static void trace(byte level, String s) {
- trace(level, s, null);
- }
-
- /**
- * Trace the given message and exception.
- *
- * @param s java.lang.String
- * @param t java.lang.Throwable
- */
- public static void trace(byte level, String s, Throwable t) {
- if (!ServerUIPlugin.getInstance().isDebugging())
- return;
-
- String pluginId = ServerUIPlugin.PLUGIN_ID;
- StringBuffer sb = new StringBuffer(pluginId);
- if (pluginId.length() > pluginLength)
- pluginLength = pluginId.length();
- else if (pluginId.length() < pluginLength)
- sb.append(spacer.substring(0, pluginLength - pluginId.length()));
- sb.append(" ");
- sb.append(levelNames[level]);
- sb.append(" ");
- sb.append(sdf.format(new Date()));
- sb.append(" ");
- sb.append(s);
- System.out.println(sb.toString());
- if (t != null)
- t.printStackTrace();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/AbstractServerActionDelegate.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/AbstractServerActionDelegate.java
deleted file mode 100644
index bd9e040..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/AbstractServerActionDelegate.java
+++ /dev/null
@@ -1,86 +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.actions;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.ui.internal.EclipseUtil;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IActionDelegate;
-/**
- *
- */
-public abstract class AbstractServerActionDelegate implements IActionDelegate {
- protected List servers;
-
- /**
- * Return true if this server can currently be acted on.
- *
- * @return boolean
- * @param server org.eclipse.wst.server.core.IServer
- */
- public abstract boolean accept(IServer server);
-
- /**
- * Perform action on this server.
- * @param server org.eclipse.wst.server.core.IServer
- */
- public abstract void perform(Shell shell, IServer server);
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- Shell shell = EclipseUtil.getShell();
- Iterator iterator = servers.iterator();
- Object obj = iterator.next();
- if (obj instanceof IServer) {
- IServer server = (IServer) obj;
- if (accept(server))
- perform(shell, server);
- selectionChanged(action, new StructuredSelection(servers));
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- servers = new ArrayList();
- if (selection.isEmpty() || !(selection instanceof StructuredSelection)) {
- action.setEnabled(false);
- return;
- }
-
- boolean enabled = false;
- Iterator iterator = ((StructuredSelection) selection).iterator();
- while (iterator.hasNext()) {
- Object obj = iterator.next();
- if (obj instanceof IServer) {
- IServer server = (IServer) obj;
- if (accept(server)) {
- servers.add(server);
- enabled = true;
- }
- } else {
- action.setEnabled(false);
- return;
- }
- }
- action.setEnabled(enabled);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/DebugOnServerActionDelegate.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/DebugOnServerActionDelegate.java
deleted file mode 100644
index d811e87..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/DebugOnServerActionDelegate.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.actions;
-
-import org.eclipse.debug.core.ILaunchManager;
-/**
- *
- */
-public class DebugOnServerActionDelegate extends RunOnServerActionDelegate {
- /**
- * Returns the start mode that the server should use.
- */
- protected String getLaunchMode() {
- return ILaunchManager.DEBUG_MODE;
- }
-}
\ 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
deleted file mode 100644
index 8ad4573..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/DeleteActionDelegate.java
+++ /dev/null
@@ -1,89 +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.actions;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-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;
-/**
- *
- */
-public class DeleteActionDelegate implements IWorkbenchWindowActionDelegate {
- protected IServer[] servers;
- protected Shell shell;
-
- /**
- * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose()
- */
- public void dispose() {
- // do nothing
- }
-
- /**
- * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(IWorkbenchWindow)
- */
- public void init(IWorkbenchWindow window) {
- if (window != null)
- shell = window.getShell();
- }
-
- /**
- * @see org.eclipse.ui.IActionDelegate#run(IAction)
- */
- public void run(IAction action) {
- if (action != null && action.isEnabled() && servers != null)
- return;
- DeleteAction delete = new DeleteAction(shell, servers);
- delete.run();
- }
-
- /**
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(IAction, ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- servers = null;
- if (selection == null || selection.isEmpty() || !(selection instanceof IStructuredSelection)) {
- action.setEnabled(false);
- return;
- }
-
- IStructuredSelection select = (IStructuredSelection) selection;
- Iterator iterator = select.iterator();
-
- List list = new ArrayList();
-
- while (iterator.hasNext()) {
- 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;
- }
- }
-
- servers = new IServer[list.size()];
- list.toArray(servers);
- action.setEnabled(true);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/ModifyModulesAction.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/ModifyModulesAction.java
deleted file mode 100644
index 62c1514..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/ModifyModulesAction.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.actions;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.*;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.ServerUtil;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-import org.eclipse.wst.server.ui.internal.wizard.ClosableWizardDialog;
-import org.eclipse.wst.server.ui.internal.wizard.ModifyModulesWizard;
-/**
- * Action to modify the modules of a server.
- */
-public class ModifyModulesAction implements IObjectActionDelegate {
- protected IWorkbenchPart part;
- protected IServer server;
-
- /**
- * ModifyModulesAction constructor comment.
- */
- public ModifyModulesAction() {
- super();
- }
-
- /*
- * Notifies this action delegate that the selection in the workbench has changed.
- */
- public void selectionChanged(IAction action, ISelection selection) {
- server = null;
-
- if (selection instanceof IStructuredSelection) {
- IStructuredSelection sel = (IStructuredSelection) selection;
- Object obj = sel.getFirstElement();
- if (obj instanceof IServer)
- server = (IServer) obj;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, org.eclipse.ui.IWorkbenchPart)
- */
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- part = targetPart;
- }
-
- /*
- * Performs this action.
- */
- public void run(IAction action) {
- if (server == null)
- return;
-
- Shell shell = part.getSite().getShell();
- //if (!ServerUIUtil.promptIfDirty(shell, server))
- // return;
-
- // check if there are any projects first
- // get currently deployed modules
- List deployed = new ArrayList();
- List modules = new ArrayList();
- IModule[] currentModules = server.getModules();
- if (currentModules != null) {
- int size = currentModules.length;
- for (int i = 0; i < size; i++) {
- deployed.add(currentModules[i]);
- }
- }
-
- // get remaining modules
- IModule[] modules2 = ServerUtil.getModules(server.getServerType().getRuntimeType().getModuleTypes());
- if (modules != null) {
- int size = modules2.length;
- for (int i = 0; i < size; i++) {
- IModule module = modules2[i];
- if (!deployed.contains(module)) {
- IStatus status = server.canModifyModules(new IModule[] { module }, null, null);
- if (status != null && status.getSeverity() != IStatus.ERROR)
- modules.add(module);
- }
- }
- }
-
- if (deployed.isEmpty() && modules.isEmpty()) {
- MessageDialog.openInformation(shell, ServerUIPlugin.getResource("%defaultDialogTitle"), ServerUIPlugin.getResource("%dialogAddRemoveModulesNone"));
- return;
- }
-
- ModifyModulesWizard wizard = new ModifyModulesWizard(server);
- ClosableWizardDialog dialog = new ClosableWizardDialog(shell, wizard);
- dialog.open();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/NewServerAction.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/NewServerAction.java
deleted file mode 100644
index 9b264d2..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/NewServerAction.java
+++ /dev/null
@@ -1,44 +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.actions;
-
-import org.eclipse.jface.action.IAction;
-
-import org.eclipse.wst.server.ui.internal.wizard.ClosableWizardDialog;
-import org.eclipse.wst.server.ui.internal.wizard.NewServerWizard;
-/**
- * Action to create a new server.
- */
-public class NewServerAction extends NewWizardAction {
- /**
- * NewServerAction constructor comment.
- */
- public NewServerAction() {
- super();
- }
-
- /**
- * Performs this action.
- * <p>
- * This method is called when the delegating action has been triggered.
- * Implement this method to do the actual work.
- * </p>
- *
- * @param action the action proxy that handles the presentation portion of the
- * action
- */
- public void run(IAction action) {
- NewServerWizard wizard = new NewServerWizard();
- wizard.init(workbench, selection);
- ClosableWizardDialog dialog = new ClosableWizardDialog(workbench.getActiveWorkbenchWindow().getShell(), wizard);
- dialog.open();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/NewWizardAction.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/NewWizardAction.java
deleted file mode 100644
index afcf36f..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/NewWizardAction.java
+++ /dev/null
@@ -1,66 +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.actions;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-/**
- * Action to create a new server element through a wizard.
- */
-public abstract class NewWizardAction implements IWorkbenchWindowActionDelegate {
- protected IWorkbench workbench;
- protected IStructuredSelection selection;
-
- /**
- * NewWizardAction constructor comment.
- */
- public NewWizardAction() {
- super();
- }
-
- /**
- * Disposes this action delegate. The implementor should unhook any references
- * to itself so that garbage collection can occur.
- */
- public void dispose() {
- // do nothing
- }
-
- /**
- * Initializes this action delegate with the workbench window it will work in.
- *
- * @param window the window that provides the context for this delegate
- */
- public void init(IWorkbenchWindow window) {
- workbench = window.getWorkbench();
- }
-
- /**
- * Notifies this action delegate that the selection in the workbench has changed.
- * <p>
- * Implementers can use this opportunity to change the availability of the
- * action or to modify other presentation properties.
- * </p>
- *
- * @param action the action proxy that handles presentation portion of the action
- * @param sel the current selection in the workbench
- */
- public void selectionChanged(IAction action, ISelection sel) {
- if (sel instanceof IStructuredSelection)
- selection = (IStructuredSelection) sel;
- else
- selection = null;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/ProfileOnServerActionDelegate.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/ProfileOnServerActionDelegate.java
deleted file mode 100644
index 129a0ae..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/ProfileOnServerActionDelegate.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.actions;
-
-import org.eclipse.debug.core.ILaunchManager;
-/**
- *
- */
-public class ProfileOnServerActionDelegate extends RunOnServerActionDelegate {
- /**
- * Returns the start mode that the server should use.
- */
- protected String getLaunchMode() {
- return ILaunchManager.PROFILE_MODE;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/RestartProjectActionDelegate.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/RestartProjectActionDelegate.java
deleted file mode 100644
index 5991be0..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/RestartProjectActionDelegate.java
+++ /dev/null
@@ -1,143 +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.actions;
-
-import java.util.Iterator;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.ServerUtil;
-import org.eclipse.wst.server.ui.internal.EclipseUtil;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-import org.eclipse.wst.server.ui.internal.Trace;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IActionDelegate;
-/**
- * Action delegate for restarting a project within a running
- * server.
- */
-public class RestartProjectActionDelegate implements IActionDelegate {
- protected IProject project;
-
- /**
- * RestartProjectAction constructor comment.
- */
- public RestartProjectActionDelegate() {
- super();
- }
-
- /**
- * Performs this action.
- * <p>
- * This method is called when the delegating action has been triggered.
- * Implement this method to do the actual work.
- * </p>
- *
- * @param action the action proxy that handles the presentation portion of the
- * action
- */
- public void run(IAction action) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- Shell shell = EclipseUtil.getShell();
- MessageDialog dialog = new MessageDialog(shell, ServerUIPlugin.getResource("%defaultDialogTitle"), null, ServerUIPlugin.getResource("%dialogRestartingProject", project.getName()), MessageDialog.INFORMATION, new String[0], 0);
- dialog.setBlockOnOpen(false);
- dialog.open();
-
- IModule[] modules = ServerUtil.getModules(project);
- if (modules != null && modules.length > 0) {
- IModule module = modules[0];
- IServer[] servers = ServerUtil.getServersByModule(module, null);
- if (servers != null) {
- int size2 = servers.length;
- for (int j = 0; j < size2; j++) {
- int state = servers[j].getServerState();
- if (state == IServer.STATE_STARTED) {
- if (servers[j].canRestartModule(module).isOK()) {
- try {
- servers[j].restartModule(module, new NullProgressMonitor());
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error restarting project", e);
- }
- }
- }
- }
- }
- }
- dialog.close();
- }
- });
- }
-
- /**
- * Notifies this action delegate that the selection in the workbench has changed.
- * <p>
- * Implementers can use this opportunity to change the availability of the
- * action or to modify other presentation properties.
- * </p>
- *
- * @param action the action proxy that handles presentation portion of the action
- * @param sel the current selection in the workbench
- */
- public void selectionChanged(IAction action, ISelection sel) {
- if (sel.isEmpty() || !(sel instanceof IStructuredSelection)) {
- action.setEnabled(false);
- return;
- }
-
- IStructuredSelection select = (IStructuredSelection) sel;
- Iterator iterator = select.iterator();
- Object selection = iterator.next();
- if (iterator.hasNext() || selection == null) {
- // more than one selection (should never happen)
- action.setEnabled(false);
- return;
- }
-
- if (!(selection instanceof IProject)) {
- action.setEnabled(false);
- return;
- }
-
- project = (IProject) selection;
- if (!project.isOpen()) {
- action.setEnabled(false);
- return;
- }
-
- IModule[] modules = ServerUtil.getModules(project);
- if (modules != null && modules.length > 0) {
- IModule module = modules[0];
- IServer[] servers = ServerUtil.getServersByModule(module, null);
- if (servers != null) {
- int size2 = servers.length;
- for (int j = 0; j < size2; j++) {
- int state = servers[j].getServerState();
- if (state == IServer.STATE_STARTED) {
- if (servers[j].canRestartModule(module).isOK()) {
- action.setEnabled(true);
- return;
- }
- }
- }
- }
- }
-
- action.setEnabled(false);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/RunOnServerActionDelegate.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/RunOnServerActionDelegate.java
deleted file mode 100644
index f382e17..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/RunOnServerActionDelegate.java
+++ /dev/null
@@ -1,477 +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.actions;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.*;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.wst.server.core.*;
-import org.eclipse.wst.server.core.internal.IClient;
-import org.eclipse.wst.server.core.internal.ILaunchableAdapter;
-import org.eclipse.wst.server.core.internal.PublishServerJob;
-import org.eclipse.wst.server.core.internal.ServerPlugin;
-import org.eclipse.wst.server.ui.internal.*;
-import org.eclipse.wst.server.ui.internal.wizard.*;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-/**
- * Support for starting/stopping server and clients for resources running on a server.
- */
-public class RunOnServerActionDelegate implements IWorkbenchWindowActionDelegate {
- protected static final String[] launchModes = {
- ILaunchManager.RUN_MODE, ILaunchManager.DEBUG_MODE, ILaunchManager.PROFILE_MODE };
-
- protected Object selection;
-
- protected IWorkbenchWindow window;
-
- protected static Object globalSelection;
-
- protected static Map globalLaunchMode;
-
- protected boolean tasksRun;
-
- /**
- * RunOnServerActionDelegate constructor comment.
- */
- public RunOnServerActionDelegate() {
- super();
- }
-
- /**
- * Disposes this action delegate. The implementor should unhook any references
- * to itself so that garbage collection can occur.
- */
- public void dispose() {
- window = null;
- }
-
- /**
- * Initializes this action delegate with the workbench window it will work in.
- *
- * @param newWindow the window that provides the context for this delegate
- */
- public void init(IWorkbenchWindow newWindow) {
- window = newWindow;
- }
-
- public IServer getServer(IModule module, String launchMode, IProgressMonitor monitor) {
- IServer server = null;
- IProject project = module.getProject();
- if (project != null)
- server = ServerCore.getProjectProperties(project).getDefaultServer();
-
- // ignore preference if the server doesn't support this mode.
- if (server != null && !ServerUIPlugin.isCompatibleWithLaunchMode(server, launchMode))
- server = null;
-
- if (server != null && !ServerUtil.containsModule(server, module, monitor)) {
- IServerWorkingCopy wc = server.createWorkingCopy();
- try {
- ServerUtil.modifyModules(wc, new IModule[] { module }, new IModule[0], monitor);
- wc.save(false, monitor);
- } catch (CoreException ce) {
- Trace.trace(Trace.SEVERE, "Could not add module to server", ce);
- server = null;
- }
- }
-
- Shell shell;
- if (window != null)
- shell = window.getShell();
- else
- shell = ServerUIPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow().getShell();
-
- if (server == null) {
- // try the full wizard
- RunOnServerWizard wizard = new RunOnServerWizard(module, launchMode);
- ClosableWizardDialog dialog = new ClosableWizardDialog(shell, wizard);
- if (dialog.open() == Window.CANCEL) {
- monitor.setCanceled(true);
- return null;
- }
-
- // TODO - this can't be called until the wizard's job finishes!!
- server = wizard.getServer();
- boolean preferred = wizard.isPreferredServer();
- tasksRun = true;
-
- // set preferred server if requested
- if (server != null && preferred && project != null) {
- try {
- ServerCore.getProjectProperties(project).setDefaultServer(server, monitor);
- } catch (CoreException ce) {
- String message = ServerUIPlugin.getResource("%errorCouldNotSavePreference");
- ErrorDialog.openError(shell, ServerUIPlugin.getResource("%errorDialogTitle"), message, ce.getStatus());
- }
- }
- }
- return server;
- }
-
- /**
- * Run the resource on a server.
- *
- * @param monitor org.eclipse.core.runtime.IProgressMonitor
- */
- protected void run(IProgressMonitor monitor) {
- String launchMode = getLaunchMode();
- IModuleArtifact moduleArtifact = ServerPlugin.loadModuleArtifact(selection);
-
- Shell shell;
- if (window != null)
- shell = window.getShell();
- else
- shell = ServerUIPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow().getShell();
-
- if (moduleArtifact == null) {
- EclipseUtil.openError(ServerUIPlugin.getResource("%errorNoModules"));
- Trace.trace(Trace.FINEST, "No modules");
- return;
- }
- IModule module = moduleArtifact.getModule();
-
- // check for servers with the given start mode
- IServer[] servers = ServerCore.getServers();
- boolean found = false;
- if (servers != null) {
- int size = servers.length;
- for (int i = 0; i < size && !found; i++) {
- if (ServerUIPlugin.isCompatibleWithLaunchMode(servers[i], launchMode)) {
- try {
- IModule[] parents = servers[i].getRootModules(module, monitor);
- if (parents != null && parents.length > 0)
- found = true;
- } catch (Exception e) {
- // ignore
- }
- }
- }
- }
-
- if (!found) {
- // no existing server supports the project and start mode!
- // check if there might be another one that can be created
- IServerType[] serverTypes = ServerCore.getServerTypes();
- boolean found2 = false;
- if (serverTypes != null) {
- int size = serverTypes.length;
- for (int i = 0; i < size && !found2; i++) {
- IServerType type = serverTypes[i];
- IModuleType[] moduleTypes = type.getRuntimeType().getModuleTypes();
- if (type.supportsLaunchMode(launchMode) && ServerUtil.isSupportedModule(moduleTypes, module.getModuleType())) {
- found2 = true;
- }
- }
- }
- if (!found2) {
- EclipseUtil.openError(ServerUIPlugin.getResource("%errorNoServer"));
- Trace.trace(Trace.FINEST, "No server for start mode");
- return;
- }
- }
-
- if (!ServerUIPlugin.saveEditors())
- return;
-
- tasksRun = false;
- IServer server = getServer(module, launchMode, monitor);
- if (monitor.isCanceled())
- return;
-
- Trace.trace(Trace.FINEST, "Server: " + server);
-
- if (server == null) {
- EclipseUtil.openError(ServerUIPlugin.getResource("%errorNoServer"));
- Trace.trace(Trace.SEVERE, "No server found");
- return;
- }
-
- if (!ServerUIPlugin.promptIfDirty(shell, server))
- return;
-
- if (!tasksRun) {
- SelectTasksWizard wizard = new SelectTasksWizard(server);
- wizard.addPages();
- if (wizard.hasTasks() && wizard.hasOptionalTasks()) {
- WizardDialog dialog = new WizardDialog(shell, wizard);
- if (dialog.open() == Window.CANCEL)
- return;
- } else
- wizard.performFinish();
- }
-
- // get the launchable adapter and module object
- ILaunchableAdapter launchableAdapter = null;
- ILaunchable launchable = null;
- ILaunchableAdapter[] adapters = ServerPlugin.getLaunchableAdapters();
- if (adapters != null) {
- int size2 = adapters.length;
- for (int j = 0; j < size2; j++) {
- ILaunchableAdapter adapter = adapters[j];
- try {
- ILaunchable launchable2 = adapter.getLaunchable(server, moduleArtifact);
- Trace.trace(Trace.FINEST, "adapter= " + adapter + ", launchable= " + launchable2);
- if (launchable2 != null) {
- launchableAdapter = adapter;
- launchable = launchable2;
- }
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error in launchable adapter", e);
- }
- }
- }
-
- IClient[] clients = new IClient[0];
- if (launchable != null)
- clients = getClients(server, launchable, launchMode);
-
- Trace.trace(Trace.FINEST, "Launchable clients: " + clients);
-
- IClient client = null;
- if (clients == null || clients.length == 0) {
- EclipseUtil.openError(ServerUIPlugin.getResource("%errorNoClient"));
- Trace.trace(Trace.SEVERE, "No launchable clients!");
- return;
- } else if (clients.length == 1) {
- client = clients[0];
- } else {
- SelectClientWizard wizard = new SelectClientWizard(clients);
- ClosableWizardDialog dialog = new ClosableWizardDialog(shell, wizard);
- dialog.open();
- client = wizard.getSelectedClient();
- if (client == null)
- return;
- }
-
- Trace.trace(Trace.FINEST, "Ready to launch");
-
- // start server if it's not already started
- // and cue the client to start
- int state = server.getServerState();
- if (state == IServer.STATE_STARTING) {
- LaunchClientJob.launchClient(server, module, launchMode, moduleArtifact, launchableAdapter, client);
- } else if (state == IServer.STATE_STARTED) {
- boolean restart = false;
- String mode = server.getMode();
- if (!ILaunchManager.DEBUG_MODE.equals(mode) && ILaunchManager.DEBUG_MODE.equals(launchMode)) {
- int result = openWarningDialog(shell, ServerUIPlugin.getResource("%dialogModeWarningDebug"));
- if (result == 1)
- launchMode = mode;
- else if (result == 0)
- restart = true;
- else
- return;
- } else if (!ILaunchManager.PROFILE_MODE.equals(mode) && ILaunchManager.PROFILE_MODE.equals(launchMode)) {
- int result = openWarningDialog(shell, ServerUIPlugin.getResource("%dialogModeWarningProfile"));
- if (result == 1)
- launchMode = mode;
- else if (result == 0)
- restart = true;
- else
- return;
- }
- if (restart)
- RestartServerJob.restartServer(server, launchMode);
-
- PublishServerJob publishJob = new PublishServerJob(server);
- publishJob.schedule();
- LaunchClientJob.launchClient(server, module, launchMode, moduleArtifact, launchableAdapter, client);
- } else if (state != IServer.STATE_STOPPING) {
- PublishServerJob publishJob = new PublishServerJob(server);
- publishJob.schedule();
- StartServerJob.startServer(server, launchMode);
- LaunchClientJob.launchClient(server, module, launchMode, moduleArtifact, launchableAdapter, client);
- }
- }
-
- /**
- * Returns the launchable clients for the given server and launchable
- * object.
- *
- * @param server org.eclipse.wst.server.core.IServer
- * @param launchable
- * @param launchMode String
- * @return an array of clients
- */
- public static IClient[] getClients(IServer server, ILaunchable launchable, String launchMode) {
- ArrayList list = new ArrayList();
- IClient[] clients = ServerPlugin.getClients();
- if (clients != null) {
- int size = clients.length;
- for (int i = 0; i < size; i++) {
- Trace.trace(Trace.FINEST, "client= " + clients[i]);
- if (clients[i].supports(server, launchable, launchMode))
- list.add(clients[i]);
- }
- }
-
- IClient[] clients2 = new IClient[list.size()];
- list.toArray(clients2);
- return clients2;
- }
-
- /**
- * Open a message dialog.
- *
- * @param shell
- * @param message
- * @return a dialog return constant
- */
- protected int openWarningDialog(Shell shell, String message) {
- MessageDialog dialog = new MessageDialog(shell, ServerUIPlugin.getResource("%errorDialogTitle"), null,
- message, MessageDialog.WARNING, new String[] {ServerUIPlugin.getResource("%dialogModeWarningRestart"),
- ServerUIPlugin.getResource("%dialogModeWarningContinue"), IDialogConstants.CANCEL_LABEL}, 0);
- return dialog.open();
- }
-
- /**
- * The delegating action has been performed. Implement
- * this method to do the actual work.
- *
- * @param action action proxy that handles the presentation
- * portion of the plugin action
- */
- public void run(IAction action) {
- Trace.trace(Trace.FINEST, "Running on Server...");
- try {
- run(new NullProgressMonitor());
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Run on Server Error", e);
- }
- }
-
- protected boolean isEnabled() {
- try {
- Boolean b = (Boolean) globalLaunchMode.get(getLaunchMode());
- return b.booleanValue();
- } catch (Exception e) {
- // ignore
- }
- return false;
- }
-
- /**
- * Returns the start mode that the server should use.
- */
- protected String getLaunchMode() {
- return ILaunchManager.RUN_MODE;
- }
-
- /**
- * Determine which clients can act on the current selection.
- *
- * @param action action proxy that handles presentation
- * portion of the plugin action
- * @param sel current selection in the desktop
- */
- public void selectionChanged(IAction action, ISelection sel) {
- Trace.trace(Trace.FINEST, "> selectionChanged");
- selection = null;
- long time = System.currentTimeMillis();
- if (sel == null || sel.isEmpty() || !(sel instanceof IStructuredSelection)) {
- action.setEnabled(false);
- globalSelection = null;
- return;
- }
-
- IStructuredSelection select = (IStructuredSelection) sel;
- Iterator iterator = select.iterator();
- selection = iterator.next();
- if (iterator.hasNext()) { // more than one selection (should never happen)
- action.setEnabled(false);
- selection = null;
- globalSelection = null;
- return;
- }
-
- if (selection != globalSelection) {
- Trace.trace(Trace.FINEST, "Selection: " + selection);
- if (selection != null)
- Trace.trace(Trace.FINEST, "Selection type: " + selection.getClass().getName());
- globalSelection = selection;
- globalLaunchMode = new HashMap();
- if (!ServerPlugin.hasModuleArtifact(globalSelection)) {
- action.setEnabled(false);
- return;
- }
-
- Trace.trace(Trace.FINEST, "checking for module artifact");
- IModuleArtifact moduleArtifact = ServerPlugin.getModuleArtifact(globalSelection);
- IModule module = null;
- if (moduleArtifact != null)
- module = moduleArtifact.getModule();
- Trace.trace(Trace.FINEST, "moduleArtifact= " + moduleArtifact + ", module= " + module);
- if (module != null)
- findGlobalLaunchModes(module);
- else {
- globalLaunchMode.put(ILaunchManager.RUN_MODE, new Boolean(true));
- globalLaunchMode.put(ILaunchManager.DEBUG_MODE, new Boolean(true));
- globalLaunchMode.put(ILaunchManager.PROFILE_MODE, new Boolean(true));
- }
- }
-
- action.setEnabled(isEnabled());
- Trace.trace(Trace.FINEST, "< selectionChanged " + (System.currentTimeMillis() - time));
- }
-
- /**
- * Determines whether there is a server factory available for the given module
- * and the various start modes.
- */
- protected void findGlobalLaunchModes(IModule module) {
- IServerType[] serverTypes = ServerCore.getServerTypes();
- if (serverTypes != null) {
- int size = serverTypes.length;
- for (int i = 0; i < size; i++) {
- IServerType type = serverTypes[i];
- if (isValidServerType(type, module)) {
- for (byte b = 0; b < launchModes.length; b++) {
- if (type.supportsLaunchMode(launchModes[b])) {
- globalLaunchMode.put(launchModes[b], new Boolean(true));
- }
- }
- }
- }
- }
- }
-
- /**
- * Returns true if the given server type can launch the module.
- */
- protected boolean isValidServerType(IServerType type, IModule module) {
- try {
- IRuntimeType runtimeType = type.getRuntimeType();
- ServerUtil.isSupportedModule(runtimeType.getModuleTypes(), module.getModuleType());
- } catch (Exception e) {
- return false;
- }
- return true;
- }
-
- protected boolean supportsLaunchMode(IServer server, String launchMode) {
- return server.getServerType().supportsLaunchMode(launchMode);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/command/ServerCommand.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/command/ServerCommand.java
deleted file mode 100644
index 3e9d4e5..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/command/ServerCommand.java
+++ /dev/null
@@ -1,43 +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.command;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.wst.server.core.IServerWorkingCopy;
-import org.eclipse.wst.server.core.util.Task;
-/**
- * A command on a server.
- */
-public abstract class ServerCommand extends Task {
- protected IServerWorkingCopy server;
-
- /**
- * ServerCommand constructor comment.
- */
- public ServerCommand(IServerWorkingCopy server) {
- super();
- this.server = server;
- }
-
- /**
- * Returns true if this command can be undone.
- * @return boolean
- */
- public boolean canUndo() {
- return true;
- }
-
- public abstract boolean execute();
-
- public void execute(IProgressMonitor monitor) {
- execute();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/command/SetServerAutoPublishDefaultCommand.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/command/SetServerAutoPublishDefaultCommand.java
deleted file mode 100644
index ec16b46..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/command/SetServerAutoPublishDefaultCommand.java
+++ /dev/null
@@ -1,65 +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.command;
-
-import org.eclipse.wst.server.core.IServerWorkingCopy;
-import org.eclipse.wst.server.core.internal.ServerWorkingCopy;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-/**
- * Command to change the server's auto-publish setting.
- */
-public class SetServerAutoPublishDefaultCommand extends ServerCommand {
- protected boolean time;
- protected boolean oldTime;
-
- /**
- * SetServerAutoPublishDefaultCommand constructor comment.
- */
- public SetServerAutoPublishDefaultCommand(IServerWorkingCopy server, boolean time) {
- super(server);
- this.time = time;
- }
-
- /**
- * Execute the command.
- * @return boolean
- */
- public boolean execute() {
- ServerWorkingCopy swc = (ServerWorkingCopy) server;
- oldTime = swc.getAutoPublishDefault();
- swc.setAutoPublishDefault(time);
- return true;
- }
-
- /**
- * Returns this command's description.
- * @return java.lang.String
- */
- public String getDescription() {
- return ServerUIPlugin.getResource("%serverEditorOverviewAutoPublishDescription");
- }
-
- /**
- * Returns this command's label.
- * @return java.lang.String
- */
- public String getName() {
- return ServerUIPlugin.getResource("%serverEditorOverviewAutoPublishCommand");
- }
-
- /**
- * Undo the command.
- */
- public void undo() {
- ServerWorkingCopy swc = (ServerWorkingCopy) server;
- swc.setAutoPublishDefault(oldTime);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/command/SetServerAutoPublishTimeCommand.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/command/SetServerAutoPublishTimeCommand.java
deleted file mode 100644
index e252bab..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/command/SetServerAutoPublishTimeCommand.java
+++ /dev/null
@@ -1,65 +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.command;
-
-import org.eclipse.wst.server.core.IServerWorkingCopy;
-import org.eclipse.wst.server.core.internal.ServerWorkingCopy;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-/**
- * Command to change the server's auto-publish setting.
- */
-public class SetServerAutoPublishTimeCommand extends ServerCommand {
- protected int time;
- protected int oldTime;
-
- /**
- * SetServerAutoPublishDefaultCommand constructor comment.
- */
- public SetServerAutoPublishTimeCommand(IServerWorkingCopy server, int time) {
- super(server);
- this.time = time;
- }
-
- /**
- * Execute the command.
- * @return boolean
- */
- public boolean execute() {
- ServerWorkingCopy swc = (ServerWorkingCopy) server;
- oldTime = swc.getAutoPublishTime();
- swc.setAutoPublishTime(time);
- return true;
- }
-
- /**
- * Returns this command's description.
- * @return java.lang.String
- */
- public String getDescription() {
- return ServerUIPlugin.getResource("%serverEditorOverviewAutoPublishDescription");
- }
-
- /**
- * Returns this command's label.
- * @return java.lang.String
- */
- public String getName() {
- return ServerUIPlugin.getResource("%serverEditorOverviewAutoPublishCommand");
- }
-
- /**
- * Undo the command.
- */
- public void undo() {
- ServerWorkingCopy swc = (ServerWorkingCopy) server;
- swc.setAutoPublishTime(oldTime);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/command/SetServerHostnameCommand.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/command/SetServerHostnameCommand.java
deleted file mode 100644
index aa2baa4..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/command/SetServerHostnameCommand.java
+++ /dev/null
@@ -1,62 +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.command;
-
-import org.eclipse.wst.server.core.IServerWorkingCopy;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-/**
- * Command to change the server hostname.
- */
-public class SetServerHostnameCommand extends ServerCommand {
- protected String name;
- protected String oldName;
-
- /**
- * SetServerHostnameCommand constructor comment.
- */
- public SetServerHostnameCommand(IServerWorkingCopy server, String name) {
- super(server);
- this.name = name;
- }
-
- /**
- * Execute the command.
- * @return boolean
- */
- public boolean execute() {
- oldName = server.getHost();
- server.setHost(name);
- return true;
- }
-
- /**
- * Returns this command's description.
- * @return java.lang.String
- */
- public String getDescription() {
- return ServerUIPlugin.getResource("%serverEditorOverviewServerHostnameDescription");
- }
-
- /**
- * Returns this command's label.
- * @return java.lang.String
- */
- public String getName() {
- return ServerUIPlugin.getResource("%serverEditorOverviewServerHostnameCommand");
- }
-
- /**
- * Undo the command.
- */
- public void undo() {
- server.setHost(oldName);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/command/SetServerNameCommand.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/command/SetServerNameCommand.java
deleted file mode 100644
index 396bfcd..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/command/SetServerNameCommand.java
+++ /dev/null
@@ -1,62 +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.command;
-
-import org.eclipse.wst.server.core.IServerWorkingCopy;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-/**
- * Command to change the server name.
- */
-public class SetServerNameCommand extends ServerCommand {
- protected String name;
- protected String oldName;
-
- /**
- * SetServerNameCommand constructor comment.
- */
- public SetServerNameCommand(IServerWorkingCopy server, String name) {
- super(server);
- this.name = name;
- }
-
- /**
- * Execute the command.
- * @return boolean
- */
- public boolean execute() {
- oldName = server.getName();
- server.setName(name);
- return true;
- }
-
- /**
- * Returns this command's description.
- * @return java.lang.String
- */
- public String getDescription() {
- return ServerUIPlugin.getResource("%serverEditorOverviewServerNameDescription");
- }
-
- /**
- * Returns this command's label.
- * @return java.lang.String
- */
- public String getName() {
- return ServerUIPlugin.getResource("%serverEditorOverviewServerNameCommand");
- }
-
- /**
- * Undo the command.
- */
- public void undo() {
- server.setName(oldName);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/command/SetServerRuntimeCommand.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/command/SetServerRuntimeCommand.java
deleted file mode 100644
index 9a02e8a..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/command/SetServerRuntimeCommand.java
+++ /dev/null
@@ -1,63 +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.command;
-
-import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.IServerWorkingCopy;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-/**
- * Command to change the server runtime.
- */
-public class SetServerRuntimeCommand extends ServerCommand {
- protected IRuntime runtime;
- protected IRuntime oldRuntime;
-
- /**
- * SetServerRuntimeCommand constructor comment.
- */
- public SetServerRuntimeCommand(IServerWorkingCopy server, IRuntime runtime) {
- super(server);
- this.runtime = runtime;
- }
-
- /**
- * Execute the command.
- * @return boolean
- */
- public boolean execute() {
- oldRuntime = server.getRuntime();
- server.setRuntime(runtime);
- return true;
- }
-
- /**
- * Returns this command's description.
- * @return java.lang.String
- */
- public String getDescription() {
- return ServerUIPlugin.getResource("%serverEditorOverviewRuntimeDescription");
- }
-
- /**
- * Returns this command's label.
- * @return java.lang.String
- */
- public String getName() {
- return ServerUIPlugin.getResource("%serverEditorOverviewRuntimeCommand");
- }
-
- /**
- * Undo the command.
- */
- public void undo() {
- server.setRuntime(oldRuntime);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/GlobalCommandManager.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/GlobalCommandManager.java
deleted file mode 100644
index 47f988d..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/GlobalCommandManager.java
+++ /dev/null
@@ -1,663 +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.editor;
-
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.io.File;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.wst.server.core.*;
-import org.eclipse.wst.server.ui.editor.ICommandManager;
-import org.eclipse.wst.server.ui.editor.IServerEditorPartInput;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-import org.eclipse.wst.server.ui.internal.Trace;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-/**
- *
- */
-public class GlobalCommandManager {
- // maximum number of commands in the history
- private static final int MAX_HISTORY = 200;
-
- class ServerResourceCommand {
- ITask command;
- String id;
- }
-
- // commands in the undo history
- protected List undoList = new ArrayList();
-
- // commands in the redo history
- protected List redoList = new ArrayList();
-
- class CommandManagerInfo {
- // number of open editors on this resource
- int count;
-
- // true if the resource has not been saved since
- // the last change
- boolean isDirty;
-
- // true if the resource is read-only
- boolean isReadOnly;
-
- // true if all changes can be undone, false if
- // a non-reversable change has been made
- boolean canCompletelyUndo = true;
-
- // the element id
- String id;
-
- // the working copy
- IServerWorkingCopy wc;
-
- // files and timestamps
- Map fileMap;
-
- int timestamp;
- }
-
- protected Map commandManagers = new HashMap();
-
- // property change listeners
- protected List propertyListeners;
- public static final String PROP_DIRTY = "dirtyState";
- public static final String PROP_UNDO = "undoAction";
- public static final String PROP_REDO = "redoAction";
- public static final String PROP_RELOAD = "reload";
-
- protected static GlobalCommandManager instance;
-
- public static GlobalCommandManager getInstance() {
- if (instance == null)
- instance = new GlobalCommandManager();
- return instance;
- }
-
- /**
- * Add a property change listener to this instance.
- *
- * @param listener java.beans.PropertyChangeListener
- */
- public void addPropertyChangeListener(PropertyChangeListener listener) {
- if (propertyListeners == null)
- propertyListeners = new ArrayList();
- propertyListeners.add(listener);
- }
-
- /**
- * Remove a property change listener from this instance.
- *
- * @param listener java.beans.PropertyChangeListener
- */
- public void removePropertyChangeListener(PropertyChangeListener listener) {
- if (propertyListeners != null)
- propertyListeners.remove(listener);
- }
-
- /**
- * Fire a property change event.
- */
- protected void firePropertyChangeEvent(String propertyName, Object oldValue, Object newValue) {
- if (propertyListeners == null)
- return;
-
- PropertyChangeEvent event = new PropertyChangeEvent(this, propertyName, oldValue, newValue);
- //Trace.trace("Firing: " + event + " " + oldValue);
- try {
- int size = propertyListeners.size();
- PropertyChangeListener[] pcl = new PropertyChangeListener[size];
- propertyListeners.toArray(pcl);
-
- for (int i = 0; i < size; i++)
- try {
- pcl[i].propertyChange(event);
- } catch (Exception e) {
- // ignore
- }
- } catch (Exception e) {
- // ignore
- }
- }
-
- /**
- *
- */
- public void getCommandManager(String id) {
- Trace.trace(Trace.FINEST, "Getting command manager for " + id);
- try {
- CommandManagerInfo info = (CommandManagerInfo) commandManagers.get(id);
- if (info != null) {
- info.count ++;
- return;
- }
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Could not find existing command manager", e);
- }
- Trace.trace(Trace.FINEST, "Creating new command manager for " + id);
- try {
- CommandManagerInfo info = new CommandManagerInfo();
- info.count = 1;
- info.id = id;
- IServer server = null;
- if (id != null)
- server = ServerCore.findServer(id);
- if (server != null)
- info.wc = server.createWorkingCopy();
- info.isDirty = false;
- info.isReadOnly = false;
- commandManagers.put(id, info);
- updateTimestamps(id);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not obtain command manager", e);
- }
- return;
- }
-
- /**
- *
- */
- public void releaseCommandManager(String id) {
- Trace.trace(Trace.FINEST, "Releasing command manager for " + id);
- try {
- CommandManagerInfo info = (CommandManagerInfo) commandManagers.get(id);
- if (info != null) {
- info.count --;
- if (info.count == 0) {
- commandManagers.remove(id);
- clearUndoList(id);
- clearRedoList(id);
- }
- }
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not release command manager", e);
- }
- }
-
- /**
- *
- */
- public void reload(String id, IProgressMonitor monitor) {
- try {
- CommandManagerInfo info = getExistingCommandManagerInfo(id);
- if (info != null) {
- IServer server = null;
- if (id != null)
- server = ServerCore.findServer(id);
- if (server != null)
- info.wc = server.createWorkingCopy();
- //info.serverElement = ServerCore.getResourceManager().getServer()
- //info.serverElement = ServerCore.getEditManager().reloadEditModel(info.file, monitor);
- firePropertyChangeEvent(PROP_RELOAD, id, null);
- }
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not release command manager", e);
- }
- }
-
- /**
- *
- */
- protected CommandManagerInfo getExistingCommandManagerInfo(String id) {
- try {
- return (CommandManagerInfo) commandManagers.get(id);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not find existing command manager info");
- }
- return null;
- }
-
- /**
- * Returns true if there is only one command manager.
- */
- public boolean isOnlyCommandManager(String id) {
- CommandManagerInfo info = getExistingCommandManagerInfo(id);
- return (info != null && info.count == 1);
- }
-
- protected IServerEditorPartInput getPartInput(String serverId, ICommandManager serverCommandManager) {
- CommandManagerInfo serverInfo = null;
- IServerWorkingCopy server = null;
- boolean serverReadOnly = false;
- if (serverId != null) {
- serverInfo = getExistingCommandManagerInfo(serverId);
- if (serverInfo == null)
- return null;
-
- server = serverInfo.wc;
- serverReadOnly = serverInfo.isReadOnly;
- }
-
- return new ServerEditorPartInput(serverCommandManager, server, serverReadOnly);
- }
-
- /**
- *
- */
- protected IServerWorkingCopy getServerResource(String id) {
- CommandManagerInfo info = getExistingCommandManagerInfo(id);
- if (info == null)
- return null;
-
- return info.wc;
- }
-
- /**
- * Execute the given command and place it in the undo stack.
- * If the command cannot be undone, the user will be notifed
- * before it is executed.
- *
- * @param command ICommand
- */
- public void executeCommand(String id, ITask command) {
- if (!command.canUndo() && !undoList.isEmpty() && ServerUIPlugin.getPreferences().getPromptBeforeIrreversibleChange()) {
- try {
- Display d = Display.getCurrent();
- if (d == null)
- d = Display.getDefault();
-
- Shell shell = d.getActiveShell();
- if (!MessageDialog.openConfirm(shell, ServerUIPlugin.getResource("%editorServerEditor"), ServerUIPlugin.getResource("%editorPromptIrreversible")))
- return;
- } catch (Exception e) {
- // ignore
- }
- }
-
- ServerResourceCommand src = new ServerResourceCommand();
- src.id = id;
- src.command = command;
-
- try {
- command.execute(new NullProgressMonitor());
- } catch (CoreException ce) {
- return;
- }
-
- CommandManagerInfo info = getExistingCommandManagerInfo(id);
- if (info == null)
- return;
-
- if (command.canUndo())
- addToUndoList(src);
- else {
- info.canCompletelyUndo = false;
- clearUndoList(id);
- }
-
- // clear redo list since a new command has been executed.
- clearRedoList(id);
-
- setDirtyState(id, true);
- }
-
- /**
- * Add a command to the history.
- */
- private void addToUndoList(ServerResourceCommand src) {
- undoList.add(src);
-
- // limit history growth
- if (undoList.size() > MAX_HISTORY)
- undoList.remove(0);
-
- firePropertyChangeEvent(PROP_UNDO, src.id, null);
- }
-
- /**
- * Clears the undo of a particular resource.
- */
- private void clearUndoList(String id) {
- int i = 0;
- boolean modified = false;
- while (i < undoList.size()) {
- ServerResourceCommand src = (ServerResourceCommand) undoList.get(i);
- if (src.id.equals(id)) {
- modified = true;
- undoList.remove(i);
- } else
- i++;
- }
- if (modified)
- firePropertyChangeEvent(PROP_UNDO, id, null);
- }
-
- /**
- * Clears the redo of a particular resource.
- */
- private void clearRedoList(String id) {
- int i = 0;
- boolean modified = false;
- while (i < redoList.size()) {
- ServerResourceCommand src = (ServerResourceCommand) redoList.get(i);
- if (src.id.equals(id)) {
- redoList.remove(i);
- modified = true;
- } else
- i++;
- }
- if (modified)
- firePropertyChangeEvent(PROP_REDO, id, null);
- }
-
- /**
- * Returns true if there is a command that can be undone.
- * @return boolean
- */
- protected boolean canUndo(String a, String b) {
- Iterator iterator = undoList.iterator();
- while (iterator.hasNext()) {
- ServerResourceCommand src = (ServerResourceCommand) iterator.next();
- if (src.id == a || src.id == b)
- return true;
- }
- return false;
- }
-
- /**
- * Returns true if there is a command that can be redone.
- * @return boolean
- */
- protected boolean canRedo(String a, String b) {
- Iterator iterator = redoList.iterator();
- while (iterator.hasNext()) {
- ServerResourceCommand src = (ServerResourceCommand) iterator.next();
- if (src.id == a || src.id == b)
- return true;
- }
- return false;
- }
-
- /**
- * Returns the command that would be undone next.
- *
- * @return org.eclipse.wst.server.ui.editor.ICommand
- */
- public ITask getUndoCommand(String a) {
- int size = undoList.size();
- for (int i = size - 1; i >= 0; i--) {
- ServerResourceCommand src = (ServerResourceCommand) undoList.get(i);
- if (src.id == a)
- return src.command;
- }
- return null;
- }
-
- /**
- * Returns the command that would be redone next.
- *
- * @return org.eclipse.wst.server.ui.editor.ICommand
- */
- public ITask getRedoCommand(String a) {
- int size = redoList.size();
- for (int i = size - 1; i >= 0; i--) {
- ServerResourceCommand src = (ServerResourceCommand) redoList.get(i);
- if (src.id == a)
- return src.command;
- }
- return null;
- }
-
- /**
- * Returns true if the server resource is "dirty".
- *
- * @return boolean
- */
- public boolean isDirty(String id) {
- CommandManagerInfo info = getExistingCommandManagerInfo(id);
- if (info == null)
- return false;
-
- return info.isDirty;
- }
-
- /**
- * Returns true if the server resource is read-only.
- *
- * @return boolean
- */
- public boolean isReadOnly(String id) {
- CommandManagerInfo info = getExistingCommandManagerInfo(id);
- if (info == null)
- return false;
- return info.isReadOnly;
- }
-
- /**
- * Returns the server resource read-only flag.
- */
- public void setReadOnly(String id, boolean readOnly) {
- CommandManagerInfo info = getExistingCommandManagerInfo(id);
- if (info == null)
- return;
-
- if (info.isReadOnly == readOnly)
- return;
- info.isReadOnly = readOnly;
- firePropertyChangeEvent(PROP_RELOAD, id, null);
- }
-
- /**
- * Returns true if the server resource files are read-only.
- *
- * @return boolean
- */
- public boolean areFilesReadOnly(String id) {
- CommandManagerInfo info = getExistingCommandManagerInfo(id);
- if (info == null)
- return false;
- return (getReadOnlyFiles(id).length > 0);
- }
-
- /**
- * Sets the dirty state and fires an event if needed.
- * @param dirty boolean
- */
- private void setDirtyState(String id, boolean dirty) {
- CommandManagerInfo info = getExistingCommandManagerInfo(id);
- if (info.isDirty == dirty)
- return;
-
- info.isDirty = dirty;
- firePropertyChangeEvent(PROP_DIRTY, id, null);
- }
-
- /**
- * Undo the last command.
- */
- protected void undo(String a) {
- ServerResourceCommand src = null;
- Iterator iterator = undoList.iterator();
- while (iterator.hasNext()) {
- ServerResourceCommand src2 = (ServerResourceCommand) iterator.next();
- if (src2.id == a)
- src = src2;
- }
- if (src == null)
- return;
-
- src.command.undo();
- undoList.remove(src);
- firePropertyChangeEvent(PROP_UNDO, src.id, null);
- redoList.add(src);
- firePropertyChangeEvent(PROP_REDO, src.id, null);
-
- CommandManagerInfo info = getExistingCommandManagerInfo(src.id);
- if (info.canCompletelyUndo && getUndoCommand(src.id) == null)
- setDirtyState(src.id, false);
- }
-
- /**
- * Redo the last command.
- */
- protected void redo(String a) {
- ServerResourceCommand src = null;
- Iterator iterator = redoList.iterator();
- while (iterator.hasNext()) {
- ServerResourceCommand src2 = (ServerResourceCommand) iterator.next();
- if (src2.id == a)
- src = src2;
- }
- if (src == null)
- return;
-
- try {
- src.command.execute(new NullProgressMonitor());
- } catch (CoreException ce) {
- return;
- }
- redoList.remove(src);
- firePropertyChangeEvent(PROP_REDO, src.id, null);
- undoList.add(src);
- firePropertyChangeEvent(PROP_UNDO, src.id, null);
-
- setDirtyState(src.id, true);
- }
-
- /**
- * Clears the history list.
- */
- public void resourceSaved(String id) {
- CommandManagerInfo info = getExistingCommandManagerInfo(id);
- //clearUndoList(resource);
- //clearRedoList(resource);
- info.canCompletelyUndo = true;
- setDirtyState(id, false);
- }
-
- /**
- *
- */
- public static IFile[] getReadOnlyFiles(IServerAttributes server) {
- try {
- List list = new ArrayList();
- IFile file = server.getFile();
-
- if (file != null)
- list.add(file);
-
- //if ()
- //IServerConfiguration config = (IServerConfiguration) element;
- // TODO: get read-only files
- IFile[] files = new IFile[list.size()];
- list.toArray(files);
- return files;
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "getReadOnlyFiles", e);
- }
- return null;
- }
-
- /**
- *
- */
- protected IFile[] getServerResourceFiles(String id) {
- if (id == null)
- return new IFile[0];
-
- CommandManagerInfo info = getExistingCommandManagerInfo(id);
- if (info == null)
- return new IFile[0];
-
- return getReadOnlyFiles(info.wc);
- }
-
- protected IFile[] getReadOnlyFiles(String id) {
- List list = new ArrayList();
- IFile[] files = getServerResourceFiles(id);
- int size = files.length;
- for (int i = 0; i < size; i++) {
- if (files[i].isReadOnly())
- list.add(files[i]);
- }
-
- IFile[] fileList = new IFile[list.size()];
- list.toArray(fileList);
- return fileList;
- }
-
- /**
- *
- */
- public void updateTimestamps(String id) {
- CommandManagerInfo info = getExistingCommandManagerInfo(id);
- if (info == null)
- return;
-
- info.fileMap = new HashMap();
- IFile[] files = getServerResourceFiles(id);
- if (files != null) {
- int size = files.length;
-
- for (int i = 0; i < size; i++) {
- if (files[i] != null) {
- File f = files[i].getLocation().toFile();
- if (f != null) {
- long time = f.lastModified();
- info.fileMap.put(files[i], new Long(time));
- }
- }
- }
- }
- info.timestamp = getTimestamp(info);
- }
-
- protected static int getTimestamp(CommandManagerInfo info) {
- IServer server = info.wc.getOriginal();
-
- if (server != null)
- return server.getTimestamp();
- return -1;
- }
-
- /**
- *
- */
- protected boolean hasChanged(String id) {
- CommandManagerInfo info = getExistingCommandManagerInfo(id);
- if (info == null)
- return false;
- IFile[] files = getServerResourceFiles(id);
- int size = files.length;
-
- int count = 0;
- for (int i = 0; i < size; i++) {
- count++;
- File f = files[i].getLocation().toFile();
- try {
- Long time = (Long) info.fileMap.get(files[i]);
- if (time.longValue() != f.lastModified())
- return true;
- } catch (Exception e) {
- return true;
- }
- }
-
- int timestamp = getTimestamp(info);
- if (info.timestamp != timestamp)
- return true;
-
- if (count != info.fileMap.size())
- return true;
- return false;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/IServerEditorActionFactory.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/IServerEditorActionFactory.java
deleted file mode 100644
index e5ebe3a..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/IServerEditorActionFactory.java
+++ /dev/null
@@ -1,53 +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.editor;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.ui.IEditorSite;
-
-import org.eclipse.wst.server.core.IServerWorkingCopy;
-import org.eclipse.wst.server.ui.editor.IOrdered;
-import org.eclipse.wst.server.ui.editor.IServerEditorPartInput;
-/**
- *
- */
-public interface IServerEditorActionFactory extends IOrdered {
- /**
- *
- */
- public String getId();
-
- /**
- *
- */
- public String getName();
-
- /**
- * Returns true if the given server resource type (given by the
- * id) can be opened with this editor. This result is based on
- * the result of the getFactoryIds() method.
- *
- * @return boolean
- */
- public boolean supportsServerElementType(String id);
-
- /**
- * Returns true if this editor page should be visible with the given server.
- * This allows (for instance) complex configuration pages to only be shown when used
- * with non-unittest servers.
- */
- public boolean shouldDisplay(IServerWorkingCopy server);
-
- /**
- * Create the action.
- */
- public IAction createAction(IEditorSite site, IServerEditorPartInput input);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/IServerEditorInput.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/IServerEditorInput.java
deleted file mode 100644
index 3badd8a..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/IServerEditorInput.java
+++ /dev/null
@@ -1,33 +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.editor;
-
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-import org.eclipse.ui.IEditorInput;
-/**
- * This is the editor input for the server and server
- * configuration editor. The input includes both a server
- * and server configuration.
- *
- * <p>This interface is not intended to be implemented by clients.</p>
- *
- * @since 1.0
- */
-public interface IServerEditorInput extends IEditorInput {
- public static final String EDITOR_ID = ServerUIPlugin.PLUGIN_ID + ".editor";
-
- /**
- * Returns the server id.
- *
- * @return java.lang.String
- */
- public String getServerId();
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/IServerEditorPageSectionFactory.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/IServerEditorPageSectionFactory.java
deleted file mode 100644
index 109eb6e..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/IServerEditorPageSectionFactory.java
+++ /dev/null
@@ -1,47 +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.editor;
-
-import org.eclipse.wst.server.core.IServerWorkingCopy;
-import org.eclipse.wst.server.ui.editor.IOrdered;
-import org.eclipse.wst.server.ui.editor.IServerEditorSection;
-/**
- *
- */
-public interface IServerEditorPageSectionFactory extends IOrdered {
- /**
- *
- */
- public String getId();
-
- /**
- * Returns true if the given server resource type (given by the
- * id) can be opened with this editor. This result is based on
- * the result of the types attribute.
- *
- * @return boolean
- */
- public boolean supportsType(String id);
-
- public String getInsertionId();
-
- /**
- * Returns true if this editor page section should be visible with the given server.
- * This allows (for instance) complex configuration pages to only be shown when used
- * with non-unittest servers.
- */
- public boolean shouldCreateSection(IServerWorkingCopy server);
-
- /**
- * Create the editor page section.
- */
- public IServerEditorSection createSection();
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/IServerEditorPartFactory.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/IServerEditorPartFactory.java
deleted file mode 100644
index 64d4247..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/IServerEditorPartFactory.java
+++ /dev/null
@@ -1,53 +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.editor;
-
-import org.eclipse.ui.IEditorPart;
-
-import org.eclipse.wst.server.core.IServerWorkingCopy;
-import org.eclipse.wst.server.ui.editor.IOrdered;
-/**
- *
- */
-public interface IServerEditorPartFactory extends IOrdered {
- /**
- *
- */
- public String getId();
-
- /**
- *
- */
- public String getName();
-
- /**
- * Returns true if the given server resource type (given by the
- * id) can be opened with this editor. This result is based on
- * the result of the types attribute.
- *
- * @return boolean
- */
- public boolean supportsType(String id);
-
- public boolean supportsInsertionId(String id);
-
- /**
- * Returns true if this editor page should be visible with the given server.
- * This allows (for instance) complex configuration pages to only be shown when used
- * with non-unittest servers.
- */
- public boolean shouldCreatePage(IServerWorkingCopy server);
-
- /**
- * Create the editor page.
- */
- public IEditorPart createPage();
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/OverviewEditorFactory.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/OverviewEditorFactory.java
deleted file mode 100644
index a112335..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/OverviewEditorFactory.java
+++ /dev/null
@@ -1,26 +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.editor;
-
-import org.eclipse.ui.IEditorPart;
-
-import org.eclipse.wst.server.ui.editor.ServerEditorPartFactoryDelegate;
-/**
- *
- */
-public class OverviewEditorFactory extends ServerEditorPartFactoryDelegate {
- /*
- * @see ServerEditorPartFactoryDelegate#createPage()
- */
- public IEditorPart createPage() {
- return new OverviewEditorPart();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/OverviewEditorPart.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/OverviewEditorPart.java
deleted file mode 100644
index 69e8205..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/OverviewEditorPart.java
+++ /dev/null
@@ -1,395 +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.editor;
-
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.*;
-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.Label;
-import org.eclipse.swt.widgets.Spinner;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.forms.FormColors;
-import org.eclipse.ui.forms.widgets.*;
-import org.eclipse.wst.server.core.*;
-import org.eclipse.wst.server.core.internal.Server;
-import org.eclipse.wst.server.core.util.SocketUtil;
-import org.eclipse.wst.server.ui.editor.*;
-import org.eclipse.wst.server.ui.internal.ContextIds;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-import org.eclipse.wst.server.ui.internal.command.*;
-/**
- * Server general editor page.
- */
-public class OverviewEditorPart extends ServerEditorPart {
- protected Text serverName;
- protected Label serverConfigurationName;
- protected Text hostname;
- protected Combo runtimeCombo;
- protected Button autoPublishDefault;
- protected Button autoPublishOverride;
- protected Spinner autoPublishTime;
-
- protected boolean updating;
-
- protected IRuntime[] runtimes;
-
- protected PropertyChangeListener listener;
-
- /**
- * OverviewEditorPart constructor comment.
- */
- protected OverviewEditorPart() {
- super();
- }
-
- protected ICommandManager getCommandManager() {
- return commandManager;
- }
-
- /**
- *
- */
- protected void addChangeListener() {
- listener = new PropertyChangeListener() {
- public void propertyChange(PropertyChangeEvent event) {
- if (updating)
- return;
- updating = true;
- if (event.getPropertyName().equals("name"))
- updateNames();
- else if (event.getPropertyName().equals("hostname") && hostname != null) {
- hostname.setText((String) event.getNewValue());
- } else if (event.getPropertyName().equals("runtime-id")) {
- String runtimeId = (String) event.getNewValue();
- IRuntime runtime = null;
- if (runtimeId != null)
- runtime = ServerCore.findRuntime(runtimeId);
- int size = runtimes.length;
- for (int i = 0; i < size; i++) {
- if (runtimes[i].equals(runtime))
- runtimeCombo.select(i);
- }
- }
- updating = false;
- }
- };
- if (server != null)
- server.addPropertyChangeListener(listener);
- }
-
- protected void updateNames() {
- if (serverName != null)
- serverName.setText(server.getName());
- }
-
- /**
- * Creates the SWT controls for this workbench part.
- *
- * @param parent the parent control
- */
- public final void createPartControl(Composite parent) {
- FormToolkit toolkit = getFormToolkit(parent.getDisplay());
-
- ScrolledForm form = toolkit.createScrolledForm(parent);
- form.setText(ServerUIPlugin.getResource("%serverEditorOverviewPageTitle"));
- form.getBody().setLayout(new GridLayout());
-
- Composite columnComp = toolkit.createComposite(form.getBody());
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- //layout.marginHeight = 10;
- //layout.marginWidth = 10;
- layout.verticalSpacing = 0;
- layout.horizontalSpacing = 10;
- columnComp.setLayout(layout);
- columnComp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL));
-
- // left column
- Composite leftColumnComp = toolkit.createComposite(columnComp);
- layout = new GridLayout();
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- layout.verticalSpacing = 10;
- layout.horizontalSpacing = 0;
- leftColumnComp.setLayout(layout);
- leftColumnComp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL));
-
- Section section = toolkit.createSection(leftColumnComp, ExpandableComposite.TWISTIE|ExpandableComposite.EXPANDED | ExpandableComposite.TITLE_BAR | Section.DESCRIPTION | ExpandableComposite.FOCUS_TITLE);
- section.setText(ServerUIPlugin.getResource("%serverEditorOverviewSection"));
- section.setDescription(ServerUIPlugin.getResource("%serverEditorOverviewDescription"));
- section.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL));
-
- Composite composite = toolkit.createComposite(section);
- layout = new GridLayout();
- layout.numColumns = 2;
- layout.marginHeight = 5;
- layout.marginWidth = 10;
- layout.verticalSpacing = 5;
- layout.horizontalSpacing = 15;
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL));
- PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, ContextIds.EDITOR_OVERVIEW_PAGE);
- toolkit.paintBordersFor(composite);
- section.setClient(composite);
-
- // server name
- if (server != null) {
- createLabel(toolkit, composite, ServerUIPlugin.getResource("%serverEditorOverviewServerName"));
-
- serverName = toolkit.createText(composite, server.getName());
- GridData data = new GridData(GridData.FILL_HORIZONTAL);
- serverName.setLayoutData(data);
- serverName.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- if (updating)
- return;
- updating = true;
- getCommandManager().executeCommand(new SetServerNameCommand(getServer(), serverName.getText()));
- updating = false;
- }
- });
- }
-
- // hostname
- if (server != null) {
- createLabel(toolkit, composite, ServerUIPlugin.getResource("%serverEditorOverviewServerHostname"));
-
- hostname = toolkit.createText(composite, server.getHost());
- GridData data = new GridData(GridData.FILL_HORIZONTAL);
- hostname.setLayoutData(data);
- hostname.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- if (updating)
- return;
- updating = true;
- getCommandManager().executeCommand(new SetServerHostnameCommand(getServer(), hostname.getText()));
- updating = false;
- }
- });
- }
-
- // runtime
- if (server != null && server.getServerType() != null && server.getServerType().hasRuntime()) {
- IRuntime runtime = server.getRuntime();
- createLabel(toolkit, composite, ServerUIPlugin.getResource("%serverEditorOverviewRuntime"));
-
- IRuntimeType runtimeType = server.getServerType().getRuntimeType();
- runtimes = ServerUIPlugin.getRuntimes(runtimeType);
-
- if (runtimes == null || runtimes.length == 0)
- toolkit.createLabel(composite, "");
- else if (runtimes.length == 1)
- toolkit.createLabel(composite, runtime.getName());
- else {
- runtimeCombo = new Combo(composite, SWT.READ_ONLY);
- GridData data = new GridData(GridData.FILL_HORIZONTAL);
- runtimeCombo.setLayoutData(data);
- updateRuntimeCombo();
-
- int size = runtimes.length;
- for (int i = 0; i < size; i++) {
- if (runtimes[i].equals(runtime))
- runtimeCombo.select(i);
- }
-
- runtimeCombo.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- try {
- if (updating)
- return;
- updating = true;
- IRuntime newRuntime = runtimes[runtimeCombo.getSelectionIndex()];
- getCommandManager().executeCommand(new SetServerRuntimeCommand(getServer(), newRuntime));
- updating = false;
- } catch (Exception ex) {
- // ignore
- }
- }
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
- });
- }
- }
-
- // server configuration path
- if (server != null && server.getServerType().hasServerConfiguration()) {
- createLabel(toolkit, composite, ServerUIPlugin.getResource("%serverEditorOverviewServerConfigurationPath"));
-
- IFolder folder = server.getServerConfiguration();
- if (folder == null)
- serverConfigurationName = toolkit.createLabel(composite, ServerUIPlugin.getResource("%elementUnknownName"));
- else
- serverConfigurationName = toolkit.createLabel(composite, "" + server.getServerConfiguration().getFullPath());
- GridData data = new GridData(GridData.FILL_HORIZONTAL);
- serverConfigurationName.setLayoutData(data);
- }
-
- // auto-publish
- if (server != null) {
- //Label label = createLabel(toolkit, composite, ServerUIPlugin.getResource("%serverEditorOverviewServerHostname"));
- //label.
-
- autoPublishDefault = toolkit.createButton(composite, ServerUIPlugin.getResource("%serverEditorOverviewAutoPublishDefault"), SWT.RADIO);
- GridData data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 2;
- autoPublishDefault.setLayoutData(data);
- Server svr = (Server) server;
- autoPublishDefault.setSelection(svr.getAutoPublishDefault());
-
- autoPublishOverride = toolkit.createButton(composite, ServerUIPlugin.getResource("%serverEditorOverviewAutoPublishOverride"), SWT.RADIO);
- autoPublishOverride.setSelection(!svr.getAutoPublishDefault());
-
- autoPublishOverride.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- if (updating)
- return;
- updating = true;
- getCommandManager().executeCommand(new SetServerAutoPublishDefaultCommand(getServer(), autoPublishDefault.getSelection()));
- updating = false;
- autoPublishTime.setEnabled(autoPublishOverride.getSelection());
- }
- });
-
- //autoPublishTime = toolkit.createText(composite, svr.getAutoPublishTime() + "");
- autoPublishTime = new Spinner(composite, SWT.BORDER);
- autoPublishTime.setMinimum(0);
- autoPublishTime.setMaximum(120);
- autoPublishTime.setSelection(svr.getAutoPublishTime());
- data = new GridData(GridData.FILL_HORIZONTAL);
- autoPublishTime.setLayoutData(data);
- autoPublishTime.setEnabled(autoPublishOverride.getSelection());
- autoPublishTime.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- if (updating)
- return;
- updating = true;
- try {
- getCommandManager().executeCommand(new SetServerAutoPublishTimeCommand(getServer(), autoPublishTime.getSelection()));
- } catch (Exception ex) {
- // ignore
- }
- updating = false;
- }
- });
- }
-
- insertSections(leftColumnComp, "org.eclipse.wst.server.editor.overview.left");
-
- // right column
- Composite rightColumnComp = toolkit.createComposite(columnComp);
- layout = new GridLayout();
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- layout.verticalSpacing = 10;
- layout.horizontalSpacing = 0;
- rightColumnComp.setLayout(layout);
- rightColumnComp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL));
-
- insertSections(rightColumnComp, "org.eclipse.wst.server.editor.overview.right");
-
- form.setContent(columnComp);
- form.reflow(true);
-
- initialize();
- }
-
- protected void updateRuntimeCombo() {
- IRuntimeType runtimeType = server.getServerType().getRuntimeType();
- runtimes = ServerUIPlugin.getRuntimes(runtimeType);
-
- if (SocketUtil.isLocalhost(server.getHost()) && runtimes != null) {
- List runtimes2 = new ArrayList();
- int size = runtimes.length;
- for (int i = 0; i < size; i++) {
- IRuntime runtime2 = runtimes[i];
- if (!runtime2.isStub())
- runtimes2.add(runtime2);
- }
- runtimes = new IRuntime[runtimes2.size()];
- runtimes2.toArray(runtimes);
- }
-
- int size = runtimes.length;
- String[] items = new String[size];
- for (int i = 0; i < size; i++)
- items[i] = runtimes[i].getName();
-
- runtimeCombo.setItems(items);
- }
-
- protected Label createLabel(FormToolkit toolkit, Composite parent, String text) {
- Label label = toolkit.createLabel(parent, text);
- label.setForeground(toolkit.getColors().getColor(FormColors.TITLE));
- return label;
- }
-
- public void dispose() {
- super.dispose();
-
- if (server != null)
- server.removePropertyChangeListener(listener);
- }
-
- /* (non-Javadoc)
- * Initializes the editor part with a site and input.
- */
- public void init(IEditorSite site, IEditorInput input) {
- super.init(site, input);
-
- addChangeListener();
- initialize();
- }
-
- /**
- * Initialize the fields in this editor.
- */
- protected void initialize() {
- if (serverName == null)
- return;
- updating = true;
-
- if (server != null) {
- serverName.setText(server.getName());
- if (readOnly)
- serverName.setEditable(false);
- else
- serverName.setEditable(true);
- }
-
- updating = false;
- }
-
- //protected void validate() { }
-
- /*
- * @see IWorkbenchPart#setFocus()
- */
- public void setFocus() {
- if (serverName != null)
- serverName.setFocus();
- else if (serverConfigurationName != null)
- serverConfigurationName.setFocus();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/ServerEditor.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/ServerEditor.java
deleted file mode 100644
index 20cf3b1..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/ServerEditor.java
+++ /dev/null
@@ -1,920 +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.editor;
-
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.util.*;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.runtime.*;
-import org.eclipse.jface.action.*;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.ui.*;
-import org.eclipse.ui.part.MultiPageEditorPart;
-
-import org.eclipse.wst.server.core.*;
-import org.eclipse.wst.server.ui.ServerUICore;
-import org.eclipse.wst.server.ui.editor.*;
-import org.eclipse.wst.server.ui.internal.*;
-/**
- * A multi-page server resource editor.
- */
-public class ServerEditor extends MultiPageEditorPart {
- /**
- * Internal part and shell activation listener
- */
- class ActivationListener extends ShellAdapter implements IPartListener {
- private IWorkbenchPart fActivePart;
- private boolean fIsHandlingActivation = false;
-
- public void partActivated(IWorkbenchPart part) {
- fActivePart = part;
- handleActivation();
- }
-
- public void partBroughtToTop(IWorkbenchPart part) {
- // do nothing
- }
-
- public void partClosed(IWorkbenchPart part) {
- // do nothing
- }
-
- public void partDeactivated(IWorkbenchPart part) {
- fActivePart = null;
- }
-
- public void partOpened(IWorkbenchPart part) {
- // do nothing
- }
-
- public void shellActivated(ShellEvent e) {
- handleActivation();
- }
-
- private void handleActivation() {
- if (fIsHandlingActivation)
- return;
-
- if (fActivePart == ServerEditor.this) {
- fIsHandlingActivation = true;
- try {
- checkResourceState();
- } finally {
- fIsHandlingActivation= false;
- }
- }
- }
- }
-
- class LifecycleListener implements IServerLifecycleListener {
- public void serverAdded(IServer oldServer) {
- // do nothing
- }
- public void serverChanged(IServer oldServer) {
- // do nothing
- }
- public void serverRemoved(IServer oldServer) {
- if (oldServer.equals(server) && !isDirty())
- closeEditor();
- }
- }
-
- protected IServerWorkingCopy server;
- protected String serverId;
-
- protected GlobalCommandManager commandManager;
-
- protected PropertyChangeListener listener;
-
- protected IAction undoAction;
- protected IAction redoAction;
-
- protected TextAction cutAction;
- protected TextAction copyAction;
- protected TextAction pasteAction;
- protected boolean updatingActions;
-
- protected IAction[] editorActions;
-
- protected java.util.List serverPages;
-
- // on focus change flag
- protected boolean resourceDeleted;
-
- // input given to the contained pages
- protected IServerEditorPartInput editorPartInput;
-
- // status line and status
- protected IStatusLineManager status;
- protected StatusLineContributionItem statusItem;
-
- private ActivationListener activationListener = new ActivationListener();
- protected LifecycleListener resourceListener;
-
- // Used for disabling resource change check when saving through editor.
- protected boolean isSaving = false;
-
- /**
- * ServerEditor constructor comment.
- */
- public ServerEditor() {
- super();
-
- ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages();
-
- undoAction = new Action() {
- public void run() {
- getCommandManager().undo(serverId);
- }
- };
- undoAction.setEnabled(false);
- undoAction.setImageDescriptor(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_UNDO));
- //undoAction.setHoverImageDescriptor(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_UNDO_HOVER));
- //undoAction.setDisabledImageDescriptor(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_UNDO_DISABLED));
-
- redoAction = new Action() {
- public void run() {
- getCommandManager().redo(serverId);
- }
- };
- redoAction.setEnabled(false);
- redoAction.setImageDescriptor(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_REDO));
- //redoAction.setHoverImageDescriptor(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_REDO_HOVER));
- //redoAction.setDisabledImageDescriptor(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_REDO_DISABLED));
- }
-
- /**
- * Close the editor correctly.
- */
- protected void closeEditor() {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- getEditorSite().getPage().closeEditor(ServerEditor.this, false);
- }
- });
- }
-
- protected void createActions() {
- List actionList = new ArrayList();
-
- // add server actions
- if (server != null && server.getServerType() != null) {
- Iterator iterator = ServerEditorCore.getServerEditorActionFactories().iterator();
- String id = server.getServerType().getId();
- while (iterator.hasNext()) {
- ServerEditorActionFactory factory = (ServerEditorActionFactory) iterator.next();
- if (factory.supportsServerElementType(id) && factory.shouldDisplay(server))
- actionList.add(factory.createAction(getEditorSite(), editorPartInput));
- }
- }
-
- editorActions = new IAction[actionList.size()];
- actionList.toArray(editorActions);
- }
-
- /**
- * Creates the pages of this multi-page editor.
- * <p>
- * Subclasses of <code>MultiPageEditor</code> must implement this method.
- * </p>
- */
- protected void createPages() {
- try {
- int index = 0;
- serverPages = new ArrayList();
-
- // add editor pages
- int pageCount = 0;
-
- String serverTypeId = null;
- if (server != null && server.getServerType() != null)
- serverTypeId = server.getServerType().getId();
-
- Iterator iterator = ServerEditorCore.getServerEditorPageFactories().iterator();
- while (iterator.hasNext()) {
- IServerEditorPartFactory factory = (IServerEditorPartFactory) iterator.next();
- if (serverTypeId != null && factory.supportsType(serverTypeId) && factory.shouldCreatePage(server)) {
- Trace.trace(Trace.FINEST, "Adding page: " + factory.getId() + " " + editorPartInput);
- try {
- IEditorPart page = factory.createPage();
- if (page instanceof ServerEditorPart) {
- ServerEditorPart srep = (ServerEditorPart) page;
- srep.setPageFactory(factory);
- }
- index = addPage(page, editorPartInput);
- serverPages.add(page);
-
- setPageText(index, factory.getName());
-
- pageCount ++;
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not display editor page " + factory.getId(), e);
- }
- }
- }
-
- setActivePage(0);
-
- // register for events that might change the cut/copy/paste actions
- int count = getPageCount();
- for (int i = 0; i < count; i++) {
- Control control = getControl(i);
- registerEvents(control);
- }
- updateActions();
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error creating server editor pages", e);
- }
- }
-
- public void dispose() {
- if (activationListener != null) {
- IWorkbenchWindow window = getSite().getWorkbenchWindow();
- window.getPartService().removePartListener(activationListener);
- Shell shell = window.getShell();
- if (shell != null && !shell.isDisposed())
- shell.removeShellListener(activationListener);
- activationListener = null;
- }
-
- if (resourceListener != null)
- ServerCore.removeServerLifecycleListener(resourceListener);
-
- super.dispose();
- if (commandManager != null)
- commandManager.removePropertyChangeListener(listener);
-
- if (serverId != null)
- commandManager.releaseCommandManager(serverId);
- }
-
- /* (non-Javadoc)
- * Saves the contents of this editor.
- * <p>
- * Subclasses must override this method to implement the open-save-close lifecycle
- * for an editor. For greater details, see <code>IEditorPart</code>
- * </p>
- *
- * @see IEditorPart
- */
- public void doSave(IProgressMonitor monitor) {
- // Set the isSaving flag to true.
- isSaving = true;
-
- // check pages for errors first
- java.util.List errors = new ArrayList();
- Iterator iterator = serverPages.iterator();
- int count = 0;
- while (iterator.hasNext()) {
- IEditorPart part = (IEditorPart) iterator.next();
- if (part instanceof ServerEditorPart) {
- IStatus[] status2 = ((ServerEditorPart) part).getSaveStatus();
- if (status2 != null) {
- int size = status2.length;
- for (int i = 0; i < size; i++)
- errors.add("[" + getPageText(count) + "] " + status2[i].getMessage());
- }
- }
- count ++;
- }
- if (!errors.isEmpty()) {
- StringBuffer sb = new StringBuffer();
- sb.append(ServerUIPlugin.getResource("%errorEditorCantSave") + "\n");
- iterator = errors.iterator();
- while (iterator.hasNext())
- sb.append("\t" + ((String) iterator.next()) + "\n");
-
- EclipseUtil.openError(getEditorSite().getShell(), sb.toString());
- monitor.setCanceled(true);
- // Reset the isSaving flag.
- isSaving = false;
- return;
- }
-
- try {
- monitor = ProgressUtil.getMonitorFor(monitor);
- int ticks = 2000;
- String name = "";
- if (server != null)
- name = server.getName();
- monitor.beginTask(ServerUIPlugin.getResource("%savingTask", name), ticks);
- if (server != null)
- ticks /= 2;
-
- if (server != null) {
- server.save(false, ProgressUtil.getSubMonitorFor(monitor, ticks));
- getCommandManager().resourceSaved(serverId);
- commandManager.updateTimestamps(serverId);
- }
-
- ILabelProvider labelProvider = ServerUICore.getLabelProvider();
- if (server != null)
- setPartName(labelProvider.getText(server));
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error saving from configuration editor", e);
-
- monitor.setCanceled(true);
-
- String title = ServerUIPlugin.getResource("%editorSaveErrorDialog");
- String message = ServerUIPlugin.getResource("%editorSaveErrorMessage", e.getLocalizedMessage());
- MessageDialog.openError(getEditorSite().getShell(), title, message);
- } finally {
- monitor.done();
- }
- // Reset the isSaving flag.
- isSaving = false;
- }
-
- /* (non-Javadoc)
- * Saves the contents of this editor to another object.
- * <p>
- * Subclasses must override this method to implement the open-save-close lifecycle
- * for an editor. For greater details, see <code>IEditorPart</code>
- * </p>
- *
- * @see IEditorPart
- */
- public void doSaveAs() {
- // do nothing
- }
-
- /**
- * Fire a property change event.
- *
- * @param i int
- */
- protected void firePropertyChange(int i) {
- if (i == ServerEditorPart.PROP_ERROR)
- updateStatusError();
- super.firePropertyChange(i);
- }
-
- /**
- *
- */
- public GlobalCommandManager getCommandManager() {
- return commandManager;
- }
-
- /**
- * Return the redo action.
- *
- * @return org.eclipse.jface.action.Action
- */
- public IAction getRedoAction() {
- return redoAction;
- }
-
- /**
- * Return the undo action.
- *
- * @return org.eclipse.jface.action.Action
- */
- public IAction getUndoAction() {
- return undoAction;
- }
-
- /* (non-Javadoc)
- * Sets the cursor and selection state for this editor to the passage defined
- * by the given marker.
- * <p>
- * Subclasses may override. For greater details, see <code>IEditorPart</code>
- * </p>
- *
- * @see IEditorPart
- */
- public void gotoMarker(IMarker marker) {
- // do nothing
- }
-
- /**
- * Update the cut, copy, and paste actions.
- */
- public void updateActionsImpl() {
- if (updatingActions)
- return;
-
- updatingActions = true;
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- updatingActions = false;
- updateActions();
- }
- });
- }
-
- /**
- * Update the cut, copy, and paste actions.
- */
- public void updateActions() {
- cutAction.update();
- copyAction.update();
- pasteAction.update();
- }
-
- /**
- * Update the cut, copy, and paste actions.
- */
- protected void updateStatusLine() {
- if (statusItem != null) {
- boolean readOnly = false;
- if (server != null && commandManager.isReadOnly(serverId))
- readOnly = true;
-
- if (readOnly)
- statusItem.setText(ServerUIPlugin.getResource("%editorReadOnly"));
- else
- statusItem.setText(ServerUIPlugin.getResource("%editorWritable"));
- }
-
- if (status != null) {
- StringBuffer sb = new StringBuffer();
- boolean first = true;
- if (server != null) {
- IFile[] files = commandManager.getReadOnlyFiles(serverId);
- for (int i = 0; i < files.length; i++) {
- if (!first)
- sb.append(", ");
- sb.append(files[i].getName());
- first = false;
- }
- }
- /*if (serverConfiguration != null) {
- IFile[] files = commandManager.getReadOnlyFiles(serverConfigurationId);
- for (int i = 0; i < files.length; i++) {
- if (!first)
- sb.append(", ");
- sb.append(files[i].getName());
- first = false;
- }
- }*/
- if (sb.length() > 1)
- status.setMessage(ServerUIPlugin.getResource("%editorReadOnlyFiles", sb.toString()));
- else
- status.setMessage("");
- }
- }
-
- /**
- *
- */
- public void updateStatusError() {
- if (status == null)
- return;
-
- String error = null;
- IEditorPart part = getActiveEditor();
- if (part instanceof ServerEditorPart)
- error = ((ServerEditorPart) part).getErrorMessage();
-
- Iterator iterator = serverPages.iterator();
- int count = 0;
- while (error == null && iterator.hasNext()) {
- part = (IEditorPart) iterator.next();
- if (part instanceof ServerEditorPart) {
- error = ((ServerEditorPart) part).getErrorMessage();
- if (error != null)
- error = "[" + getPageText(count) + "] " + error;
- }
- count ++;
- }
- status.setErrorMessage(error);
- }
-
- /**
- *
- */
- protected void pageChange(int newPageIndex) {
- super.pageChange(newPageIndex);
- updateStatusError();
- }
-
- /**
- *
- */
- public void setStatus(IStatusLineManager status, StatusLineContributionItem item) {
- this.status = status;
- this.statusItem = item;
- updateStatusError();
- }
-
- /**
- * Register for key and traversal events to enable/disable the cut/copy/paste actions.
- */
- protected void registerEvents(Control control) {
- if (control == null)
- return;
-
- if (control instanceof Text || control instanceof Combo) {
- // register the world... any of these actions could cause the state to change
- control.addTraverseListener(new TraverseListener() {
- public void keyTraversed(TraverseEvent event) {
- updateActionsImpl();
- }
- });
- control.addKeyListener(new KeyListener() {
- public void keyPressed(KeyEvent event) {
- updateActionsImpl();
- }
- public void keyReleased(KeyEvent event) {
- updateActionsImpl();
- }
- });
- control.addMouseListener(new MouseListener() {
- public void mouseDown(MouseEvent event) {
- // do nothing
- }
- public void mouseUp(MouseEvent event) {
- updateActionsImpl();
- }
- public void mouseDoubleClick(MouseEvent event) {
- updateActionsImpl();
- }
- });
- control.addFocusListener(new FocusListener() {
- public void focusGained(FocusEvent event) {
- updateActionsImpl();
- }
- public void focusLost(FocusEvent event) {
- updateActionsImpl();
- }
- });
- if (control instanceof Text) {
- Text text = (Text) control;
- text.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent event) {
- updateActionsImpl();
- }
- });
- text.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent event) {
- updateActionsImpl();
- }
- public void widgetDefaultSelected(SelectionEvent event) {
- updateActionsImpl();
- }
- });
- } else {
- Combo combo = (Combo) control;
- combo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent event) {
- updateActionsImpl();
- }
- });
- combo.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent event) {
- updateActionsImpl();
- }
- public void widgetDefaultSelected(SelectionEvent event) {
- updateActionsImpl();
- }
- });
- }
- }
-
- if (control instanceof Composite) {
- Control[] children = ((Composite)control).getChildren();
- if (children != null) {
- int size = children.length;
- for (int i = 0; i < size; i++)
- registerEvents(children[i]);
- }
- }
- }
-
- /* (non-Javadoc)
- * Initializes the editor part with a site and input.
- * <p>
- * Subclasses of <code>EditorPart</code> must implement this method. Within
- * the implementation subclasses should verify that the input type is acceptable
- * and then save the site and input. Here is sample code:
- * </p>
- * <pre>
- * if (!(input instanceof IFileEditorInput))
- * throw new PartInitException("Invalid Input: Must be IFileEditorInput");
- * setSite(site);
- * setInput(editorInput);
- * </pre>
- */
- public void init(IEditorSite site, IEditorInput input) throws PartInitException {
- commandManager = GlobalCommandManager.getInstance();
-
- super.init(site, input);
-
- if (input instanceof IFileEditorInput) {
- IFileEditorInput fei = (IFileEditorInput) input;
- IFile file = fei.getFile();
- if (file != null && file.exists()) {
- IServer server2 = ServerUIPlugin.findServer(file);
- if (server2 != null)
- serverId = server2.getId();
- }
- if (serverId == null)
- throw new PartInitException(ServerUIPlugin.getResource("%errorEditor", file.getName()));
- } else if (input instanceof IServerEditorInput) {
- IServerEditorInput sei = (IServerEditorInput) input;
- serverId = sei.getServerId();
- }
-
- if (serverId != null) {
- commandManager.getCommandManager(serverId);
- server = commandManager.getServerResource(serverId);
- }
-
- ILabelProvider labelProvider = ServerUICore.getLabelProvider();
- if (server != null) {
- setPartName(labelProvider.getText(server));
- setTitleImage(labelProvider.getImage(server));
- setTitleToolTip(serverId);
- } else
- setPartName("-");
-
- cutAction = new TextAction(site.getShell().getDisplay(), TextAction.CUT_ACTION);
- copyAction = new TextAction(site.getShell().getDisplay(), TextAction.COPY_ACTION);
- pasteAction = new TextAction(site.getShell().getDisplay(), TextAction.PASTE_ACTION);
-
- listener = new PropertyChangeListener() {
- public void propertyChange(PropertyChangeEvent event) {
- if (GlobalCommandManager.PROP_DIRTY.equals(event.getPropertyName())) {
- Object obj = event.getOldValue();
- if (obj == serverId)
- firePropertyChange(PROP_DIRTY);
- } else if (GlobalCommandManager.PROP_UNDO.equals(event.getPropertyName())) {
- Object obj = event.getOldValue();
- if (obj == serverId)
- updateUndoAction();
- } else if (GlobalCommandManager.PROP_REDO.equals(event.getPropertyName())) {
- Object obj = event.getOldValue();
- if (obj == serverId)
- updateRedoAction();
- } else if (GlobalCommandManager.PROP_RELOAD.equals(event.getPropertyName())) {
- Object obj = event.getOldValue();
- if (obj == serverId) {
- server = commandManager.getServerResource(serverId);
- refresh();
- }
- }
- }
- };
- if (server != null && commandManager.isDirty(serverId))
- firePropertyChange(PROP_DIRTY);
-
- commandManager.addPropertyChangeListener(listener);
-
- // create editor input
- ICommandManager serverCommandManager = null;
- if (server != null)
- serverCommandManager = new ServerResourceCommandManager(this, serverId, commandManager);
- editorPartInput = commandManager.getPartInput(serverId, serverCommandManager);
-
- createActions();
-
- // add resource listener
- resourceListener = new LifecycleListener();
- ServerCore.addServerLifecycleListener(resourceListener);
-
- IWorkbenchWindow window = getSite().getWorkbenchWindow();
- window.getPartService().addPartListener(activationListener);
- window.getShell().addShellListener(activationListener);
- }
-
- /* (non-Javadoc)
- * Returns whether the contents of this editor have changed since the last save
- * operation.
- * <p>
- * Subclasses must override this method to implement the open-save-close lifecycle
- * for an editor. For greater details, see <code>IEditorPart</code>
- * </p>
- *
- * @see IEditorPart
- */
- public boolean isDirty() {
- if (commandManager != null) {
- if (server != null && commandManager.isDirty(serverId))
- return true;
- }
- return false;
- }
-
- /* (non-Javadoc)
- * Returns whether the "save as" operation is supported by this editor.
- * <p>
- * Subclasses must override this method to implement the open-save-close lifecycle
- * for an editor. For greater details, see <code>IEditorPart</code>
- * </p>
- *
- * @see IEditorPart
- */
- public boolean isSaveAsAllowed() {
- return false;
- }
-
- /**
- * Update the undo action.
- */
- protected void updateUndoAction() {
- ITask command = commandManager.getUndoCommand(serverId);
- if (command == null) {
- undoAction.setText(ServerUIPlugin.getResource("%editorUndoDisabled"));
- undoAction.setToolTipText("");
- undoAction.setDescription("");
- undoAction.setEnabled(false);
- } else {
- String text = ServerUIPlugin.getResource("%editorUndoEnabled", new Object[] {command.getName()});
- undoAction.setText(text);
- undoAction.setToolTipText(command.getDescription());
- undoAction.setDescription(command.getDescription());
- undoAction.setEnabled(true);
- }
- }
-
- /**
- * Update the redo action.
- */
- protected void updateRedoAction() {
- ITask command = commandManager.getRedoCommand(serverId);
- if (command == null) {
- redoAction.setText(ServerUIPlugin.getResource("%editorRedoDisabled"));
- redoAction.setToolTipText("");
- redoAction.setDescription("");
- redoAction.setEnabled(false);
- } else {
- String text = ServerUIPlugin.getResource("%editorRedoEnabled", new Object[] {command.getName()});
- redoAction.setText(text);
- redoAction.setToolTipText(command.getDescription());
- redoAction.setDescription(command.getDescription());
- redoAction.setEnabled(true);
- }
- }
-
- /**
- * Return the cut action.
- *
- * @return org.eclipse.jface.action.IAction
- */
- public IAction getCutAction() {
- return cutAction;
- }
-
- /**
- * Return the copy action.
- *
- * @return org.eclipse.jface.action.IAction
- */
- public IAction getCopyAction() {
- return copyAction;
- }
-
- /**
- * Return the paste action.
- *
- * @return org.eclipse.jface.action.IAction
- */
- public IAction getPasteAction() {
- return pasteAction;
- }
-
- /**
- * Returns the editor actions.
- *
- * @return org.eclipse.jface.action.IAction
- */
- public IAction[] getEditorActions() {
- return editorActions;
- }
-
- /**
- * Update the server pages with new input.
- */
- protected void refresh() {
- // create editor input
- ICommandManager serverCommandManager = null;
- if (server != null)
- serverCommandManager = new ServerResourceCommandManager(this, serverId, commandManager);
- editorPartInput = commandManager.getPartInput(serverId, serverCommandManager);
-
- Iterator iterator = serverPages.iterator();
- while (iterator.hasNext()) {
- IEditorPart part = (IEditorPart) iterator.next();
- try {
- part.init(part.getEditorSite(), editorPartInput);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error refresh()ing editor part", e);
- }
- }
- }
-
- /**
- *
- */
- protected void promptReadOnlyServerFile(String id) {
- commandManager.setReadOnly(id, true);
- String title = ServerUIPlugin.getResource("%editorResourceModifiedTitle");
- String message = ServerUIPlugin.getResource("%editorReadOnlyMessage");
- MessageDialog.openInformation(getEditorSite().getShell(), title, message);
- }
-
- /**
- *
- */
- protected void promptReloadServerFile(String id, IServerWorkingCopy wc) {
- String title = ServerUIPlugin.getResource("%editorResourceModifiedTitle");
- String message = ServerUIPlugin.getResource("%editorServerModifiedMessage");
-
- if (MessageDialog.openQuestion(getEditorSite().getShell(), title, message)) {
- try {
- //wc.refreshLocal(IResource.DEPTH_ONE, new NullProgressMonitor());
- //TODO: refresh local server
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error refreshing server", e);
- }
- commandManager.reload(id, new NullProgressMonitor());
- }
- }
-
- /**
- *
- */
- public void setFocus() {
- super.setFocus();
- }
-
- /**
- *
- */
- protected void checkResourceState() {
- // Do not check the resource state change if saving through the editor.
- if (isSaving) {
- // Do nothing.
- return;
- }
-
- // check for deleted files
- if (resourceDeleted) {
- String title = ServerUIPlugin.getResource("%editorResourceDeleteTitle");
- String message = null;
- if (server != null)
- message = ServerUIPlugin.getResource("%editorResourceDeleteServerMessage", server.getName());
- String[] labels = new String[] {ServerUIPlugin.getResource("%editorResourceDeleteSave"), IDialogConstants.CLOSE_LABEL};
- MessageDialog dialog = new MessageDialog(getEditorSite().getShell(), title, null, message, MessageDialog.INFORMATION, labels, 0);
-
- if (dialog.open() == 0)
- doSave(new NullProgressMonitor());
- else
- closeEditor();
- return;
- }
- resourceDeleted = false;
-
- // check for server changes
- if (serverId != null) {
- if (!commandManager.isDirty(serverId)) {
- if (commandManager.hasChanged(serverId))
- promptReloadServerFile(serverId, server);
- } else {
- if (commandManager.hasChanged(serverId) && !commandManager.areFilesReadOnly(serverId))
- promptReloadServerFile(serverId, server);
- else if (commandManager.areFilesReadOnly(serverId) && !commandManager.isReadOnly(serverId))
- promptReadOnlyServerFile(serverId);
- }
- if (commandManager.isReadOnly(serverId) && !commandManager.areFilesReadOnly(serverId))
- commandManager.setReadOnly(serverId, false);
- commandManager.updateTimestamps(serverId);
- }
-
- updateStatusLine();
- }
-
- /**
- * Set the tooltip.
- */
- public String getTitleToolTip() {
- if (server != null && server.getFile() != null)
- return server.getFile().getFullPath().toString();
- else if (server != null)
- return server.getName();
- else
- return "error";
- }
-
- public int getOrientation() {
- return Window.getDefaultOrientation();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/ServerEditorActionBarContributor.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/ServerEditorActionBarContributor.java
deleted file mode 100644
index ae4c948..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/ServerEditorActionBarContributor.java
+++ /dev/null
@@ -1,113 +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.editor;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.wst.server.ui.internal.Trace;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.actions.ActionFactory;
-import org.eclipse.ui.part.EditorActionBarContributor;
-/**
- * Server editor action bar contributor.
- */
-public class ServerEditorActionBarContributor extends EditorActionBarContributor {
- public static final String SERVER_EDITOR_SEPARATOR = "server-editor-additions";
-
- // current editor
- protected ServerEditor editor;
-
- /**
- * ServerEditorActionBarContributor constructor comment.
- */
- public ServerEditorActionBarContributor() {
- super();
- }
-
- /**
- * Sets the active editor for the contributor.
- * <p>
- * The <code>EditorActionBarContributor</code> implementation of this method does
- * nothing. Subclasses may reimplement. This generally entails disconnecting
- * from the old editor, connecting to the new editor, and updating the actions
- * to reflect the new editor.
- * </p>
- *
- * @param targetEditor the new target editor
- */
- public void setActiveEditor(IEditorPart targetEditor) {
- super.setActiveEditor(targetEditor);
-
- if (targetEditor != null && targetEditor.equals(editor))
- return;
-
- IActionBars actionBars = getActionBars();
- boolean actionBarsUpdated = false;
-
- if (editor != null) {
- editor.setStatus(null, null);
-
- IStatusLineManager status = actionBars.getStatusLineManager();
- status.removeAll();
-
- IToolBarManager tbm = actionBars.getToolBarManager();
- tbm.removeAll();
-
- actionBarsUpdated = true;
- }
-
- if (targetEditor instanceof ServerEditor) {
- editor = (ServerEditor) targetEditor;
- Trace.trace(Trace.FINEST, "Editor action bar contributor for: " + editor);
- editor.updateUndoAction();
- editor.updateRedoAction();
-
- actionBars.setGlobalActionHandler(ActionFactory.UNDO.getId(), editor.getUndoAction());
- actionBars.setGlobalActionHandler(ActionFactory.REDO.getId(), editor.getRedoAction());
-
- actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(), editor.getCopyAction());
- actionBars.setGlobalActionHandler(ActionFactory.CUT.getId(), editor.getCutAction());
- actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(), editor.getPasteAction());
-
- IStatusLineManager status = actionBars.getStatusLineManager();
- StatusLineContributionItem item = new StatusLineContributionItem("id");
- status.add(item);
-
- editor.setStatus(status, item);
- editor.updateStatusLine();
-
- IAction[] actions = editor.getEditorActions();
- IToolBarManager tbm = actionBars.getToolBarManager();
- tbm.add(new Separator(SERVER_EDITOR_SEPARATOR));
- boolean modified = false;
- if (actions != null) {
- int size = actions.length;
- Trace.trace(Trace.FINEST, "Attempting to add editor actions: " + size);
- for (int i = 0; i < size; i++) {
- Trace.trace(Trace.FINEST, "action: " + actions[i]);
- tbm.appendToGroup(SERVER_EDITOR_SEPARATOR, actions[i]);
- modified = true;
- }
- }
-
- if (modified)
- tbm.update(false);
- actionBarsUpdated = true;
- } else
- editor = null;
-
- if (actionBarsUpdated)
- actionBars.updateActionBars();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/ServerEditorActionFactory.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/ServerEditorActionFactory.java
deleted file mode 100644
index afe2af2..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/ServerEditorActionFactory.java
+++ /dev/null
@@ -1,169 +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.editor;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.StringTokenizer;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.wst.server.core.IServerWorkingCopy;
-import org.eclipse.wst.server.ui.editor.ServerEditorActionFactoryDelegate;
-import org.eclipse.wst.server.ui.editor.IServerEditorPartInput;
-import org.eclipse.wst.server.ui.internal.Trace;
-import org.eclipse.ui.IEditorSite;
-/**
- * A default server that can be created for a set of given
- * natures.
- */
-public class ServerEditorActionFactory implements IServerEditorActionFactory {
- private IConfigurationElement element;
- private ServerEditorActionFactoryDelegate delegate;
-
- /**
- * ServerEditorActionFactory constructor comment.
- */
- public ServerEditorActionFactory(IConfigurationElement element) {
- super();
- this.element = element;
- }
-
- /**
- *
- */
- public IConfigurationElement getConfigurationElement() {
- return element;
- }
-
- /**
- * Returns the id of this default server.
- *
- * @return java.lang.String
- */
- public String getId() {
- return element.getAttribute("id");
- }
-
- /**
- * Returns the id of this default server.
- *
- * @return java.lang.String
- */
- public String getName() {
- return element.getAttribute("name");
- }
-
- /**
- * Returns the order.
- *
- * @return int
- */
- public int getOrder() {
- try {
- String o = element.getAttribute("order");
- return Integer.parseInt(o);
- } catch (NumberFormatException e) {
- return -1;
- }
- }
-
- /**
- * Return the ids of the server resource factories (specified
- * using Java-import style) that this page may support.
- *
- * @return java.lang.String[]
- */
- public String[] getTypeIds() {
- try {
- List list = new ArrayList();
- StringTokenizer st = new StringTokenizer(element.getAttribute("typeIds"), ",");
- while (st.hasMoreTokens()) {
- String str = st.nextToken();
- if (str != null && str.length() > 0)
- list.add(str);
- }
- String[] s = new String[list.size()];
- list.toArray(s);
- return s;
- } catch (Exception e) {
- //Trace.trace("Could not get server resource from: " + element.getAttribute("serverResources"));
- return null;
- }
- }
-
- /**
- * Returns true if the given server resource type (given by the
- * id) can be opened with this editor. This result is based on
- * the result of the getServerResources() method.
- *
- * @return boolean
- */
- public boolean supportsServerElementType(String id) {
- if (id == null || id.length() == 0)
- return false;
-
- String[] s = getTypeIds();
- if (s == null)
- return false;
-
- int size = s.length;
- for (int i = 0; i < size; i++) {
- if (s[i].endsWith("*")) {
- if (id.length() >= s[i].length() && id.startsWith(s[i].substring(0, s[i].length() - 1)))
- return true;
- } else if (id.equals(s[i]))
- return true;
- }
- return false;
- }
-
- /*
- * @see IPublishManager#getDelegate()
- */
- public ServerEditorActionFactoryDelegate getDelegate() {
- if (delegate == null) {
- try {
- delegate = (ServerEditorActionFactoryDelegate) element.createExecutableExtension("class");
- } catch (Throwable t) {
- Trace.trace(Trace.SEVERE, "Could not create server action factory delegate", t);
- }
- }
- return delegate;
- }
-
- /**
- * Returns true if this editor page should be visible with the given
- * server instance. This allows (for
- * instance) complex configuration pages to only be shown when used
- * with non-unittest servers.
- */
- public boolean shouldDisplay(IServerWorkingCopy server) {
- try {
- return getDelegate().shouldDisplay(server);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error calling delegate", e);
- return false;
- }
- }
-
- /**
- * Create the editor page.
- */
- public IAction createAction(IEditorSite site, IServerEditorPartInput input) {
- try {
- return getDelegate().createAction(site, input);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error calling delegate", e);
- return null;
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/ServerEditorCore.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/ServerEditorCore.java
deleted file mode 100644
index 102070b..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/ServerEditorCore.java
+++ /dev/null
@@ -1,161 +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.editor;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.server.ui.editor.IOrdered;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-import org.eclipse.wst.server.ui.internal.Trace;
-/**
- *
- */
-public class ServerEditorCore {
- // cached copy of all editor factories and actions
- private static List editorPageFactories;
- private static List editorPageSectionFactories;
- private static List editorActionFactories;
-
- /**
- * Returns a List of all editor page factories
- *
- * @return java.util.List
- */
- public static List getServerEditorPageFactories() {
- if (editorPageFactories == null)
- loadEditorPageFactories();
- return editorPageFactories;
- }
-
- /**
- * Returns a List of all editor page section factories
- *
- * @return java.util.List
- */
- public static List getServerEditorPageSectionFactories() {
- if (editorPageSectionFactories == null)
- loadEditorPageSectionFactories();
- return editorPageSectionFactories;
- }
-
- /**
- * Load the editor page factory extension point.
- */
- private static void loadEditorPageFactories() {
- Trace.trace(Trace.CONFIG, "->- Loading .editorPages extension point ->-");
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IConfigurationElement[] cf = registry.getConfigurationElementsFor(ServerUIPlugin.PLUGIN_ID, "editorPages");
-
- int size = cf.length;
- editorPageFactories = new ArrayList(size);
- for (int i = 0; i < size; i++) {
- try {
- editorPageFactories.add(new ServerEditorPartFactory(cf[i]));
- Trace.trace(Trace.CONFIG, " Loaded editorPage: " + cf[i].getAttribute("id"));
- } catch (Throwable t) {
- Trace.trace(Trace.SEVERE, " Could not load editorPage: " + cf[i].getAttribute("id"), t);
- }
- }
-
- // sort pages
- sortOrderedList(editorPageFactories);
- Trace.trace(Trace.CONFIG, "-<- Done loading .editorPages extension point -<-");
- }
-
- /**
- * Load the editor page section factory extension point.
- */
- private static void loadEditorPageSectionFactories() {
- Trace.trace(Trace.CONFIG, "->- Loading .editorPageSections extension point ->-");
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IConfigurationElement[] cf = registry.getConfigurationElementsFor(ServerUIPlugin.PLUGIN_ID, "editorPageSections");
-
- int size = cf.length;
- editorPageSectionFactories = new ArrayList(size);
- for (int i = 0; i < size; i++) {
- try {
- editorPageSectionFactories.add(new ServerEditorPageSectionFactory(cf[i]));
- Trace.trace(Trace.CONFIG, " Loaded editorPageSection: " + cf[i].getAttribute("id"));
- } catch (Throwable t) {
- Trace.trace(Trace.SEVERE, " Could not load editorPageSection: " + cf[i].getAttribute("id"), t);
- }
- }
-
- // sort sections
- sortOrderedList(editorPageSectionFactories);
- Trace.trace(Trace.CONFIG, "-<- Done loading .editorPageSections extension point -<-");
- }
-
- /**
- * Returns a List of all editor action factories.
- *
- * @return java.util.List
- */
- public static List getServerEditorActionFactories() {
- if (editorActionFactories == null)
- loadEditorActionFactories();
- return editorActionFactories;
- }
-
- /**
- * Load the editor action factories extension point.
- */
- private static void loadEditorActionFactories() {
- Trace.trace(Trace.CONFIG, "->- Loading .editorActions extension point ->-");
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IConfigurationElement[] cf = registry.getConfigurationElementsFor(ServerUIPlugin.PLUGIN_ID, "editorActions");
-
- int size = cf.length;
- editorActionFactories = new ArrayList(size);
- for (int i = 0; i < size; i++) {
- try {
- editorActionFactories.add(new ServerEditorActionFactory(cf[i]));
- Trace.trace(Trace.CONFIG, " Loaded editorAction: " + cf[i].getAttribute("id"));
- } catch (Throwable t) {
- Trace.trace(Trace.SEVERE, " Could not load editorAction: " + cf[i].getAttribute("id"), t);
- }
- }
-
- // sort pages
- sortOrderedList(editorActionFactories);
- Trace.trace(Trace.CONFIG, "-<- Done loading .editorActions extension point -<-");
- }
-
- /**
- * Sort the given list of IOrdered items into indexed order. This method
- * modifies the original list, but returns the value for convenience.
- *
- * @param list java.util.List
- * @return java.util.List
- */
- public static List sortOrderedList(List list) {
- if (list == null)
- return null;
-
- int size = list.size();
- for (int i = 0; i < size - 1; i++) {
- for (int j = i + 1; j < size; j++) {
- IOrdered a = (IOrdered) list.get(i);
- IOrdered b = (IOrdered) list.get(j);
- if (a.getOrder() > b.getOrder()) {
- Object temp = a;
- list.set(i, b);
- list.set(j, temp);
- }
- }
- }
- return list;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/ServerEditorInput.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/ServerEditorInput.java
deleted file mode 100644
index 5f2ed3f..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/ServerEditorInput.java
+++ /dev/null
@@ -1,179 +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.editor;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.ServerCore;
-import org.eclipse.wst.server.ui.internal.ImageResource;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.IPersistableElement;
-/**
- * The editor input for server configurations and instances. The
- * input points to a resource that is either an instance or
- * configuration.
- *
- * <p>Editors supporting this editor input should use the ResourceManager
- * to load their own copy of the resource. Each editor is responsible
- * for managing this resource and making sure that only one copy is
- * loaded from disk when multiple editors are opened on the same
- * resource.</p>
- *
- * <p>When the editor saves back to the resource, the server tooling
- * will notice the change and reload the new configuration.</p>
- *
- * <p>Editors should call setEditing(resource, true) when the first
- * editor opens on a particular resource, and setEditing(resource,
- * false) when the last editor on a resource closes. This will
- * ensure that the server tooling does not try to edit the resource
- * and cause conflicting changes while an editor is open.</p>
- */
-public class ServerEditorInput implements IServerEditorInput, IPersistableElement {
- private String serverId;
-
- /**
- * ServerEditorInput constructor comment.
- */
- public ServerEditorInput(String serverId) {
- super();
- this.serverId = serverId;
- }
-
- /**
- * Returns the server id.
- * @return org.eclipse.core.resources.IResource
- */
- public String getServerId() {
- return serverId;
- }
-
- /**
- * Indicates whether some other object is "equal to" this one.
- * In this case it means that the underlying IFolders are equal.
- */
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (!(obj instanceof ServerEditorInput))
- return false;
- ServerEditorInput other = (ServerEditorInput) obj;
- if (serverId == null) {
- if (other.serverId != null)
- return false;
- } else if (!serverId.equals(other.serverId))
- return false;
- return true;
- }
-
- /**
- * Returns whether the editor input exists.
- * <p>
- * This method is primarily used to determine if an editor input should
- * appear in the "File Most Recently Used" menu. An editor input will appear
- * in the list until the return value of <code>exists</code> becomes
- * <code>false</code> or it drops off the bottom of the list.
- *
- * @return <code>true</code> if the editor input exists; <code>false</code>
- * otherwise
- */
- public boolean exists() {
- if (serverId != null && ServerCore.findServer(serverId) == null)
- return false;
-
- return true;
- }
-
- /**
- * Returns an object which is an instance of the given class
- * associated with this object. Returns <code>null</code> if
- * no such object can be found.
- *
- * @param adapter the adapter class to look up
- * @return a object castable to the given class,
- * or <code>null</code> if this object does not
- * have an adapter for the given class
- */
- public Object getAdapter(Class adapter) {
- return Platform.getAdapterManager().getAdapter(this, adapter);
- }
-
- /**
- * Returns the ID of an element factory which can be used to recreate
- * this object. An element factory extension with this ID must exist
- * within the workbench registry.
- *
- * @return the element factory ID
- */
- public String getFactoryId() {
- return ServerEditorInputFactory.FACTORY_ID;
- }
-
- public ImageDescriptor getImageDescriptor() {
- return ImageResource.getImageDescriptor(ImageResource.IMG_SERVER);
- }
-
- /**
- * Returns the name of this editor input for display purposes.
- * <p>
- * For instance, if the fully qualified input name is
- * <code>"a\b\MyFile.gif"</code>, the return value would be just
- * <code>"MyFile.gif"</code>.
- *
- * @return the file name string
- */
- public String getName() {
- if (serverId != null) {
- IServer server = ServerCore.findServer(serverId);
- if (server != null)
- return server.getName();
- return serverId;
- }
- return "";
- }
-
- /*
- * Returns an object that can be used to save the state of this editor input.
- *
- * @return the persistable element, or <code>null</code> if this editor input
- * cannot be persisted
- */
- public IPersistableElement getPersistable() {
- return this;
- }
-
- public String getToolTipText() {
- String s = null;
- if (serverId != null) {
- IServer server = ServerCore.findServer(serverId);
- if (server != null) {
- if (server.getFile() != null) {
- s = server.getFile().getFullPath().makeRelative().toString();
- if (s.startsWith("/"))
- s = s.substring(1);
- } else
- s = server.getName();
- }
- }
- if (s == null)
- s = "";
- return s;
- }
-
- /**
- * Saves the state of an element within a memento.
- *
- * @param memento the storage area for element state
- */
- public void saveState(IMemento memento) {
- ServerEditorInputFactory.saveState(memento, this);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/ServerEditorInputFactory.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/ServerEditorInputFactory.java
deleted file mode 100644
index 6ef4721..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/ServerEditorInputFactory.java
+++ /dev/null
@@ -1,54 +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.editor;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.ui.IElementFactory;
-import org.eclipse.ui.IMemento;
-/**
- * This factory is used in the persistence of ServerResourceEditorInput
- * instances. This allows the user to close the workbench with an
- * open editor and reopen to the same editor.
- */
-public class ServerEditorInputFactory implements IElementFactory {
- protected final static String FACTORY_ID = "org.eclipse.wst.server.ui.editor.input.factory";
- protected final static String SERVER_ID = "server-id";
-
- /**
- * ServerEditorInputFactory constructor comment.
- */
- public ServerEditorInputFactory() {
- // do nothing
- }
-
- /*
- * Creates editor input based on the state in the memento.
- */
- public IAdaptable createElement(IMemento memento) {
- // get the resource names
- String serverId = memento.getString(SERVER_ID);
-
- return new ServerEditorInput(serverId);
- }
-
- /**
- * Saves the state of an element within a memento.
- *
- * @param memento the storage area for element state
- */
- public static void saveState(IMemento memento, ServerEditorInput input) {
- if (input == null)
- return;
-
- if (input.getServerId() != null)
- memento.putString(SERVER_ID, input.getServerId());
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/ServerEditorPageSectionFactory.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/ServerEditorPageSectionFactory.java
deleted file mode 100644
index 384003b..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/ServerEditorPageSectionFactory.java
+++ /dev/null
@@ -1,173 +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.editor;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.StringTokenizer;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-
-import org.eclipse.wst.server.core.IServerWorkingCopy;
-import org.eclipse.wst.server.ui.editor.*;
-import org.eclipse.wst.server.ui.internal.Trace;
-/**
- *
- */
-public class ServerEditorPageSectionFactory implements IServerEditorPageSectionFactory {
- private IConfigurationElement element;
- private ServerEditorPageSectionFactoryDelegate delegate;
-
- /**
- * ServerEditorPageSectionFactory constructor comment.
- */
- public ServerEditorPageSectionFactory(IConfigurationElement element) {
- super();
- this.element = element;
- }
-
- /**
- *
- */
- public IConfigurationElement getConfigurationElement() {
- return element;
- }
-
- /**
- * Returns the id of this factory.
- *
- * @return java.lang.String
- */
- public String getId() {
- return element.getAttribute("id");
- }
-
- /**
- * Returns the order.
- *
- * @return int
- */
- public int getOrder() {
- try {
- String o = element.getAttribute("order");
- return Integer.parseInt(o);
- } catch (NumberFormatException e) {
- return -1;
- }
- }
-
- /**
- * Returns the insertion id of this factory.
- *
- * @return java.lang.String
- */
- public String getInsertionId() {
- return element.getAttribute("insertionId");
- }
-
- /**
- * Return the ids of the server resource factories (specified
- * using Java-import style) that this page may support.
- *
- * @return java.lang.String[]
- */
- protected String[] getTypeIds() {
- try {
- List list = new ArrayList();
- StringTokenizer st = new StringTokenizer(element.getAttribute("typeIds"), ",");
- while (st.hasMoreTokens()) {
- String str = st.nextToken();
- if (str != null && str.length() > 0)
- list.add(str.trim());
- }
- String[] s = new String[list.size()];
- list.toArray(s);
- return s;
- } catch (Exception e) {
- //Trace.trace("Could not get server resource from: " + element.getAttribute("serverResources"));
- return null;
- }
- }
-
- /**
- * Returns true if the given server resource type (given by the
- * id) can be opened with this editor. This result is based on
- * the result of the getServerResources() method.
- *
- * @return boolean
- */
- public boolean supportsType(String id) {
- if (id == null || id.length() == 0)
- return false;
-
- String[] s = getTypeIds();
- if (s == null)
- return false;
-
- int size = s.length;
- for (int i = 0; i < size; i++) {
- if (s[i].endsWith("*")) {
- if (id.length() >= s[i].length() && id.startsWith(s[i].substring(0, s[i].length() - 1)))
- return true;
- } else if (id.equals(s[i]))
- return true;
- }
- return false;
- }
-
- /*
- *
- */
- public ServerEditorPageSectionFactoryDelegate getDelegate() {
- if (delegate == null) {
- try {
- delegate = (ServerEditorPageSectionFactoryDelegate) element.createExecutableExtension("class");
- } catch (Throwable t) {
- Trace.trace(Trace.SEVERE, "Could not create server editorpage delegate", t);
- }
- }
- return delegate;
- }
-
- /**
- * Returns true if this editor page should be visible with the given
- * server instance and configuration combination. This allows (for
- * instance) complex configuration pages to only be shown when used
- * with non-unittest servers.
- *
- * <p>If the instance or configuration is being opened by itself, the
- * other value (instance or configuration) will be null.
- */
- public boolean shouldCreateSection(IServerWorkingCopy server) {
- try {
- return getDelegate().shouldCreateSection(server);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error calling delegate", e);
- return false;
- }
- }
-
- /**
- * Create the editor page.
- */
- public IServerEditorSection createSection() {
- try {
- return getDelegate().createSection();
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error calling delegate", e);
- return null;
- }
- }
-
- public String toString() {
- return "ServerEditorSection [" + getId() + ", " + getInsertionId() + ", " + getOrder() + "]";
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/ServerEditorPartFactory.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/ServerEditorPartFactory.java
deleted file mode 100644
index 52c2eb0..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/ServerEditorPartFactory.java
+++ /dev/null
@@ -1,199 +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.editor;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.StringTokenizer;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.wst.server.core.IServerWorkingCopy;
-import org.eclipse.wst.server.ui.editor.ServerEditorPartFactoryDelegate;
-import org.eclipse.wst.server.ui.internal.Trace;
-import org.eclipse.ui.IEditorPart;
-/**
- *
- */
-public class ServerEditorPartFactory implements IServerEditorPartFactory {
- private IConfigurationElement element;
- private ServerEditorPartFactoryDelegate delegate;
-
- /**
- * ServerEditorPartFactory constructor comment.
- */
- public ServerEditorPartFactory(IConfigurationElement element) {
- super();
- this.element = element;
- }
-
- /**
- *
- */
- public IConfigurationElement getConfigurationElement() {
- return element;
- }
-
- /**
- * Returns the id of this part factory.
- *
- * @return java.lang.String
- */
- public String getId() {
- return element.getAttribute("id");
- }
-
- /**
- * Returns the name of this part factory.
- *
- * @return java.lang.String
- */
- public String getName() {
- return element.getAttribute("name");
- }
-
- protected String[] getInsertionIds() {
- try {
- List list = new ArrayList();
- StringTokenizer st = new StringTokenizer(element.getAttribute("insertionIds"), ",");
- while (st.hasMoreTokens()) {
- String str = st.nextToken();
- if (str != null && str.length() > 0)
- list.add(str.trim());
- }
- String[] s = new String[list.size()];
- list.toArray(s);
- return s;
- } catch (Exception e) {
- //Trace.trace("Could not get server resource from: " + element.getAttribute("serverResources"));
- return null;
- }
- }
-
- public boolean supportsInsertionId(String id) {
- if (id == null || id.length() == 0)
- return false;
-
- String[] s = getInsertionIds();
- if (s == null)
- return false;
-
- int size = s.length;
- for (int i = 0; i < size; i++) {
- if (s[i].endsWith("*")) {
- if (id.length() >= s[i].length() && id.startsWith(s[i].substring(0, s[i].length() - 1)))
- return true;
- } else if (id.equals(s[i]))
- return true;
- }
- return false;
- }
-
- /**
- * Returns the order.
- *
- * @return int
- */
- public int getOrder() {
- try {
- String o = element.getAttribute("order");
- return Integer.parseInt(o);
- } catch (NumberFormatException e) {
- return -1;
- }
- }
-
- /**
- * Return the ids of the server and server configuration type ids (specified
- * using Java-import style) that this page may support.
- *
- * @return java.lang.String[]
- */
- protected String[] getTypeIds() {
- try {
- List list = new ArrayList();
- StringTokenizer st = new StringTokenizer(element.getAttribute("typeIds"), ",");
- while (st.hasMoreTokens()) {
- String str = st.nextToken();
- if (str != null && str.length() > 0)
- list.add(str.trim());
- }
- String[] s = new String[list.size()];
- list.toArray(s);
- return s;
- } catch (Exception e) {
- //Trace.trace("Could not get server resource from: " + element.getAttribute("serverResources"));
- return null;
- }
- }
-
- /**
- * Returns true if the given server or server configuration type id
- * can be opened with this editor. This result is based on
- * the result of the getTypeIds() method.
- *
- * @return boolean
- */
- public boolean supportsType(String id) {
- if (id == null || id.length() == 0)
- return false;
-
- String[] s = getTypeIds();
- if (s == null)
- return false;
-
- int size = s.length;
- for (int i = 0; i < size; i++) {
- if (s[i].endsWith("*")) {
- if (id.length() >= s[i].length() && id.startsWith(s[i].substring(0, s[i].length() - 1)))
- return true;
- } else if (id.equals(s[i]))
- return true;
- }
- return false;
- }
-
- public ServerEditorPartFactoryDelegate getDelegate() {
- if (delegate == null) {
- try {
- delegate = (ServerEditorPartFactoryDelegate) element.createExecutableExtension("class");
- } catch (Throwable t) {
- Trace.trace(Trace.SEVERE, "Could not create server editorpage delegate", t);
- }
- }
- return delegate;
- }
-
- /**
- * Returns true if this editor page should be visible with the given server.
- * This allows (for instance) complex configuration pages to only be shown when used
- * with non-unittest servers.
- */
- public boolean shouldCreatePage(IServerWorkingCopy server) {
- try {
- return getDelegate().shouldCreatePage(server);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error calling delegate", e);
- return false;
- }
- }
-
- /**
- * Create the editor page.
- */
- public IEditorPart createPage() {
- try {
- return getDelegate().createPage();
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error calling delegate", e);
- return null;
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/ServerEditorPartInput.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/ServerEditorPartInput.java
deleted file mode 100644
index 1dbfdc7..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/ServerEditorPartInput.java
+++ /dev/null
@@ -1,84 +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.editor;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.IPersistableElement;
-
-import org.eclipse.wst.server.core.IServerWorkingCopy;
-import org.eclipse.wst.server.ui.editor.ICommandManager;
-import org.eclipse.wst.server.ui.editor.IServerEditorPartInput;
-/**
- *
- */
-public class ServerEditorPartInput implements IServerEditorPartInput {
- protected IServerWorkingCopy server;
- protected boolean serverReadOnly;
- protected ICommandManager serverCommandManager;
-
- public ServerEditorPartInput(
- ICommandManager serverCommandManager, IServerWorkingCopy server, boolean serverReadOnly) {
-
- this.server = server;
- this.serverReadOnly = serverReadOnly;
- this.serverCommandManager = serverCommandManager;
- }
-
- public String getName() {
- return "-";
- }
-
- public String getToolTipText() {
- return "-";
- }
-
- public boolean exists() {
- return true;
- }
-
- public Object getAdapter(Class adapter) {
- return null;
- }
-
- public ImageDescriptor getImageDescriptor() {
- return null;
- }
-
- public IPersistableElement getPersistable() {
- return null;
- }
-
- /**
- * Returns the server to be edited.
- *
- * @return IServerResource
- */
- public IServerWorkingCopy getServer() {
- return server;
- }
-
- /**
- * Returns true if the server is read-only.
- *
- * @return boolean
- */
- public boolean isServerReadOnly() {
- return serverReadOnly;
- }
-
- public ICommandManager getServerCommandManager() {
- return serverCommandManager;
- }
-
- public String toString() {
- return "ServerEditorPartInput [" + server + "]";
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/ServerResourceCommandManager.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/ServerResourceCommandManager.java
deleted file mode 100644
index 603183f..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/ServerResourceCommandManager.java
+++ /dev/null
@@ -1,98 +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.editor;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.wst.server.core.*;
-import org.eclipse.wst.server.ui.editor.ICommandManager;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-/**
- * A command manager for a single server resource.
- */
-public class ServerResourceCommandManager implements ICommandManager {
- protected ServerEditor editor;
- protected GlobalCommandManager commandManager;
- protected String id;
-
- public ServerResourceCommandManager(ServerEditor editor, String id, GlobalCommandManager commandManager) {
- this.editor = editor;
- this.commandManager = commandManager;
- this.id = id;
- }
-
- public boolean isReadOnly() {
- return commandManager.isReadOnly(id);
- }
-
- /**
- * Execute the given command and place it in the undo stack.
- * If the command cannot be undone, the user will be notifed
- * before it is executed.
- *
- * @param command ICommand
- */
- public void executeCommand(ITask command) {
- if (!validateEdit())
- return;
-
- if (commandManager.isReadOnly(id)) {
- warnReadOnly();
- return;
- }
- commandManager.executeCommand(id, command);
- }
-
- protected void warnReadOnly() {
- String title = ServerUIPlugin.getResource("%editorResourceWarnTitle");
- String message = ServerUIPlugin.getResource("%editorResourceWarnMessage");
-
- MessageDialog.openWarning(editor.getEditorSite().getShell(), title, message);
- }
-
- /**
- *
- */
- protected boolean validateEdit() {
- if (commandManager.isDirty(id))
- return true;
-
- IFile[] files = commandManager.getReadOnlyFiles(id);
- if (files.length == 0)
- return true;
-
- IStatus status = ResourcesPlugin.getWorkspace().validateEdit(files, editor.getEditorSite().getShell());
-
- if (status.getSeverity() == IStatus.ERROR) {
- // inform user
- String message = ServerUIPlugin.getResource("%editorValidateEditFailureMessage");
- ErrorDialog.openError(editor.getEditorSite().getShell(), ServerUIPlugin.getResource("%errorDialogTitle"), message, status);
-
- // change to read-only
- commandManager.setReadOnly(id, true);
-
- // do not execute command
- return false;
- }
- // check file timestamp
- IServerAttributes serverfile = commandManager.getServerResource(id);
- if (commandManager.hasChanged(id)) {
- if (serverfile instanceof IServer)
- editor.promptReloadServerFile(id, (IServerWorkingCopy) serverfile);
- }
-
- // allow edit
- return true;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/StatusLineContributionItem.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/StatusLineContributionItem.java
deleted file mode 100644
index 9a35eec..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/StatusLineContributionItem.java
+++ /dev/null
@@ -1,91 +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.editor;
-
-import org.eclipse.jface.action.ContributionItem;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.texteditor.IStatusField;
-/**
- * Contribution item for the status line.
- */
-public class StatusLineContributionItem extends ContributionItem implements IStatusField {
-
- static class StatusLineLabel extends CLabel {
-
- private static int INDENT= 3; // left and right margin used in CLabel
-
- private Point fFixedSize;
-
- public StatusLineLabel(Composite parent, int style) {
- super(parent, style);
-
- GC gc= new GC(parent);
- gc.setFont(parent.getFont());
- Point extent= gc.textExtent("MMMMMMMMM"); //$NON-NLS-1$
- gc.dispose();
-
- fFixedSize= new Point(extent.x + INDENT * 2, 10);
- }
-
- public Point computeSize(int wHint, int hHint, boolean changed) {
- return fFixedSize;
- }
- }
-
- private String fText;
- private Image fImage;
- private StatusLineLabel fLabel;
-
- /**
- * Creates a new item with the given id.
- *
- * @param id the item's id
- */
- StatusLineContributionItem(String id) {
- super(id);
- }
-
- /*
- * @see IStatusField#setText
- */
- public void setText(String text) {
- fText= text;
- if (fLabel != null && !fLabel.isDisposed()) {
- fLabel.setText(fText);
- }
- }
-
- /*
- * @see IStatusField#setImage(Image)
- */
- public void setImage(Image image) {
- fImage= image;
- if (fLabel != null && !fLabel.isDisposed()) {
- fLabel.setImage(fImage);
- }
- }
-
- /*
- * @see IContributionItem#fill(Composite)
- */
- public void fill(Composite parent) {
- fLabel= new StatusLineLabel(parent, SWT.SHADOW_IN);
- fLabel.setData(this);
-
- if (fText != null)
- fLabel.setText(fText);
- }
-}
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/TextAction.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/TextAction.java
deleted file mode 100644
index dd7b197..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/TextAction.java
+++ /dev/null
@@ -1,264 +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.editor;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.wst.server.ui.internal.Trace;
-import org.eclipse.swt.SWTError;
-import org.eclipse.swt.dnd.Clipboard;
-import org.eclipse.swt.dnd.TextTransfer;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Text;
-/**
- * Text actions (cut, copy, paste) for the Web browser.
- */
-public class TextAction extends Action {
- protected Display display;
- protected Clipboard clipboard;
- protected byte type;
-
- public static final byte CUT_ACTION = 0;
- public static final byte COPY_ACTION = 1;
- public static final byte PASTE_ACTION = 2;
-
- /**
- * TextAction constructor comment.
- */
- protected TextAction(Display display, byte type) {
- super("Text action: " + type);
- this.display = display;
- clipboard = new Clipboard(display);
- this.type = type;
- }
-
- protected Control getControl() {
- Control control = display.getFocusControl();
- return control;
- }
-
- protected Point getControlSelection() {
- Control control = getControl();
- if (control == null)
- return null;
-
- if (control instanceof Text) {
- Text text = (Text) control;
- return text.getSelection();
- } else if (control instanceof Combo) {
- Combo combo = (Combo) control;
- return combo.getSelection();
- } else
- return null;
- }
-
- protected void setControlSelection(Point sel) {
- Control control = getControl();
- if (control == null)
- return;
-
- if (control instanceof Text) {
- Text text = (Text) control;
- text.setSelection(sel);
- } else if (control instanceof Combo) {
- Combo combo = (Combo) control;
- combo.setSelection(sel);
- }
- }
-
- protected String getControlText() {
- Control control = getControl();
- if (control == null)
- return null;
-
- if (control instanceof Text) {
- Text text = (Text) control;
- return text.getText();
- } else if (control instanceof Combo) {
- Combo combo = (Combo) control;
- return combo.getText();
- } else
- return null;
- }
-
- protected void setControlText(String text) {
- Control control = getControl();
- if (control == null)
- return;
-
- if (control instanceof Text) {
- Text text2 = (Text) control;
- text2.setText(text);
- } else if (control instanceof Combo) {
- Combo combo = (Combo) control;
- combo.setText(text);
- }
- }
-
- /**
- * Copies the selected text to the clipboard. The text will be put in the
- * clipboard in plain text format.
- * <p>
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
- public void copy() {
- Point selection = getControlSelection();
- String text = getControlText();
- if (selection == null || text == null)
- return;
-
- int length = selection.y - selection.x;
- if (length > 0) {
- TextTransfer plainTextTransfer = TextTransfer.getInstance();
- try {
- clipboard.setContents(
- new String[] { text.substring(selection.x, selection.y) },
- new Transfer[] { plainTextTransfer });
- } catch (SWTError error) {
- // Copy to clipboard failed. This happens when another application
- // is accessing the clipboard while we copy. Ignore the error.
- }
- }
- }
-
- /**
- * Moves the selected text to the clipboard. The text will be put in the
- * clipboard in plain text format and RTF format.
- * <p>
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
- public void cut(){
- Point selection = getControlSelection();
- if (selection == null)
- return;
-
- if (selection.y > selection.x) {
- copy();
- delete();
- }
- }
-
- /**
- * Deletes the character to the right of the caret. Delete the selected text if any.
- */
- public void delete() {
- Point selection = getControlSelection();
- String text = getControlText();
- if (selection == null || text == null)
- return;
-
- if (selection.x != selection.y) {
- text = text.substring(0, selection.x) + text.substring(selection.y);
- setControlText(text);
- setControlSelection(new Point(selection.x, selection.x));
- }
- }
-
- /**
- * Replaces the selection with the clipboard text or insert the text at
- * the current caret offset if there is no selection.
- * If the widget has the SWT.SINGLE style and the clipboard text contains
- * more than one line, only the first line without line delimiters is
- * inserted in the widget.
- * <p>
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
- public void paste() {
- TextTransfer transfer = TextTransfer.getInstance();
- Point selection = getControlSelection();
- String text = getControlText();
- if (selection == null)
- return;
-
- String newText = (String) clipboard.getContents(transfer);
- if (newText != null && newText.length() > 0) {
- if (text == null)
- text = newText;
- else
- text = text.substring(0, selection.x) + newText + text.substring(selection.y);
- setControlText(text);
-
- // set the selection to the end of the paste
- int x = selection.x + newText.length();
- setControlSelection(new Point(x, x));
- }
- }
-
- /**
- * Execute the action.
- */
- public void run() {
- if (display == null)
- return;
- if (type == CUT_ACTION)
- cut();
- else if (type == COPY_ACTION)
- copy();
- else if (type == PASTE_ACTION)
- paste();
- }
-
- /**
- * Update the actions enabled/disabled state.
- */
- protected void update() {
- if (getControl() == null) {
- setEnabled(false);
- return;
- }
- Point selection = getControlSelection();
- String text = getControlText();
-
- try {
- if (type == CUT_ACTION)
- setEnabled(text != null && text.length() > 0 && selection != null && selection.x < selection.y);
- else if (type == COPY_ACTION)
- setEnabled(text != null && text.length() > 0 && selection != null && selection.x < selection.y);
- else if (type == PASTE_ACTION) {
- Control control = getControl();
- if (!control.isEnabled()) {
- setEnabled(false);
- return;
- }
- if (!(control instanceof Text)) {
- setEnabled(false);
- return;
- }
-
- Text text2 = (Text) control;
- if (!text2.getEditable()) {
- setEnabled(false);
- return;
- }
- TextTransfer transfer = TextTransfer.getInstance();
- String newText = (String) clipboard.getContents(transfer);
- setEnabled(newText != null && newText.length() > 0);
- }
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error updating text action", e);
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/task/AddModuleTask.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/task/AddModuleTask.java
deleted file mode 100644
index 4e2d1d0..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/task/AddModuleTask.java
+++ /dev/null
@@ -1,63 +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.task;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-
-import org.eclipse.wst.server.core.*;
-import org.eclipse.wst.server.core.util.Task;
-import org.eclipse.wst.server.ui.internal.Trace;
-/**
- *
- */
-public class AddModuleTask extends Task {
- protected IModule module;
-
- public AddModuleTask(IModule module) {
- this.module = module;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.server.ui.internal.task.ITask#doTask()
- */
- public void execute(IProgressMonitor monitor) throws CoreException {
- if (module == null)
- return;
-
- IServer server = (IServer) getTaskModel().getObject(TaskModel.TASK_SERVER);
- IModule parentModule = null;
- try {
- IModule[] parents = server.getRootModules(module, monitor);
- if (parents != null && parents.length > 0) {
- parentModule = parents[0];
- }
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Could not find parent module", e);
- }
-
- if (parentModule == null) {
- // Use the original module since no parent module is available.
- parentModule = module;
- }
-
- IModule[] modules = server.getModules();
- int size = modules.length;
- for (int i = 0; i < size; i++) {
- if (parentModule.equals(modules[i]))
- return;
- }
-
- IServerWorkingCopy workingCopy = server.createWorkingCopy();
- workingCopy.modifyModules(new IModule[] { parentModule }, new IModule[0], monitor);
- getTaskModel().putObject(TaskModel.TASK_SERVER, workingCopy.save(false, monitor));
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/task/CompositeTask.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/task/CompositeTask.java
deleted file mode 100644
index 068e14c..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/task/CompositeTask.java
+++ /dev/null
@@ -1,25 +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.task;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.wst.server.core.util.Task;
-/**
- *
- */
-public class CompositeTask extends Task {
- /* (non-Javadoc)
- * @see org.eclipse.wst.server.ui.internal.task.Task#doTask(org.eclipse.core.runtime.IProgressMonitor)
- */
- public void execute(IProgressMonitor monitor) {
- // do nothing
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/task/FinishWizardFragment.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/task/FinishWizardFragment.java
deleted file mode 100644
index f263ff4..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/task/FinishWizardFragment.java
+++ /dev/null
@@ -1,28 +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.task;
-
-import org.eclipse.wst.server.core.ITask;
-import org.eclipse.wst.server.ui.wizard.WizardFragment;
-/**
- *
- */
-public class FinishWizardFragment extends WizardFragment {
- protected ITask finishTask;
-
- public FinishWizardFragment(ITask finishTask) {
- this.finishTask = finishTask;
- }
-
- public ITask createFinishTask() {
- return finishTask;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/task/InputTask.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/task/InputTask.java
deleted file mode 100644
index 0ceb32b..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/task/InputTask.java
+++ /dev/null
@@ -1,37 +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.task;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.wst.server.core.util.Task;
-/**
- *
- */
-public class InputTask extends Task {
- protected String[] ids;
- protected Object[] values;
-
- public InputTask(String id, Object value) {
- this(new String[] { id }, new Object[] { value });
- }
-
- public InputTask(String[] ids, Object[] values) {
- this.ids = ids;
- this.values = values;
- }
-
- public void execute(IProgressMonitor monitor) {
- int size = ids.length;
- for (int i = 0; i < size; i++) {
- getTaskModel().putObject(ids[i], values[i]);
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/task/InputWizardFragment.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/task/InputWizardFragment.java
deleted file mode 100644
index 39d70c7..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/task/InputWizardFragment.java
+++ /dev/null
@@ -1,46 +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.task;
-
-import org.eclipse.wst.server.core.TaskModel;
-import org.eclipse.wst.server.ui.wizard.WizardFragment;
-/**
- *
- */
-public class InputWizardFragment extends WizardFragment {
- protected String[] ids;
- protected Object[] values;
-
- public InputWizardFragment(String id, Object value) {
- this(new String[] { id }, new Object[] { value });
- }
-
- public InputWizardFragment(String[] ids, Object[] values) {
- this.ids = ids;
- this.values = values;
- }
-
- /*public void enter() {
- int size = ids.length;
- for (int i = 0; i < size; i++)
- getTaskModel().putObject(ids[i], values[i]);
- }*/
-
- public void setTaskModel(TaskModel taskModel) {
- super.setTaskModel(taskModel);
- if (taskModel == null)
- return;
-
- int size = ids.length;
- for (int i = 0; i < size; i++)
- taskModel.putObject(ids[i], values[i]);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/task/ModifyModulesTask.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/task/ModifyModulesTask.java
deleted file mode 100644
index 9717898..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/task/ModifyModulesTask.java
+++ /dev/null
@@ -1,93 +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.task;
-
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.wst.server.core.*;
-import org.eclipse.wst.server.core.internal.ProjectProperties;
-import org.eclipse.wst.server.core.model.IRunningActionServer;
-import org.eclipse.wst.server.core.util.Task;
-import org.eclipse.wst.server.ui.internal.EclipseUtil;
-/**
- *
- */
-public class ModifyModulesTask extends Task {
- protected List add;
- protected List remove;
-
- public ModifyModulesTask() {
- // do nothing
- }
-
- public void setAddModules(List add) {
- this.add = add;
- }
-
- public void setRemoveModules(List remove) {
- this.remove = remove;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.server.ui.internal.task.ITask#doTask()
- */
- public void execute(IProgressMonitor monitor) throws CoreException {
- if ((add == null || add.isEmpty()) && (remove == null || remove.isEmpty()))
- return;
-
- IServerWorkingCopy workingCopy = (IServerWorkingCopy) getTaskModel().getObject(TaskModel.TASK_SERVER);
-
- IRunningActionServer ras = (IRunningActionServer) workingCopy.getAdapter(IRunningActionServer.class);
- if (ras != null) {
- IServer server = workingCopy.getOriginal();
- int state = server.getServerState();
- if (state == IServer.STATE_STOPPED || state == IServer.STATE_UNKNOWN) {
- String mode = (String) getTaskModel().getObject(TaskModel.TASK_LAUNCH_MODE);
- if (mode == null || mode.length() == 0)
- mode = ILaunchManager.DEBUG_MODE;
-
- server.synchronousStart(mode, monitor);
- }
- }
-
- // modify modules
- IModule[] remove2 = new IModule[0];
- if (remove != null) {
- remove2 = new IModule[remove.size()];
- remove.toArray(remove2);
- }
-
- IModule[] add2 = new IModule[0];
- if (add != null) {
- add2 = new IModule[add.size()];
- add.toArray(add2);
- }
-
- IFile file = workingCopy.getFile();
- if (file != null) {
- IProject project = file.getProject();
-
- if (!file.getProject().exists())
- EclipseUtil.createNewServerProject(null, project.getName(), null, monitor);
-
- ProjectProperties pp = (ProjectProperties) ServerCore.getProjectProperties(project);
- if (!pp.isServerProject())
- pp.setServerProject(true, monitor);
- }
-
- workingCopy.modifyModules(add2, remove2, monitor);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/task/SaveRuntimeTask.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/task/SaveRuntimeTask.java
deleted file mode 100644
index 35689c2..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/task/SaveRuntimeTask.java
+++ /dev/null
@@ -1,38 +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.task;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.IRuntimeWorkingCopy;
-import org.eclipse.wst.server.core.TaskModel;
-import org.eclipse.wst.server.core.util.Task;
-/**
- *
- */
-public class SaveRuntimeTask extends Task {
- public SaveRuntimeTask() {
- // do nothing
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.server.ui.internal.task.ITask#doTask()
- */
- public void execute(IProgressMonitor monitor) throws CoreException {
- IRuntime runtime = (IRuntime) getTaskModel().getObject(TaskModel.TASK_RUNTIME);
- if (runtime != null && runtime instanceof IRuntimeWorkingCopy) {
- IRuntimeWorkingCopy workingCopy = (IRuntimeWorkingCopy) runtime;
- if (workingCopy.isDirty())
- getTaskModel().putObject(TaskModel.TASK_RUNTIME, workingCopy.save(false, monitor));
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/task/SaveServerTask.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/task/SaveServerTask.java
deleted file mode 100644
index 1c35b26..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/task/SaveServerTask.java
+++ /dev/null
@@ -1,52 +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.task;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.wst.server.core.*;
-import org.eclipse.wst.server.core.internal.ProjectProperties;
-import org.eclipse.wst.server.core.util.Task;
-import org.eclipse.wst.server.ui.internal.EclipseUtil;
-/**
- *
- */
-public class SaveServerTask extends Task {
- public SaveServerTask() {
- // do nothing
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.server.ui.internal.task.ITask#doTask()
- */
- public void execute(IProgressMonitor monitor) throws CoreException {
- IServer server = (IServer) getTaskModel().getObject(TaskModel.TASK_SERVER);
- if (server != null && server instanceof IServerWorkingCopy) {
- IServerWorkingCopy workingCopy = (IServerWorkingCopy) server;
- if (workingCopy.isDirty()) {
- IFile file = workingCopy.getFile();
- if (file != null) {
- IProject project = file.getProject();
-
- if (!file.getProject().exists())
- EclipseUtil.createNewServerProject(null, project.getName(), null, monitor);
-
- ProjectProperties pp = (ProjectProperties) ServerCore.getProjectProperties(project);
- if (!pp.isServerProject())
- pp.setServerProject(true, monitor);
- }
- getTaskModel().putObject(TaskModel.TASK_SERVER, workingCopy.save(false, monitor));
- }
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/task/TempSaveRuntimeTask.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/task/TempSaveRuntimeTask.java
deleted file mode 100644
index a62226e..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/task/TempSaveRuntimeTask.java
+++ /dev/null
@@ -1,41 +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.task;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.IRuntimeWorkingCopy;
-import org.eclipse.wst.server.core.TaskModel;
-import org.eclipse.wst.server.core.util.Task;
-/**
- *
- */
-public class TempSaveRuntimeTask extends Task {
- public TempSaveRuntimeTask() {
- // do nothing
- }
-
- /* (non-Javadoc)
- * @see com.ibm.wtp.server.ui.internal.task.ITask#doTask()
- */
- public void execute(IProgressMonitor monitor) throws CoreException {
- IRuntime runtime = (IRuntime) getTaskModel().getObject(TaskModel.TASK_RUNTIME);
- if (runtime != null && runtime instanceof IRuntimeWorkingCopy) {
- IRuntimeWorkingCopy workingCopy = (IRuntimeWorkingCopy) runtime;
- if (!workingCopy.isDirty())
- return;
-
- runtime = workingCopy.save(false, monitor);
- getTaskModel().putObject(TaskModel.TASK_RUNTIME, runtime.createWorkingCopy());
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/task/TempSaveServerTask.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/task/TempSaveServerTask.java
deleted file mode 100644
index 6f5140d..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/task/TempSaveServerTask.java
+++ /dev/null
@@ -1,63 +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.task;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.wst.server.core.*;
-import org.eclipse.wst.server.core.internal.ProjectProperties;
-import org.eclipse.wst.server.core.internal.Server;
-import org.eclipse.wst.server.core.util.Task;
-import org.eclipse.wst.server.ui.internal.EclipseUtil;
-/**
- *
- */
-public class TempSaveServerTask extends Task {
- public TempSaveServerTask() {
- // do nothing
- }
-
- /* (non-Javadoc)
- * @see com.ibm.wtp.server.ui.internal.task.ITask#doTask()
- */
- public void execute(IProgressMonitor monitor) throws CoreException {
- IServer server = (IServer) getTaskModel().getObject(TaskModel.TASK_SERVER);
- if (server != null && server instanceof IServerWorkingCopy) {
- IServerWorkingCopy workingCopy = (IServerWorkingCopy) server;
- if (!workingCopy.isDirty())
- return;
-
- IFile file = workingCopy.getFile();
- if (file != null) {
- IProject project = file.getProject();
-
- if (!file.getProject().exists())
- EclipseUtil.createNewServerProject(null, project.getName(), null, monitor);
-
- ProjectProperties pp = (ProjectProperties) ServerCore.getProjectProperties(project);
- if (!pp.isServerProject())
- pp.setServerProject(true, monitor);
- }
- IRuntime runtime = workingCopy.getRuntime();
-
- server = workingCopy.save(false, monitor);
- workingCopy = server.createWorkingCopy();
-
- workingCopy.setRuntime(runtime);
- if (workingCopy.getServerType().hasServerConfiguration()) {
- ((Server)workingCopy).importConfiguration(runtime, null);
- }
- getTaskModel().putObject(TaskModel.TASK_SERVER, workingCopy);
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/AbstractServerAction.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/AbstractServerAction.java
deleted file mode 100644
index a70e2f7..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/AbstractServerAction.java
+++ /dev/null
@@ -1,81 +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.servers;
-
-import java.util.Iterator;
-
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.actions.SelectionProviderAction;
-
-import org.eclipse.wst.server.core.IServer;
-/**
- * An abstract class for an action on a server.
- */
-public abstract class AbstractServerAction extends SelectionProviderAction {
- public Shell shell;
-
- public AbstractServerAction(Shell shell, ISelectionProvider selectionProvider, String name) {
- super(selectionProvider, name);
- this.shell = shell;
- setEnabled(false);
- }
-
- /**
- * Return true if this server can currently be acted on.
- *
- * @return boolean
- * @param server org.eclipse.wst.server.core.IServer
- */
- public abstract boolean accept(IServer server);
-
- /**
- * Perform action on this server.
- * @param server org.eclipse.wst.server.core.IServer
- */
- public abstract void perform(IServer server);
-
- public void run() {
- Iterator iterator = getStructuredSelection().iterator();
- Object obj = iterator.next();
- if (obj instanceof IServer) {
- IServer server = (IServer) obj;
- if (accept(server))
- perform(server);
- selectionChanged(getStructuredSelection());
- }
- }
-
- /**
- * Update the enable state.
- */
- public void selectionChanged(IStructuredSelection sel) {
- if (sel.isEmpty()) {
- setEnabled(false);
- return;
- }
- boolean enabled = false;
- Iterator iterator = sel.iterator();
- while (iterator.hasNext()) {
- Object obj = iterator.next();
- if (obj instanceof IServer) {
- IServer server = (IServer) obj;
- if (accept(server))
- enabled = true;
- } else {
- setEnabled(false);
- return;
- }
- }
- setEnabled(enabled);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/DeleteAction.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/DeleteAction.java
deleted file mode 100644
index c38aff7..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/DeleteAction.java
+++ /dev/null
@@ -1,84 +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.servers;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.jface.action.Action;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.ServerCore;
-import org.eclipse.wst.server.ui.internal.DeleteServerDialog;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-import org.eclipse.swt.widgets.Shell;
-/**
- * Action for deleting server resources.
- */
-public class DeleteAction extends Action {
- protected IServer[] servers;
- protected IFolder[] configs;
- protected Shell shell;
-
- /**
- * DeleteAction constructor comment.
- */
- public DeleteAction(Shell shell, IServer server) {
- this(shell, new IServer[] { server });
- }
-
- /**
- * DeleteAction constructor comment.
- */
- public DeleteAction(Shell shell, IServer[] servers) {
- super(ServerUIPlugin.getResource("%actionDelete"));
- this.shell = shell;
-
- this.servers = servers;
-
- List list = new ArrayList();
-
- int size = servers.length;
- for (int i = 0; i < size; i++) {
- if (servers[i].getServerConfiguration() != null)
- list.add(servers[i].getServerConfiguration());
- }
-
- // remove configurations that are still referenced by other servers
- IServer[] servers2 = ServerCore.getServers();
- if (servers2 != null) {
- int size2 = servers2.length;
- for (int j = 0; j < size2; j++) {
- boolean found = false;
- for (int i = 0; i < size; i++) {
- if (servers[i].equals(servers2[j]))
- found = true;
- }
- if (!found) {
- IFolder folder = servers2[j].getServerConfiguration();
- if (folder != null && list.contains(folder))
- list.remove(folder);
- }
- }
- }
-
- configs = new IFolder[list.size()];
- list.toArray(configs);
- }
-
- /**
- * Invoked when an action occurs.
- */
- public void run() {
- DeleteServerDialog dsd = new DeleteServerDialog(shell, servers, configs);
- dsd.open();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ModuleSloshAction.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ModuleSloshAction.java
deleted file mode 100644
index ab77141..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ModuleSloshAction.java
+++ /dev/null
@@ -1,48 +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.servers;
-
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.swt.widgets.Shell;
-
-import org.eclipse.wst.server.core.IServer;
-/**
- *
- */
-public class ModuleSloshAction extends AbstractServerAction {
- public ModuleSloshAction(Shell shell, ISelectionProvider selectionProvider, String name) {
- super(shell, selectionProvider, name);
- }
-
- /**
- * Return true if this server can currently be acted on.
- * @return boolean
- * @param server org.eclipse.wst.server.core.IServer
- */
- public boolean accept(IServer server) {
- return true;
- }
-
- /**
- * Perform action on this server.
- * @param server org.eclipse.wst.server.core.IServer
- */
- public void perform(final IServer server) {
- /*if (!ServerUIUtil.promptIfDirty(shell, server))
- return;
-
- IServerConfiguration configuration = ServerUtil.getServerConfiguration(server);
- ModifyModulesWizard wizard = new ModifyModulesWizard(configuration);
- ClosableWizardDialog dialog = new ClosableWizardDialog(shell, wizard);
- if (dialog.open() == Window.CANCEL)
- return;*/
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/MonitorServerAction.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/MonitorServerAction.java
deleted file mode 100644
index 007d466..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/MonitorServerAction.java
+++ /dev/null
@@ -1,41 +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.servers;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.swt.widgets.Shell;
-
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-/**
- * Action for monitoring a server.
- */
-public class MonitorServerAction extends Action {
- protected IServer server;
- protected Shell shell;
-
- /**
- * MonitorServerAction constructor comment.
- */
- public MonitorServerAction(Shell shell, IServer server) {
- super(ServerUIPlugin.getResource("%actionMonitorProperties"));
- this.shell = shell;
- this.server = server;
- }
-
- /**
- * Invoked when an action occurs.
- */
- public void run() {
- MonitorServerDialog msd = new MonitorServerDialog(shell, server);
- msd.open();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/MonitorServerDialog.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/MonitorServerDialog.java
deleted file mode 100644
index 46cb485..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/MonitorServerDialog.java
+++ /dev/null
@@ -1,87 +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.servers;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-import org.eclipse.wst.server.ui.internal.viewers.MonitorComposite;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-/**
- * Dialog that prompts a user to monitor ports from a given server.
- */
-public class MonitorServerDialog extends Dialog {
- protected IServer server;
- protected MonitorComposite monitorComp;
-
- /**
- * MonitorServerDialog constructor comment.
- * @param parentShell org.eclipse.swt.widgets.Shell
- * @
- */
- public MonitorServerDialog(Shell parentShell, IServer server) {
- super(parentShell);
- this.server = server;
-
- setBlockOnOpen(true);
- }
-
- /**
- *
- */
- protected void configureShell(Shell newShell) {
- super.configureShell(newShell);
- newShell.setText(ServerUIPlugin.getResource("%dialogMonitorTitle"));
- }
-
- protected void createButtonsForButtonBar(Composite parent) {
- createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
- }
-
- /**
- *
- */
- protected Control createDialogArea(Composite parent) {
- // create a composite with standard margins and spacing
- Composite composite = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
- layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
- layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
- layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
- composite.setLayout(layout);
- GridData data = new GridData(GridData.FILL_BOTH);
- data.widthHint = 550;
- composite.setLayoutData(data);
- composite.setFont(parent.getFont());
- //WorkbenchHelp.setHelp(composite, ContextIds.TERMINATE_SERVER_DIALOG);
-
- Label label = new Label(composite, SWT.WRAP);
- label.setText(ServerUIPlugin.getResource("%dialogMonitorDescription", new String[] { server.getName() } ));
- data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- label.setLayoutData(data);
-
- monitorComp = new MonitorComposite(composite, SWT.NONE, null, server);
- monitorComp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL));
-
- Dialog.applyDialogFont(composite);
-
- return composite;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/MonitorServerPortAction.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/MonitorServerPortAction.java
deleted file mode 100644
index 6dbae79..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/MonitorServerPortAction.java
+++ /dev/null
@@ -1,71 +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.servers;
-
-import org.eclipse.jface.action.Action;
-
-import org.eclipse.wst.server.core.*;
-import org.eclipse.wst.server.core.internal.IMonitoredServerPort;
-import org.eclipse.wst.server.core.internal.IServerMonitorManager;
-import org.eclipse.wst.server.core.internal.ServerMonitorManager;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-import org.eclipse.wst.server.ui.internal.Trace;
-import org.eclipse.swt.widgets.Shell;
-/**
- * Monitor a server port.
- */
-public class MonitorServerPortAction extends Action {
- protected Shell shell;
- protected IServer server;
- protected IServerPort port;
- protected IMonitoredServerPort monitoredPort;
- protected boolean checked;
-
- public MonitorServerPortAction(Shell shell, IServer server, IServerPort port) {
- super(ServerUIPlugin.getResource("%actionMonitorPort", new String[] { port.getPort() + "", port.getName() }));
-
- this.shell = shell;
- this.server = server;
- this.port = port;
-
- IMonitoredServerPort[] msps = ServerMonitorManager.getInstance().getMonitoredPorts(server);
- if (msps != null) {
- int size = msps.length;
- for (int i = 0; i < size; i++) {
- if (port.equals(msps[i].getServerPort()) && msps[i].isStarted() &&
- (msps[i].getContentTypes() == null || (port.getContentTypes() != null && msps[i].getContentTypes().length == port.getContentTypes().length)))
- monitoredPort = msps[i];
- }
- }
-
- checked = monitoredPort != null && monitoredPort.isStarted();
- setChecked(checked);
- }
-
- /**
- * Enable or disable monitoring.
- */
- public void run() {
- IServerMonitorManager smm = ServerMonitorManager.getInstance();
- if (checked) {
- smm.removeMonitor(monitoredPort);
- } else {
- if (monitoredPort == null)
- monitoredPort = smm.createMonitor(server, port, -1, null);
-
- try {
- smm.startMonitor(monitoredPort);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not monitor", e);
- }
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/OpenAction.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/OpenAction.java
deleted file mode 100644
index 0aee66a..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/OpenAction.java
+++ /dev/null
@@ -1,43 +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.servers;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-import org.eclipse.wst.server.ui.internal.Trace;
-/**
- * "Open" menu action.
- */
-public class OpenAction extends Action {
- protected IServer server;
-
- /**
- * OpenAction constructor comment.
- */
- public OpenAction(IServer server) {
- super(ServerUIPlugin.getResource("%actionOpen"));
-
- this.server = server;
- setEnabled(server.getServerType() != null);
- }
-
- /**
- * Implementation of method defined on <code>IAction</code>.
- */
- public void run() {
- try {
- ServerUIPlugin.editServer(server);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error editing element", e);
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/PublishAction.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/PublishAction.java
deleted file mode 100644
index acc0473..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/PublishAction.java
+++ /dev/null
@@ -1,55 +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.servers;
-
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.internal.PublishServerJob;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-import org.eclipse.swt.widgets.Shell;
-/**
- * Publish to a server.
- */
-public class PublishAction extends AbstractServerAction {
- public PublishAction(Shell shell, ISelectionProvider selectionProvider, String name) {
- super(shell, selectionProvider, name);
- try {
- selectionChanged((IStructuredSelection) selectionProvider.getSelection());
- } catch (Exception e) {
- // ignore
- }
- }
-
- /**
- * Return true if this server can currently be acted on.
- * @return boolean
- * @param server org.eclipse.wst.server.core.IServer
- */
- public boolean accept(IServer server) {
- return server.canPublish().isOK();
- }
-
- /**
- * Perform action on this server.
- * @param server org.eclipse.wst.server.core.IServer
- */
- public void perform(final IServer server) {
- if (!ServerUIPlugin.promptIfDirty(shell, server))
- return;
-
- if (!ServerUIPlugin.saveEditors())
- return;
-
- PublishServerJob publishJob = new PublishServerJob(server, IServer.PUBLISH_INCREMENTAL, false);
- publishJob.schedule();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/RestartAction.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/RestartAction.java
deleted file mode 100644
index 9ecbd43..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/RestartAction.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.servers;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.IServerType;
-import org.eclipse.wst.server.core.internal.PublishServerJob;
-import org.eclipse.wst.server.ui.internal.RestartServerJob;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-import org.eclipse.swt.widgets.Shell;
-/**
- * Restart a server.
- */
-public class RestartAction extends AbstractServerAction {
- protected String mode;
-
- public RestartAction(Shell shell, ISelectionProvider selectionProvider, String name) {
- this(shell, selectionProvider, name, null);
- }
-
- public RestartAction(Shell shell, ISelectionProvider selectionProvider, String name, String mode) {
- super(shell, selectionProvider, name);
- try {
- selectionChanged((IStructuredSelection) selectionProvider.getSelection());
- } catch (Exception e) {
- // ignore
- }
- this.mode = mode;
- }
-
- /**
- * Return true if this server can currently be acted on.
- *
- * @return boolean
- * @param server org.eclipse.wst.server.core.IServer
- */
- public boolean accept(IServer server) {
- String mode2 = mode;
- if (mode2 == null)
- mode2 = server.getMode();
- return server.getServerType() != null && server.getServerType().getServerStateSet() == IServerType.SERVER_STATE_SET_MANAGED && server.canRestart(mode2).isOK();
- }
-
- /**
- * Perform action on this server.
- * @param server org.eclipse.wst.server.core.IServer
- */
- public void perform(IServer server) {
- if (!ServerUIPlugin.promptIfDirty(shell, server))
- return;
-
- IProgressMonitor pm = Platform.getJobManager().createProgressGroup();
- try {
- pm.beginTask("Restarting", 100);
- PublishServerJob publishJob = new PublishServerJob(server);
- publishJob.setProgressGroup(pm, 50);
- publishJob.schedule();
- String launchMode = mode;
- if (launchMode == null)
- launchMode = server.getMode();
- RestartServerJob restartJob = new RestartServerJob(server, launchMode);
- restartJob.setProgressGroup(pm, 50);
- restartJob.schedule();
- } catch (Exception e) {
- // ignore
- } finally {
- pm.done();
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/RestartModuleAction.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/RestartModuleAction.java
deleted file mode 100644
index d6eb19a..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/RestartModuleAction.java
+++ /dev/null
@@ -1,68 +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.servers;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jface.action.Action;
-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.ui.internal.EclipseUtil;
-/**
- * Restart a module on a server.
- */
-public class RestartModuleAction extends Action {
- protected IServer server;
- protected IModule module;
-
- public RestartModuleAction(IServer server, IModule module) {
- super();
- this.server = server;
- this.module = module;
-
- setText(module.getName());
-
- IProject project = module.getProject();
- if (project != null) {
- ImageDescriptor descriptor = EclipseUtil.getProjectImageDescriptor(project);
- if (descriptor != null)
- setImageDescriptor(descriptor);
- }
-
- // enable or disable
- if (server == null || module == null) {
- setEnabled(false);
- return;
- }
-
- /*if (!(dr.getServerState() == IServer2.STATE_STARTED ||
- dr.getServerState() == IServer2.STATE_STARTED_DEBUG) ||
- !dr.canRestartModule(module)) {
- setEnabled(false);
- return;
- }*/
-
- setEnabled(server.canRestartModule(module).isOK());
- }
-
- /**
- * Implementation of method defined on <code>IAction</code>.
- */
- public void run() {
- try {
- server.restartModule(module, new NullProgressMonitor());
- } catch (CoreException e) {
- // ignore
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ServerTableLabelProvider.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ServerTableLabelProvider.java
deleted file mode 100644
index 81a5afc..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ServerTableLabelProvider.java
+++ /dev/null
@@ -1,243 +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.servers;
-
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.IServerType;
-import org.eclipse.wst.server.ui.internal.DefaultServerLabelDecorator;
-import org.eclipse.wst.server.ui.internal.ImageResource;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-import org.eclipse.swt.graphics.Image;
-/**
- * Server table label provider.
- */
-public class ServerTableLabelProvider implements ITableLabelProvider {
- 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)
- };
-
- private static final String[] serverStateUnmanaged = new String[] {
- "",
- ServerUIPlugin.getResource("%viewStatusStarting4"),
- ServerUIPlugin.getResource("%viewStatusStarted2"),
- ServerUIPlugin.getResource("%viewStatusStopping4"),
- ServerUIPlugin.getResource("%viewStatusStopped2")};
-
- public static final String[] syncState = new String[] {
- ServerUIPlugin.getResource("%viewSyncOkay"),
- ServerUIPlugin.getResource("%viewSyncRestart"),
- ServerUIPlugin.getResource("%viewSyncPublish"),
- ServerUIPlugin.getResource("%viewSyncRestartPublish"),
- ServerUIPlugin.getResource("%viewSyncPublishing")};
-
- public static final String[] syncStateUnmanaged = new String[] {
- ServerUIPlugin.getResource("%viewSyncOkay2"),
- ServerUIPlugin.getResource("%viewSyncRestart2"),
- ServerUIPlugin.getResource("%viewSyncPublish2"),
- ServerUIPlugin.getResource("%viewSyncRestartPublish2"),
- ServerUIPlugin.getResource("%viewSyncPublishing2")};
-
- private static final String[] startingText = new String[] {
- ServerUIPlugin.getResource("%viewStatusStarting1"),
- ServerUIPlugin.getResource("%viewStatusStarting2"),
- ServerUIPlugin.getResource("%viewStatusStarting3")};
-
- private static final String[] stoppingText = new String[] {
- ServerUIPlugin.getResource("%viewStatusStopping1"),
- ServerUIPlugin.getResource("%viewStatusStopping2"),
- ServerUIPlugin.getResource("%viewStatusStopping3")};
-
- private int count = 0;
-
- protected DefaultServerLabelDecorator decorator = new DefaultServerLabelDecorator();
-
- protected IServer defaultServer;
-
- /**
- * ServerTableLabelProvider constructor comment.
- */
- public ServerTableLabelProvider() {
- super();
- }
-
- public void addListener(ILabelProviderListener listener) {
- // do nothing
- }
-
- public void dispose() {
- decorator.dispose();
- }
-
- public void setDefaultServer(IServer ds) {
- defaultServer = ds;
- }
-
- public IServer getDefaultServer() {
- return defaultServer;
- }
-
- public Image getColumnImage(Object element, int columnIndex) {
- IServer server = (IServer) element;
- if (columnIndex == 0) {
- if (server.getServerType() != null) {
- Image image = ImageResource.getImage(server.getServerType().getId());
- if (defaultServer != null && defaultServer.equals(server)) {
- Image decorated = decorator.decorateImage(image, element);
- if (decorated != null)
- return decorated;
- }
- return image;
- }
- return null;
- } else if (columnIndex == 2) {
- IServerType serverType = server.getServerType();
- if (serverType == null)
- return null;
- if (serverType.getServerStateSet() == IServerType.SERVER_STATE_SET_PUBLISHED)
- return null;
- return getServerStateImage(server);
- } else
- return null;
- }
-
- public String getColumnText(Object element, int columnIndex) {
- IServer server = (IServer) element;
- if (columnIndex == 0)
- return notNull(server.getName());
- else if (columnIndex == 1) {
- return notNull(server.getHost());
- } else if (columnIndex == 2) {
- IServerType serverType = server.getServerType();
- if (serverType != null)
- return getServerStateLabel(server, serverType.getServerStateSet());
-
- return "";
- } else if (columnIndex == 3) {
- if (server.getServerType() == null)
- return "";
-
- //if (server.getServerType().hasServerConfiguration() && server.getServerConfiguration() == null)
- // return ServerUIPlugin.getResource("%viewNoConfiguration");
-
- if (server.getServerState() == IServer.STATE_UNKNOWN)
- return "";
-
- String serverId = server.getId();
- if (ServerTableViewer.publishing.contains(serverId))
- return syncState[4];
-
- int i = 0;
- if (server.getServerRestartState())
- i = 1;
-
- // republish
- if (server.getServerPublishState() != IServer.PUBLISH_STATE_NONE)
- i += 2;
-
- IServerType serverType = server.getServerType();
- if (serverType.getServerStateSet() == IServerType.SERVER_STATE_SET_MANAGED)
- return syncState[i];
- return syncStateUnmanaged[i];
- } else
- return "X";
- }
-
- protected String notNull(String s) {
- if (s == null)
- return "";
- return s;
- }
-
- public boolean isLabelProperty(Object element, String property) {
- return false;
- }
-
- public void removeListener(ILabelProviderListener listener) {
- // do nothing
- }
-
- /**
- * Returns an image representing the server's state.
- * @return org.eclipse.jface.parts.IImage
- * @param server org.eclipse.wst.server.core.IServer
- */
- protected Image getServerStateImage(IServer server) {
- int state = server.getServerState();
- 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);
- }
- }
-
- /**
- * Returns a string representing the server's state.
- *
- * @return java.lang.String
- * @param server org.eclipse.wst.server.core.IServer
- */
- protected String getServerStateLabel(IServer server, int stateSet) {
- if (stateSet == IServerType.SERVER_STATE_SET_PUBLISHED)
- return "";
-
- int state = server.getServerState();
- if (stateSet == IServerType.SERVER_STATE_SET_MANAGED) {
- 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) {
- String mode = server.getMode();
- if (ILaunchManager.DEBUG_MODE.equals(mode))
- return ServerUIPlugin.getResource("%viewStatusStartedDebug");
- else if (ILaunchManager.PROFILE_MODE.equals(mode))
- return ServerUIPlugin.getResource("%viewStatusStartedProfile");
- else
- return ServerUIPlugin.getResource("%viewStatusStarted");
- } else if (state == IServer.STATE_STOPPED)
- return ServerUIPlugin.getResource("%viewStatusStopped");
- }
-
- return serverStateUnmanaged[state];
- }
-
- protected void animate() {
- count ++;
- if (count > 2)
- count = 0;
- }
-}
\ No newline at end of file
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
deleted file mode 100644
index 92809f2..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ServerTableViewer.java
+++ /dev/null
@@ -1,457 +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.servers;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.viewers.*;
-
-import org.eclipse.wst.server.core.*;
-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.Table;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.ISelectionListener;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.actions.ActionFactory;
-/**
- * Tree view showing servers and their associations.
- */
-public class ServerTableViewer extends TableViewer {
- protected static final String ROOT = "root";
-
- protected IServerLifecycleListener serverResourceListener;
- protected IPublishListener publishListener;
- protected IServerListener serverListener;
-
- protected static Object deletedElement = null;
-
- // servers that are currently publishing and starting
- protected static List publishing = new ArrayList();
- protected static List starting = new ArrayList();
-
- protected ServerTableLabelProvider labelProvider;
- protected ISelectionListener dsListener;
-
- protected ServersView view;
-
- public class ServerContentProvider implements IStructuredContentProvider {
- public Object[] getElements(Object inputElement) {
- List list = new ArrayList();
- IServer[] servers = ServerCore.getServers();
- if (servers != null) {
- int size = servers.length;
- for (int i = 0; i < size; i++) {
- if (!servers[i].isPrivate())
- list.add(servers[i]);
- }
- }
- return list.toArray();
- }
-
- public void inputChanged(Viewer theViewer, Object oldInput, Object newInput) {
- // do nothing
- }
-
- public void dispose() {
- // do nothing
- }
- }
-
- /*protected void createHover(Shell parent, Point p) {
- final Shell fShell = new Shell(parent, SWT.NO_FOCUS | SWT.ON_TOP | SWT.RESIZE | SWT.NO_TRIM);
- GridLayout layout = new GridLayout();
- layout.marginHeight = 1;
- layout.marginWidth = 1;
- fShell.setLayout(layout);
-
- Display display = parent.getDisplay();
- StyledText text = new StyledText(fShell, SWT.NONE);
- text.setForeground(display.getSystemColor(SWT.COLOR_INFO_FOREGROUND));
- text.setBackground(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND));
- text.append("Testing <b>me</b>");
-
- fShell.setLocation(p.x, p.y);
- fShell.setBackground(display.getSystemColor(SWT.COLOR_BLACK));
- fShell.pack();
- fShell.setVisible(true);
-
- Thread t = new Thread() {
- public void run() {
- try {
- Thread.sleep(2000);
- } catch (Exception e) { }
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- fShell.dispose();
- }
- });
- }
- };
- t.start();
- }*/
-
- protected Thread thread = null;
- protected boolean stopThread = false;
-
- protected void startThread() {
- stopThread = false;
- if (thread != null)
- return;
-
- thread = new Thread("Servers view animator") {
- public void run() {
- while (!stopThread) {
- try {
- labelProvider.animate();
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (getTable() != null && !getTable().isDisposed())
- refresh();
- }
- });
- Thread.sleep(200);
- } catch (Exception e) {
- Trace.trace(Trace.FINEST, "Error in animated server view", e);
- }
- thread = null;
- }
- }
- };
- thread.setDaemon(true);
- thread.start();
- }
-
- protected void stopThread() {
- stopThread = true;
- }
-
- /**
- * ServerTableViewer constructor comment.
- */
- public ServerTableViewer(final ServersView view, final Table table) {
- super(table);
- this.view = view;
- /*table.addMouseTrackListener(new MouseTrackListener() {
- public void mouseEnter(MouseEvent event) {
- }
-
- public void mouseExit(MouseEvent event) {
- }
-
- public void mouseHover(MouseEvent event) {
- createHover(table.getShell(), table.toDisplay(event.x, event.y));
- }
- });*/
-
- setContentProvider(new ServerContentProvider());
- labelProvider = new ServerTableLabelProvider();
- setLabelProvider(labelProvider);
- setSorter(new ViewerSorter() {
- // empty
- });
-
- setInput(ROOT);
-
- addListeners();
-
- IActionBars actionBars = view.getViewSite().getActionBars();
- actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), new ServerTreeAction(getControl().getShell(), this, "Delete it!", ServerTree.ACTION_DELETE));
-
- dsListener = new ISelectionListener() {
- public void selectionChanged(IWorkbenchPart part, ISelection selection) {
- if (!(selection instanceof IStructuredSelection))
- return;
- IStructuredSelection sel = (IStructuredSelection) selection;
- final Object obj = sel.getFirstElement();
- IProject proj = null;
- if (obj instanceof IResource) {
- IResource res = (IResource) obj;
- proj = res.getProject();
- }
- if (proj == null) {
- try {
- IResource res = (IResource) Platform.getAdapterManager().getAdapter(obj, IResource.class);
- if (res != null)
- proj = res.getProject();
- } catch (Exception e) {
- // ignore
- }
- }
- if (proj != null) {
- final IProject project = proj;
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (getTable() == null || getTable().isDisposed())
- return;
-
- IServer defaultServer = null;
- if (project != null) {
- IProjectProperties props = ServerCore.getProjectProperties(project);
- defaultServer = props.getDefaultServer();
- }
- IServer oldDefaultServer = labelProvider.getDefaultServer();
- if ((oldDefaultServer == null && defaultServer == null)
- || (oldDefaultServer != null && oldDefaultServer.equals(defaultServer)))
- return;
- labelProvider.setDefaultServer(defaultServer);
-
- if (oldDefaultServer != null)
- refresh(oldDefaultServer);
- if (defaultServer != null)
- refresh(defaultServer);
- }
- });
- }
- }
- };
- view.getViewSite().getPage().addSelectionListener(dsListener);
- }
-
- protected void addListeners() {
- serverResourceListener = new IServerLifecycleListener() {
- public void serverAdded(IServer server) {
- addServer(server);
- server.addServerListener(serverListener);
- ((Server) server).addPublishListener(publishListener);
- }
- public void serverChanged(IServer server) {
- refreshServer(server);
- }
- public void serverRemoved(IServer server) {
- removeServer(server);
- server.removeServerListener(serverListener);
- ((Server) server).removePublishListener(publishListener);
- }
- };
- ServerCore.addServerLifecycleListener(serverResourceListener);
-
- publishListener = new PublishAdapter() {
- public void publishStarted(IServer server) {
- handlePublishChange(server, true);
- }
-
- public void publishFinished(IServer server, IStatus status) {
- handlePublishChange(server, false);
- }
- };
-
- serverListener = new IServerListener() {
- public void moduleStateChange(IServer server, IModule[] parents, IModule module) {
- refreshServer(server);
- }
-
- public void serverStateChange(IServer server) {
- refreshServer(server);
- int state = server.getServerState();
- String id = server.getId();
- if (state == IServer.STATE_STARTING || state == IServer.STATE_STOPPING) {
- if (!starting.contains(id)) {
- if (starting.isEmpty())
- startThread();
- starting.add(id);
- }
- } else {
- if (starting.contains(id)) {
- starting.remove(id);
- if (starting.isEmpty())
- stopThread();
- }
- }
- }
- public void configurationSyncStateChange(IServer server) {
- refreshServer(server);
- }
- public void restartStateChange(IServer server) {
- refreshServer(server);
- }
- public void modulesChanged(IServer server) {
- handleServerModulesChanged(server);
- }
- public void moduleStateChange(IServer server, IModule module) {
- // do nothing
- }
- };
-
- // add listeners to servers
- IServer[] servers = ServerCore.getServers();
- if (servers != null) {
- int size = servers.length;
- for (int i = 0; i < size; i++) {
- servers[i].addServerListener(serverListener);
- ((Server) servers[i]).addPublishListener(publishListener);
- }
- }
- }
-
- /**
- * Respond to a configuration being added or deleted.
- * @param configuration org.eclipse.wst.server.core.IServerConfiguration
- * @param add boolean
- */
- /*protected void configurationChange(IServerConfiguration configuration, boolean add) {
- if (configuration == null)
- return;
-
- if (!add)
- deletedElement = configuration;
-
- IServer[] servers = ServerCore.getServers();
- if (servers != null) {
- int size = servers.length;
- for (int i = 0; i < size; i++) {
- if (configuration.equals(servers[i].getServerConfiguration()))
- refresh(servers[i]);
- }
- }
- deletedElement = null;
- }*/
-
- protected void refreshServer(final IServer server) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- try {
- refresh(server);
- ISelection sel = ServerTableViewer.this.getSelection();
- ServerTableViewer.this.setSelection(sel);
- } catch (Exception e) {
- // ignore
- }
- }
- });
- }
-
- protected void handleDispose(DisposeEvent event) {
- stopThread();
- view.getViewSite().getPage().removeSelectionListener(dsListener);
-
- ServerCore.removeServerLifecycleListener(serverResourceListener);
-
- // remove listeners from server
- IServer[] servers = ServerCore.getServers();
- if (servers != null) {
- int size = servers.length;
- for (int i = 0; i < size; i++) {
- servers[i].removeServerListener(serverListener);
- ((Server) servers[i]).removePublishListener(publishListener);
- }
- }
-
- super.handleDispose(event);
- }
-
- /**
- * Called when the publish state changes.
- * @param server org.eclipse.wst.server.core.IServer
- */
- protected void handlePublishChange(IServer server, boolean isPublishing) {
- String serverId = server.getId();
- if (isPublishing)
- publishing.add(serverId);
- else
- publishing.remove(serverId);
-
- refreshServer(server);
- }
-
- /**
- *
- */
- protected void handleServerModulesChanged(IServer server2) {
- if (server2 == null)
- return;
-
- IServer[] servers = ServerCore.getServers();
- if (servers != null) {
- int size = servers.length;
- for (int i = 0; i < size; i++) {
- if (server2.equals(servers[i]))
- refresh(servers[i]);
- }
- }
- }
-
- /**
- * Called when an element is added.
- * @param server org.eclipse.wst.server.core.IServer
- */
- protected void handleServerResourceAdded(IServer server) {
- add(server);
- }
-
- /*protected void handleServerResourceAdded(IServerConfiguration configuration) {
- configurationChange(configuration, true);
- }*/
-
- /**
- * Called when an element is changed.
- * @param server org.eclipse.wst.server.core.IServer
- */
- protected void handleServerResourceChanged(IServer server) {
- refresh(server);
- }
-
- /*protected void handleServerResourceChanged(IServerConfiguration configuration) {
- IServer[] servers = ServerCore.getServers();
- if (servers != null) {
- int size = servers.length;
- for (int i = 0; i < size; i++) {
- IServerConfiguration config = servers[i].getServerConfiguration();
- if (configuration.equals(config))
- refresh(servers[i]);
- }
- }
- }*/
-
- /**
- * Called when an element is removed.
- * @param server org.eclipse.wst.server.core.IServer
- */
- protected void handleServerResourceRemoved(IServer server) {
- remove(server);
-
- String serverId = server.getId();
- publishing.remove(serverId);
-
- view.getViewSite().getActionBars().getStatusLineManager().setMessage(null, null);
- }
-
- /*protected void handleServerResourceRemoved(IServerConfiguration configuration) {
- configurationChange(configuration, false);
- }*/
-
- protected void addServer(final IServer server) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- add(server);
- }
- });
- }
-
- protected void removeServer(final IServer server) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- remove(server);
- }
- });
- }
-}
\ No newline at end of file
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
deleted file mode 100644
index 48e97c1..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ServersView.java
+++ /dev/null
@@ -1,495 +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.servers;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.IDebugView;
-import org.eclipse.jface.action.*;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.wst.server.core.*;
-import org.eclipse.wst.server.core.internal.Trace;
-import org.eclipse.wst.server.ui.internal.*;
-import org.eclipse.wst.server.ui.internal.view.tree.DisabledMenuManager;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.swt.dnd.FileTransfer;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.ui.*;
-import org.eclipse.ui.part.ResourceTransfer;
-import org.eclipse.ui.part.ViewPart;
-import org.eclipse.ui.views.navigator.LocalSelectionTransfer;
-/**
- * View of server, their configurations and status.
- */
-public class ServersView extends ViewPart {
- protected Table table;
- protected ServerTableViewer tableViewer;
-
- // actions on a server
- protected Action[] actions;
- protected MenuManager restartMenu;
-
- /**
- * ServersView constructor comment.
- */
- public ServersView() {
- super();
- }
-
- /**
- * createPartControl method comment.
- */
- public void createPartControl(Composite parent) {
- table = new Table(parent, SWT.SINGLE | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL | SWT.NONE);
- table.setHeaderVisible(true);
- table.setLinesVisible(false);
- table.setLayoutData(new GridData(GridData.FILL_BOTH));
- table.setFont(parent.getFont());
- PlatformUI.getWorkbench().getHelpSystem().setHelp(table, ContextIds.VIEW_CONTROL);
-
- TableLayout tableLayout = new TableLayout();
-
- // add columns
- TableColumn column = new TableColumn(table, SWT.SINGLE);
- column.setText(ServerUIPlugin.getResource("%viewServer"));
- ColumnWeightData colData = new ColumnWeightData(200, 200, true);
- tableLayout.addColumnData(colData);
-
- column = new TableColumn(table, SWT.SINGLE);
- column.setText(ServerUIPlugin.getResource("%viewHost"));
- colData = new ColumnWeightData(100, 150, true);
- tableLayout.addColumnData(colData);
-
- column = new TableColumn(table, SWT.SINGLE);
- column.setText(ServerUIPlugin.getResource("%viewStatus"));
- colData = new ColumnWeightData(100, 150, true);
- tableLayout.addColumnData(colData);
-
- column = new TableColumn(table, SWT.SINGLE);
- column.setText(ServerUIPlugin.getResource("%viewSync"));
- colData = new ColumnWeightData(100, 150, true);
- tableLayout.addColumnData(colData);
-
- table.setLayout(tableLayout);
-
- tableViewer = new ServerTableViewer(this, table);
- initializeActions(tableViewer);
-
- table.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent event) {
- try {
- /*TableItem item = table.getSelection()[0];
- IServerResource resource = (IServerResource) item.getData();
- IServerResourceFactory factory = ServerUtil.getServerResourceFactory(resource);
- String label = ServerLabelProvider.getInstance().getText(factory);
- label += " (";
- label += ServerCore.getResourceManager().getServerResourceLocation(resource).getFullPath().toString().substring(1);
- label += ")";
- getViewSite().getActionBars().getStatusLineManager().setMessage(ServerLabelProvider.getInstance().getImage(factory), label);
-
- if (resource instanceof IServer) {
- IServer server = (IServer) resource;
- ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
- ILaunch[] launches = launchManager.getLaunches();
- int size = launches.length;
- for (int i = size-1; i >= 0; i--) {
- ILaunchConfiguration config = launches[i].getLaunchConfiguration();
- if (LAUNCH_CONFIGURATION_TYPE_ID.equals(config.getType().getIdentifier()) &&
- ServerCore.getServerRef(server).equals(config.getAttribute(SERVER_REF, (String)null))) {
- selectServerProcess(launches[i]);
- return;
- }
- }
- }*/
- } catch (Exception e) {
- getViewSite().getActionBars().getStatusLineManager().setMessage(null, "");
- }
- }
- public void widgetDefaultSelected(SelectionEvent event) {
- try {
- TableItem item = table.getSelection()[0];
- IServer server = (IServer) item.getData();
- 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 = table.getShell();
- menuManager.addMenuListener(new IMenuListener() {
- public void menuAboutToShow(IMenuManager mgr) {
- fillContextMenu(shell, mgr);
- }
- });
- Menu menu = menuManager.createContextMenu(parent);
- table.setMenu(menu);
- getSite().registerContextMenu(menuManager, tableViewer);
- getSite().setSelectionProvider(tableViewer);
-
- initDragAndDrop();
- }
-
- protected void selectServerProcess(Object process) {
- IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow() ;
- if (window != null) {
- IWorkbenchPage page = window.getActivePage();
- if (page != null) {
- IWorkbenchPart part = page.findView(IDebugUIConstants.ID_DEBUG_VIEW);
- if (part != null) {
- IDebugView view = (IDebugView)part.getAdapter(IDebugView.class);
- if (view != null) {
- Viewer viewer = view.getViewer();
- if (viewer != null) {
- viewer.setSelection(new StructuredSelection(process));
- }
- }
- }
- }
- }
- }
-
- /**
- * Initialize actions
- */
- public void initializeActions(ISelectionProvider provider) {
- Shell shell = getSite().getShell();
-
- // create the debug action
- Action debugAction = new StartAction(shell, provider, "debug", ILaunchManager.DEBUG_MODE);
- debugAction.setToolTipText(ServerUIPlugin.getResource("%actionDebugToolTip"));
- debugAction.setText(ServerUIPlugin.getResource("%actionDebug"));
- debugAction.setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_ELCL_START_DEBUG));
- debugAction.setHoverImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_CLCL_START_DEBUG));
- debugAction.setDisabledImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_DLCL_START_DEBUG));
-
- // create the start action
- Action runAction = new StartAction(shell, provider, "start", ILaunchManager.RUN_MODE);
- runAction.setToolTipText(ServerUIPlugin.getResource("%actionStartToolTip"));
- runAction.setText(ServerUIPlugin.getResource("%actionStart"));
- runAction.setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_ELCL_START));
- runAction.setHoverImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_CLCL_START));
- runAction.setDisabledImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_DLCL_START));
-
- // create the profile action
- Action profileAction = new StartAction(shell, provider, "profile", ILaunchManager.PROFILE_MODE);
- profileAction.setToolTipText(ServerUIPlugin.getResource("%actionProfileToolTip"));
- profileAction.setText(ServerUIPlugin.getResource("%actionProfile"));
- profileAction.setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_ELCL_START_PROFILE));
- profileAction.setHoverImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_CLCL_START_PROFILE));
- profileAction.setDisabledImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_DLCL_START_PROFILE));
-
- // create the restart menu
- restartMenu = new MenuManager(ServerUIPlugin.getResource("%actionRestart"));
-
- Action restartAction = new RestartAction(shell, provider, "restartDebug", ILaunchManager.DEBUG_MODE);
- restartAction.setToolTipText(ServerUIPlugin.getResource("%actionDebugToolTip"));
- restartAction.setText(ServerUIPlugin.getResource("%actionDebug"));
- restartAction.setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_ELCL_START_DEBUG));
- restartAction.setHoverImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_CLCL_START_DEBUG));
- restartAction.setDisabledImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_DLCL_START_DEBUG));
- restartMenu.add(restartAction);
-
- restartAction = new RestartAction(shell, provider, "restartRun", ILaunchManager.RUN_MODE);
- restartAction.setToolTipText(ServerUIPlugin.getResource("%actionRestartToolTip"));
- restartAction.setText(ServerUIPlugin.getResource("%actionStart"));
- restartAction.setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_ELCL_START));
- restartAction.setHoverImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_CLCL_START));
- restartAction.setDisabledImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_DLCL_START));
- restartMenu.add(restartAction);
-
- restartAction = new RestartAction(shell, provider, "restartProfile", ILaunchManager.PROFILE_MODE);
- restartAction.setToolTipText(ServerUIPlugin.getResource("%actionRestartToolTip"));
- restartAction.setText(ServerUIPlugin.getResource("%actionProfile"));
- restartAction.setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_ELCL_START_PROFILE));
- restartAction.setHoverImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_CLCL_START_PROFILE));
- restartAction.setDisabledImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_DLCL_START_PROFILE));
- restartMenu.add(restartAction);
-
- // create the restart action
- restartAction = new RestartAction(shell, provider, "restart");
- restartAction.setToolTipText(ServerUIPlugin.getResource("%actionRestartToolTip"));
- restartAction.setText(ServerUIPlugin.getResource("%actionRestart"));
- restartAction.setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_ELCL_RESTART));
- restartAction.setHoverImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_CLCL_RESTART));
- restartAction.setDisabledImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_DLCL_RESTART));
-
- // create the stop action
- Action stopAction = new StopAction(shell, provider, "stop", IServerType.SERVER_STATE_SET_MANAGED);
- stopAction.setToolTipText(ServerUIPlugin.getResource("%actionStopToolTip"));
- stopAction.setText(ServerUIPlugin.getResource("%actionStop"));
- stopAction.setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_ELCL_STOP));
- stopAction.setHoverImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_CLCL_STOP));
- stopAction.setDisabledImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_DLCL_STOP));
-
- // create the disconnect action
- Action disconnectAction = new StopAction(shell, provider, "disconnect", IServerType.SERVER_STATE_SET_ATTACHED);
- disconnectAction.setToolTipText(ServerUIPlugin.getResource("%actionStopToolTip2"));
- disconnectAction.setText(ServerUIPlugin.getResource("%actionStop2"));
- disconnectAction.setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_ELCL_DISCONNECT));
- disconnectAction.setHoverImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_CLCL_DISCONNECT));
- disconnectAction.setDisabledImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_DLCL_DISCONNECT));
-
- // create the publish action
- Action publishAction = new PublishAction(shell, provider, "publish");
- publishAction.setToolTipText(ServerUIPlugin.getResource("%actionPublishToolTip"));
- publishAction.setText(ServerUIPlugin.getResource("%actionPublish"));
- publishAction.setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_ELCL_PUBLISH));
- publishAction.setHoverImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_CLCL_PUBLISH));
- publishAction.setDisabledImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_DLCL_PUBLISH));
-
- // create the module slosh dialog action
- Action addModuleAction = new ModuleSloshAction(shell, provider, "modules");
- addModuleAction.setToolTipText(ServerUIPlugin.getResource("%actionModifyModulesToolTip"));
- addModuleAction.setText(ServerUIPlugin.getResource("%actionModifyModules"));
- addModuleAction.setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_ETOOL_MODIFY_MODULES));
- addModuleAction.setHoverImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_CTOOL_MODIFY_MODULES));
- addModuleAction.setDisabledImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_DTOOL_MODIFY_MODULES));
-
- actions = new Action[8];
- actions[0] = debugAction;
- actions[1] = runAction;
- actions[2] = profileAction;
- actions[3] = restartAction;
- actions[4] = stopAction;
- actions[5] = disconnectAction;
- actions[6] = publishAction;
- actions[7] = addModuleAction;
-
- // add toolbar buttons
- IContributionManager cm = getViewSite().getActionBars().getToolBarManager();
- for (int i = 0; i < actions.length - 1; i++) {
- cm.add(actions[i]);
- }
- }
-
- protected void fillContextMenu(Shell shell, IMenuManager menu) {
- // get selection but avoid no selection or multiple selection
- IServer server = null;
- IStructuredSelection selection = (IStructuredSelection) tableViewer.getSelection();
- if (!selection.isEmpty()) {
- Iterator iterator = selection.iterator();
- server = (IServer) iterator.next();
- if (iterator.hasNext())
- server = null;
- }
-
- // new action
- MenuManager newMenu = new MenuManager(ServerUIPlugin.getResource("%actionNew"));
- ServerTree.fillNewContextMenu(null, selection, newMenu);
- menu.add(newMenu);
-
- // open action
- if (server != null) {
- menu.add(new OpenAction(server));
- menu.add(new Separator());
-
- menu.add(new DeleteAction(shell, server));
- menu.add(new Separator());
-
- // server actions
- for (int i = 0; i < actions.length - 1; i++) {
- if (i == 3)
- menu.add(restartMenu);
- else
- menu.add(actions[i]);
- }
-
- // switch config
- /*if (server.getServerType() != null && server.getServerType().hasServerConfiguration()) {
- MenuManager menuManager = new MenuManager(ServerUIPlugin.getResource("%actionSwitchConfiguration"));
- menuManager.add(new SwitchConfigurationAction(shell, ServerUIPlugin.getResource("%viewNoConfiguration"), server, null));
-
- IServerConfiguration[] configs = getSupportedServerConfigurations(server);
- if (configs != null) {
- int size = configs.length;
- for (int i = 0; i < size; i++) {
- menuManager.add(new SwitchConfigurationAction(shell, configs[i].getName(), server, configs[i]));
- }
- }
-
- menu.add(menuManager);
- }*/
-
- // monitor
- if (server.getServerType() != null) {
- final MenuManager menuManager = new MenuManager(ServerUIPlugin.getResource("%actionMonitor"));
-
- final IServer server2 = server;
- final Shell shell2 = shell;
- menuManager.addMenuListener(new IMenuListener() {
- public void menuAboutToShow(IMenuManager manager) {
- menuManager.removeAll();
- if (server2.isDelegateLoaded()) {
- IServerPort[] ports = server2.getServerPorts();
- if (ports != null) {
- int size = ports.length;
- for (int i = 0; i < size; i++) {
- if (!ports[i].isAdvanced())
- menuManager.add(new MonitorServerPortAction(shell2, server2, ports[i]));
- }
- }
- }
-
- menuManager.add(new MonitorServerAction(shell2, server2));
- }
- });
-
- // add an initial menu item so that the menu appears correctly
- menuManager.add(new MonitorServerAction(shell, server));
- menu.add(menuManager);
- }
- }
-
- if (server != null && server.isDelegateLoaded()) {
- menu.add(new Separator());
-
- MenuManager restartProjectMenu = new MenuManager(ServerUIPlugin.getResource("%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(ServerUIPlugin.getResource("%actionRestartProject")));
- else
- menu.add(restartProjectMenu);
- }
-
- menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
- menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS+"-end"));
- }
-
- /**
- * Returns a list of configurations that are supported by this
- * server.
- *
- * @param server org.eclipse.wst.server.core.IServer
- * @return java.util.List
- */
- /*protected static IServerConfiguration[] getSupportedServerConfigurations(IServer server) {
- if (server == null)
- return new IServerConfiguration[0];
-
- List list = new ArrayList();
-
- IServerConfiguration[] configs = ServerCore.getServerConfigurations();
- if (configs != null) {
- int size = configs.length;
- for (int i = 0; i < size; i++) {
- //Trace.trace("Is supported configuration: " + getName(server) + " " + getName(configuration) + " " + server.isSupportedConfiguration(configuration));
- if (server.isSupportedConfiguration(configs[i]))
- list.add(configs[i]);
- }
- }
-
- IServerConfiguration[] sc = new IServerConfiguration[list.size()];
- list.toArray(sc);
- return sc;
- }*/
-
- /**
- *
- */
- public void setFocus() {
- if (table != null)
- table.setFocus();
- }
-
- /**
- * Adds drag and drop support to the Servers view.
- */
- protected void initDragAndDrop() {
- int ops = DND.DROP_COPY;
- Transfer[] transfers = new Transfer[] { LocalSelectionTransfer.getInstance(),
- ResourceTransfer.getInstance(), FileTransfer.getInstance() };
- //tableViewer.addDragSupport(ops, transfers, new ServersViewDragAdapter(viewer));
- tableViewer.addDropSupport(ops | DND.DROP_DEFAULT, transfers, new ServersViewDropAdapter(tableViewer));
- }
-
- /**
- * Returns all projects contained by the server. This included the
- * projects that are in the configuration, as well as their
- * children, and their children...
- *
- * @param server org.eclipse.wst.server.core.IServer
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @return a possibly-empty array of module instances {@link IModule}
- */
- public static IModule[] getAllContainedModules(IServer server, IProgressMonitor monitor) {
- //Trace.trace("> getAllContainedModules: " + getName(configuration));
- List modules = new ArrayList();
- if (server == null)
- return new IModule[0];
-
- // get all of the directly contained projects
- IModule[] deploys = server.getModules();
- if (deploys == null || deploys.length == 0)
- return new IModule[0];
-
- int size = deploys.length;
- for (int i = 0; i < size; i++) {
- if (deploys[i] != null && !modules.contains(deploys[i]))
- modules.add(deploys[i]);
- }
-
- //Trace.trace(" getAllContainedModules: root level done");
-
- // get all of the module's children
- int count = 0;
- while (count < modules.size()) {
- IModule module = (IModule) modules.get(count);
- try {
- IModule[] children = server.getChildModules(module, monitor);
- if (children != null) {
- size = children.length;
- for (int i = 0; i < size; i++) {
- if (children[i] != null && !modules.contains(children[i]))
- modules.add(children[i]);
- }
- }
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error getting child modules for: " + module.getName(), e);
- }
- count ++;
- }
-
- //Trace.trace("< getAllContainedModules");
-
- IModule[] modules2 = new IModule[modules.size()];
- modules.toArray(modules2);
- return modules2;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ServersViewDropAdapter.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ServersViewDropAdapter.java
deleted file mode 100644
index e5d3109..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ServersViewDropAdapter.java
+++ /dev/null
@@ -1,116 +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.view.servers;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerDropAdapter;
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.swt.dnd.DropTargetEvent;
-import org.eclipse.swt.dnd.FileTransfer;
-import org.eclipse.swt.dnd.TransferData;
-import org.eclipse.ui.part.ResourceTransfer;
-import org.eclipse.ui.views.navigator.LocalSelectionTransfer;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.ui.internal.actions.RunOnServerActionDelegate;
-/**
- *
- */
-public class ServersViewDropAdapter extends ViewerDropAdapter {
- protected ServersViewDropAdapter(Viewer viewer) {
- super(viewer);
- }
-
- public void dragEnter(DropTargetEvent event) {
- if (event.detail == DND.DROP_DEFAULT)
- event.detail = DND.DROP_COPY;
-
- super.dragEnter(event);
- }
-
- public boolean performDrop(Object data) {
- Object target = getCurrentTarget();
- IServer server = null;
- if (target instanceof IServer)
- server = (IServer) target;
-
- if (server == null)
- return false;
-
- final IServer finalServer = server;
- RunOnServerActionDelegate ros = new RunOnServerActionDelegate() {
- protected IServer getServer() {
- return finalServer;
- }
- };
- Action action = new Action() {
- //
- };
- ros.selectionChanged(action, new StructuredSelection(data));
-
- //if (!action.isEnabled())
- // return false;
-
- ros.run(action);
- return true;
- }
-
- public boolean validateDrop(Object target, int operation, TransferData transferType) {
- if (target == null)
- return false;
- /*IServer server = null;
- if (target instanceof IServer)
- server = (IServer) target;*/
- //if (!ServerUIPlugin.hasModuleArtifact(target))
- // return false;
-
- System.out.println("Target: " + target + " " + operation + " " + transferType);
-
- if (FileTransfer.getInstance().isSupportedType(transferType))
- return true;
- if (ResourceTransfer.getInstance().isSupportedType(transferType))
- return true;
- if (LocalSelectionTransfer.getInstance().isSupportedType(transferType))
- return true;
-
- return false;
- }
-
- /**
- * Returns the resource selection from the LocalSelectionTransfer.
- *
- * @return the resource selection from the LocalSelectionTransfer
- */
- /*private IResource[] getSelectedResources() {
- ArrayList selectedResources = new ArrayList();
-
- ISelection selection = LocalSelectionTransfer.getInstance()
- .getSelection();
- if (selection instanceof IStructuredSelection) {
- IStructuredSelection ssel = (IStructuredSelection) selection;
- for (Iterator i = ssel.iterator(); i.hasNext();) {
- Object o = i.next();
- if (o instanceof IResource) {
- selectedResources.add(o);
- }
- else if (o instanceof IAdaptable) {
- IAdaptable a = (IAdaptable) o;
- IResource r = (IResource) a.getAdapter(IResource.class);
- if (r != null) {
- selectedResources.add(r);
- }
- }
- }
- }
- return (IResource[]) selectedResources.toArray(new IResource[selectedResources.size()]);
- }*/
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/StartAction.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/StartAction.java
deleted file mode 100644
index e3e0356..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/StartAction.java
+++ /dev/null
@@ -1,74 +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.servers;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.internal.PublishServerJob;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-import org.eclipse.wst.server.ui.internal.StartServerJob;
-import org.eclipse.swt.widgets.Shell;
-/**
- * Start a server.
- */
-public class StartAction extends AbstractServerAction {
- protected String launchMode = ILaunchManager.RUN_MODE;
-
- public StartAction(Shell shell, ISelectionProvider selectionProvider, String name, String launchMode) {
- super(shell, selectionProvider, name);
- this.launchMode = launchMode;
- try {
- selectionChanged((IStructuredSelection) selectionProvider.getSelection());
- } catch (Exception e) {
- // ignore
- }
- }
-
- /**
- * Return true if this server can currently be acted on.
- * @return boolean
- * @param server org.eclipse.wst.server.core.IServer
- */
- public boolean accept(IServer server) {
- return server.canStart(launchMode).isOK();
- }
-
- /**
- * Perform action on this server.
- * @param server org.eclipse.wst.server.core.IServer
- */
- public void perform(final IServer server) {
- //if (!ServerUIUtil.promptIfDirty(shell, server))
- // return;
-
- if (!ServerUIPlugin.saveEditors())
- return;
-
- IProgressMonitor pm = Platform.getJobManager().createProgressGroup();
- try {
- pm.beginTask("Starting", 10);
- PublishServerJob publishJob = new PublishServerJob(server);
- publishJob.setProgressGroup(pm, 5);
- publishJob.schedule();
- StartServerJob startJob = new StartServerJob(server, launchMode);
- startJob.setProgressGroup(pm, 5);
- startJob.schedule();
- } catch (Exception e) {
- // ignore
- } finally {
- pm.done();
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/StopAction.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/StopAction.java
deleted file mode 100644
index 00e2e1b..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/StopAction.java
+++ /dev/null
@@ -1,66 +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.servers;
-
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-/**
- * Stop (terminate) a server.
- */
-public class StopAction extends AbstractServerAction {
- protected int serverStateSet;
-
- public StopAction(Shell shell, ISelectionProvider selectionProvider, String name, int serverStateSet) {
- super(shell, selectionProvider, name);
- this.serverStateSet = serverStateSet;
- try {
- selectionChanged((IStructuredSelection) selectionProvider.getSelection());
- } catch (Exception e) {
- // ignore
- }
- }
-
- /**
- * Return true if this server can currently be acted on.
- * @return boolean
- * @param server org.eclipse.wst.server.core.IServer
- */
- public boolean accept(IServer server) {
- if (server.getServerType() == null || server.getServerType().getServerStateSet() != serverStateSet)
- return false;
- return server.getServerType() != null && server.canStop().isOK();
- }
-
- /**
- * Perform action on this server.
- * @param server org.eclipse.wst.server.core.IServer
- */
- public void perform(final IServer server) {
- ServerUIPlugin.addTerminationWatch(shell, server, ServerUIPlugin.STOP);
-
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- MessageDialog dialog = new MessageDialog(shell, ServerUIPlugin.getResource("%defaultDialogTitle"), null,
- ServerUIPlugin.getResource("%dialogStoppingServer", server.getName()), MessageDialog.INFORMATION, new String[0], 0);
- dialog.setBlockOnOpen(false);
- dialog.open();
-
- server.stop(false);
- dialog.close();
- }
- });
- }
-}
\ No newline at end of file
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 c243da0..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/tree/ModuleResourceAdapter.java
+++ /dev/null
@@ -1,117 +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.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.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.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 1e99f46..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/tree/ServerElementAdapter.java
+++ /dev/null
@@ -1,158 +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.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 ((IServer) 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/ServerTreeAction.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/tree/ServerTreeAction.java
deleted file mode 100644
index da4ef55..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/tree/ServerTreeAction.java
+++ /dev/null
@@ -1,60 +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.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 {
- protected Shell shell;
- protected byte action;
-
- public ServerTreeAction(Shell shell, ISelectionProvider provider, String label, byte action) {
- super(provider, label);
- this.shell = shell;
- this.action = action;
- setEnabled(ServerTree.isActionEnabled(getSelection(), action));
- }
-
- /**
- * Notifies this action that the given (non-structured) selection has changed
- * in the selection provider.
- * <p>
- * The <code>SelectionProviderAction</code> implementation of this method
- * does nothing. Subclasses may reimplement to react to this selection change.
- * </p>
- *
- * @param selection the new selection
- */
- public void selectionChanged(ISelection selection) {
- setEnabled(ServerTree.isActionEnabled(selection, action));
- }
-
- public void selectionChanged(IStructuredSelection selection) {
- setEnabled(ServerTree.isActionEnabled(selection, action));
- }
-
- /**
- * The default implementation of this <code>IAction</code> method
- * does nothing. Subclasses should override this method
- * if they do not need information from the triggering event,
- * or override <code>run(Event)</code> if they do.
- */
- public void run() {
- ServerTree.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/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 6a86f07..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/tree/SwitchConfigurationAction.java
+++ /dev/null
@@ -1,86 +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.IServerType;
-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 comment.
- */
- 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));
-
- IServerType type = server.getServerType();
- if (type.getServerStateSet() == IServerType.SERVER_STATE_SET_MANAGED &&
- 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 3097b29..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.ServerUIPlugin;
-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 ServerUIPlugin.getResource("%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 ServerUIPlugin.getResource("%viewNoModules");
- else if (thisStyle == STYLE_NO_SERVERS)
- return ServerUIPlugin.getResource("%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/viewers/AbstractTableComposite.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/AbstractTableComposite.java
deleted file mode 100644
index 6aea532..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/AbstractTableComposite.java
+++ /dev/null
@@ -1,79 +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.viewers;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Table;
-/**
- *
- */
-public abstract class AbstractTableComposite extends Composite {
- protected Table table;
- protected TableViewer tableViewer;
-
- public AbstractTableComposite(Composite parent, int style) {
- super(parent, style);
-
- createWidgets();
- }
-
- protected void createWidgets() {
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- layout.numColumns = 1;
- setLayout(layout);
-
- GridData data = new GridData(GridData.FILL_BOTH);
- setLayoutData(data);
-
- createTable();
- data = new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL);
- table.setLayoutData(data);
- table.setLinesVisible(true);
- createTableViewer();
- }
-
- protected void createTable() {
- table = new Table(this, SWT.BORDER | SWT.FULL_SELECTION | SWT.V_SCROLL | SWT.H_SCROLL | SWT.SINGLE);
- }
-
- protected void createTableViewer() {
- tableViewer = new LockedTableViewer(table);
- }
-
- protected TableViewer getTableViewer() {
- return tableViewer;
- }
-
- protected Object getSelection(ISelection sel2) {
- IStructuredSelection sel = (IStructuredSelection) sel2;
- return sel.getFirstElement();
- }
-
- public void refresh() {
- tableViewer.refresh();
- }
-
- public void refresh(Object obj) {
- tableViewer.refresh(obj);
- }
-
- public void remove(Object obj) {
- tableViewer.remove(obj);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/AbstractTreeComposite.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/AbstractTreeComposite.java
deleted file mode 100644
index f0bb83c..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/AbstractTreeComposite.java
+++ /dev/null
@@ -1,158 +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.viewers;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.ViewerSorter;
-import org.eclipse.swt.SWT;
-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.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Tree;
-
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-/**
- *
- */
-public abstract class AbstractTreeComposite extends Composite {
- protected Tree tree;
- protected TreeViewer treeViewer;
- protected Label description;
-
- public AbstractTreeComposite(Composite parent, int style) {
- super(parent, style);
-
- createWidgets();
- }
-
- protected void createWidgets() {
- GridLayout layout = new GridLayout();
- layout.horizontalSpacing = 3;
- layout.verticalSpacing = 3;
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- layout.numColumns = 2;
- setLayout(layout);
-
- //GridData data = new GridData(GridData.FILL_BOTH);
- //setLayoutData(data);
-
- String descriptionText = getDescriptionLabel();
- if (descriptionText != null) {
- Label label = new Label(this, SWT.WRAP);
- label.setText(descriptionText);
- GridData data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_CENTER);
- data.horizontalSpan = 2;
- label.setLayoutData(data);
- }
-
- Label label = new Label(this, SWT.WRAP);
- label.setText(getTitleLabel());
- GridData data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_CENTER);
- data.horizontalSpan = 2;
- label.setLayoutData(data);
-
- tree = new Tree(this, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL | SWT.SINGLE);
- data = new GridData(GridData.FILL_BOTH);
- data.horizontalSpan = 2;
- tree.setLayoutData(data);
- treeViewer = new TreeViewer(tree);
-
- treeViewer.setSorter(new ViewerSorter());
-
- label = new Label(this, SWT.NONE);
- label.setText("");
- data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_CENTER);
- label.setLayoutData(data);
-
- // view composite
- Composite comp = new Composite(this, SWT.NONE);
- layout = new GridLayout();
- layout.horizontalSpacing = 3;
- layout.verticalSpacing = 0;
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- layout.numColumns = 2;
- comp.setLayout(layout);
-
- data = new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.VERTICAL_ALIGN_CENTER);
- comp.setLayoutData(data);
-
- label = new Label(comp, SWT.NONE);
- label.setText(ServerUIPlugin.getResource("%viewBy"));
- data = new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.VERTICAL_ALIGN_CENTER);
- label.setLayoutData(data);
-
- final Combo combo = new Combo(comp, SWT.DROP_DOWN | SWT.READ_ONLY);
- combo.setItems(getComboOptions());
- combo.select(1);
- combo.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.GRAB_HORIZONTAL | GridData.VERTICAL_ALIGN_CENTER));
- combo.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent event) {
- int sel = combo.getSelectionIndex();
- viewOptionSelected((byte) sel);
- }
- });
-
- if (hasDescription()) {
- description = new Label(this, SWT.WRAP);
- description.setText(ServerUIPlugin.getResource("%wizDescription"));
- data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_CENTER);
- data.horizontalSpan = 2;
- data.heightHint = 35;
- description.setLayoutData(data);
- }
- }
-
- protected abstract String getDescriptionLabel();
-
- protected abstract String getTitleLabel();
-
- protected abstract String[] getComboOptions();
-
- protected boolean hasDescription() {
- return true;
- }
-
- protected void setDescription(String text) {
- if (description != null && text != null)
- description.setText(ServerUIPlugin.getResource("%wizDescription") + " " + text);
- }
-
- protected abstract void viewOptionSelected(byte option);
-
- protected TreeViewer getTreeViewer() {
- return treeViewer;
- }
-
- protected Object getSelection(ISelection sel2) {
- IStructuredSelection sel = (IStructuredSelection) sel2;
- return sel.getFirstElement();
- }
-
- public void refresh() {
- treeViewer.refresh();
- }
-
- public void refresh(Object obj) {
- treeViewer.refresh(obj);
- }
-
- public void remove(Object obj) {
- treeViewer.remove(obj);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/AbstractTreeContentProvider.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/AbstractTreeContentProvider.java
deleted file mode 100644
index 434a8a2..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/AbstractTreeContentProvider.java
+++ /dev/null
@@ -1,192 +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.viewers;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-/**
- * Runtime type content provider.
- */
-public abstract class AbstractTreeContentProvider implements ITreeContentProvider {
- public static final byte STYLE_FLAT = 0;
-
- public static final String ROOT = "root";
-
- protected byte style;
-
- protected Object initialSelection;
- protected int initialSelectionOrder;
-
- public class TreeElement {
- String text;
- List contents;
- }
-
- protected Object[] elements;
- protected Map elementToParentMap = new HashMap(2);
- protected Map textMap = new HashMap(2);
-
- /**
- * AbstractTreeContentProvider constructor comment.
- */
- public AbstractTreeContentProvider(byte style) {
- super();
- this.style = style;
-
- fillTree();
- }
-
- public AbstractTreeContentProvider(byte style, boolean init) {
- super();
- this.style = style;
- }
-
- protected abstract void fillTree();
-
- protected void clean() {
- elements = null;
- elementToParentMap = new HashMap(2);
- textMap = new HashMap(2);
-
- initialSelection = null;
- initialSelectionOrder = -1000;
- }
-
- protected TreeElement getOrCreate(List list, String text) {
- try {
- Object obj = textMap.get(text);
- if (obj != null)
- return (TreeElement) obj;
- } catch (Exception e) {
- return null;
- }
-
- TreeElement element = new TreeElement();
- element.text = text;
- element.contents = new ArrayList();
- textMap.put(text, element);
- list.add(element);
- return element;
- }
-
- protected TreeElement getOrCreate(List list, String id, String text) {
- try {
- Object obj = textMap.get(id);
- if (obj != null)
- return (TreeElement) obj;
- } catch (Exception e) {
- return null;
- }
-
- TreeElement element = new TreeElement();
- element.text = text;
- element.contents = new ArrayList();
- textMap.put(id, element);
- list.add(element);
- return element;
- }
-
- protected TreeElement getByText(String text) {
- try {
- return (TreeElement) textMap.get(text);
- } catch (Exception e) {
- return null;
- }
- }
-
- protected TreeElement getParentImpl(Object obj) {
- try {
- return (TreeElement) elementToParentMap.get(obj);
- } catch (Exception e) {
- return null;
- }
- }
-
- /**
- * Disposes of this content provider.
- * This is called by the viewer when it is disposed.
- */
- public void dispose() {
- // do nothing
- }
-
- /**
- * Returns the elements to display in the viewer
- * when its input is set to the given element.
- * These elements can be presented as rows in a table, items in a list, etc.
- * The result is not modified by the viewer.
- *
- * @param element the input element
- * @return the array of elements to display in the viewer
- */
- public Object[] getElements(Object element) {
- return elements;
- }
-
- public Object[] getChildren(Object element) {
- if (style == STYLE_FLAT)
- return null;
- else if (!(element instanceof TreeElement))
- return null;
-
- TreeElement rte = (TreeElement) element;
- return rte.contents.toArray();
- }
-
- public Object getParent(Object element) {
- if (style == STYLE_FLAT)
- return null;
- //else if (element instanceof TreeElement)
- // return null;
-
- return getParentImpl(element);
- }
-
- public boolean hasChildren(Object element) {
- if (style == STYLE_FLAT)
- return false;
- //else if (!(element instanceof TreeElement))
- // return false;
- Object[] children = getChildren(element);
- return children != null && children.length > 0;
-
- //return true;
- }
-
- /**
- * Notifies this content provider that the given viewer's input
- * has been switched to a different element.
- * <p>
- * A typical use for this method is registering the content provider as a listener
- * to changes on the new input (using model-specific means), and deregistering the viewer
- * from the old input. In response to these change notifications, the content provider
- * propagates the changes to the viewer.
- * </p>
- *
- * @param viewer the viewer
- * @param oldInput the old input element, or <code>null</code> if the viewer
- * did not previously have an input
- * @param newInput the new input element, or <code>null</code> if the viewer
- * does not have an input
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- // do nothing
- }
-
- public Object getInitialSelection() {
- return initialSelection;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/AbstractTreeLabelProvider.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/AbstractTreeLabelProvider.java
deleted file mode 100644
index a8174fc..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/AbstractTreeLabelProvider.java
+++ /dev/null
@@ -1,59 +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.viewers;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.PlatformUI;
-/**
- * Abstract tree label provider.
- */
-public abstract class AbstractTreeLabelProvider extends BaseLabelProvider {
- /**
- * AbstractTreeLabelProvider constructor comment.
- */
- public AbstractTreeLabelProvider() {
- super();
- }
-
- /**
- * Returns the label image for the given column of the given element.
- *
- * @param element the object representing the entire row, or
- * <code>null</code> indicating that no input object is set
- * in the viewer
- */
- public Image getImage(Object element) {
- if (element instanceof ServerTreeContentProvider.TreeElement) {
- ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages();
- return sharedImages.getImage(ISharedImages.IMG_OBJ_FOLDER);
- }
- return getImageImpl(element);
- }
-
- protected abstract Image getImageImpl(Object element);
-
- /**
- * Returns the label text for the given column of the given element.
- *
- * @param element the object representing the entire row, or
- * <code>null</code> indicating that no input object is set
- * in the viewer
- */
- public String getText(Object element) {
- if (element instanceof ServerTreeContentProvider.TreeElement) {
- return ((ServerTreeContentProvider.TreeElement) element).text;
- }
- return getTextImpl(element);
- }
-
- protected abstract String getTextImpl(Object element);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/BaseLabelProvider.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/BaseLabelProvider.java
deleted file mode 100644
index 77498c2..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/BaseLabelProvider.java
+++ /dev/null
@@ -1,106 +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.viewers;
-
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.swt.graphics.Image;
-/**
- * A basic label provider.
- */
-public abstract class BaseLabelProvider implements ILabelProvider {
- /**
- * BaseLabelProvider constructor comment.
- */
- public BaseLabelProvider() {
- super();
- }
-
- /**
- * Adds a listener to this label provider.
- * Has no effect if an identical listener is already registered.
- * <p>
- * Label provider listeners are informed about state changes
- * that affect the rendering of the viewer that uses this label provider.
- * </p>
- *
- * @param listener a label provider listener
- */
- public void addListener(ILabelProviderListener listener) {
- // do nothing
- }
-
- /**
- * Disposes of this label provider. When a label provider is
- * attached to a viewer, the viewer will automatically call
- * this method when the viewer is being closed. When label providers
- * are used outside of the context of a viewer, it is the client's
- * responsibility to ensure that this method is called when the
- * provider is no longer needed.
- */
- public void dispose() {
- // do nothing
- }
-
- /**
- * Returns the label image for the given column of the given element.
- *
- * @param element the object representing the entire row, or
- * <code>null</code> indicating that no input object is set
- * in the viewer
- */
- public Image getImage(Object element) {
- return null;
- }
-
- /**
- * Returns the label text for the given column of the given element.
- *
- * @param element the object representing the entire row, or
- * <code>null</code> indicating that no input object is set
- * in the viewer
- */
- public String getText(Object element) {
- return "";
- }
-
- /**
- * Returns whether the label would be affected
- * by a change to the given property of the given element.
- * This can be used to optimize a non-structural viewer update.
- * If the property mentioned in the update does not affect the label,
- * then the viewer need not update the label.
- *
- * @param element the element
- * @param property the property
- * @return <code>true</code> if the label would be affected,
- * and <code>false</code> if it would be unaffected
- */
- public boolean isLabelProperty(Object element, String property) {
- return false;
- }
-
- /**
- * Removes a listener to this label provider.
- * Has no affect if an identical listener is not registered.
- *
- * @param listener a label provider listener
- */
- public void removeListener(ILabelProviderListener listener) {
- // do nothing
- }
-
- protected String notNull(String s) {
- if (s == null)
- return "";
- return s;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/ILockedLabelProvider.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/ILockedLabelProvider.java
deleted file mode 100644
index 3c43b4e..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/ILockedLabelProvider.java
+++ /dev/null
@@ -1,26 +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.viewers;
-/**
- * Extends <code>ITableLabelProvider</code> with methods to provide
- * lock information.
- */
-public interface ILockedLabelProvider {
- /**
- * Returns the lock info for the element. This value will be used
- * to change the presentation of the table row.
- *
- * @param element the object representing the entire row, or
- * <code>null</code> indicating that no input object is set
- * in the viewer
- */
- public boolean isLocked(Object element);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/LockedCheckboxTableViewer.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/LockedCheckboxTableViewer.java
deleted file mode 100644
index ea06b4b..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/LockedCheckboxTableViewer.java
+++ /dev/null
@@ -1,57 +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.viewers;
-
-import org.eclipse.jface.viewers.CheckboxTableViewer;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.Widget;
-/**
- *
- */
-public class LockedCheckboxTableViewer extends CheckboxTableViewer {
- protected Color color;
-
- public LockedCheckboxTableViewer(Table table) {
- super(table);
- createColor(table);
- }
-
- protected void createColor(Control c) {
- color = new Color(c.getDisplay(), 255, 255, 225);
- c.addDisposeListener(new DisposeListener() {
- public void widgetDisposed(DisposeEvent e) {
- color.dispose();
- }
- });
- }
-
- public void doUpdateItem(Widget widget, Object element, boolean fullMap) {
- if (color == null)
- return;
- if (widget instanceof TableItem) {
- TableItem item = (TableItem) widget;
- if (getLabelProvider() instanceof ILockedLabelProvider) {
- ILockedLabelProvider provider = (ILockedLabelProvider) getLabelProvider();
- if (provider.isLocked(element)) {
- item.setBackground(color);
- item.setImage(0, null);
- } else
- item.setBackground(null);
- }
- }
- super.doUpdateItem(widget, element, fullMap);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/LockedTableViewer.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/LockedTableViewer.java
deleted file mode 100644
index 1ec2d15..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/LockedTableViewer.java
+++ /dev/null
@@ -1,68 +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.viewers;
-
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.Widget;
-/**
- *
- */
-public class LockedTableViewer extends TableViewer {
- protected Color color;
-
- public LockedTableViewer(Composite parent) {
- super(parent);
- createColor(parent);
- }
-
- public LockedTableViewer(Composite parent, int style) {
- super(parent, style);
- createColor(parent);
- }
-
- public LockedTableViewer(Table table) {
- super(table);
- createColor(table);
- }
-
- protected void createColor(Control c) {
- color = new Color(c.getDisplay(), 255, 255, 225);
- c.addDisposeListener(new DisposeListener() {
- public void widgetDisposed(DisposeEvent e) {
- color.dispose();
- }
- });
- }
-
- public void doUpdateItem(Widget widget, Object element, boolean fullMap) {
- if (color == null)
- return;
- if (widget instanceof TableItem) {
- TableItem item = (TableItem) widget;
- if (getLabelProvider() instanceof ILockedLabelProvider) {
- ILockedLabelProvider provider = (ILockedLabelProvider) getLabelProvider();
- if (provider.isLocked(element)) {
- item.setBackground(color);
- item.setImage(0, null);
- } else
- item.setBackground(null);
- }
- }
- super.doUpdateItem(widget, element, fullMap);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/MonitorComposite.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/MonitorComposite.java
deleted file mode 100644
index 57eff07..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/MonitorComposite.java
+++ /dev/null
@@ -1,227 +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.viewers;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-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.Composite;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.IServerPort;
-import org.eclipse.wst.server.core.internal.IMonitoredServerPort;
-import org.eclipse.wst.server.core.internal.IServerMonitorManager;
-import org.eclipse.wst.server.core.internal.ServerMonitorManager;
-import org.eclipse.wst.server.ui.internal.EclipseUtil;
-import org.eclipse.wst.server.ui.internal.SWTUtil;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-/**
- *
- */
-public class MonitorComposite extends Composite {
- //protected IServerPort selection;
- protected PortSelectionListener listener;
- protected IServer server;
-
- protected IServerMonitorManager smm;
-
- protected Table monitorTable;
- protected TableViewer monitorTableViewer;
-
- public interface PortSelectionListener {
- public void portSelected(IServerPort port);
- }
-
- public MonitorComposite(Composite parent, int style, PortSelectionListener listener2, IServer server) {
- super(parent, style);
- this.listener = listener2;
- this.server = server;
-
- smm = ServerMonitorManager.getInstance();
-
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- layout.numColumns = 2;
- setLayout(layout);
-
- GridData data = new GridData(GridData.FILL_BOTH);
- setLayoutData(data);
-
- monitorTable = new Table(this, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL | SWT.MULTI | SWT.FULL_SELECTION);
- data = new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL);
- //data.horizontalSpan = 2;
- data.heightHint = 150;
- //data.widthHint = 340;
- monitorTable.setLayoutData(data);
- monitorTable.setLinesVisible(true);
- monitorTableViewer = new TableViewer(monitorTable);
-
- TableLayout tableLayout = new TableLayout();
- monitorTable.setLayout(tableLayout);
- monitorTable.setHeaderVisible(true);
-
- tableLayout.addColumnData(new ColumnWeightData(8, 80, true));
- TableColumn col = new TableColumn(monitorTable, SWT.NONE);
- col.setText(ServerUIPlugin.getResource("%dialogMonitorColumnStatus"));
-
- tableLayout.addColumnData(new ColumnWeightData(12, 120, true));
- col = new TableColumn(monitorTable, SWT.NONE);
- col.setText(ServerUIPlugin.getResource("%dialogMonitorColumnType"));
-
- tableLayout.addColumnData(new ColumnWeightData(8, 80, true));
- col = new TableColumn(monitorTable, SWT.NONE);
- col.setText(ServerUIPlugin.getResource("%dialogMonitorColumnPort"));
-
- tableLayout.addColumnData(new ColumnWeightData(8, 80, true));
- col = new TableColumn(monitorTable, SWT.NONE);
- col.setText(ServerUIPlugin.getResource("%dialogMonitorColumnMonitorPort"));
-
- tableLayout.addColumnData(new ColumnWeightData(8, 80, true));
- col = new TableColumn(monitorTable, SWT.NONE);
- col.setText(ServerUIPlugin.getResource("%dialogMonitorColumnContentType"));
-
- monitorTableViewer.setContentProvider(new MonitorContentProvider(server));
- monitorTableViewer.setLabelProvider(new MonitorLabelProvider(server));
- monitorTableViewer.setInput(AbstractTreeContentProvider.ROOT);
-
- monitorTableViewer.setSorter(new ViewerSorter() {
- public int compare(Viewer viewer, Object e1, Object e2) {
- IMonitoredServerPort port1 = (IMonitoredServerPort) e1;
- IMonitoredServerPort port2 = (IMonitoredServerPort) e2;
- if (port1.getServerPort().getPort() == port2.getServerPort().getPort()) {
- if (port1.getMonitorPort() == port2.getMonitorPort()) {
- return 0;
- } else if (port1.getMonitorPort() > port2.getMonitorPort())
- return 1;
- else
- return -1;
- } else if (port1.getServerPort().getPort() > port2.getServerPort().getPort())
- return 1;
- else
- return -1;
- }
- });
-
- Composite buttonComp = new Composite(this, SWT.NONE);
- buttonComp.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_BEGINNING));
- layout = new GridLayout();
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- buttonComp.setLayout(layout);
-
- final IServer server2 = server;
- Button add = SWTUtil.createButton(buttonComp, ServerUIPlugin.getResource("%add"));
- add.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- MonitorDialog dialog = new MonitorDialog(getShell(), server2);
- if (dialog.open() != Window.CANCEL) {
- IServerPort port = dialog.getServerPort();
- IMonitoredServerPort sp = smm.createMonitor(server2, port, dialog.getMonitorPort(), dialog.getContentTypes());
- if (sp != null)
- monitorTableViewer.add(sp);
- }
- }
- });
-
- final Button edit = SWTUtil.createButton(buttonComp, ServerUIPlugin.getResource("%edit"));
- edit.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- IStructuredSelection sel = (IStructuredSelection) monitorTableViewer.getSelection();
- IMonitoredServerPort port = (IMonitoredServerPort) sel.getFirstElement();
- MonitorDialog dialog = new MonitorDialog(getShell(), server2, port.getServerPort(), port.getMonitorPort(), port.getContentTypes());
- if (dialog.open() != Window.CANCEL) {
- smm.removeMonitor(port);
- monitorTableViewer.remove(port);
- port = smm.createMonitor(server2, dialog.getServerPort(), dialog.getMonitorPort(), dialog.getContentTypes());
- if (port != null) {
- monitorTableViewer.add(port);
- monitorTableViewer.setSelection(new StructuredSelection(port));
- }
- }
- }
- });
- edit.setEnabled(false);
-
- final Button remove = SWTUtil.createButton(buttonComp, ServerUIPlugin.getResource("%remove"));
- remove.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- IMonitoredServerPort msp = (IMonitoredServerPort) getSelection(monitorTableViewer.getSelection());
- if (msp.isStarted())
- smm.stopMonitor(msp);
- smm.removeMonitor(msp);
- monitorTableViewer.remove(msp);
- }
- });
- remove.setEnabled(false);
-
- final Button start = SWTUtil.createButton(buttonComp, ServerUIPlugin.getResource("%start"));
- start.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- IStructuredSelection sel = (IStructuredSelection) monitorTableViewer.getSelection();
- IMonitoredServerPort msp = (IMonitoredServerPort) sel.getFirstElement();
- try {
- smm.startMonitor(msp);
- } catch (CoreException ce) {
- EclipseUtil.openError(getShell(), ce.getLocalizedMessage());
- }
- monitorTableViewer.refresh(msp);
- monitorTableViewer.setSelection(new StructuredSelection(msp));
- }
- });
- start.setEnabled(false);
-
- final Button stop = SWTUtil.createButton(buttonComp, ServerUIPlugin.getResource("%stop"));
- stop.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- IStructuredSelection sel = (IStructuredSelection) monitorTableViewer.getSelection();
- IMonitoredServerPort msp = (IMonitoredServerPort) sel.getFirstElement();
- smm.stopMonitor(msp);
- monitorTableViewer.refresh(msp);
- monitorTableViewer.setSelection(new StructuredSelection(msp));
- }
- });
- stop.setEnabled(false);
-
- monitorTableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- IMonitoredServerPort port = (IMonitoredServerPort) getSelection(monitorTableViewer.getSelection());
- if (port != null) {
- edit.setEnabled(!port.isStarted());
- remove.setEnabled(true);
- start.setEnabled(!port.isStarted());
- stop.setEnabled(port.isStarted());
- } else {
- edit.setEnabled(false);
- remove.setEnabled(false);
- start.setEnabled(false);
- stop.setEnabled(false);
- }
- }
- });
-
- IMonitoredServerPort[] msps = ServerMonitorManager.getInstance().getMonitoredPorts(server);
- if (msps != null && msps.length > 0)
- monitorTableViewer.setSelection(new StructuredSelection(msps[0]));
- }
-
- protected Object getSelection(ISelection sel2) {
- IStructuredSelection sel = (IStructuredSelection) sel2;
- return sel.getFirstElement();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/MonitorContentProvider.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/MonitorContentProvider.java
deleted file mode 100644
index 4666192..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/MonitorContentProvider.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.viewers;
-
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.internal.ServerMonitorManager;
-/**
- * Monitor port content provider.
- */
-public class MonitorContentProvider implements IStructuredContentProvider {
- protected IServer server;
-
- public MonitorContentProvider(IServer server) {
- super();
- this.server = server;
- }
-
- public void dispose() {
- // do nothing
- }
-
- public Object[] getElements(Object inputElement) {
- return ServerMonitorManager.getInstance().getMonitoredPorts(server);
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- // do nothing
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/MonitorDialog.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/MonitorDialog.java
deleted file mode 100644
index 07d9af0..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/MonitorDialog.java
+++ /dev/null
@@ -1,246 +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.viewers;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.*;
-
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.IServerPort;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-/**
- * Dialog that prompts a user to add or edit a server monitor.
- */
-public class MonitorDialog extends Dialog {
- protected IServer server;
- protected IServerPort port;
- protected int monitorPort = -1;
- protected String[] portContentTypes;
- protected String[] contentTypes;
- protected boolean isEdit = false;
- protected boolean portChanged = false;
-
- protected Button ok;
-
- protected Table table;
- protected TableViewer tableViewer;
- protected boolean init;
-
- /**
- * MonitorDialog constructor comment.
- *
- * @param parentShell the shell
- * @param server the server
- */
- public MonitorDialog(Shell parentShell, IServer server) {
- super(parentShell);
-
- this.server = server;
- }
-
- public MonitorDialog(Shell parentShell, IServer server, IServerPort port, int monitorPort, String[] contentTypes) {
- this(parentShell, server);
- this.monitorPort = monitorPort;
- this.contentTypes = contentTypes;
- this.port = port;
- isEdit = true;
- }
-
- /**
- *
- */
- protected void configureShell(Shell newShell) {
- super.configureShell(newShell);
- newShell.setText(ServerUIPlugin.getResource("%dialogMonitorTitle"));
- }
-
- protected void createButtonsForButtonBar(Composite parent) {
- ok = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
- createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
- }
-
- /**
- *
- */
- protected Control createDialogArea(Composite parent) {
- // create a composite with standard margins and spacing
- Composite composite = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
- layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
- layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
- layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
- layout.numColumns = 2;
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
- composite.setFont(parent.getFont());
- //WorkbenchHelp.setHelp(composite, ContextIds.TERMINATE_SERVER_DIALOG);
-
- Label label = new Label(composite, SWT.WRAP);
- label.setText(ServerUIPlugin.getResource("%dialogMonitorAddDescription", new String[] { server.getName() } ));
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- data.horizontalSpan = 2;
- data.widthHint = 275;
- label.setLayoutData(data);
-
- table = new Table(composite, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL | SWT.SINGLE | SWT.FULL_SELECTION);
- data = new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL);
- data.heightHint = 100;
- data.horizontalSpan = 2;
- table.setLayoutData(data);
- table.setLinesVisible(true);
- tableViewer = new TableViewer(table);
-
- TableLayout tableLayout = new TableLayout();
- table.setLayout(tableLayout);
- table.setHeaderVisible(true);
-
- tableLayout.addColumnData(new ColumnWeightData(12, 120, true));
- TableColumn col = new TableColumn(table, SWT.NONE);
- col.setText(ServerUIPlugin.getResource("%dialogMonitorColumnType"));
-
- tableLayout.addColumnData(new ColumnWeightData(4, 40, true));
- col = new TableColumn(table, SWT.NONE);
- col.setText(ServerUIPlugin.getResource("%dialogMonitorColumnPort"));
-
- tableViewer.setContentProvider(new PortContentProvider(server));
- tableViewer.setLabelProvider(new PortLabelProvider(server));
- tableViewer.setInput(AbstractTreeContentProvider.ROOT);
-
- tableViewer.setSorter(new ViewerSorter() {
- public int compare(Viewer viewer, Object e1, Object e2) {
- IServerPort port1 = (IServerPort) e1;
- IServerPort port2 = (IServerPort) e2;
- if (port1.getPort() == port2.getPort())
- return 0;
- else if (port1.getPort() > port2.getPort())
- return 1;
- else
- return -1;
- }
- });
-
- label = new Label(composite, SWT.NONE);
- label.setText(ServerUIPlugin.getResource("%dialogMonitorMonitorPort"));
-
- final Text portText = new Text(composite, SWT.BORDER);
- data = new GridData(GridData.FILL_HORIZONTAL);
- data.widthHint = 150;
- portText.setLayoutData(data);
- if (monitorPort >= 0)
- portText.setText(monitorPort + "");
-
- portText.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- try {
- monitorPort = Integer.parseInt(portText.getText());
- if (ok != null)
- ok.setEnabled(true);
- } catch (Exception ex) {
- monitorPort = -1;
- if (ok != null)
- ok.setEnabled(false);
- }
- portChanged = true;
- }
- });
-
- label = new Label(composite, SWT.NONE);
- label.setText(ServerUIPlugin.getResource("%dialogMonitorContentType"));
-
- final Combo combo = new Combo(composite, SWT.READ_ONLY);
- data = new GridData(GridData.FILL_HORIZONTAL);
- data.widthHint = 150;
- combo.setLayoutData(data);
- combo.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- int size = combo.getItemCount();
- int sel = combo.getSelectionIndex();
- if (sel == size - 1)
- contentTypes = portContentTypes;
- else
- contentTypes = new String[] { portContentTypes[sel] };
- }
- });
-
- tableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- port = (IServerPort) getSelection(tableViewer.getSelection());
- if (port == null)
- return;
- if (!portChanged) {
- portText.setText((port.getPort() + 1) + "");
- portChanged = false;
- }
- portContentTypes = port.getContentTypes();
- String[] s = null;
- String all = ServerUIPlugin.getResource("%dialogMonitorContentTypeAll");
- if (portContentTypes == null || portContentTypes.length == 1) {
- s = new String[] { all };
- } else {
- int size = portContentTypes.length;
- s = new String[size+1];
- for (int i = 0; i < size; i++) {
- s[i] = MonitorLabelProvider.getContentTypeString(portContentTypes[i]);
- }
- s[size] = all;
- }
- combo.setItems(s);
- combo.setText(all);
- }
- });
-
- Dialog.applyDialogFont(composite);
-
- if (port != null) {
- portChanged = true;
- String[] ct = contentTypes;
- tableViewer.setSelection(new StructuredSelection(port));
- if (ct != null)
- combo.setText(MonitorLabelProvider.getContentTypeString(ct[0]));
- } else if (tableViewer != null) {
- try {
- Object obj = tableViewer.getElementAt(0);
- if (obj != null)
- tableViewer.setSelection(new StructuredSelection(obj));
- } catch (Exception e) {
- // ignore
- }
- }
-
- portChanged = false;
-
- return composite;
- }
-
- protected Object getSelection(ISelection sel2) {
- IStructuredSelection sel = (IStructuredSelection) sel2;
- return sel.getFirstElement();
- }
-
- public int getMonitorPort() {
- return monitorPort;
- }
-
- public IServerPort getServerPort() {
- return port;
- }
-
- public String[] getContentTypes() {
- return contentTypes;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/MonitorLabelProvider.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/MonitorLabelProvider.java
deleted file mode 100644
index aae68a8..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/MonitorLabelProvider.java
+++ /dev/null
@@ -1,77 +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.viewers;
-
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.swt.graphics.Image;
-
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.internal.IMonitoredServerPort;
-import org.eclipse.wst.server.ui.internal.ImageResource;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-/**
- * Monitor port label provider.
- */
-public class MonitorLabelProvider extends BaseLabelProvider implements ITableLabelProvider {
- protected IServer server;
-
- public MonitorLabelProvider(IServer server) {
- super();
- this.server = server;
- }
-
- public Image getColumnImage(Object element, int columnIndex) {
- IMonitoredServerPort port = (IMonitoredServerPort) element;
- if (columnIndex == 0) {
- if (port.isStarted())
- return ImageResource.getImage(ImageResource.IMG_MONITOR_ON);
- return ImageResource.getImage(ImageResource.IMG_MONITOR_OFF);
- }
- return null;
- }
-
- public String getColumnText(Object element, int columnIndex) {
- IMonitoredServerPort port = (IMonitoredServerPort) element;
- if (columnIndex == 0) {
- if (port.isStarted())
- return ServerUIPlugin.getResource("%started");
- return ServerUIPlugin.getResource("%stopped");
- } else if (columnIndex == 1)
- return notNull(port.getServerPort().getName());
- else if (columnIndex == 2)
- return port.getServerPort().getPort() + "";
- else if (columnIndex == 3)
- return port.getMonitorPort() + "";
- else {
- String[] content = port.getContentTypes();
- if (content == null || content.length == 0)
- return ServerUIPlugin.getResource("%dialogMonitorContentTypeAll");
-
- StringBuffer sb = new StringBuffer();
- int size = content.length;
- for (int i = 0; i < size; i++) {
- if (i > 0)
- sb.append(",");
- sb.append(getContentTypeString(content[i]));
- }
- return sb.toString();
- }
- }
-
- protected static String getContentTypeString(String s) {
- if ("web".equals(s))
- return ServerUIPlugin.getResource("%dialogMonitorContentTypeWeb");
- else if ("webservices".equals(s))
- return ServerUIPlugin.getResource("%dialogMonitorContentTypeWebServices");
- else
- return s;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/PortContentProvider.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/PortContentProvider.java
deleted file mode 100644
index 0c19fa5..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/PortContentProvider.java
+++ /dev/null
@@ -1,39 +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.viewers;
-
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-
-import org.eclipse.wst.server.core.IServer;
-/**
- * Monitor port content provider.
- */
-public class PortContentProvider implements IStructuredContentProvider {
- protected IServer server;
-
- public PortContentProvider(IServer server) {
- super();
- this.server = server;
- }
-
- public void dispose() {
- // do nothing
- }
-
- public Object[] getElements(Object inputElement) {
- return server.getServerPorts();
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- // do nothing
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/PortLabelProvider.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/PortLabelProvider.java
deleted file mode 100644
index ae4ea45..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/PortLabelProvider.java
+++ /dev/null
@@ -1,42 +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.viewers;
-
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.swt.graphics.Image;
-
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.IServerPort;
-/**
- * Server port label provider.
- */
-public class PortLabelProvider extends BaseLabelProvider implements ITableLabelProvider {
- protected IServer server;
-
- public PortLabelProvider(IServer server) {
- super();
- this.server = server;
- }
-
- public Image getColumnImage(Object element, int columnIndex) {
- return null;
- }
-
- public String getColumnText(Object element, int columnIndex) {
- IServerPort port = (IServerPort) element;
- if (columnIndex == 0)
- return notNull(port.getName());
- else if (columnIndex == 1)
- return port.getPort() + "";
- else
- return "";
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/RuntimeComposite.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/RuntimeComposite.java
deleted file mode 100644
index b842dfb..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/RuntimeComposite.java
+++ /dev/null
@@ -1,133 +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.viewers;
-
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
-import org.eclipse.jface.viewers.CheckboxTableViewer;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.KeyListener;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.IRuntimeWorkingCopy;
-import org.eclipse.wst.server.core.internal.ResourceManager;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-import org.eclipse.wst.server.ui.internal.Trace;
-/**
- *
- */
-public class RuntimeComposite extends AbstractTableComposite {
- protected IRuntime selection;
- protected IRuntime defaultRuntime;
- protected RuntimeSelectionListener listener;
-
- public interface RuntimeSelectionListener {
- public void runtimeSelected(IRuntime runtime);
- }
-
- public RuntimeComposite(Composite parent, int style, RuntimeSelectionListener listener2) {
- super(parent, style);
- this.listener = listener2;
-
- TableLayout tableLayout = new TableLayout();
- table.setLayout(tableLayout);
- table.setHeaderVisible(true);
-
- tableLayout.addColumnData(new ColumnWeightData(60, 160, true));
- TableColumn col = new TableColumn(table, SWT.NONE);
- col.setText(ServerUIPlugin.getResource("%columnName"));
-
- /*tableLayout.addColumnData(new ColumnWeightData(12, 120, true));
- col = new TableColumn(table, SWT.NONE);
- col.setText("Location");*/
-
- tableLayout.addColumnData(new ColumnWeightData(45, 125, true));
- col = new TableColumn(table, SWT.NONE);
- col.setText(ServerUIPlugin.getResource("%columnType"));
-
- tableViewer.setContentProvider(new RuntimeContentProvider());
- tableViewer.setLabelProvider(new RuntimeTableLabelProvider());
- tableViewer.setInput(AbstractTreeContentProvider.ROOT);
- tableViewer.setColumnProperties(new String[] {"name", "location", "type"});
-
- tableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- Object obj = getSelection(event.getSelection());
- if (obj instanceof IRuntime)
- selection = (IRuntime) obj;
- else
- selection = null;
- listener.runtimeSelected(selection);
- }
- });
-
- table.addKeyListener(new KeyListener() {
- public void keyPressed(KeyEvent e) {
- if (e.character == 'l') {
- try {
- IRuntime runtime = getSelectedRuntime();
- IRuntimeWorkingCopy wc = runtime.createWorkingCopy();
- wc.setReadOnly(!runtime.isReadOnly());
- wc.save(false, null);
- refresh(runtime);
- } catch (Exception ex) {
- // ignore
- }
- }
- }
-
- public void keyReleased(KeyEvent e) {
- // do nothing
- }
- });
-
- final ResourceManager rm = ResourceManager.getInstance();
- defaultRuntime = rm.getDefaultRuntime();
- if (defaultRuntime != null)
- ((CheckboxTableViewer)tableViewer).setChecked(defaultRuntime, true);
-
- ((CheckboxTableViewer)tableViewer).addCheckStateListener(new ICheckStateListener() {
- public void checkStateChanged(CheckStateChangedEvent event) {
- try {
- IRuntime runtime = (IRuntime) event.getElement();
- if (event.getChecked()) {
- if (defaultRuntime != null && !runtime.equals(defaultRuntime))
- ((CheckboxTableViewer)tableViewer).setChecked(defaultRuntime, false);
- rm.setDefaultRuntime(runtime);
- defaultRuntime = runtime;
- } else
- rm.setDefaultRuntime(null);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error setting default runtime", e);
- }
- }
- });
- }
-
- protected void createTable() {
- table = new Table(this, SWT.BORDER | SWT.FULL_SELECTION | SWT.V_SCROLL | SWT.H_SCROLL | SWT.SINGLE | SWT.CHECK);
- }
-
- protected void createTableViewer() {
- tableViewer = new LockedCheckboxTableViewer(table);
- }
-
- public IRuntime getSelectedRuntime() {
- return selection;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/RuntimeContentProvider.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/RuntimeContentProvider.java
deleted file mode 100644
index d1cbf29..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/RuntimeContentProvider.java
+++ /dev/null
@@ -1,64 +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.viewers;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-
-import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.ServerCore;
-/**
- * Runtime content provider.
- */
-public class RuntimeContentProvider implements IStructuredContentProvider {
- /**
- * RuntimeContentProvider constructor comment.
- */
- public RuntimeContentProvider() {
- super();
- }
-
- /**
- * Disposes of this content provider.
- * This is called by the viewer when it is disposed.
- */
- public void dispose() {
- // do nothing
- }
-
- /**
- * Returns the elements to display in the viewer
- * when its input is set to the given element.
- */
- public Object[] getElements(Object inputElement) {
- List list = new ArrayList();
- IRuntime[] runtimes = ServerCore.getRuntimes();
- if (runtimes != null) {
- int size = runtimes.length;
- for (int i = 0; i < size; i++) {
- if (!runtimes[i].isPrivate())
- list.add(runtimes[i]);
- }
- }
- return list.toArray();
- }
-
- /**
- * Notifies this content provider that the given viewer's input
- * has been switched to a different element.
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- // do nothing
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/RuntimeTableLabelProvider.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/RuntimeTableLabelProvider.java
deleted file mode 100644
index 35c0ced..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/RuntimeTableLabelProvider.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.viewers;
-
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.IRuntimeType;
-import org.eclipse.wst.server.ui.internal.ImageResource;
-import org.eclipse.swt.graphics.Image;
-/**
- * Runtime table label provider.
- */
-public class RuntimeTableLabelProvider extends BaseLabelProvider implements ITableLabelProvider, ILockedLabelProvider {
- /**
- * RuntimeTableLabelProvider constructor comment.
- */
- public RuntimeTableLabelProvider() {
- super();
- }
-
- /**
- * Returns the label image for the given column of the given element.
- *
- * @param element the object representing the entire row, or
- * <code>null</code> indicating that no input object is set
- * in the viewer
- * @param columnIndex the zero-based index of the column in which
- * the label appears
- */
- public Image getColumnImage(Object element, int columnIndex) {
- if (columnIndex == 0) {
- IRuntime runtime = (IRuntime) element;
- IRuntimeType runtimeType = runtime.getRuntimeType();
- if (runtimeType != null)
- return ImageResource.getImage(runtimeType.getId());
- }
- return null;
- }
-
- /**
- * Returns the label text for the given column of the given element.
- *
- * @param element the object representing the entire row, or
- * <code>null</code> indicating that no input object is set
- * in the viewer
- * @param columnIndex the zero-based index of the column in which the label appears
- */
- public String getColumnText(Object element, int columnIndex) {
- IRuntime runtime = (IRuntime) element;
- if (columnIndex == 0)
- return notNull(runtime.getName());
- /*else if (columnIndex == 1) {
- IPath location = runtime.getLocation();
- if (location == null)
- return "";
- else
- return notNull(location.toOSString());
- }*/
- else if (columnIndex == 1) {
- IRuntimeType runtimeType = runtime.getRuntimeType();
- if (runtimeType != null)
- return notNull(runtimeType.getName());
- return "";
- } else
- return "X";
- }
-
- public boolean isLocked(Object element) {
- IRuntime runtime = (IRuntime) element;
- return runtime.isReadOnly();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/RuntimeTreeContentProvider.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/RuntimeTreeContentProvider.java
deleted file mode 100644
index 14b0bb7..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/RuntimeTreeContentProvider.java
+++ /dev/null
@@ -1,69 +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.viewers;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.IRuntimeType;
-import org.eclipse.wst.server.core.ServerCore;
-import org.eclipse.wst.server.ui.internal.Trace;
-/**
- * Runtime content provider.
- */
-public class RuntimeTreeContentProvider extends AbstractTreeContentProvider {
- public static final byte STYLE_VENDOR = 1;
- public static final byte STYLE_VERSION = 2;
- public static final byte STYLE_TYPE = 3;
-
- /**
- * RuntimeTreeContentProvider constructor comment.
- */
- public RuntimeTreeContentProvider(byte style) {
- super(style);
- }
-
- public void fillTree() {
- clean();
- List list = new ArrayList();
- if (style != STYLE_FLAT) {
- IRuntime[] runtimes = ServerCore.getRuntimes();
- if (runtimes != null) {
- int size = runtimes.length;
- for (int i = 0; i < size; i++) {
- IRuntimeType runtimeType = runtimes[i].getRuntimeType();
- try {
- TreeElement ele = null;
- if (style == STYLE_VENDOR)
- ele = getOrCreate(list, runtimeType.getVendor());
- else if (style == STYLE_VERSION)
- ele = getOrCreate(list, runtimeType.getVersion());
- else if (style == STYLE_TYPE)
- ele = getOrCreate(list, runtimeType.getName());
- ele.contents.add(runtimes[i]);
- elementToParentMap.put(runtimes[i], ele);
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Error in runtime content provider", e);
- }
- }
- }
- } else {
- IRuntime[] runtimes = ServerCore.getRuntimes();
- if (runtimes != null) {
- int size = runtimes.length;
- for (int i = 0; i < size; i++)
- list.add(runtimes[i]);
- }
- }
- elements = list.toArray();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/RuntimeTreeLabelProvider.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/RuntimeTreeLabelProvider.java
deleted file mode 100644
index 4cf36de..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/RuntimeTreeLabelProvider.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.viewers;
-
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.ui.internal.ImageResource;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.PlatformUI;
-/**
- * Runtime label provider.
- */
-public class RuntimeTreeLabelProvider extends AbstractTreeLabelProvider implements ITableLabelProvider {
- /**
- * RuntimeTreeLabelProvider constructor comment.
- */
- public RuntimeTreeLabelProvider() {
- super();
- }
-
- /**
- *
- */
- protected Image getImageImpl(Object element) {
- IRuntime runtime = (IRuntime) element;
- if (runtime.getRuntimeType() != null)
- return ImageResource.getImage(runtime.getRuntimeType().getId());
- return null;
- }
-
- /**
- *
- */
- protected String getTextImpl(Object element) {
- IRuntime runtime = (IRuntime) element;
- return notNull(runtime.getName());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, int)
- */
- public Image getColumnImage(Object element, int columnIndex) {
- if (columnIndex == 0) {
- if (element instanceof ServerTreeContentProvider.TreeElement) {
- ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages();
- return sharedImages.getImage(ISharedImages.IMG_OBJ_FOLDER);
- }
- return getImageImpl(element);
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int)
- */
- public String getColumnText(Object element, int columnIndex) {
- if (element instanceof ServerTreeContentProvider.TreeElement) {
- if (columnIndex == 0)
- return ((ServerTreeContentProvider.TreeElement) element).text;
- return "";
- }
- IRuntime runtime = (IRuntime) element;
- if (columnIndex == 0)
- return runtime.getName();
- else if (columnIndex == 1) {
- if (runtime.getRuntimeType() != null)
- return notNull(runtime.getRuntimeType().getName());
- return "";
- }
- return "X";
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/RuntimeTypeComposite.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/RuntimeTypeComposite.java
deleted file mode 100644
index 61b4c5c..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/RuntimeTypeComposite.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.viewers;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerSorter;
-import org.eclipse.swt.widgets.Composite;
-
-import org.eclipse.wst.server.core.IRuntimeType;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-/**
- *
- */
-public class RuntimeTypeComposite extends AbstractTreeComposite {
- protected IRuntimeType selection;
- protected RuntimeTypeSelectionListener listener;
- protected boolean creation;
- protected String type;
- protected String version;
- protected String runtimeTypeId;
-
- protected RuntimeTypeTreeContentProvider contentProvider;
- protected boolean initialSelection = true;
-
- public interface RuntimeTypeSelectionListener {
- public void runtimeTypeSelected(IRuntimeType runtimeType);
- }
-
- public RuntimeTypeComposite(Composite parent, int style, boolean creation, RuntimeTypeSelectionListener listener2, String type, String version, String runtimeTypeId) {
- super(parent, style);
- this.listener = listener2;
- this.creation = creation;
- this.type = type;
- this.version = version;
- this.runtimeTypeId = runtimeTypeId;
-
- contentProvider = new RuntimeTypeTreeContentProvider(RuntimeTypeTreeContentProvider.STYLE_VENDOR, creation, type, version, runtimeTypeId);
- treeViewer.setContentProvider(contentProvider);
- treeViewer.setLabelProvider(new RuntimeTypeTreeLabelProvider());
- treeViewer.setInput(AbstractTreeContentProvider.ROOT);
-
- treeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- Object obj = getSelection(event.getSelection());
- if (obj instanceof IRuntimeType) {
- selection = (IRuntimeType) obj;
- setDescription(selection.getDescription());
- } else {
- selection = null;
- setDescription("");
- }
- listener.runtimeTypeSelected(selection);
- }
- });
-
- treeViewer.setSorter(new ViewerSorter() {
- public int compare(Viewer viewer, Object e1, Object e2) {
- if (e1 instanceof IRuntimeType && !(e2 instanceof IRuntimeType))
- return 1;
- if (!(e1 instanceof IRuntimeType) && e2 instanceof IRuntimeType)
- return -1;
- if (!(e1 instanceof IRuntimeType && e2 instanceof IRuntimeType))
- return super.compare(viewer, e1, e2);
- IRuntimeType r1 = (IRuntimeType) e1;
- IRuntimeType r2 = (IRuntimeType) e2;
- return r1.getName().compareToIgnoreCase(r2.getName());
- }
- });
- }
-
- public void setVisible(boolean visible) {
- super.setVisible(visible);
- if (visible && initialSelection) {
- initialSelection = false;
- if (contentProvider.getInitialSelection() != null)
- treeViewer.setSelection(new StructuredSelection(contentProvider.getInitialSelection()), true);
- }
- }
-
- protected String getTitleLabel() {
- return ServerUIPlugin.getResource("%runtimeTypeCompTree");
- }
-
- protected String getDescriptionLabel() {
- return ServerUIPlugin.getResource("%runtimeTypeCompDescription");
- }
-
- protected String[] getComboOptions() {
- return new String[] { ServerUIPlugin.getResource("%name"),
- ServerUIPlugin.getResource("%vendor"), ServerUIPlugin.getResource("%version"),
- ServerUIPlugin.getResource("%moduleSupport") };
- }
-
- protected void viewOptionSelected(byte option) {
- ISelection sel = treeViewer.getSelection();
- treeViewer.setContentProvider(new RuntimeTypeTreeContentProvider(option, creation, type, version, runtimeTypeId));
- treeViewer.setSelection(sel);
- }
-
- public IRuntimeType getSelectedRuntimeType() {
- return selection;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/RuntimeTypeTreeContentProvider.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/RuntimeTypeTreeContentProvider.java
deleted file mode 100644
index b7d969a..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/RuntimeTypeTreeContentProvider.java
+++ /dev/null
@@ -1,114 +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.viewers;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.server.core.*;
-/**
- * Runtime type content provider.
- */
-public class RuntimeTypeTreeContentProvider extends AbstractTreeContentProvider {
- public static final byte STYLE_VENDOR = 1;
- public static final byte STYLE_VERSION = 2;
- public static final byte STYLE_MODULE_TYPE = 3;
-
- protected boolean creation;
- protected String type;
- protected String version;
- protected String runtimeTypeId;
-
- /**
- * RuntimeTypeContentProvider constructor comment.
- */
- public RuntimeTypeTreeContentProvider(byte style, boolean creation) {
- super(style);
- this.creation = creation;
- }
-
- public RuntimeTypeTreeContentProvider(byte style, boolean creation, String type, String version, String runtimeTypeId) {
- super(style, false);
- this.type = type;
- this.version = version;
- this.runtimeTypeId = runtimeTypeId;
- this.creation = creation;
-
- fillTree();
- }
-
- public void fillTree() {
- clean();
- List list = new ArrayList();
- if (style != STYLE_FLAT) {
- IRuntimeType[] runtimeTypes = ServerUtil.getRuntimeTypes(type, version, runtimeTypeId);
- if (runtimeTypes != null) {
- int size = runtimeTypes.length;
- for (int i = 0; i < size; i++) {
- IRuntimeType runtimeType = runtimeTypes[i];
- if (!creation || runtimeType.canCreate()) {
- int order = getRuntimeOrder(runtimeType);
- if (order > initialSelectionOrder) {
- initialSelection = runtimeType;
- initialSelectionOrder = order;
- }
- TreeElement ele = null;
- if (style == STYLE_VENDOR) {
- ele = getOrCreate(list, runtimeType.getVendor());
- ele.contents.add(runtimeType);
- elementToParentMap.put(runtimeType, ele);
- } else if (style == STYLE_VERSION) {
- ele = getOrCreate(list, runtimeType.getVersion());
- ele.contents.add(runtimeType);
- elementToParentMap.put(runtimeType, ele);
- } else if (style == STYLE_MODULE_TYPE) {
- IModuleType[] moduleTypes = runtimeType.getModuleTypes();
- if (moduleTypes != null) {
- int size2 = moduleTypes.length;
- for (int j = 0; j < size2; j++) {
- IModuleType mb = moduleTypes[j];
- if (mb != null) {
- ele = getOrCreate(list, mb.getName());
- TreeElement ele2 = getOrCreate(ele.contents, mb.getName() + "/" + mb.getVersion(), mb.getVersion());
- ele2.contents.add(runtimeType);
- elementToParentMap.put(runtimeType, ele2);
- elementToParentMap.put(ele2, ele);
- }
- }
- }
- }
- }
- }
- }
- } else {
- IRuntimeType[] runtimeTypes = ServerUtil.getRuntimeTypes(type, version, runtimeTypeId);
- if (runtimeTypes != null) {
- int size = runtimeTypes.length;
- for (int i = 0; i < size; i++) {
- IRuntimeType runtimeType = runtimeTypes[i];
- if (!creation || runtimeType.canCreate()) {
- int order = getRuntimeOrder(runtimeType);
- if (order > initialSelectionOrder) {
- initialSelection = runtimeType;
- initialSelectionOrder = order;
- }
- list.add(runtimeType);
- }
- }
- }
- }
- elements = list.toArray();
- }
-
- private int getRuntimeOrder(IRuntimeType runtimeType) {
- return 0;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/RuntimeTypeTreeLabelProvider.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/RuntimeTypeTreeLabelProvider.java
deleted file mode 100644
index be65daf..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/RuntimeTypeTreeLabelProvider.java
+++ /dev/null
@@ -1,42 +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.viewers;
-
-import org.eclipse.wst.server.core.IRuntimeType;
-import org.eclipse.wst.server.ui.internal.ImageResource;
-import org.eclipse.swt.graphics.Image;
-/**
- * Runtime type label provider.
- */
-public class RuntimeTypeTreeLabelProvider extends AbstractTreeLabelProvider {
- /**
- * RuntimeTypeTreeLabelProvider constructor comment.
- */
- public RuntimeTypeTreeLabelProvider() {
- super();
- }
-
- /**
- *
- */
- protected Image getImageImpl(Object element) {
- IRuntimeType runtimeType = (IRuntimeType) element;
- return ImageResource.getImage(runtimeType.getId());
- }
-
- /**
- *
- */
- protected String getTextImpl(Object element) {
- IRuntimeType runtimeType = (IRuntimeType) element;
- return notNull(runtimeType.getName());
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/SView.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/SView.java
deleted file mode 100644
index 9f38091..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/SView.java
+++ /dev/null
@@ -1,277 +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.viewers;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.ACC;
-import org.eclipse.swt.accessibility.AccessibleAdapter;
-import org.eclipse.swt.accessibility.AccessibleControlAdapter;
-import org.eclipse.swt.accessibility.AccessibleControlEvent;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.FocusListener;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseListener;
-import org.eclipse.swt.events.MouseTrackListener;
-import org.eclipse.swt.events.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Cursor;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.graphics.Region;
-import org.eclipse.swt.widgets.Canvas;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.TypedListener;
-/**
- * Simple SWT widget with an image banner and a label.
- */
-public class SView extends Canvas {
- protected Color focusColor;
- protected boolean mouseOver = false;
- protected boolean hasFocus = false;
- //protected boolean isOpen = true;
-
- //protected String name;
- //protected String description;
-
- protected Color one;
- protected Color two;
- protected Color three;
-
- protected Color grone;
- protected Color grtwo;
- protected Color grthree;
-
- private Cursor cursor;
-
- public SView(Composite parent, int style) {
- super(parent, style);
-
- cursor = new Cursor(parent.getDisplay(), SWT.CURSOR_HAND);
- setCursor(cursor);
-
- one = new Color(getDisplay(), 224, 244, 252);
- two = new Color(getDisplay(), 178, 212, 247);
- three = new Color(getDisplay(), 138, 185, 242);
-
- grone = new Color(getDisplay(), 229, 255, 193);
- grtwo = new Color(getDisplay(), 63, 214, 16);
- grthree = new Color(getDisplay(), 21, 157, 4);
-
- addPaintListener(new PaintListener() {
- public void paintControl(PaintEvent e) {
- SView.this.paintControl(e);
- }
- });
- addMouseListener(new MouseListener() {
- public void mouseDown(MouseEvent e) {
- //changeTwistie(!isOpen);
- }
- public void mouseUp(MouseEvent e) {
- // do nothing
- }
- public void mouseDoubleClick(MouseEvent e) {
- // do nothing
- }
- });
- addMouseTrackListener(new MouseTrackListener() {
- public void mouseEnter(MouseEvent e) {
- mouseOver = true;
- SView.this.redraw();
- }
- public void mouseExit(MouseEvent e) {
- mouseOver = false;
- SView.this.redraw();
- }
- public void mouseHover(MouseEvent e) {
- // do nothing
- }
- });
- addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- //changeTwistie(!isOpen);
- redraw();
- }
- });
- addListener(SWT.Traverse, new Listener () {
- public void handleEvent(Event e) {
- if (e.detail != SWT.TRAVERSE_RETURN)
- e.doit = true;
- }
- });
- addFocusListener(new FocusListener() {
- public void focusGained(FocusEvent e) {
- hasFocus = true;
- redraw();
- }
- public void focusLost(FocusEvent e) {
- hasFocus = false;
- redraw();
- }
- });
- addKeyListener(new KeyAdapter() {
- public void keyPressed(KeyEvent e) {
- if (e.character == '\r') {
- // Activation
- notifyListeners(SWT.Selection);
- }
- }
- });
- addDisposeListener(new DisposeListener() {
- public void widgetDisposed(DisposeEvent e) {
- disposeImpl();
- }
- });
-
- getAccessible().addAccessibleListener(new AccessibleAdapter() {
- public void getName(AccessibleEvent e) {
- //e.result = name;
- }
-
- public void getDescription(AccessibleEvent e) {
- //e.result = description;
- }
- });
-
- getAccessible().addAccessibleControlListener(new AccessibleControlAdapter() {
- public void getLocation(AccessibleControlEvent e) {
- Rectangle location = getBounds();
- Point pt = toDisplay(new Point(location.x, location.y));
- e.x = pt.x;
- e.y = pt.y;
- e.width = location.width;
- e.height = location.height;
- }
-
- public void getChildCount(AccessibleControlEvent e) {
- e.detail = 0;
- }
-
- public void getRole(AccessibleControlEvent e) {
- e.detail = ACC.ROLE_TREE;
- }
-
- public void getState(AccessibleControlEvent e) {
- //e.detail = isOpen ? ACC.STATE_EXPANDED : ACC.STATE_COLLAPSED;
- }
- });
- }
-
- protected void disposeImpl() {
- if (cursor != null) {
- cursor.dispose();
- cursor = null;
- one.dispose();
- two.dispose();
- three.dispose();
-
- grone.dispose();
- grtwo.dispose();
- grthree.dispose();
- }
- }
-
- public void addSelectionListener(SelectionListener listener) {
- checkWidget ();
- if (listener == null) return;
- TypedListener typedListener = new TypedListener (listener);
- addListener (SWT.Selection,typedListener);
- }
-
- public void removeSelectionListener(SelectionListener listener) {
- checkWidget ();
- if (listener == null) return;
- removeListener (SWT.Selection, listener);
- }
-
- protected void notifyListeners(int eventType) {
- Event event = new Event();
- event.type = eventType;
- event.widget = this;
- notifyListeners(eventType, event);
- }
-
- protected void paintRect(GC gc, int x, int y, Color a, Color b, Color c) {
- int[] p = new int[] { 0, 2, 2, 0, 30, 0, 32, 2, 32, 30, 30, 32, 2, 32, 0, 30};
-
- int[] q = new int[p.length];
- for (int i = 0; i < p.length / 2; i++) {
- q[i*2] = p[i*2] + x;
- q[i*2+1] = p[i*2+1] + y;
- }
-
- Region region = new Region(getDisplay());
- region.add(q);
-
- gc.setClipping(region);
-
- gc.setBackground(a);
- gc.setForeground(b);
- gc.fillGradientRectangle(x, y, 32, 32, true);
- gc.setClipping((Region)null);
- gc.setForeground(c);
- gc.drawPolygon(q);
-
- gc.setForeground(getForeground());
- gc.setBackground(getBackground());
- String st = "Tomcat Test Environment";
- Point stp = gc.stringExtent(st);
- gc.drawString(st, x+16 - stp.x / 2, y + 32 + 2);
- }
-
- void paintControl(PaintEvent e) {
- GC gc = e.gc;
-
- Point s = getSize();
-
- gc.setBackground(getBackground());
- gc.fillRectangle(0, 0, s.x, s.y);
-
- /*if (mouseOver)
- gc.setBackground(getFocusColor());
- else
- gc.setBackground(getForeground());*/
-
- // one
- paintRect(gc, 60, 0, one, two, three);
-
- paintRect(gc, 140, 0, grone, grtwo, grthree);
-
- /*if (hasFocus) {
- gc.setBackground(getBackground());
- gc.setForeground(getFocusColor());
- gc.drawFocus(0, 0, 10, 11);
- }*/
- }
-
- /*public Color getFocusColor() {
- return focusColor;
- }
-
- public void setFocusColor(Color color) {
- focusColor = color;
- }*/
-
- public Point computeSize(int wHint, int hHint, boolean changed) {
- return new Point(200, 60);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/ServerComposite.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/ServerComposite.java
deleted file mode 100644
index e4ad92d..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/ServerComposite.java
+++ /dev/null
@@ -1,127 +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.viewers;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.widgets.Composite;
-
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-/**
- *
- */
-public class ServerComposite extends AbstractTreeComposite {
- protected IServer selection;
- protected ServerSelectionListener listener;
- protected ServerTreeContentProvider contentProvider;
- protected boolean initialSelection = true;
- protected byte viewOption;
-
- protected IModule module;
- protected String launchMode;
- protected boolean includeIncompatibleVersions;
-
- public interface ServerSelectionListener {
- public void serverSelected(IServer server);
- }
-
- public ServerComposite(Composite parent, int style, ServerSelectionListener listener2, IModule module, String launchMode) {
- super(parent, style);
- this.module = module;
- this.launchMode = launchMode;
-
- this.listener = listener2;
-
- contentProvider = new ServerTreeContentProvider(ServerTreeContentProvider.STYLE_HOST, module, launchMode);
- viewOption = ServerTreeContentProvider.STYLE_HOST;
- treeViewer.setContentProvider(contentProvider);
- treeViewer.setLabelProvider(new ServerTreeLabelProvider());
- treeViewer.setInput(AbstractTreeContentProvider.ROOT);
- treeViewer.expandToLevel(1);
-
- treeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- Object obj = getSelection(event.getSelection());
- if (obj instanceof IServer) {
- selection = (IServer) obj;
- setDescription(selection.getServerType().getRuntimeType().getDescription());
- } else {
- selection = null;
- setDescription("");
- }
- listener.serverSelected(selection);
- }
- });
- }
-
- public ServerComposite(Composite parent, int style, ServerSelectionListener listener2) {
- this(parent, style, listener2, null, null);
- }
-
- public void setIncludeIncompatibleVersions(boolean b) {
- includeIncompatibleVersions = b;
- ISelection sel = treeViewer.getSelection();
- contentProvider.setIncludeIncompatibleVersions(b);
- treeViewer.refresh();
- treeViewer.setSelection(sel, true);
- }
-
- public void setVisible(boolean visible) {
- super.setVisible(visible);
- if (visible && initialSelection) {
- initialSelection = false;
- if (contentProvider.getInitialSelection() != null)
- treeViewer.setSelection(new StructuredSelection(contentProvider.getInitialSelection()), true);
- }
- }
-
- public void refreshAll() {
- ISelection sel = treeViewer.getSelection();
- contentProvider = new ServerTreeContentProvider(viewOption, module, launchMode);
- contentProvider.setIncludeIncompatibleVersions(includeIncompatibleVersions);
- treeViewer.setContentProvider(contentProvider);
- treeViewer.setSelection(sel);
- }
-
- protected String getDescriptionLabel() {
- return null; //ServerUIPlugin.getResource("%serverTypeCompDescription");
- }
-
- protected String getTitleLabel() {
- return ServerUIPlugin.getResource("%wizNewServerSelectExisting");
- }
-
- protected String[] getComboOptions() {
- return new String[] { ServerUIPlugin.getResource("%name"), ServerUIPlugin.getResource("%host"),
- ServerUIPlugin.getResource("%vendor"), ServerUIPlugin.getResource("%version") };
- }
-
- protected void viewOptionSelected(byte option) {
- ISelection sel = treeViewer.getSelection();
- viewOption = option;
- contentProvider = new ServerTreeContentProvider(option, module, launchMode);
- contentProvider.setIncludeIncompatibleVersions(includeIncompatibleVersions);
- treeViewer.setContentProvider(contentProvider);
- treeViewer.setSelection(sel);
- }
-
- public IServer getSelectedServer() {
- return selection;
- }
-
- public void setSelection(IServer server) {
- treeViewer.setSelection(new StructuredSelection(server), true);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/ServerTreeContentProvider.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/ServerTreeContentProvider.java
deleted file mode 100644
index af0ec46..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/ServerTreeContentProvider.java
+++ /dev/null
@@ -1,131 +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.viewers;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IModuleType;
-import org.eclipse.wst.server.core.IRuntimeType;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.IServerType;
-import org.eclipse.wst.server.core.ServerCore;
-import org.eclipse.wst.server.core.ServerUtil;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-/**
- * Runtime type content provider.
- */
-public class ServerTreeContentProvider extends AbstractTreeContentProvider {
- public static final byte STYLE_HOST = 1;
- public static final byte STYLE_VENDOR = 2;
- public static final byte STYLE_VERSION = 3;
-
- protected IModule module;
- protected String launchMode;
- protected boolean includeIncompatibleVersions;
-
- /**
- * ServerTreeContentProvider constructor comment.
- */
- public ServerTreeContentProvider(byte style) {
- super(style);
- }
-
- public ServerTreeContentProvider(byte style, IModule module, String launchMode) {
- super(style, false);
- this.module = module;
- this.launchMode = launchMode;
-
- fillTree();
- }
-
- public void setIncludeIncompatibleVersions(boolean b) {
- includeIncompatibleVersions = b;
- fillTree();
- }
-
- protected void fillTree() {
- clean();
- List list = new ArrayList();
- if (style != STYLE_FLAT) {
- IServer[] servers = ServerCore.getServers();
- if (servers != null) {
- int size = servers.length;
- for (int i = 0; i < size; i++) {
- if (acceptServer(servers[i])) {
- IServerType serverType = servers[i].getServerType();
- IRuntimeType runtimeType = serverType.getRuntimeType();
- int order = getServerOrder(serverType);
- if (order > initialSelectionOrder) {
- initialSelection = servers[i];
- initialSelectionOrder = order;
- }
- TreeElement te = null;
- if (style == STYLE_HOST) {
- te = getOrCreate(list, servers[i].getHost());
- } else if (style == STYLE_VERSION) {
- String version = ServerUIPlugin.getResource("%elementUnknownName");
- if (runtimeType != null)
- version = runtimeType.getVersion();
- te = getOrCreate(list, version);
- } else if (style == STYLE_VENDOR) {
- String vendor = ServerUIPlugin.getResource("%elementUnknownName");
- if (runtimeType != null)
- vendor = runtimeType.getVendor();
- te = getOrCreate(list, vendor);
- }
- te.contents.add(servers[i]);
- elementToParentMap.put(servers[i], te);
- }
- }
- }
- } else {
- IServer[] servers = ServerCore.getServers();
- if (servers != null) {
- int size = servers.length;
- for (int i = 0; i < size; i++) {
- if (acceptServer(servers[i])) {
- IServerType serverType = servers[i].getServerType();
- list.add(servers[i]);
- int order = getServerOrder(serverType);
- if (order > initialSelectionOrder) {
- initialSelection = servers[i];
- initialSelectionOrder = order;
- }
- }
- }
- }
- }
- elements = list.toArray();
- }
-
- protected boolean acceptServer(IServer server) {
- if (module == null || launchMode == null)
- return true;
- if (!ServerUIPlugin.isCompatibleWithLaunchMode(server, launchMode))
- return false;
-
- IModuleType mt = module.getModuleType();
- if (includeIncompatibleVersions) {
- if (!ServerUtil.isSupportedModule(server.getServerType().getRuntimeType().getModuleTypes(), mt.getId(), null))
- return false;
- } else {
- if (!ServerUtil.isSupportedModule(server.getServerType().getRuntimeType().getModuleTypes(), mt.getId(), mt.getVersion()))
- return false;
- }
- return true;
- }
-
- private int getServerOrder(IServerType serverType) {
- return 0;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/ServerTreeLabelProvider.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/ServerTreeLabelProvider.java
deleted file mode 100644
index c2dcda1..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/ServerTreeLabelProvider.java
+++ /dev/null
@@ -1,42 +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.viewers;
-
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.ui.internal.ImageResource;
-import org.eclipse.swt.graphics.Image;
-/**
- * Server tree label provider.
- */
-public class ServerTreeLabelProvider extends AbstractTreeLabelProvider {
- /**
- * ServerTreeLabelProvider constructor comment.
- */
- public ServerTreeLabelProvider() {
- super();
- }
-
- /**
- *
- */
- public Image getImageImpl(Object element) {
- IServer server = (IServer) element;
- return ImageResource.getImage(server.getServerType().getId());
- }
-
- /**
- *
- */
- public String getTextImpl(Object element) {
- IServer server = (IServer) element;
- return server.getName();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/ServerTypeComposite.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/ServerTypeComposite.java
deleted file mode 100644
index 9159dca..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/ServerTypeComposite.java
+++ /dev/null
@@ -1,143 +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.viewers;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerSorter;
-import org.eclipse.swt.widgets.Composite;
-
-import org.eclipse.wst.server.core.IModuleType;
-import org.eclipse.wst.server.core.IServerType;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-/**
- *
- */
-public class ServerTypeComposite extends AbstractTreeComposite {
- protected IServerType selection;
- protected ServerTypeSelectionListener listener;
- protected ServerTypeTreeContentProvider contentProvider;
- protected boolean initialSelection = true;
-
- protected IModuleType moduleType;
-
- protected boolean isLocalhost;
- protected boolean includeIncompatibleVersions;
-
- public interface ServerTypeSelectionListener {
- public void serverTypeSelected(IServerType type);
- }
-
- public ServerTypeComposite(Composite parent, int style, IModuleType moduleType, ServerTypeSelectionListener listener2) {
- super(parent, style);
- this.listener = listener2;
-
- this.moduleType = moduleType;
-
- contentProvider = new ServerTypeTreeContentProvider(ServerTypeTreeContentProvider.STYLE_VENDOR, moduleType);
- treeViewer.setContentProvider(contentProvider);
- treeViewer.setLabelProvider(new ServerTypeTreeLabelProvider());
- treeViewer.setInput(AbstractTreeContentProvider.ROOT);
-
- treeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- Object obj = getSelection(event.getSelection());
- if (obj instanceof IServerType) {
- selection = (IServerType) obj;
- setDescription(selection.getDescription());
- } else {
- selection = null;
- setDescription("");
- }
- listener.serverTypeSelected(selection);
- }
- });
-
- treeViewer.setSorter(new ViewerSorter() {
- public int compare(Viewer viewer, Object e1, Object e2) {
- if (e1 instanceof IServerType && !(e2 instanceof IServerType))
- return 1;
- if (!(e1 instanceof IServerType) && e2 instanceof IServerType)
- return -1;
- if (!(e1 instanceof IServerType && e2 instanceof IServerType))
- return super.compare(viewer, e1, e2);
- IServerType r1 = (IServerType) e1;
- IServerType r2 = (IServerType) e2;
- /*if (r1.getOrder() > r2.getOrder())
- return -1;
- else if (r1.getOrder() < r2.getOrder())
- return 1;
- else
- return super.compare(viewer, e1, e2);*/
- return r1.getName().compareTo(r2.getName());
- }
- });
- }
-
- public void setVisible(boolean visible) {
- super.setVisible(visible);
- if (visible && initialSelection) {
- initialSelection = false;
- if (contentProvider.getInitialSelection() != null)
- treeViewer.setSelection(new StructuredSelection(contentProvider.getInitialSelection()), true);
- }
- }
-
- public void setHost(boolean newHost) {
- if (isLocalhost == newHost)
- return;
-
- isLocalhost = newHost;
- ISelection sel = treeViewer.getSelection();
- contentProvider.setLocalhost(isLocalhost);
- treeViewer.refresh();
- //treeViewer.expandToLevel(2);
- treeViewer.setSelection(sel, true);
- }
-
- public void setIncludeIncompatibleVersions(boolean b) {
- includeIncompatibleVersions = b;
- ISelection sel = treeViewer.getSelection();
- contentProvider.setIncludeIncompatibleVersions(b);
- treeViewer.refresh();
- treeViewer.setSelection(sel, true);
- }
-
- protected String getDescriptionLabel() {
- return null; //ServerUIPlugin.getResource("%serverTypeCompDescription");
- }
-
- protected String getTitleLabel() {
- return ServerUIPlugin.getResource("%serverTypeCompDescription");
- }
-
- protected String[] getComboOptions() {
- return new String[] { ServerUIPlugin.getResource("%name"),
- ServerUIPlugin.getResource("%vendor"), ServerUIPlugin.getResource("%version"),
- ServerUIPlugin.getResource("%moduleSupport") };
- }
-
- protected void viewOptionSelected(byte option) {
- ISelection sel = treeViewer.getSelection();
- contentProvider = new ServerTypeTreeContentProvider(option, moduleType);
- contentProvider.setLocalhost(isLocalhost);
- contentProvider.setIncludeIncompatibleVersions(includeIncompatibleVersions);
- treeViewer.setContentProvider(contentProvider);
- treeViewer.setSelection(sel);
- }
-
- public IServerType getSelectedServerType() {
- return selection;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/ServerTypeTreeContentProvider.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/ServerTypeTreeContentProvider.java
deleted file mode 100644
index 6fa8f38..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/ServerTypeTreeContentProvider.java
+++ /dev/null
@@ -1,152 +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.viewers;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.server.core.*;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-import org.eclipse.wst.server.ui.internal.Trace;
-/**
- * Server type content provider.
- */
-public class ServerTypeTreeContentProvider extends AbstractTreeContentProvider {
- public static final byte STYLE_VENDOR = 1;
- public static final byte STYLE_VERSION = 2;
- public static final byte STYLE_MODULE_TYPE = 3;
- public static final byte STYLE_TYPE = 4; // not used yet
-
- protected boolean localhost;
-
- protected IModuleType moduleType;
- protected boolean includeIncompatibleVersions;
-
- /**
- * ServerTypeTreeContentProvider constructor comment.
- */
- public ServerTypeTreeContentProvider(byte style, IModuleType moduleType) {
- super(style, false);
- localhost = true;
-
- this.moduleType = moduleType;
-
- fillTree();
- }
-
- public void fillTree() {
- clean();
-
- List list = new ArrayList();
- IServerType[] serverTypes = ServerCore.getServerTypes();
- if (serverTypes != null) {
- int size = serverTypes.length;
- for (int i = 0; i < size; i++) {
- IServerType serverType = serverTypes[i];
- if (include(serverType)) {
- int order = getServerOrder(serverType);
- if (order > initialSelectionOrder) {
- initialSelection = serverType;
- initialSelectionOrder = order;
- }
- if (style == STYLE_FLAT) {
- list.add(serverType);
- } else if (style != STYLE_MODULE_TYPE) {
- try {
- IRuntimeType runtimeType = serverType.getRuntimeType();
- TreeElement ele = null;
- if (style == STYLE_VENDOR)
- ele = getOrCreate(list, runtimeType.getVendor());
- else if (style == STYLE_VERSION)
- ele = getOrCreate(list, runtimeType.getVersion());
- else if (style == STYLE_TYPE)
- ele = getOrCreate(list, runtimeType.getName());
- ele.contents.add(serverType);
- elementToParentMap.put(serverType, ele);
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Error in server configuration content provider", e);
- }
- } else { // style = MODULE_TYPE
- IRuntimeType runtimeType = serverType.getRuntimeType();
- IModuleType[] moduleTypes = runtimeType.getModuleTypes();
- if (moduleTypes != null) {
- int size2 = moduleTypes.length;
- for (int j = 0; j < size2; j++) {
- IModuleType mb = moduleTypes[j];
- if (mb != null) {
- TreeElement ele = getOrCreate(list, mb.getName());
- TreeElement ele2 = getOrCreate(ele.contents, mb.getName() + "/" + mb.getVersion(), mb.getVersion());
- ele2.contents.add(serverType);
- elementToParentMap.put(serverType, ele2);
- elementToParentMap.put(ele2, ele);
- }
- }
- }
- }
- }
- }
- }
- elements = list.toArray();
- }
-
- protected boolean include(IServerType serverType) {
- IRuntimeType runtimeType = serverType.getRuntimeType();
- if (runtimeType == null)
- return false;
-
- String moduleTypeId = null;
- if (moduleType != null)
- moduleTypeId = moduleType.getId();
- if (includeIncompatibleVersions) {
- if (!ServerUtil.isSupportedModule(runtimeType.getModuleTypes(), moduleTypeId, null))
- return false;
- } else {
- String moduleVersion = null;
- if (moduleType != null)
- moduleVersion = moduleType.getVersion();
- if (!ServerUtil.isSupportedModule(runtimeType.getModuleTypes(), moduleTypeId, moduleVersion))
- return false;
- }
-
- if (localhost || serverType.supportsRemoteHosts())
- return true;
-
- return false;
- }
-
- protected boolean checkForNonStubEnvironmentRuntime(IServerType serverType) {
- IRuntimeType runtimeType = serverType.getRuntimeType();
- IRuntime[] runtimes = ServerUIPlugin.getRuntimes(runtimeType);
- if (runtimes == null || runtimes.length == 0)
- return false;
-
- int size = runtimes.length;
- for (int i = 0; i < size; i++) {
- if (!runtimes[i].isStub())
- return true;
- }
- return false;
- }
-
- public void setLocalhost(boolean local) {
- localhost = local;
- fillTree();
- }
-
- public void setIncludeIncompatibleVersions(boolean b) {
- includeIncompatibleVersions = b;
- fillTree();
- }
-
- private int getServerOrder(IServerType serverType) {
- return 0;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/ServerTypeTreeLabelProvider.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/ServerTypeTreeLabelProvider.java
deleted file mode 100644
index c5de75f..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/ServerTypeTreeLabelProvider.java
+++ /dev/null
@@ -1,42 +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.viewers;
-
-import org.eclipse.wst.server.core.IServerType;
-import org.eclipse.wst.server.ui.internal.ImageResource;
-import org.eclipse.swt.graphics.Image;
-/**
- * Server type label provider.
- */
-public class ServerTypeTreeLabelProvider extends AbstractTreeLabelProvider {
- /**
- * ServerTypeTreeLabelProvider constructor comment.
- */
- public ServerTypeTreeLabelProvider() {
- super();
- }
-
- /**
- *
- */
- protected Image getImageImpl(Object element) {
- IServerType type = (IServerType) element;
- return ImageResource.getImage(type.getId());
- }
-
- /**
- *
- */
- protected String getTextImpl(Object element) {
- IServerType type = (IServerType) element;
- return notNull(type.getName());
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/AbstractWizard.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/AbstractWizard.java
deleted file mode 100644
index 65f822e..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/AbstractWizard.java
+++ /dev/null
@@ -1,49 +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.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.ui.IWorkbench;
-/**
- * An abstract Wizard that contains helper methods.
- */
-public abstract class AbstractWizard extends Wizard {
- protected IWorkbench workbench;
- protected IStructuredSelection selection;
-
- /**
- * AbstractWizard constructor comment.
- */
- public AbstractWizard() {
- super();
- }
-
- /**
- * Return the current workbench.
- *
- * @return the workbench
- */
- public IWorkbench getWorkbench() {
- return workbench;
- }
-
- /**
- * Initialize the workbench and current selection.
- *
- * @param newWorkbench
- * @param newSelection
- */
- public void init(IWorkbench newWorkbench, IStructuredSelection newSelection) {
- workbench = newWorkbench;
- selection = newSelection;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/ClosableWizardDialog.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/ClosableWizardDialog.java
deleted file mode 100644
index 5e75750..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/ClosableWizardDialog.java
+++ /dev/null
@@ -1,35 +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.jface.wizard.IWizard;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.swt.widgets.Shell;
-/**
- * A closable wizard dialog.
- */
-public class ClosableWizardDialog extends WizardDialog {
- /**
- * Constructor for ClosableWizardDialog.
- * @param shell
- * @param wizard
- */
- public ClosableWizardDialog(Shell shell, IWizard wizard) {
- super(shell, wizard);
- }
-
- /**
- * The Finish button has been pressed.
- */
- public void finishPressed() {
- super.finishPressed();
- }
-}
\ 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 cbee26e..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.ServerUIPlugin;
-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(ServerUIPlugin.getResource("%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/ModifyModulesWizard.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/ModifyModulesWizard.java
deleted file mode 100644
index eec3478..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/ModifyModulesWizard.java
+++ /dev/null
@@ -1,57 +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 java.util.List;
-
-import org.eclipse.wst.server.core.*;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-import org.eclipse.wst.server.ui.internal.task.SaveServerTask;
-import org.eclipse.wst.server.ui.internal.wizard.fragment.ModifyModulesWizardFragment;
-import org.eclipse.wst.server.ui.internal.wizard.fragment.TasksWizardFragment;
-import org.eclipse.wst.server.ui.wizard.TaskWizard;
-import org.eclipse.wst.server.ui.wizard.WizardFragment;
-/**
- * A wizard used to add and remove modules.
- */
-public class ModifyModulesWizard extends TaskWizard {
- static class ModifyModulesWizard2 extends WizardFragment {
- protected IServerWorkingCopy server;
-
- public ModifyModulesWizard2(IServerWorkingCopy server) {
- this.server = server;
- }
-
- protected void createChildFragments(List list) {
- list.add(new WizardFragment() {
- public void enter() {
- getTaskModel().putObject(TaskModel.TASK_SERVER, server);
- }
- });
- list.add(new ModifyModulesWizardFragment());
- list.add(new TasksWizardFragment());
- list.add(new WizardFragment() {
- public ITask createFinishTask() {
- return new SaveServerTask();
- }
- });
- }
- }
-
- /**
- * ModifyModulesWizard constructor comment.
- */
- public ModifyModulesWizard(IServer server) {
- super(ServerUIPlugin.getResource("%wizModuleWizardTitle"), new ModifyModulesWizard2(server.createWorkingCopy()));
-
- setNeedsProgressMonitor(true);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/NewRuntimeWizard.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/NewRuntimeWizard.java
deleted file mode 100644
index 2d85a84..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/NewRuntimeWizard.java
+++ /dev/null
@@ -1,45 +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 java.util.List;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-import org.eclipse.wst.server.ui.internal.task.FinishWizardFragment;
-import org.eclipse.wst.server.ui.internal.task.SaveRuntimeTask;
-import org.eclipse.wst.server.ui.internal.wizard.fragment.NewRuntimeWizardFragment;
-import org.eclipse.wst.server.ui.wizard.TaskWizard;
-import org.eclipse.wst.server.ui.wizard.WizardFragment;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
-/**
- * A wizard to create a new runtime.
- */
-public class NewRuntimeWizard extends TaskWizard implements INewWizard {
- /**
- * NewRuntimeWizard constructor comment.
- */
- public NewRuntimeWizard() {
- super(ServerUIPlugin.getResource("%wizNewRuntimeWizardTitle"), new WizardFragment() {
- protected void createChildFragments(List list) {
- list.add(new NewRuntimeWizardFragment());
- list.add(new FinishWizardFragment(new SaveRuntimeTask()));
- }
- });
-
- setForcePreviousAndNextButtons(true);
- }
-
- public void init(IWorkbench newWorkbench, IStructuredSelection newSelection) {
- // do nothing
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/NewServerWizard.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/NewServerWizard.java
deleted file mode 100644
index 851dc2c..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/NewServerWizard.java
+++ /dev/null
@@ -1,73 +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 java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.TaskModel;
-import org.eclipse.wst.server.core.util.Task;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-import org.eclipse.wst.server.ui.internal.task.*;
-import org.eclipse.wst.server.ui.internal.wizard.fragment.ModifyModulesWizardFragment;
-import org.eclipse.wst.server.ui.internal.wizard.fragment.NewServerWizardFragment;
-import org.eclipse.wst.server.ui.internal.wizard.fragment.TasksWizardFragment;
-import org.eclipse.wst.server.ui.wizard.TaskWizard;
-import org.eclipse.wst.server.ui.wizard.WizardFragment;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
-/**
- * A wizard to create a new server and server configuration.
- */
-public class NewServerWizard extends TaskWizard implements INewWizard {
- /**
- * NewServerWizard constructor comment.
- */
- public NewServerWizard() {
- this(null, null);
- }
-
- public NewServerWizard(final String[] ids, final String[] values) {
- super(ServerUIPlugin.getResource("%wizNewServerWizardTitle"), new WizardFragment() {
- protected void createChildFragments(List list) {
- if (ids != null)
- list.add(new InputWizardFragment(ids, values));
- list.add(new NewServerWizardFragment());
- list.add(new FinishWizardFragment(new TempSaveRuntimeTask()));
- list.add(new FinishWizardFragment(new TempSaveServerTask()));
- list.add(new ModifyModulesWizardFragment());
- list.add(new TasksWizardFragment());
- list.add(new FinishWizardFragment(new SaveRuntimeTask()));
- list.add(new FinishWizardFragment(new SaveServerTask()));
- list.add(new FinishWizardFragment(new Task() {
- public void execute(IProgressMonitor monitor) throws CoreException {
- try {
- IServer server = (IServer) getTaskModel().getObject(TaskModel.TASK_SERVER);
- ServerUIPlugin.getPreferences().addHostname(server.getHost());
- } catch (Exception e) {
- // ignore
- }
- }
- }));
- }
- });
-
- setForcePreviousAndNextButtons(true);
- }
-
- public void init(IWorkbench newWorkbench, IStructuredSelection newSelection) {
- // do nothing
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/RunOnServerWizard.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/RunOnServerWizard.java
deleted file mode 100644
index 6fff38c..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/RunOnServerWizard.java
+++ /dev/null
@@ -1,89 +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 java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.TaskModel;
-import org.eclipse.wst.server.core.util.Task;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-import org.eclipse.wst.server.ui.internal.task.*;
-import org.eclipse.wst.server.ui.internal.wizard.fragment.ModifyModulesWizardFragment;
-import org.eclipse.wst.server.ui.internal.wizard.fragment.NewServerWizardFragment;
-import org.eclipse.wst.server.ui.internal.wizard.fragment.TasksWizardFragment;
-import org.eclipse.wst.server.ui.wizard.TaskWizard;
-import org.eclipse.wst.server.ui.wizard.WizardFragment;
-/**
- * A wizard used to select a server from various lists.
- */
-public class RunOnServerWizard extends TaskWizard {
- protected static NewServerWizardFragment task;
-
- /**
- * RunOnServerWizard constructor comment.
- */
- public RunOnServerWizard(final IModule module, final String launchMode) {
- super(ServerUIPlugin.getResource("%wizRunOnServerTitle"), new WizardFragment() {
- protected void createChildFragments(List list) {
- task = new NewServerWizardFragment(module, launchMode);
- list.add(task);
- list.add(new FinishWizardFragment(new TempSaveRuntimeTask()));
- list.add(new FinishWizardFragment(new TempSaveServerTask()));
- list.add(new ModifyModulesWizardFragment(module));
- list.add(new TasksWizardFragment());
- list.add(new FinishWizardFragment(new SaveRuntimeTask()));
- list.add(new FinishWizardFragment(new SaveServerTask()));
- list.add(new FinishWizardFragment(new Task() {
- public void execute(IProgressMonitor monitor) throws CoreException {
- try {
- IServer server = (IServer) getTaskModel().getObject(TaskModel.TASK_SERVER);
- ServerUIPlugin.getPreferences().addHostname(server.getHost());
- } catch (Exception e) {
- // ignore
- }
- }
- }));
- }
- protected boolean useJob() {
- return true;
- }
- });
-
- setNeedsProgressMonitor(true);
- if (ILaunchManager.DEBUG_MODE.equals(launchMode))
- setWindowTitle(ServerUIPlugin.getResource("%wizDebugOnServerTitle"));
- else if (ILaunchManager.PROFILE_MODE.equals(launchMode))
- setWindowTitle(ServerUIPlugin.getResource("%wizProfileOnServerTitle"));
- }
-
- /**
- * Return the server.
- * @return org.eclipse.wst.server.core.IServer
- */
- public IServer getServer() {
- try {
- return (IServer) getRootFragment().getTaskModel().getObject(TaskModel.TASK_SERVER);
- } catch (Exception e) {
- return null;
- }
- }
-
- public boolean isPreferredServer() {
- if (task == null)
- return false;
- return task.isPreferredServer();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/SelectClientWizard.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/SelectClientWizard.java
deleted file mode 100644
index 82ddcf3..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/SelectClientWizard.java
+++ /dev/null
@@ -1,56 +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.core.internal.IClient;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-import org.eclipse.wst.server.ui.internal.wizard.page.SelectClientComposite;
-import org.eclipse.wst.server.ui.wizard.IWizardHandle;
-import org.eclipse.wst.server.ui.wizard.TaskWizard;
-import org.eclipse.wst.server.ui.wizard.WizardFragment;
-import org.eclipse.swt.widgets.Composite;
-/**
- * A wizard used to select a server client from a list.
- */
-public class SelectClientWizard extends TaskWizard {
- protected static SelectClientComposite comp;
-
- /**
- * SelectClientWizard constructor comment.
- */
- public SelectClientWizard(final IClient[] clients) {
- super(ServerUIPlugin.getResource("%wizSelectClientWizardTitle"),
- new WizardFragment() {
- public boolean hasComposite() {
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.server.ui.internal.task.WizardTask#getWizardPage()
- */
- public Composite createComposite(Composite parent, IWizardHandle wizard) {
- comp = new SelectClientComposite(parent, wizard, clients);
- return comp;
- }
- }
- );
-
- setForcePreviousAndNextButtons(true);
- }
-
- /**
- * Return the selected client.
- * @return org.eclipse.wst.server.core.IClient
- */
- public IClient getSelectedClient() {
- return comp.getSelectedClient();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/SelectTasksWizard.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/SelectTasksWizard.java
deleted file mode 100644
index e3ca9ad..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/SelectTasksWizard.java
+++ /dev/null
@@ -1,57 +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 java.util.List;
-
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.TaskModel;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-import org.eclipse.wst.server.ui.internal.task.FinishWizardFragment;
-import org.eclipse.wst.server.ui.internal.task.InputWizardFragment;
-import org.eclipse.wst.server.ui.internal.task.SaveServerTask;
-import org.eclipse.wst.server.ui.internal.wizard.fragment.TasksWizardFragment;
-import org.eclipse.wst.server.ui.wizard.TaskWizard;
-import org.eclipse.wst.server.ui.wizard.WizardFragment;
-/**
- * A wizard used to select server and module tasks.
- */
-public class SelectTasksWizard extends TaskWizard {
- protected TasksWizardFragment fragment;
-
- /**
- * SelectTasksWizard constructor comment.
- */
- public SelectTasksWizard(final IServer server) {
- super(ServerUIPlugin.getResource("%wizTaskWizardTitle"));
-
- setRootFragment(new WizardFragment() {
- protected void createChildFragments(List list) {
- list.add(new InputWizardFragment(new String[] { TaskModel.TASK_SERVER }, new Object[] { server }));
- fragment = new TasksWizardFragment();
- list.add(fragment);
- list.add(new FinishWizardFragment(new SaveServerTask()));
- }
- });
- addPages();
- }
-
- /**
- *
- */
- public boolean hasTasks() {
- return fragment.hasTasks();
- }
-
- public boolean hasOptionalTasks() {
- return fragment.hasOptionalTasks();
- }
-}
\ No newline at end of file
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
deleted file mode 100644
index 99a15e3..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/fragment/ModifyModulesWizardFragment.java
+++ /dev/null
@@ -1,142 +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.fragment;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.server.core.*;
-import org.eclipse.wst.server.core.internal.IModuleVisitor;
-import org.eclipse.wst.server.core.internal.Server;
-import org.eclipse.wst.server.ui.internal.Trace;
-import org.eclipse.wst.server.ui.internal.task.ModifyModulesTask;
-import org.eclipse.wst.server.ui.internal.wizard.page.ModifyModulesComposite;
-import org.eclipse.wst.server.ui.wizard.IWizardHandle;
-import org.eclipse.wst.server.ui.wizard.WizardFragment;
-/**
- *
- */
-public class ModifyModulesWizardFragment extends WizardFragment {
- protected ModifyModulesComposite comp;
- protected ModifyModulesTask task;
-
- protected IModule module;
-
- public ModifyModulesWizardFragment() {
- // do nothing
- }
-
- public ModifyModulesWizardFragment(IModule module) {
- this.module = module;
- }
-
- public boolean hasComposite() {
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.server.ui.internal.task.WizardTask#getWizardPage()
- */
- public Composite createComposite(Composite parent, IWizardHandle handle) {
- comp = new ModifyModulesComposite(parent, handle, module);
- return comp;
- }
-
- public void setTaskModel(TaskModel taskModel) {
- super.setTaskModel(taskModel);
- if (comp != null)
- comp.setTaskModel(taskModel);
- }
-
- public List getChildFragments() {
- updateModules();
- return super.getChildFragments();
- }
-
- public void enter() {
- updateModules();
- }
-
- protected void updateModules() {
- if (comp != null) {
- IServerWorkingCopy server = (IServerWorkingCopy) getTaskModel().getObject(TaskModel.TASK_SERVER);
- comp.setServer(server);
- comp.setTaskModel(getTaskModel());
- } else if (module != null) {
- TaskModel taskModel = getTaskModel();
- if (taskModel == null)
- return;
- IServerWorkingCopy server = (IServerWorkingCopy) taskModel.getObject(TaskModel.TASK_SERVER);
- if (server == null) {
- taskModel.putObject(TaskModel.TASK_MODULE_PARENTS, null);
- taskModel.putObject(TaskModel.TASK_MODULES, null);
- return;
- }
-
- class Helper {
- List parentList = new ArrayList();
- List moduleList = new ArrayList();
- }
- final Helper help = new Helper();
- if (server != null) {
- ((Server) server).visit(new IModuleVisitor() {
- public boolean visit(IModule[] parents2, IModule module2) {
- help.parentList.add(parents2);
- help.moduleList.add(module2);
- return true;
- }
- }, null);
- }
-
- // add module
- IModule parent = null;
- try {
- IModule[] parents = server.getRootModules(module, null);
- List list = new ArrayList();
-
- if (parents != null && parents.length > 0) {
- parent = parents[0];
- list.add(parent);
- }
- if (!help.moduleList.contains(module)) {
- help.moduleList.add(module);
- help.parentList.add(list);
- }
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Could not find parent module", e);
- }
-
- int size = help.parentList.size();
- List[] parents = new List[size];
- help.parentList.toArray(parents);
- IModule[] modules = new IModule[size];
- help.moduleList.toArray(modules);
-
- taskModel.putObject(TaskModel.TASK_MODULE_PARENTS, parents);
- taskModel.putObject(TaskModel.TASK_MODULES, modules);
- }
- }
-
- public void exit() {
- if (comp != null) {
- createFinishTask();
- task.setAddModules(comp.getModulesToAdd());
- task.setRemoveModules(comp.getModulesToRemove());
- }
- }
-
- public ITask createFinishTask() {
- if (task == null)
- task = new ModifyModulesTask();
- return task;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/fragment/NewRuntimeWizardFragment.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/fragment/NewRuntimeWizardFragment.java
deleted file mode 100644
index 0889da9..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/fragment/NewRuntimeWizardFragment.java
+++ /dev/null
@@ -1,81 +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.fragment;
-
-import java.util.List;
-
-import org.eclipse.wst.server.core.IRuntimeWorkingCopy;
-import org.eclipse.wst.server.core.TaskModel;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-import org.eclipse.wst.server.ui.internal.wizard.page.NewRuntimeComposite;
-import org.eclipse.wst.server.ui.wizard.WizardFragment;
-import org.eclipse.wst.server.ui.wizard.IWizardHandle;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.swt.widgets.Composite;
-/**
- *
- */
-public class NewRuntimeWizardFragment extends WizardFragment {
- protected NewRuntimeComposite page;
-
- // filter by type/version
- protected String type;
- protected String version;
-
- // filter by partial runtime type id
- protected String runtimeTypeId;
-
- public NewRuntimeWizardFragment() {
- // do nothing
- }
-
- public NewRuntimeWizardFragment(String type, String version, String runtimeTypeId) {
- this.type = type;
- this.version = version;
- this.runtimeTypeId = runtimeTypeId;
- }
-
- public boolean hasComposite() {
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.server.ui.internal.task.WizardTask#getWizardPage()
- */
- public Composite createComposite(Composite parent, IWizardHandle wizard) {
- page = new NewRuntimeComposite(parent, wizard, getTaskModel(), type, version, runtimeTypeId);
- return page;
- }
-
- public boolean isComplete() {
- if (page != null) {
- if (page.getRuntime() == null)
- return false;
- IStatus status = page.getRuntime().validate(null);
- return status == null || status.getSeverity() != IStatus.ERROR;
- }
- return true;
- }
-
- protected void createChildFragments(List list) {
- if (getTaskModel() == null)
- return;
-
- IRuntimeWorkingCopy runtime = (IRuntimeWorkingCopy) getTaskModel().getObject(TaskModel.TASK_RUNTIME);
- if (runtime == null)
- return;
-
- WizardFragment sub = ServerUIPlugin.getWizardFragment(runtime.getRuntimeType().getId());
- if (sub != null)
- list.add(sub);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/fragment/NewServerWizardFragment.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/fragment/NewServerWizardFragment.java
deleted file mode 100644
index 2d2ca5f..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/fragment/NewServerWizardFragment.java
+++ /dev/null
@@ -1,175 +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.fragment;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.server.core.*;
-import org.eclipse.wst.server.core.internal.Server;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-import org.eclipse.wst.server.ui.internal.wizard.page.NewServerComposite;
-import org.eclipse.wst.server.ui.wizard.WizardFragment;
-import org.eclipse.wst.server.ui.wizard.IWizardHandle;
-/**
- *
- */
-public class NewServerWizardFragment extends WizardFragment {
- public static final String MODE = "mode";
- public static final byte MODE_EXISTING = 0;
- public static final byte MODE_DETECT = 1;
- public static final byte MODE_MANUAL= 2;
-
- protected NewServerComposite comp;
- protected IModule module;
- protected String launchMode;
-
- protected Map fragmentMap = new HashMap();
- protected Map configMap = new HashMap();
-
- public NewServerWizardFragment() {
- // do nothing
- }
-
- public NewServerWizardFragment(IModule module, String launchMode) {
- this.module = module;
- this.launchMode = launchMode;
- }
-
- public boolean hasComposite() {
- return true;
- }
-
- public void enter() {
- super.enter();
- getTaskModel().putObject(TaskModel.TASK_LAUNCH_MODE, launchMode);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.server.ui.internal.task.WizardTask#getWizardPage()
- */
- public Composite createComposite(Composite parent, IWizardHandle wizard) {
- comp = new NewServerComposite(parent, wizard, module, launchMode);
- if (getTaskModel() != null)
- comp.setTaskModel(getTaskModel());
- return comp;
- }
-
- /*protected void createConfiguration(IServerWorkingCopy server) {
- TaskModel model = getTaskModel();
- IRuntime runtime = (IRuntime) model.getObject(TaskModel.TASK_RUNTIME);
-
- IServerType type = server.getServerType();
- if (type.hasServerConfiguration()) {
- server.setServerConfiguration(null);
- IStatus status = null;
- if (runtime != null)
- status = runtime.validate(null);
- if (status == null || status.isOK()) {
- try {
- IFile file = null;
- if (ServerCore.getServerPreferences().isCreateResourcesInWorkspace())
- file = ServerUtil.getUnusedServerConfigurationFile(WizardUtil.getServerProject(), null);
-
- IServerConfigurationWorkingCopy serverConfiguration = getServerConfiguration(type.getServerConfigurationType(), file, runtime);
- model.putObject(TaskModel.TASK_SERVER_CONFIGURATION, serverConfiguration);
- server.setServerConfiguration(serverConfiguration);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not create configuration", e);
- }
- }
- }
- }*/
-
- /*protected IServerConfigurationWorkingCopy getServerConfiguration(IServerConfigurationType type, IFile file, IRuntime runtime) throws CoreException {
- Object key = type.getId() + "|" + file + "|" + runtime;
- try {
- IServerConfigurationWorkingCopy serverConfiguration = (IServerConfigurationWorkingCopy) configMap.get(key);
- if (serverConfiguration != null)
- return serverConfiguration;
- } catch (Exception e) {
- // ignore
- }
-
- IServerConfigurationWorkingCopy serverConfiguration = type.importFromRuntime(null, file, runtime, new NullProgressMonitor());
- ServerUtil.setServerConfigurationDefaultName(serverConfiguration);
- configMap.put(key, serverConfiguration);
- return serverConfiguration;
- }*/
-
- protected WizardFragment getWizardFragment(String typeId) {
- try {
- WizardFragment fragment = (WizardFragment) fragmentMap.get(typeId);
- if (fragment != null)
- return fragment;
- } catch (Exception e) {
- // ignore
- }
-
- WizardFragment fragment = ServerUIPlugin.getWizardFragment(typeId);
- if (fragment != null)
- fragmentMap.put(typeId, fragment);
- return fragment;
- }
-
- public List getChildFragments() {
- List listImpl = new ArrayList();
- createChildFragments(listImpl);
- return listImpl;
- }
-
- protected void createChildFragments(List list) {
- if (getTaskModel() == null)
- return;
-
- Byte b = (Byte) getTaskModel().getObject(MODE);
- if (b != null && b.byteValue() == MODE_MANUAL) {
- IRuntime runtime = (IRuntime) getTaskModel().getObject(TaskModel.TASK_RUNTIME);
- if (runtime != null && runtime instanceof IRuntimeWorkingCopy) {
- WizardFragment sub = getWizardFragment(runtime.getRuntimeType().getId());
- if (sub != null)
- list.add(sub);
- }
-
- IServerWorkingCopy server = (IServerWorkingCopy) getTaskModel().getObject(TaskModel.TASK_SERVER);
- if (server != null) {
- // createConfiguration(server);
- if (server.getServerType().hasServerConfiguration()) {
- ((Server)server).importConfiguration(runtime, null);
- }
- WizardFragment sub = getWizardFragment(server.getServerType().getId());
- if (sub != null)
- list.add(sub);
- }
- } else if (b != null && b.byteValue() == MODE_EXISTING) {
- /*if (comp != null) {
- IServer server = comp.getServer();
- if (server != null)
- list.add(new TasksWizardFragment());
- }*/
- }
- }
-
- public IServerWorkingCopy getServer() {
- if (comp == null)
- return null;
- return comp.getServer();
- }
-
- public boolean isPreferredServer() {
- if (comp == null)
- return false;
- return comp.isPreferredServer();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/fragment/ServerConfigurationWizardFragment.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/fragment/ServerConfigurationWizardFragment.java
deleted file mode 100644
index 16803d5..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/fragment/ServerConfigurationWizardFragment.java
+++ /dev/null
@@ -1,56 +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.fragment;
-
-import org.eclipse.wst.server.ui.wizard.WizardFragment;
-/**
- *
- */
-public class ServerConfigurationWizardFragment extends WizardFragment {
- public ServerConfigurationWizardFragment() {
- // do nothing
- }
-
- public void enter() {
- //TaskModel model = getTaskModel();
- //IRuntime runtime = (IRuntime) model.getObject(TaskModel.TASK_RUNTIME);
- //IServerWorkingCopy server = (IServerWorkingCopy) model.getObject(TaskModel.TASK_SERVER);
-
- //IServerType type = server.getServerType();
- /*if (type.hasServerConfiguration() && server.getServerConfiguration() == null) {
- try {
- IFile file = null;
- if (ServerCore.getServerPreferences().isCreateResourcesInWorkspace())
- file = ServerUtil.getUnusedServerConfigurationFile(WizardUtil.getServerProject(), type.getServerConfigurationType());
-
- IServerConfigurationWorkingCopy serverConfiguration = type.getServerConfigurationType().importFromRuntime(null, file, runtime, new NullProgressMonitor());
- ServerUtil.setServerConfigurationDefaultName(serverConfiguration);
- model.putObject(TaskModel.TASK_SERVER_CONFIGURATION, serverConfiguration);
- server.setServerConfiguration(serverConfiguration);
- updateChildFragments();
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not create configuration", e);
- }
- }*/
- }
-
- /*protected void createChildFragments(List list) {
- IServerWorkingCopy server = (IServerWorkingCopy) getTaskModel().getObject(TaskModel.TASK_SERVER);
- IServerConfiguration serverConfiguration = null;
- if (server != null)
- serverConfiguration = server.getServerConfiguration();
- if (serverConfiguration != null) {
- WizardFragment sub = ServerUICore.getWizardFragment(serverConfiguration.getServerConfigurationType().getId());
- if (sub != null)
- list.add(sub);
- }
- }*/
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/fragment/TasksWizardFragment.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/fragment/TasksWizardFragment.java
deleted file mode 100644
index 8acc183..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/fragment/TasksWizardFragment.java
+++ /dev/null
@@ -1,313 +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.fragment;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.wst.server.core.*;
-import org.eclipse.wst.server.core.internal.*;
-import org.eclipse.wst.server.core.util.Task;
-import org.eclipse.wst.server.ui.editor.IOrdered;
-import org.eclipse.wst.server.ui.internal.EclipseUtil;
-import org.eclipse.wst.server.ui.internal.ProgressUtil;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-import org.eclipse.wst.server.ui.internal.Trace;
-import org.eclipse.wst.server.ui.internal.editor.ServerEditorCore;
-import org.eclipse.wst.server.ui.internal.wizard.page.TasksComposite;
-import org.eclipse.wst.server.ui.wizard.IWizardHandle;
-import org.eclipse.wst.server.ui.wizard.WizardFragment;
-/**
- *
- */
-public class TasksWizardFragment extends WizardFragment {
- public class TaskInfo implements IOrdered {
- public int status;
- public String id;
- public IOptionalTask task2;
-
- private static final String DEFAULT = "default:";
-
- public boolean isSelected() {
- try {
- Boolean b = (Boolean) selectedTaskMap.get(getId());
- return b.booleanValue();
- } catch (Exception e) {
- // ignore
- }
-
- try {
- Boolean b = (Boolean) selectedTaskMap.get(DEFAULT + getId());
- return b.booleanValue();
- } catch (Exception e) {
- // ignore
- }
- return false;
- }
-
- public void setDefaultSelected(boolean sel) {
- selectedTaskMap.put(DEFAULT + getId(), new Boolean(sel));
- }
-
- public void setSelected(boolean sel) {
- selectedTaskMap.put(getId(), new Boolean(sel));
- }
-
- public int getOrder() {
- return task2.getOrder();
- }
-
- protected String getId() {
- return id;
- }
- }
-
- protected TasksComposite comp;
-
- protected List tasks;
- protected boolean hasOptionalTasks;
-
- protected Map selectedTaskMap = new HashMap();
-
- public TasksWizardFragment() {
- // do nothing
- }
-
- public void enter() {
- updateTasks();
- }
-
- public List getChildFragments() {
- updateTasks();
- return super.getChildFragments();
- }
-
- public void setTaskModel(TaskModel taskModel) {
- super.setTaskModel(taskModel);
- updateTasks();
- }
-
- public void updateTasks() {
- tasks = null;
- if (getTaskModel() == null)
- return;
-
- IServer server = (IServer) getTaskModel().getObject(TaskModel.TASK_SERVER);
-
- List[] parents = (List[]) getTaskModel().getObject(TaskModel.TASK_MODULE_PARENTS);
- IModule[] modules = (IModule[]) getTaskModel().getObject(TaskModel.TASK_MODULES);
-
- if (server != null && (parents == null || modules == null)) {
- class Helper {
- List parentList = new ArrayList();
- List moduleList = new ArrayList();
- }
- final Helper help = new Helper();
- ((Server) server).visit(new IModuleVisitor() {
- public boolean visit(IModule[] parents2, IModule module2) {
- int size = parents2.length;
- List list = new ArrayList(size);
- for (int i = 0; i < size; i++)
- list.add(parents2[i]);
-
- help.parentList.add(list);
- help.moduleList.add(module2);
- return true;
- }
- }, null);
-
- int size = help.parentList.size();
- parents = new List[size];
- help.parentList.toArray(parents);
- modules = new IModule[size];
- help.moduleList.toArray(modules);
- }
-
- if (server != null && parents != null || modules != null) {
- tasks = new ArrayList();
- createTasks(server, parents, modules);
- }
-
- if (comp != null)
- Display.getDefault().syncExec(new Runnable() {
- public void run() {
- comp.setTasks(tasks);
- }
- });
- }
-
- protected void createTasks(IServer server, List[] parents, IModule[] modules) {
- String serverTypeId = null;
- if (server != null)
- serverTypeId = server.getServerType().getId();
-
- // server tasks
- IServerTask[] serverTasks = ServerPlugin.getServerTasks();
- if (serverTasks != null) {
- int size = serverTasks.length;
- for (int i = 0; i < size; i++) {
- IServerTask task = serverTasks[i];
- if (serverTypeId != null && task.supportsType(serverTypeId)) {
- IOptionalTask[] tasks2 = task.getTasks(server, parents, modules);
- if (tasks2 != null) {
- int size2 = tasks2.length;
- for (int j = 0; j < size2; j++) {
- int status = tasks2[j].getStatus();
- if (status != IOptionalTask.TASK_UNNECESSARY) {
- if (status == IOptionalTask.TASK_READY || status == IOptionalTask.TASK_PREFERRED)
- hasOptionalTasks = true;
- tasks2[i].setTaskModel(getTaskModel());
- addServerTask(server, tasks2[j]);
- }
- }
- }
- }
- }
- }
- }
-
- public void addServerTask(IServer server, IOptionalTask task2) {
- TaskInfo sti = new TaskInfo();
- sti.task2 = task2;
- sti.status = task2.getStatus();
- String id = server.getId();
- sti.id = id + "|" + task2.getName();
- if (sti.status == IOptionalTask.TASK_PREFERRED || sti.status == IOptionalTask.TASK_MANDATORY)
- sti.setDefaultSelected(true);
-
- tasks.add(sti);
- }
-
- public boolean hasComposite() {
- return hasTasks();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.server.ui.internal.task.WizardTask#getWizardPage()
- */
- public Composite createComposite(Composite parent, IWizardHandle wizard) {
- comp = new TasksComposite(parent, wizard);
- return comp;
- }
-
- public ITask createFinishTask() {
- return new Task() {
- public void execute(IProgressMonitor monitor) throws CoreException {
- performFinish(monitor);
- }
- };
- }
-
- /**
- * Returns the number of tasks run, or -1 if there was an error.
- *
- * @param monitor
- * @return int
- */
- protected void performFinish(IProgressMonitor monitor) throws CoreException {
- List performTasks = new ArrayList();
-
- if (tasks == null)
- return;
- int size = tasks.size();
- for (int i = 0; i < size; i++) {
- TaskInfo ti = (TaskInfo) tasks.get(i);
- if (ti.isSelected())
- performTasks.add(tasks.get(i));
- }
-
- Trace.trace(Trace.FINEST, "Performing wizard tasks: " + performTasks.size());
-
- if (performTasks.size() == 0)
- return;
-
- // get most recent server/configuration
- boolean createdServerWC = false;
- TaskModel taskModel = getTaskModel();
- IServer server = (IServer) taskModel.getObject(TaskModel.TASK_SERVER);
- if (server == null)
- return;
-
- // get working copies
- IServerWorkingCopy serverWC = null;
- if (server instanceof IServerWorkingCopy)
- serverWC = (IServerWorkingCopy) server;
- else {
- serverWC = server.createWorkingCopy();
- createdServerWC = true;
- }
-
- taskModel.putObject(TaskModel.TASK_SERVER, serverWC);
-
- // begin task
- monitor.beginTask(ServerUIPlugin.getResource("%performingTasks"), performTasks.size() * 1000);
-
- ServerEditorCore.sortOrderedList(performTasks);
-
- Iterator iterator = performTasks.iterator();
- while (iterator.hasNext()) {
- IProgressMonitor subMonitor = ProgressUtil.getSubMonitorFor(monitor, 1000);
- Object obj = iterator.next();
- if (obj instanceof TasksWizardFragment.TaskInfo) {
- TasksWizardFragment.TaskInfo sti = (TasksWizardFragment.TaskInfo) obj;
- try {
- Trace.trace(Trace.FINER, "Executing task: " + sti.task2.getName());
- sti.task2.setTaskModel(taskModel);
- sti.task2.execute(subMonitor);
- } catch (final CoreException ce) {
- Trace.trace(Trace.SEVERE, "Error executing task " + sti.task2.getName(), ce);
- throw ce;
- }
- }
- subMonitor.done();
- }
-
- if (createdServerWC) {
- if (serverWC.isDirty()) {
- IFile file = serverWC.getFile();
- if (file != null) {
- IProject project = file.getProject();
-
- if (!file.getProject().exists())
- EclipseUtil.createNewServerProject(null, project.getName(), null, monitor);
-
- ProjectProperties pp = (ProjectProperties) ServerCore.getProjectProperties(project);
- if (!pp.isServerProject())
- pp.setServerProject(true, monitor);
- }
- taskModel.putObject(TaskModel.TASK_SERVER, serverWC.save(false, monitor));
- } else
- taskModel.putObject(TaskModel.TASK_SERVER, serverWC.getOriginal());
- }
-
- monitor.done();
- }
-
- /**
- *
- */
- public boolean hasTasks() {
- return tasks == null || !tasks.isEmpty();
- }
-
- public boolean hasOptionalTasks() {
- return hasOptionalTasks;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/ElementCreationCache.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/ElementCreationCache.java
deleted file mode 100644
index f8c0841..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/ElementCreationCache.java
+++ /dev/null
@@ -1,97 +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 java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-
-import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.IServerType;
-import org.eclipse.wst.server.core.IServerWorkingCopy;
-import org.eclipse.wst.server.core.ServerUtil;
-import org.eclipse.wst.server.core.internal.ServerPreferences;
-/**
- * A helper class used to cache the creation of server elements.
- */
-public class ElementCreationCache {
- protected Map elementCache;
- protected Map taskCache;
-
- /**
- * ElementCreationCache constructor comment.
- */
- public ElementCreationCache() {
- super();
- elementCache = new HashMap();
- taskCache = new HashMap();
- }
-
- /**
- * Return the key to use for the given factory.
- *
- * @param type the server type
- * @param host the server host
- * @return the key
- */
- protected String getKey(IServerType type, String host) {
- return type.getId() + "|" + host + "|";
- }
-
- /**
- * Returns a server.
- *
- * @param type
- * @return a server working copy
- */
- public IServerWorkingCopy getServer(IServerType type, String host, IProgressMonitor monitor) throws CoreException {
- try {
- IServerWorkingCopy server = getCachedServer(type, host);
- if (server != null)
- return server;
- } catch (Exception e) {
- // ignore
- }
-
- try {
- IFile file = null;
- if (ServerPreferences.getInstance().isCreateResourcesInWorkspace())
- file = ServerUtil.getUnusedServerFile(WizardUtil.getServerProject(), type);
-
- IServerWorkingCopy server = type.createServer(null, file, (IRuntime)null, monitor);
- elementCache.put(getKey(type, host), server);
- return server;
- } catch (CoreException ce) {
- throw ce;
- }
- }
-
- /**
- * Returns a cached server resource.
- *
- * @param type the server type
- * @return a working copy
- */
- public IServerWorkingCopy getCachedServer(IServerType type, String host) {
- try {
- IServerWorkingCopy server = (IServerWorkingCopy) elementCache.get(getKey(type, host));
- if (server != null)
- return server;
- } catch (Exception e) {
- // ignore
- }
-
- return null;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/FixedTableLayout.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/FixedTableLayout.java
deleted file mode 100644
index f07ba23..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/FixedTableLayout.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 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 java.util.ArrayList;
-//import java.util.List;
-
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Layout;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-/**
- *
- */
-public class FixedTableLayout extends Layout {
- //private List columns = new ArrayList();
-
- /*public void addColumnData(Integer data) {
- columns.add(data);
- }*/
-
- /* (non-Javadoc)
- * @see org.eclipse.swt.widgets.Layout#computeSize(org.eclipse.swt.widgets.Composite, int, int, boolean)
- */
- protected Point computeSize(Composite composite, int wHint, int hHint, boolean flushCache) {
- Table table = (Table) composite;
- Point result = table.computeSize(wHint, hHint, flushCache);
- return result;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.swt.widgets.Layout#layout(org.eclipse.swt.widgets.Composite, boolean)
- */
- protected void layout(Composite composite, boolean flushCache) {
- Table table = (Table) composite;
- TableColumn[] tableColumns = table.getColumns();
- int width = table.getClientArea().width - 10;
-
- tableColumns[0].setWidth(width);
- }
-}
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/HostnameComposite.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/HostnameComposite.java
deleted file mode 100644
index a240998..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/HostnameComposite.java
+++ /dev/null
@@ -1,140 +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 java.util.List;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.resource.JFaceResources;
-
-import org.eclipse.wst.server.ui.internal.SWTUtil;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-
-import org.eclipse.swt.SWT;
-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.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-/**
- * A composite used to select a hostname.
- */
-public class HostnameComposite extends Composite {
- private static final String LOCALHOST = "localhost";
- protected String host;
- protected IHostnameSelectionListener listener;
-
- protected Combo combo;
-
- public interface IHostnameSelectionListener {
- public void hostnameSelected(String host);
- }
-
- /**
- * Create a new HostComposite.
- */
- public HostnameComposite(Composite parent, IHostnameSelectionListener listener2) {
- super(parent, SWT.NONE);
- this.listener = listener2;
-
- createControl();
- }
-
- protected Label createHeadingLabel(Composite parent, String text, int span) {
- Label label = createLabel(parent, text, span, true, false);
- label.setFont(JFaceResources.getBannerFont());
- return label;
- }
-
- protected Label createLabel(Composite parent, String text, int span, boolean alignTop, boolean indent) {
- Label label = new Label(parent, SWT.WRAP);
- label.setText(text);
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER);
- if (alignTop)
- data.verticalAlignment = GridData.BEGINNING;
- data.horizontalSpan = span;
- if (indent)
- data.horizontalIndent = 10;
- label.setLayoutData(data);
- return label;
- }
-
- protected Combo createCombo(Composite parent, String[] items, String text2, int span) {
- Combo combo2 = new Combo(parent, SWT.DROP_DOWN);
- combo2.setItems(items);
- combo2.setText(text2);
- GridData data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_CENTER);
- data.horizontalSpan = span;
- combo2.setLayoutData(data);
- return combo2;
- }
-
- /**
- * Creates the UI of the page.
- */
- protected void createControl() {
- GridLayout layout = new GridLayout();
- layout.horizontalSpacing = SWTUtil.convertHorizontalDLUsToPixels(this, 4);
- layout.verticalSpacing = SWTUtil.convertVerticalDLUsToPixels(this, 4);
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- layout.numColumns = 3;
- setLayout(layout);
- //WorkbenchHelp.setHelp(this, ContextIds.SELECT_CLIENT_WIZARD);
-
- createHeadingLabel(this, ServerUIPlugin.getResource("%hostnameTitle"), 3);
-
- createLabel(this, ServerUIPlugin.getResource("%hostname"), 1, false, true);
-
- List hosts = ServerUIPlugin.getPreferences().getHostnames();
- String[] s = new String[hosts.size()];
- hosts.toArray(s);
- combo = createCombo(this, s, LOCALHOST, 2);
- combo.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- hostnameChanged(combo.getText());
- }
- });
- combo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- Point p = combo.getSelection();
- hostnameChanged(combo.getText());
- combo.setSelection(p);
- }
- });
-
- Dialog.applyDialogFont(this);
- }
-
- protected void hostnameChanged(String newHost) {
- if (newHost == null)
- return;
-
- if (newHost.equals(host))
- return;
-
- host = newHost;
- listener.hostnameSelected(host);
- }
-
- public String getHostname() {
- return host;
- }
-
- public void setHostname(String hostname) {
- combo.setText(hostname);
- }
-}
\ No newline at end of file
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 6c9e744..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/ImportConfigurationWizardPage.java
+++ /dev/null
@@ -1,539 +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(ServerUIPlugin.getResource("%wizImportConfigurationTitle"));
- setDescription(ServerUIPlugin.getResource("%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.
- */
- 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(ServerUIPlugin.getResource("%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(ServerUIPlugin.getResource("%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(ServerUIPlugin.getResource("%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(ServerUIPlugin.getResource("%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, ServerUIPlugin.getResource("%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(ServerUIPlugin.getResource("%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(ServerUIPlugin.getResource("%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] = ServerUIPlugin.getResource("%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] = ServerUIPlugin.getResource("%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] = ServerUIPlugin.getResource("%wizErrorImport");
- }
- } catch (Exception e) {
- validationErrors[INVALID_IMPORT] = ServerUIPlugin.getResource("%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] = ServerUIPlugin.getResource("%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
deleted file mode 100644
index f7f204e..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/ModifyModulesComposite.java
+++ /dev/null
@@ -1,531 +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 java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.swt.SWT;
-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.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.server.core.*;
-import org.eclipse.wst.server.ui.ServerUICore;
-import org.eclipse.wst.server.ui.internal.*;
-import org.eclipse.wst.server.ui.wizard.IWizardHandle;
-/**
- * A wizard page used to add and remove modules.
- */
-public class ModifyModulesComposite extends Composite {
- protected static final ILabelProvider slp = ServerUICore.getLabelProvider();
-
- protected IWizardHandle wizard;
-
- protected IServerAttributes server;
-
- protected Map childModuleMap = new HashMap();
- protected Map parentTreeItemMap = new HashMap();
-
- // original modules on the server
- protected List originalModules = new ArrayList();
-
- // modules available to be added to the server
- protected List modules = new ArrayList();
-
- // current modules on the server
- protected List deployed = new ArrayList();
-
- protected Tree availableTree;
- protected Tree deployedTree;
-
- protected Button add, addAll;
- protected Button remove, removeAll;
-
- protected TaskModel taskModel;
- protected IModule newModule;
- protected IModule origNewModule;
-
- protected Map errorMap;
-
- /**
- * Create a new ModifyModulesComposite.
- */
- public ModifyModulesComposite(Composite parent, IWizardHandle wizard, IModule module) {
- super(parent, SWT.NONE);
- this.wizard = wizard;
- origNewModule = module;
-
- wizard.setTitle(ServerUIPlugin.getResource("%wizModuleTitle"));
- wizard.setDescription(ServerUIPlugin.getResource("%wizModuleDescription"));
- wizard.setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_WIZBAN_SELECT_SERVER));
-
- createControl();
- }
-
- public void setServer(IServerAttributes server) {
- if (server == this.server)
- return;
-
- this.server = server;
- originalModules = new ArrayList();
- deployed = new ArrayList();
- modules = new ArrayList();
-
- childModuleMap = new HashMap();
-
- if (server == null)
- return;
-
- // get currently deployed modules
- IModule[] currentModules = server.getModules();
- if (currentModules != null) {
- int size = currentModules.length;
- for (int i = 0; i < size; i++) {
- originalModules.add(currentModules[i]);
- deployed.add(currentModules[i]);
- }
- }
-
- // add new module
- newModule = null;
- if (origNewModule != null) {
- try {
- IModule[] parents = server.getRootModules(origNewModule, null);
- if (parents != null && parents.length > 0)
- newModule = parents[0];
- else
- newModule = origNewModule;
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Could not find parent module", e);
- newModule = null;
- }
- }
- if (newModule != null && !deployed.contains(newModule))
- deployed.add(newModule);
-
- // get remaining modules
- errorMap = new HashMap();
- IModule[] modules2 = ServerUtil.getModules(server.getServerType().getRuntimeType().getModuleTypes());
- if (modules2 != null) {
- int size = modules2.length;
- for (int i = 0; i < size; i++) {
- IModule module = modules2[i];
- if (!deployed.contains(module)) {
- try {
- IModule[] parents = server.getRootModules(module, null);
- if (parents != null) {
- int size2 = parents.length;
- for (int j = 0; j < size2; j++) {
- if (parents[j].equals(module)) {
- IStatus status = server.canModifyModules(new IModule[] { module }, null, null);
- if (status != null && !status.isOK())
- errorMap.put(module, status);
- modules.add(module);
- }
- }
- }
- } catch (CoreException ce) {
- errorMap.put(module, ce.getStatus());
- modules.add(module);
- }
- }
- }
- }
-
- // build child map
- Iterator iterator = deployed.iterator();
- while (iterator.hasNext()) {
- IModule module = (IModule) iterator.next();
- try {
- IModule[] children = server.getChildModules(module, null);
- childModuleMap.put(module, children);
- } catch (Exception e) {
- // ignore
- }
- }
-
- iterator = modules.iterator();
- while (iterator.hasNext()) {
- IModule module = (IModule) iterator.next();
- try {
- IModule[] children = server.getChildModules(module, null);
- childModuleMap.put(module, children);
- } catch (Exception e) {
- // ignore
- }
- }
-
- if (availableTree != null)
- Display.getDefault().syncExec(new Runnable() {
- public void run() {
- try { // update trees if we can
- parentTreeItemMap = new HashMap();
- fillTree(availableTree, modules);
- fillTree(deployedTree, deployed);
- setEnablement();
- } catch (Exception e) {
- // ignore
- }
- }
- });
- updateTaskModel();
- }
-
- public void setTaskModel(TaskModel model) {
- this.taskModel = model;
- }
-
- /**
- * Creates the UI of the page.
- */
- protected void createControl() {
- GridLayout layout = new GridLayout();
- layout.horizontalSpacing = SWTUtil.convertHorizontalDLUsToPixels(this, 4);
- layout.verticalSpacing = SWTUtil.convertVerticalDLUsToPixels(this, 4);
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- layout.numColumns = 3;
- setLayout(layout);
- setFont(getParent().getFont());
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, ContextIds.MODIFY_MODULES_COMPOSITE);
-
- Label label = new Label(this, SWT.NONE);
- GridData data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
- data.horizontalSpan = 3;
- label.setLayoutData(data);
- label.setText(ServerUIPlugin.getResource("%wizModuleMessage"));
-
- label = new Label(this, SWT.NONE);
- label.setText(ServerUIPlugin.getResource("%wizModuleAvailableList"));
-
- label = new Label(this, SWT.NONE);
- label.setText("");
-
- label = new Label(this, SWT.NONE);
- label.setText(ServerUIPlugin.getResource("%wizModuleDeployedList"));
-
- availableTree = new Tree(this, SWT.BORDER);
- data = new GridData(GridData.FILL_BOTH);
- data.heightHint = 200;
- data.widthHint = 150;
- availableTree.setLayoutData(data);
- availableTree.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent event) {
- setEnablement();
- }
- });
-
- // slosh buttons
- Composite comp = new Composite(this, SWT.NONE);
- data = new GridData(GridData.FILL_BOTH);
- data.widthHint = 120;
- comp.setLayoutData(data);
-
- layout = new GridLayout();
- layout.marginWidth = 5;
- layout.marginHeight = 25;
- layout.verticalSpacing = 20;
- comp.setLayout(layout);
-
- add = new Button(comp, SWT.PUSH);
- add.setText(ServerUIPlugin.getResource("%wizModuleAdd"));
- add.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- add.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent event) {
- add(false);
- }
- });
-
- remove = new Button(comp, SWT.PUSH);
- remove.setText(ServerUIPlugin.getResource("%wizModuleRemove"));
- remove.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- remove.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent event) {
- remove(false);
- }
- });
-
- label = new Label(comp, SWT.NONE);
- label.setText("");
-
- addAll = new Button(comp, SWT.PUSH);
- addAll.setText(ServerUIPlugin.getResource("%wizModuleAddAll"));
- addAll.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- addAll.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent event) {
- add(true);
- }
- });
-
- removeAll = new Button(comp, SWT.PUSH);
- removeAll.setText(ServerUIPlugin.getResource("%wizModuleRemoveAll"));
- removeAll.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- removeAll.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent event) {
- remove(true);
- }
- });
-
- deployedTree = new Tree(this, SWT.BORDER);
- data = new GridData(GridData.FILL_BOTH);
- data.widthHint = 150;
- deployedTree.setLayoutData(data);
- deployedTree.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent event) {
- setEnablement();
- }
- });
-
- parentTreeItemMap = new HashMap();
- fillTree(availableTree, modules);
- fillTree(deployedTree, deployed);
-
- setEnablement();
-
- availableTree.setFocus();
-
- Dialog.applyDialogFont(this);
- }
-
- protected void setEnablement() {
- boolean enabled = false;
- wizard.setMessage(null, IMessageProvider.NONE);
- if (availableTree.getItemCount() > 0) {
- try {
- TreeItem item = availableTree.getSelection()[0];
- item = (TreeItem) parentTreeItemMap.get(item);
- IModule module = (IModule) item.getData();
-
- IStatus status = (IStatus) errorMap.get(module);
- if (modules.contains(module)) {
- if (status == null)
- enabled = true;
- else if (status.getSeverity() == IStatus.ERROR)
- wizard.setMessage(status.getMessage(), IMessageProvider.ERROR);
- else if (status.getSeverity() == IStatus.WARNING)
- wizard.setMessage(status.getMessage(), IMessageProvider.WARNING);
- else if (status.getSeverity() == IStatus.INFO)
- wizard.setMessage(status.getMessage(), IMessageProvider.INFORMATION);
- }
- } catch (Exception e) {
- // ignore
- }
- }
- add.setEnabled(enabled);
- addAll.setEnabled(availableTree.getItemCount() > 0);
-
- enabled = false;
- if (deployedTree.getItemCount() > 0) {
- try {
- TreeItem item = deployedTree.getSelection()[0];
- item = (TreeItem) parentTreeItemMap.get(item);
- IModule module = (IModule) item.getData();
- if (deployed.contains(module) && !module.equals(newModule))
- enabled = true;
- } catch (Exception e) {
- // ignore
- }
- }
- remove.setEnabled(enabled);
- if (newModule == null)
- removeAll.setEnabled(deployedTree.getItemCount() > 0);
- else
- removeAll.setEnabled(deployedTree.getItemCount() > 1);
- }
-
- protected void addChildren(TreeItem item, IModule module) {
- try {
- IModule[] children = (IModule[]) childModuleMap.get(module);
- if (children != null) {
- int size = children.length;
- for (int i = 0; i < size; i++) {
- IModule child = children[i];
- TreeItem childItem = new TreeItem(item, SWT.NONE);
- childItem.setText(slp.getText(child));
- childItem.setImage(slp.getImage(child));
- childItem.setData(child);
- parentTreeItemMap.put(childItem, item);
- addChildren(childItem, child);
- }
- }
- } catch (Exception e) {
- // ignore
- }
- }
-
- protected void fillTree(Tree tree, List modules2) {
- tree.removeAll();
-
- Iterator iterator = modules2.iterator();
- while (iterator.hasNext()) {
- IModule module = (IModule) iterator.next();
- TreeItem item = new TreeItem(tree, SWT.NONE);
- item.setText(slp.getText(module));
- item.setImage(slp.getImage(module));
- item.setData(module);
- parentTreeItemMap.put(item, item);
- addChildren(item, module);
- }
- }
-
- protected void add(boolean all) {
- if (all)
- moveAll(availableTree.getItems(), true);
- else
- moveAll(availableTree.getSelection(), true);
- updateTaskModel();
- }
-
- protected void remove(boolean all) {
- if (all)
- moveAll(deployedTree.getItems(), false);
- else
- moveAll(deployedTree.getSelection(), false);
- updateTaskModel();
- }
-
- protected void moveAll(TreeItem[] items, boolean add2) {
- int size = items.length;
- List list = new ArrayList();
- for (int i = 0; i < size; i++) {
- TreeItem item = (TreeItem) parentTreeItemMap.get(items[i]);
- IModule module = (IModule) item.getData();
-
- if (!list.contains(module))
- list.add(module);
- }
-
- Iterator iterator = list.iterator();
- while (iterator.hasNext()) {
- IModule module = (IModule) iterator.next();
- if (add2) {
- modules.remove(module);
- deployed.add(module);
- } else if (!module.equals(newModule)) {
- modules.add(module);
- deployed.remove(module);
- }
- }
-
- parentTreeItemMap = new HashMap();
- fillTree(availableTree, modules);
- fillTree(deployedTree, deployed);
-
- setEnablement();
- }
-
- protected void updateTaskModel() {
- if (taskModel == null)
- return;
-
- ModuleMap map = getModuleMap();
- int size = map.parentList.size();
- List[] parents = new List[size];
- map.parentList.toArray(parents);
-
- size = map.parentList.size();
- IModule[] modules2 = new IModule[size];
- map.moduleList.toArray(modules2);
-
- taskModel.putObject(TaskModel.TASK_MODULE_PARENTS, parents);
- taskModel.putObject(TaskModel.TASK_MODULES, modules2);
- 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();
- while (iterator.hasNext()) {
- IModule module = (IModule) iterator.next();
- if (!deployed.contains(module))
- list.add(module);
- }
- return list;
- }
-
- public List getModulesToAdd() {
- List list = new ArrayList();
- Iterator iterator = deployed.iterator();
- while (iterator.hasNext()) {
- IModule module = (IModule) iterator.next();
- if (!originalModules.contains(module))
- list.add(module);
- }
- return list;
- }
-
- public class ModuleMap {
- public List parentList = new ArrayList();
- public List moduleList = new ArrayList();
- }
-
- private void addChildMap(ModuleMap help, List parents, IModule[] children) {
- if (children == null)
- return;
-
- int size = children.length;
- for (int i = 0; i < size; i++) {
- IModule module = children[i];
- help.parentList.add(parents);
- help.moduleList.add(module);
- IModule[] children2 = (IModule[]) childModuleMap.get(module);
- if (children2 != null) {
- List parents2 = new ArrayList();
- parents2.addAll(parents);
- parents2.add(module);
- addChildMap(help, parents2, children2);
- }
- }
- }
-
- public ModuleMap getModuleMap() {
- final ModuleMap help = new ModuleMap();
-
- Iterator iterator = deployed.iterator();
- while (iterator.hasNext()) {
- IModule module = (IModule) iterator.next();
- help.parentList.add(null);
- help.moduleList.add(module);
- IModule[] children = (IModule[]) childModuleMap.get(module);
- if (children != null) {
- List parents = new ArrayList();
- parents.add(module);
- addChildMap(help, parents, children);
- }
- }
-
- return help;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/NewDetectServerComposite.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/NewDetectServerComposite.java
deleted file mode 100644
index 9d2fc57..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/NewDetectServerComposite.java
+++ /dev/null
@@ -1,227 +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 java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.IServerAttributes;
-import org.eclipse.wst.server.core.IServerWorkingCopy;
-import org.eclipse.wst.server.ui.internal.SWTUtil;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-/**
- * A wizard page used to detect a server.
- */
-public class NewDetectServerComposite extends Composite {
- protected String host;
-
- protected IServerWorkingCopy server;
- protected IServerSelectionListener listener;
-
- protected List servers = new ArrayList();
-
- protected Button detect;
- protected Table table;
- protected TableViewer tableViewer;
- protected Label hostLabel;
-
- public interface IServerSelectionListener {
- public void serverSelected(IServerAttributes server);
- }
-
- public class ServerContentProvider implements IStructuredContentProvider {
- public void dispose() {
- // do nothing
- }
-
- public Object[] getElements(Object inputElement) {
- return servers.toArray();
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- // do nothing
- }
- }
-
- public class ServerLabelProvider implements ITableLabelProvider {
- public void addListener(ILabelProviderListener listener2) {
- // do nothing
- }
-
- public void dispose() {
- // do nothing
- }
-
- public Image getColumnImage(Object element, int columnIndex) {
- return null;
- }
-
- public String getColumnText(Object element, int columnIndex) {
- IServer server2 = (IServer) element;
- if (columnIndex == 0)
- return server2.getName();
- else if (columnIndex == 0)
- return "n/a";
- return null;
- }
-
- public boolean isLabelProperty(Object element, String property) {
- return false;
- }
-
- public void removeListener(ILabelProviderListener listener2) {
- // do nothing
- }
- }
-
- /**
- * Create a new NewDetectServerComposite.
- */
- public NewDetectServerComposite(Composite parent, IServerSelectionListener listener2) {
- super(parent, SWT.NONE);
- this.listener = listener2;
-
- createControl();
- }
-
- protected Label createHeadingLabel(Composite parent, String text, int span) {
- Label label = createLabel(parent, text, span, true, false);
- label.setFont(JFaceResources.getBannerFont());
- return label;
- }
-
- protected Label createLabel(Composite parent, String text, int span, boolean alignTop, boolean indent) {
- Label label = new Label(parent, SWT.WRAP);
- label.setText(text);
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER);
- if (alignTop)
- data.verticalAlignment = GridData.BEGINNING;
- data.horizontalSpan = span;
- if (indent)
- data.horizontalIndent = 10;
- label.setLayoutData(data);
- return label;
- }
-
- /**
- * Creates the UI of the page.
- */
- protected void createControl() {
- GridLayout layout = new GridLayout();
- layout.horizontalSpacing = SWTUtil.convertHorizontalDLUsToPixels(this, 4);
- layout.verticalSpacing = SWTUtil.convertVerticalDLUsToPixels(this, 4);
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- layout.numColumns = 2;
- setLayout(layout);
- //WorkbenchHelp.setHelp(this, ContextIds.SELECT_CLIENT_WIZARD);
-
- createHeadingLabel(this, "Select the Server", 2);
-
- table = new Table(this, SWT.BORDER | SWT.FULL_SELECTION | SWT.V_SCROLL | SWT.H_SCROLL | SWT.SINGLE);
- GridData data = new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL);
- data.heightHint = 60;
- data.widthHint = 50;
- data.horizontalSpan = 2;
- data.horizontalIndent = 10;
- table.setLayoutData(data);
-
- TableLayout tableLayout = new TableLayout();
- table.setHeaderVisible(true);
-
- tableLayout.addColumnData(new ColumnWeightData(50, 100, true));
- TableColumn col = new TableColumn(table, SWT.NONE);
- col.setText("Server");
-
- tableLayout.addColumnData(new ColumnWeightData(40, 80, true));
- TableColumn col2 = new TableColumn(table, SWT.NONE);
- col2.setText("Status");
-
- table.setLayout(tableLayout);
-
- tableViewer = new TableViewer(table);
- tableViewer.setContentProvider(new ServerContentProvider());
- tableViewer.setLabelProvider(new ServerLabelProvider());
- tableViewer.setColumnProperties(new String[] {"name", "status"});
- tableViewer.setInput("root");
-
- String date = "<now>";
- hostLabel = createLabel(this, "Last detected servers on " + host + " at " + date + ":", 1, false, true);
-
- detect = SWTUtil.createButton(this, "Refresh");
- detect.setEnabled(false);
- data = (GridData) detect.getLayoutData();
- data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_END;
-
- // listeners
- detect.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- // do nothing
- }
- });
-
- tableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- IStructuredSelection sel = (IStructuredSelection) event.getSelection();
- Object obj = sel.getFirstElement();
- IServerWorkingCopy newServer = null;
- if (obj instanceof IServerWorkingCopy)
- newServer = (IServerWorkingCopy) obj;
-
- if ((newServer == null && server != null) || (newServer != null && !newServer.equals(server))) {
- server = newServer;
- listener.serverSelected(server);
- }
- }
- });
-
- setHost(null);
-
- Dialog.applyDialogFont(this);
- }
-
- public String getHost() {
- return host;
- }
-
- public void setHost(String host) {
- this.host = host;
- servers = new ArrayList();
- tableViewer.refresh();
- if (host != null) {
- hostLabel.setText("Detected servers on " + host + ":");
- detect.setEnabled(true);
- table.setEnabled(true);
- } else {
- hostLabel.setText("No host selected");
- detect.setEnabled(false);
- table.setEnabled(false);
- }
- }
-
- public IServerWorkingCopy getServer() {
- return server;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/NewManualServerComposite.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/NewManualServerComposite.java
deleted file mode 100644
index 53c7332..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/NewManualServerComposite.java
+++ /dev/null
@@ -1,362 +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 java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.help.IWorkbenchHelpSystem;
-import org.eclipse.wst.server.core.*;
-import org.eclipse.wst.server.core.internal.Server;
-import org.eclipse.wst.server.core.util.SocketUtil;
-import org.eclipse.wst.server.ui.internal.*;
-import org.eclipse.wst.server.ui.internal.viewers.ServerTypeComposite;
-/**
- * Wizard page used to create a server and configuration at the same time.
- */
-public class NewManualServerComposite extends Composite {
- public interface ServerSelectionListener {
- public void serverSelected(IServerAttributes server);
- }
-
- public interface IWizardHandle2 {
- public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws InterruptedException, InvocationTargetException;
- public void update();
- public void setMessage(String newMessage, int newType);
- }
- protected IWizardHandle2 wizard;
-
- //private IContainer defaultContainer;
- //private String defaultServerTypeId;
- private ServerTypeComposite serverTypeComposite;
-
- protected Label runtimeLabel;
- protected Combo runtimeCombo;
- protected IRuntime[] runtimes;
-
- protected IRuntime runtime;
- protected IServerWorkingCopy server;
- protected ServerSelectionListener listener;
-
- protected String host;
-
- //protected String type;
- //protected String version;
- protected IModuleType moduleType;
-
- protected ElementCreationCache cache = new ElementCreationCache();
-
- /**
- * Creates a new server and server configuration. If the initial
- * resource selection contains exactly one container resource then it will be
- * used as the default container resource.
- *
- * @param parent
- */
- public NewManualServerComposite(Composite parent, IWizardHandle2 wizard, IModuleType moduleType, ServerSelectionListener listener) {
- super(parent, SWT.NONE);
- this.wizard = wizard;
- this.listener = listener;
-
- this.moduleType = moduleType;
-
- createControl();
- wizard.setMessage("", IMessageProvider.ERROR);
- }
-
- /**
- * Returns this page's initial visual components.
- */
- protected void createControl() {
- // top level group
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- layout.horizontalSpacing = SWTUtil.convertHorizontalDLUsToPixels(this, 4);
- layout.verticalSpacing = SWTUtil.convertVerticalDLUsToPixels(this, 4);
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- setLayout(layout);
-
- this.setFont(getParent().getFont());
- IWorkbenchHelpSystem whs = PlatformUI.getWorkbench().getHelpSystem();
- whs.setHelp(this, ContextIds.NEW_SERVER_WIZARD);
-
- serverTypeComposite = new ServerTypeComposite(this, SWT.NONE, moduleType, new ServerTypeComposite.ServerTypeSelectionListener() {
- public void serverTypeSelected(IServerType type2) {
- handleTypeSelection(type2);
- //WizardUtil.defaultSelect(parent, CreateServerWizardPage.this);
- }
- });
- serverTypeComposite.setIncludeIncompatibleVersions(true);
- GridData data = new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL);
- data.horizontalSpan = 2;
- serverTypeComposite.setLayoutData(data);
- whs.setHelp(serverTypeComposite, ContextIds.NEW_SERVER_INSTANCE_FACTORY);
-
- runtimeLabel = new Label(this, SWT.NONE);
- runtimeLabel.setText(ServerUIPlugin.getResource("%wizNewServerRuntime"));
-
- runtimeCombo = new Combo(this, SWT.READ_ONLY);
- data = new GridData(GridData.FILL_HORIZONTAL);
- runtimeCombo.setLayoutData(data);
- runtimeCombo.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- try {
- runtime = runtimes[runtimeCombo.getSelectionIndex()];
- if (server != null) {
- server.setRuntime(runtime);
- wizard.update();
- }
- } catch (Exception ex) {
- // ignore
- }
- }
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
- });
-
- Dialog.applyDialogFont(this);
- }
-
- public void setHost(String host) {
- this.host = host;
- if (serverTypeComposite == null)
- return;
- if (host == null) {
- serverTypeComposite.setHost(true);
- } else if (SocketUtil.isLocalhost(host))
- serverTypeComposite.setHost(true);
- else
- serverTypeComposite.setHost(false);
- if (server != null) {
- server.setHost(host);
- ServerUtil.setServerDefaultName(server);
- }
- }
-
- /**
- * Return the current editable element.
- * @return org.eclipse.wst.server.core.IServer
- */
- protected void loadServerImpl(final IServerType serverType) {
- //runtime = null;
- server = null;
-
- if (serverType == null)
- return;
-
- server = cache.getCachedServer(serverType, host);
- if (server != null) {
- server.setHost(host);
- ServerUtil.setServerDefaultName(server);
- runtime = server.getRuntime();
- return;
- }
-
- final CoreException[] ce = new CoreException[1];
-
- IRunnableWithProgress runnable = new IRunnableWithProgress() {
- public void run(IProgressMonitor monitor) {
- try {
- monitor = ProgressUtil.getMonitorFor(monitor);
- int ticks = 200;
- monitor.beginTask(ServerUIPlugin.getResource("%loadingTask", serverType.getName()), ticks);
-
- server = cache.getServer(serverType, host, ProgressUtil.getSubMonitorFor(monitor, 200));
- if (server != null) {
- server.setHost(host);
- ServerUtil.setServerDefaultName(server);
-
- if (serverType.hasRuntime() && server.getRuntime() == null) {
- server.setRuntime(runtime);
-
- if (server.getServerType().hasServerConfiguration()) {
- ((Server)server).importConfiguration(runtime, null);
- }
- }
- }
- } catch (CoreException cex) {
- ce[0] = cex;
- } catch (Throwable t) {
- Trace.trace(Trace.SEVERE, "Error creating element", t);
- } finally {
- monitor.done();
- }
- }
- };
- try {
- wizard.run(true, false, runnable);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error with runnable", e);
- }
-
- if (ce[0] != null)
- wizard.setMessage(ce[0].getLocalizedMessage(), IMessageProvider.ERROR);
- else if (server == null)
- wizard.setMessage(ServerUIPlugin.getResource("%wizErrorServerCreationError"), IMessageProvider.ERROR);
- }
-
- /**
- * Look for test environment runtime first. Otherwise, pick any runtime.
- *
- * @return the default runtime
- */
- protected IRuntime getDefaultRuntime() {
- if (runtimes == null || runtimes.length == 0)
- return null;
-
- if (runtimes != null) {
- int size = runtimes.length;
- for (int i = 0; i < size; i++) {
- if (!runtimes[i].isStub())
- return runtimes[i];
- }
- }
- return runtimes[0];
- }
-
- protected void updateRuntimeCombo(IServerType serverType) {
- runtime = null;
-
- if (serverType == null || !serverType.hasRuntime()) {
- if (runtimeLabel != null) {
- runtimeLabel.setEnabled(false);
- runtimeCombo.setItems(new String[0]);
- runtimeCombo.setEnabled(false);
- runtimeLabel.setVisible(false);
- runtimeCombo.setVisible(false);
- }
- return;
- }
-
- IRuntimeType runtimeType = serverType.getRuntimeType();
- runtimes = ServerUIPlugin.getRuntimes(runtimeType);
-
- if (server != null && SocketUtil.isLocalhost(server.getHost()) && runtimes != null) {
- List runtimes2 = new ArrayList();
- int size = runtimes.length;
- for (int i = 0; i < size; i++) {
- IRuntime runtime2 = runtimes[i];
- if (!runtime2.isStub())
- runtimes2.add(runtime2);
- }
- runtimes = new IRuntime[runtimes2.size()];
- runtimes2.toArray(runtimes);
- }
-
- if (runtimes.length == 0) {
- // create new runtime
- try {
- IRuntimeWorkingCopy runtimeWC = runtimeType.createRuntime(null, null);
- ServerUtil.setRuntimeDefaultName(runtimeWC);
- runtimes = new IRuntime[1];
- runtimes[0] = runtimeWC;
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Couldn't create runtime", e);
- }
- }
-
- int size = runtimes.length;
- String[] items = new String[size];
- for (int i = 0; i < size; i++)
- items[i] = runtimes[i].getName();
-
- runtime = getDefaultRuntime();
- if (runtimeCombo != null) {
- runtimeCombo.setItems(items);
- if (runtimes.length > 0) {
- for (int i = 0; i < size; i++) {
- if (runtimes[i].equals(runtime))
- runtimeCombo.select(i);
- }
- }
- runtimeCombo.setEnabled(size > 1);
- runtimeLabel.setEnabled(size > 1);
- runtimeLabel.setVisible(size > 1);
- runtimeCombo.setVisible(size > 1);
- }
- }
-
- /**
- * Handle the server type selection.
- */
- protected void handleTypeSelection(IServerType serverType) {
- boolean wrong = false;
- if (serverType != null && moduleType != null) {
- IRuntimeType runtimeType = serverType.getRuntimeType();
- if (!ServerUtil.isSupportedModule(runtimeType.getModuleTypes(), moduleType)) {
- serverType = null;
- wrong = true;
- //wizard.setMessage("Not the right spec level2", IMessageProvider.ERROR);
- }
- }
-
- updateRuntimeCombo(serverType);
- if (wrong) {
- wizard.setMessage(ServerUIPlugin.getResource("%errorVersionLevel", new Object[] { moduleType.getName(), moduleType.getVersion() }), IMessageProvider.ERROR);
- } else if (serverType == null)
- wizard.setMessage("", IMessageProvider.ERROR);
- else {
- wizard.setMessage(null, IMessageProvider.NONE);
- loadServerImpl(serverType);
- }
- listener.serverSelected(server);
- wizard.update();
- }
-
- public void setVisible(boolean visible) {
- super.setVisible(visible);
-
- if (visible) {
- /*if (defaultServerFactory != null) {
- tree.setSelection(new TreeItem[] { defaultServerFactory });
- tree.showItem(tree.getItems()[0]);
- }*/
- // force the focus to initially validate the fields
- handleTypeSelection(null);
- }
-
- Control[] c = getChildren();
- if (c != null) {
- int size = c.length;
- for (int i = 0; i < size; i++)
- if (c[i] != null && c[i] instanceof ServerTypeComposite)
- c[i].setVisible(visible);
- }
- if (visible)
- handleTypeSelection(serverTypeComposite.getSelectedServerType());
- }
-
- public IRuntime getRuntime() {
- return runtime;
- }
-
- public IServerWorkingCopy getServer() {
- return server;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/NewRuntimeComposite.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/NewRuntimeComposite.java
deleted file mode 100644
index be59ba9..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/NewRuntimeComposite.java
+++ /dev/null
@@ -1,126 +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 java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.wst.server.core.*;
-import org.eclipse.wst.server.ui.internal.ImageResource;
-import org.eclipse.wst.server.ui.internal.SWTUtil;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-import org.eclipse.wst.server.ui.internal.viewers.RuntimeTypeComposite;
-import org.eclipse.wst.server.ui.wizard.IWizardHandle;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Tree;
-/**
- *
- */
-public class NewRuntimeComposite extends Composite {
- protected Tree tree;
- protected TreeViewer treeViewer;
-
- protected IRuntimeWorkingCopy runtime;
- protected Map runtimeMap = new HashMap();
-
- protected TaskModel taskModel;
- protected IWizardHandle wizard;
-
- protected String type;
- protected String version;
- protected String runtimeTypeId;
-
- public NewRuntimeComposite(Composite parent, IWizardHandle wizard, TaskModel tm, String type, String version, String runtimeTypeId) {
- super(parent, SWT.NONE);
-
- this.wizard = wizard;
- this.taskModel = tm;
- this.type = type;
- this.version = version;
- this.runtimeTypeId = runtimeTypeId;
-
- createControl();
-
- wizard.setTitle(ServerUIPlugin.getResource("%wizNewRuntimeTitle"));
- wizard.setDescription(ServerUIPlugin.getResource("%wizNewRuntimeDescription"));
- wizard.setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_WIZBAN_NEW_RUNTIME));
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
- */
- public void createControl() {
- //initializeDialogUnits(parent);
- GridLayout layout = new GridLayout();
- layout.horizontalSpacing = SWTUtil.convertHorizontalDLUsToPixels(this, 4);
- layout.verticalSpacing = SWTUtil.convertVerticalDLUsToPixels(this, 4);
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- layout.numColumns = 1;
- setLayout(layout);
-
- RuntimeTypeComposite comp = new RuntimeTypeComposite(this, SWT.NONE, true, new RuntimeTypeComposite.RuntimeTypeSelectionListener() {
- public void runtimeTypeSelected(IRuntimeType runtimeType) {
- handleSelection(runtimeType);
- }
- }, type, version, runtimeTypeId);
- GridData data = new GridData(GridData.FILL_BOTH);
- data.heightHint = 200;
- comp.setLayoutData(data);
- }
-
- protected void handleSelection(IRuntimeType runtimeType) {
- if (runtimeType == null)
- runtime = null;
- else {
- try {
- runtime = null;
- runtime = (IRuntimeWorkingCopy) runtimeMap.get(runtimeType);
- } catch (Exception e) {
- // ignore
- }
- if (runtime == null) {
- try {
- runtime = runtimeType.createRuntime(null, null);
- ServerUtil.setRuntimeDefaultName(runtime);
- if (runtime != null)
- runtimeMap.put(runtimeType, runtime);
- } catch (Exception e) {
- // ignore
- }
- }
- }
-
- taskModel.putObject(TaskModel.TASK_RUNTIME, runtime);
- wizard.update();
- }
-
- public IRuntimeWorkingCopy getRuntime() {
- return runtime;
- }
-
- public void setVisible(boolean visible) {
- super.setVisible(visible);
-
- Control[] c = getChildren();
- if (c != null) {
- int size = c.length;
- for (int i = 0; i < size; i++)
- if (c[i] != null)
- c[i].setVisible(visible);
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/NewServerComposite.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/NewServerComposite.java
deleted file mode 100644
index 7f68a13..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/NewServerComposite.java
+++ /dev/null
@@ -1,468 +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 java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.resource.JFaceResources;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.StackLayout;
-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.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IModuleType;
-import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.IServerAttributes;
-import org.eclipse.wst.server.core.IServerType;
-import org.eclipse.wst.server.core.IServerWorkingCopy;
-import org.eclipse.wst.server.core.TaskModel;
-import org.eclipse.wst.server.core.ServerCore;
-import org.eclipse.wst.server.core.ServerUtil;
-import org.eclipse.wst.server.ui.internal.*;
-import org.eclipse.wst.server.ui.internal.viewers.ServerComposite;
-import org.eclipse.wst.server.ui.internal.wizard.fragment.NewServerWizardFragment;
-import org.eclipse.wst.server.ui.wizard.IWizardHandle;
-/**
- * A wizard page used to select a server.
- */
-public class NewServerComposite extends Composite {
- protected IWizardHandle wizard;
- protected TaskModel taskModel;
- protected IModule module;
- protected String launchMode;
-
- protected static final byte MODE_EXISTING = 0;
- protected static final byte MODE_DETECT = 1;
- protected static final byte MODE_MANUAL= 2;
- protected byte mode;
-
- protected Composite detectComp2;
- protected NewDetectServerComposite detectComp;
- protected HostnameComposite detectHostComp;
- protected Composite manualComp2;
- protected NewManualServerComposite manualComp;
- protected HostnameComposite manualHostComp;
- protected ServerComposite existingComp;
-
- protected Composite stack;
- protected StackLayout stackLayout;
-
- protected String lastHostname;
-
- protected Button pref;
- protected boolean preferred;
-
- protected IServerWorkingCopy existingWC;
-
- /**
- * Create a new NewServerComposite.
- */
- public NewServerComposite(Composite parent, IWizardHandle wizard, IModule module, String launchMode) {
- super(parent, SWT.NONE);
- this.wizard = wizard;
- this.module = module;
- this.launchMode = launchMode;
-
- wizard.setTitle(ServerUIPlugin.getResource("%wizNewServerTitle"));
- wizard.setDescription(ServerUIPlugin.getResource("%wizNewServerDescription"));
- wizard.setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_WIZBAN_NEW_SERVER));
-
- createControl();
- }
-
- public NewServerComposite(Composite parent, IWizardHandle wizard) {
- this(parent, wizard, null, null);
- }
-
- protected Label createHeadingLabel(Composite parent, String text, int span) {
- Label label = createLabel(parent, text, span);
- label.setFont(JFaceResources.getBannerFont());
- return label;
- }
-
- protected Label createLabel(Composite parent, String text, int span) {
- Label label = new Label(parent, SWT.WRAP);
- label.setText(text);
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_BEGINNING);
- data.horizontalSpan = span;
- label.setLayoutData(data);
- return label;
- }
-
- protected Label createLabel(Composite parent, String text) {
- return createLabel(parent, text, 1);
- }
-
- protected Button createRadioButton(Composite parent, String text, int span) {
- Button button = new Button(parent, SWT.RADIO);
- button.setText(text);
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_BEGINNING);
- data.horizontalSpan = span;
- data.horizontalIndent = 10;
- button.setLayoutData(data);
- return button;
- }
-
- protected Text createText(Composite parent, String text2, int span) {
- Text text = new Text(parent, SWT.NONE);
- text.setText(text2);
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_BEGINNING);
- data.horizontalSpan = span;
- text.setLayoutData(data);
- return text;
- }
-
- /**
- * Creates the UI of the page.
- */
- protected void createControl() {
- GridLayout layout = new GridLayout();
- layout.horizontalSpacing = SWTUtil.convertHorizontalDLUsToPixels(this, 4);
- layout.verticalSpacing = SWTUtil.convertVerticalDLUsToPixels(this, 4);
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- layout.numColumns = 1;
- setLayout(layout);
- //WorkbenchHelp.setHelp(this, ContextIds.SELECT_CLIENT_WIZARD);
-
- if (module != null)
- createHeadingLabel(this, ServerUIPlugin.getResource("%wizNewServerSelect"), 1);
-
- Button existing = null;
- if (module != null) {
- final Button predefined = createRadioButton(this, ServerUIPlugin.getResource("%wizNewServerExisting"), 1);
- predefined.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- if (predefined.getSelection())
- toggleMode(MODE_EXISTING);
- }
- });
- existing = predefined;
- }
-
- /*final Button auto = createRadioButton(this, ServerUIPlugin.getResource("%wizNewServerDetect"), 1);
- auto.setEnabled(false);
- auto.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- if (auto.getSelection())
- toggleMode(MODE_DETECT);
- }
- });*/
-
- Button manual = null;
- if (module != null) {
- final Button manualButton = createRadioButton(this, ServerUIPlugin.getResource("%wizNewServerManual"), 1);
- manualButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- if (manualButton.getSelection())
- toggleMode(MODE_MANUAL);
- }
- });
- manual = manualButton;
- }
-
- stack = new Composite(this, SWT.NONE);
- GridData data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
- stack.setLayoutData(data);
- stackLayout = new StackLayout();
- stackLayout.marginHeight = 0;
- stackLayout.marginWidth = 0;
- stack.setLayout(stackLayout);
-
- if (module != null)
- createExistingComposite(stack);
- createAutoComposite(stack);
- createManualComposite(stack);
-
- if (existingComp != null) {
- if (isExistingServer()) {
- mode = MODE_EXISTING;
- stackLayout.topControl = existingComp;
- existing.setSelection(true);
- } else {
- mode = MODE_MANUAL;
- stackLayout.topControl = manualComp2;
- manualComp.setVisible(true);
- if (manual != null)
- manual.setSelection(true);
- existing.setEnabled(false);
- existingComp.setEnabled(false);
- }
- } else {
- mode = MODE_MANUAL;
- stackLayout.topControl = manualComp2;
- manualComp.setVisible(true);
- if (manual != null)
- manual.setSelection(true);
- }
-
- if (module != null) {
- // preferred server button
- pref = new Button(this, SWT.CHECK | SWT.WRAP);
- pref.setText(ServerUIPlugin.getResource("%wizSelectServerPreferred"));
- data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_END);
- //pref.setSelection(true);
- //preferred = true;
- data.horizontalSpan = 1;
- pref.setLayoutData(data);
- pref.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- preferred = pref.getSelection();
- }
- });
- PlatformUI.getWorkbench().getHelpSystem().setHelp(pref, ContextIds.SELECT_SERVER_PREFERENCE);
- }
-
- Dialog.applyDialogFont(this);
- }
-
- protected void toggleMode(byte newMode) {
- if (!isVisible())
- return;
-
- if (newMode == mode)
- return;
-
- mode = newMode;
- wizard.setMessage(null, IMessageProvider.NONE);
-
- if (mode == MODE_EXISTING) {
- stackLayout.topControl = existingComp;
- existingComp.setSelection(existingComp.getSelectedServer());
- } else if (mode == MODE_DETECT) {
- stackLayout.topControl = detectComp2;
- detectComp.setVisible(true);
- } else {
- stackLayout.topControl = manualComp2;
- manualComp.setVisible(true);
- }
- stack.layout();
- if (taskModel != null) {
- taskModel.putObject(NewServerWizardFragment.MODE, new Byte(mode));
- updateTaskModel();
- }
- }
-
- protected HostnameComposite createHostComposite(Composite comp) {
- HostnameComposite hostComp = new HostnameComposite(comp, new HostnameComposite.IHostnameSelectionListener() {
- public void hostnameSelected(String host) {
- lastHostname = host;
- if (detectComp != null)
- detectComp.setHost(host);
- if (manualComp != null)
- manualComp.setHost(host);
- }
- });
-
- if (lastHostname != null)
- hostComp.setHostname(lastHostname);
-
- GridData data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 3;
- hostComp.setLayoutData(data);
- return hostComp;
- }
-
- protected void createAutoComposite(Composite comp) {
- detectComp2 = new Composite(comp, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.horizontalSpacing = SWTUtil.convertHorizontalDLUsToPixels(this, 4);
- layout.verticalSpacing = SWTUtil.convertVerticalDLUsToPixels(this, 4);
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- layout.numColumns = 1;
- detectComp2.setLayout(layout);
-
- detectHostComp = createHostComposite(detectComp2);
-
- detectComp = new NewDetectServerComposite(detectComp2, new NewDetectServerComposite.IServerSelectionListener() {
- public void serverSelected(IServerAttributes server) {
- // do nothing
- }
- });
-
- if (lastHostname != null)
- detectComp.setHost(lastHostname);
- else
- detectComp.setHost("localhost");
- GridData data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL);
- data.horizontalSpan = 3;
- data.heightHint = 120;
- detectComp.setLayoutData(data);
- }
-
- protected void createExistingComposite(Composite comp) {
- existingComp = new ServerComposite(comp, SWT.NONE, new ServerComposite.ServerSelectionListener() {
- public void serverSelected(IServer server) {
- wizard.setMessage(null, IMessageProvider.NONE);
-
- // check for compatibility
- if (server != null && module != null) {
- IServerType serverType = server.getServerType();
- IModuleType mt = module.getModuleType();
- if (!ServerUtil.isSupportedModule(serverType.getRuntimeType().getModuleTypes(), mt)) {
- String type = mt.getName();
- wizard.setMessage(ServerUIPlugin.getResource("%errorVersionLevel", new Object[] { type, mt.getVersion() }), IMessageProvider.ERROR);
- server = null;
- }
- }
-
- if (existingWC != null) {
- if (server != null && server.equals(existingWC.getOriginal()))
- return;
- existingWC = null;
- }
- if (server != null)
- existingWC = server.createWorkingCopy();
- updateTaskModel();
- }
- }, module, launchMode);
- existingComp.setIncludeIncompatibleVersions(true);
- GridData data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL);
- data.horizontalSpan = 3;
- data.heightHint = 120;
- existingComp.setLayoutData(data);
- }
-
- protected boolean isExistingServer() {
- if (module == null || launchMode == null)
- return false;
-
- IServer[] servers = ServerCore.getServers();
- if (servers != null) {
- int size = servers.length;
- for (int i = 0; i < size; i++) {
- IModuleType mt = module.getModuleType();
- if (ServerUIPlugin.isCompatibleWithLaunchMode(servers[i], launchMode) &&
- ServerUtil.isSupportedModule(servers[i].getServerType().getRuntimeType().getModuleTypes(), mt))
- return true;
- }
- }
- return false;
- }
-
- protected void createManualComposite(Composite comp) {
- manualComp2 = new Composite(comp, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.horizontalSpacing = SWTUtil.convertHorizontalDLUsToPixels(this, 4);
- layout.verticalSpacing = SWTUtil.convertVerticalDLUsToPixels(this, 4);
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- layout.numColumns = 1;
- manualComp2.setLayout(layout);
-
- manualHostComp = createHostComposite(manualComp2);
- IModuleType mt = null;
- if (module != null)
- mt = module.getModuleType();
-
- manualComp = new NewManualServerComposite(manualComp2, new NewManualServerComposite.IWizardHandle2() {
- public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws InterruptedException, InvocationTargetException {
- wizard.run(fork, cancelable, runnable);
- }
- public void update() {
- wizard.update();
- }
- public void setMessage(String newMessage, int newType) {
- wizard.setMessage(newMessage, newType);
- }
- }, mt, new NewManualServerComposite.ServerSelectionListener() {
- public void serverSelected(IServerAttributes server) {
- updateTaskModel();
- }
- });
-
- if (lastHostname != null)
- manualComp.setHost(lastHostname);
- else
- manualComp.setHost("localhost");
-
- GridData data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL);
- data.horizontalSpan = 3;
- data.heightHint = 250;
- manualComp.setLayoutData(data);
- }
-
- protected void updateTaskModel() {
- if (taskModel != null) {
- IServerWorkingCopy server = getServer();
- if (server != null) {
- taskModel.putObject(TaskModel.TASK_SERVER, server);
- taskModel.putObject(TaskModel.TASK_RUNTIME, server.getRuntime());
- } else {
- taskModel.putObject(TaskModel.TASK_SERVER, null);
- taskModel.putObject(TaskModel.TASK_RUNTIME, null);
- }
- wizard.update();
- }
- }
-
- public void setTaskModel(TaskModel model) {
- taskModel = model;
- taskModel.putObject(NewServerWizardFragment.MODE, new Byte(mode));
- updateTaskModel();
- }
-
- public IServerWorkingCopy getServer() {
- if (mode == MODE_EXISTING)
- return existingWC; //existingComp.getSelectedServer();
- else if (mode == MODE_DETECT)
- return detectComp.getServer();
- else
- return manualComp.getServer();
- }
-
- public IRuntime getRuntime() {
- if (mode == MODE_EXISTING) {
- IServer server = existingComp.getSelectedServer();
- if (server != null)
- return server.getRuntime();
- return null;
- } else if (mode == MODE_DETECT)
- return null;
- else
- return manualComp.getRuntime();
- }
-
- /**
- * Returns true if this server should become the preferred server.
- *
- * @return boolean
- */
- public boolean isPreferredServer() {
- return preferred;
- }
-
- public void setVisible(boolean visible) {
- super.setVisible(visible);
-
- Control[] c = getChildren();
- if (c != null) {
- int size = c.length;
- for (int i = 0; i < size; i++)
- if (c[i] != null)
- c[i].setVisible(visible);
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/SelectClientComposite.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/SelectClientComposite.java
deleted file mode 100644
index 0835928..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/SelectClientComposite.java
+++ /dev/null
@@ -1,157 +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.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.wst.server.core.internal.IClient;
-import org.eclipse.wst.server.ui.ServerUICore;
-import org.eclipse.wst.server.ui.internal.*;
-import org.eclipse.wst.server.ui.wizard.IWizardHandle;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.help.IWorkbenchHelpSystem;
-/**
- * A wizard page used to select a server client.
- */
-public class SelectClientComposite extends Composite {
- protected IWizardHandle wizard;
-
- // the list of elements to select from
- protected IClient[] clients;
-
- // the currently selected element
- protected IClient selectedClient;
-
- // the table containing the elements
- protected Table elementTable;
-
- // the description of the selected client
- protected Label description;
-
- /**
- * Create a new SelectClientComposite.
- */
- public SelectClientComposite(Composite parent, IWizardHandle wizard, IClient[] clients) {
- super(parent, SWT.NONE);
- this.wizard = wizard;
- this.clients = clients;
-
- wizard.setTitle(ServerUIPlugin.getResource("%wizSelectClientTitle"));
- wizard.setDescription(ServerUIPlugin.getResource("%wizSelectClientDescription"));
- wizard.setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_WIZBAN_SELECT_SERVER_CLIENT));
-
- createControl();
- }
-
- /**
- * Clears the selected client.
- */
- public void clearSelectedClient() {
- selectedClient = null;
- }
-
- /**
- * Creates the UI of the page.
- */
- protected void createControl() {
- GridLayout layout = new GridLayout();
- layout.horizontalSpacing = SWTUtil.convertHorizontalDLUsToPixels(this, 4);
- layout.verticalSpacing = SWTUtil.convertVerticalDLUsToPixels(this, 4);
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- setLayout(layout);
-
- IWorkbenchHelpSystem whs = PlatformUI.getWorkbench().getHelpSystem();
- whs.setHelp(this, ContextIds.SELECT_CLIENT_WIZARD);
-
- Label label = new Label(this, SWT.WRAP);
- label.setText(ServerUIPlugin.getResource("%wizSelectClientMessage"));
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_BEGINNING);
- label.setLayoutData(data);
-
- elementTable = new Table(this, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
- data = new GridData(GridData.VERTICAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL);
- data.heightHint = 80;
- data.horizontalIndent = 20;
- elementTable.setLayoutData(data);
- elementTable.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- handleSelection();
- }
- public void widgetDefaultSelected(SelectionEvent e) {
- handleSelection();
- //TODO: WizardUtil.defaultSelect(getWizard(), SelectClientWizardPage.this);
- }
- });
- whs.setHelp(elementTable, ContextIds.SELECT_CLIENT);
-
- if (clients != null) {
- int size = clients.length;
- for (int i = 0; i < size; i++) {
- TableItem item = new TableItem(elementTable, SWT.NONE);
- item.setText(0, ServerUICore.getLabelProvider().getText(clients[i]));
- item.setImage(0, ServerUICore.getLabelProvider().getImage(clients[i]));
- item.setData(clients[i]);
- }
- }
-
- description = new Label(this, SWT.WRAP);
- description.setText("");
- data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_BEGINNING);
- data.heightHint = 70;
- description.setLayoutData(data);
-
- Dialog.applyDialogFont(this);
- }
-
- /**
- * Return the selected client.
- *
- * @return org.eclipse.wst.server.core.IClient
- */
- public IClient getSelectedClient() {
- return selectedClient;
- }
-
- /**
- * Handle the selection of a client.
- */
- protected void handleSelection() {
- int index = elementTable.getSelectionIndex();
- if (index < 0)
- selectedClient = null;
- else
- selectedClient = clients[index];
-
- if (selectedClient != null)
- wizard.setMessage(null, IMessageProvider.NONE);
- else
- wizard.setMessage("", IMessageProvider.ERROR);
-
- String desc = null;
- if (selectedClient != null)
- desc = selectedClient.getDescription();
- if (desc == null)
- desc = "";
- description.setText(desc);
-
- wizard.update();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/TasksComposite.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/TasksComposite.java
deleted file mode 100644
index 3e2e9a2..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/TasksComposite.java
+++ /dev/null
@@ -1,169 +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 java.util.List;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.wst.server.core.IOptionalTask;
-import org.eclipse.wst.server.ui.internal.ContextIds;
-import org.eclipse.wst.server.ui.internal.ImageResource;
-import org.eclipse.wst.server.ui.internal.SWTUtil;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-import org.eclipse.wst.server.ui.internal.wizard.fragment.TasksWizardFragment;
-import org.eclipse.wst.server.ui.wizard.IWizardHandle;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.PlatformUI;
-/**
- * A wizard page used to select server and module tasks.
- */
-public class TasksComposite extends Composite {
- protected IWizardHandle wizard;
-
- protected Composite comp;
-
- // the list of elements to select from
- protected List tasks;
-
- /**
- * Create a new TasksComposite.
- */
- public TasksComposite(Composite parent, IWizardHandle wizard) {
- super(parent, SWT.NONE);
- this.wizard = wizard;
-
- wizard.setTitle(ServerUIPlugin.getResource("%wizTaskTitle"));
- wizard.setDescription(ServerUIPlugin.getResource("%wizTaskDescription"));
- wizard.setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_WIZBAN_SELECT_SERVER));
- }
-
- public void setTasks(List tasks) {
- this.tasks = tasks;
-
- Control[] children = getChildren();
- if (children != null) {
- int size = children.length;
- for (int i = 0; i < size; i++) {
- children[i].dispose();
- }
- }
-
- createControl();
- layout(true);
- }
-
- /**
- * Creates the UI of the page.
- */
- protected void createControl() {
- GridLayout layout = new GridLayout();
- layout.horizontalSpacing = SWTUtil.convertHorizontalDLUsToPixels(this, 4);
- layout.verticalSpacing = SWTUtil.convertVerticalDLUsToPixels(this, 4);
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- layout.numColumns = 3;
- setLayout(layout);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, ContextIds.SELECT_TASK_WIZARD);
-
- int size = 0;
- if (tasks != null)
- size = tasks.size();
-
- //Object cont = null;
- Group group = null;
- int count = 0;
-
- for (int i = 0; i < size; i++) {
- Object obj = tasks.get(i);
- final TasksWizardFragment.TaskInfo sti = (TasksWizardFragment.TaskInfo) obj;
- /*if (cont != sti.server) {
- if (group != null && count == 0)
- group.setEnabled(false);
-
- if (cont != null) {
- Label spacer = new Label(this, SWT.SEPARATOR | SWT.HORIZONTAL);
- GridData data = new GridData(GridData.VERTICAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 3;
- spacer.setLayoutData(data);
- }
-
- group = new Group(this, SWT.SHADOW_NONE);
- group.setText(ServerUIPlugin.getResource("%wizTaskDetail") + " " + ServerUICore.getLabelProvider().getText(sti.server));
- GridData data = new GridData(GridData.VERTICAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 3;
- group.setLayoutData(data);
-
- layout = new GridLayout();
- layout.horizontalSpacing = 0;
- layout.verticalSpacing = 3;
- layout.marginWidth = 5;
- layout.marginHeight = 5;
- group.setLayout(layout);
-
- //cont = sti.server;
- }*/
- final Button checkbox = new Button(this, SWT.CHECK);
- checkbox.setText(sti.task2.getName());
- GridData data = new GridData(GridData.VERTICAL_ALIGN_BEGINNING | GridData.HORIZONTAL_ALIGN_FILL);
- checkbox.setLayoutData(data);
- checkbox.setFocus();
-
- checkbox.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent event) {
- sti.setSelected(checkbox.getSelection());
- }
- public void widgetDefaultSelected(SelectionEvent event) {
- sti.setSelected(checkbox.getSelection());
- }
- });
-
- Label description = new Label(group, SWT.WRAP);
- data = new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_FILL);
- data.heightHint = 50;
- data.horizontalIndent = 20;
- description.setLayoutData(data);
- description.setText(sti.task2.getDescription());
-
- int status = sti.status;
- if (status == IOptionalTask.TASK_COMPLETED) {
- checkbox.setEnabled(false);
- description.setEnabled(false);
- } else if (status == IOptionalTask.TASK_PREFERRED) {
- checkbox.setSelection(true);
- count++;
- } else if (status == IOptionalTask.TASK_MANDATORY) {
- checkbox.setSelection(true);
- checkbox.setEnabled(false);
- description.setEnabled(false);
- } else
- count++;
- }
-
- if (group != null && count == 0)
- group.setEnabled(false);
-
- if (size == 0) {
- Label label = new Label(this, SWT.NONE);
- label.setText(ServerUIPlugin.getResource("%wizTaskNone"));
- }
-
- Dialog.applyDialogFont(this);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/WizardUtil.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/WizardUtil.java
deleted file mode 100644
index 2a006e0..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/WizardUtil.java
+++ /dev/null
@@ -1,233 +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.*;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.wst.server.core.ServerCore;
-import org.eclipse.wst.server.core.internal.ProjectProperties;
-import org.eclipse.wst.server.core.internal.ServerPlugin;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-import org.eclipse.wst.server.ui.internal.wizard.ClosableWizardDialog;
-import org.eclipse.swt.widgets.Shell;
-/**
- * A helper class for wizards.
- */
-public class WizardUtil {
- /**
- * Use static methods.
- */
- private WizardUtil() {
- // do nothing
- }
-
- public static IProject getServerProject() {
- IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
- if (projects != null) {
- int size = projects.length;
- for (int i = 0; i < size; i++) {
- if (((ProjectProperties)ServerCore.getProjectProperties(projects[i])).isServerProject())
- return projects[i];
- }
- }
-
- String s = findUnusedServerProjectName();
- return ResourcesPlugin.getWorkspace().getRoot().getProject(s);
- }
-
- /**
- * Finds an unused project name to use as a server project.
- *
- * @return java.lang.String
- */
- protected static String findUnusedServerProjectName() {
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- String name = ServerPlugin.getResource("%defaultServerProjectName", "");
- int count = 1;
- while (root.getProject(name).exists()) {
- name = ServerPlugin.getResource("%defaultServerProjectName", ++count + "");
- }
- return name;
- }
-
- /**
- * Return the container with the given name, if one exists.
- *
- * @param containerName java.lang.String
- * @return org.eclipse.core.resources.IContainer
- */
- public static IContainer findContainer(String containerName) {
- if (containerName == null || containerName.equals(""))
- return null;
-
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- try {
- IProject project = root.getProject(containerName);
- if (project != null && project.exists())
- return project;
- } catch (Exception e) {
- // ignore
- }
-
- try {
- IFolder folder = root.getFolder(new Path(containerName));
- if (folder != null && folder.exists())
- return folder;
- } catch (Exception e) {
- // ignore
- }
- return null;
- }
-
- /**
- * Tries to find a server project folder in the heirarchy
- * of the given resource. If it finds one, it returns the
- * folder that the resource is or is in.
- *
- * @param resource org.eclipse.core.resources.IResource
- * @return org.eclipse.core.resources.IContainer
- */
- protected static IContainer findServerProjectContainer(IResource resource) {
- IContainer container = null;
- while (resource != null) {
- if (container == null && resource instanceof IContainer)
- container = (IContainer) resource;
-
- if (resource instanceof IFile) {
- IFile file = (IFile) resource;
- if (ServerUIPlugin.findServer(file) != null)
- return null;
- }
-
- if (resource instanceof IProject) {
- if (resource.getProject().isOpen())
- return container;
- }
- resource = resource.getParent();
- }
- return null;
- }
-
- /**
- * Return the full pathname of a container.
- *
- * @param container org.eclipse.core.resources.Container
- * @return java.lang.String
- */
- public static String getContainerText(IContainer container) {
- String name = container.getName();
- while (container != null && !(container instanceof IProject)) {
- container = container.getParent();
- name = container.getName() + "/" + name;
- }
- return name;
- }
-
- /**
- * Returns the selected container from this selection.
- *
- * @param selection the selection
- * @return the container
- */
- public static IContainer getSelectionContainer(IStructuredSelection selection) {
- if (selection == null || selection.isEmpty())
- return null;
-
- Object obj = selection.getFirstElement();
- if (obj instanceof IResource)
- return findServerProjectContainer((IResource) obj);
-
- return null;
- }
-
- /**
- * Return true if the container is a valid server project
- * folder and is not "within" a server instance or configuration.
- *
- * @param name a container name
- */
- public static String validateContainer(String name) {
- IContainer container = WizardUtil.findContainer(name);
- if (container == null || !container.exists()) {
- IStatus status = ResourcesPlugin.getWorkspace().validateName(name, IResource.PROJECT);
- if (status.isOK())
- return null; // we can create one later
- return status.getMessage();
- }
-
- String error = ServerUIPlugin.getResource("%wizErrorInvalidFolder");
- try {
- // find project of this container
- IProject project = null;
- if (container instanceof IProject) {
- project = (IProject) container;
- } else {
- // look up hierarchy for project
- IContainer temp = container.getParent();
- while (project == null && temp != null && !(temp instanceof IProject)) {
- temp = temp.getParent();
- }
- if (temp != null && temp instanceof IProject)
- project = (IProject) temp;
- }
-
- // validate the project
- if (project != null && !project.isOpen())
- return ServerUIPlugin.getResource("%wizErrorClosedProject");
-
- if (project == null || !project.exists() || !project.isOpen())
- return error;
-
- // make sure we're not embedding in another server element
- IResource temp = container;
- while (temp != null && !(temp instanceof IProject)) {
- if (temp instanceof IFile) {
- IFile file = (IFile) temp;
- if (ServerUIPlugin.findServer(file) != null)
- return error;
- }
- temp = temp.getParent();
- }
- } catch (Exception e) {
- return error;
- }
- return null;
- }
-
- /**
- * Returns true if the user said okay to creating a new server
- * project.
- *
- * @return boolean
- */
- public static boolean promptForServerProjectCreation(Shell shell, String projectName) {
- String msg = ServerUIPlugin.getResource("%createServerProjectDialogMessage", projectName);
- return MessageDialog.openQuestion(shell, ServerUIPlugin.getResource("%createServerProjectDialogTitle"), msg);
- }
-
- /**
- * Handles default selection within a wizard by going to the next
- * page, or finishing the wizard if possible.
- */
- public static void defaultSelect(IWizard wizard, IWizardPage page) {
- if (page.canFlipToNextPage() && page.getNextPage() != null)
- wizard.getContainer().showPage(page.getNextPage());
- else if (wizard.canFinish() && wizard.getContainer() instanceof ClosableWizardDialog) {
- ClosableWizardDialog dialog = (ClosableWizardDialog) wizard.getContainer();
- dialog.finishPressed();
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/WorkspaceRunnableAdapter.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/WorkspaceRunnableAdapter.java
deleted file mode 100644
index e80519d..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/WorkspaceRunnableAdapter.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.page;
-
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-/**
- * IRunnableWithProgressAdapter to allow it to run an IWorkspaceRunnable.
- */
-public class WorkspaceRunnableAdapter implements IRunnableWithProgress {
- private IWorkspaceRunnable workspaceRunnable;
-
- public WorkspaceRunnableAdapter(IWorkspaceRunnable runnable) {
- workspaceRunnable = runnable;
- }
-
- /*
- * @see IRunnableWithProgress#run(IProgressMonitor)
- */
- public void run(IProgressMonitor monitor) throws InvocationTargetException {
- try {
- ResourcesPlugin.getWorkspace().run(workspaceRunnable, monitor);
- } catch (CoreException e) {
- throw new InvocationTargetException(e);
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/package.xml b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/package.xml
deleted file mode 100644
index fec593a..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/package.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<html>
-<head>
- <!-- Escape to the root of your source folder -->
- <meta
- name="root"
- content="../../../../../../" />
- <title>WTP API overview</title>
-</head>
-
-<body>
-
-<p>The server tools UI.</p>
-
-<p>ServerUICore is the main entry-point for the API. From here, clients
-can get the wizard pages for a particular server type, get a label
-provider for all server types, or launch Run on Server directly.</p>
-
-<p>ServerUIUtil provides utility methods. Currently, this is limited to
-launching the server runtime wizard and editing an existing server
-runtime.</p>
-
-<p>ServerLaunchConfigurationTab is a generic server tools tab that can
-be used in launch configuration tab groups for a server launch. It shows
-information about the server to the user.</p>
-
-</body>
-</html>
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/wizard/IWizardHandle.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/wizard/IWizardHandle.java
deleted file mode 100644
index e3fdc69..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/wizard/IWizardHandle.java
+++ /dev/null
@@ -1,67 +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.wizard;
-
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.resource.ImageDescriptor;
-/**
- *
- *
- * @since 1.0
- */
-public interface IWizardHandle extends IMessageProvider {
- public void update();
-
- /**
- * Sets the title of this wizard page.
- *
- * @param title the title of the wizard page
- */
- public void setTitle(String title);
-
- /**
- * The page's description.
- *
- * @param desc the page's description
- */
- public void setDescription(String desc);
-
- /**
- * The page's image descriptor.
- *
- * @param image the page's image descriptor
- */
- public void setImageDescriptor(ImageDescriptor image);
-
- /**
- * Set an error or warning message.
- *
- * @param newMessage the new message
- * @param newType the new type, from IStatus
- */
- public void setMessage(String newMessage, int newType);
-
- /**
- * Execute a runnable within the context of the wizard. This will typically
- * disable the wizard while the runnable is running, and provide a progress
- * monitor for the user.
- *
- * @param fork true if a separate thread should be used
- * @param cancelable true if it should be cancelable
- * @param runnable the runnable
- * @throws InterruptedException thrown if it is interrupted
- * @throws InvocationTargetException thrown if there is an error
- */
- public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws InterruptedException, InvocationTargetException;
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/wizard/TaskWizard.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/wizard/TaskWizard.java
deleted file mode 100644
index 41b642f..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/wizard/TaskWizard.java
+++ /dev/null
@@ -1,564 +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.wizard;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.runtime.*;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.jface.wizard.IWizardContainer;
-import org.eclipse.jface.wizard.IWizardPage;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.server.core.ITask;
-import org.eclipse.wst.server.core.TaskModel;
-import org.eclipse.wst.server.ui.internal.EclipseUtil;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-import org.eclipse.wst.server.ui.internal.Trace;
-import org.eclipse.wst.server.ui.internal.wizard.page.WorkspaceRunnableAdapter;
-/**
- * A wizard used to execute tasks.
- *
- * @since 1.0
- */
-public class TaskWizard implements IWizard {
- private static final byte FINISH = 2;
- private static final byte CANCEL = 3;
-
- private List pages;
- private boolean addingPages;
- private Map fragmentData = new HashMap();
- protected TaskModel taskModel = new TaskModel();
-
- private IWizardContainer container = null;
-
- private boolean needsProgressMonitor = false;
-
- private boolean forcePreviousAndNextButtons = false;
-
- private boolean isHelpAvailable = false;
-
- private Image defaultImage = null;
-
- private RGB titleBarColor = null;
-
- private String windowTitle = null;
-
- private IDialogSettings dialogSettings = null;
-
- private WizardFragment rootFragment;
- private WizardFragment currentFragment;
-
- //private static TaskWizard current;
-
- class FragmentData {
- public TaskWizardPage page;
- public ITask finishTask;
- public ITask cancelTask;
-
- public FragmentData(WizardFragment fragment) {
- finishTask = fragment.createFinishTask();
- if (finishTask != null)
- finishTask.setTaskModel(taskModel);
-
- cancelTask = fragment.createCancelTask();
- if (cancelTask != null)
- cancelTask.setTaskModel(taskModel);
- }
- }
-
- /**
- * TaskWizard constructor comment.
- */
- public TaskWizard() {
- super();
-
- setNeedsProgressMonitor(true);
- setForcePreviousAndNextButtons(true);
-
- //current = this;
- }
-
- /**
- * TaskWizard constructor comment.
- */
- public TaskWizard(WizardFragment rootFragment) {
- this();
- this.rootFragment = rootFragment;
- }
-
- public TaskWizard(String title) {
- this();
- setWindowTitle(title);
- }
-
- public TaskWizard(String title, WizardFragment rootFragment) {
- this(rootFragment);
- setWindowTitle(title);
- }
-
- public void setRootFragment(WizardFragment rootFragment) {
- this.rootFragment = rootFragment;
- }
-
- public WizardFragment getRootFragment() {
- return rootFragment;
- }
-
- /**
- * Cancel the client selection.
- *
- * @return boolean
- */
- public boolean performCancel() {
- final List list = getAllWizardFragments();
- IRunnableWithProgress runnable = new IRunnableWithProgress() {
- public void run(IProgressMonitor monitor) throws InvocationTargetException {
- try {
- Iterator iterator = list.iterator();
- while (iterator.hasNext())
- executeTask((WizardFragment) iterator.next(), CANCEL, monitor);
- } catch (CoreException ce) {
- throw new InvocationTargetException(ce);
- }
- }
- };
-
- Throwable t = null;
- try {
- if (getContainer() != null)
- getContainer().run(true, true, runnable);
- else
- runnable.run(new NullProgressMonitor());
- return true;
- } catch (InvocationTargetException te) {
- t = te.getCause();
- } catch (Exception e) {
- t = e;
- }
- Trace.trace(Trace.SEVERE, "Error cancelling task wizard", t);
-
- if (t instanceof CoreException) {
- EclipseUtil.openError(t.getLocalizedMessage(), ((CoreException)t).getStatus());
- } else
- EclipseUtil.openError(t.getLocalizedMessage());
-
- return false;
-
- }
-
- public boolean performFinish() {
- if (currentFragment != null)
- currentFragment.exit();
-
- final WizardFragment cFragment = currentFragment;
-
- final List list = getAllWizardFragments();
- IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- // enter & exit the remaining pages
- int index = list.indexOf(cFragment);
- while (index > 0 && index < list.size() - 1) {
- WizardFragment fragment = (WizardFragment) list.get(++index);
- try {
- fragment.enter();
- fragment.exit();
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Could not enter/exit page", e);
- }
- }
-
- if (useJob()) {
- class FinishWizardJob extends Job {
- public FinishWizardJob() {
- super(getJobTitle());
- }
-
- public IStatus run(IProgressMonitor monitor2) {
- try {
- Iterator iterator = list.iterator();
- while (iterator.hasNext())
- executeTask((WizardFragment) iterator.next(), FINISH, monitor2);
- } catch (CoreException ce) {
- Trace.trace(Trace.SEVERE, "Error finishing wizard job", ce);
- return new Status(IStatus.ERROR, ServerUIPlugin.PLUGIN_ID, 0, ce.getLocalizedMessage(), null);
- }
- return new Status(IStatus.OK, ServerUIPlugin.PLUGIN_ID, 0, "", null);
- }
- }
-
- FinishWizardJob job = new FinishWizardJob();
- job.setUser(true);
- job.schedule();
- } else {
- Iterator iterator = list.iterator();
- while (iterator.hasNext())
- executeTask((WizardFragment) iterator.next(), FINISH, monitor);
- }
- }
- };
-
- Throwable t = null;
- try {
- if (getContainer() != null)
- getContainer().run(true, true, new WorkspaceRunnableAdapter(runnable));
- else
- runnable.run(new NullProgressMonitor());
- return true;
- } catch (InvocationTargetException te) {
- Trace.trace(Trace.SEVERE, "Error finishing task wizard", te);
- t = te.getCause();
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error finishing task wizard 2", e);
- t = e;
- }
-
- // TODO: show better error dialog, e.g. when Tomcat config is corrupt while doing Add/Remove
- // it currently displays the error message twice
- if (t instanceof CoreException) {
- EclipseUtil.openError(t.getLocalizedMessage(), ((CoreException)t).getStatus());
- } else
- EclipseUtil.openError(t.getLocalizedMessage());
-
- return false;
- }
-
- public void addPage(IWizardPage page) {
- pages.add(page);
- page.setWizard(this);
- }
-
- protected void executeTask(WizardFragment fragment, byte type, IProgressMonitor monitor) throws CoreException {
- if (fragment == null)
- return;
-
- FragmentData data = getFragmentData(fragment);
- if (type == FINISH && data.finishTask != null)
- data.finishTask.execute(monitor);
- else if (type == CANCEL && data.cancelTask != null)
- data.cancelTask.execute(monitor);
- }
-
- protected WizardFragment getCurrentWizardFragment() {
- return currentFragment;
- }
-
- protected void switchWizardFragment(WizardFragment newFragment) {
- List list = getAllWizardFragments();
- int oldIndex = list.indexOf(currentFragment);
- int newIndex = list.indexOf(newFragment);
- if (oldIndex == newIndex)
- return;
-
- //safeExecuteTask(currentFragment, DEPARTURE);
- if (currentFragment != null)
- currentFragment.exit();
-
- if (oldIndex < newIndex)
- oldIndex ++;
- else
- oldIndex --;
-
- while (oldIndex != newIndex) {
- WizardFragment fragment = (WizardFragment) list.get(oldIndex);
- //safeExecuteTask(fragment, ARRIVAL);
- //safeExecuteTask(fragment, DEPARTURE);
- fragment.enter();
- fragment.exit();
- if (oldIndex < newIndex)
- oldIndex ++;
- else
- oldIndex --;
- }
-
- currentFragment = newFragment;
- //safeExecuteTask(currentFragment, ARRIVAL);
- currentFragment.enter();
- }
-
- private List getAllWizardFragments() {
- List list = new ArrayList();
- list.add(rootFragment);
- addSubWizardFragments(rootFragment, list);
-
- Iterator iterator = list.iterator();
- while (iterator.hasNext()) {
- WizardFragment fragment = (WizardFragment) iterator.next();
- if (!taskModel.equals(fragment.getTaskModel()))
- fragment.setTaskModel(taskModel);
- }
- return list;
- }
-
- private void addSubWizardFragments(WizardFragment fragment, List list) {
- Iterator iterator = fragment.getChildFragments().iterator();
- while (iterator.hasNext()) {
- WizardFragment child = (WizardFragment) iterator.next();
- list.add(child);
- addSubWizardFragments(child, list);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.wizard.IWizard#addPages()
- */
- public void addPages() {
- if (addingPages)
- return;
-
- try {
- addingPages = true;
- pages = new ArrayList();
- Iterator iterator = getAllWizardFragments().iterator();
- while (iterator.hasNext()) {
- WizardFragment fragment = (WizardFragment) iterator.next();
- FragmentData data = getFragmentData(fragment);
- if (fragment.hasComposite()) {
- if (data.page != null)
- addPage(data.page);
- else {
- TaskWizardPage page = new TaskWizardPage(fragment);
- data.page = page;
- addPage(page);
- }
- }
- }
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error adding fragments to wizard", e);
- } finally {
- addingPages = false;
- }
- }
-
- /*private static void updateWizardPages() {
- try {
- current.updatePages();
- current.getContainer().updateButtons();
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error updating wizard pages", e);
- }
- }*/
-
- private FragmentData getFragmentData(WizardFragment fragment) {
- try {
- FragmentData data = (FragmentData) fragmentData.get(fragment);
- if (data != null)
- return data;
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error getting fragment data", e);
- }
-
- FragmentData data = new FragmentData(fragment);
- fragmentData.put(fragment, data);
- return data;
- }
-
- protected void updatePages() {
- addPages();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.wizard.IWizard#canFinish()
- */
- public boolean canFinish() {
- // Default implementation is to check if all pages are complete.
- for (int i= 0; i < pages.size(); i++) {
- if (!((IWizardPage)pages.get(i)).isPageComplete())
- return false;
- }
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.wizard.IWizard#createPageControls(org.eclipse.swt.widgets.Composite)
- */
- public void createPageControls(Composite pageContainer) {
- // the default behavior is to create all the pages controls
- for (int i = 0; i < pages.size(); i++){
- IWizardPage page = (IWizardPage) pages.get(i);
- page.createControl(pageContainer);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.wizard.IWizard#dispose()
- */
- public void dispose() {
- // notify pages
- for (int i = 0; i < pages.size(); i++){
- ((IWizardPage)pages.get(i)).dispose();
- }
-
- // dispose of image
- if (defaultImage != null) {
- defaultImage.dispose();
- defaultImage = null;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.wizard.IWizard#getContainer()
- */
- public IWizardContainer getContainer() {
- return container;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.wizard.IWizard#getDefaultPageImage()
- */
- public Image getDefaultPageImage() {
- return defaultImage;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.wizard.IWizard#getDialogSettings()
- */
- public IDialogSettings getDialogSettings() {
- return dialogSettings;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.wizard.IWizard#getNextPage(org.eclipse.jface.wizard.IWizardPage)
- */
- public IWizardPage getNextPage(IWizardPage page) {
- int index = pages.indexOf(page);
- if (index == pages.size() - 1 || index == -1)
- // last page or page not found
- return null;
-
- return (IWizardPage)pages.get(index + 1);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.wizard.IWizard#getPage(java.lang.String)
- */
- public IWizardPage getPage(String name) {
- for (int i= 0; i < pages.size(); i++) {
- IWizardPage page = (IWizardPage)pages.get(i);
- String pageName = page.getName();
- if (pageName.equals(name))
- return page;
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.wizard.IWizard#getPageCount()
- */
- public int getPageCount() {
- return pages.size();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.wizard.IWizard#getPages()
- */
- public IWizardPage[] getPages() {
- return (IWizardPage[])pages.toArray(new IWizardPage[pages.size()]);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.wizard.IWizard#getPreviousPage(org.eclipse.jface.wizard.IWizardPage)
- */
- public IWizardPage getPreviousPage(IWizardPage page) {
- int index = pages.indexOf(page);
- if (index == 0 || index == -1)
- // first page or page not found
- return null;
- return (IWizardPage)pages.get(index - 1);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.wizard.IWizard#getStartingPage()
- */
- public IWizardPage getStartingPage() {
- if (pages.size() == 0)
- return null;
-
- return (IWizardPage) pages.get(0);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.wizard.IWizard#getTitleBarColor()
- */
- public RGB getTitleBarColor() {
- return titleBarColor;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.wizard.IWizard#getWindowTitle()
- */
- public String getWindowTitle() {
- return windowTitle;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.wizard.IWizard#isHelpAvailable()
- */
- public boolean isHelpAvailable() {
- return isHelpAvailable;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.wizard.IWizard#needsPreviousAndNextButtons()
- */
- public boolean needsPreviousAndNextButtons() {
- return forcePreviousAndNextButtons || pages.size() > 1;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.wizard.IWizard#needsProgressMonitor()
- */
- public boolean needsProgressMonitor() {
- return needsProgressMonitor;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.wizard.IWizard#setContainer(org.eclipse.jface.wizard.IWizardContainer)
- */
- public void setContainer(IWizardContainer wizardContainer) {
- this.container = wizardContainer;
- }
-
- public void setDialogSettings(IDialogSettings settings) {
- dialogSettings = settings;
- }
-
- public void setNeedsProgressMonitor(boolean b) {
- needsProgressMonitor = b;
- }
-
- public void setForcePreviousAndNextButtons(boolean b) {
- forcePreviousAndNextButtons = b;
- }
-
- public void setWindowTitle(String title) {
- windowTitle = title;
- }
-
- protected boolean useJob() {
- return false;
- }
-
- protected String getJobTitle() {
- return getWindowTitle();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/wizard/TaskWizardPage.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/wizard/TaskWizardPage.java
deleted file mode 100644
index c4b5d61..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/wizard/TaskWizardPage.java
+++ /dev/null
@@ -1,95 +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.wizard;
-
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-/**
- *
- *
- * @since 1.0
- */
-class TaskWizardPage extends WizardPage implements IWizardHandle {
- protected WizardFragment fragment;
-
- protected boolean isEmptyError = false;
-
- public TaskWizardPage(WizardFragment fragment) {
- super(fragment.toString());
- this.fragment = fragment;
- }
-
- public void createControl(Composite parentComp) {
- Composite comp = fragment.createComposite(parentComp, this);
- GridData data = new GridData(GridData.FILL_BOTH);
- data.widthHint = convertHorizontalDLUsToPixels(350);
- //data.heightHint = convertVerticalDLUsToPixels(350);
- comp.setLayoutData(data);
- setControl(comp);
- }
-
- public boolean isPageComplete() {
- if (!fragment.isComplete())
- return false;
- if (isEmptyError)
- return false;
- return (getMessage() == null || getMessageType() != ERROR);
- }
-
- public boolean canFlipToNextPage() {
- if (getNextPage() == null)
- return false;
- if (isEmptyError)
- return false;
- return (getMessage() == null || getMessageType() != ERROR);
- }
-
- public void setVisible(boolean visible) {
- super.setVisible(visible);
-
- if (visible) {
- TaskWizard wizard = (TaskWizard) getWizard();
- wizard.switchWizardFragment(fragment);
-
- if (getContainer().getCurrentPage() != null)
- getContainer().updateButtons();
- }
- }
-
- public void setMessage(String message, int type) {
- if (type == IMessageProvider.ERROR && "".equals(message)) {
- isEmptyError = true;
- message = null;
- } else
- isEmptyError = false;
- super.setMessage(message, type);
- WizardFragment frag = ((TaskWizard) getWizard()).getCurrentWizardFragment();
- if (!fragment.equals(frag))
- return;
- getContainer().updateButtons();
- }
-
- public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws InterruptedException, InvocationTargetException {
- getWizard().getContainer().run(fork, cancelable, runnable);
- }
-
- public void update() {
- fragment.updateChildFragments();
- ((TaskWizard) getWizard()).updatePages();
- if (getContainer().getCurrentPage() != null)
- getContainer().updateButtons();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/wizard/WizardFragment.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/wizard/WizardFragment.java
deleted file mode 100644
index 80f9dda..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/wizard/WizardFragment.java
+++ /dev/null
@@ -1,150 +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.wizard;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.swt.widgets.Composite;
-
-import org.eclipse.wst.server.core.ITask;
-import org.eclipse.wst.server.core.TaskModel;
-/**
- * A wizard fragment is a
- *
- * @since 1.0
- */
-public abstract class WizardFragment {
- private TaskModel taskModel;
- private boolean isComplete = true;
- private List listImpl;
-
- /**
- * Returns <code>true</code> if this fragment has an associated UI,
- * and <code>false</code> otherwise.
- *
- * @return true if the fragment has a composite
- */
- public boolean hasComposite() {
- return false;
- }
-
- /**
- * Creates the composite associated with this fragment.
- * This method is only called when hasComposite() returns true.
- *
- * @param parent
- * @param handle
- * @return the created composite
- */
- public Composite createComposite(Composite parent, IWizardHandle handle) {
- return null;
- }
-
- /**
- * Sets the wizard task model. The task model is shared by all fragments
- * in the wizard and is used to share data.
- *
- * @param taskModel the task model
- */
- public void setTaskModel(TaskModel taskModel) {
- this.taskModel = taskModel;
- }
-
- /**
- * Returns the wizard task model.
- *
- * @return the task model
- */
- public TaskModel getTaskModel() {
- return taskModel;
- }
-
- /**
- * The fragment has been entered.
- */
- public void enter() {
- // do nothing
- }
-
- /**
- * The fragment has been left.
- */
- public void exit() {
- // do nothing
- }
-
- /**
- * Create a task to run when the wizard finishes.
- *
- * @return the task
- */
- public ITask createFinishTask() {
- return null;
- }
-
- /**
- * Create a task to run when the wizard is cancelled.
- *
- * @return the task
- */
- public ITask createCancelTask() {
- return null;
- }
-
- /**
- * Returns the child fragments. Child fragments come directly after this fragment
- * in the wizard flow.
- *
- * @return a list of child fragments
- */
- public List getChildFragments() {
- if (listImpl == null) {
- listImpl = new ArrayList();
- createChildFragments(listImpl);
- }
- return listImpl;
- }
-
- /**
- * Gives the fragment a chance to update it's child fragments.
- */
- protected void updateChildFragments() {
- listImpl = null;
- }
-
- /**
- * Called to allow the fragment to update it's children.
- *
- * @param list
- */
- protected void createChildFragments(List list) {
- // do nothing
- }
-
- /**
- * Returns true if this fragment is complete (can finish).
- *
- * @return true if the fragment is complete
- */
- public boolean isComplete() {
- return isComplete;
- }
-
- /**
- * Set the isComplete state.
- *
- * @param complete
- */
- protected void setComplete(boolean complete) {
- this.isComplete = complete;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/wizard/package.xml b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/wizard/package.xml
deleted file mode 100644
index 8443da8..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/wizard/package.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<html>
-<head>
- <!-- Escape to the root of your source folder -->
- <meta
- name="root"
- content="../../../../../../" />
- <title>WTP API overview</title>
-</head>
-
-<body>
-
-<p>Wizard and task support for the server tools UI.</p>
-
-<p>WizardFragment is extended to provide a subtree of wizard pages or tasks
-that can be inserted into a larger wizard flow. TaskWizard is the standard
-wizard that knows how to handle WizardFragments and display them in order
-within a single wizard. It uses the TaskWizardPages to display the wizard
-fragment's composites within the wizard.</p>
-
-</body>
-</html>
\ No newline at end of file