Good-bye, IServerConfigurations!
diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/j2ee/EJBBean.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/j2ee/EJBBean.java
index 37533bf..e16c54e 100644
--- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/j2ee/EJBBean.java
+++ b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/j2ee/EJBBean.java
@@ -11,9 +11,9 @@
package org.eclipse.jst.server.j2ee;
import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IModuleObject;
+import org.eclipse.wst.server.core.IModuleArtifact;
-public class EJBBean implements IModuleObject {
+public class EJBBean implements IModuleArtifact {
public static final String ID = "org.eclipse.jst.server.j2ee.ejb";
private IModule module;
@@ -39,14 +39,14 @@
}
/*
- * @see IModuleObject#getId()
+ * @see IModuleArtifact#getId()
*/
public String getId() {
return ID;
}
/*
- * @see IModuleObject#getModule()
+ * @see IModuleArtifact#getModule()
*/
public IModule getModule() {
return module;
diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/j2ee/JndiLaunchable.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/j2ee/JndiLaunchable.java
index 3cf615f..a2e9313 100644
--- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/j2ee/JndiLaunchable.java
+++ b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/j2ee/JndiLaunchable.java
@@ -1,6 +1,6 @@
/**********************************************************************
- * Copyright (c) 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
+ * 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 Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/j2ee/JndiObject.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/j2ee/JndiObject.java
index 2add0fa..16b6d0e 100644
--- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/j2ee/JndiObject.java
+++ b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/j2ee/JndiObject.java
@@ -11,11 +11,11 @@
package org.eclipse.jst.server.j2ee;
import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IModuleObject;
+import org.eclipse.wst.server.core.IModuleArtifact;
/**
*
*/
-public class JndiObject implements IModuleObject {
+public class JndiObject implements IModuleArtifact {
public static final String ID = "org.eclipse.jst.server.j2ee.jndi";
private IModule module;
diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/j2ee/Servlet.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/j2ee/Servlet.java
index c61e079..c2a1ed2 100644
--- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/j2ee/Servlet.java
+++ b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/j2ee/Servlet.java
@@ -11,11 +11,11 @@
package org.eclipse.jst.server.j2ee;
import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IModuleObject;
+import org.eclipse.wst.server.core.IModuleArtifact;
/**
*
*/
-public class Servlet implements IModuleObject {
+public class Servlet implements IModuleArtifact {
public static final String ID = "org.eclipse.jst.server.j2ee.servlet";
private IModule module;
diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/j2ee/WebResource.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/j2ee/WebResource.java
index 8f16cbd..7e6e3f9 100644
--- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/j2ee/WebResource.java
+++ b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/j2ee/WebResource.java
@@ -13,11 +13,11 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IModuleObject;
+import org.eclipse.wst.server.core.IModuleArtifact;
/**
*
*/
-public class WebResource implements IModuleObject {
+public class WebResource implements IModuleArtifact {
public static final String ID = "org.eclipse.jst.server.j2ee.webresource";
private IModule module;
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/plugin.xml b/plugins/org.eclipse.jst.server.tomcat.core/plugin.xml
index 51a6c5b..c330f72 100644
--- a/plugins/org.eclipse.jst.server.tomcat.core/plugin.xml
+++ b/plugins/org.eclipse.jst.server.tomcat.core/plugin.xml
@@ -118,7 +118,7 @@
startTimeout="45000"
stopTimeout="15000"
initialState="stopped"
- configurationTypeId="org.eclipse.jst.server.tomcat.32"
+ 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"
@@ -134,7 +134,7 @@
startTimeout="45000"
stopTimeout="15000"
initialState="stopped"
- configurationTypeId="org.eclipse.jst.server.tomcat.40"
+ 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"
@@ -150,7 +150,7 @@
startTimeout="45000"
stopTimeout="15000"
initialState="stopped"
- configurationTypeId="org.eclipse.jst.server.tomcat.41"
+ 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"
@@ -166,7 +166,7 @@
startTimeout="45000"
stopTimeout="15000"
initialState="stopped"
- configurationTypeId="org.eclipse.jst.server.tomcat.50"
+ 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"
@@ -182,15 +182,15 @@
startTimeout="45000"
stopTimeout="15000"
initialState="stopped"
- configurationTypeId="org.eclipse.jst.server.tomcat.55"
+ 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>
- <extension point="org.eclipse.wst.server.core.serverLocators">
+ <extension point="org.eclipse.wst.server.core.serverLocators">
<serverLocator
id="org.eclipse.jst.server.tomcat.server.locator"
name="%serverLocatorLabel"
@@ -200,57 +200,19 @@
class="org.eclipse.jst.server.tomcat.core.internal.TomcatServerLocator"/>
</extension>
- <extension point="org.eclipse.wst.server.core.serverConfigurationTypes">
- <serverConfigurationType
- id="org.eclipse.jst.server.tomcat.32"
- name="%tomcat32ConfigurationType"
- description="%tomcat32ConfigurationDescription"
- isFolder="true"
- class="org.eclipse.jst.server.tomcat.core.internal.Tomcat32Configuration">
- </serverConfigurationType>
- <serverConfigurationType
- id="org.eclipse.jst.server.tomcat.40"
- name="%tomcat40ConfigurationType"
- description="%tomcat40ConfigurationDescription"
- isFolder="true"
- class="org.eclipse.jst.server.tomcat.core.internal.Tomcat40Configuration">
- </serverConfigurationType>
- <serverConfigurationType
- id="org.eclipse.jst.server.tomcat.41"
- name="%tomcat41ConfigurationType"
- description="%tomcat41ConfigurationDescription"
- isFolder="true"
- class="org.eclipse.jst.server.tomcat.core.internal.Tomcat41Configuration">
- </serverConfigurationType>
- <serverConfigurationType
- id="org.eclipse.jst.server.tomcat.50"
- name="%tomcat50ConfigurationType"
- description="%tomcat50ConfigurationDescription"
- isFolder="true"
- class="org.eclipse.jst.server.tomcat.core.internal.Tomcat50Configuration">
- </serverConfigurationType>
- <serverConfigurationType
- id="org.eclipse.jst.server.tomcat.55"
- name="%tomcat55ConfigurationType"
- description="%tomcat55ConfigurationDescription"
- isFolder="true"
- class="org.eclipse.jst.server.tomcat.core.internal.Tomcat55Configuration">
- </serverConfigurationType>
- </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.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">
+ <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>
- <extension point="org.eclipse.debug.core.launchConfigurationTypes">
+ <extension point="org.eclipse.debug.core.launchConfigurationTypes">
<launchConfigurationType
id="org.eclipse.jst.server.tomcat.core.launchConfigurationType"
name="%tomcatLaunchConfigurationType"
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/ITomcatServer.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/ITomcatServer.java
index fa18f84..66352ca 100644
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/ITomcatServer.java
+++ b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/ITomcatServer.java
@@ -49,4 +49,11 @@
* @return
*/
public String getRuntimeClass();
+
+ /**
+ * Return the Tomcat configuration model.
+ *
+ * @return
+ */
+ public ITomcatConfiguration getServerConfiguration();
}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/ITomcatServerBehaviour.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/ITomcatServerBehaviour.java
index 2320590..4c51a08 100644
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/ITomcatServerBehaviour.java
+++ b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/ITomcatServerBehaviour.java
@@ -14,12 +14,10 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.model.IProcess;
-
-import org.eclipse.wst.server.core.model.IURLProvider;
/**
*
*/
-public interface ITomcatServerBehaviour extends IURLProvider {
+public interface ITomcatServerBehaviour {
/**
* Returns the main class that is used to launch the Tomcat server.
*
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
index 209988b..20eb5b2 100644
--- 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
@@ -31,7 +31,6 @@
import org.xml.sax.InputSource;
import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.IServerConfigurationWorkingCopy;
import org.eclipse.wst.server.core.IServerPort;
import org.eclipse.wst.server.core.util.ServerPort;
/**
@@ -57,8 +56,8 @@
/**
* Tomcat32Configuration constructor comment.
*/
- public Tomcat32Configuration() {
- super();
+ public Tomcat32Configuration(IPath path) {
+ super(path);
}
/**
@@ -495,7 +494,7 @@
monitor = ProgressUtil.getMonitorFor(monitor);
monitor.beginTask(TomcatPlugin.getResource("%updatingConfigurationTask"), 100);
- Tomcat32Configuration config = new Tomcat32Configuration();
+ Tomcat32Configuration config = new Tomcat32Configuration(path);
config.load(path, ProgressUtil.getSubMonitorFor(monitor, 30));
if (monitor.isCanceled())
@@ -505,9 +504,9 @@
config.server.getContextManager().setHome(runtime.getLocation().toOSString());
config.isServerDirty = true;
} else {
- IServerConfigurationWorkingCopy scwc = config.getServerConfiguration().createWorkingCopy();
- Tomcat32Configuration cfg = (Tomcat32Configuration) scwc.getAdapter(Tomcat32Configuration.class);
- cfg.localizeWebModules();
+ //IServerConfigurationWorkingCopy scwc = config.getServerConfiguration().createWorkingCopy();
+ //Tomcat32Configuration cfg = (Tomcat32Configuration) scwc.getAdapter(Tomcat32Configuration.class);
+ config.localizeWebModules();
}
monitor.worked(40);
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
index d27895c..824d2d2 100644
--- 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
@@ -34,7 +34,6 @@
import org.w3c.dom.Element;
import org.xml.sax.InputSource;
-import org.eclipse.wst.server.core.IServerConfigurationWorkingCopy;
import org.eclipse.wst.server.core.IServerPort;
import org.eclipse.wst.server.core.util.ServerPort;
/**
@@ -61,8 +60,8 @@
/**
* Tomcat40Configuration constructor comment.
*/
- public Tomcat40Configuration() {
- super();
+ public Tomcat40Configuration(IPath path) {
+ super(path);
}
/**
@@ -490,16 +489,16 @@
monitor = ProgressUtil.getMonitorFor(monitor);
monitor.beginTask(TomcatPlugin.getResource("%updatingConfigurationTask"), 100);
- Tomcat40Configuration config = new Tomcat40Configuration();
+ Tomcat40Configuration config = new Tomcat40Configuration(path);
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);
- cfg.localizeWebModules();
+ //IServerConfigurationWorkingCopy scwc = config.getServerConfiguration().createWorkingCopy();
+ //Tomcat40Configuration cfg = (Tomcat40Configuration) scwc.getAdapter(Tomcat40Configuration.class);
+ config.localizeWebModules();
}
monitor.worked(20);
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
index 5360319..b14caed 100644
--- 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
@@ -34,7 +34,6 @@
import org.w3c.dom.Element;
import org.xml.sax.InputSource;
-import org.eclipse.wst.server.core.IServerConfigurationWorkingCopy;
import org.eclipse.wst.server.core.IServerPort;
import org.eclipse.wst.server.core.util.ServerPort;
/**
@@ -62,8 +61,8 @@
/**
* Tomcat41Configuration constructor comment.
*/
- public Tomcat41Configuration() {
- super();
+ public Tomcat41Configuration(IPath path) {
+ super(path);
}
/**
@@ -507,16 +506,16 @@
monitor = ProgressUtil.getMonitorFor(monitor);
monitor.beginTask(TomcatPlugin.getResource("%updatingConfigurationTask"), 100);
- Tomcat41Configuration config = new Tomcat41Configuration();
+ Tomcat41Configuration config = new Tomcat41Configuration(path);
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);
- cfg.localizeWebModules();
+ //IServerConfigurationWorkingCopy scwc = config.getServerConfiguration().createWorkingCopy();
+ //Tomcat41Configuration cfg = (Tomcat41Configuration) scwc.getAdapter(Tomcat41Configuration.class);
+ config.localizeWebModules();
}
monitor.worked(20);
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
index d35970b..1fea1d0 100644
--- 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
@@ -27,7 +27,6 @@
import org.w3c.dom.Document;
import org.xml.sax.InputSource;
-import org.eclipse.wst.server.core.IServerConfigurationWorkingCopy;
import org.eclipse.wst.server.core.IServerPort;
import org.eclipse.wst.server.core.util.ServerPort;
/**
@@ -49,8 +48,8 @@
/**
* Tomcat50Configuration constructor comment.
*/
- public Tomcat50Configuration() {
- super();
+ public Tomcat50Configuration(IPath path) {
+ super(path);
}
/**
@@ -487,16 +486,16 @@
monitor = ProgressUtil.getMonitorFor(monitor);
monitor.beginTask(TomcatPlugin.getResource("%updatingConfigurationTask"), 100);
- Tomcat50Configuration config = new Tomcat50Configuration();
+ Tomcat50Configuration config = new Tomcat50Configuration(path);
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);
- cfg.localizeWebModules();
+ //IServerConfigurationWorkingCopy scwc = config.getServerConfiguration().createWorkingCopy();
+ //Tomcat50Configuration cfg = (Tomcat50Configuration) scwc.getAdapter(Tomcat50Configuration.class);
+ config.localizeWebModules();
}
monitor.worked(20);
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
index 00ee0d7..dc367bf 100644
--- 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
@@ -27,7 +27,6 @@
import org.w3c.dom.Document;
import org.xml.sax.InputSource;
-import org.eclipse.wst.server.core.IServerConfigurationWorkingCopy;
import org.eclipse.wst.server.core.IServerPort;
import org.eclipse.wst.server.core.util.ServerPort;
/**
@@ -49,8 +48,8 @@
/**
* Tomcat55Configuration constructor comment.
*/
- public Tomcat55Configuration() {
- super();
+ public Tomcat55Configuration(IPath path) {
+ super(path);
}
/**
@@ -487,16 +486,16 @@
monitor = ProgressUtil.getMonitorFor(monitor);
monitor.beginTask(TomcatPlugin.getResource("%updatingConfigurationTask"), 100);
- Tomcat55Configuration config = new Tomcat55Configuration();
+ Tomcat55Configuration config = new Tomcat55Configuration(path);
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);
- cfg.localizeWebModules();
+ //IServerConfigurationWorkingCopy scwc = config.getServerConfiguration().createWorkingCopy();
+ //Tomcat55Configuration cfg = (Tomcat55Configuration) scwc.getAdapter(Tomcat55Configuration.class);
+ config.localizeWebModules();
}
monitor.worked(20);
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
index d369255..f34da65 100644
--- 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
@@ -10,8 +10,12 @@
**********************************************************************/
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;
@@ -20,18 +24,18 @@
import org.eclipse.core.runtime.*;
import org.eclipse.jst.server.j2ee.IWebModule;
import org.eclipse.jst.server.tomcat.core.ITomcatConfiguration;
+import org.eclipse.jst.server.tomcat.core.ITomcatConfigurationWorkingCopy;
+import org.eclipse.jst.server.tomcat.core.ITomcatWebModule;
import org.eclipse.jst.server.tomcat.core.WebModule;
import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.IServerConfiguration;
import org.eclipse.wst.server.core.IServerPort;
-import org.eclipse.wst.server.core.model.ServerConfigurationDelegate;
+import org.eclipse.wst.server.core.internal.Trace;
import org.eclipse.wst.server.core.util.FileUtil;
/**
* Generic Tomcat server configuration.
*/
-public abstract class TomcatConfiguration extends ServerConfigurationDelegate implements ITomcatConfiguration {
+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";
@@ -42,12 +46,27 @@
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 IPath configPath;
+
+ // property change listeners
+ private transient List propertyListeners;
/**
* TomcatConfiguration constructor comment.
*/
- public TomcatConfiguration() {
+ public TomcatConfiguration(IPath path) {
super();
+ this.configPath = path;
+ /*try {
+ load(configPath, new NullProgressMonitor());
+ } catch (Exception e) {
+ // ignore
+ }*/
+ }
+
+ protected IPath getPath() {
+ return configPath;
}
/**
@@ -74,14 +93,14 @@
confDir = confDir.append("conf");
- IServerConfiguration config = getServerConfiguration();
+ /*IServerConfiguration config = getServerConfiguration();
IFolder folder = config.getConfigurationDataFolder();
if (folder != null)
backupFolder(folder, confDir, backup, ms, monitor);
else {
- IPath path = config.getConfigurationDataPath();
- backupPath(path, confDir, backup, ms, monitor);
- }
+ IPath path = config.getConfigurationDataPath();*/
+ backupPath(configPath, confDir, backup, ms, monitor);
+ //}
} catch (Exception e) {
Trace.trace("backupAndPublish() error", e);
@@ -237,16 +256,61 @@
protected abstract void save(IPath path, boolean forceSave, IProgressMonitor monitor) throws CoreException;
protected void firePropertyChangeEvent(String propertyName, Object oldValue, Object newValue) {
- getServerConfiguration().createWorkingCopy().firePropertyChangeEvent(propertyName, oldValue, newValue);
- }
+ if (propertyListeners == null)
+ return;
- public void importFromPath(IPath path, IProgressMonitor monitor) throws CoreException {
+ 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("Error firing property change event", e);
+ }
+ }
+ } catch (Exception e) {
+ Trace.trace("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);
- }
+ }*/
+
+ public abstract void load(IPath path, IProgressMonitor monitor) throws CoreException;
+
+ //public 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.
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
index 9abaa1c..2044ff2 100644
--- 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
@@ -1,7 +1,6 @@
-package org.eclipse.jst.server.tomcat.core.internal;
/**********************************************************************
- * Copyright (c) 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
+ * 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 Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
@@ -9,6 +8,8 @@
* Contributors:
* IBM - Initial API and implementation
**********************************************************************/
+package org.eclipse.jst.server.tomcat.core.internal;
+
import java.io.File;
import java.util.Map;
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
index 74375ac..4d6edf5 100644
--- 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
@@ -16,7 +16,7 @@
import org.eclipse.jst.server.j2ee.Servlet;
import org.eclipse.jst.server.j2ee.WebResource;
import org.eclipse.wst.server.core.ILaunchable;
-import org.eclipse.wst.server.core.IModuleObject;
+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;
@@ -25,9 +25,9 @@
*/
public class TomcatLaunchableAdapterDelegate extends LaunchableAdapterDelegate {
/*
- * @see LaunchableAdapterDelegate#getLaunchable(IServer, IModuleObject)
+ * @see LaunchableAdapterDelegate#getLaunchable(IServer, IModuleArtifact)
*/
- public ILaunchable getLaunchable(IServer server, IModuleObject moduleObject) {
+ public ILaunchable getLaunchable(IServer server, IModuleArtifact moduleObject) {
Trace.trace("TomcatLaunchableAdapter " + server + "-" + moduleObject);
if (server.getAdapter(TomcatServer.class) == null)
return null;
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
index a286110..969fa73 100644
--- 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
@@ -13,6 +13,7 @@
import java.io.File;
import java.io.FileFilter;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
@@ -35,12 +36,21 @@
/* (non-Javadoc)
* @see org.eclipse.wst.server.core.model.IRuntimeFactoryDelegate#getKnownRuntimes()
*/
- public void searchForRuntimes(IRuntimeLocator.Listener listener, IProgressMonitor monitor) {
- searchForRuntimes2(listener, monitor);
+ public void searchForRuntimes(IPath path, IRuntimeLocator.RuntimeSearchListener listener, IProgressMonitor monitor) {
+ searchForRuntimes2(path, listener, monitor);
}
- protected static void searchForRuntimes2(IRuntimeLocator.Listener listener, IProgressMonitor monitor) {
- File[] files = File.listRoots();
+ protected static void searchForRuntimes2(IPath path, IRuntimeLocator.RuntimeSearchListener 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;
@@ -57,7 +67,7 @@
monitor.worked(100);
}
- protected static void searchDir(IRuntimeLocator.Listener listener, File dir, int depth, IProgressMonitor monitor) {
+ protected static void searchDir(IRuntimeLocator.RuntimeSearchListener listener, File dir, int depth, IProgressMonitor monitor) {
if ("conf".equals(dir.getName())) {
IRuntimeWorkingCopy runtime = getRuntimeFromDir(dir.getParentFile(), monitor);
if (runtime != null) {
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
index 6d419c3..19b2c5a 100644
--- 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
@@ -24,7 +24,6 @@
import org.eclipse.jdt.launching.JavaRuntime;
import org.eclipse.jst.server.j2ee.IWebModule;
import org.eclipse.jst.server.tomcat.core.ITomcatConfiguration;
-import org.eclipse.jst.server.tomcat.core.ITomcatConfigurationWorkingCopy;
import org.eclipse.jst.server.tomcat.core.ITomcatRuntime;
import org.eclipse.jst.server.tomcat.core.ITomcatServer;
import org.eclipse.jst.server.tomcat.core.ITomcatServerWorkingCopy;
@@ -43,6 +42,8 @@
protected transient PingThread ping = null;
protected transient IProcess process;
protected transient IDebugEventSetListener processListener;
+
+ protected transient TomcatConfiguration configuration;
/**
* TomcatServer.
@@ -57,20 +58,69 @@
return (TomcatRuntime) getServer().getAdapter(TomcatRuntime.class);
}
-
+
public ITomcatVersionHandler getTomcatVersionHandler() {
if (getServer().getRuntime() == null)
return null;
return getTomcatRuntime().getVersionHandler();
}
-
+
+ public ITomcatConfiguration getServerConfiguration() {
+ return getTomcatConfiguration();
+ }
+
public TomcatConfiguration getTomcatConfiguration() {
- IServerConfiguration configuration = getServer().getServerConfiguration();
- if (configuration == null)
- return null;
+ if (configuration == null) {
+ //IPath path = getServer().getServerConfiguration();
+ //if (path == null)
+ IPath path = null;
+ if (getServerWC() != null && getServerWC().getRuntime() != null)
+ path = getServerWC().getRuntime().getLocation().append("conf");
+ else if (getServer() != null && getServer().getRuntime() != null)
+ path = getServer().getRuntime().getLocation().append("conf");
+ else
+ return null;
+
+ String id = getServer().getServerType().getId();
+ if (id.indexOf("32") > 0)
+ configuration = new Tomcat32Configuration(path);
+ else if (id.indexOf("40") > 0)
+ configuration = new Tomcat40Configuration(path);
+ else if (id.indexOf("41") > 0)
+ configuration = new Tomcat41Configuration(path);
+ else if (id.indexOf("50") > 0)
+ configuration = new Tomcat50Configuration(path);
+ else if (id.indexOf("55") > 0)
+ configuration = new Tomcat55Configuration(path);
+ try {
+ configuration.load(path, null);
+ } catch (CoreException ce) {
+ // ignore
+ }
+ }
+ return configuration;
+ }
+
+ public void importConfiguration(IRuntime runtime, IProgressMonitor monitor) {
+ IPath path = runtime.getLocation().append("conf");
- return (TomcatConfiguration) configuration.getAdapter(TomcatConfiguration.class);
+ String id = getServer().getServerType().getId();
+ if (id.indexOf("32") > 0)
+ configuration = new Tomcat32Configuration(path);
+ else if (id.indexOf("40") > 0)
+ configuration = new Tomcat40Configuration(path);
+ else if (id.indexOf("41") > 0)
+ configuration = new Tomcat41Configuration(path);
+ else if (id.indexOf("50") > 0)
+ configuration = new Tomcat50Configuration(path);
+ else if (id.indexOf("55") > 0)
+ configuration = new Tomcat55Configuration(path);
+ try {
+ configuration.load(path, monitor);
+ } catch (CoreException ce) {
+ // ignore
+ }
}
/**
@@ -83,11 +133,11 @@
if (module == null || !(module instanceof IWebModule))
return null;
- IServerConfiguration serverConfig = getServer().getServerConfiguration();
+ IPath serverConfig = getServer().getServerConfiguration();
if (serverConfig == null)
return null;
- TomcatConfiguration config = (TomcatConfiguration) serverConfig.getAdapter(TomcatConfiguration.class);
+ TomcatConfiguration config = getTomcatConfiguration();
if (config == null)
return null;
@@ -415,10 +465,7 @@
if (status == null || !status.isOK())
throw new CoreException(status);
- IServerConfigurationWorkingCopy scwc = getServer().getServerConfiguration().createWorkingCopy();
- // TODO
- ITomcatConfigurationWorkingCopy wc = (ITomcatConfigurationWorkingCopy) scwc.getAdapter(ITomcatConfigurationWorkingCopy.class);
- boolean change = false;
+ TomcatConfiguration config = getTomcatConfiguration();
if (add != null) {
int size = add.length;
@@ -430,8 +477,7 @@
contextRoot = "/" + contextRoot;
WebModule module2 = new WebModule(contextRoot,
module.getLocation().toOSString(), module3.getId(), true);
- wc.addWebModule(-1, module2);
- change = true;
+ config.addWebModule(-1, module2);
}
}
@@ -444,14 +490,11 @@
int size = modules.size();
for (int i = 0; i < size; i++) {
WebModule module = (WebModule) modules.get(i);
- if (memento.equals(module.getMemento())) {
- wc.removeWebModule(i);
- change = true;
- }
+ if (memento.equals(module.getMemento()))
+ config.removeWebModule(i);
}
}
}
- if (change)
- scwc.save(false, monitor);
+ config.save(config.getPath(), true, 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
index 0eec0f9..5ac0aba 100644
--- 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
@@ -11,7 +11,6 @@
package org.eclipse.jst.server.tomcat.core.internal;
import java.io.File;
-import java.net.URL;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
@@ -51,12 +50,16 @@
public TomcatServerBehaviour() {
super();
}
+
+ public void initialize() {
+ setMode(ILaunchManager.RUN_MODE);
+ }
public TomcatRuntime getTomcatRuntime() {
if (getServer().getRuntime() == null)
return null;
- return (TomcatRuntime) getServer().getAdapter(TomcatRuntime.class);
+ return (TomcatRuntime) getServer().getRuntime().getAdapter(TomcatRuntime.class);
}
public ITomcatVersionHandler getTomcatVersionHandler() {
@@ -67,51 +70,11 @@
}
public TomcatConfiguration getTomcatConfiguration() {
- IServerConfiguration configuration = getServer().getServerConfiguration();
- if (configuration == null)
- return null;
-
- return (TomcatConfiguration) configuration.getAdapter(TomcatConfiguration.class);
+ return getTomcatServer().getTomcatConfiguration();
}
-
+
public TomcatServer getTomcatServer() {
- return null; // TODO
- }
-
- /**
- * 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 || !(module instanceof IWebModule))
- return null;
-
- IServerConfiguration serverConfig = getServer().getServerConfiguration();
- if (serverConfig == null)
- return null;
-
- TomcatConfiguration config = (TomcatConfiguration) serverConfig.getAdapter(TomcatConfiguration.class);
- if (config == null)
- return null;
-
- String url = "http://localhost";
- int port = config.getMainPort().getPort();
- port = ServerCore.getServerMonitorManager().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("Could not get root URL", e);
- return null;
- }
+ return (TomcatServer) getServer().getAdapter(TomcatServer.class);
}
/**
@@ -267,7 +230,7 @@
int port = configuration.getMainPort().getPort();
if (port != 80)
url += ":" + port;
- ping = new PingThread(getServer(), this, url);
+ ping = new PingThread(getServer(), this, url, 50);
} catch (Exception e) {
Trace.trace(Trace.SEVERE, "Can't ping for Tomcat startup.");
}
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
index ef50fc3..da7571d 100644
--- 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
@@ -19,7 +19,7 @@
*/
public class TomcatServerLocator extends ServerLocatorDelegate {
public void searchForServers(String host, final IServerLocator.Listener listener, final IProgressMonitor monitor) {
- IRuntimeLocator.Listener listener2 = new IRuntimeLocator.Listener() {
+ IRuntimeLocator.RuntimeSearchListener listener2 = new IRuntimeLocator.RuntimeSearchListener() {
public void runtimeFound(IRuntimeWorkingCopy runtime) {
String runtimeTypeId = runtime.getRuntimeType().getId();
String serverTypeId = runtimeTypeId.substring(0, runtimeTypeId.length() - 8);
@@ -32,6 +32,6 @@
}
}
};
- TomcatRuntimeLocator.searchForRuntimes2(listener2, monitor);
+ 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/command/RemoveWebModuleTask.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/command/RemoveWebModuleTask.java
index 3923168..ae93c8d 100644
--- 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
@@ -12,13 +12,12 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jst.server.tomcat.core.ITomcatConfiguration;
-import org.eclipse.jst.server.tomcat.core.ITomcatConfigurationWorkingCopy;
import org.eclipse.jst.server.tomcat.core.WebModule;
+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.wst.server.core.IServerConfiguration;
-import org.eclipse.wst.server.core.IServerConfigurationWorkingCopy;
+import org.eclipse.wst.server.core.IServerWorkingCopy;
import org.eclipse.wst.server.core.ITaskModel;
import org.eclipse.wst.server.core.util.Task;
/**
@@ -41,8 +40,9 @@
* @return boolean
*/
public void execute(IProgressMonitor monitor) throws CoreException {
- IServerConfigurationWorkingCopy wc = (IServerConfigurationWorkingCopy) getTaskModel().getObject(ITaskModel.TASK_SERVER_CONFIGURATION);
- ITomcatConfigurationWorkingCopy configuration = (ITomcatConfigurationWorkingCopy) wc.getAdapter(ITomcatConfigurationWorkingCopy.class);
+ IServerWorkingCopy wc = (IServerWorkingCopy) getTaskModel().getObject(ITaskModel.TASK_SERVER);
+ TomcatServer server = (TomcatServer) wc.getAdapter(TomcatServer.class);
+ TomcatConfiguration configuration = server.getTomcatConfiguration();
module = (WebModule) configuration.getWebModules().get(index);
configuration.removeWebModule(index);
}
@@ -53,8 +53,9 @@
*/
public String getDescription() {
if (module == null) {
- IServerConfiguration config = (IServerConfiguration) getTaskModel().getObject(ITaskModel.TASK_SERVER_CONFIGURATION);
- ITomcatConfiguration configuration = (ITomcatConfiguration) config.getAdapter(ITomcatConfiguration.class);
+ IServerWorkingCopy wc = (IServerWorkingCopy) getTaskModel().getObject(ITaskModel.TASK_SERVER);
+ TomcatServer server = (TomcatServer) wc.getAdapter(TomcatServer.class);
+ TomcatConfiguration configuration = server.getTomcatConfiguration();
module = (WebModule) configuration.getWebModules().get(index);
}
return TomcatPlugin.getResource("%configurationEditorActionRemoveWebModuleDescription", module.getPath());
@@ -73,8 +74,9 @@
*/
public void undo() {
try {
- IServerConfigurationWorkingCopy wc = (IServerConfigurationWorkingCopy) getTaskModel().getObject(ITaskModel.TASK_SERVER_CONFIGURATION);
- ITomcatConfigurationWorkingCopy configuration = (ITomcatConfigurationWorkingCopy) wc.getAdapter(ITomcatConfigurationWorkingCopy.class);
+ IServerWorkingCopy wc = (IServerWorkingCopy) getTaskModel().getObject(ITaskModel.TASK_SERVER);
+ TomcatServer server = (TomcatServer) wc.getAdapter(TomcatServer.class);
+ TomcatConfiguration configuration = server.getTomcatConfiguration();
configuration.addWebModule(index, module);
} catch (Exception e) {
// ignore
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
index ce983c0..0ac8c1b 100644
--- 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
@@ -12,13 +12,12 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jst.server.tomcat.core.ITomcatConfiguration;
-import org.eclipse.jst.server.tomcat.core.ITomcatConfigurationWorkingCopy;
import org.eclipse.jst.server.tomcat.core.WebModule;
+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.wst.server.core.IServerConfiguration;
-import org.eclipse.wst.server.core.IServerConfigurationWorkingCopy;
+import org.eclipse.wst.server.core.IServerWorkingCopy;
import org.eclipse.wst.server.core.ITaskModel;
import org.eclipse.wst.server.core.util.Task;
/**
@@ -37,14 +36,15 @@
this.index = index;
this.path = contextRoot;
}
-
+
/**
* Execute the command.
* @return boolean
*/
public void execute(IProgressMonitor monitor) throws CoreException {
- IServerConfigurationWorkingCopy wc = (IServerConfigurationWorkingCopy) getTaskModel().getObject(ITaskModel.TASK_SERVER_CONFIGURATION);
- ITomcatConfigurationWorkingCopy configuration = (ITomcatConfigurationWorkingCopy) wc.getAdapter(ITomcatConfigurationWorkingCopy.class);
+ IServerWorkingCopy wc = (IServerWorkingCopy) getTaskModel().getObject(ITaskModel.TASK_SERVER);
+ TomcatServer server = (TomcatServer) wc.getAdapter(TomcatServer.class);
+ TomcatConfiguration configuration = server.getTomcatConfiguration();
oldModule = (WebModule) configuration.getWebModules().get(index);
configuration.removeWebModule(index);
@@ -58,8 +58,9 @@
*/
public String getDescription() {
if (oldModule == null) {
- IServerConfiguration config = (IServerConfiguration) getTaskModel().getObject(ITaskModel.TASK_SERVER_CONFIGURATION);
- ITomcatConfiguration configuration = (ITomcatConfiguration) config.getAdapter(ITomcatConfiguration.class);
+ IServerWorkingCopy wc = (IServerWorkingCopy) getTaskModel().getObject(ITaskModel.TASK_SERVER);
+ TomcatServer server = (TomcatServer) wc.getAdapter(TomcatServer.class);
+ TomcatConfiguration configuration = server.getTomcatConfiguration();
oldModule = (WebModule) configuration.getWebModules().get(index);
}
@@ -79,8 +80,9 @@
*/
public void undo() {
try {
- IServerConfigurationWorkingCopy wc = (IServerConfigurationWorkingCopy) getTaskModel().getObject(ITaskModel.TASK_SERVER_CONFIGURATION);
- ITomcatConfigurationWorkingCopy configuration = (ITomcatConfigurationWorkingCopy) wc.getAdapter(ITomcatConfigurationWorkingCopy.class);
+ IServerWorkingCopy wc = (IServerWorkingCopy) getTaskModel().getObject(ITaskModel.TASK_SERVER);
+ TomcatServer server = (TomcatServer) wc.getAdapter(TomcatServer.class);
+ TomcatConfiguration configuration = server.getTomcatConfiguration();
configuration.removeWebModule(index);
configuration.addWebModule(index, oldModule);
} catch (Exception e) {
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
index a2d823c..aab3835 100644
--- 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
@@ -24,9 +24,9 @@
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.ITomcatConfigurationWorkingCopy;
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;
@@ -39,7 +39,7 @@
* Tomcat configuration mime editor section.
*/
public class ConfigurationMimeEditorSection extends ServerEditorSection {
- protected ITomcatConfigurationWorkingCopy tomcatConfiguration;
+ protected TomcatConfiguration tomcatConfiguration;
protected boolean updating;
@@ -79,7 +79,7 @@
}
}
};
- serverConfiguration.addPropertyChangeListener(listener);
+ tomcatConfiguration.addPropertyChangeListener(listener);
}
public void createSection(Composite parent) {
@@ -184,17 +184,16 @@
}
public void dispose() {
- if (serverConfiguration != null)
- serverConfiguration.removePropertyChangeListener(listener);
+ if (tomcatConfiguration != null)
+ tomcatConfiguration.removePropertyChangeListener(listener);
}
public void init(IEditorSite site, IEditorInput input) {
super.init(site, input);
- if (serverConfiguration != null) {
- tomcatConfiguration = (ITomcatConfigurationWorkingCopy) serverConfiguration.getAdapter(ITomcatConfigurationWorkingCopy.class);
- addChangeListener();
- }
+ TomcatServer ts = (TomcatServer) server.getAdapter(TomcatServer.class);
+ tomcatConfiguration = ts.getTomcatConfiguration();
+ addChangeListener();
initialize();
}
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
index 26536c3..f00f4a6 100644
--- 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
@@ -10,6 +10,7 @@
**********************************************************************/
package org.eclipse.jst.server.tomcat.ui.internal.editor;
+import org.eclipse.jst.server.tomcat.core.ITomcatServer;
import org.eclipse.wst.server.core.IServerWorkingCopy;
import org.eclipse.wst.server.ui.editor.*;
/**
@@ -20,7 +21,8 @@
* @see ServerEditorPartFactoryDelegate#shouldDisplay(IServer)
*/
public boolean shouldCreateSection(IServerWorkingCopy server) {
- return (server.getServerConfiguration() != null);
+ ITomcatServer tomcatServer = (ITomcatServer) server.getAdapter(ITomcatServer.class);
+ return tomcatServer.getServerConfiguration() != null;
}
/*
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
index 0384087..39c36ec 100644
--- 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
@@ -25,8 +25,8 @@
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.TableItem;
import org.eclipse.jface.viewers.*;
-import org.eclipse.jst.server.tomcat.core.ITomcatConfigurationWorkingCopy;
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;
@@ -39,7 +39,7 @@
* Tomcat configuration port editor page.
*/
public class ConfigurationPortEditorSection extends ServerEditorSection {
- protected ITomcatConfigurationWorkingCopy tomcatConfiguration;
+ protected TomcatConfiguration tomcatConfiguration;
protected boolean updating;
@@ -68,7 +68,7 @@
}
}
};
- serverConfiguration.addPropertyChangeListener(listener);
+ tomcatConfiguration.addPropertyChangeListener(listener);
}
/**
@@ -192,8 +192,8 @@
}
public void dispose() {
- if (serverConfiguration != null)
- serverConfiguration.removePropertyChangeListener(listener);
+ if (tomcatConfiguration != null)
+ tomcatConfiguration.removePropertyChangeListener(listener);
}
/* (non-Javadoc)
@@ -202,10 +202,9 @@
public void init(IEditorSite site, IEditorInput input) {
super.init(site, input);
- if (serverConfiguration != null) {
- tomcatConfiguration = (ITomcatConfigurationWorkingCopy) serverConfiguration.getAdapter(ITomcatConfigurationWorkingCopy.class);
- addChangeListener();
- }
+ TomcatServer ts = (TomcatServer) server.getAdapter(TomcatServer.class);
+ tomcatConfiguration = ts.getTomcatConfiguration();
+ addChangeListener();
initialize();
}
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
index 5fb8e1e..b21779e 100644
--- 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
@@ -10,6 +10,7 @@
**********************************************************************/
package org.eclipse.jst.server.tomcat.ui.internal.editor;
+import org.eclipse.jst.server.tomcat.core.ITomcatServer;
import org.eclipse.wst.server.core.IServerWorkingCopy;
import org.eclipse.wst.server.ui.editor.*;
/**
@@ -20,7 +21,8 @@
* @see ServerEditorPartFactoryDelegate#shouldDisplay(IServer)
*/
public boolean shouldCreateSection(IServerWorkingCopy server) {
- return (server.getServerConfiguration() != null);
+ ITomcatServer tomcatServer = (ITomcatServer) server.getAdapter(ITomcatServer.class);
+ return tomcatServer.getServerConfiguration() != null;
}
/*
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
index bf88255..1991b66 100644
--- 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
@@ -10,6 +10,7 @@
**********************************************************************/
package org.eclipse.jst.server.tomcat.ui.internal.editor;
+import org.eclipse.jst.server.tomcat.core.ITomcatServer;
import org.eclipse.ui.IEditorPart;
import org.eclipse.wst.server.core.IServerWorkingCopy;
@@ -22,7 +23,8 @@
* @see ServerEditorPartFactoryDelegate#shouldDisplay(IServer)
*/
public boolean shouldCreatePage(IServerWorkingCopy server) {
- return (server.getServerConfiguration() != null);
+ ITomcatServer tomcatServer = (ITomcatServer) server.getAdapter(ITomcatServer.class);
+ return tomcatServer.getServerConfiguration() != null;
}
/*
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
index c284297..9450b9e 100644
--- 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
@@ -19,10 +19,10 @@
import org.eclipse.jface.viewers.ColumnWeightData;
import org.eclipse.jface.viewers.TableLayout;
import org.eclipse.jst.server.j2ee.IWebModule;
-import org.eclipse.jst.server.tomcat.core.ITomcatConfigurationWorkingCopy;
import org.eclipse.jst.server.tomcat.core.ITomcatServerWorkingCopy;
import org.eclipse.jst.server.tomcat.core.WebModule;
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.AddWebModuleCommand;
import org.eclipse.jst.server.tomcat.core.internal.command.ModifyWebModuleCommand;
import org.eclipse.jst.server.tomcat.core.internal.command.RemoveWebModuleCommand;
@@ -57,7 +57,7 @@
*/
public class ConfigurationWebModuleEditorPart extends ServerEditorPart {
protected ITomcatServerWorkingCopy server2;
- protected ITomcatConfigurationWorkingCopy configuration;
+ protected TomcatConfiguration configuration;
protected Table webAppTable;
protected int selection = -1;
@@ -90,7 +90,7 @@
}
}
};
- serverConfiguration.addPropertyChangeListener(listener);
+ configuration.addPropertyChangeListener(listener);
}
protected ICommandManager getCommandManager() {
@@ -265,8 +265,8 @@
}
public void dispose() {
- if (serverConfiguration != null)
- serverConfiguration.removePropertyChangeListener(listener);
+ if (configuration != null)
+ configuration.removePropertyChangeListener(listener);
}
/* (non-Javadoc)
@@ -275,10 +275,8 @@
public void init(IEditorSite site, IEditorInput input) {
super.init(site, input);
- if (serverConfiguration != null) {
- configuration = (ITomcatConfigurationWorkingCopy) serverConfiguration.getAdapter(ITomcatConfigurationWorkingCopy.class);
- addChangeListener();
- }
+ TomcatServer ts = (TomcatServer) server.getAdapter(TomcatServer.class);
+ configuration = ts.getTomcatConfiguration();
if (server != null)
server2 = (ITomcatServerWorkingCopy) server.getAdapter(ITomcatServerWorkingCopy.class);
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
index 011fc5a..ab977a0 100644
--- 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
@@ -10,20 +10,12 @@
**********************************************************************/
package org.eclipse.jst.server.tomcat.ui.internal.editor;
-import org.eclipse.wst.server.core.IServerWorkingCopy;
import org.eclipse.wst.server.ui.editor.*;
/**
*
*/
public class ServerGeneralEditorSectionFactory extends ServerEditorPageSectionFactoryDelegate {
/*
- * @see ServerEditorPartFactoryDelegate#shouldDisplay(IServer)
- */
- public boolean shouldCreateSection(IServerWorkingCopy server) {
- return (server != null && server.getServerType().getId().indexOf("tomcat") >= 0);
- }
-
- /*
* @see ServerEditorPartFactoryDelegate#createPage()
*/
public IServerEditorSection createSection() {
diff --git a/plugins/org.eclipse.wst.server.core/plugin.properties b/plugins/org.eclipse.wst.server.core/plugin.properties
index 1351b4d..e1690ab 100644
--- a/plugins/org.eclipse.wst.server.core/plugin.properties
+++ b/plugins/org.eclipse.wst.server.core/plugin.properties
@@ -20,7 +20,7 @@
extensionPointServerLocators=Server Locators
extensionPointServerConfigurationTypes=Server Configuration Types
extensionPointModuleFactories=Module Factories
-extensionPointModuleObjectAdapters=Module Object Adapters
+extensionPointModuleObjectAdapters=Module Artifact Adapters
extensionPointLaunchableAdapters=Launchable Adapters
extensionPointClients=Clients
extensionPointServerTasks=Server Tasks
diff --git a/plugins/org.eclipse.wst.server.core/plugin.xml b/plugins/org.eclipse.wst.server.core/plugin.xml
index 9dd0900..15fb959 100644
--- a/plugins/org.eclipse.wst.server.core/plugin.xml
+++ b/plugins/org.eclipse.wst.server.core/plugin.xml
@@ -26,9 +26,8 @@
<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="serverConfigurationTypes" name="%extensionPointServerConfigurationTypes" schema="schema/serverConfigurationTypes.exsd"/>
<extension-point id="moduleFactories" name="%extensionPointModuleFactories" schema="schema/moduleFactories.exsd"/>
- <extension-point id="moduleObjectAdapters" name="%extensionPointModuleObjectAdapters" schema="schema/moduleObjectAdapters.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"/>
@@ -39,12 +38,4 @@
id="*"
name="%moduleTypeUnknown"/>
</extension>
-
- <extension point="org.eclipse.wst.server.core.moduleFactories">
- <moduleFactory
- projects="false"
- class="org.eclipse.wst.server.core.util.MissingModuleFactoryDelegate"
- id="org.eclipse.wst.server.core.missingModuleFactory">
- </moduleFactory>
- </extension>
</plugin>
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/schema/moduleObjectAdapters.exsd b/plugins/org.eclipse.wst.server.core/schema/moduleArtifactAdapters.exsd
similarity index 90%
rename from plugins/org.eclipse.wst.server.core/schema/moduleObjectAdapters.exsd
rename to plugins/org.eclipse.wst.server.core/schema/moduleArtifactAdapters.exsd
index cc260e5..c2cd833 100644
--- a/plugins/org.eclipse.wst.server.core/schema/moduleObjectAdapters.exsd
+++ b/plugins/org.eclipse.wst.server.core/schema/moduleArtifactAdapters.exsd
@@ -3,7 +3,7 @@
<schema targetNamespace="org.eclipse.wst.server.core">
<annotation>
<appInfo>
- <meta.schema plugin="org.eclipse.wst.server.core" id="moduleObjectAdapters" name="Module Object Adapters"/>
+ <meta.schema plugin="org.eclipse.wst.server.core" id="moduleArtifactAdapters" name="Module Artifact Adapters"/>
</appInfo>
<documentation>
@@ -13,7 +13,7 @@
<element name="extension">
<complexType>
<sequence>
- <element ref="moduleObjectAdapter" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="moduleArtifactAdapter" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
<attribute name="point" type="string" use="required">
<annotation>
@@ -39,7 +39,7 @@
</complexType>
</element>
- <element name="moduleObjectAdapter">
+ <element name="moduleArtifactAdapter">
<annotation>
<appInfo>
<meta.element labelAttribute="name"/>
@@ -58,7 +58,7 @@
<attribute name="class" type="string" use="required">
<annotation>
<documentation>
- specifies the fully qualified name of the Java class that extends <samp>ModuleObjectAdapterDelegate</samp>.
+ specifies the fully qualified name of the Java class that extends <samp>ModuleArtifactAdapterDelegate</samp>.
Module object adapter instances of this type will delegate to instances of this class.
</documentation>
<appInfo>
@@ -96,7 +96,7 @@
<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.ModuleObjectAdapterDelegate</b> and contains a public 0-arg constructor.
+ 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>
diff --git a/plugins/org.eclipse.wst.server.core/schema/serverConfigurationTypes.exsd b/plugins/org.eclipse.wst.server.core/schema/serverConfigurationTypes.exsd
deleted file mode 100644
index 7b84151..0000000
--- a/plugins/org.eclipse.wst.server.core/schema/serverConfigurationTypes.exsd
+++ /dev/null
@@ -1,141 +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="serverConfigurationTypes" name="Server Configuration Types"/>
- </appInfo>
- <documentation>
- This extension point is used to provide a new server configuration type.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="serverConfigurationType"/>
- </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="serverConfigurationType">
- <complexType>
- <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 configuration
- </documentation>
- </annotation>
- </attribute>
- <attribute name="description" type="string" use="required">
- <annotation>
- <documentation>
- a translatable description of this server configuration type
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string">
- <annotation>
- <documentation>
- specifies the fully qualified name of the Java class that extends <samp>IServerConfigurationDelegate</samp>.
-Server configuration instances of this type will delegate to instances of this class.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="isFolder" type="string">
- <annotation>
- <documentation>
- true if the configuration requires it's own data in a folder
- </documentation>
- </annotation>
- </attribute>
- <attribute name="order" type="string">
- <annotation>
- <documentation>
- an integer order specifying the relative importance of this server configuration type
- </documentation>
- </annotation>
- </attribute>
- <attribute name="importExtensions" type="string">
- <annotation>
- <documentation>
- a comma separated list of import extensions (e.g. "xml", "cfg") that this server configuration could be imported using
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following is an example of a server configuration type extension point:
-
-<p>
-<pre>
- <extension point="org.eclipse.wst.server.core.serverConfigurationTypes">
- <serverConfigurationType
- id="com.example.serverConfiguration"
- name="%serverConfigurationTypeName"
- description="%serverConfigurationTypeDescription"
- isFolder="true"
- class="com.example.ExampleServerConfigurationDelegate"/>
- </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.ServerConfigurationDelegate</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 Common Public License v1.0 which accompanies
-this distribution, and is available at
-<a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-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
index caaf75f..7e44ab7 100644
--- a/plugins/org.eclipse.wst.server.core/schema/serverTypes.exsd
+++ b/plugins/org.eclipse.wst.server.core/schema/serverTypes.exsd
@@ -80,10 +80,10 @@
</documentation>
</annotation>
</attribute>
- <attribute name="configurationTypeId" type="string">
+ <attribute name="hasConfiguration" type="boolean">
<annotation>
<documentation>
- the id of the server configuration type that this server requires
+ true if this server has server configuration files
</documentation>
</annotation>
</attribute>
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/ILaunchableAdapter.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/ILaunchableAdapter.java
index ec47fbe..00d949b 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/ILaunchableAdapter.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/ILaunchableAdapter.java
@@ -13,7 +13,7 @@
import org.eclipse.core.runtime.CoreException;
/**
* This interface, typically implemented by the server
- * code, converts from an IModuleObject to an
+ * code, converts from an IModuleArtifact to an
* ILaunchable.
*
* <p>This interface is not intended to be implemented by clients.</p>
@@ -36,5 +36,5 @@
* @return
* @exception
*/
- public ILaunchable getLaunchable(IServer server, IModuleObject moduleObject) throws CoreException;
+ public ILaunchable getLaunchable(IServer server, IModuleArtifact moduleObject) throws CoreException;
}
\ 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
index 3b02ace..7f9e8ae 100644
--- 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
@@ -145,7 +145,7 @@
/**
* Returns whether this module currently exists.
* <p>
- * [issue: The method touches on the important issue
+ * [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
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IModuleObject.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IModuleArtifact.java
similarity index 96%
rename from plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IModuleObject.java
rename to plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IModuleArtifact.java
index 6a2120d..babb4f7 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IModuleObject.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IModuleArtifact.java
@@ -14,7 +14,7 @@
* which can be launched on the server. Examples of module
* objects could include servlets, HTML pages, or EJB beans.
*/
-public interface IModuleObject {
+public interface IModuleArtifact {
/**
* Returns the id of this module object. Each known
* module object has a distinct id.
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IModuleObjectAdapter.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IModuleArtifactAdapter.java
similarity index 89%
rename from plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IModuleObjectAdapter.java
rename to plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IModuleArtifactAdapter.java
index 8ec9c51..d7c41f2 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IModuleObjectAdapter.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IModuleArtifactAdapter.java
@@ -16,7 +16,7 @@
*
* <p>This interface is not intended to be implemented by clients.</p>
*/
-public interface IModuleObjectAdapter {
+public interface IModuleArtifactAdapter {
/**
* 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
@@ -41,10 +41,10 @@
public boolean isPluginActivated();
/**
- * Converts from a model object to an IModuleObject.
+ * Converts from a model object to an IModuleArtifact.
*
* @param obj
* @return
*/
- public IModuleObject getModuleObject(Object obj);
+ public IModuleArtifact getModuleObject(Object obj);
}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IRuntimeLocator.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IRuntimeLocator.java
index 7f30083..281cf1f 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IRuntimeLocator.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IRuntimeLocator.java
@@ -11,6 +11,7 @@
package org.eclipse.wst.server.core;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
/**
* A runtime locator provides the ability to locate or search for additional
@@ -21,7 +22,7 @@
* @since 1.0
*/
public interface IRuntimeLocator {
- public interface Listener {
+ public interface RuntimeSearchListener {
/**
* Called when a new runtime is found by the locator.
* The runtime must never be null.
@@ -73,11 +74,14 @@
/**
* 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(Listener listener, IProgressMonitor monitor) throws CoreException;
+ public void searchForRuntimes(IPath path, RuntimeSearchListener 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/IServerAttributes.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IServerAttributes.java
index 87f92bd..158017d 100644
--- 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
@@ -175,7 +175,7 @@
*
* @return the server configuration, or <code>null</code> if none
*/
- public IServerConfiguration getServerConfiguration();
+ public IPath getServerConfiguration();
/**
* Returns the server extension for this server.
@@ -242,7 +242,7 @@
* @return <code>true</code> if this server supports the given server
* configuration, and <code>false/code> otherwise
*/
- public boolean isSupportedConfiguration(IServerConfiguration configuration);
+ public boolean isSupportedConfiguration(IPath configuration);
/**
* Returns a temporary directory that the requestor can use
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IServerConfiguration.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IServerConfiguration.java
deleted file mode 100644
index 1ae48ae..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IServerConfiguration.java
+++ /dev/null
@@ -1,179 +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 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;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IPath;
-/**
- * Represents a server configuration instance. Every server configuration is an
- * instance of a particular, fixed server configuration type.
- * <p>
- * Servers have an optional server configuration. The server configuration is
- * information used to configure a running server. Simple types of servers
- * might not require any configuration, whereas full-featured web server have
- * an extensive set of parameters for adjusting the server's behavior. Even
- * though server configuration information usually takes the form of one or
- * more files, configuration information is treated separately from actual
- * content. Actual web content can be deployed on different servers without
- * change, whereas server configuration information is usually highly
- * dependent on the particulars of the server. Having the server configuration
- * identified as an entity separate from the server itself facilitates
- * switching an existing server between configurations, and sharing server
- * configurations between several servers of the same type (e.g., a local test
- * server and a remote server running on another host). * </p>
- * <p>
- * The server framework maintains a global list of all known server
- * configuration instances ({@link ServerCore#getServerConfigurations()}).
- * </p>
- * <p>
- * [issue: The information actually stored in the (.config) file is:
- * server configuration id and name, and server configuration type id.
- * 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>
- * [issue: What is the role of the data files in the configuration
- * data folder? Where do they come from? Are they created by the
- * client (UI), or do they get created automatically?]
- * </p>
- * <p>
- * [issue: Are data files ever changed as a direct and immediate
- * result of a change to a working copy? Changing any of the data
- * files prior to the save() request would be problematic since
- * these files are shared by the original. The only way it could
- * work is to the data files to be updated only when a working copy
- * is saved.]
- * </p>
- * <p>
- * [issue: Equality/identify for server configurations?]
- * </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 IServerConfiguration extends IElement, IAdaptable {
-
- /**
- * File extension (value "config") for serialized representation of
- * server configuration instances.
- * <p>
- * [issue: What is relationship between this file extension and
- * the file passed to IServerConfigurationType.createServerConfiguration(...)
- * and importFromPath/Runtime or returned by IServerConfiguration.getFile()?
- * That is, are server files configuration expected to end
- * in ".config", or is this just a default? If the former
- * (as I suspect), then IServerConfigurationType operations needs to say so,
- * and the implementation should enforce the restriction.]
- * </p>
- */
- public static final String FILE_EXTENSION = "config";
-
- /**
- * Returns the type of this server configuration.
- *
- * @return the server configuration type
- */
- public IServerConfigurationType getServerConfigurationType();
-
- /**
- * Returns the file where this server configuration instance is serialized.
- *
- * @return the file in the workspace where the server configuration 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 extension for this server configuration.
- * The extension is a server-configuration-type-specific object.
- * By casting the server configuration extension to the type prescribed in
- * the API documentation for that particular server configuration type,
- * the client can access server-configuration-type-specific properties and
- * methods.
- *
- * @return the server configuration extension
- */
- //public IServerExtension getExtension(IProgressMonitor monitor);
-
- /**
- * Returns a working copy for modifying this server configuration instance.
- * If this instance is already a working copy, it is returned.
- * If this instance is not a working copy, a new server configuration
- * 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 configuration working copy is related to this server
- * configuration instance in the following ways:
- * <pre>
- * this.getWorkingCopy().getId() == this.getId()
- * this.getWorkingCopy().getFile() == this.getFile()
- * this.getWorkingCopy().getOriginal() == this
- * </pre>
- * </p>
- * <p>
- * [issue: IServerConfigurationWorkingCopy extends IServerConfiguration.
- * ServerConfiguration.getWorkingCopy() create a new working copy;
- * ServerConfigurationWorkingCopy.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.
- * This method should be renamed "createWorkingCopy"
- * or "newWorkingCopy" to make it clear to clients that it
- * creates a new object, even for working copies.]
- * </p>
- *
- * @return a new working copy
- */
- public IServerConfigurationWorkingCopy createWorkingCopy();
-
- /**
- * Returns the handle of a workspace folder where this server
- * configuration's files are stored. Returns <code>null</code>
- * if the folder is outside the workspace (in which case use
- * {@link #getConfigurationDataPath()} to get the file system
- * path).
- * <p>
- * When a configuration instance is serialized in a workspace
- * file, the accompanying data files are stored in a
- * sibling folder with a derivative name. If the configuration file
- * is named "MyConfig.config", the sibling folder that holds the data
- * files would be named "MyConfig-data".
- * </p>
- *
- * @return a workspace folder, or <code>null</code>
- * if the data folder is not in the workspace
- */
- public IFolder getConfigurationDataFolder();
-
- /**
- * Returns the path to a non-workspace folder where this server
- * configuration's files are stored. Returns <code>null</code>
- * if the folder is inside the workspace (in which case use
- * {@link #getConfigurationDataFolder()} to get the folder's handle).
- *
- * @return a folder not in the workspace, or <code>null</code>
- * if the data folder is in the workspace
- */
- public IPath getConfigurationDataPath();
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IServerConfigurationLifecycleListener.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IServerConfigurationLifecycleListener.java
deleted file mode 100644
index aaa0bb0..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IServerConfigurationLifecycleListener.java
+++ /dev/null
@@ -1,36 +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 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;
-/**
- * Listener interface for server configuration changes.
- */
-public interface IServerConfigurationLifecycleListener {
- /**
- * A new server configuration has been created.
- *
- * @param serverConfiguration org.eclipse.wst.server.core.IServerConfiguration
- */
- public void serverConfigurationAdded(IServerConfiguration serverConfiguration);
-
- /**
- * An existing server configuration has been updated or modified.
- *
- * @param serverConfiguration org.eclipse.wst.server.core.IServerConfiguration
- */
- public void serverConfigurationChanged(IServerConfiguration serverConfiguration);
-
- /**
- * A existing configuration has been removed.
- *
- * @param serverConfiguration org.eclipse.wst.server.core.IServerConfiguration
- */
- public void serverConfigurationRemoved(IServerConfiguration serverConfiguration);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IServerConfigurationType.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IServerConfigurationType.java
deleted file mode 100644
index 2126df3..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IServerConfigurationType.java
+++ /dev/null
@@ -1,203 +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 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;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-/**
- * Represents a server configuration type from which server configuration
- * instances ({@link IServerConfiguration}) can be created.
- * <p>
- * The server core framework supports
- * an open-ended set of server configuration types, which are contributed via
- * the <code>serverConfigurationTypes</code> extension point in the server core
- * plug-in. Server configuration type objects carry no state (all information is
- * read-only and is supplied by the server configuration type declaration).
- * The global list of known server configuration types is available via
- * {@link ServerCore#getServerConfigurationTypes()}.
- * </p>
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- * <p>
- * [issue: Equality/identify for server types? Are IServerConfigurationType
- * instances guaranteed to be canonical (client can use ==),
- * or is it possible for there to be non-identical IServerConfigurationType
- * objects in play that both represent the same server configuration type?
- * The latter is the more common; type should spec equals.]
- * </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 IServerConfigurationType {
-
- /**
- * Returns the id of this server configuration type.
- * Each known server configuration 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 configuration type id
- */
- public String getId();
-
- /**
- * Returns the displayable name for this server configuration type.
- * <p>
- * Note that this name is appropriate for the current locale.
- * </p>
- *
- * @return a displayable name for this server configuration type
- */
- public String getName();
-
- /**
- * Returns the displayable description for this server configuration type.
- * <p>
- * Note that this description is appropriate for the current locale.
- * </p>
- *
- * @return a displayable description for this server configuration type
- */
- public String getDescription();
-
- /**
- * Returns the extensions to filter when importing the server
- * resource. If these extensions are given, the resource is
- * assumed to be a file. If null is returned, the import will
- * look for folders instead.
- * <p>
- * [issue: Explain how these are used.]
- * </p>
- * <p>
- * [issue: Seems like a very UI-centric API, useful only
- * in conjuction with importFromPath(...).]
- * </p>
- *
- * @return java.lang.String[]
- */
- public String[] getImportFilterExtensions();
-
- /**
- * Returns whether this type of server configuration requires
- * requires it's own data in a folder in the workspace. If false,
- * this server configuration does not store any files and all data
- * is contained within the actual server configuration.
- *
- * @return <code>true</code> if this type of server configuration
- * needs a folder, and <code>false</code> if it does not
- */
- public boolean isFolder();
-
- /**
- * Creates a working copy instance of this server configuration type.
- * After setting various properties of the working copy,
- * the client should call
- * {@link IServerConfigurationWorkingCopy#save(IProgressMonitor)}
- * to bring the server configuration 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>
- * [issue: This method is declared as throwing CoreException.
- * From a clients's point of view, what are the circumstances that
- * cause this operation to fail?]
- * </p>
- *
- * @param id the id to assign to the server configuration 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 configuration
- * 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 configuration working copy with the given id
- * @throws CoreException [missing]
- */
- public IServerConfigurationWorkingCopy createServerConfiguration(String id, IFile file, IProgressMonitor monitor) throws CoreException;
-
- /**
- * Creates a working copy instance of this server configuration type,
- * by importing from the given local file system path (outside the workspace).
- * After setting additional various properties of the working copy,
- * the client should call
- * {@link IServerConfigurationWorkingCopy#save(IProgressMonitor)}
- * to bring the server configuration instance into existence.
- * <p>
- * [issue: What this does is type-dependent. Perhaps these
- * methods should instead be type-dependent API on
- * IServerConfigurationWorkingCopy(Delegate).]
- * </p>
- * <p>
- * [issue: This method is declared as throwing CoreException.
- * From a clients's point of view, what are the circumstances that
- * cause this operation to fail?]
- * </p>
- *
- * @param id the id to assign to the server configuration 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 configuration
- * 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 path a local file system path
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @return a new server configuration working copy with the given id
- * @throws CoreException [missing]
- */
- public IServerConfigurationWorkingCopy importFromPath(String id, IFile file, IPath path, IProgressMonitor monitor) throws CoreException;
-
- /**
- * Creates a working copy instance of this server configuration type,
- * by importing from the given runtime instance.
- * After setting additional various properties of the working copy,
- * the client should call
- * {@link IServerConfigurationWorkingCopy#save(IProgressMonitor)}
- * to bring the server configuration instance into existence.
- * <p>
- * [issue: A server runtime is primarily for building against.
- * How is it that it can cough up a server configuration?]
- * </p>
- * <p>
- * [issue: What this does is type-dependent. Perhaps these
- * methods should instead be type-dependent API on
- * IServerConfigurationWorkingCopy(Delegate).]
- * </p>
- * <p>
- * [issue: This method is declared as throwing CoreException.
- * From a clients's point of view, what are the circumstances that
- * cause this operation to fail?]
- * </p>
- *
- * @param id the id to assign to the server configuration 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 configuration
- * 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 a runtime
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @return a new server configuration working copy with the given id
- * @throws CoreException [missing]
- */
- public IServerConfigurationWorkingCopy importFromRuntime(String id, IFile file, 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/IServerConfigurationWorkingCopy.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IServerConfigurationWorkingCopy.java
deleted file mode 100644
index a54f09c..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IServerConfigurationWorkingCopy.java
+++ /dev/null
@@ -1,116 +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 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;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-/**
- * A working copy server object used for formulating changes
- * to a server configuration instance
- * ({@link org.eclipse.wst.server.core.IServerConfiguration}).
- * <p>
- * [issue: There can be other server-configuration-type-specific properties.
- * The default values for these need to be specified somewhere
- * too (probably in the API subclass of ServerConfigurationWorkingCopyDelegate).]
- * </p>
- * <p>
- * [issue: IElementWorkingCopy and IElement support an open-ended set
- * of attribute-value pairs. What is relationship between these
- * attributes and (a) the get/setXXX methods found on this interface,
- * and (b) get/setXXX methods provided by specific server types?
- * Is it the case that these attribute-values pairs are the only
- * information about a server instance that can be preserved
- * between workbench sessions? That is, any information recorded
- * just in instance fields of an ServerConfigurationDelegate implementation
- * will be lost when the session ends.]
- * </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 IServerConfigurationWorkingCopy extends IServerConfiguration, IElementWorkingCopy {
- /**
- * Returns the server configuration instance that this working copy is
- * associated with.
- * <p>
- * For a server configuration working copy created by a call to
- * {@link IServerConfiguration#createWorkingCopy()},
- * <code>this.getOriginal()</code> returns the original
- * server configuration object. For a server configuration working copy
- * just created by a call to
- * {@link IServerConfigurationType#createServerConfiguration(String, IFile, IProgressMonitor)},
- * <code>this.getOriginal()</code> returns <code>null</code>.
- * </p>
- *
- * @return the associated server configuration instance, or <code>null</code> if none
- */
- public IServerConfiguration getOriginal();
-
- /**
- * Returns the extension for this server configuration working copy.
- * The server configuration working copy extension is a
- * server-configuration-type-specific object. By casting the server
- * configuration working copy extension to the type prescribed in the API
- * documentation for that particular server configuration working copy type,
- * the client can access server-configuration-type-specific properties and
- * methods.
- *
- * @return the extension for the server configuration working copy
- */
- //public IServerExtension getWorkingCopyExtension(IProgressMonitor monitor);
-
- /**
- * Sets the file where this server instance is serialized.
- *
- * @param 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);
-
- /**
- * Commits the changes made in this working copy. If there is
- * no extant server configuration instance with a matching id and
- * server configuration type, this will create a server configuration
- * instance with attributes taken from this working copy.
- * If there an existing server configuration instance with a matching id
- * and server configuration type, this will change the server configuration
- * instance accordingly.
- * <p>
- * [issue: What is relationship to
- * this.getOriginal() and the IServerConfiguration returned by this.save()?
- * The answer should be: they're the same server configuration, for an
- * appropriate notion of "same". As currently implemented, they
- * are different IServerConfiguration instances but have the same
- * ids and types. Client that are hanging on to the old server configuration
- * instance will not see the changes.
- * If IServerConfiguration were some kind of handle object as elsewhere in
- * Eclipse Platform, this kind of change could be done much
- * more smoothly.]
- * </p>
- * <p>
- * [issue: What is lifecycle for ServerConfigurationWorkingCopyDelegate
- * 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 server configuration instance
- * @throws CoreException [missing]
- */
- public IServerConfiguration 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/IServerTask.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IServerTask.java
index 4b8aea9..477c792 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IServerTask.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IServerTask.java
@@ -38,9 +38,8 @@
* create a new cache.
*
* @param server org.eclipse.wst.server.core.IServer
- * @param configuration org.eclipse.wst.server.core.IServerConfiguration
* @param parents java.util.List[]
* @param modules org.eclipse.wst.server.core.IModule[]
*/
- public IOptionalTask[] getTasks(IServer server, IServerConfiguration configuration, List[] parents, IModule[] modules);
+ 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/IServerType.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IServerType.java
index e32b15d..893e130 100644
--- 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
@@ -203,39 +203,6 @@
public int getServerStateSet();
/**
- * Returns the type of server configuration that this type
- * of server requires.
- * <p>
- * [issue: configurationTypeId is optional according the
- * serverTypes schema. This suggests that some types
- * of servers do not take a server configuration.
- * Is this correct?
- * ]
- * </p>
- * <p>
- * [issue: Does it really make sense for
- * serverConfigurationTypes and serverTypes be separate extension
- * points? Would it not be sufficient to have the party declaring
- * the server type also declare the server configuration type?
- * Having serverConfigurationType as a separate extension point
- * only makes sense if it would be possible in principle to
- * declare a server configuration type that could actually be
- * used on serveral server types. If server configurations
- * 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 configuration type that is not known
- * to the system?]
- * </p>
- *
- * @return a server configuration type, or <code>null</code>
- * if this server does not require any
- */
- public IServerConfigurationType getServerConfigurationType();
-
- /**
* Returns whether this type of server requires a server
* configuration.
* <p>
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
index 784d4fd..5208d92 100644
--- 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
@@ -12,6 +12,7 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
/**
* A working copy server object used for formulating changes
@@ -77,7 +78,7 @@
*
* @param configuration the server configuration, or <code>null</code> if none
*/
- public void setServerConfiguration(IServerConfiguration configuration);
+ public void setServerConfiguration(IPath configuration);
/**
* Returns the server instance that this working copy is
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/ITaskModel.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/ITaskModel.java
index f9f7f77..a385504 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/ITaskModel.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/ITaskModel.java
@@ -16,7 +16,6 @@
public interface ITaskModel {
public static final String TASK_RUNTIME = "runtime";
public static final String TASK_SERVER = "server";
- public static final String TASK_SERVER_CONFIGURATION = "server-configuration";
public static final String TASK_MODULE_PARENTS = "module-parents";
public static final String TASK_MODULES = "modules";
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
index c298c79..9df9f22 100644
--- 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
@@ -78,7 +78,6 @@
// cached copy of all server and configuration types
private static List serverTypes;
- private static List serverConfigurationTypes;
// cached copy of all monitors
private static List monitors;
@@ -266,51 +265,6 @@
}
return null;
}
-
- /**
- * Returns an array of all known server configuration types.
- * <p>
- * A new array is returned on each call, so clients may store or modify the result.
- * </p>
- *
- * @return the array of server configuration types {@link IServerConfigurationType}
- */
- public static IServerConfigurationType[] getServerConfigurationTypes() {
- if (serverConfigurationTypes == null)
- loadServerConfigurationTypes();
-
- IServerConfigurationType[] sct = new IServerConfigurationType[serverConfigurationTypes.size()];
- serverConfigurationTypes.toArray(sct);
- return sct;
- }
-
- /**
- * Returns the server configuration type with the given id,
- * or <code>null</code> if none. This convenience method searches
- * the list of known server configuration types
- * ({@link #getServerConfigurationTypes()}) for the one a matching
- * server id ({@link IServerConfigurationType#getId()}). The id may not
- * be null.
- *
- * @param the server configuration type id
- * @return the server configuration type, or <code>null</code> if
- * there is no server configuration type with the given id
- */
- public static IServerConfigurationType findServerConfigurationType(String id) {
- if (id == null)
- throw new IllegalArgumentException();
-
- if (serverConfigurationTypes == null)
- loadServerConfigurationTypes();
-
- Iterator iterator = serverConfigurationTypes.iterator();
- while (iterator.hasNext()) {
- IServerConfigurationType serverConfigurationType = (IServerConfigurationType) iterator.next();
- if (id.equals(serverConfigurationType.getId()))
- return serverConfigurationType;
- }
- return null;
- }
/**
* Returns an array of all known module module factories.
@@ -356,15 +310,15 @@
}*/
/**
- * Returns an array of all module object adapters.
+ * Returns an array of all module artifact adapters.
*
* @return
*/
- public static IModuleObjectAdapter[] getModuleObjectAdapters() {
+ public static IModuleArtifactAdapter[] getModuleArtifactAdapters() {
if (moduleObjectAdapters == null)
loadModuleObjectAdapters();
- IModuleObjectAdapter[] moa = new IModuleObjectAdapter[moduleObjectAdapters.size()];
+ IModuleArtifactAdapter[] moa = new IModuleArtifactAdapter[moduleObjectAdapters.size()];
moduleObjectAdapters.toArray(moa);
return moa;
}
@@ -551,32 +505,6 @@
}
/**
- * Load the server configuration types.
- */
- private static synchronized void loadServerConfigurationTypes() {
- if (serverConfigurationTypes != null)
- return;
- Trace.trace(Trace.EXTENSION_POINT, "->- Loading .serverConfigurationTypes extension point ->-");
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IConfigurationElement[] cf = registry.getConfigurationElementsFor(ServerPlugin.PLUGIN_ID, "serverConfigurationTypes");
-
- int size = cf.length;
- serverConfigurationTypes = new ArrayList(size);
- for (int i = 0; i < size; i++) {
- try {
- ServerConfigurationType serverConfigurationType = new ServerConfigurationType(cf[i]);
- serverConfigurationTypes.add(serverConfigurationType);
- Trace.trace(Trace.EXTENSION_POINT, " Loaded serverConfigurationType: " + cf[i].getAttribute("id"));
- } catch (Throwable t) {
- Trace.trace(Trace.SEVERE, " Could not load serverConfigurationType: " + cf[i].getAttribute("id"), t);
- }
- }
- sortOrderedList(serverConfigurationTypes);
-
- Trace.trace(Trace.EXTENSION_POINT, "-<- Done loading .serverConfigurationTypes extension point -<-");
- }
-
- /**
* Load the module factories extension point.
*/
private static synchronized void loadModuleFactories() {
@@ -762,34 +690,6 @@
}
/**
- * Returns the server configuration with the given id, or <code>null</code>
- * if none. This convenience method searches the list of known
- * server configurations ({@link #getServerConfigurations()}) for the one
- * with a matching server configuration id
- * ({@link IServerConfiguration#getId()}). The id must not be null.
- *
- * @param the server configuration id
- * @return the server configuration instance, or <code>null</code> if
- * there is no server configuration with the given id
- */
- public static IServerConfiguration findServerConfiguration(String id) {
- return getResourceManager().getServerConfiguration(id);
- }
-
- /**
- * Returns an array of all known server configuration 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 configuration instances {@link IServerConfiguration}
- */
- public static IServerConfiguration[] getServerConfigurations() {
- return getResourceManager().getServerConfigurations();
- }
-
- /**
* Returns an array of all known server instances. The array will not include any
* working copies.
* <p>
@@ -841,26 +741,6 @@
public static void removeServerLifecycleListener(IServerLifecycleListener listener) {
getResourceManager().removeServerLifecycleListener(listener);
}
-
- /**
- * Adds a new server configuration lifecycle listener.
- * Has no effect if an identical listener is already registered.
- *
- * @param listener org.eclipse.wst.server.IServerConfigurationLifecycleListener
- */
- public static void addServerConfigurationLifecycleListener(IServerConfigurationLifecycleListener listener) {
- getResourceManager().addServerConfigurationLifecycleListener(listener);
- }
-
- /**
- * Removes a server configuration lifecycle listener.
- * Has no effect if the listener is not registered.
- *
- * @param listener org.eclipse.wst.server.IServerConfigurationLifecycleListener
- */
- public static void removeServerConfigurationLifecycleListener(IServerConfigurationLifecycleListener listener) {
- getResourceManager().removeServerConfigurationLifecycleListener(listener);
- }
/**
* Returns the default runtime. Test API - do not use.
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
index 60f06ea..d18b6fc 100644
--- 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
@@ -202,7 +202,7 @@
if (obj == null)
return null;
Trace.trace(Trace.FINEST, "ServerUtil.getModule()");
- IModuleObjectAdapter[] adapters = ServerCore.getModuleObjectAdapters();
+ IModuleArtifactAdapter[] adapters = ServerCore.getModuleArtifactAdapters();
if (adapters != null) {
int size = adapters.length;
for (int i = 0; i < size; i++) {
@@ -211,7 +211,7 @@
Trace.trace(Trace.FINEST, "getModule(): " + obj.getClass() + " " + adapters[i].getObjectClassName());
throw new Exception();
}
- IModuleObject moduleObject = adapters[i].getModuleObject(obj);
+ IModuleArtifact moduleObject = adapters[i].getModuleObject(obj);
if (moduleObject != null)
return moduleObject.getModule();
}
@@ -225,15 +225,15 @@
*
* @return java.util.List
*/
- public static IModuleObject[] getModuleObjects(Object obj) {
+ public static IModuleArtifact[] getModuleObjects(Object obj) {
List list = new ArrayList();
Trace.trace(Trace.FINEST, "ServerUtil.getModuleObjects()");
- IModuleObjectAdapter[] adapters = ServerCore.getModuleObjectAdapters();
+ IModuleArtifactAdapter[] adapters = ServerCore.getModuleArtifactAdapters();
if (adapters != null) {
int size = adapters.length;
for (int i = 0; i < size; i++) {
if (isEnabled(obj.getClass(), adapters[i].getObjectClassName())) {
- IModuleObject moduleObject = adapters[i].getModuleObject(obj);
+ IModuleArtifact moduleObject = adapters[i].getModuleObject(obj);
Trace.trace(Trace.FINEST, "moduleObject: " + moduleObject);
if (moduleObject != null)
list.add(moduleObject);
@@ -241,7 +241,7 @@
}
}
- IModuleObject[] mo = new IModuleObject[list.size()];
+ IModuleArtifact[] mo = new IModuleArtifact[list.size()];
list.toArray(mo);
return mo;
}
@@ -254,7 +254,7 @@
* @param moduleObject
* @return ILaunchable
*/
- /*public static ILaunchable getLaunchable(IServer server, IModuleObject moduleObject) {
+ /*public static ILaunchable getLaunchable(IServer server, IModuleArtifact moduleObject) {
ILaunchableAdapter[] adapters = ServerCore.getLaunchableAdapters();
if (adapters != null) {
int size = adapters.length;
@@ -283,7 +283,7 @@
/*public static ILaunchable getLaunchable(IServer server, List moduleObjects) {
Iterator iterator = moduleObjects.iterator();
while (iterator.hasNext()) {
- IModuleObject moduleObject = (IModuleObject) iterator.next();
+ IModuleArtifact moduleObject = (IModuleArtifact) iterator.next();
ILaunchable launchable = getLaunchable(server, moduleObject);
if (launchable != null)
return launchable;
@@ -641,18 +641,6 @@
wc.setName(name);
}
- public static void setServerConfigurationDefaultName(IServerConfigurationWorkingCopy wc) {
- String typeName = wc.getServerConfigurationType().getName();
-
- String name = ServerPlugin.getResource("%defaultServerConfigurationName", new String[] {typeName});
- int i = 2;
- while (isNameInUse(name)) {
- name = ServerPlugin.getResource("%defaultServerConfigurationName2", new String[] {typeName, i + ""});
- i++;
- }
- wc.setName(name);
- }
-
private static boolean isValidFilename(String name) {
IStatus status = ResourcesPlugin.getWorkspace().validateName(name, IResource.FILE);
if (status != null && !status.isOK())
@@ -694,17 +682,6 @@
return project.getFile(name);
}
- public static IFile getUnusedServerConfigurationFile(IProject project, IServerConfigurationType type) {
- String typeName = getValidFileName(type.getName());
- String name = ServerPlugin.getResource("%defaultServerConfigurationName", new String[] {typeName}) + "." + IServerConfiguration.FILE_EXTENSION;
- int i = 2;
- while (isFileNameInUse(project, name)) {
- name = ServerPlugin.getResource("%defaultServerConfigurationName2", new String[] {typeName, i + ""}) + "." + IServerConfiguration.FILE_EXTENSION;
- i++;
- }
- return project.getFile(name);
- }
-
/**
* Returns true if an element exists with the given name.
*
@@ -719,7 +696,6 @@
addAll(list, ServerCore.getRuntimes());
addAll(list, ServerCore.getServers());
- addAll(list, ServerCore.getServerConfigurations());
Iterator iterator = list.iterator();
while (iterator.hasNext()) {
@@ -1004,66 +980,4 @@
list.toArray(s);
return s;
}*/
-
- /**
- * Returns an array of all known server configuration instances of
- * the given server configuration type. This convenience method filters
- * the list of known server configurations
- * ({@link #getServerConfigurations()}) for ones with a matching
- * server configuration type
- * ({@link IServerConfiguration#getServerConfigurationType()}). 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 configType the server configuration type
- * @return a possibly-empty list of server configuration instances
- * {@link IServerConfiguration) of the given server configuration type
- */
- /*public static IServerConfiguration[] getServerConfigurations(IServerConfigurationType configType) {
- List list = new ArrayList();
- IServerConfiguration[] configs = ServerCore.getServerConfigurations();
- if (configs != null) {
- int size = configs.length;
- for (int i = 0; i < size; i++) {
- if (configs[i].getServerConfigurationType().equals(configType))
- list.add(configs[i]);
- }
- }
-
- IServerConfiguration[] sc = new IServerConfiguration[list.size()];
- list.toArray(sc);
- return sc;
- }*/
-
- /**
- * Returns the server configuration that came from the given file,
- * or <code>null</code> if none. This convenience method searches the list
- * of known server configurations ({@link #getServerConfigurations()}) for
- * the one with a matching location ({@link IServerConfiguration#getFile()}).
- * The id may not be null.
- * <p>
- * [issue: Is this convenience method really necessary?
- * It's straightforward enough for a client to do.]
- * </p>
- *
- * @param a server configuration file
- * @return the server configuration instance, or <code>null</code> if
- * there is no server configuration associated with the given file
- */
- public static IServerConfiguration findServerConfiguration(IFile file) {
- if (file == null)
- throw new IllegalArgumentException();
-
- IServerConfiguration[] configs = ServerCore.getServerConfigurations();
- if (configs != null) {
- int size = configs.length;
- for (int i = 0; i < size; i++) {
- if (file.equals(configs[i].getFile()))
- return configs[i];
- }
- }
- return null;
- }
}
\ 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
index 12887c1..cd43f13 100644
--- 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
@@ -14,7 +14,7 @@
import org.eclipse.wst.server.core.ILaunchable;
import org.eclipse.wst.server.core.ILaunchableAdapter;
-import org.eclipse.wst.server.core.IModuleObject;
+import org.eclipse.wst.server.core.IModuleArtifact;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.model.*;
/**
@@ -58,7 +58,7 @@
/**
*
*/
- public ILaunchable getLaunchable(IServer server, IModuleObject object) {
+ public ILaunchable getLaunchable(IServer server, IModuleArtifact object) {
try {
return getDelegate().getLaunchable(server, object);
} catch (Exception e) {
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
index 75ddfd5..dbaa653 100644
--- 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
@@ -23,7 +23,7 @@
/**
*
*/
-public class ModuleFactory {
+public class ModuleFactory implements IOrdered {
private IConfigurationElement element;
private ModuleFactoryDelegate delegate;
private List moduleTypes;
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ModuleObjectAdapter.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ModuleObjectAdapter.java
index 27ca801..d7f863e 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ModuleObjectAdapter.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ModuleObjectAdapter.java
@@ -14,13 +14,13 @@
import org.eclipse.core.runtime.Platform;
import org.osgi.framework.Bundle;
-import org.eclipse.wst.server.core.IModuleObject;
-import org.eclipse.wst.server.core.IModuleObjectAdapter;
+import org.eclipse.wst.server.core.IModuleArtifact;
+import org.eclipse.wst.server.core.IModuleArtifactAdapter;
import org.eclipse.wst.server.core.model.ModuleObjectAdapterDelegate;
/**
*
*/
-public class ModuleObjectAdapter implements IModuleObjectAdapter {
+public class ModuleObjectAdapter implements IModuleArtifactAdapter {
private IConfigurationElement element;
private ModuleObjectAdapterDelegate delegate;
@@ -75,9 +75,9 @@
}
/**
- * Converts from a model object to an IModuleObject.
+ * Converts from a model object to an IModuleArtifact.
*/
- public IModuleObject getModuleObject(Object obj) {
+ public IModuleArtifact getModuleObject(Object obj) {
try {
return getDelegate().getModuleObject(obj);
} catch (Exception e) {
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
index 7b1ca44..cdcf24a 100644
--- 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
@@ -314,7 +314,7 @@
*/
public boolean isServerProject() {
loadPreferences();
- return false;
+ return serverProject;
}
/**
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
index e721cbc..2312f2c 100644
--- 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
@@ -1,5 +1,5 @@
/**********************************************************************
- * Copyright (c) 2003 IBM Corporation and others.
+ * 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 Common Public License v1.0
* which accompanies this distribution, and is available at
@@ -31,7 +31,6 @@
*/
public class ResourceManager {
private static final String SERVER_DATA_FILE = "servers.xml";
- private static final String SERVER_CONFIGURATION_DATA_FILE = "configurations.xml";
private static final byte EVENT_ADDED = 0;
private static final byte EVENT_CHANGED = 1;
@@ -242,7 +241,6 @@
configurations = new ArrayList();
loadRuntimesList();
loadServersList();
- loadServerConfigurationsList();
pcl = new Preferences.IPropertyChangeListener() {
public void propertyChange(Preferences.PropertyChangeEvent event) {
@@ -409,27 +407,6 @@
serverListeners.remove(listener);
}
- /*
- *
- */
- public void addServerConfigurationLifecycleListener(IServerConfigurationLifecycleListener listener) {
- Trace.trace(Trace.LISTENERS, "Adding server configuration listener " + listener + " to " + this);
-
- if (serverConfigurationListeners == null)
- serverConfigurationListeners = new ArrayList(3);
- serverConfigurationListeners.add(listener);
- }
-
- /*
- *
- */
- public void removeServerConfigurationLifecycleListener(IServerConfigurationLifecycleListener listener) {
- Trace.trace(Trace.LISTENERS, "Removing server configuration listener " + listener + " from " + this);
-
- if (serverConfigurationListeners != null)
- serverConfigurationListeners.remove(listener);
- }
-
/**
* Deregister an existing runtime.
*
@@ -466,23 +443,6 @@
}
/**
- * Deregister an existing server resource.
- *
- * @param resource org.eclipse.core.resources.IResource
- */
- protected void deregisterServerConfiguration(IServerConfiguration configuration) {
- if (configuration == null)
- return;
-
- Trace.trace(Trace.RESOURCES, "Deregistering server configuration: " + configuration.getName());
-
- ((ServerConfiguration)configuration).dispose();
- resolveServers();
- fireServerConfigurationEvent(configuration, EVENT_REMOVED);
- configurations.remove(configuration);
- }
-
- /**
* Fire a runtime event.
*/
private void fireRuntimeEvent(final IRuntime runtime, byte b) {
@@ -538,69 +498,8 @@
}
}
Trace.trace(Trace.LISTENERS, "-<- Done firing server event -<-");
- }
-
- /**
- * Fire a server configuration event.
- */
- private void fireServerConfigurationEvent(final IServerConfiguration config, byte b) {
- Trace.trace(Trace.LISTENERS, "->- Firing server config event: " + config.getName() + " ->-");
-
- if (serverConfigurationListeners == null || serverConfigurationListeners.isEmpty())
- return;
-
- int size = serverConfigurationListeners.size();
- IServerConfigurationLifecycleListener[] srl = new IServerConfigurationLifecycleListener[size];
- serverListeners.toArray(srl);
-
- for (int i = 0; i < size; i++) {
- Trace.trace(Trace.LISTENERS, " Firing server config event to " + srl[i]);
- try {
- if (b == EVENT_ADDED)
- srl[i].serverConfigurationAdded(config);
- else if (b == EVENT_CHANGED)
- srl[i].serverConfigurationChanged(config);
- else
- srl[i].serverConfigurationRemoved(config);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, " Error firing server config event to " + srl[i], e);
- }
- }
- Trace.trace(Trace.LISTENERS, "-<- Done firing server config event -<-");
- }
+ }
- /**
- * Returns an array of all currently active server configurations.
- *
- * @return
- */
- public IServerConfiguration[] getServerConfigurations() {
- List list = new ArrayList(configurations);
- List list2 = ServerPlugin.sortServerResourceList(list);
-
- IServerConfiguration[] sc = new IServerConfiguration[list2.size()];
- list2.toArray(sc);
- return sc;
- }
-
- /**
- * Returns a list of all servers.
- *
- * @return java.util.List
- */
- public IServerConfiguration getServerConfiguration(String id) {
- if (id == null)
- throw new IllegalArgumentException();
-
- Iterator iterator = configurations.iterator();
- while (iterator.hasNext()) {
- IServerConfiguration config = (IServerConfiguration) iterator.next();
- if (id.equals(config.getId()))
- return config;
- }
- return null;
- }
-
protected void saveRuntimesList() {
try {
ignorePreferenceChanges = true;
@@ -650,26 +549,6 @@
}
}
- protected void saveServerConfigurationsList() {
- String filename = ServerPlugin.getInstance().getStateLocation().append(SERVER_CONFIGURATION_DATA_FILE).toOSString();
-
- try {
- XMLMemento memento = XMLMemento.createWriteRoot("server-configurations");
-
- Iterator iterator = configurations.iterator();
- while (iterator.hasNext()) {
- ServerConfiguration config = (ServerConfiguration) iterator.next();
-
- IMemento child = memento.createChild("configuration");
- config.save(child);
- }
-
- memento.saveToFile(filename);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not save server configurations", e);
- }
- }
-
protected void loadRuntimesList() {
Trace.trace(Trace.FINEST, "Loading runtime info");
Preferences prefs = ServerPlugin.getInstance().getPluginPreferences();
@@ -723,26 +602,6 @@
}
}
- protected void loadServerConfigurationsList() {
- Trace.trace(Trace.FINEST, "Loading server configuration info");
- String filename = ServerPlugin.getInstance().getStateLocation().append(SERVER_CONFIGURATION_DATA_FILE).toOSString();
-
- try {
- IMemento memento = XMLMemento.loadMemento(filename);
-
- IMemento[] children = memento.getChildren("configuration");
- int size = children.length;
-
- for (int i = 0; i < size; i++) {
- ServerConfiguration config = new ServerConfiguration(null);
- config.loadFromMemento(children[i], new NullProgressMonitor());
- configurations.add(config);
- }
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Could not load server configurations: " + e.getMessage());
- }
- }
-
protected void addRuntime(IRuntime runtime) {
if (runtime == null)
return;
@@ -781,23 +640,6 @@
}
}
- protected void addServerConfiguration(IServerConfiguration config) {
- if (!configurations.contains(config))
- registerServerConfiguration(config);
- else
- fireServerConfigurationEvent(config, EVENT_CHANGED);
- saveServerConfigurationsList();
- resolveServers();
- }
-
- protected void removeServerConfiguration(IServerConfiguration config) {
- if (configurations.contains(config)) {
- deregisterServerConfiguration(config);
- saveServerConfigurationsList();
- resolveServers();
- }
- }
-
/**
* Returns an array of all runtimes.
*
@@ -908,26 +750,6 @@
}
/**
- * Handle a change to the child projects of this configuration.
- *
- * @param configuration org.eclipse.wst.server.core.model.IServerConfiguration
- */
- protected void handleConfigurationChildProjectsChange(IServerConfiguration configuration) {
- /*String configRef = ServerCore.getServerConfigurationRef(configuration);
- if (configRef == null || configRef.length() == 0)
- return;
-
- Iterator iterator = ServerCore.getResourceManager().getServers().iterator();
- while (iterator.hasNext()) {
- IServer2 server = (IServer2) iterator.next();
- if (server.getServerConfiguration().equals(configuration)) {
- ServerControl control = (ServerControl) ServerCore.getServerControl(server);
- control.handleConfigurationChildProjectChange(configuration);
- }
- }*/
- }
-
- /**
* Returns true if the resource change was handled.
*
* @param delta org.eclipse.core.resources.IResourceDelta
@@ -997,12 +819,6 @@
return server;
}
- protected IServerConfiguration loadServerConfiguration(IFile file, IProgressMonitor monitor) throws CoreException {
- ServerConfiguration config = new ServerConfiguration(file);
- config.loadFromFile(monitor);
- return config;
- }
-
/**
* Tries to load a new server resource from the given resource.
* Returns true if the load and register were successful.
@@ -1027,19 +843,6 @@
} catch (Exception e) {
Trace.trace(Trace.SEVERE, "Error loading server", e);
}
- } else if (file.getFileExtension().equals(IServerConfiguration.FILE_EXTENSION)) {
-
- // try loading a server configuration
- try {
- IServerConfiguration config = loadServerConfiguration(file, ProgressUtil.getSubMonitorFor(monitor, 1000));
- if (config != null) {
- registerServerConfiguration(config);
- monitor.done();
- return true;
- }
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error loading configuration", e);
- }
}
monitor.done();
@@ -1071,29 +874,6 @@
deregisterServer(server);
}
}
-
- IServerConfiguration configuration = ServerUtil.findServerConfiguration(file);
- if (configuration != null) {
- found = true;
- try {
- Trace.trace(Trace.RESOURCES, "Reloading configuration: " + configuration);
- ((ServerConfiguration) configuration).loadFromFile(monitor);
- fireServerConfigurationEvent(configuration, EVENT_CHANGED);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error reloading configuration " + configuration.getName() + " from " + file + ": " + e.getMessage());
- deregisterServerConfiguration(configuration);
- }
-
- // TODO find any running servers that contain this configuration
- // notify the servers with this configuration
- /*Iterator iterator = getServers().iterator();
- while (iterator.hasNext()) {
- IServer server2 = (IServer) iterator.next();
- if (server2.getServerConfiguration().equals(configuration))
- server2.updateConfiguration();
- }*/
- fireServerConfigurationEvent(configuration, EVENT_CHANGED);
- }
Trace.trace(Trace.RESOURCES, "No server resource found at: " + file);
@@ -1116,12 +896,7 @@
deregisterServer(server);
return true;
}
- IServerConfiguration config = ServerUtil.findServerConfiguration(file);
- if (config != null) {
- deregisterServerConfiguration(config);
- return true;
- }
-
+
Trace.trace(Trace.RESOURCES, "No server resource found at: " + file);
return false;
}
@@ -1221,23 +996,6 @@
}
/**
- * Registers a new server configuration resource.
- *
- * @param resource org.eclipse.core.resources.IResource
- * @param element org.eclipse.wst.server.core.model.IServerResource
- */
- protected void registerServerConfiguration(IServerConfiguration config) {
- if (config == null)
- return;
-
- Trace.trace(Trace.RESOURCES, "Registering server configuration: " + config.getName());
-
- configurations.add(config);
- resolveServers();
- fireServerConfigurationEvent(config, EVENT_ADDED);
- }
-
- /**
*
*/
protected void addModuleFactoryListener(ModuleFactoryDelegate delegate) {
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
index 25a55e1..44d702b 100644
--- 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
@@ -11,6 +11,7 @@
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.IRuntimeLocator;
import org.eclipse.wst.server.core.model.RuntimeLocatorDelegate;
@@ -83,9 +84,9 @@
/*
* @see IRuntimeLocator#searchForRuntimes()
*/
- public void searchForRuntimes(Listener found, IProgressMonitor monitor) {
+ public void searchForRuntimes(IPath path, RuntimeSearchListener found, IProgressMonitor monitor) {
try {
- getDelegate().searchForRuntimes(found, monitor);
+ getDelegate().searchForRuntimes(path, found, monitor);
} catch (Exception e) {
Trace.trace(Trace.SEVERE, "Error calling delegate " + toString() + ": " + e.getMessage());
}
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
index 796144f..d4fc79f 100644
--- 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
@@ -37,7 +37,7 @@
protected ServerBehaviourDelegate behaviourDelegate;
protected IRuntime runtime;
- protected IServerConfiguration configuration;
+ protected IPath configuration;
protected String mode;
protected int serverState = STATE_UNKNOWN;
@@ -114,7 +114,7 @@
/* (non-Javadoc)
* @see com.ibm.wtp.server.core.IServer2#getServerConfiguration()
*/
- public IServerConfiguration getServerConfiguration() {
+ public IPath getServerConfiguration() {
return configuration;
}
@@ -186,13 +186,19 @@
* Returns true if this is a configuration that is
* applicable to (can be used with) this server.
*
- * @param configuration org.eclipse.wst.server.core.model.IServerConfiguration
+ * @param configuration
* @return boolean
*/
- public boolean isSupportedConfiguration(IServerConfiguration configuration2) {
- if (!getServerType().hasServerConfiguration() || configuration2 == null)
+ public boolean isSupportedConfiguration(IPath configuration2) {
+ /*if (!getServerType().hasServerConfiguration() || configuration2 == null)
return false;
- return getServerType().getServerConfigurationType().equals(configuration2.getServerConfigurationType());
+ return getServerType().getServerConfigurationType().equals(configuration2.getServerConfigurationType());*/
+ try {
+ return getDelegate().isSupportedConfiguration(configuration2);
+ } catch (Exception e) {
+ Trace.trace(Trace.SEVERE, "Error calling delegate getModules() " + toString(), e);
+ return false;
+ }
}
public String getHost() {
@@ -391,7 +397,7 @@
//Trace.trace(Trace.FINEST, "> handleDeployableProjectChange() " + server + " " + delta + " " + moduleProjects);
final int size = moduleProjects.length;
//final IModuleResourceDelta[] deployableDelta = new IModuleResourceDelta[size];
- // TODO
+ // TODO: module changes
IModuleVisitor visitor = new IModuleVisitor() {
public boolean visit(IModule[] parents, IModule module) {
if (module.getProject() == null)
@@ -874,17 +880,14 @@
List tasks = new ArrayList();
String serverTypeId = getServerType().getId();
- String serverConfigurationTypeId = null;
- if (configuration != null)
- serverConfigurationTypeId = configuration.getServerConfigurationType().getId();
IServerTask[] serverTasks = ServerCore.getServerTasks();
if (serverTasks != null) {
int size = serverTasks.length;
for (int i = 0; i < size; i++) {
IServerTask task = serverTasks[i];
- if ((task.supportsType(serverTypeId)) || (serverConfigurationTypeId != null && task.supportsType(serverConfigurationTypeId))) {
- IOptionalTask[] tasks2 = task.getTasks(this, configuration, parents, modules);
+ if (task.supportsType(serverTypeId)) {
+ IOptionalTask[] tasks2 = task.getTasks(this, parents, modules);
if (tasks2 != null) {
int size2 = tasks2.length;
for (int j = 0; j < size2; j++) {
@@ -1025,7 +1028,15 @@
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();
@@ -1331,7 +1342,7 @@
* @see IServer#synchronousRestart(String, IProgressMonitor)
*/
public void synchronousRestart(String mode2, IProgressMonitor monitor) throws CoreException {
- // TODO
+ // TODO: synchronousRestart
}
/*
@@ -1532,10 +1543,12 @@
String runtimeId = getAttribute(RUNTIME_ID, (String)null);
runtime = ServerCore.findRuntime(runtimeId);
- String configurationId = getAttribute(CONFIGURATION_ID, (String)null);
- configuration = ServerCore.findServerConfiguration(configurationId);
+ String configPath = getAttribute(CONFIGURATION_ID, (String)null);
+ configuration = null;
+ if (configPath != null)
+ configuration = new Path(configPath);
}
-
+
protected void setInternal(ServerWorkingCopy wc) {
map = wc.map;
configuration = wc.configuration;
@@ -1554,7 +1567,7 @@
memento.putString("server-type", serverType.getId());
if (configuration != null)
- memento.putString(CONFIGURATION_ID, configuration.getId());
+ memento.putString(CONFIGURATION_ID, configuration.toPortableString());
else
memento.putString(CONFIGURATION_ID, null);
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerConfiguration.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerConfiguration.java
deleted file mode 100644
index 4b31f69..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerConfiguration.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2003 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 java.io.File;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.runtime.*;
-import org.osgi.framework.Bundle;
-
-import org.eclipse.wst.server.core.*;
-import org.eclipse.wst.server.core.model.*;
-import org.eclipse.wst.server.core.util.FileUtil;
-/**
- *
- */
-public class ServerConfiguration extends Base implements IServerConfiguration {
- protected IServerConfigurationType configurationType;
- protected ServerConfigurationDelegate delegate;
- protected boolean isDataLoaded = false;
-
- // working copy, loaded resource
- public ServerConfiguration(IFile file) {
- super(file);
- }
-
- // creation (working copy)
- public ServerConfiguration(String id, IFile file, IServerConfigurationType type) {
- super(file, id);
- this.configurationType = type;
- }
-
- public ServerConfigurationDelegate getDelegate(IProgressMonitor monitor) {
- if (delegate != null)
- return delegate;
-
- synchronized (this) {
- if (delegate == null) {
- try {
- long time = System.currentTimeMillis();
- ServerConfigurationType configType = (ServerConfigurationType) configurationType;
- delegate = (ServerConfigurationDelegate) configType.getElement().createExecutableExtension("class");
- delegate.initialize(this);
- loadData(monitor);
- Trace.trace(Trace.PERFORMANCE, "ServerConfiguration.getDelegate(): <" + (System.currentTimeMillis() - time) + "> " + getServerConfigurationType().getId());
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not create delegate " + toString(), e);
- }
- }
- }
- return delegate;
- }
-
- /**
- * Returns true if the delegate has been loaded.
- *
- * @return
- */
- public boolean isDelegateLoaded() {
- return delegate != null;
- }
-
- public void dispose() {
- if (delegate != null)
- delegate.dispose();
- }
-
- public boolean isDelegatePluginActivated() {
- IConfigurationElement element = ((ServerConfigurationType) configurationType).getElement();
- String pluginId = element.getDeclaringExtension().getNamespace();
- return Platform.getBundle(pluginId).getState() == Bundle.ACTIVE;
- }
-
- public IServerConfigurationWorkingCopy createWorkingCopy() {
- return new ServerConfigurationWorkingCopy(this);
- }
-
- public void delete() throws CoreException {
- if (file != null) {
- file.delete(true, true, new NullProgressMonitor());
- if (getServerConfigurationType().isFolder()) {
- IFolder folder = getFolder(false);
- if (folder.exists())
- folder.delete(true, true, new NullProgressMonitor());
- }
- } else
- deleteFromMetadata();
- }
-
- public IServerConfigurationType getServerConfigurationType() {
- return configurationType;
- }
-
- public IFolder getConfigurationDataFolder() {
- if (file == null)
- return null;
- try {
- return getFolder(false);
- } catch (Exception e) {
- return null;
- }
- }
-
- public IPath getConfigurationDataPath() {
- if (file != null)
- return null;
- return getPath(false);
- }
-
- protected IFolder getFolder(boolean create) throws CoreException {
- IPath path = file.getProjectRelativePath();
- path = path.removeLastSegments(1).append(file.getName() + "-data");
- IFolder folder = file.getProject().getFolder(path);
- if (!folder.exists() && create)
- folder.create(true, true, new NullProgressMonitor());
- return folder;
- }
-
- protected IPath getPath(boolean create) {
- IPath path = ServerPlugin.getInstance().getStateLocation().append("configs");
- path = path.append(getId() + "-data");
- if (create) {
- File file2 = path.toFile();
- if (!file2.exists())
- file2.mkdirs();
- }
- return path;
- }
-
- protected void loadData(IProgressMonitor monitor) {
- if (isDataLoaded)
- return;
- isDataLoaded = true;
- if (!getServerConfigurationType().isFolder())
- return;
-
- try {
- if (file != null) {
- IFolder folder = getFolder(false);
- getDelegate(monitor).load(folder, new NullProgressMonitor());
- } else {
- IPath path = getPath(false);
- getDelegate(monitor).load(path, new NullProgressMonitor());
- }
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not load server configuration data", e);
- }
- }
-
- protected void saveData(boolean create, IProgressMonitor monitor) {
- if (!isDataLoaded || !getServerConfigurationType().isFolder())
- return;
-
- try {
- if (file != null) {
- IFolder folder = getFolder(create);
- getDelegate(monitor).save(folder, new NullProgressMonitor());
- } else {
- IPath path = getPath(create);
- getDelegate(monitor).save(path, new NullProgressMonitor());
- }
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not save server configuration data", e);
- }
- }
-
- protected void saveToFile(IProgressMonitor monitor) throws CoreException {
- super.saveToFile(monitor);
-
- saveData(true, monitor);
- }
-
- protected void loadFromFile(IProgressMonitor monitor) throws CoreException {
- super.loadFromFile(monitor);
-
- //loadData();
- }
-
- protected void deleteFromMetadata() {
- ResourceManager.getInstance().removeServerConfiguration(this);
-
- if (getServerConfigurationType().isFolder()) {
- try {
- IPath path = getPath(false);
- File file2 = path.toFile();
- if (file2.exists())
- FileUtil.deleteDirectory(file2, new NullProgressMonitor());
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not save server configuration", e);
- }
- }
- }
-
- protected void saveToMetadata(IProgressMonitor monitor) {
- super.saveToMetadata(monitor);
- ResourceManager.getInstance().addServerConfiguration(this);
-
- saveData(true, monitor);
- }
-
- protected String getXMLRoot() {
- return "server-configuration";
- }
-
- protected void setInternal(ServerConfigurationWorkingCopy wc) {
- map = wc.map;
- configurationType = wc.configurationType;
- isDataLoaded = false; //wc.isDataLoaded; let the wc save it
- delegate = wc.delegate;
-
- int timestamp = wc.getTimestamp();
- map.put("timestamp", Integer.toString(timestamp+1));
- }
-
- protected void loadFromMemento(IMemento memento, IProgressMonitor monitor) {
- super.loadFromMemento(memento, monitor);
-
- //loadData();
- }
-
- protected void loadState(IMemento memento) {
- String serverTypeId = memento.getString("server-configuration-type-id");
- configurationType = ServerCore.findServerConfigurationType(serverTypeId);
- }
-
- protected void saveState(IMemento memento) {
- if (configurationType != null)
- memento.putString("server-configuration-type-id", configurationType.getId());
- }
-
- public IStatus validateEdit(Object context) {
- if (file == null)
- return null;
-
- // TODO
- return file.getWorkspace().validateEdit(new IFile[] { file }, context);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
- */
- public Object getAdapter(Class adapter) {
- ServerConfigurationDelegate delegate2 = getDelegate(null);
- if (adapter.isInstance(delegate2))
- return delegate;
- return null;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerConfigurationType.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerConfigurationType.java
deleted file mode 100644
index 4baa001..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerConfigurationType.java
+++ /dev/null
@@ -1,119 +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 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.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-
-import org.eclipse.wst.server.core.*;
-/**
- *
- */
-public class ServerConfigurationType implements IServerConfigurationType, IOrdered {
- protected IConfigurationElement element;
-
- /**
- * ServerConfigurationType constructor comment.
- */
- public ServerConfigurationType(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");
- }
-
- /**
- * Returns the order.
- *
- * @return int
- */
- public int getOrder() {
- try {
- String o = element.getAttribute("order");
- return Integer.parseInt(o);
- } catch (NumberFormatException e) {
- return -1;
- }
- }
-
- public boolean isFolder() {
- return "true".equalsIgnoreCase(element.getAttribute("isFolder"));
- }
-
- /**
- * Return the import extensions.
- *
- * @return java.lang.String
- */
- public String[] getImportFilterExtensions() {
- String importExt = element.getAttribute("importExtensions");
- if (importExt == null || importExt.length() < 1)
- return null;
- return ServerPlugin.tokenize(importExt, ",");
- }
-
- public IServerConfigurationWorkingCopy createServerConfiguration(String id, IFile file, IProgressMonitor monitor) {
- if (id == null || id.length() == 0)
- id = ServerPlugin.generateId();
- ServerConfigurationWorkingCopy scwc = new ServerConfigurationWorkingCopy(id, file, this);
- scwc.setDefaults(monitor);
- return scwc;
- }
-
- public IServerConfigurationWorkingCopy importFromRuntime(String id, IFile file, IRuntime runtime, IProgressMonitor monitor) throws CoreException {
- if (id == null || id.length() == 0)
- id = ServerPlugin.generateId();
- ServerConfigurationWorkingCopy scwc = new ServerConfigurationWorkingCopy(id, file, this);
- scwc.setDefaults(monitor);
- scwc.importFromRuntime(runtime, monitor);
- return scwc;
- }
-
- public IServerConfigurationWorkingCopy importFromPath(String id, IFile file, IPath path, IProgressMonitor monitor) throws CoreException {
- if (id == null || id.length() == 0)
- id = ServerPlugin.generateId();
- ServerConfigurationWorkingCopy scwc = new ServerConfigurationWorkingCopy(id, file, this);
- scwc.setDefaults(monitor);
- scwc.importFromPath(path, monitor);
- return scwc;
- }
-
- /**
- * Return a string representation of this object.
- *
- * @return java.lang.String
- */
- public String toString() {
- return "ServerConfigurationType[" + getId() + "]";
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerConfigurationWorkingCopy.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerConfigurationWorkingCopy.java
deleted file mode 100644
index ee99da3..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerConfigurationWorkingCopy.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2003 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 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.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.wst.server.core.*;
-import org.eclipse.wst.server.core.model.ServerConfigurationDelegate;
-/**
- *
- */
-public class ServerConfigurationWorkingCopy extends ServerConfiguration implements IServerConfigurationWorkingCopy {
- protected ServerConfiguration config;
- protected WorkingCopyHelper wch;
-
- protected ServerConfigurationDelegate workingCopyDelegate;
-
- // working copy
- public ServerConfigurationWorkingCopy(ServerConfiguration config) {
- super(config.getFile());
- this.config = config;
- this.configurationType = config.configurationType;
-
- map = new HashMap(config.map);
- wch = new WorkingCopyHelper(this);
- }
-
- // creation
- public ServerConfigurationWorkingCopy(String id, IFile file, IServerConfigurationType configType) {
- super(id, file, configType);
- //this.config = this;
- wch = new WorkingCopyHelper(this);
- wch.setDirty(true);
- }
-
- public boolean isWorkingCopy() {
- return true;
- }
-
- public IServerConfiguration getOriginal() {
- return config;
- }
-
- public IServerConfigurationWorkingCopy 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);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.server.core.IServerWorkingCopy#setName(java.lang.String)
- */
- public void setName(String name) {
- wch.setName(name);
- }
-
- public void setLocked(boolean b) {
- wch.setLocked(b);
- }
-
- public void setPrivate(boolean b) {
- wch.setPrivate(b);
- }
-
- 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 IServerConfiguration save(boolean force, IProgressMonitor monitor) throws CoreException {
- monitor = ProgressUtil.getMonitorFor(monitor);
- monitor.subTask(ServerPlugin.getResource("%savingTask", getName()));
-
- if (!force)
- wch.validateTimestamp(getOriginal());
-
- if (config == null)
- config = new ServerConfiguration(file);
-
- config.setInternal(this);
- config.doSave(monitor);
- saveData(true, monitor);
- wch.setDirty(false);
-
- return config;
- }
-
- public ServerConfigurationDelegate getWorkingCopyDelegate(boolean load, IProgressMonitor monitor) {
- if (workingCopyDelegate != null)
- return workingCopyDelegate;
-
- synchronized (this) {
- if (workingCopyDelegate == null) {
- try {
- long time = System.currentTimeMillis();
- ServerConfigurationType configType = (ServerConfigurationType) configurationType;
- workingCopyDelegate = (ServerConfigurationDelegate) configType.getElement().createExecutableExtension("class");
- workingCopyDelegate.initialize(this);
- if (load)
- loadData(monitor);
- Trace.trace(Trace.PERFORMANCE, "ServerConfigurationWorkingCopy.getWorkingCopyDelegate(): <" + (System.currentTimeMillis() - time) + "> " + getServerConfigurationType().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(false, monitor).setDefaults();
- isDataLoaded = true;
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error calling delegate setDefaults() " + toString(), e);
- }
- }
-
- public void importFromPath(IPath path, IProgressMonitor monitor) throws CoreException {
- try {
- getWorkingCopyDelegate(false, monitor).importFromPath(path, monitor);
- isDataLoaded = true;
- } catch (CoreException ce) {
- throw ce;
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error calling delegate importFromPath() " + toString(), e);
- }
- }
-
- public void importFromRuntime(IRuntime runtime, IProgressMonitor monitor) throws CoreException {
- try {
- getWorkingCopyDelegate(false, monitor).importFromRuntime(runtime, monitor);
- isDataLoaded = true;
- } catch (CoreException ce) {
- throw ce;
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error calling delegate importFromRuntime() " + toString(), e);
- }
- }
-
- public String toString() {
- return "ServerConfigurationWorkingCopy " + getId();
- }
-}
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
index ecd25fb..f5da62a 100644
--- 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
@@ -73,10 +73,10 @@
/*
* @see
*/
- public IOptionalTask[] getTasks(IServer server, IServerConfiguration configuration, List[] parents, IModule[] modules) {
+ public IOptionalTask[] getTasks(IServer server, List[] parents, IModule[] modules) {
try {
Trace.trace(Trace.FINEST, "Task.init " + this);
- return getDelegate().getTasks(server, configuration, parents, modules);
+ return getDelegate().getTasks(server, parents, modules);
} catch (Exception e) {
Trace.trace(Trace.SEVERE, "Error calling delegate " + toString() + ": " + e.getMessage());
}
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
index adf5e1a..a982cc8 100644
--- 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
@@ -104,10 +104,10 @@
return configType.supportsMode(launchMode);
}
- public IServerConfigurationType getServerConfigurationType() {
+ /*public IServerConfigurationType getServerConfigurationType() {
String configurationTypeId = element.getAttribute("configurationTypeId");
return ServerCore.findServerConfigurationType(configurationTypeId);
- }
+ }*/
public boolean supportsRemoteHosts() {
String hosts = element.getAttribute("supportsRemoteHosts");
@@ -138,10 +138,9 @@
}
public boolean hasServerConfiguration() {
- String configurationTypeId = element.getAttribute("configurationTypeId");
- return configurationTypeId != null && configurationTypeId.length() > 0;
+ return ("true".equalsIgnoreCase(element.getAttribute("hasConfiguration")));
}
-
+
public IServerWorkingCopy createServer(String id, IFile file, IRuntime runtime, IProgressMonitor monitor) {
if (id == null || id.length() == 0)
id = ServerPlugin.generateId();
@@ -178,7 +177,8 @@
if (runtime != null)
swc.setRuntime(runtime);
- IServerConfigurationWorkingCopy config = null;
+ //TODO: import server config
+ /* IServerConfigurationWorkingCopy config = null;
if (hasServerConfiguration()) {
if (runtime != null)
config = getServerConfigurationType().importFromRuntime(id + "-config", file, runtime, monitor);
@@ -187,7 +187,7 @@
ServerUtil.setServerConfigurationDefaultName(config);
if (config != null)
swc.setServerConfiguration(config);
- }
+ }*/
swc.setDefaults(monitor);
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
index 8e09e55..1ea3aa6 100644
--- 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
@@ -111,12 +111,12 @@
setAttribute(PROP_HOSTNAME, host);
}
- public void setServerConfiguration(IServerConfiguration config) {
+ public void setServerConfiguration(IPath config) {
this.configuration = config;
if (configuration == null)
setAttribute(CONFIGURATION_ID, (String)null);
else
- setAttribute(CONFIGURATION_ID, configuration.getId());
+ setAttribute(CONFIGURATION_ID, configuration.toPortableString());
}
public void setFile(IFile file) {
@@ -188,11 +188,6 @@
wc.save(force, monitor);
}
- if (configuration != null && configuration.isWorkingCopy()) {
- IServerConfigurationWorkingCopy wc = (IServerConfigurationWorkingCopy) configuration;
- wc.save(force, monitor);
- }
-
return save(force, monitor);
}
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
index adaece7..b1aa0c4 100644
--- 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
@@ -127,7 +127,7 @@
*/
public void addPropertyChangeListener(PropertyChangeListener listener) {
if (propertyListeners == null)
- propertyListeners = new ArrayList();
+ propertyListeners = new ArrayList(2);
propertyListeners.add(listener);
}
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
index 72db2a3..de5b724 100644
--- 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
@@ -12,11 +12,11 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.wst.server.core.ILaunchable;
-import org.eclipse.wst.server.core.IModuleObject;
+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 IModuleObject to an ILaunchable.
+ * an IModuleArtifact to an ILaunchable.
*
* <p>This is the implementation of a launchableAdapter extension point.</p>
*/
@@ -29,5 +29,5 @@
* @return
* @exception
*/
- public abstract ILaunchable getLaunchable(IServer server, IModuleObject moduleObject) throws CoreException;
+ public abstract ILaunchable getLaunchable(IServer server, IModuleArtifact moduleObject) throws CoreException;
}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ModuleObjectAdapterDelegate.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ModuleObjectAdapterDelegate.java
index 8a5051d..5a19a6f 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ModuleObjectAdapterDelegate.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ModuleObjectAdapterDelegate.java
@@ -10,7 +10,7 @@
**********************************************************************/
package org.eclipse.wst.server.core.model;
-import org.eclipse.wst.server.core.IModuleObject;
+import org.eclipse.wst.server.core.IModuleArtifact;
/**
* A module object adapter converts from some view's model
* object into a module object that is recognized by the
@@ -20,10 +20,10 @@
*/
public abstract class ModuleObjectAdapterDelegate {
/**
- * Converts from a model object to an IModuleObject.
+ * Converts from a model object to an IModuleArtifact.
*
* @param obj
* @return
*/
- public abstract IModuleObject getModuleObject(Object obj);
+ public abstract IModuleArtifact getModuleObject(Object obj);
}
\ 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
index 654cbf3..25fe3e9 100644
--- 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
@@ -10,6 +10,7 @@
**********************************************************************/
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.IRuntimeLocator;
/**
@@ -27,11 +28,14 @@
/**
* 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
- * @see IRuntimeLocator.searchForRuntimes(IRuntimeLocator.Listener, IProgressMonitor)
+ * @see IRuntimeLocator.searchForRuntimes(IPath, IRuntimeLocator.RuntimeSearchListener, IProgressMonitor)
*/
- public abstract void searchForRuntimes(IRuntimeLocator.Listener listener, IProgressMonitor monitor);
+ public abstract void searchForRuntimes(IPath path, IRuntimeLocator.RuntimeSearchListener 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/ServerConfigurationDelegate.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ServerConfigurationDelegate.java
deleted file mode 100644
index 4a5222d..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ServerConfigurationDelegate.java
+++ /dev/null
@@ -1,90 +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 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.model;
-
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.IServerConfiguration;
-import org.eclipse.wst.server.core.IServerConfigurationWorkingCopy;
-import org.eclipse.wst.server.core.internal.ServerConfiguration;
-import org.eclipse.wst.server.core.internal.ServerConfigurationWorkingCopy;
-/**
- * A server configuration. Server configurations usually contain
- * directories (the resources to be run on the server) and configuration
- * information. (i.e. mime types, data sources, etc.)
- * <p>
- * This abstract class is intended to be extended only by clients
- * to extend the <code>serverConfigurationTypes</code> extension point.
- * </p>
- */
-public abstract class ServerConfigurationDelegate {
- private ServerConfiguration configuration;
- private ServerConfigurationWorkingCopy configurationWC;
-
- /**
- * Called when the server is loaded as a model object.
- */
- public final void initialize(ServerConfiguration configuration2) {
- configuration = configuration2;
- if (configuration instanceof ServerConfigurationWorkingCopy)
- configurationWC = (ServerConfigurationWorkingCopy) configuration;
- initialize();
- }
-
- public void initialize() {
- // do nothing
- }
-
- public IServerConfiguration getServerConfiguration() {
- return configuration;
- }
-
- public IServerConfigurationWorkingCopy getServerConfigurationWC() {
- return configurationWC;
- }
-
- /**
- * Called when this server resource has become invalid or no longer
- * required and is being deregistered or dicarded. This method can
- * be used to remove listeners, etc.
- */
- public void dispose() {
- configuration = null;
- }
-
- public void load(IPath path, IProgressMonitor monitor) throws CoreException {
- throw new CoreException(null);
- }
-
- public void load(IFolder folder, IProgressMonitor monitor) throws CoreException {
- throw new CoreException(null);
- }
-
- public abstract void save(IPath path, IProgressMonitor monitor) throws CoreException;
-
- public abstract void save(IFolder folder, IProgressMonitor monitor) throws CoreException;
-
- /**
- * Initializes this server configuration with default values. This method is called when
- * a new configuration is created so that the configuration can be initialized with
- * meaningful values.
- */
- public void setDefaults() {
- // do nothing;
- }
-
- public abstract void importFromPath(IPath path, IProgressMonitor monitor) throws CoreException;
-
- public abstract void importFromRuntime(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/ServerDelegate.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ServerDelegate.java
index bd5015a..0f591df 100644
--- 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
@@ -14,9 +14,11 @@
import java.util.Map;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
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.IRuntime;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.IServerPort;
import org.eclipse.wst.server.core.IServerWorkingCopy;
@@ -309,4 +311,19 @@
* @throws CoreException [missing]
*/
public abstract void modifyModules(IModule[] add, IModule[] remove, IProgressMonitor monitor) throws CoreException;
+
+ /**
+ * Returns true if this is a configuration that is
+ * applicable to (can be used with) this server.
+ *
+ * @param configuration
+ * @return boolean
+ */
+ public boolean isSupportedConfiguration(IPath configuration2) {
+ return true;
+ }
+
+ public void importConfiguration(IRuntime runtime, IProgressMonitor monitor) {
+ // do nothing
+ }
}
\ 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
index f8ceaba..8c64203 100644
--- 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
@@ -15,7 +15,6 @@
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IOptionalTask;
import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.IServerConfiguration;
/**
* A server task delegate.
*
@@ -27,5 +26,5 @@
*
* @return the tasks that should be performed on the server.
*/
- public abstract IOptionalTask[] getTasks(IServer server, IServerConfiguration configuration, List[] parents, IModule[] modules);
+ 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/util/HttpLaunchable.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/HttpLaunchable.java
index 2cc4957..e8c984b 100644
--- 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
@@ -36,4 +36,4 @@
public String toString() {
return "HttpLaunchable[id=" + getId() + ", 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/PingThread.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/PingThread.java
index e3b5478..8e101ed 100644
--- 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
@@ -29,7 +29,7 @@
private static final int PING_INTERVAL = 250;
// maximum number of pings before giving up
- private static final int MAX_PINGS = 56; // total: 16 seconds
+ private int maxPings = 56; // total: 16 seconds + connection time
private boolean stop = false;
private String url;
@@ -44,14 +44,15 @@
* @param url
* @param mode
*/
- public PingThread(IServer server2, ServerBehaviourDelegate server, String url) {
+ 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() {
- run();
+ ping();
}
};
t.setDaemon(true);
@@ -62,7 +63,7 @@
* Ping the server until it is started. Then set the server
* state to STATE_STARTED.
*/
- protected void run() {
+ protected void ping() {
int count = 0;
try {
Thread.sleep(PING_DELAY);
@@ -71,16 +72,17 @@
}
while (!stop) {
try {
- if (count == MAX_PINGS) {
+ 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();
- count++;
// ping worked - server is up
if (!stop) {
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/ServerConfigurationLifecycleAdapter.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/ServerConfigurationLifecycleAdapter.java
deleted file mode 100644
index 9da4836..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/ServerConfigurationLifecycleAdapter.java
+++ /dev/null
@@ -1,30 +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 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.util;
-
-import org.eclipse.wst.server.core.IServerConfiguration;
-import org.eclipse.wst.server.core.IServerConfigurationLifecycleListener;
-/**
- *
- */
-public class ServerConfigurationLifecycleAdapter implements IServerConfigurationLifecycleListener {
- public void serverConfigurationAdded(IServerConfiguration serverConfiguration) {
- // do nothing
- }
-
- public void serverConfigurationChanged(IServerConfiguration serverConfiguration) {
- // do nothing
- }
-
- public void serverConfigurationRemoved(IServerConfiguration serverConfiguration) {
- // 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
index f9a3853..f85a715 100644
--- 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
@@ -116,4 +116,8 @@
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.ui/plugin.properties b/plugins/org.eclipse.wst.server.ui/plugin.properties
index d8a3cdc..7f4ee67 100644
--- a/plugins/org.eclipse.wst.server.ui/plugin.properties
+++ b/plugins/org.eclipse.wst.server.ui/plugin.properties
@@ -406,9 +406,7 @@
serverEditorOverviewServerName=Server name:
serverEditorOverviewServerNameCommand=set server name
serverEditorOverviewServerNameDescription=Set the server name
-serverEditorOverviewServerConfigurationName=Server configuration name:
-serverEditorOverviewServerConfigurationNameCommand=set server configuration name
-serverEditorOverviewServerConfigurationNameDescription=Set the server configuration name
+serverEditorOverviewServerConfigurationPath=Server configuration path:
serverEditorOverviewServerHostname=Host name:
serverEditorOverviewServerHostnameCommand=set host name
serverEditorOverviewServerHostnameDescription=Set the host name
diff --git a/plugins/org.eclipse.wst.server.ui/plugin.xml b/plugins/org.eclipse.wst.server.ui/plugin.xml
index 6870d8a..acc52b2 100644
--- a/plugins/org.eclipse.wst.server.ui/plugin.xml
+++ b/plugins/org.eclipse.wst.server.ui/plugin.xml
@@ -55,6 +55,7 @@
</wizard>
</extension>
+<!--
<extension point="org.eclipse.ui.importWizards">
<wizard
id="org.eclipse.wst.server.ui.import.configuration"
@@ -64,6 +65,7 @@
<description>%importServerConfigurationDescription</description>
</wizard>
</extension>
+-->
<extension point="org.eclipse.ui.views">
<category
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
index 7261f24..19ee93f 100644
--- 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
@@ -53,17 +53,14 @@
*
* @param server
*/
- public static void editServer(IServer server, IServerConfiguration configuration) {
- if (server == null && configuration == null)
+ public static void editServer(IServer server) {
+ if (server == null)
return;
String serverId = null;
if (server != null)
serverId = server.getId();
- String configurationId = null;
- if (configuration != null)
- configurationId = configuration.getId();
- editServer(serverId, configurationId);
+ editServer(serverId);
}
/**
@@ -71,15 +68,15 @@
*
* @param serverId
*/
- public static void editServer(String serverId, String configurationId) {
- if (serverId == null && configurationId == null)
+ public 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, configurationId);
+ IServerEditorInput input = new ServerEditorInput(serverId);
page.openEditor(input, IServerEditorInput.EDITOR_ID);
} catch (Exception e) {
Trace.trace(Trace.SEVERE, "Error opening server editor", e);
@@ -123,34 +120,6 @@
return false;
}
- IServerConfiguration config = server.getServerConfiguration();
- if (config != null)
- return promptIfDirty(shell, config);
- return true;
- }
-
- /**
- * Prompts the user if the server configuration 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, IServerConfiguration configuration) {
- if (configuration == null || !(configuration instanceof IServerConfigurationWorkingCopy))
- return false;
-
- String title = ServerUIPlugin.getResource("%resourceDirtyDialogTitle");
-
- IServerConfigurationWorkingCopy wc = (IServerConfigurationWorkingCopy) configuration;
- if (wc.isDirty()) {
- String message = ServerUIPlugin.getResource("%resourceDirtyDialogMessage", configuration.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;
}
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/editor/IServerEditorInput.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/editor/IServerEditorInput.java
index 0902336..660b3df 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/editor/IServerEditorInput.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/editor/IServerEditorInput.java
@@ -28,11 +28,4 @@
* @return java.lang.String
*/
public String getServerId();
-
- /**
- * Returns the server configuration id.
- *
- * @return java.lang.String
- */
- public String getServerConfigurationId();
}
\ 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
index 6694435..6cdd413 100644
--- 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
@@ -12,7 +12,6 @@
import org.eclipse.ui.IEditorInput;
-import org.eclipse.wst.server.core.IServerConfigurationWorkingCopy;
import org.eclipse.wst.server.core.IServerWorkingCopy;
/**
*
@@ -40,27 +39,4 @@
* @param commandManager ICommandManager
*/
public ICommandManager getServerCommandManager();
-
- /**
- * Returns the server configuration to be edited.
- *
- * @return IServerConfigurationWorkingCopy
- */
- public IServerConfigurationWorkingCopy getServerConfiguration();
-
- /**
- * Returns true if the server configuration is read-only.
- *
- * @return boolean
- */
- public boolean isServerConfigurationReadOnly();
-
- /**
- * 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 configuration.
- *
- * @param commandManager ICommandManager
- */
- public ICommandManager getServerConfigurationCommandManager();
}
\ 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
index b044d57..1757e88 100644
--- 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
@@ -25,7 +25,9 @@
*
* @param server
*/
- public abstract boolean shouldDisplay(IServerWorkingCopy server);
+ public boolean shouldDisplay(IServerWorkingCopy server) {
+ return true;
+ }
/**
* Create the action.
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
index 28baf5e..31cd62c 100644
--- 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
@@ -21,7 +21,9 @@
* instance) complex configuration pages to only be shown when used
* with non-unittest servers.
*/
- public abstract boolean shouldCreateSection(IServerWorkingCopy server);
+ public boolean shouldCreateSection(IServerWorkingCopy server) {
+ return true;
+ }
/**
* Create the editor page section.
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
index 471f424..c4d77bb 100644
--- 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
@@ -21,7 +21,6 @@
import org.eclipse.ui.IEditorSite;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.part.EditorPart;
-import org.eclipse.wst.server.core.IServerConfigurationWorkingCopy;
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;
@@ -43,7 +42,6 @@
protected IServerEditorPartFactory pageFactory;
protected IServerWorkingCopy server;
- protected IServerConfigurationWorkingCopy serverConfiguration;
protected ICommandManager commandManager;
protected boolean readOnly;
@@ -169,11 +167,7 @@
String serverTypeId = null;
if (server != null)
serverTypeId = server.getServerType().getId();
- String serverConfigurationTypeId = null;
- if (serverConfiguration != null)
- serverConfigurationTypeId = serverConfiguration.getServerConfigurationType().getId();
- if (((serverTypeId != null && factory.supportsType(serverTypeId)) ||
- (serverConfigurationTypeId != null && factory.supportsType(serverConfigurationTypeId)))
+ if (serverTypeId != null && factory.supportsType(serverTypeId)
&& factory.shouldCreateSection(server)) {
IServerEditorSection section = factory.createSection();
if (section instanceof ServerEditorSection)
@@ -209,7 +203,6 @@
if (input instanceof IServerEditorPartInput) {
IServerEditorPartInput sepi = (IServerEditorPartInput) input;
server = sepi.getServer();
- serverConfiguration = sepi.getServerConfiguration();
commandManager = sepi.getServerCommandManager();
readOnly = sepi.isServerReadOnly();
}
@@ -224,10 +217,6 @@
public IServerWorkingCopy getServer() {
return server;
}
-
- public IServerConfigurationWorkingCopy getServerConfiguration() {
- return serverConfiguration;
- }
public void insertSections(Composite parent, String id) {
if (id == null)
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
index 0148c45..80d8607 100644
--- 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
@@ -23,7 +23,9 @@
* instance) complex configuration pages to only be shown when used
* with non-unittest servers.
*/
- public abstract boolean shouldCreatePage(IServerWorkingCopy server);
+ public boolean shouldCreatePage(IServerWorkingCopy server) {
+ return true;
+ }
/**
* Create the editor page.
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
index 2a1c0b9..935bacb 100644
--- 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
@@ -17,7 +17,6 @@
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorSite;
import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.wst.server.core.IServerConfigurationWorkingCopy;
import org.eclipse.wst.server.core.IServerWorkingCopy;
/**
*
@@ -26,7 +25,6 @@
private String errorMessage = null;
public IServerWorkingCopy server;
- public IServerConfigurationWorkingCopy serverConfiguration;
public ICommandManager commandManager;
protected boolean readOnly;
protected Composite parentComp;
@@ -39,7 +37,6 @@
if (input instanceof IServerEditorPartInput) {
IServerEditorPartInput sepi = (IServerEditorPartInput) input;
server = sepi.getServer();
- serverConfiguration = sepi.getServerConfiguration();
commandManager = sepi.getServerCommandManager();
readOnly = sepi.isServerReadOnly();
}
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
index 4dbbf9c..fcc3533 100644
--- 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
@@ -30,7 +30,6 @@
import org.eclipse.ui.model.IWorkbenchAdapter;
import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.IServerConfiguration;
import org.eclipse.wst.server.core.ServerCore;
/**
* Eclipse utility methods.
@@ -230,14 +229,6 @@
IStatus status = server.validateEdit(shell);
return validateEdit(shell, status);
}
-
- /**
- * Do a validateEdit() on the given server element.
- */
- public static boolean validateEdit(Shell shell, IServerConfiguration config) {
- IStatus status = config.validateEdit(shell);
- return validateEdit(shell, status);
- }
protected static boolean validateEdit(Shell shell, IStatus status) {
if (status != null && status.getSeverity() == IStatus.ERROR) {
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
index f01fef5..845fa99 100644
--- 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
@@ -177,7 +177,7 @@
monitor.beginTask(ServerUIPlugin.getResource("%search"), 100 * locators.length + 10);
final List list = new ArrayList();
- final IRuntimeLocator.Listener listener = new IRuntimeLocator.Listener() {
+ final IRuntimeLocator.RuntimeSearchListener listener = new IRuntimeLocator.RuntimeSearchListener() {
public void runtimeFound(final IRuntimeWorkingCopy runtime) {
dialog.getShell().getDisplay().syncExec(new Runnable() {
public void run() {
@@ -195,7 +195,7 @@
for (int i = 0; i < size; i++) {
if (!monitor2.isCanceled())
try {
- locators[i].searchForRuntimes(listener, monitor2);
+ locators[i].searchForRuntimes(null, listener, monitor2);
} catch (CoreException ce) {
Trace.trace(Trace.WARNING, "Error locating runtimes: " + locators[i].getId(), ce);
}
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
index 3de2acc..c322133 100644
--- 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
@@ -68,12 +68,6 @@
} else if (element instanceof IServer) {
IServer server = (IServer) element;
return ImageResource.getImageDescriptor(server.getServerType().getId());
- } else if (element instanceof IServerConfigurationType) {
- IServerConfigurationType configType = (IServerConfigurationType) element;
- return ImageResource.getImageDescriptor(configType.getId());
- } else if (element instanceof IServerConfiguration) {
- IServerConfiguration config = (IServerConfiguration) element;
- return ImageResource.getImageDescriptor(config.getServerConfigurationType().getId());
} else if (element instanceof IModule) {
IModule module = (IModule) element;
IModuleType mt = module.getModuleType();
@@ -107,12 +101,6 @@
return null;
return ImageResource.getImage(server.getServerType().getId());
- } else if (element instanceof IServerConfigurationType) {
- IServerConfigurationType configType = (IServerConfigurationType) element;
- return ImageResource.getImage(configType.getId());
- } else if (element instanceof IServerConfiguration) {
- IServerConfiguration config = (IServerConfiguration) element;
- return ImageResource.getImage(config.getServerConfigurationType().getId());
} else if (element instanceof IModule) {
IModule module = (IModule) element;
IModuleType mt = module.getModuleType();
@@ -142,14 +130,10 @@
return getString(((IRuntime) element).getName());
} else if (element instanceof IServer) {
return getString(((IServer) element).getName());
- } else if (element instanceof IServerConfiguration) {
- return getString(((IServerConfiguration) element).getName());
} else if (element instanceof IRuntimeType) {
return ((IRuntimeType) element).getName();
} else if (element instanceof IServerType) {
return ((IServerType) element).getName();
- } else if (element instanceof IServerConfigurationType) {
- return ((IServerConfigurationType) element).getName();
} else if (element instanceof IClient) {
return ((IClient) element).getName();
} else if (element instanceof IModule) {
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
index 8641bf3..7ab6344 100644
--- 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
@@ -16,7 +16,7 @@
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.wst.server.core.IModuleObject;
+import org.eclipse.wst.server.core.IModuleArtifact;
import org.eclipse.wst.server.core.ServerUtil;
import org.eclipse.wst.server.ui.internal.actions.RunOnServerActionDelegate;
import org.eclipse.ui.IEditorInput;
@@ -52,7 +52,7 @@
// 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();
- IModuleObject[] mo = ServerUtil.getModuleObjects(input);
+ IModuleArtifact[] mo = ServerUtil.getModuleObjects(input);
if (mo != null && mo.length > 0) {
launch(new StructuredSelection(input), mode);
} else if (input instanceof IFileEditorInput) {
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerStartupListener.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerStartupListener.java
index 00cda45..ede842e 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerStartupListener.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerStartupListener.java
@@ -37,7 +37,7 @@
protected IClient client;
protected ILaunchableAdapter launchableAdapter;
- protected IModuleObject moduleObject;
+ protected IModuleArtifact moduleObject;
protected String launchMode;
protected IModule module;
@@ -70,7 +70,7 @@
/**
* ServerStartupListener constructor comment.
*/
- public ServerStartupListener(Shell shell, IServer server, IClient client, ILaunchableAdapter launchableAdapter, IModuleObject moduleObject, String launchMode, IModule module) {
+ public ServerStartupListener(Shell shell, IServer server, IClient client, ILaunchableAdapter launchableAdapter, IModuleArtifact moduleObject, String launchMode, IModule module) {
this(shell, server);
this.client = client;
this.launchableAdapter = launchableAdapter;
@@ -82,7 +82,7 @@
/**
* ServerStartupListener constructor comment.
*/
- public ServerStartupListener(Shell shell, IServer server, IClient client, ILaunchableAdapter launchableAdapter, IModuleObject moduleObject, String launchMode, IModule module, boolean ignoreShutdown) {
+ public ServerStartupListener(Shell shell, IServer server, IClient client, ILaunchableAdapter launchableAdapter, IModuleArtifact moduleObject, String launchMode, IModule module, boolean ignoreShutdown) {
this(shell, server, client, launchableAdapter, moduleObject, launchMode, module);
this.ignoreShutdown = ignoreShutdown;
}
@@ -170,7 +170,7 @@
dispose();
}
- public static void launchClientUtil(final IServer server, final IModule module, final ILaunchableAdapter la, final IModuleObject mo, final String launchMode, final IClient client) {
+ public static void launchClientUtil(final IServer server, final IModule module, final ILaunchableAdapter la, final IModuleArtifact mo, final String launchMode, final IClient client) {
if (client == null || server == null)
return;
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
index 76aee0d..6e7948b 100644
--- 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
@@ -10,8 +10,6 @@
**********************************************************************/
package org.eclipse.wst.server.ui.internal;
-import java.util.ArrayList;
-
import org.eclipse.core.resources.IResourceChangeListener;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.jface.viewers.ITreeContentProvider;
@@ -22,7 +20,6 @@
import org.eclipse.wst.server.core.model.IModuleEventsListener;
import org.eclipse.wst.server.core.model.IModuleFactoryEvent;
import org.eclipse.wst.server.core.util.ServerAdapter;
-import org.eclipse.wst.server.ui.internal.view.tree.ConfigurationProxyResourceAdapter;
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;
@@ -41,7 +38,7 @@
protected IResourceChangeListener resourceChangeListener;
protected IModuleEventsListener moduleEventsListener;
- class LifecycleListener implements IServerLifecycleListener, IServerConfigurationLifecycleListener {
+ class LifecycleListener implements IServerLifecycleListener {
public void serverAdded(final IServer server) {
server.addServerListener(serverListener);
Display.getDefault().syncExec(new Runnable() {
@@ -65,27 +62,6 @@
}
});
}
- public void serverConfigurationAdded(final IServerConfiguration configuration) {
- Display.getDefault().syncExec(new Runnable() {
- public void run() {
- handleServerResourceAdded(configuration);
- }
- });
- }
- public void serverConfigurationRemoved(final IServerConfiguration configuration) {
- Display.getDefault().syncExec(new Runnable() {
- public void run() {
- handleServerResourceRemoved(configuration);
- }
- });
- }
- public void serverConfigurationChanged(final IServerConfiguration configuration) {
- Display.getDefault().syncExec(new Runnable() {
- public void run() {
- handleServerResourceChanged(configuration);
- }
- });
- }
}
/**
@@ -120,7 +96,6 @@
}
ServerCore.removeServerLifecycleListener(listener);
- ServerCore.removeServerConfigurationLifecycleListener(listener);
if (moduleEventsListener != null)
ServerCore.removeModuleEventsListener(moduleEventsListener);
@@ -233,7 +208,6 @@
// add a listener for resources being added or removed
listener = new LifecycleListener();
ServerCore.addServerLifecycleListener(listener);
- ServerCore.addServerConfigurationLifecycleListener(listener);
}
/**
@@ -288,30 +262,6 @@
adapter.setFlags((byte) 1);
if (element instanceof IServer) {
viewer.add(new TextResourceAdapter(null, TextResourceAdapter.STYLE_SERVERS), adapter);
- } else {
- IServerConfiguration configuration = (IServerConfiguration) element;
- //boolean used = false;
-
- IServer[] servers = ServerCore.getServers();
- if (servers != null) {
- int size = servers.length;
- for (int i = 0; i < size; i++) {
- IServerConfiguration cfg = servers[i].getServerConfiguration();
- if (cfg != null && cfg.equals(configuration)) {
- ServerElementAdapter adapter2 = new ServerElementAdapter(null, servers[i]);
- adapter2.setFlags((byte) 1);
- viewer.refresh(adapter2);
-
- //used = true;
- }
- }
- }
-
- /*if (!used) {
- ServerLifecycleAdapter adapter2 = new ServerLifecycleAdapter(null, configuration);
- adapter2.setFlags((byte) 1);
- viewer.add(new TextResourceAdapter(null, TextResourceAdapter.STYLE_LOOSE_CONFIGURATIONS), adapter2);
- }*/
}
}
@@ -326,34 +276,9 @@
return;
if (element instanceof IServer) {
- IServer server = (IServer) element;
ServerElementAdapter adapter = new ServerElementAdapter(null, element);
adapter.setFlags((byte) 1);
viewer.refresh(adapter);
-
- IServerConfiguration cfg = server.getServerConfiguration();
- if (cfg != null) {
- ServerElementAdapter adapter3 = new ServerElementAdapter(null, cfg);
- adapter3.setFlags((byte) 1);
- viewer.remove(adapter3);
- }
- } else {
- IServerConfiguration configuration = (IServerConfiguration) element;
-
- // refresh servers
- IServer[] servers = ServerCore.getServers();
- if (servers != null) {
- int size = servers.length;
- for (int i = 0; i < size; i++) {
- IServerConfiguration cfg = servers[i].getServerConfiguration();
- if (cfg != null && cfg.equals(configuration)) {
- ServerElementAdapter adapter2 = new ServerElementAdapter(null, servers[i]);
- adapter2.setFlags((byte) 1);
- viewer.refresh(adapter2);
- }
- }
- }
- //viewer.refresh(new TextResourceAdapter(null, TextResourceAdapter.STYLE_LOOSE_CONFIGURATIONS));
}
}
@@ -368,9 +293,7 @@
return;
TextResourceAdapter.deleted = element;
- if (element instanceof IServerConfiguration)
- ConfigurationProxyResourceAdapter.deleted = (IServerConfiguration) element;
-
+
if (element instanceof IServer) {
//IServer server = (IServer) element;
TextResourceAdapter adapter = new TextResourceAdapter(null, TextResourceAdapter.STYLE_SERVERS);
@@ -393,71 +316,6 @@
adapter2.setFlags((byte) 1);
viewer.add(new TextResourceAdapter(null, TextResourceAdapter.STYLE_LOOSE_CONFIGURATIONS), adapter2);
}*/
- } else {
- //TextResourceAdapter adapter = new TextResourceAdapter(null, TextResourceAdapter.STYLE_CONFIGURATIONS);
- //viewer.refresh(adapter);
-
- /*Iterator iterator = ServerCore.getResourceManager().getServers().iterator();
- while (iterator.hasNext()) {
- IServer server = (IServer) iterator.next();
- ServerLifecycleAdapter adapter2 = new ServerLifecycleAdapter(null, server);
- adapter2.setFlags((byte) 1);
- viewer.refresh(adapter2);
- }*/
- IServerConfiguration configuration = (IServerConfiguration) element;
-
- // refresh servers
- //boolean used = false;
- IServer[] servers = ServerCore.getServers();
- if (servers != null) {
- int size = servers.length;
- for (int i = 0; i < size; i++) {
- IServerConfiguration cfg = servers[i].getServerConfiguration();
- if (cfg != null && cfg.equals(configuration)) {
- ServerElementAdapter adapter2 = new ServerElementAdapter(null, servers[i]);
- adapter2.setFlags((byte) 1);
- viewer.refresh(adapter2);
-
- //used = true;
- }
- }
- }
-
- /*if (!used) {
- TextResourceAdapter adapter = new TextResourceAdapter(null, TextResourceAdapter.STYLE_LOOSE_CONFIGURATIONS);
- viewer.refresh(adapter);
- }*/
}
- ConfigurationProxyResourceAdapter.deleted = null;
- TextResourceAdapter.deleted = null;
- }
-
- public static IServerConfiguration[] getLooseConfigurations() {
- IServerConfiguration[] configs = ServerCore.getServerConfigurations();
- java.util.List list = new ArrayList();
- if (configs != null) {
- int size = configs.length;
- for (int i = 0; i < size; i++)
- list.add(configs[i]);
- }
-
- IServer[] servers = ServerCore.getServers();
- if (servers != null) {
- int size = servers.length;
- for (int i = 0; i < size; i++) {
- if (!servers[i].equals(TextResourceAdapter.deleted)) {
- IServerConfiguration cfg = servers[i].getServerConfiguration();
- if (cfg != null && list.contains(cfg))
- list.remove(cfg);
- }
- }
- }
-
- if (list.contains(ConfigurationProxyResourceAdapter.deleted))
- list.remove(ConfigurationProxyResourceAdapter.deleted);
-
- IServerConfiguration[] config = new IServerConfiguration[list.size()];
- list.toArray(config);
- return config;
}
}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/AddRemoveModulesAction.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/AddRemoveModulesAction.java
index bd9ec80..e6d643d 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/AddRemoveModulesAction.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/AddRemoveModulesAction.java
@@ -13,12 +13,12 @@
import java.util.ArrayList;
import java.util.List;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.IServerConfiguration;
import org.eclipse.wst.server.core.ServerUtil;
import org.eclipse.wst.server.ui.actions.IServerAction;
import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
@@ -32,7 +32,7 @@
public boolean supports(IServer server) {
if (server == null)
return false;
- IServerConfiguration configuration = server.getServerConfiguration();
+ IPath configuration = server.getServerConfiguration();
return (!server.getServerType().hasServerConfiguration() || configuration != null);
}
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/DeleteActionDelegate.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/DeleteActionDelegate.java
index 62008d1..7b8540b 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/DeleteActionDelegate.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/DeleteActionDelegate.java
@@ -19,7 +19,6 @@
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.IServerConfiguration;
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;
@@ -78,8 +77,6 @@
list.add(obj);
else if (obj instanceof IServer)
list.add(obj);
- else if (obj instanceof IServerConfiguration)
- list.add(obj);
else if (obj instanceof ServerElementAdapter)
list.add(((ServerElementAdapter) obj).getObject());
else {
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
index 6541130..e09a443 100644
--- 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
@@ -133,7 +133,7 @@
String launchMode = getLaunchMode();
firePropertyChangeEvent("launchMode", null, launchMode);
- IModuleObject[] moduleObjects = ServerUtil.getModuleObjects(selection);
+ IModuleArtifact[] moduleObjects = ServerUtil.getModuleObjects(selection);
Shell shell;
if (window != null)
@@ -260,13 +260,13 @@
// get the launchable adapter and module object
ILaunchableAdapter launchableAdapter = null;
- IModuleObject moduleObject = null;
+ IModuleArtifact moduleObject = null;
ILaunchable launchable = null;
- //IModuleObject[] mo = moduleObjects.iterator();
+ //IModuleArtifact[] mo = moduleObjects.iterator();
if (moduleObjects != null) {
int size = moduleObjects.length;
for (int i = 0; i < size; i++) {
- IModuleObject moduleObject2 = moduleObjects[i];
+ IModuleArtifact moduleObject2 = moduleObjects[i];
ILaunchableAdapter[] adapters = ServerCore.getLaunchableAdapters();
if (adapters != null) {
@@ -372,7 +372,7 @@
* object.
*
* @param server org.eclipse.wst.server.core.IServer
- * @param moduleObject org.eclipse.wst.server.core.IModuleObject
+ * @param moduleObject org.eclipse.wst.server.core.IModuleArtifact
* @param launchMode String
* @return java.util.List
*/
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/ServerAction.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/ServerAction.java
index abb414a..adc0171 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/ServerAction.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/ServerAction.java
@@ -23,7 +23,6 @@
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.IServerConfiguration;
import org.eclipse.wst.server.ui.actions.IServerAction;
import org.eclipse.wst.server.ui.editor.IOrdered;
import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
@@ -229,14 +228,10 @@
Trace.trace(Trace.CONFIG, "-<- Done loading .serverActions extension point -<-");
}
- public static void addServerMenuItems(Shell shell, IMenuManager menu, IServer server) {
- addServerMenuItems(shell, menu, server, server.getServerConfiguration());
- }
-
/**
*
*/
- public static void addServerMenuItems(Shell shell, IMenuManager menu, IServer server, IServerConfiguration configuration) {
+ public static void addServerMenuItems(Shell shell, IMenuManager menu, IServer server) {
boolean addedSeparator = false;
String category = null;
@@ -250,8 +245,7 @@
menu.add(new Separator());
}
long time = System.currentTimeMillis();
- if ((server != null && server.getServerType() != null && serverAction.supportsServerResource(server.getServerType().getId())) ||
- (configuration != null && serverAction.supportsServerResource(configuration.getServerConfigurationType().getId()))) {
+ if (server != null && server.getServerType() != null && serverAction.supportsServerResource(server.getServerType().getId())) {
if (!addedSeparator) {
addedSeparator = true;
menu.add(new Separator());
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/command/ConfigurationCommand.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/command/ConfigurationCommand.java
deleted file mode 100644
index 0cdff87..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/command/ConfigurationCommand.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package org.eclipse.wst.server.ui.internal.command;
-/**********************************************************************
- * Copyright (c) 2003 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 - Initial API and implementation
- **********************************************************************/
-import org.eclipse.core.runtime.IProgressMonitor;
-
-import org.eclipse.wst.server.core.IServerConfigurationWorkingCopy;
-import org.eclipse.wst.server.core.util.Task;
-/**
- * Configuration command.
- */
-public abstract class ConfigurationCommand extends Task {
- protected IServerConfigurationWorkingCopy configuration;
-
- /**
- * ConfigurationCommand constructor comment.
- */
- public ConfigurationCommand(IServerConfigurationWorkingCopy 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.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/command/SetServerConfigurationNameCommand.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/command/SetServerConfigurationNameCommand.java
deleted file mode 100644
index eae0f0d..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/command/SetServerConfigurationNameCommand.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package org.eclipse.wst.server.ui.internal.command;
-/**********************************************************************
- * Copyright (c) 2003 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 - Initial API and implementation
- **********************************************************************/
-import org.eclipse.wst.server.core.IServerConfigurationWorkingCopy;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-/**
- * Command to change the server configuration name.
- */
-public class SetServerConfigurationNameCommand extends ConfigurationCommand {
- protected String name;
- protected String oldName;
-
- /**
- * SetServerConfigurationNameCommand constructor comment.
- */
- public SetServerConfigurationNameCommand(IServerConfigurationWorkingCopy config, String name) {
- super(config);
- this.name = name;
- }
-
- /**
- * Execute the command.
- * @return boolean
- */
- public boolean execute() {
- oldName = configuration.getName();
- configuration.setName(name);
- return true;
- }
-
- /**
- * Returns this command's description.
- * @return java.lang.String
- */
- public String getDescription() {
- return ServerUIPlugin.getResource("%serverEditorOverviewServerConfigurationNameDescription");
- }
-
- /**
- * Returns this command's label.
- * @return java.lang.String
- */
- public String getName() {
- return ServerUIPlugin.getResource("%serverEditorOverviewServerConfigurationNameCommand");
- }
-
- /**
- * Undo the command.
- */
- public void undo() {
- configuration.setName(oldName);
- }
-}
\ 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
index d82bcd7..ac2d119 100644
--- 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
@@ -27,8 +27,6 @@
import org.eclipse.wst.server.core.IElement;
import org.eclipse.wst.server.core.IElementWorkingCopy;
import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.IServerConfiguration;
-import org.eclipse.wst.server.core.IServerConfigurationWorkingCopy;
import org.eclipse.wst.server.core.IServerWorkingCopy;
import org.eclipse.wst.server.core.ITask;
import org.eclipse.wst.server.core.ServerCore;
@@ -39,8 +37,9 @@
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;
@@ -168,11 +167,6 @@
IServer server = ServerCore.findServer(id);
if (server != null)
info.wc = server.createWorkingCopy();
- else {
- IServerConfiguration config = ServerCore.findServerConfiguration(id);
- if (config != null)
- info.wc = config.createWorkingCopy();
- }
info.isDirty = false;
info.isReadOnly = false;
commandManagers.put(id, info);
@@ -213,11 +207,6 @@
IServer server = ServerCore.findServer(id);
if (server != null)
info.wc = server.createWorkingCopy();
- else {
- IServerConfiguration config = ServerCore.findServerConfiguration(id);
- if (config != null)
- info.wc = config.createWorkingCopy();
- }
//info.serverElement = ServerCore.getResourceManager().getServer()
//info.serverElement = ServerCore.getEditManager().reloadEditModel(info.file, monitor);
firePropertyChangeEvent(PROP_RELOAD, id, null);
@@ -247,7 +236,7 @@
return (info != null && info.count == 1);
}
- protected IServerEditorPartInput getPartInput(String serverId, ICommandManager serverCommandManager, String configurationId, ICommandManager configurationCommandManager) {
+ protected IServerEditorPartInput getPartInput(String serverId, ICommandManager serverCommandManager) {
CommandManagerInfo serverInfo = null;
IServerWorkingCopy server = null;
boolean serverReadOnly = false;
@@ -259,21 +248,8 @@
server = (IServerWorkingCopy) serverInfo.wc;
serverReadOnly = serverInfo.isReadOnly;
}
-
- CommandManagerInfo configurationInfo = null;
- IServerConfigurationWorkingCopy configuration = null;
- boolean configurationReadOnly = false;
- if (configurationId != null) {
- configurationInfo = getExistingCommandManagerInfo(configurationId);
- if (configurationInfo == null)
- return null;
-
- configuration = (IServerConfigurationWorkingCopy) configurationInfo.wc;
- configurationReadOnly = configurationInfo.isReadOnly;
- }
- return new ServerEditorPartInput(serverCommandManager, server, serverReadOnly,
- configurationCommandManager, configuration, configurationReadOnly);
+ return new ServerEditorPartInput(serverCommandManager, server, serverReadOnly);
}
/**
@@ -418,11 +394,11 @@
*
* @return org.eclipse.wst.server.ui.editor.ICommand
*/
- public ITask getUndoCommand(String a, String b) {
+ 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 || src.id == b)
+ if (src.id == a)
return src.command;
}
return null;
@@ -433,11 +409,11 @@
*
* @return org.eclipse.wst.server.ui.editor.ICommand
*/
- public ITask getRedoCommand(String a, String b) {
+ 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 || src.id == b)
+ if (src.id == a)
return src.command;
}
return null;
@@ -510,12 +486,12 @@
/**
* Undo the last command.
*/
- protected void undo(String a, String b) {
+ protected void undo(String a) {
ServerResourceCommand src = null;
Iterator iterator = undoList.iterator();
while (iterator.hasNext()) {
ServerResourceCommand src2 = (ServerResourceCommand) iterator.next();
- if (src2.id == a || src2.id == b)
+ if (src2.id == a)
src = src2;
}
if (src == null)
@@ -528,19 +504,19 @@
firePropertyChangeEvent(PROP_REDO, src.id, null);
CommandManagerInfo info = getExistingCommandManagerInfo(src.id);
- if (info.canCompletelyUndo && getUndoCommand(src.id, null) == null)
+ if (info.canCompletelyUndo && getUndoCommand(src.id) == null)
setDirtyState(src.id, false);
}
/**
* Redo the last command.
*/
- protected void redo(String a, String b) {
+ protected void redo(String a) {
ServerResourceCommand src = null;
Iterator iterator = redoList.iterator();
while (iterator.hasNext()) {
ServerResourceCommand src2 = (ServerResourceCommand) iterator.next();
- if (src2.id == a || src2.id == b)
+ if (src2.id == a)
src = src2;
}
if (src == null)
@@ -579,15 +555,13 @@
IFile file = null;
if (element instanceof IServer)
file = ((IServer) element).getFile();
- else if (element instanceof IServerConfiguration)
- file = ((IServerConfiguration) element).getFile();
if (file != null)
list.add(file);
//if ()
//IServerConfiguration config = (IServerConfiguration) element;
- // TODO
+ // TODO: get read-only files
IFile[] files = new IFile[list.size()];
list.toArray(files);
return files;
@@ -656,8 +630,6 @@
IElement element2 = null;
if (element instanceof IServer)
element2 = ((IServerWorkingCopy) element).getOriginal();
- else if (element instanceof IServerConfiguration)
- element2 = ((IServerConfigurationWorkingCopy) element).getOriginal();
if (element2 != null)
return element2.getTimestamp();
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
index 04c6802..42a36c8 100644
--- 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
@@ -12,20 +12,12 @@
import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.server.core.IServerWorkingCopy;
import org.eclipse.wst.server.ui.editor.ServerEditorPartFactoryDelegate;
/**
*
*/
public class OverviewEditorFactory extends ServerEditorPartFactoryDelegate {
/*
- * @see ServerEditorPartFactoryDelegate#shouldCreatePage(IServer, IServerConfiguration)
- */
- public boolean shouldCreatePage(IServerWorkingCopy server) {
- return true;
- }
-
- /*
* @see ServerEditorPartFactoryDelegate#createPage()
*/
public IEditorPart createPage() {
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
index aebf081..d65243f 100644
--- 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
@@ -32,7 +32,6 @@
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.SetServerConfigurationNameCommand;
import org.eclipse.wst.server.ui.internal.command.SetServerHostnameCommand;
import org.eclipse.wst.server.ui.internal.command.SetServerNameCommand;
import org.eclipse.wst.server.ui.internal.command.SetServerRuntimeCommand;
@@ -41,7 +40,7 @@
*/
public class OverviewEditorPart extends ServerEditorPart {
protected Text serverName;
- protected Text serverConfigurationName;
+ protected Label serverConfigurationName;
protected Text hostname;
protected Combo runtimeCombo;
@@ -81,15 +80,11 @@
};
if (server != null)
server.addPropertyChangeListener(listener);
- if (serverConfiguration != null)
- serverConfiguration.addPropertyChangeListener(listener);
}
protected void updateNames() {
if (serverName != null)
serverName.setText(server.getName());
- if (serverConfigurationName != null)
- serverConfigurationName.setText(serverConfiguration.getName());
}
/**
@@ -161,24 +156,6 @@
});
}
- // server configuration name
- if (serverConfiguration != null) {
- createLabel(toolkit, composite, ServerUIPlugin.getResource("%serverEditorOverviewServerConfigurationName"));
-
- serverConfigurationName = toolkit.createText(composite, serverConfiguration.getName());
- GridData data = new GridData(GridData.FILL_HORIZONTAL);
- serverConfigurationName.setLayoutData(data);
- serverConfigurationName.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- if (updating)
- return;
- updating = true;
- getCommandManager().executeCommand(new SetServerConfigurationNameCommand(getServerConfiguration(), serverConfigurationName.getText()));
- updating = false;
- }
- });
- }
-
// hostname
if (server != null) {
createLabel(toolkit, composite, ServerUIPlugin.getResource("%serverEditorOverviewServerHostname"));
@@ -197,6 +174,16 @@
});
}
+ // server configuration path
+ if (server != null && server.getServerType().hasServerConfiguration()) {
+ createLabel(toolkit, composite, ServerUIPlugin.getResource("%serverEditorOverviewServerConfigurationPath"));
+
+ serverConfigurationName = toolkit.createLabel(composite, "" + server.getServerConfiguration());
+ GridData data = new GridData(GridData.FILL_HORIZONTAL);
+ serverConfigurationName.setLayoutData(data);
+ }
+
+ // runtime
if (server != null && server.getServerType() != null && server.getServerType().hasRuntime()) {
IRuntime runtime = server.getRuntime();
createLabel(toolkit, composite, ServerUIPlugin.getResource("%serverEditorOverviewRuntime"));
@@ -292,8 +279,6 @@
if (server != null)
server.removePropertyChangeListener(listener);
- if (serverConfiguration != null)
- serverConfiguration.removePropertyChangeListener(listener);
}
/* (non-Javadoc)
@@ -321,13 +306,6 @@
else
serverName.setEnabled(true);
}
- if (serverConfiguration != null) {
- serverConfigurationName.setText(serverConfiguration.getName());
- if (readOnly)
- serverConfigurationName.setEnabled(false);
- else
- serverConfigurationName.setEnabled(true);
- }
updating = false;
}
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
index 5157fca..58c91f4 100644
--- 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
@@ -81,7 +81,7 @@
}
}
- class LifecycleListener implements IServerLifecycleListener, IServerConfigurationLifecycleListener {
+ class LifecycleListener implements IServerLifecycleListener {
public void serverAdded(IServer oldServer) {
// do nothing
}
@@ -92,23 +92,10 @@
if (oldServer.equals(server) && !isDirty())
closeEditor();
}
-
- public void serverConfigurationAdded(IServerConfiguration oldServerConfiguration) {
- // do nothing
- }
- public void serverConfigurationChanged(IServerConfiguration oldServerConfiguration) {
- // do nothing
- }
- public void serverConfigurationRemoved(IServerConfiguration oldServerConfiguration) {
- if (oldServerConfiguration.equals(serverConfiguration) && !isDirty())
- closeEditor();
- }
}
protected IServerWorkingCopy server;
- protected IServerConfigurationWorkingCopy serverConfiguration;
protected String serverId;
- protected String serverConfigurationId;
protected GlobalCommandManager commandManager;
@@ -152,7 +139,7 @@
undoAction = new Action() {
public void run() {
- getCommandManager().undo(serverId, serverConfigurationId);
+ getCommandManager().undo(serverId);
}
};
undoAction.setEnabled(false);
@@ -162,7 +149,7 @@
redoAction = new Action() {
public void run() {
- getCommandManager().redo(serverId, serverConfigurationId);
+ getCommandManager().redo(serverId);
}
};
redoAction.setEnabled(false);
@@ -195,17 +182,6 @@
actionList.add(factory.createAction(getEditorSite(), editorPartInput));
}
}
-
- // add server configuration actions
- if (serverConfiguration != null && serverConfiguration.getServerConfigurationType() != null) {
- Iterator iterator = ServerEditorCore.getServerEditorActionFactories().iterator();
- String id = serverConfiguration.getServerConfigurationType().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);
@@ -226,18 +202,13 @@
int pageCount = 0;
String serverTypeId = null;
- String serverConfigurationTypeId = null;
if (server != null && server.getServerType() != null)
serverTypeId = server.getServerType().getId();
- if (serverConfiguration != null && serverConfiguration.getServerConfigurationType() != null)
- serverConfigurationTypeId = serverConfiguration.getServerConfigurationType().getId();
-
+
Iterator iterator = ServerEditorCore.getServerEditorPageFactories().iterator();
while (iterator.hasNext()) {
IServerEditorPartFactory factory = (IServerEditorPartFactory) iterator.next();
- if (((serverTypeId != null && factory.supportsType(serverTypeId)) ||
- (serverConfigurationTypeId != null && factory.supportsType(serverConfigurationTypeId)))
- && factory.shouldCreatePage(server)) {
+ if (serverTypeId != null && factory.supportsType(serverTypeId) && factory.shouldCreatePage(server)) {
Trace.trace(Trace.FINEST, "Adding page: " + factory.getId() + " " + editorPartInput);
try {
IEditorPart page = factory.createPage();
@@ -281,10 +252,8 @@
activationListener = null;
}
- if (resourceListener != null) {
+ if (resourceListener != null)
ServerCore.removeServerLifecycleListener(resourceListener);
- ServerCore.removeServerConfigurationLifecycleListener(resourceListener);
- }
super.dispose();
if (commandManager != null)
@@ -292,9 +261,6 @@
if (serverId != null)
commandManager.releaseCommandManager(serverId);
-
- if (serverConfigurationId != null)
- commandManager.releaseCommandManager(serverConfigurationId);
}
/* (non-Javadoc)
@@ -346,10 +312,8 @@
String name = "";
if (server != null)
name = server.getName();
- else
- name = serverConfiguration.getName();
monitor.beginTask(ServerUIPlugin.getResource("%savingTask", name), ticks);
- if (server != null && serverConfiguration != null)
+ if (server != null)
ticks /= 2;
if (server != null) {
@@ -357,18 +321,10 @@
getCommandManager().resourceSaved(serverId);
commandManager.updateTimestamps(serverId);
}
-
- if (serverConfiguration != null) {
- serverConfiguration.save(false, ProgressUtil.getSubMonitorFor(monitor, ticks));
- getCommandManager().resourceSaved(serverConfigurationId);
- commandManager.updateTimestamps(serverConfigurationId);
- }
ILabelProvider labelProvider = ServerUICore.getLabelProvider();
if (server != null)
setPartName(labelProvider.getText(server));
- else
- setPartName(labelProvider.getText(serverConfiguration));
} catch (Exception e) {
Trace.trace("Error saving from configuration editor", e);
@@ -479,8 +435,6 @@
boolean readOnly = false;
if (server != null && commandManager.isReadOnly(serverId))
readOnly = true;
- else if (serverConfiguration != null && commandManager.areFilesReadOnly(serverConfigurationId))
- readOnly = true;
if (readOnly)
statusItem.setText(ServerUIPlugin.getResource("%editorReadOnly"));
@@ -500,7 +454,7 @@
first = false;
}
}
- if (serverConfiguration != null) {
+ /*if (serverConfiguration != null) {
IFile[] files = commandManager.getReadOnlyFiles(serverConfigurationId);
for (int i = 0; i < files.length; i++) {
if (!first)
@@ -508,7 +462,7 @@
sb.append(files[i].getName());
first = false;
}
- }
+ }*/
if (sb.length() > 1)
status.setMessage(ServerUIPlugin.getResource("%editorReadOnlyFiles", sb.toString()));
else
@@ -667,22 +621,14 @@
IFile file = fei.getFile();
if (file != null && file.exists()) {
IServer server2 = ServerUtil.findServer(file);
- if (server2 != null) {
+ if (server2 != null)
serverId = server2.getId();
- if (server2.getServerConfiguration() != null)
- serverConfigurationId = server2.getServerConfiguration().getId();
- } else {
- IServerConfiguration configuration = ServerUtil.findServerConfiguration(file);
- if (configuration != null)
- serverConfigurationId = configuration.getId();
- }
}
- if (serverId == null && serverConfigurationId == null)
+ if (serverId == null)
throw new PartInitException(ServerUIPlugin.getResource("%errorEditor", file.getName()));
} else if (input instanceof IServerEditorInput) {
IServerEditorInput sei = (IServerEditorInput) input;
serverId = sei.getServerId();
- serverConfigurationId = sei.getServerConfigurationId();
}
if (serverId != null) {
@@ -690,23 +636,13 @@
server = (IServerWorkingCopy) commandManager.getServerResource(serverId);
}
- if (serverConfigurationId != null) {
- commandManager.getCommandManager(serverConfigurationId);
- serverConfiguration = (IServerConfigurationWorkingCopy) commandManager.getServerResource(serverConfigurationId);
- }
-
ILabelProvider labelProvider = ServerUICore.getLabelProvider();
if (server != null) {
setPartName(labelProvider.getText(server));
setTitleImage(labelProvider.getImage(server));
setTitleToolTip(serverId);
- } else if (serverConfiguration != null) {
- setPartName(labelProvider.getText(serverConfiguration));
- setTitleImage(labelProvider.getImage(serverConfiguration));
- setTitleToolTip(serverConfigurationId);
- } else {
- setPartName("-");
- }
+ } else
+ setPartName("-");
cutAction = new TextAction(site.getShell().getDisplay(), TextAction.CUT_ACTION);
copyAction = new TextAction(site.getShell().getDisplay(), TextAction.COPY_ACTION);
@@ -716,30 +652,26 @@
public void propertyChange(PropertyChangeEvent event) {
if (GlobalCommandManager.PROP_DIRTY.equals(event.getPropertyName())) {
Object obj = event.getOldValue();
- if (obj == serverId || obj == serverConfigurationId)
+ if (obj == serverId)
firePropertyChange(PROP_DIRTY);
} else if (GlobalCommandManager.PROP_UNDO.equals(event.getPropertyName())) {
Object obj = event.getOldValue();
- if (obj == serverId || obj == serverConfigurationId)
+ if (obj == serverId)
updateUndoAction();
} else if (GlobalCommandManager.PROP_REDO.equals(event.getPropertyName())) {
Object obj = event.getOldValue();
- if (obj == serverId || obj == serverConfigurationId)
+ if (obj == serverId)
updateRedoAction();
} else if (GlobalCommandManager.PROP_RELOAD.equals(event.getPropertyName())) {
Object obj = event.getOldValue();
if (obj == serverId) {
server = (IServerWorkingCopy) commandManager.getServerResource(serverId);
refresh();
- } else if (obj == serverConfigurationId) {
- serverConfiguration = (IServerConfigurationWorkingCopy) commandManager.getServerResource(serverConfigurationId);
- refresh();
}
}
}
};
- if ((server != null && commandManager.isDirty(serverId)) ||
- (serverConfiguration != null && commandManager.isDirty(serverConfigurationId)))
+ if (server != null && commandManager.isDirty(serverId))
firePropertyChange(PROP_DIRTY);
commandManager.addPropertyChangeListener(listener);
@@ -748,17 +680,13 @@
ICommandManager serverCommandManager = null;
if (server != null)
serverCommandManager = new ServerResourceCommandManager(this, serverId, commandManager);
- ICommandManager configurationCommandManager = null;
- if (serverConfiguration != null)
- configurationCommandManager = new ServerResourceCommandManager(this, serverConfigurationId, commandManager);
- editorPartInput = commandManager.getPartInput(serverId, serverCommandManager, serverConfigurationId, configurationCommandManager);
+ editorPartInput = commandManager.getPartInput(serverId, serverCommandManager);
createActions();
// add resource listener
resourceListener = new LifecycleListener();
ServerCore.addServerLifecycleListener(resourceListener);
- ServerCore.addServerConfigurationLifecycleListener(resourceListener);
IWorkbenchWindow window = getSite().getWorkbenchWindow();
window.getPartService().addPartListener(activationListener);
@@ -779,8 +707,6 @@
if (commandManager != null) {
if (server != null && commandManager.isDirty(serverId))
return true;
- if (serverConfiguration != null && commandManager.isDirty(serverConfigurationId))
- return true;
}
return false;
}
@@ -802,7 +728,7 @@
* Update the undo action.
*/
protected void updateUndoAction() {
- ITask command = commandManager.getUndoCommand(serverId, serverConfigurationId);
+ ITask command = commandManager.getUndoCommand(serverId);
if (command == null) {
undoAction.setText(ServerUIPlugin.getResource("%editorUndoDisabled"));
undoAction.setToolTipText("");
@@ -821,7 +747,7 @@
* Update the redo action.
*/
protected void updateRedoAction() {
- ITask command = commandManager.getRedoCommand(serverId, serverConfigurationId);
+ ITask command = commandManager.getRedoCommand(serverId);
if (command == null) {
redoAction.setText(ServerUIPlugin.getResource("%editorRedoDisabled"));
redoAction.setToolTipText("");
@@ -880,10 +806,7 @@
ICommandManager serverCommandManager = null;
if (server != null)
serverCommandManager = new ServerResourceCommandManager(this, serverId, commandManager);
- ICommandManager configurationCommandManager = null;
- if (serverConfiguration != null)
- configurationCommandManager = new ServerResourceCommandManager(this, serverConfigurationId, commandManager);
- editorPartInput = commandManager.getPartInput(serverId, serverCommandManager, serverConfigurationId, configurationCommandManager);
+ editorPartInput = commandManager.getPartInput(serverId, serverCommandManager);
Iterator iterator = serverPages.iterator();
while (iterator.hasNext()) {
@@ -909,29 +832,14 @@
/**
*
*/
- protected void promptReloadServerFile(String id, IServerWorkingCopy serverFile2) {
+ 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 {
- //file.refreshLocal(IResource.DEPTH_ONE, new NullProgressMonitor());
- //TODO
- } catch (Exception e) {
- Trace.trace("Error refreshing server", e);
- }
- commandManager.reload(id, new NullProgressMonitor());
- }
- }
-
- protected void promptReloadServerConfigurationFile(String id, IServerConfiguration serverFile2) {
- String title = ServerUIPlugin.getResource("%editorResourceModifiedTitle");
- String message = ServerUIPlugin.getResource("%editorServerConfigurationModifiedMessage");
-
- if (MessageDialog.openQuestion(getEditorSite().getShell(), title, message)) {
- try {
- //file.refreshLocal(IResource.DEPTH_ONE, new NullProgressMonitor());
- //TODO
+ //wc.refreshLocal(IResource.DEPTH_ONE, new NullProgressMonitor());
+ //TODO: refresh local server
} catch (Exception e) {
Trace.trace("Error refreshing server", e);
}
@@ -960,12 +868,8 @@
if (resourceDeleted) {
String title = ServerUIPlugin.getResource("%editorResourceDeleteTitle");
String message = null;
- if (server != null && serverConfiguration != null)
- message = ServerUIPlugin.getResource("%editorResourceDeleteBothMessage", new String[] {server.getName(), serverConfiguration.getName()});
- else if (server != null)
+ if (server != null)
message = ServerUIPlugin.getResource("%editorResourceDeleteServerMessage", server.getName());
- else
- message = ServerUIPlugin.getResource("%editorResourceDeleteServerConfigurationMessage", serverConfiguration.getName());
String[] labels = new String[] {ServerUIPlugin.getResource("%editorResourceDeleteSave"), IDialogConstants.CLOSE_LABEL};
MessageDialog dialog = new MessageDialog(getEditorSite().getShell(), title, null, message, MessageDialog.INFORMATION, labels, 0);
@@ -993,22 +897,6 @@
commandManager.updateTimestamps(serverId);
}
- // check for server configuration changes
- if (serverConfigurationId != null) {
- if (!commandManager.isDirty(serverConfigurationId)) {
- if (commandManager.hasChanged(serverConfigurationId))
- promptReloadServerConfigurationFile(serverConfigurationId, serverConfiguration);
- } else {
- if (commandManager.hasChanged(serverConfigurationId) && !commandManager.areFilesReadOnly(serverConfigurationId))
- promptReloadServerConfigurationFile(serverConfigurationId, serverConfiguration);
- else if (commandManager.areFilesReadOnly(serverConfigurationId) && !commandManager.isReadOnly(serverConfigurationId))
- promptReadOnlyServerFile(serverConfigurationId);
- }
- if (commandManager.isReadOnly(serverConfigurationId) && !commandManager.areFilesReadOnly(serverConfigurationId))
- commandManager.setReadOnly(serverConfigurationId, false);
- commandManager.updateTimestamps(serverConfigurationId);
- }
-
updateStatusLine();
}
@@ -1018,12 +906,8 @@
public String getTitleToolTip() {
if (server != null && server.getFile() != null)
return server.getFile().getFullPath().toString();
- else if (serverConfiguration != null && serverConfiguration.getFile() != null)
- return serverConfiguration.getFile().getFullPath().toString();
else if (server != null)
return server.getName();
- else if (serverConfiguration != null)
- return serverConfiguration.getName();
else
return "error";
}
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
index fa8f6df..c2e3140 100644
--- 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
@@ -13,7 +13,6 @@
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.IServerConfiguration;
import org.eclipse.wst.server.core.ServerCore;
import org.eclipse.wst.server.ui.editor.IServerEditorInput;
import org.eclipse.wst.server.ui.internal.ImageResource;
@@ -41,15 +40,13 @@
*/
public class ServerEditorInput implements IServerEditorInput, IPersistableElement {
private String serverId;
- private String configurationId;
/**
* ServerEditorInput constructor comment.
*/
- public ServerEditorInput(String serverId, String configurationId) {
+ public ServerEditorInput(String serverId) {
super();
this.serverId = serverId;
- this.configurationId = configurationId;
}
/**
@@ -61,14 +58,6 @@
}
/**
- * Returns the server configuration id.
- * @return org.eclipse.core.resources.IResource
- */
- public String getServerConfigurationId() {
- return configurationId;
- }
-
- /**
* Indicates whether some other object is "equal to" this one.
* In this case it means that the underlying IFolders are equal.
*/
@@ -83,11 +72,6 @@
return false;
} else if (!serverId.equals(other.serverId))
return false;
- if (configurationId == null) {
- if (other.configurationId != null)
- return false;
- } else if (!configurationId.equals(other.configurationId))
- return false;
return true;
}
@@ -105,10 +89,8 @@
public boolean exists() {
if (serverId != null && ServerCore.findServer(serverId) == null)
return false;
- else if (configurationId != null && ServerCore.findServerConfiguration(configurationId) == null)
- return false;
- else
- return true;
+
+ return true;
}
/**
@@ -158,13 +140,8 @@
if (server != null)
return server.getName();
return serverId;
- } else if (configurationId != null) {
- IServerConfiguration configuration = ServerCore.findServerConfiguration(configurationId);
- if (configuration != null)
- return configuration.getName();
- return configurationId;
- } else
- return "";
+ }
+ return "";
}
/*
@@ -190,17 +167,6 @@
s = server.getName();
}
}
- if (s == null && configurationId != null) {
- IServerConfiguration configuration = ServerCore.findServerConfiguration(configurationId);
- if (configuration != null) {
- if (configuration.getFile() != null) {
- s = configuration.getFile().getFullPath().makeRelative().toString();
- if (s.startsWith("/"))
- s = s.substring(1);
- } else
- s = configuration.getName();
- }
- }
if (s == null)
s = "";
return s;
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
index 6a8fbe4..fdf6742 100644
--- 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
@@ -8,7 +8,6 @@
*
* Contributors:
* IBM - Initial API and implementation
- *
**********************************************************************/
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.ui.IElementFactory;
@@ -21,7 +20,6 @@
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";
- protected final static String SERVER_CONFIGURATION_ID = "server-configuration-id";
/**
* ServerEditorInputFactory constructor comment.
@@ -40,9 +38,8 @@
public IAdaptable createElement(IMemento memento) {
// get the resource names
String serverId = memento.getString(SERVER_ID);
- String configurationId = memento.getString(SERVER_CONFIGURATION_ID);
-
- return new ServerEditorInput(serverId, configurationId);
+
+ return new ServerEditorInput(serverId);
}
/**
@@ -56,7 +53,5 @@
if (input.getServerId() != null)
memento.putString(SERVER_ID, input.getServerId());
- if (input.getServerConfigurationId() != null)
- memento.putString(SERVER_CONFIGURATION_ID, input.getServerConfigurationId());
}
-}
+}
\ 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
index 1743af6..6e5e33e 100644
--- 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
@@ -13,7 +13,6 @@
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.IPersistableElement;
-import org.eclipse.wst.server.core.IServerConfigurationWorkingCopy;
import org.eclipse.wst.server.core.IServerWorkingCopy;
import org.eclipse.wst.server.ui.editor.ICommandManager;
import org.eclipse.wst.server.ui.editor.IServerEditorPartInput;
@@ -25,21 +24,12 @@
protected boolean serverReadOnly;
protected ICommandManager serverCommandManager;
- protected IServerConfigurationWorkingCopy configuration;
- protected boolean configurationReadOnly;
- protected ICommandManager configurationCommandManager;
-
public ServerEditorPartInput(
- ICommandManager serverCommandManager, IServerWorkingCopy server, boolean serverReadOnly,
- ICommandManager configurationCommandManager, IServerConfigurationWorkingCopy configuration, boolean configurationReadOnly) {
+ ICommandManager serverCommandManager, IServerWorkingCopy server, boolean serverReadOnly) {
this.server = server;
this.serverReadOnly = serverReadOnly;
this.serverCommandManager = serverCommandManager;
-
- this.configuration = configuration;
- this.configurationReadOnly = configurationReadOnly;
- this.configurationCommandManager = configurationCommandManager;
}
public String getName() {
@@ -87,30 +77,8 @@
public ICommandManager getServerCommandManager() {
return serverCommandManager;
}
-
- /**
- * Returns the server configuration to be edited.
- *
- * @return IServerConfiguration
- */
- public IServerConfigurationWorkingCopy getServerConfiguration() {
- return configuration;
- }
-
- /**
- * Returns true if the server configuration is read-only.
- *
- * @return boolean
- */
- public boolean isServerConfigurationReadOnly() {
- return configurationReadOnly;
- }
-
- public ICommandManager getServerConfigurationCommandManager() {
- return configurationCommandManager;
- }
public String toString() {
- return "ServerEditorPartInput [" + server + ", " + configuration + "]";
+ 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
index 2d0aaa3..cdf3429 100644
--- 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
@@ -17,7 +17,6 @@
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.wst.server.core.IElement;
import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.IServerConfiguration;
import org.eclipse.wst.server.core.IServerWorkingCopy;
import org.eclipse.wst.server.core.ITask;
import org.eclipse.wst.server.ui.editor.ICommandManager;
@@ -94,8 +93,6 @@
if (commandManager.hasChanged(id)) {
if (serverfile instanceof IServer)
editor.promptReloadServerFile(id, (IServerWorkingCopy) serverfile);
- else
- editor.promptReloadServerConfigurationFile(id, (IServerConfiguration) serverfile);
}
// allow edit
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/task/SaveServerConfigurationTask.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/task/SaveServerConfigurationTask.java
deleted file mode 100644
index b791e38..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/task/SaveServerConfigurationTask.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2003 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 - 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.IServerConfiguration;
-import org.eclipse.wst.server.core.IServerConfigurationWorkingCopy;
-import org.eclipse.wst.server.core.ITaskModel;
-import org.eclipse.wst.server.core.util.Task;
-import org.eclipse.wst.server.ui.internal.EclipseUtil;
-/**
- *
- */
-public class SaveServerConfigurationTask extends Task {
- public SaveServerConfigurationTask() {
- // do nothing
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.server.ui.internal.task.ITask#doTask()
- */
- public void execute(IProgressMonitor monitor) throws CoreException {
- IServerConfiguration sc = (IServerConfiguration) getTaskModel().getObject(ITaskModel.TASK_SERVER_CONFIGURATION);
- if (sc != null && sc instanceof IServerConfigurationWorkingCopy) {
- IServerConfigurationWorkingCopy workingCopy = (IServerConfigurationWorkingCopy) sc;
- if (workingCopy.isDirty()) {
- IFile file = workingCopy.getFile();
- if (file != null && !file.getProject().exists()) {
- IProject project = file.getProject();
- EclipseUtil.createNewServerProject(null, project.getName(), null, monitor);
- }
- getTaskModel().putObject(ITaskModel.TASK_SERVER_CONFIGURATION, 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/TempSaveServerConfigurationTask.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/task/TempSaveServerConfigurationTask.java
deleted file mode 100644
index e7309a0..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/task/TempSaveServerConfigurationTask.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2003 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 - 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.IServerConfiguration;
-import org.eclipse.wst.server.core.IServerConfigurationWorkingCopy;
-import org.eclipse.wst.server.core.IServerWorkingCopy;
-import org.eclipse.wst.server.core.ITaskModel;
-import org.eclipse.wst.server.core.util.Task;
-import org.eclipse.wst.server.ui.internal.EclipseUtil;
-/**
- *
- */
-public class TempSaveServerConfigurationTask extends Task {
- public TempSaveServerConfigurationTask() {
- // do nothing
- }
-
- /* (non-Javadoc)
- * @see com.ibm.wtp.server.ui.internal.task.ITask#doTask()
- */
- public void execute(IProgressMonitor monitor) throws CoreException {
- IServerConfiguration sc = (IServerConfiguration) getTaskModel().getObject(ITaskModel.TASK_SERVER_CONFIGURATION);
- if (sc != null && sc instanceof IServerConfigurationWorkingCopy) {
- IServerConfigurationWorkingCopy workingCopy = (IServerConfigurationWorkingCopy) sc;
- if (!workingCopy.isDirty())
- return;
-
- IFile file = workingCopy.getFile();
- if (file != null && !file.getProject().exists()) {
- IProject project = file.getProject();
- EclipseUtil.createNewServerProject(null, project.getName(), null, monitor);
- }
- sc = workingCopy.save(false, monitor);
-
- workingCopy = sc.createWorkingCopy();
- try {
- IServerWorkingCopy server = (IServerWorkingCopy) getTaskModel().getObject(ITaskModel.TASK_SERVER);
- if (server.getServerType().hasServerConfiguration() &&server != null)
- server.setServerConfiguration(workingCopy);
- } catch (Exception e) {
- // ignore
- }
- getTaskModel().putObject(ITaskModel.TASK_SERVER_CONFIGURATION, workingCopy);
- }
- }
-}
\ 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
index 0372d85..dc481cb 100644
--- 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
@@ -1,6 +1,6 @@
/**********************************************************************
- * Copyright (c) 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
+ * 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 Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
@@ -41,12 +41,10 @@
EclipseUtil.createNewServerProject(null, project.getName(), null, monitor);
}
IRuntime runtime = workingCopy.getRuntime();
- IServerConfiguration config = workingCopy.getServerConfiguration();
server = workingCopy.save(false, monitor);
workingCopy = server.createWorkingCopy();
- workingCopy.setServerConfiguration(config);
workingCopy.setRuntime(runtime);
getTaskModel().putObject(ITaskModel.TASK_SERVER, workingCopy);
}
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
index 77d3032..166463f 100644
--- 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
@@ -14,9 +14,6 @@
import java.util.List;
import org.eclipse.jface.action.Action;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.IServerConfiguration;
-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;
@@ -47,12 +44,10 @@
deleteList.add(serverResources[i]);
}
- for (int i = 0; i < size; i++) {
+ // TODO: delete server config
+ /*for (int i = 0; i < size; i++) {
if (serverResources[i] instanceof IServer) {
IServer server = (IServer) serverResources[i];
- IServerConfiguration config = server.getServerConfiguration();
- if (config != null && !deleteList.contains(config))
- deleteExtraList.add(config);
}
}
@@ -67,7 +62,7 @@
deleteExtraList.remove(config);
}
}
- }
+ }*/
}
/**
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
index 359a48e..2ec7927 100644
--- 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
@@ -1,21 +1,20 @@
-package org.eclipse.wst.server.ui.internal.view.servers;
/**********************************************************************
- * Copyright (c) 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
+ * 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 Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* IBM - 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.ServerUIUtil;
import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
import org.eclipse.wst.server.ui.internal.Trace;
-
/**
* "Open" menu action.
*/
@@ -37,9 +36,9 @@
*/
public void run() {
try {
- ServerUIUtil.editServer(server, server.getServerConfiguration());
+ ServerUIUtil.editServer(server);
} catch (Exception e) {
Trace.trace("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/ServerTableLabelProvider.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ServerTableLabelProvider.java
index 2994699..f598992 100644
--- 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
@@ -10,6 +10,7 @@
*/
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;
@@ -24,16 +25,6 @@
* Server table label provider.
*/
public class ServerTableLabelProvider implements ITableLabelProvider {
- private static final Image[] serverStateImage = new Image[] {
- null,
- ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STARTING_1),
- ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STARTED),
- ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STARTED_DEBUG),
- ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STARTED_PROFILE),
- ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STOPPING_1),
- ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STOPPED),
- null};
-
private static final Image[] startingImages = new Image[] {
ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STARTING_1),
ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STARTING_2),
@@ -45,26 +36,13 @@
ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STOPPING_2),
ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STOPPING_2)
};
-
- private static final String[] serverState = new String[] {
- "",
- ServerUIPlugin.getResource("%viewStatusStarting"),
- ServerUIPlugin.getResource("%viewStatusStarted"),
- ServerUIPlugin.getResource("%viewStatusStartedDebug"),
- ServerUIPlugin.getResource("%viewStatusStartedProfile"),
- ServerUIPlugin.getResource("%viewStatusStopping"),
- ServerUIPlugin.getResource("%viewStatusStopped"),
- ServerUIPlugin.getResource("%viewStatusUnsupported")};
private static final String[] serverStateUnmanaged = new String[] {
"",
ServerUIPlugin.getResource("%viewStatusStarting4"),
ServerUIPlugin.getResource("%viewStatusStarted2"),
- ServerUIPlugin.getResource("%viewStatusStartedDebug2"),
- ServerUIPlugin.getResource("%viewStatusStartedProfile2"),
ServerUIPlugin.getResource("%viewStatusStopping4"),
- ServerUIPlugin.getResource("%viewStatusStopped2"),
- ServerUIPlugin.getResource("%viewStatusUnsupported2")};
+ ServerUIPlugin.getResource("%viewStatusStopped2")};
public static final String[] syncState = new String[] {
ServerUIPlugin.getResource("%viewSyncOkay"),
@@ -159,8 +137,8 @@
if (server.getServerType() == null)
return "";
- if (server.getServerType().hasServerConfiguration() && server.getServerConfiguration() == null)
- return ServerUIPlugin.getResource("%viewNoConfiguration");
+ //if (server.getServerType().hasServerConfiguration() && server.getServerConfiguration() == null)
+ // return ServerUIPlugin.getResource("%viewNoConfiguration");
if (server.getServerState() == IServer.STATE_UNKNOWN)
return "";
@@ -210,12 +188,23 @@
*/
protected Image getServerStateImage(IServer server) {
int state = server.getServerState();
- if (state == IServer.STATE_STARTING)
+ 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
- return serverStateImage[server.getServerState()];
+ 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);
+ }
}
/**
@@ -225,19 +214,30 @@
* @param server org.eclipse.wst.server.core.model.IServer
*/
protected String getServerStateLabel(IServer server, int stateSet) {
- if (stateSet == IServerType.SERVER_STATE_SET_PUBLISHED) {
+ if (stateSet == IServerType.SERVER_STATE_SET_PUBLISHED)
return "";
- }
+
+ int state = server.getServerState();
if (stateSet == IServerType.SERVER_STATE_SET_MANAGED) {
- int state = server.getServerState();
- if (state == IServer.STATE_STARTING)
+ 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
- return serverState[server.getServerState()];
+ 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[server.getServerState()];
+
+ return serverStateUnmanaged[state];
}
protected void animate() {
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ServerTableViewer.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ServerTableViewer.java
index aba6431..28a0106 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ServerTableViewer.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ServerTableViewer.java
@@ -311,7 +311,7 @@
* @param configuration org.eclipse.wst.server.core.model.IServerConfiguration
* @param add boolean
*/
- protected void configurationChange(IServerConfiguration configuration, boolean add) {
+ /*protected void configurationChange(IServerConfiguration configuration, boolean add) {
if (configuration == null)
return;
@@ -327,7 +327,7 @@
}
}
deletedElement = null;
- }
+ }*/
protected void refreshServer(final IServer server) {
Display.getDefault().asyncExec(new Runnable() {
@@ -401,9 +401,9 @@
add(server);
}
- protected void handleServerResourceAdded(IServerConfiguration configuration) {
+ /*protected void handleServerResourceAdded(IServerConfiguration configuration) {
configurationChange(configuration, true);
- }
+ }*/
/**
* Called when an element is changed.
@@ -413,7 +413,7 @@
refresh(server);
}
- protected void handleServerResourceChanged(IServerConfiguration configuration) {
+ /*protected void handleServerResourceChanged(IServerConfiguration configuration) {
IServer[] servers = ServerCore.getServers();
if (servers != null) {
int size = servers.length;
@@ -423,7 +423,7 @@
refresh(servers[i]);
}
}
- }
+ }*/
/**
* Called when an element is removed.
@@ -438,9 +438,9 @@
view.getViewSite().getActionBars().getStatusLineManager().setMessage(null, null);
}
- protected void handleServerResourceRemoved(IServerConfiguration configuration) {
+ /*protected void handleServerResourceRemoved(IServerConfiguration configuration) {
configurationChange(configuration, false);
- }
+ }*/
/**
* Register a startup listener.
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ServersView.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ServersView.java
index d286d97..a92d7ba 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ServersView.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ServersView.java
@@ -10,9 +10,7 @@
**********************************************************************/
package org.eclipse.wst.server.ui.internal.view.servers;
-import java.util.ArrayList;
import java.util.Iterator;
-import java.util.List;
import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.debug.ui.IDebugUIConstants;
@@ -24,7 +22,6 @@
import org.eclipse.wst.server.ui.internal.*;
import org.eclipse.wst.server.ui.internal.actions.ServerAction;
import org.eclipse.wst.server.ui.internal.view.tree.DisabledMenuManager;
-import org.eclipse.wst.server.ui.internal.view.tree.SwitchConfigurationAction;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
@@ -131,7 +128,7 @@
try {
TableItem item = table.getSelection()[0];
IServer server = (IServer) item.getData();
- ServerUIUtil.editServer(server, server.getServerConfiguration());
+ ServerUIUtil.editServer(server);
} catch (Exception e) {
Trace.trace(Trace.SEVERE, "Could not open server", e);
}
@@ -317,7 +314,7 @@
}
// switch config
- if (server.getServerType() != null && server.getServerType().hasServerConfiguration()) {
+ /*if (server.getServerType() != null && server.getServerType().hasServerConfiguration()) {
MenuManager menuManager = new MenuManager(ServerUIPlugin.getResource("%actionSwitchConfiguration"));
menuManager.add(new SwitchConfigurationAction(shell, ServerUIPlugin.getResource("%viewNoConfiguration"), server, null));
@@ -330,7 +327,7 @@
}
menu.add(menuManager);
- }
+ }*/
// monitor
if (server.getServerType() != null) {
@@ -398,7 +395,7 @@
* @param server org.eclipse.wst.server.core.IServer
* @return java.util.List
*/
- protected static IServerConfiguration[] getSupportedServerConfigurations(IServer server) {
+ /*protected static IServerConfiguration[] getSupportedServerConfigurations(IServer server) {
if (server == null)
return new IServerConfiguration[0];
@@ -417,7 +414,7 @@
IServerConfiguration[] sc = new IServerConfiguration[list.size()];
list.toArray(sc);
return sc;
- }
+ }*/
/**
*
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
index 0eb7da0..8d4e7cd 100644
--- 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
@@ -1,7 +1,6 @@
-package org.eclipse.wst.server.ui.internal.view.servers;
/**********************************************************************
- * Copyright (c) 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
+ * 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 Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
@@ -9,6 +8,8 @@
* Contributors:
* IBM - Initial API and implementation
**********************************************************************/
+package org.eclipse.wst.server.ui.internal.view.servers;
+
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.jface.viewers.ISelectionProvider;
@@ -48,8 +49,8 @@
* @param server org.eclipse.wst.server.core.model.IServer
*/
public void perform(final IServer server) {
- if (!ServerUIUtil.promptIfDirty(shell, server))
- return;
+ //if (!ServerUIUtil.promptIfDirty(shell, server))
+ // return;
if (!ServerUIUtil.saveEditors())
return;
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/tree/ConfigurationProxyResourceAdapter.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/tree/ConfigurationProxyResourceAdapter.java
deleted file mode 100644
index 8baf7dc..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/tree/ConfigurationProxyResourceAdapter.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2003 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 - 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.IServer;
-import org.eclipse.wst.server.core.IServerConfiguration;
-import org.eclipse.wst.server.ui.ServerUICore;
-import org.eclipse.wst.server.ui.internal.ImageResource;
-import org.eclipse.wst.server.ui.internal.ServerLabelProvider;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-import org.eclipse.ui.model.IWorkbenchAdapter;
-/**
- *
- */
-public class ConfigurationProxyResourceAdapter implements IAdaptable, IWorkbenchAdapter, IServerElementTag {
- private static final Object[] NO_CHILDREN = new Object[0];
-
- public static IServerConfiguration deleted;
-
- protected IServer server;
- protected Object parent;
-
- public ConfigurationProxyResourceAdapter(Object parent, IServer server) {
- super();
- this.parent = parent;
- this.server = server;
- }
-
- /*
- * @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);
- }
-
- public Object[] getChildren(Object o) {
- return NO_CHILDREN;
- }
-
- /*
- * @see IWorkbenchAdapter#getImageDescriptor(Object)
- */
- public ImageDescriptor getImageDescriptor(Object object) {
- IServerConfiguration config = server.getServerConfiguration();
- if (config != null && config != deleted)
- return ((ServerLabelProvider)ServerUICore.getLabelProvider()).getImageDescriptor(config);
-
- return ImageResource.getImageDescriptor(ImageResource.IMG_SERVER_CONFIGURATION_MISSING);
- }
-
- /*
- * @see IWorkbenchAdapter#getLabel(Object)
- */
- public String getLabel(Object o) {
- IServerConfiguration config = server.getServerConfiguration();
- if (config != null && config != deleted)
- return config.getName();
-
- return ServerUIPlugin.getResource("%viewNoConfiguration");
- }
-
- /*
- * @see IWorkbenchAdapter#getParent(Object)
- */
- public Object getParent(Object o) {
- return parent;
- }
-
- /**
- * Return true if the object is the same as this object.
- * @return boolean
- * @param obj java.lang.Object
- */
- public boolean equals(Object obj) {
- if (obj instanceof ConfigurationProxyResourceAdapter) {
- ConfigurationProxyResourceAdapter proxy = (ConfigurationProxyResourceAdapter) obj;
-
- IServer inst = proxy.getServer();
- if ((server == null && inst != null) ||
- server != null && !server.equals(inst))
- return false;
-
- return true;
- }
- return false;
- }
-
- /**
- * Return the server.
- *
- * @return org.eclipse.wst.server.core.model.IServer
- */
- public IServer getServer() {
- return server;
- }
-
- public int hashCode() {
- if (server != null) {
- IFile file = server.getFile();
- return file.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/ServerElementAdapter.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/tree/ServerElementAdapter.java
index de5cbce..10912d2 100644
--- 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
@@ -16,7 +16,6 @@
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.IServerConfiguration;
import org.eclipse.wst.server.ui.ServerUICore;
import org.eclipse.wst.server.ui.internal.ServerLabelProvider;
import org.eclipse.ui.model.IWorkbenchAdapter;
@@ -69,12 +68,7 @@
public Object[] getChildren() {
if (resource instanceof IServer) {
IServer server = (IServer) resource;
- IServerConfiguration configuration = server.getServerConfiguration();
- if (configuration == null)
- //return new Object[] { new TextResourceAdapter(this, TextResourceAdapter.STYLE_NO_CONFIGURATION) };
- return new Object[] { new ConfigurationProxyResourceAdapter(this, server) };
- //return NO_CHILDREN;
-
+
IModule[] modules = server.getModules(null);
if (modules == null || modules.length == 0) {
//return new Object[] { new TextResourceAdapter(this, TextResourceAdapter.STYLE_NO_MODULES)};
@@ -144,10 +138,7 @@
protected IFile getFile() {
if (resource instanceof IServer)
return ((IServer) resource).getFile();
- else if (resource instanceof IServerConfiguration)
- return ((IServerConfiguration) resource).getFile();
- else
- return null;
+ return null;
}
public boolean equals(Object obj) {
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
index baa81e9..d4ffcb5 100644
--- 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
@@ -1,7 +1,6 @@
-package org.eclipse.wst.server.ui.internal.view.tree;
/**********************************************************************
- * Copyright (c) 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
+ * 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 Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
@@ -9,13 +8,15 @@
* Contributors:
* IBM - Initial API and implementation
**********************************************************************/
+package org.eclipse.wst.server.ui.internal.view.tree;
+
+import org.eclipse.core.runtime.IPath;
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.IServerConfiguration;
import org.eclipse.wst.server.core.IServerType;
import org.eclipse.wst.server.core.IServerWorkingCopy;
import org.eclipse.wst.server.ui.ServerUICore;
@@ -25,26 +26,25 @@
import org.eclipse.wst.server.ui.internal.ServerLabelProvider;
import org.eclipse.wst.server.ui.internal.Trace;
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 IServerConfiguration config;
+ protected IPath config;
protected Shell shell;
protected IStatus status;
/**
* SwitchConfigurationAction constructor comment.
*/
- public SwitchConfigurationAction(Shell shell, String label, IServer server, IServerConfiguration config) {
+ public SwitchConfigurationAction(Shell shell, String label, IServer server, IPath config) {
super(label);
this.shell = shell;
this.server = server;
this.config = config;
- IServerConfiguration tempConfig = server.getServerConfiguration();
+ IPath tempConfig = server.getServerConfiguration();
if ((tempConfig == null && config == null) || (tempConfig != null && tempConfig.equals(config)))
setChecked(true);
@@ -60,7 +60,7 @@
}
public void run() {
- IServerConfiguration tempConfig = server.getServerConfiguration();
+ IPath tempConfig = server.getServerConfiguration();
if ((tempConfig == null && config == null) || (tempConfig != null && tempConfig.equals(config)))
return;
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
index d8cc747..33cff7c 100644
--- 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
@@ -15,10 +15,8 @@
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.wst.server.core.IServerConfiguration;
import org.eclipse.wst.server.core.ServerCore;
import org.eclipse.wst.server.ui.ServerImageResource;
-import org.eclipse.wst.server.ui.internal.ServerTreeContentProvider;
import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.PlatformUI;
@@ -34,12 +32,8 @@
public static Object deleted;
public final static byte STYLE_SERVERS = 0;
- public final static byte STYLE_CONFIGURATIONS = 1;
- //public final static byte STYLE_SERVERS_AND_CONFIGURATIONS = 2;
- //public final static byte STYLE_NO_CONFIGURATION = 3;
public final static byte STYLE_NO_MODULES = 4;
public final static byte STYLE_NO_SERVERS = 5;
- public final static byte STYLE_LOOSE_CONFIGURATIONS = 6;
public TextResourceAdapter(Object parent, byte thisStyle) {
this.parent = parent;
@@ -72,16 +66,6 @@
public Object[] getChildren(Object o) {
if (thisStyle == STYLE_NO_MODULES || thisStyle == STYLE_NO_SERVERS)
return new Object[0];
- if (thisStyle == STYLE_LOOSE_CONFIGURATIONS) {
- IServerConfiguration[] looseCfg = ServerTreeContentProvider.getLooseConfigurations();
- int size = looseCfg.length;
- Object[] obj = new Object[size];
- for (int i = 0; i < size; i++) {
- obj[i] = new ServerElementAdapter(this, looseCfg[i]);
- }
-
- return obj;
- }
/*else if (thisStyle == STYLE_SERVERS_AND_CONFIGURATIONS)
return new Object[] {
new TextResourceAdapter(this, STYLE_SERVERS),
@@ -91,8 +75,6 @@
Object[] elements = null;
if (thisStyle == STYLE_SERVERS)
elements = ServerCore.getServers();
- else if (thisStyle == STYLE_CONFIGURATIONS)
- elements = ServerCore.getServerConfigurations();
List list = new ArrayList();
if (elements != null) {
@@ -111,8 +93,6 @@
public ImageDescriptor getImageDescriptor(Object object) {
if (thisStyle == STYLE_SERVERS)
return ServerImageResource.getImageDescriptor(ServerImageResource.IMG_SERVER_FOLDER);
- else if (thisStyle == STYLE_CONFIGURATIONS || thisStyle == STYLE_LOOSE_CONFIGURATIONS)
- return ServerImageResource.getImageDescriptor(ServerImageResource.IMG_SERVER_CONFIGURATION_FOLDER);
//else if (thisStyle == STYLE_SERVERS_AND_CONFIGURATIONS)
// return ServerImageResource.getImageDescriptor(ServerImageResource.IMG_SERVER_PROJECT);
//else if (thisStyle == STYLE_NO_CONFIGURATION)
@@ -133,8 +113,6 @@
public String getLabel(Object o) {
if (thisStyle == STYLE_SERVERS)
return ServerUIPlugin.getResource("%viewServers");
- else if (thisStyle == STYLE_CONFIGURATIONS)
- return ServerUIPlugin.getResource("%viewConfigurations");
//else if (thisStyle == STYLE_SERVERS_AND_CONFIGURATIONS)
// return "Server Info";
//else if (thisStyle == STYLE_NO_CONFIGURATION)
@@ -143,8 +121,6 @@
return ServerUIPlugin.getResource("%viewNoModules");
else if (thisStyle == STYLE_NO_SERVERS)
return ServerUIPlugin.getResource("%viewConfigurationUnused");
- else if (thisStyle == STYLE_LOOSE_CONFIGURATIONS)
- return ServerUIPlugin.getResource("%viewLooseConfigurations");
else
return "n/a";
}
@@ -167,4 +143,4 @@
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/ServerConfigurationTypeComposite.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/ServerConfigurationTypeComposite.java
deleted file mode 100644
index e738982..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/ServerConfigurationTypeComposite.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2003 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 - 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.swt.widgets.Composite;
-import org.eclipse.wst.server.core.IServerConfigurationType;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-/**
- *
- */
-public class ServerConfigurationTypeComposite extends AbstractTreeComposite {
- protected IServerConfigurationType selection;
- protected ServerConfigurationTypeSelectionListener listener;
-
- public interface ServerConfigurationTypeSelectionListener {
- public void configurationTypeSelected(IServerConfigurationType type);
- }
-
- public ServerConfigurationTypeComposite(Composite parent, int style, ServerConfigurationTypeSelectionListener listener2) {
- super(parent, style);
- this.listener = listener2;
-
- treeViewer.setContentProvider(new ServerConfigurationTypeTreeContentProvider(AbstractTreeContentProvider.STYLE_FLAT));
- treeViewer.setLabelProvider(new ServerConfigurationTypeTreeLabelProvider());
- treeViewer.setInput(AbstractTreeContentProvider.ROOT);
-
- treeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- Object obj = getSelection(event.getSelection());
- if (obj instanceof IServerConfigurationType) {
- selection = (IServerConfigurationType) obj;
- setDescription(selection.getDescription());
- } else {
- selection = null;
- setDescription("");
- }
- listener.configurationTypeSelected(selection);
- }
- });
- }
-
- protected String getDescriptionLabel() {
- return null;
- }
-
- protected boolean hasDescription() {
- return false;
- }
-
- protected String getTitleLabel() {
- return ServerUIPlugin.getResource("%wizImportConfigurationType");
- }
-
- protected String[] getComboOptions() {
- return new String[] { ServerUIPlugin.getResource("%name") };
- //, ServerUIPlugin.getResource("%vendor"), ServerUIPlugin.getResource("%version") };
- }
-
- protected void viewOptionSelected(byte option) {
- ISelection sel = treeViewer.getSelection();
- treeViewer.setContentProvider(new ServerConfigurationTypeTreeContentProvider(option));
- treeViewer.setSelection(sel);
- }
-
- public IServerConfigurationType getSelectedServerConfigurationType() {
- return selection;
- }
-}
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/ServerConfigurationTypeTreeContentProvider.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/ServerConfigurationTypeTreeContentProvider.java
deleted file mode 100644
index 5068cb7..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/ServerConfigurationTypeTreeContentProvider.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2003 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 - 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.IServerConfigurationType;
-import org.eclipse.wst.server.core.ServerCore;
-import org.eclipse.wst.server.ui.internal.Trace;
-/**
- * Server configuration type content provider.
- */
-public class ServerConfigurationTypeTreeContentProvider extends AbstractTreeContentProvider {
- public static final byte STYLE_VENDOR = 1;
- public static final byte STYLE_VERSION = 2;
- public static final byte STYLE_HOST = 3;
- public static final byte STYLE_TYPE = 4;
-
- /**
- * ServerConfigurationTypeTreeContentProvider constructor comment.
- */
- public ServerConfigurationTypeTreeContentProvider(byte style) {
- super(style);
- }
-
- public void fillTree() {
- clean();
- List list = new ArrayList();
- IServerConfigurationType[] configTypes = ServerCore.getServerConfigurationTypes();
- if (configTypes != null) {
- int size = configTypes.length;
- for (int i = 0; i < size; i++) {
- IServerConfigurationType type = configTypes[i];
- if (style == STYLE_FLAT) {
- list.add(type);
- } else {
- try {
- /*TreeElement ele = null;
- if (style == STYLE_VENDOR)
- ele = getOrCreate(list, type.getVendor());
- else if (style == STYLE_VERSION)
- ele = getOrCreate(list, type.getVersion());
- else if (style == STYLE_TYPE)
- ele = getOrCreate(list, type.getLabel());
- ele.contents.add(type);
- elementToParentMap.put(type, ele);*/
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Error in server configuration content provider", e);
- }
- }
- }
- }
- 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/ServerConfigurationTypeTreeLabelProvider.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/ServerConfigurationTypeTreeLabelProvider.java
deleted file mode 100644
index 08b91d6..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/ServerConfigurationTypeTreeLabelProvider.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/**
- * Copyright (c) 2003 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 - Initial API and implementation
- */
-package org.eclipse.wst.server.ui.internal.viewers;
-
-import org.eclipse.wst.server.core.IServerConfigurationType;
-import org.eclipse.wst.server.ui.internal.ImageResource;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * Server configuration type label provider.
- */
-public class ServerConfigurationTypeTreeLabelProvider extends AbstractTreeLabelProvider {
- /**
- * ServerConfigurationTypeTreeLabelProvider constructor comment.
- */
- public ServerConfigurationTypeTreeLabelProvider() {
- super();
- }
-
- /**
- *
- */
- protected Image getImageImpl(Object element) {
- IServerConfigurationType type = (IServerConfigurationType) element;
- return ImageResource.getImage(type.getId());
- }
-
- /**
- *
- */
- protected String getTextImpl(Object element) {
- IServerConfigurationType type = (IServerConfigurationType) element;
- return notNull(type.getName());
- }
-}
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
index 9e3d954..4aadd8e 100644
--- 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
@@ -48,12 +48,10 @@
list.add(new NewServerWizardFragment());
list.add(new FinishWizardFragment(new TempSaveRuntimeTask()));
list.add(new FinishWizardFragment(new TempSaveServerTask()));
- list.add(new FinishWizardFragment(new TempSaveServerConfigurationTask()));
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 SaveServerConfigurationTask()));
list.add(new FinishWizardFragment(new Task() {
public void execute(IProgressMonitor monitor) throws CoreException {
try {
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/SelectServerWizard.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/SelectServerWizard.java
index 3db2f2e..33821e7 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/SelectServerWizard.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/SelectServerWizard.java
@@ -43,12 +43,10 @@
list.add(task);
list.add(new FinishWizardFragment(new TempSaveRuntimeTask()));
list.add(new FinishWizardFragment(new TempSaveServerTask()));
- list.add(new FinishWizardFragment(new TempSaveServerConfigurationTask()));
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 SaveServerConfigurationTask()));
list.add(new FinishWizardFragment(new Task() {
public void execute(IProgressMonitor monitor) throws CoreException {
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
index 083df8d..0ec113f 100644
--- 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
@@ -14,16 +14,10 @@
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.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.wst.server.core.*;
import org.eclipse.wst.server.ui.ServerUICore;
-import org.eclipse.wst.server.ui.internal.Trace;
import org.eclipse.wst.server.ui.internal.wizard.page.NewServerComposite;
-import org.eclipse.wst.server.ui.internal.wizard.page.WizardUtil;
import org.eclipse.wst.server.ui.wizard.WizardFragment;
import org.eclipse.wst.server.ui.wizard.IWizardHandle;
/**
@@ -70,7 +64,7 @@
return comp;
}
- protected void createConfiguration(IServerWorkingCopy server) {
+ /*protected void createConfiguration(IServerWorkingCopy server) {
ITaskModel model = getTaskModel();
IRuntime runtime = (IRuntime) model.getObject(ITaskModel.TASK_RUNTIME);
@@ -84,10 +78,8 @@
try {
IFile file = null;
if (ServerCore.getServerPreferences().isCreateResourcesInWorkspace())
- file = ServerUtil.getUnusedServerConfigurationFile(WizardUtil.getServerProject(), type.getServerConfigurationType());
+ file = ServerUtil.getUnusedServerConfigurationFile(WizardUtil.getServerProject(), null);
- /*IServerConfigurationWorkingCopy serverConfiguration = type.getServerConfigurationType().importFromRuntime(null, file, runtime, new NullProgressMonitor());
- ServerUtil.setServerConfigurationDefaultName(serverConfiguration);*/
IServerConfigurationWorkingCopy serverConfiguration = getServerConfiguration(type.getServerConfigurationType(), file, runtime);
model.putObject(ITaskModel.TASK_SERVER_CONFIGURATION, serverConfiguration);
server.setServerConfiguration(serverConfiguration);
@@ -96,9 +88,9 @@
}
}
}
- }
+ }*/
- protected IServerConfigurationWorkingCopy getServerConfiguration(IServerConfigurationType type, IFile file, IRuntime runtime) throws CoreException {
+ /*protected IServerConfigurationWorkingCopy getServerConfiguration(IServerConfigurationType type, IFile file, IRuntime runtime) throws CoreException {
Object key = type.getId() + "|" + file + "|" + runtime;
try {
IServerConfigurationWorkingCopy serverConfiguration = (IServerConfigurationWorkingCopy) configMap.get(key);
@@ -112,7 +104,7 @@
ServerUtil.setServerConfigurationDefaultName(serverConfiguration);
configMap.put(key, serverConfiguration);
return serverConfiguration;
- }
+ }*/
protected WizardFragment getWizardFragment(String typeId) {
try {
@@ -144,7 +136,7 @@
IServerWorkingCopy server = (IServerWorkingCopy) getTaskModel().getObject(ITaskModel.TASK_SERVER);
if (server != null) {
- createConfiguration(server);
+ /*createConfiguration(server);
WizardFragment sub = getWizardFragment(server.getServerType().getId());
if (sub != null)
list.add(sub);
@@ -154,7 +146,7 @@
sub = getWizardFragment(serverConfiguration.getServerConfigurationType().getId());
if (sub != null)
list.add(sub);
- }
+ }*/
}
//list.add(new TasksWizardFragment());
} else if (b != null && b.byteValue() == MODE_EXISTING) {
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
index 3e1c232..0efc49b 100644
--- 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
@@ -10,14 +10,6 @@
**********************************************************************/
package org.eclipse.wst.server.ui.internal.wizard.fragment;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.wst.server.core.*;
-import org.eclipse.wst.server.ui.ServerUICore;
-import org.eclipse.wst.server.ui.internal.Trace;
-import org.eclipse.wst.server.ui.internal.wizard.page.WizardUtil;
import org.eclipse.wst.server.ui.wizard.WizardFragment;
/**
*
@@ -28,12 +20,12 @@
}
public void enter() {
- ITaskModel model = getTaskModel();
- IRuntime runtime = (IRuntime) model.getObject(ITaskModel.TASK_RUNTIME);
- IServerWorkingCopy server = (IServerWorkingCopy) model.getObject(ITaskModel.TASK_SERVER);
+ //ITaskModel model = getTaskModel();
+ //IRuntime runtime = (IRuntime) model.getObject(ITaskModel.TASK_RUNTIME);
+ //IServerWorkingCopy server = (IServerWorkingCopy) model.getObject(ITaskModel.TASK_SERVER);
- IServerType type = server.getServerType();
- if (type.hasServerConfiguration() && server.getServerConfiguration() == null) {
+ //IServerType type = server.getServerType();
+ /*if (type.hasServerConfiguration() && server.getServerConfiguration() == null) {
try {
IFile file = null;
if (ServerCore.getServerPreferences().isCreateResourcesInWorkspace())
@@ -47,10 +39,10 @@
} catch (Exception e) {
Trace.trace(Trace.SEVERE, "Could not create configuration", e);
}
- }
+ }*/
}
- protected void createChildFragments(List list) {
+ /*protected void createChildFragments(List list) {
IServerWorkingCopy server = (IServerWorkingCopy) getTaskModel().getObject(ITaskModel.TASK_SERVER);
IServerConfiguration serverConfiguration = null;
if (server != null)
@@ -60,5 +52,5 @@
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
index 946f52a..9496099 100644
--- 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
@@ -110,10 +110,6 @@
IServer server = (IServer) getTaskModel().getObject(ITaskModel.TASK_SERVER);
- IServerConfiguration configuration = null;
- if (server != null)
- configuration = server.getServerConfiguration();
-
List[] parents = (List[]) getTaskModel().getObject(ITaskModel.TASK_MODULE_PARENTS);
IModule[] modules = (IModule[]) getTaskModel().getObject(ITaskModel.TASK_MODULES);
@@ -140,7 +136,7 @@
if (server != null && parents != null || modules != null) {
tasks = new ArrayList();
- createTasks(server, configuration, parents, modules);
+ createTasks(server, parents, modules);
}
if (comp != null)
@@ -151,13 +147,10 @@
});
}
- protected void createTasks(IServer server, IServerConfiguration configuration, List[] parents, IModule[] modules) {
+ protected void createTasks(IServer server, List[] parents, IModule[] modules) {
String serverTypeId = null;
- String serverConfigurationTypeId = null;
if (server != null)
serverTypeId = server.getServerType().getId();
- if (configuration != null)
- serverConfigurationTypeId = configuration.getServerConfigurationType().getId();
// server tasks
IServerTask[] serverTasks = ServerCore.getServerTasks();
@@ -165,9 +158,8 @@
int size = serverTasks.length;
for (int i = 0; i < size; i++) {
IServerTask task = serverTasks[i];
- if ((serverTypeId != null && task.supportsType(serverTypeId)) ||
- (serverConfigurationTypeId != null && task.supportsType(serverConfigurationTypeId))) {
- IOptionalTask[] tasks2 = task.getTasks(server, configuration, parents, modules);
+ 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++) {
@@ -176,7 +168,7 @@
if (status == IOptionalTask.TASK_READY || status == IOptionalTask.TASK_PREFERRED)
hasOptionalTasks = true;
tasks2[i].setTaskModel(getTaskModel());
- addServerTask(server, configuration, tasks2[j]);
+ addServerTask(server, tasks2[j]);
}
}
}
@@ -185,13 +177,11 @@
}
}
- public void addServerTask(IServer server, IServerConfiguration configuration, IOptionalTask task2) {
+ public void addServerTask(IServer server, IOptionalTask task2) {
TaskInfo sti = new TaskInfo();
sti.task2 = task2;
sti.status = task2.getStatus();
String id = server.getId();
- if (configuration != null)
- id += "|" + configuration.getId();
sti.id = id + "|" + task2.getName();
if (sti.status == IOptionalTask.TASK_PREFERRED || sti.status == IOptionalTask.TASK_MANDATORY)
sti.setDefaultSelected(true);
@@ -244,13 +234,10 @@
// get most recent server/configuration
boolean createdServerWC = false;
- boolean createdConfigWC = false;
ITaskModel taskModel = getTaskModel();
IServer server = (IServer) taskModel.getObject(ITaskModel.TASK_SERVER);
if (server == null)
return;
- IServerConfiguration configuration = null;
- configuration = server.getServerConfiguration();
// get working copies
IServerWorkingCopy serverWC = null;
@@ -261,17 +248,7 @@
createdServerWC = true;
}
- IServerConfigurationWorkingCopy configWC = null;
- if (configuration != null) {
- if (configuration instanceof IServerConfigurationWorkingCopy)
- configWC = (IServerConfigurationWorkingCopy) configuration;
- else {
- configWC = configuration.createWorkingCopy();
- createdConfigWC = true;
- }
- }
taskModel.putObject(ITaskModel.TASK_SERVER, serverWC);
- taskModel.putObject(ITaskModel.TASK_SERVER_CONFIGURATION, configWC);
// begin task
monitor.beginTask(ServerUIPlugin.getResource("%performingTasks"), performTasks.size() * 1000);
@@ -307,19 +284,7 @@
} else
taskModel.putObject(ITaskModel.TASK_SERVER, serverWC.getOriginal());
}
-
- if (createdConfigWC) {
- if (configWC.isDirty()) {
- IFile file = configWC.getFile();
- if (file != null && !file.getProject().exists()) {
- IProject project = file.getProject();
- EclipseUtil.createNewServerProject(null, project.getName(), null, monitor);
- }
- taskModel.putObject(ITaskModel.TASK_SERVER_CONFIGURATION, configWC.save(false, monitor));
- } else
- taskModel.putObject(ITaskModel.TASK_SERVER_CONFIGURATION, configWC.getOriginal());
- }
-
+
monitor.done();
}
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
index 9f2671d..8940eb9 100644
--- 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
@@ -17,8 +17,6 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.IServerConfigurationType;
-import org.eclipse.wst.server.core.IServerConfigurationWorkingCopy;
import org.eclipse.wst.server.core.IServerType;
import org.eclipse.wst.server.core.IServerWorkingCopy;
import org.eclipse.wst.server.core.ServerCore;
@@ -49,39 +47,6 @@
return type.getId() + "|" + host + "|";
}
- protected String getKey(IServerConfigurationType type) {
- return type.getId() + "|";
- }
-
- /**
- * Returns a server configuration.
- *
- * @param type org.eclipse.wst.server.core.IServerConfigurationTpye
- * @return org.eclipse.wst.server.core.IServerConfigurationWorkingCopy
- */
- public IServerConfigurationWorkingCopy getServerConfiguration(IServerConfigurationType type, IRuntime runtime, IProgressMonitor monitor) throws CoreException {
- try {
- IServerConfigurationWorkingCopy configuration = getCachedServerConfiguration(type);
- if (configuration != null)
- return configuration;
- } catch (Exception e) {
- // ignore
- }
-
- try {
- IFile file = null;
- if (ServerCore.getServerPreferences().isCreateResourcesInWorkspace())
- file = ServerUtil.getUnusedServerConfigurationFile(WizardUtil.getServerProject(), type);
-
- IServerConfigurationWorkingCopy configuration = type.createServerConfiguration(null, file, monitor);
- if (runtime != null)
- elementCache.put(getKey(type) + runtime.getId(), configuration);
- return configuration;
- } catch (CoreException ce) {
- throw ce;
- }
- }
-
/**
* Returns a server.
*
@@ -127,22 +92,4 @@
return null;
}
-
- /**
- * Returns a cached server resource.
- *
- * @param factory org.eclipse.wst.server.core.model.IServerFactory
- * @return org.eclipse.wst.server.core.model.IServerResource
- */
- public IServerConfigurationWorkingCopy getCachedServerConfiguration(IServerConfigurationType type) {
- try {
- IServerConfigurationWorkingCopy wc = (IServerConfigurationWorkingCopy) elementCache.get(getKey(type));
- if (wc != null)
- return wc;
- } 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/ImportConfigurationWizardPage.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/ImportConfigurationWizardPage.java
index ecd29ea..4beab64 100644
--- 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
@@ -9,16 +9,17 @@
* Contributors:
* IBM - Initial API and implementation
**********************************************************************/
-import org.eclipse.core.resources.IContainer;
+/*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.jface.dialogs.Dialog;*/
+import org.eclipse.core.resources.IContainer;
import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.SWT;
+/*import org.eclipse.swt.SWT;
import org.eclipse.swt.events.FocusAdapter;
import org.eclipse.swt.events.FocusEvent;
import org.eclipse.swt.events.ModifyEvent;
@@ -28,32 +29,29 @@
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.Combo;*/
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.DirectoryDialog;
+/*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.IServerConfiguration;
-import org.eclipse.wst.server.core.IServerConfigurationType;
-import org.eclipse.wst.server.core.IServerConfigurationWorkingCopy;
import org.eclipse.wst.server.core.internal.ServerPlugin;
-import org.eclipse.wst.server.ui.ServerUICore;
+import org.eclipse.wst.server.ui.ServerUICore;*/
import org.eclipse.wst.server.ui.internal.*;
-import org.eclipse.wst.server.ui.internal.viewers.ServerConfigurationTypeComposite;
/**
* Wizard page to import a configuration.
*/
public class ImportConfigurationWizardPage extends WizardPage {
- protected IServerConfigurationType selectedConfigType;
- protected IServerConfigurationWorkingCopy configuration;
+ /*
+ //protected IServerConfigurationType selectedConfigType;
+ //protected IServerConfigurationWorkingCopy configuration;
protected Combo serverProject;
protected Button create;
protected Text name;
protected Text filename;
- protected ServerConfigurationTypeComposite configTypeComposite;
+ //protected ServerConfigurationTypeComposite configTypeComposite;
private Label description;
protected Button browse;
private IContainer defaultContainer;
@@ -66,9 +64,9 @@
private static final int INVALID_IMPORT = 4;
protected LoadThread thread;
- protected boolean threadDone;
+ protected boolean threadDone;*/
- class LoadThread extends Thread {
+ /*class LoadThread extends Thread {
final int DELAY = 800;
String filename2;
IFile file;
@@ -95,7 +93,7 @@
}
threadDone = true;
}
- }
+ }*/
/**
* ImportConfigurationWizardPage constructor comment.
@@ -114,7 +112,8 @@
*/
public void createControl(Composite parent) {
initializeDialogUnits(parent);
-
+ }
+ /*
Composite composite = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
layout.numColumns = 3;
@@ -264,9 +263,9 @@
setControl(composite);
Dialog.applyDialogFont(composite);
- }
+ }*/
- protected void loadConfiguration() {
+ /*protected void loadConfiguration() {
if (thread != null) {
try {
thread.interrupt();
@@ -307,12 +306,12 @@
threadDone = false;
thread.start();
}
- }
+ }*/
/**
* Handle the server factory selection.
*/
- protected void handleFactorySelection(IServerConfigurationType type) {
+ /*protected void handleFactorySelection(IServerConfigurationType type) {
validationErrors[INVALID_IMPORT] = null;
configuration = null;
selectedConfigType = type;
@@ -369,13 +368,13 @@
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() {
+ /*public boolean isPageComplete() {
// check for validation first
for (int i = 0; i < validationErrors.length; i++) {
if (validationErrors[i] != null)
@@ -390,7 +389,7 @@
// otherwise, defer to superclass
return super.isPageComplete();
- }
+ }*/
/**
* Finish the wizard by saving the configuration into
@@ -398,6 +397,9 @@
* @return boolean
*/
public boolean performFinish() {
+ return true;
+ }
+ /*
if (configuration == null)
return false;
@@ -419,7 +421,7 @@
Trace.trace(Trace.SEVERE, "Error saving imported configuration", e);
return false;
}
- }
+ }*/
/**
* Save the element to the given file name.
@@ -427,7 +429,7 @@
* @param name java.lang.String
* @param org.eclipse.core.runtime.IProgressMonitor monitor
*/
- protected void saveConfiguration(IServerConfigurationWorkingCopy config, String theName, IProgressMonitor monitor) throws CoreException {
+ /*protected void saveConfiguration(IServerConfigurationWorkingCopy config, String theName, IProgressMonitor monitor) throws CoreException {
// save the element
try {
IFile file = config.getFile();
@@ -441,17 +443,17 @@
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 org.eclipse.core.resources.IContainer
*/
public void setDefaultContainer(IContainer container) {
- defaultContainer = container;
+ //defaultContainer = container;
}
- public void setVisible(boolean visible) {
+ /*public void setVisible(boolean visible) {
super.setVisible(visible);
if (visible) {
@@ -463,12 +465,12 @@
name.forceFocus();
}
- }
+ }*/
/**
* Validates the folder.
*/
- protected void validateFolder() {
+ /*protected void validateFolder() {
String text = serverProject.getText();
if (text == null || text.length() == 0) {
validationErrors[INVALID_FOLDER] = "";
@@ -476,12 +478,12 @@
}
validationErrors[INVALID_FOLDER] = WizardUtil.validateContainer(text);
- }
+ }*/
/**
* Validates the name.
*/
- protected void validateName() {
+ /*protected void validateName() {
String text = name.getText();
if (text == null || text.length() == 0) {
validationErrors[INVALID_NAME] = "";
@@ -509,14 +511,14 @@
} 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) {
+ /*protected void validatePage(int x) {
if (x >= 0 && validationErrors[x] != null && validationErrors[x].length() > 0) {
setErrorMessage(validationErrors[x]);
getContainer().updateButtons();
@@ -532,5 +534,5 @@
}
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/NewManualServerComposite.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/NewManualServerComposite.java
index 0dcc7ea..7176927 100644
--- 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
@@ -233,7 +233,7 @@
int size = runtimes.length;
for (int i = 0; i < size; i++) {
if (!runtimes[i].isStub())
- return runtime;
+ return runtimes[i];
}
}
return runtimes[0];
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
index 3f76913..762e5c9 100644
--- 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
@@ -108,7 +108,7 @@
if (resource instanceof IFile) {
IFile file = (IFile) resource;
- if (ServerUtil.findServerConfiguration(file) != null || ServerUtil.findServer(file) != null)
+ if (ServerUtil.findServer(file) != null)
return null;
}
@@ -197,7 +197,7 @@
while (temp != null && !(temp instanceof IProject)) {
if (temp instanceof IFile) {
IFile file = (IFile) temp;
- if (ServerUtil.findServerConfiguration(file) != null || ServerUtil.findServer(file) != null)
+ if (ServerUtil.findServer(file) != null)
return error;
}
temp = temp.getParent();