More plugin cleanup/server fixing
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/re_execute.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/re_execute.gif new file mode 100644 index 0000000..8f943a8 --- /dev/null +++ b/plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/re_execute.gif Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/wizard/J2EEModuleImportPage.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/wizard/J2EEModuleImportPage.java index f4ad4a0..e8d53ee 100644 --- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/wizard/J2EEModuleImportPage.java +++ b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/wizard/J2EEModuleImportPage.java
@@ -60,7 +60,7 @@ * @param composite */ private void createServerEarAndStandaloneGroup(Composite composite) { - new ServerEarAndStandaloneGroup(composite, getJ2EEModuleImportDataModel().getJ2eeArtifactCreationDataModel()); + new ServerEarAndStandaloneGroup(composite, getJ2EEModuleImportDataModel().getJ2EEModuleCreationDataModel()); } /**
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/wizard/ServerEarAndStandaloneGroup.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/wizard/ServerEarAndStandaloneGroup.java index 126aac4..a44c3e7 100644 --- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/wizard/ServerEarAndStandaloneGroup.java +++ b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/wizard/ServerEarAndStandaloneGroup.java
@@ -49,17 +49,19 @@ private Label earLabel; private Button addToEAR; protected Combo serverTargetCombo; - private J2EEArtifactCreationDataModel model; + private J2EEModuleCreationDataModel model; // constants //private static final int SIZING_TEXT_FIELD_WIDTH = 305; private WTPDataModelSynchHelper synchHelper; + private WTPDataModelSynchHelper serverTargetSynchHelper; /** * */ - public ServerEarAndStandaloneGroup(Composite parent, J2EEArtifactCreationDataModel model) { + public ServerEarAndStandaloneGroup(Composite parent, J2EEModuleCreationDataModel model) { this.model = model; synchHelper = new WTPDataModelSynchHelper(model); + serverTargetSynchHelper = new WTPDataModelSynchHelper(model.getServerTargetDataModel()); buildComposites(parent); } @@ -142,8 +144,7 @@ * */ protected void handleNewEarSelected() { - - J2EEModuleCreationDataModel moduleModel = getJ2EEModuleCreationDataModel(); + J2EEModuleCreationDataModel moduleModel = model; EnterpriseApplicationCreationDataModel earModel = new EnterpriseApplicationCreationDataModel(); earModel.setIntProperty(EnterpriseApplicationCreationDataModel.APPLICATION_VERSION, moduleModel.getJ2EEVersion()); earModel.setProperty(EditModelOperationDataModel.PROJECT_NAME, moduleModel.getProperty(J2EEModuleCreationDataModel.EAR_PROJECT_NAME)); @@ -162,10 +163,6 @@ return serverTargetCombo.getShell(); } - protected J2EEModuleCreationDataModel getJ2EEModuleCreationDataModel() { - return (J2EEModuleCreationDataModel) model; - } - protected void createServerTargetComposite(Composite parent) { Label label = new Label(parent, SWT.NONE); label.setText(J2EEUIMessages.getResourceString(J2EEUIMessages.TARGET_SERVER_LBL)); @@ -176,14 +173,16 @@ newServerTargetButton.setText(J2EEUIMessages.getResourceString(J2EEUIMessages.NEW_THREE_DOTS_E)); newServerTargetButton.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { - J2EEProjectCreationPage.launchNewRuntimeWizard(getShell(), getJ2EEModuleCreationDataModel().getServerTargetDataModel()); + J2EEProjectCreationPage.launchNewRuntimeWizard(getShell(), model.getServerTargetDataModel()); } }); Control[] deps = new Control[]{label, newServerTargetButton}; - synchHelper.synchCombo(serverTargetCombo, ServerTargetDataModel.RUNTIME_TARGET_ID, deps); + serverTargetSynchHelper.synchCombo(serverTargetCombo, ServerTargetDataModel.RUNTIME_TARGET_ID, deps); } public void dispose() { + serverTargetSynchHelper.dispose(); + serverTargetSynchHelper = null; model.removeListener(synchHelper); model.dispose(); synchHelper = null;
diff --git a/plugins/org.eclipse.jst.j2ee.ui/plugin.xml b/plugins/org.eclipse.jst.j2ee.ui/plugin.xml index dba70b9..c8aafa5 100644 --- a/plugins/org.eclipse.jst.j2ee.ui/plugin.xml +++ b/plugins/org.eclipse.jst.j2ee.ui/plugin.xml
@@ -46,6 +46,7 @@ <import plugin="org.eclipse.jst.common.annotations.controller"/> <import plugin="org.eclipse.jst.common.navigator.java"/> <import plugin="org.eclipse.wst.web"/> + <import plugin="org.eclipse.wst.common.navigator.workbench"/> </requires> @@ -247,7 +248,7 @@ <!-- Navigator Object Contributions --> <extension - point="org.eclipse.wst.common.frameworks.internals.ui.wtpuiAction"> + point="org.eclipse.wst.common.frameworks.ui.wtpuiAction"> <masterOperation description="Delete the dependent J2EE modules" extendedGenericId="org.eclipse.wst.common.generic.Delete" @@ -524,7 +525,7 @@ </filter> </page> <page - objectClass="org.eclipse.core.resources.IJavaProject" + objectClass="org.eclipse.jdt.core.IJavaProject" adaptable="true" name="%j2ee" class="org.eclipse.jst.j2ee.internal.J2EEPropertiesPage" @@ -547,7 +548,7 @@ </filter> </page> <page - objectClass="org.eclipse.core.resources.IJavaProject" + objectClass="org.eclipse.jdt.core.IJavaProject" adaptable="true" name="%j2ee" class="org.eclipse.jst.j2ee.internal.J2EEPropertiesPage" @@ -570,7 +571,7 @@ </filter> </page> <page - objectClass="org.eclipse.core.resources.IJavaProject" + objectClass="org.eclipse.jdt.core.IJavaProject" adaptable="true" name="%j2ee" class="org.eclipse.jst.j2ee.internal.J2EEPropertiesPage" @@ -593,7 +594,7 @@ </filter> </page> <page - objectClass="org.eclipse.core.resources.IJavaProject" + objectClass="org.eclipse.jdt.core.IJavaProject" adaptable="true" name="%j2ee" class="org.eclipse.jst.j2ee.internal.J2EEPropertiesPage" @@ -605,7 +606,7 @@ </page> <!-- =========== org.eclipse.jst.j2ee.internal.ejb.EJBNature ============ --> <page - objectClass="org.eclipsbe.core.resources.IProject" + objectClass="org.eclipse.core.resources.IProject" adaptable="true" name="%j2ee" class="org.eclipse.jst.j2ee.internal.J2EEPropertiesPage" @@ -616,7 +617,7 @@ </filter> </page> <page - objectClass="org.eclipse.core.resources.IJavaProject" + objectClass="org.eclipse.jdt.core.IJavaProject" adaptable="true" name="%j2ee" class="org.eclipse.jst.j2ee.internal.J2EEPropertiesPage"
diff --git a/plugins/org.eclipse.jst.j2ee.ui/property_files/j2ee_ui.properties b/plugins/org.eclipse.jst.j2ee.ui/property_files/j2ee_ui.properties index 05e5bb0..c2e71e5 100644 --- a/plugins/org.eclipse.jst.j2ee.ui/property_files/j2ee_ui.properties +++ b/plugins/org.eclipse.jst.j2ee.ui/property_files/j2ee_ui.properties
@@ -249,7 +249,7 @@ WEB_24=2.4 WEB_22_DESCRIPTION=Web 2.2 includes Servlet specification 2.2 and JSP specification 1.1. WEB_23_DESCRIPTION=Web 2.3 includes Servlet specification 2.3 and JSP specification 1.2. -WEB_24_DESCRIPTION=Web 2.4 includes Servlet specification 2.4 and JSP specification 1.3. +WEB_24_DESCRIPTION=Web 2.4 includes Servlet specification 2.4 and JSP specification 2.0. APP_CLIENT_LEVEL=Application Client Level: APP_CLIENT_12_DESCRIPTION=Application 1.2 includes the Applciation client specification level 1.2. APP_CLIENT_13_DESCRIPTION=Application 1.3 includes the Applciation client specification level 1.3.
diff --git a/plugins/org.eclipse.jst.j2ee.web/plugin.xml b/plugins/org.eclipse.jst.j2ee.web/plugin.xml index 2021b2c..4212fdb 100644 --- a/plugins/org.eclipse.jst.j2ee.web/plugin.xml +++ b/plugins/org.eclipse.jst.j2ee.web/plugin.xml
@@ -142,7 +142,7 @@ </adapterFactory> </extension> <extension - point="org.eclipse.wst.common.frameworks.internals.ExtendableOperation"> + point="org.eclipse.wst.common.frameworks.ExtendableOperation"> <extendableOperation class="org.eclipse.jst.j2ee.internal.web.archive.operations.WebProjectCreationOperation" id="org.eclipse.jst.j2ee.internal.web.archive.operations.WebProjectCreationOperation"> @@ -159,7 +159,7 @@ point="org.eclipse.core.resources.builders"> <builder> <run - class="com.ibm.iwt.webtools.LibDirBuilder"> + class="org.eclipse.jst.j2ee.internal.web.operations.LibDirBuilder"> </run> </builder> </extension> @@ -168,31 +168,31 @@ <!-- Purpose: Define adapters for EJB and Web resources --> <!-- ==================================================================== --> <extension - point="com.ibm.wtp.server.core.moduleObjectAdapters"> + point="org.eclipse.wst.server.core.moduleArtifactAdapters"> <moduleObjectAdapter class="org.eclipse.jst.j2ee.internal.web.deployables.WebDeployableObjectAdapter" objectClass="org.eclipse.jst.j2ee.internal.webapplication.WebApp" - id="com.ibm.wtp.web.server.webresource"> + id="org.eclipse.jst.web.server.webresource"> </moduleObjectAdapter> <moduleObjectAdapter objectClass="org.eclipse.jst.j2ee.internal.webapplication.Servlet" class="org.eclipse.jst.j2ee.internal.web.deployables.WebDeployableObjectAdapter" - id="com.ibm.wtp.web.server.webresource2"> + id="org.eclipse.jst.web.server.webresource2"> </moduleObjectAdapter> <moduleObjectAdapter objectClass="org.eclipse.core.resources.IProject" class="org.eclipse.jst.j2ee.internal.web.deployables.WebDeployableObjectAdapter" - id="com.ibm.wtp.web.server.webresource3"> + id="org.eclipse.jst.web.server.webresource3"> </moduleObjectAdapter> <moduleObjectAdapter objectClass="org.eclipse.core.resources.IFile" class="org.eclipse.jst.j2ee.internal.web.deployables.WebDeployableObjectAdapter" - id="com.ibm.wtp.web.server.webresource4"> + id="corg.eclipse.jst.web.server.webresource4"> </moduleObjectAdapter> <moduleObjectAdapter objectClass="org.eclipse.jdt.core.ICompilationUnit" class="org.eclipse.jst.j2ee.internal.web.deployables.WebDeployableObjectAdapter" - id="com.ibm.wtp.web.server.webresource5"> + id="org.eclipse.jst.web.server.webresource5"> </moduleObjectAdapter> </extension> <!-- =============================================================== --> @@ -212,7 +212,7 @@ </moduleFactory> </extension> <extension - point="org.eclipse.jst.common.migration.migrator"> + point="org.eclipse.wst.common.migration.migrator"> <migrator className="org.eclipse.jst.j2ee.internal.web.operations.WebSettingsMigrator" id="org.eclipse.jst.common.migration.WebSettingsMigrator.id" @@ -227,7 +227,7 @@ <!-- WTP Operation extendable operations --> <!-- =============================================================== --> <extension - point="org.eclipse.wst.common.frameworks.internal.ExtendableOperation"> + point="org.eclipse.wst.common.frameworks.ExtendableOperation"> <extendableOperation class="org.eclipse.jst.j2ee.internal.web.operations.RemoveServletOperation" id="org.eclipse.jst.j2ee.internal.web.operations.RemoveServletOperation"> @@ -246,7 +246,7 @@ <!-- TagLib Server Target Listener Ext --> <!-- =============================================================== --> - <extension point="com.ibm.wtp.server.core.runtimeTargetHandlers"> + <extension point="org.eclipse.wst.server.core.runtimeTargetHandlers"> <runtimeTargetHandler id="com.ibm.wtp.webtools.taglib.runtimeTarget" runtimeTypeIds="com.ibm.ws.ast.st.runtime.v60, com.ibm.etools.websphere*" @@ -254,7 +254,7 @@ </extension> - <extension point="org.eclipse.wst.common.navigator.java.compressedProject"> + <extension point="org.eclipse.jst.common.navigator.java.compressedProject"> <compressedProject natureId="org.eclipse.jst.j2ee.web.WebNature" /> <compressedProject natureId="org.eclipse.wst.web.StaticWebNature" />
diff --git a/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/deployables/J2EEWebDeployable.java b/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/deployables/J2EEWebDeployable.java index 61c7703..3cc9b46 100644 --- a/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/deployables/J2EEWebDeployable.java +++ b/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/deployables/J2EEWebDeployable.java
@@ -43,307 +43,310 @@ * @author */ public class J2EEWebDeployable extends J2EEDeployable implements IWebModule, ILooseArchiveSupport { - protected String contextRoot; + protected String contextRoot; - protected ILooseArchive[] archives; - protected Map uris = new HashMap(); + protected ILooseArchive[] archives; - /** - * @param aNature - * @param aFactoryId - */ - public J2EEWebDeployable(J2EENature aNature, String aFactoryId) { - super(aNature, aFactoryId); - this.contextRoot = getUncachedContextRoot(); - } + protected Map uris = new HashMap(); - public String getContextRoot() { - return this.contextRoot; - } + /** + * @param aNature + * @param aFactoryId + */ + public J2EEWebDeployable(J2EENature aNature, String aFactoryId) { + super(aNature, aFactoryId); + this.contextRoot = getUncachedContextRoot(); + } - private J2EEWebNatureRuntime getWebNature() { - return (J2EEWebNatureRuntime) getNature(); - } + public String getContextRoot() { + return this.contextRoot; + } - public String getUncachedContextRoot() { - return getWebNature().getContextRoot(); - } + private J2EEWebNatureRuntime getWebNature() { + return (J2EEWebNatureRuntime) getNature(); + } - public String getJ2EESpecificationVersion() { - IBaseWebNature baseWebNature = getWebNature(); - if (baseWebNature.isJ2EE()) { - return ((J2EEWebNatureRuntime) baseWebNature).getJ2EEVersionText(); - } - return "1.3"; //$NON-NLS-1$ - } + public String getUncachedContextRoot() { + return getWebNature().getContextRoot(); + } - public String getJSPFileMapping(String jspFile) { - return null; - } + public String getJ2EESpecificationVersion() { + IBaseWebNature baseWebNature = getWebNature(); + if (baseWebNature.isJ2EE()) { + return ((J2EEWebNatureRuntime) baseWebNature).getJ2EEVersionText(); + } + return "1.3"; //$NON-NLS-1$ + } - public String getJSPSpecificationVersion() { - IBaseWebNature baseWebNature = getWebNature(); - if (baseWebNature.isJ2EE()) { - return ((J2EEWebNatureRuntime) baseWebNature).getJSPLevel(); - } - return "1.2"; //$NON-NLS-1$ - } + public String getJSPFileMapping(String jspFile) { + return null; + } - public String getServletMapping(String className) { - return null; - } + public String getJSPSpecificationVersion() { + IBaseWebNature baseWebNature = getWebNature(); + if (baseWebNature.isJ2EE()) { + return ((J2EEWebNatureRuntime) baseWebNature).getJSPLevel(); + } + return "1.2"; //$NON-NLS-1$ + } - public String getServletSpecificationVersion() { - IBaseWebNature baseWebNature = getWebNature(); - if (baseWebNature.isJ2EE()) { - return ((J2EEWebNatureRuntime) baseWebNature).isServlet2_3() ? "2.3" : "2.2"; //$NON-NLS-1$ //$NON-NLS-2$ - } - return "2.3"; //$NON-NLS-1$ - } + public String getServletMapping(String className) { + return null; + } - public boolean isPublishRequired() { - return false; - } + public String getServletSpecificationVersion() { + IBaseWebNature baseWebNature = getWebNature(); + if (baseWebNature.isJ2EE()) { + return ((J2EEWebNatureRuntime) baseWebNature).isServlet2_3() ? "2.3" : "2.2"; //$NON-NLS-1$ //$NON-NLS-2$ + } + return "2.3"; //$NON-NLS-1$ + } - protected LooseArchiveDeployableFactory getLooseArchiveDeployableFactory() { - /* Iterator factories = Arrays.asList(ServerCore.getModuleFactories()).iterator(); - while (factories.hasNext()) { - ModuleFactory deployableFactory = (ModuleFactory) factories.next(); - ModuleFactoryDelegate deployableFactoryDelegate = deployableFactory.getDelegate(); - if (deployableFactoryDelegate instanceof LooseArchiveDeployableFactory) - return (LooseArchiveDeployableFactory) deployableFactoryDelegate; - }*/ - return null; - } + public boolean isPublishRequired() { + return false; + } - protected ILooseArchive getArchiveDeployable(IProject aProject, LooseArchiveDeployableFactory fact) { - return (ILooseArchive) fact.getModuleProject(aProject); - } + protected LooseArchiveDeployableFactory getLooseArchiveDeployableFactory() { + /* + * Iterator factories = + * Arrays.asList(ServerCore.getModuleFactories()).iterator(); while + * (factories.hasNext()) { ModuleFactory deployableFactory = + * (ModuleFactory) factories.next(); ModuleFactoryDelegate + * deployableFactoryDelegate = deployableFactory.getDelegate(); if + * (deployableFactoryDelegate instanceof LooseArchiveDeployableFactory) + * return (LooseArchiveDeployableFactory) deployableFactoryDelegate; } + */ + return null; + } - protected ILibModule[] getLibModules() { - J2EEWebNatureRuntime j2eeNature = J2EEWebNatureRuntimeUtilities.getJ2EERuntime(this.project); - if (j2eeNature == null) - return null; + protected ILooseArchive getArchiveDeployable(IProject aProject, LooseArchiveDeployableFactory fact) { + return (ILooseArchive) fact.getModuleProject(aProject); + } - ILibModule[] libModules = j2eeNature.getLibModules(); + protected ILibModule[] getLibModules() { + J2EEWebNatureRuntime j2eeNature = J2EEWebNatureRuntimeUtilities.getJ2EERuntime(this.project); + if (j2eeNature == null) + return null; - if (libModules == null || libModules.length == 0) - return null; - return libModules; - } + ILibModule[] libModules = j2eeNature.getLibModules(); + if (libModules == null || libModules.length == 0) + return null; + return libModules; + } - public ILooseArchive[] getLooseArchives() { - return this.archives; - } + public ILooseArchive[] getLooseArchives() { + return this.archives; + } - /* - * @see com.ibm.etools.server.core.util.DeployableProject#getRootFolder() - */ - public IPath getRootFolder() { - J2EEWebNatureRuntime webNature = getWebNature(); - if (webNature != null) - return getWebNature().getRootPublishableFolder().getProjectRelativePath(); - return null; - } + /* + * @see com.ibm.etools.server.core.util.DeployableProject#getRootFolder() + */ + public IPath getRootFolder() { + J2EEWebNatureRuntime webNature = getWebNature(); + if (webNature != null) + return getWebNature().getRootPublishableFolder().getProjectRelativePath(); + return null; + } - public ILooseArchive[] getUncachedLooseArchives() { - ILibModule[] libModules = getLibModules(); - if (libModules == null) - return null; + public ILooseArchive[] getUncachedLooseArchives() { + ILibModule[] libModules = getLibModules(); + if (libModules == null) + return null; - LooseArchiveDeployableFactory fact = getLooseArchiveDeployableFactory(); - if (fact == null) - return null; + LooseArchiveDeployableFactory fact = getLooseArchiveDeployableFactory(); + if (fact == null) + return null; - List arcs = new ArrayList(libModules.length); - for (int i = 0; i < libModules.length; i++) { - ILibModule libModule = libModules[i]; - IProject proj = libModule.getProject(); - if (proj != null && proj.exists()) - arcs.add(getArchiveDeployable(proj, fact)); - } - ILooseArchive[] result = new ILooseArchive[arcs.size()]; - arcs.toArray(result); - return result; - } + List arcs = new ArrayList(libModules.length); + for (int i = 0; i < libModules.length; i++) { + ILibModule libModule = libModules[i]; + IProject proj = libModule.getProject(); + if (proj != null && proj.exists()) + arcs.add(getArchiveDeployable(proj, fact)); + } + ILooseArchive[] result = new ILooseArchive[arcs.size()]; + arcs.toArray(result); + return result; + } + public String getURI(ILooseArchive jar) { + try { + return (String) this.uris.get(jar); + } catch (Exception e) { + } + return null; + } - public String getURI(ILooseArchive jar) { - try { - return (String) this.uris.get(jar); - } catch (Exception e) { - } - return null; - } + public String getUncachedURI(ILooseArchive jar) { + if (!(jar instanceof LooseArchiveDeployable)) + return null; - public String getUncachedURI(ILooseArchive jar) { - if (!(jar instanceof LooseArchiveDeployable)) - return null; + LooseArchiveDeployable dep = (LooseArchiveDeployable) jar; + IProject proj = dep.getProject(); + return getURI(proj); + } - LooseArchiveDeployable dep = (LooseArchiveDeployable) jar; - IProject proj = dep.getProject(); - return getURI(proj); - } + protected String getURI(IProject looseJARProject) { + J2EEWebNatureRuntime j2eeNature = J2EEWebNatureRuntimeUtilities.getJ2EERuntime(this.project); + if (j2eeNature == null) + return null; - protected String getURI(IProject looseJARProject) { - J2EEWebNatureRuntime j2eeNature = J2EEWebNatureRuntimeUtilities.getJ2EERuntime(this.project); - if (j2eeNature == null) - return null; + ILibModule[] libModules = getLibModules(); + if (libModules == null) + return null; - ILibModule[] libModules = getLibModules(); - if (libModules == null) - return null; + for (int i = 0; i < libModules.length; i++) { + ILibModule iLibModule = libModules[i]; + if (iLibModule.getProject().equals(looseJARProject)) + return iLibModule.getURI(); + } - for (int i = 0; i < libModules.length; i++) { - ILibModule iLibModule = libModules[i]; - if (iLibModule.getProject().equals(looseJARProject)) - return iLibModule.getURI(); - } + return null; + } - return null; - } + public boolean isBinary() { + return false; + } - public boolean isBinary() { - return false; - } + protected void update() { + ILooseArchive[] oldArchives = this.archives; + this.archives = getUncachedLooseArchives(); + if (this.archives == null) + this.archives = new ILooseArchive[0]; + String oldContextRoot = this.contextRoot; + this.contextRoot = getUncachedContextRoot(); - protected void update() { - ILooseArchive[] oldArchives = this.archives; - this.archives = getUncachedLooseArchives(); - if (this.archives == null) - this.archives = new ILooseArchive[0]; - String oldContextRoot = this.contextRoot; - this.contextRoot = getUncachedContextRoot(); + boolean changed = false; + if (oldContextRoot == null && this.contextRoot != null) + changed = true; + else if (oldContextRoot != null && !oldContextRoot.equals(this.contextRoot)) + changed = true; - boolean changed = false; - if (oldContextRoot == null && this.contextRoot != null) - changed = true; - else if (oldContextRoot != null && !oldContextRoot.equals(this.contextRoot)) - changed = true; + // fire remove events + List add = new ArrayList(2); + addRemovedObjects(add, oldArchives, this.archives); - // fire remove events - List add = new ArrayList(2); - addRemovedObjects(add, oldArchives, this.archives); + // fire add events + List remove = new ArrayList(2); + addAddedObjects(remove, oldArchives, this.archives); - // fire add events - List remove = new ArrayList(2); - addAddedObjects(remove, oldArchives, this.archives); + // fire change events + int size = this.archives.length; + List change = new ArrayList(size); + for (int i = 0; i < size; i++) { + String newURI = getUncachedURI(this.archives[i]); + String oldURI = getURI(this.archives[i]); - // fire change events - int size = this.archives.length; - List change = new ArrayList(size); - for (int i = 0; i < size; i++) { - String newURI = getUncachedURI(this.archives[i]); - String oldURI = getURI(this.archives[i]); + if (oldURI != null && !oldURI.equals(newURI)) { + change.add(this.archives[i]); + } + this.uris.put(this.archives[i], newURI); + } - if (oldURI != null && !oldURI.equals(newURI)) { - change.add(this.archives[i]); - } - this.uris.put(this.archives[i], newURI); - } + if (!add.isEmpty() || !remove.isEmpty() || !change.isEmpty() || changed) { + IModule[] added = new IModule[add.size()]; + add.toArray(added); + IModule[] changed2 = new IModule[change.size()]; + change.toArray(changed2); + IModule[] removed = new IModule[remove.size()]; + remove.toArray(removed); + fireModuleChangeEvent(changed, added, changed2, removed); + } + } - if (!add.isEmpty() || !remove.isEmpty() || !change.isEmpty() || changed) { - IModule[] added = new IModule[add.size()]; - add.toArray(added); - IModule[] changed2 = new IModule[change.size()]; - change.toArray(changed2); - IModule[] removed = new IModule[remove.size()]; - remove.toArray(removed); - fireModuleChangeEvent(changed, added, changed2, removed); - } - } + /** + * Return the objects that have been added between array a and array b. + * Assumes that there are no null objects in the array. + */ + protected static void addAddedObjects(List list, Object[] a, Object[] b) { + if (b == null) + return; + else if (a == null) { + int size = b.length; + for (int i = 0; i < size; i++) + list.add(b[i]); + return; + } + int size = b.length; + for (int i = 0; i < size; i++) { + Object obj = b[i]; + boolean found = false; + if (a != null) { + int size2 = a.length; + for (int j = 0; !found && j < size2; j++) { + if (obj != null && obj.equals(a[j])) + found = true; + } + } + if (!found) + list.add(obj); + } + } - /** - * Return the objects that have been added between array a and array b. Assumes that there are - * no null objects in the array. - */ - protected static void addAddedObjects(List list, Object[] a, Object[] b) { - if (b == null) - return; - else if (a == null) { - int size = b.length; - for (int i = 0; i < size; i++) - list.add(b[i]); - return; - } - int size = b.length; - for (int i = 0; i < size; i++) { - Object obj = b[i]; - boolean found = false; - if (a != null) { - int size2 = a.length; - for (int j = 0; !found && j < size2; j++) { - if (obj != null && obj.equals(a[j])) - found = true; - } - } - if (!found) - list.add(obj); - } - } + /** + * Return the objects that have been removed between array a and array b. + * Assumes that there are no null objects in the array. + */ + protected static void addRemovedObjects(List list, Object[] a, Object[] b) { + if (a == null) + return; + else if (b == null) { + int size = a.length; + for (int i = 0; i < size; i++) + list.add(a[i]); + return; + } + int size = a.length; + for (int i = 0; i < size; i++) { + Object obj = a[i]; + boolean found = false; + if (b != null) { + int size2 = b.length; + for (int j = 0; !found && j < size2; j++) { + if (obj != null && obj.equals(b[j])) + found = true; + } + } + if (!found) + list.add(obj); + } + } - /** - * Return the objects that have been removed between array a and array b. Assumes that there are - * no null objects in the array. - */ - protected static void addRemovedObjects(List list, Object[] a, Object[] b) { - if (a == null) - return; - else if (b == null) { - int size = a.length; - for (int i = 0; i < size; i++) - list.add(a[i]); - return; - } - int size = a.length; - for (int i = 0; i < size; i++) { - Object obj = a[i]; - boolean found = false; - if (b != null) { - int size2 = b.length; - for (int j = 0; !found && j < size2; j++) { - if (obj != null && obj.equals(b[j])) - found = true; - } - } - if (!found) - list.add(obj); - } - } + public String getType() { + return "j2ee.web"; //$NON-NLS-1$ + } - public String getType() { - return "j2ee.web"; //$NON-NLS-1$ - } + public String getVersion() { + IBaseWebNature baseWebNature = getWebNature(); + if (baseWebNature.isJ2EE()) { + return ((J2EEWebNatureRuntime) baseWebNature).getJ2EEVersionText(); + } + return "1.2"; //$NON-NLS-1$ + } - public String getVersion() { - IBaseWebNature baseWebNature = getWebNature(); - if (baseWebNature.isJ2EE()) { - return ((J2EEWebNatureRuntime) baseWebNature).getJ2EEVersionText(); - } - return "1.2"; //$NON-NLS-1$ - } + /** + * Returns the child modules of this module. + * + * @return com.ibm.wtp.server.core.model.IModule[] + */ + public IModule[] getChildModules() { + List list = new ArrayList(); - /** - * Returns the child modules of this module. - * - * @return com.ibm.wtp.server.core.model.IModule[] - */ - public IModule[] getChildModules() { - List list = new ArrayList(); + if (this.archives != null) { + int size = this.archives.length; + for (int i = 0; i < size; i++) + list.add(this.archives[i]); + } - if (this.archives != null) { - int size = this.archives.length; - for (int i = 0; i < size; i++) - list.add(this.archives[i]); - } + IModule[] children = new IModule[list.size()]; + list.toArray(children); + return children; + } - IModule[] children = new IModule[list.size()]; - list.toArray(children); - return children; - } - - /* (non-Javadoc) + /* + * (non-Javadoc) + * * @see org.eclipse.wst.server.core.IModule#validate(org.eclipse.core.runtime.IProgressMonitor) */ public IStatus validate(IProgressMonitor monitor) { @@ -351,7 +354,9 @@ return null; } - /* (non-Javadoc) + /* + * (non-Javadoc) + * * @see org.eclipse.wst.server.core.IModule#getModuleType() */ public IModuleType getModuleType() { @@ -359,7 +364,9 @@ return null; } - /* (non-Javadoc) + /* + * (non-Javadoc) + * * @see org.eclipse.wst.server.core.IModule#getChildModules(org.eclipse.core.runtime.IProgressMonitor) */ public IModule[] getChildModules(IProgressMonitor monitor) { @@ -367,11 +374,14 @@ return null; } - /* (non-Javadoc) + /* + * (non-Javadoc) + * * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) */ public Object getAdapter(Class adapter) { - // TODO Auto-generated method stub - return null; + if (getModule() == null) + initialize(this); + return this; } } \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/deployables/WebDeployableFactory.java b/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/deployables/WebDeployableFactory.java index 623dded..2f7dbcf 100644 --- a/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/deployables/WebDeployableFactory.java +++ b/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/deployables/WebDeployableFactory.java
@@ -8,7 +8,10 @@ **************************************************************************************************/ package org.eclipse.jst.j2ee.internal.web.deployables; +import java.util.Iterator; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IResourceDelta; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.Path; import org.eclipse.jst.j2ee.internal.deployables.J2EEDeployableFactory; @@ -17,51 +20,52 @@ import org.eclipse.wst.server.core.IModule; import org.eclipse.wst.server.core.model.ModuleDelegate; +import sun.security.action.GetPropertyAction; + public class WebDeployableFactory extends J2EEDeployableFactory { - private static final String ID = "com.ibm.wtp.web.server"; //$NON-NLS-1$ + private static final String ID = "com.ibm.wtp.web.server"; //$NON-NLS-1$ - protected static final IPath[] PATHS = new IPath[]{new Path(".j2ee") //$NON-NLS-1$ - }; + protected static final IPath[] PATHS = new IPath[] { new Path(".j2ee") //$NON-NLS-1$ + }; - /* - * @see DeployableProjectFactoryDelegate#getFactoryID() - */ - public String getFactoryId() { - return ID; - } + /* + * @see DeployableProjectFactoryDelegate#getFactoryID() + */ + public String getFactoryId() { + return ID; + } + /* + * (non-Javadoc) + * + * @see org.eclise.wtp.j2ee.servers.J2EEDeployableFactory#getNatureID() + */ + public String getNatureID() { + return IWebNatureConstants.J2EE_NATURE_ID; + } - /* - * (non-Javadoc) - * - * @see org.eclise.wtp.j2ee.servers.J2EEDeployableFactory#getNatureID() - */ - public String getNatureID() { - return IWebNatureConstants.J2EE_NATURE_ID; - } + /* + * (non-Javadoc) + * + * @see org.eclise.wtp.j2ee.servers.J2EEDeployableFactory#createDeployable(org.eclipse.jst.j2ee.internal.internal.j2eeproject.J2EENature) + */ + public IModule createModule(J2EENature nature) { + IModule deployable = (IModule) nature.getModule(); + if (deployable == null) + deployable = new J2EEWebDeployable(nature, ID); + return deployable; + } + /* + * @see DeployableProjectFactoryDelegate#getListenerPaths() + */ + protected IPath[] getListenerPaths() { + return PATHS; + } - /* - * (non-Javadoc) - * - * @see org.eclise.wtp.j2ee.servers.J2EEDeployableFactory#createDeployable(org.eclipse.jst.j2ee.internal.internal.j2eeproject.J2EENature) - */ - public IModule createModule(J2EENature nature) { - IModule deployable = (IModule) nature.getModule(); - if (deployable == null) - deployable = new J2EEWebDeployable(nature, ID); - return deployable; - } - - /* - * @see DeployableProjectFactoryDelegate#getListenerPaths() - */ - protected IPath[] getListenerPaths() { - return PATHS; - } - - - /* (non-Javadoc) + /* + * (non-Javadoc) + * * @see org.eclipse.wst.server.core.model.ModuleFactoryDelegate#getModuleDelegate(org.eclipse.wst.server.core.IModule) */ public ModuleDelegate getModuleDelegate(IModule module) { @@ -69,12 +73,34 @@ return null; } - - /* (non-Javadoc) + /* + * (non-Javadoc) + * * @see org.eclipse.wst.server.core.model.ModuleFactoryDelegate#getModules() */ public IModule[] getModules() { + int i = 0; + Iterator modules = projects.values().iterator(); + IModule[] modulesArray = new IModule[projects.values().size()]; + while (modules.hasNext()) { + IModule element = (IModule) modules.next(); + modulesArray[i++]= element; + + } // TODO Auto-generated method stub - return null; + return modulesArray; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.wst.server.core.util.ProjectModuleFactoryDelegate#handleProjectChange(org.eclipse.core.resources.IProject, + * org.eclipse.core.resources.IResourceDelta) + */ + protected void handleProjectChange(IProject project, IResourceDelta delta) { + // TODO Auto-generated method stub + if (projects == null) + cacheModules(); + super.handleProjectChange(project, delta); } } \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/archive/operations/WebModuleCreationDataModel.java b/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/archive/operations/WebModuleCreationDataModel.java index 306e5e3..3913dbb 100644 --- a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/archive/operations/WebModuleCreationDataModel.java +++ b/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/archive/operations/WebModuleCreationDataModel.java
@@ -65,19 +65,21 @@ public static final String MIGRATE_WEB_SETTINGS = "WebModuleCreationDataModel.MIGRATE_WEB_SETTINGS"; //$NON-NLS-1$ /** - * Creates a Connector project with the specified name and version in the specified location. + * Creates a Web project with the specified name and version in the specified location. * * @param projectName - * The name of the Connector project to create. + * The name of the Web project to create. * @param projectLocation * Sets the local file system location for the described project. The path must be * either an absolute file system path, or a relative path whose first segment is the * name of a defined workspace path variable. If <code>null</code> is specified, * the default location is used. * @param connectorModuleVersion - * Sets the Connector Module Version for the descibed project. The version must be either - * <code>J2EEVersionConstants.JCA_1_0_ID</code> or - * <code>J2EEVersionConstants.JCA_1_5_ID</code>. + * Sets the Web Module Version for the descibed project. The version must be one of + * the following: <code>J2EEVersionConstants.WEB_2_2_ID</code>, + * <code>J2EEVersionConstants.WEB_2_3_ID</code>, or + * <code>J2EEVersionConstants.WEB_2_4_ID</code> + * or. * @since WTP 1.0 */ public static void createProject(String projectName, IPath projectLocation, int connectorModuleVersion) { @@ -95,7 +97,7 @@ Logger.getLogger().logError(e); } } - + public WTPOperation getDefaultOperation() { return new WebModuleCreationOperation(this); }
diff --git a/plugins/org.eclipse.jst.j2ee.webservice/plugin.xml b/plugins/org.eclipse.jst.j2ee.webservice/plugin.xml index 8335c5b..1b46e8f 100644 --- a/plugins/org.eclipse.jst.j2ee.webservice/plugin.xml +++ b/plugins/org.eclipse.jst.j2ee.webservice/plugin.xml
@@ -82,7 +82,7 @@ </adapterFactory> </extension> <extension - point="com.ibm.wtp.emf.workbench.editModelExtension"> + point="org.eclipse.wst.common.emfworkbench.integration.editModelExtension"> <editModelExtension editModelID="org.eclipse.jst.j2ee.applicationClient.editModel" id="com.ibm.wtp.webservices.appclient.editModelextension"> @@ -103,7 +103,7 @@ <extension - point="com.ibm.wtp.webservice.webserviceseditmodelcontainer"> + point="org.eclipse.jst.j2ee.webservice.webserviceseditmodelcontainer"> <webserviceseditmodelcontainer name="%WSDD_EDIT_MODEL_NAME" class="org.eclipse.jst.j2ee.internal.webservice.atk.ui.model.ws.WsddEditModel" @@ -112,7 +112,7 @@ </webserviceseditmodelcontainer> </extension> <extension - point="com.ibm.wtp.webservice.webservicesclienteditmodelcontainer"> + point="org.eclipse.jst.j2ee.webservice.webservicesclienteditmodelcontainer"> <webservicesclienteditmodelcontainer name="%WSCDD_EDIT_MODEL_NAME" class="org.eclipse.jst.j2ee.internal.webservice.atk.ui.model.wsc.WscddEditModel"
diff --git a/plugins/org.eclipse.jst.servlet.ui/plugin.xml b/plugins/org.eclipse.jst.servlet.ui/plugin.xml index df32574..7b23fa2 100644 --- a/plugins/org.eclipse.jst.servlet.ui/plugin.xml +++ b/plugins/org.eclipse.jst.servlet.ui/plugin.xml
@@ -29,6 +29,7 @@ <import plugin="com.ibm.wtp.emf.workbench"/> <import plugin="org.eclipse.ui.ide"/> <import plugin="org.eclipse.wst.web"/> + <import plugin="org.eclipse.wst.common.navigator.workbench"/> </requires> <!-- Web Project Wizard -->