geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcco...@apache.org
Subject svn commit: r666281 - in /geronimo/devtools/eclipse-plugin/trunk/plugins: org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/jaxb/ org.apache.geronimo.st.ui/ org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/...
Date Tue, 10 Jun 2008 19:08:36 GMT
Author: mcconne
Date: Tue Jun 10 12:08:35 2008
New Revision: 666281

URL: http://svn.apache.org/viewvc?rev=666281&view=rev
Log:
GERONIMODEVTOOLS-354 Fix to support editor for geroniom-app-client.xml file. Thanks to BJ Reed for this patch !!

Added:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/AppClientGeneralPage.java   (with props)
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/AppClientClientGeneralSection.java   (with props)
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/AppClientServerGeneralSection.java   (with props)
Modified:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/jaxb/JAXBUtils.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/plugin.xml
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.properties
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/GeronimoV21Utils.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/jaxb/JAXBModelUtils.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/editors/GeronimoFormContentLoader.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/NamingFormPage.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/CommonGeneralSection.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/GBeanRefSection.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/GBeanRefWizard.java

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/jaxb/JAXBUtils.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/jaxb/JAXBUtils.java?rev=666281&r1=666280&r2=666281&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/jaxb/JAXBUtils.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/jaxb/JAXBUtils.java Tue Jun 10 12:08:35 2008
@@ -178,6 +178,6 @@
 			// TODO Auto-generated catch block
 			e.printStackTrace();
 		}
-		System.out.println( "============== No such method get" + name + " in class " + element.getClass().getName() );
+		System.out.println( "============== No such method set" + name + " in class " + element.getClass().getName() );
 	}
 }

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/plugin.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/plugin.xml?rev=666281&r1=666280&r2=666281&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/plugin.xml (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/plugin.xml Tue Jun 10 12:08:35 2008
@@ -158,6 +158,7 @@
             filenames="geronimo-web.xml,
                        geronimo-application.xml,    
                        openejb-jar.xml,
+                       geronimo-application-client.xml,
                        geronimo-ra.xml"
             icon="icons/obj16/littleG.gif"
             id="org.apache.geronimo.ui.editors.WebEditor" 

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.java?rev=666281&r1=666280&r2=666281&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.java Tue Jun 10 12:08:35 2008
@@ -104,6 +104,7 @@
 	}
 	
 	public static String appGeneralPageTitle;
+    public static String appClientGeneralPageTitle;
 	public static String connectorOverViewPageTitle;
 	public static String deploymentPageTitle;
 	public static String namingFormPageTitle;
@@ -118,6 +119,10 @@
 	public static String editorSectionGeneralTitle;
 	public static String editorSectionGeneralDescription;
 	public static String editorContextRoot;
+    public static String editorSectionServerTitle;
+    public static String editorSectionServerDescription;
+    public static String editorSectionClientTitle;
+    public static String editorSectionClientDescription;
 	//
 	public static String editorSectionSecurityRolesTitle;
 	public static String editorSectionSecurityRolesDescription;

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.properties
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.properties?rev=666281&r1=666280&r2=666281&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.properties (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.properties Tue Jun 10 12:08:35 2008
@@ -17,6 +17,7 @@
 # $Rev$ $Date$
 #
 appGeneralPageTitle=Application Plan General Configuration
+appClientGeneralPageTitle=Application Plan General Configuration
 connectorOverViewPageTitle=Connector Plan General Configuration
 deploymentPageTitle=Deployment Configuration
 namingFormPageTitle=Defined References
@@ -29,6 +30,12 @@
 editorSectionGeneralTitle=General
 editorSectionGeneralDescription=Edit the common deployment settings.
 
+editorSectionServerTitle=Server
+editorSectionServerDescription=Edit the application server deployment settings.
+
+editorSectionClientTitle=Client
+editorSectionClientDescription=Edit the application client deployment settings.
+
 editorSectionSecurityRolesTitle=Security Roles
 editorSectionSecurityRolesDescription=The following security roles are defined:
 

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/GeronimoV21Utils.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/GeronimoV21Utils.java?rev=666281&r1=666280&r2=666281&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/GeronimoV21Utils.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/GeronimoV21Utils.java Tue Jun 10 12:08:35 2008
@@ -1,255 +1,257 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.geronimo.st.v21.core;
-
-import javax.xml.bind.JAXBElement;
-
-import org.apache.geronimo.jee.application.Application;
-import org.apache.geronimo.jee.applicationclient.ApplicationClient;
-import org.apache.geronimo.jee.connector.Connector;
-import org.apache.geronimo.jee.deployment.Artifact;
-import org.apache.geronimo.jee.deployment.Environment;
-import org.apache.geronimo.jee.openejb.OpenejbJar;
-import org.apache.geronimo.jee.web.WebApp;
-import org.apache.geronimo.st.core.GeronimoUtils;
-import org.apache.geronimo.st.core.internal.Trace;
-import org.apache.geronimo.st.core.jaxb.JAXBUtils;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.server.core.IModule;
-
-/**
- * @version $Rev: 533836 $ $Date: 2007-04-30 15:39:14 -0400 (Mon, 30 Apr 2007) $
- */
-public class GeronimoV21Utils extends GeronimoUtils {
-
-    public static JAXBElement getDeploymentPlan(IFile file) {
-        Trace.tracePoint("ENTRY", "GeronimoV21Utils.getDeploymentPlan", file);
-
-        if (!file.exists()) {
-            return null;
-        }
-
-        if (file.getName().equals(GeronimoUtils.APP_PLAN_NAME))
-            return getApplicationDeploymentPlan(file);
-        else if (file.getName().equals(GeronimoUtils.OPENEJB_PLAN_NAME))
-            return getOpenEjbDeploymentPlan(file);
-        else if (file.getName().equals(GeronimoUtils.WEB_PLAN_NAME))
-            return getWebDeploymentPlan(file);
-        else if (file.getName().equals(GeronimoUtils.CONNECTOR_PLAN_NAME))
-            return getConnectorDeploymentPlan(file);
-
-        Trace.tracePoint("EXIT", "GeronimoV21Utils.getDeploymentPlan", null);
-        return null;
-    }
-
-    //public static String getConfigId2(IModule module) {
-    //    Trace.tracePoint("ENTRY", "GeronimoV21Utils.getConfigId2", module);
-
-    //    IFile planFile = null;
-    //   IVirtualComponent comp = ComponentCore.createComponent(module.getProject());
-    //    if (isWebModule(module)) {
-    //        planFile = GeronimoUtils.getWebDeploymentPlanFile(comp);
-    //   }
-    //    else if (isEjbJarModule(module)) {
-    //        planFile = GeronimoUtils.getOpenEjbDeploymentPlanFile(comp);
-    //    }
-    //    else if (isEarModule(module)) {
-    //       planFile = GeronimoUtils.getApplicationDeploymentPlanFile(comp);
-    //    }
-    //    else if (isRARModule(module)) {
-    //        planFile = GeronimoUtils.getConnectorDeploymentPlanFile(comp);
-    //    }
-
-    //    if (planFile != null) {
-    //       try {
-    //            XmlObject xmlObject = XmlBeansUtil.parse(planFile.getLocation().toFile());
-    //            XmlCursor cursor = xmlObject.newCursor();
-    //            cursor.toFirstChild();
-    //            xmlObject = cursor.getObject();
-    //            XmlObject result[] = xmlObject.selectChildren(QNameSet.singleton(EnvironmentDocument.type.getDocumentElementName()));
-    //            if (result != null && result.length > 0) {
-    //                org.apache.geronimo.deployment.xbeans.EnvironmentType env = (org.apache.geronimo.deployment.xbeans.EnvironmentType) result[0].changeType(org.apache.geronimo.deployment.xbeans.EnvironmentType.type);
-    //                org.apache.geronimo.deployment.xbeans.ArtifactType moduleId = env.getModuleId();
-    //                Trace.tracePoint("EXIT", "GeronimoV21Utils.getConfigId2", getQualifiedConfigID(moduleId));
-    //                return getQualifiedConfigID(moduleId);
-    //            }
-    //            else {
-                    // 
-                    // FIXME -- Once GERONIMODEVTOOLS-263 is resolved
-                    // 
-    //                String id = getConfigId(module);
-    //                Trace.tracePoint("EXIT", "GeronimoV21Utils.getConfigId2", id);
-    //                return id;
-    //            }
-    //        }
-    //        catch (IOException e) {
-    //            e.printStackTrace();
-    //        }
-    //        catch (XmlException e) {
-    //            e.printStackTrace();
-    //        }
-    //    }
-
-    //    Trace.tracePoint("EXIT", "GeronimoV21Utils.getConfigId2", null);
-    //    return null;
-    //}
-
-    public static String getConfigId(IModule module) {
-        Trace.tracePoint("ENTRY", "GeronimoV21Utils.getConfigId", module);
-
-        Environment environment = null;
-        if (isWebModule(module)) {
-            WebApp plan = getWebDeploymentPlan(module).getValue();
-            if (plan != null)
-                environment = plan.getEnvironment();
-        }
-        else if (isEjbJarModule(module)) {
-            OpenejbJar plan = getOpenEjbDeploymentPlan(module).getValue();
-//            if (plan != null)
-//                environment = plan.getEnvironment();
-        }
-        else if (isEarModule(module)) {
-            Application plan = getApplicationDeploymentPlan(module).getValue();
-            if (plan != null)
-                environment = plan.getEnvironment();
-        }
-        else if (isRARModule(module)) {
-            Connector plan = getConnectorDeploymentPlan(module).getValue();
-            if (plan != null)
-                environment = plan.getEnvironment();
-        }
-
-        if (environment != null
-            && environment.getModuleId() != null) {
-            Trace.tracePoint("EXIT", "GeronimoV21Utils.getConfigId", getQualifiedConfigID(environment.getModuleId()));
-            return getQualifiedConfigID(environment.getModuleId());
-        }
-
-        Trace.tracePoint("EXIT", "GeronimoV21Utils.getConfigId", getId(module));
-        return getId(module);
-    }
-
-    public static String getQualifiedConfigID(Artifact artifact) {
-        return getQualifiedConfigID(artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), artifact.getType());
-    }
-
-    //public static String getQualifiedConfigID(org.apache.geronimo.deployment.xbeans.ArtifactType artifact) {
-    //    return getQualifiedConfigID(artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), artifact.getType());
-    //}
-
-    public static String getContextRoot(IModule module) {
-        String contextRoot = null;
-
-        WebApp deploymentPlan = getWebDeploymentPlan(module).getValue();
-        if (deploymentPlan != null)
-            contextRoot = deploymentPlan.getContextRoot();
-
-        if (contextRoot == null)
-            contextRoot = GeronimoUtils.getContextRoot(module);
-
-        return contextRoot;
-    }
-
-    public static JAXBElement<WebApp> getWebDeploymentPlan(IModule module) {
-        return getWebDeploymentPlan(getVirtualComponent(module));
-    }
-
-    public static JAXBElement<Application> getApplicationDeploymentPlan(IModule module) {
-        return getApplicationDeploymentPlan(getVirtualComponent(module));
-    }
-
-    public static JAXBElement<OpenejbJar> getOpenEjbDeploymentPlan(IModule module) {
-        return getOpenEjbDeploymentPlan(getVirtualComponent(module));
-    }
-
-    public static JAXBElement<Connector> getConnectorDeploymentPlan(IModule module) {
-        return getConnectorDeploymentPlan(getVirtualComponent(module));
-    }
-
-    public static JAXBElement getApplicationDeploymentPlan(IVirtualComponent comp) {
-        return getApplicationDeploymentPlan(getApplicationDeploymentPlanFile(comp));
-    }
-
-    public static JAXBElement getWebDeploymentPlan(IVirtualComponent comp) {
-        return getWebDeploymentPlan(getWebDeploymentPlanFile(comp));
-    }
-
-    public static JAXBElement getOpenEjbDeploymentPlan(IVirtualComponent comp) {
-        return getOpenEjbDeploymentPlan(getOpenEjbDeploymentPlanFile(comp));
-    }
-
-    public static JAXBElement getConnectorDeploymentPlan(IVirtualComponent comp) {
-        return getConnectorDeploymentPlan(getConnectorDeploymentPlanFile(comp));
-    }
-
-    public static JAXBElement getApplicationDeploymentPlan(IFile file) {
-        Trace.tracePoint("ENTRY", "GeronimoV21Utils.getApplicationDeploymentPlan", file);
-
-        if (file.getName().equals(APP_PLAN_NAME) && file.exists()) {
-        	return JAXBUtils.unmarshalDeploymentPlan(file);
-        }
-
-        Trace.tracePoint("EXIT", "GeronimoV21Utils.getApplicationDeploymentPlan", null);
-        return null;
-    }
-
-    public static JAXBElement getApplicationClientDeploymentPlan(IFile file) {
-        Trace.tracePoint("ENTRY", "GeronimoV21Utils.getApplicationClientDeploymentPlan", file);
-
-        if (file.getName().equals(APP_CLIENT_PLAN_NAME) && file.exists()) {
-        	return JAXBUtils.unmarshalDeploymentPlan(file);
-        }
-
-        Trace.tracePoint("EXIT", "GeronimoV21Utils.getApplicationClientDeploymentPlan", null);
-        return null;
-    }
-
-    public static JAXBElement getWebDeploymentPlan(IFile file) {
-        Trace.tracePoint("ENTRY", "GeronimoV21Utils.getWebDeploymentPlan", file);
-
-        if (file.getName().equals(WEB_PLAN_NAME) && file.exists()) {
-        	return JAXBUtils.unmarshalDeploymentPlan(file);
-        }
-
-        Trace.tracePoint("EXIT", "GeronimoV21Utils.getWebDeploymentPlan", null);
-        return null;
-    }
-
-    public static JAXBElement getOpenEjbDeploymentPlan(IFile file) {
-        Trace.tracePoint("ENTRY", "GeronimoV21Utils.getOpenEjbDeploymentPlan", file);
-
-        if (file.getName().equals(OPENEJB_PLAN_NAME) && file.exists()) {
-        	return JAXBUtils.unmarshalDeploymentPlan(file);
-        }
-
-        Trace.tracePoint("EXIT", "GeronimoV21Utils.getOpenEjbDeploymentPlan", null);
-        return null;
-    }
-
-    public static JAXBElement getConnectorDeploymentPlan(IFile file) {
-        Trace.tracePoint("ENTRY", "GeronimoV21Utils.getConnectorDeploymentPlan", file);
-
-        if (file.getName().equals(CONNECTOR_PLAN_NAME) && file.exists()) {
-        	return JAXBUtils.unmarshalDeploymentPlan(file);
-        }
-
-        Trace.tracePoint("EXIT", "GeronimoV21Utils.getConnectorDeploymentPlan", null);
-        return null;
-    }
-    
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.st.v21.core;
+
+import javax.xml.bind.JAXBElement;
+
+import org.apache.geronimo.jee.application.Application;
+import org.apache.geronimo.jee.applicationclient.ApplicationClient;
+import org.apache.geronimo.jee.connector.Connector;
+import org.apache.geronimo.jee.deployment.Artifact;
+import org.apache.geronimo.jee.deployment.Environment;
+import org.apache.geronimo.jee.openejb.OpenejbJar;
+import org.apache.geronimo.jee.web.WebApp;
+import org.apache.geronimo.st.core.GeronimoUtils;
+import org.apache.geronimo.st.core.internal.Trace;
+import org.apache.geronimo.st.core.jaxb.JAXBUtils;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.server.core.IModule;
+
+/**
+ * @version $Rev: 533836 $ $Date: 2007-04-30 15:39:14 -0400 (Mon, 30 Apr 2007) $
+ */
+public class GeronimoV21Utils extends GeronimoUtils {
+
+    public static JAXBElement getDeploymentPlan(IFile file) {
+        Trace.tracePoint("ENTRY", "GeronimoV21Utils.getDeploymentPlan", file);
+
+        if (!file.exists()) {
+            return null;
+        }
+
+        if (file.getName().equals(GeronimoUtils.APP_PLAN_NAME))
+            return getApplicationDeploymentPlan(file);
+        else if (file.getName().equals(GeronimoUtils.OPENEJB_PLAN_NAME))
+            return getOpenEjbDeploymentPlan(file);
+        else if (file.getName().equals(GeronimoUtils.WEB_PLAN_NAME))
+            return getWebDeploymentPlan(file);
+        else if (file.getName().equals(GeronimoUtils.CONNECTOR_PLAN_NAME))
+            return getConnectorDeploymentPlan(file);
+        else if (file.getName().equals(GeronimoUtils.APP_CLIENT_PLAN_NAME))
+            return getApplicationClientDeploymentPlan(file);
+
+        Trace.tracePoint("EXIT", "GeronimoV21Utils.getDeploymentPlan", null);
+        return null;
+    }
+
+    //public static String getConfigId2(IModule module) {
+    //    Trace.tracePoint("ENTRY", "GeronimoV21Utils.getConfigId2", module);
+
+    //    IFile planFile = null;
+    //   IVirtualComponent comp = ComponentCore.createComponent(module.getProject());
+    //    if (isWebModule(module)) {
+    //        planFile = GeronimoUtils.getWebDeploymentPlanFile(comp);
+    //   }
+    //    else if (isEjbJarModule(module)) {
+    //        planFile = GeronimoUtils.getOpenEjbDeploymentPlanFile(comp);
+    //    }
+    //    else if (isEarModule(module)) {
+    //       planFile = GeronimoUtils.getApplicationDeploymentPlanFile(comp);
+    //    }
+    //    else if (isRARModule(module)) {
+    //        planFile = GeronimoUtils.getConnectorDeploymentPlanFile(comp);
+    //    }
+
+    //    if (planFile != null) {
+    //       try {
+    //            XmlObject xmlObject = XmlBeansUtil.parse(planFile.getLocation().toFile());
+    //            XmlCursor cursor = xmlObject.newCursor();
+    //            cursor.toFirstChild();
+    //            xmlObject = cursor.getObject();
+    //            XmlObject result[] = xmlObject.selectChildren(QNameSet.singleton(EnvironmentDocument.type.getDocumentElementName()));
+    //            if (result != null && result.length > 0) {
+    //                org.apache.geronimo.deployment.xbeans.EnvironmentType env = (org.apache.geronimo.deployment.xbeans.EnvironmentType) result[0].changeType(org.apache.geronimo.deployment.xbeans.EnvironmentType.type);
+    //                org.apache.geronimo.deployment.xbeans.ArtifactType moduleId = env.getModuleId();
+    //                Trace.tracePoint("EXIT", "GeronimoV21Utils.getConfigId2", getQualifiedConfigID(moduleId));
+    //                return getQualifiedConfigID(moduleId);
+    //            }
+    //            else {
+                    // 
+                    // FIXME -- Once GERONIMODEVTOOLS-263 is resolved
+                    // 
+    //                String id = getConfigId(module);
+    //                Trace.tracePoint("EXIT", "GeronimoV21Utils.getConfigId2", id);
+    //                return id;
+    //            }
+    //        }
+    //        catch (IOException e) {
+    //            e.printStackTrace();
+    //        }
+    //        catch (XmlException e) {
+    //            e.printStackTrace();
+    //        }
+    //    }
+
+    //    Trace.tracePoint("EXIT", "GeronimoV21Utils.getConfigId2", null);
+    //    return null;
+    //}
+
+    public static String getConfigId(IModule module) {
+        Trace.tracePoint("ENTRY", "GeronimoV21Utils.getConfigId", module);
+
+        Environment environment = null;
+        if (isWebModule(module)) {
+            WebApp plan = getWebDeploymentPlan(module).getValue();
+            if (plan != null)
+                environment = plan.getEnvironment();
+        }
+        else if (isEjbJarModule(module)) {
+            OpenejbJar plan = getOpenEjbDeploymentPlan(module).getValue();
+//            if (plan != null)
+//                environment = plan.getEnvironment();
+        }
+        else if (isEarModule(module)) {
+            Application plan = getApplicationDeploymentPlan(module).getValue();
+            if (plan != null)
+                environment = plan.getEnvironment();
+        }
+        else if (isRARModule(module)) {
+            Connector plan = getConnectorDeploymentPlan(module).getValue();
+            if (plan != null)
+                environment = plan.getEnvironment();
+        }
+
+        if (environment != null
+            && environment.getModuleId() != null) {
+            Trace.tracePoint("EXIT", "GeronimoV21Utils.getConfigId", getQualifiedConfigID(environment.getModuleId()));
+            return getQualifiedConfigID(environment.getModuleId());
+        }
+
+        Trace.tracePoint("EXIT", "GeronimoV21Utils.getConfigId", getId(module));
+        return getId(module);
+    }
+
+    public static String getQualifiedConfigID(Artifact artifact) {
+        return getQualifiedConfigID(artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), artifact.getType());
+    }
+
+    //public static String getQualifiedConfigID(org.apache.geronimo.deployment.xbeans.ArtifactType artifact) {
+    //    return getQualifiedConfigID(artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), artifact.getType());
+    //}
+
+    public static String getContextRoot(IModule module) {
+        String contextRoot = null;
+
+        WebApp deploymentPlan = getWebDeploymentPlan(module).getValue();
+        if (deploymentPlan != null)
+            contextRoot = deploymentPlan.getContextRoot();
+
+        if (contextRoot == null)
+            contextRoot = GeronimoUtils.getContextRoot(module);
+
+        return contextRoot;
+    }
+
+    public static JAXBElement<WebApp> getWebDeploymentPlan(IModule module) {
+        return getWebDeploymentPlan(getVirtualComponent(module));
+    }
+
+    public static JAXBElement<Application> getApplicationDeploymentPlan(IModule module) {
+        return getApplicationDeploymentPlan(getVirtualComponent(module));
+    }
+
+    public static JAXBElement<OpenejbJar> getOpenEjbDeploymentPlan(IModule module) {
+        return getOpenEjbDeploymentPlan(getVirtualComponent(module));
+    }
+
+    public static JAXBElement<Connector> getConnectorDeploymentPlan(IModule module) {
+        return getConnectorDeploymentPlan(getVirtualComponent(module));
+    }
+
+    public static JAXBElement getApplicationDeploymentPlan(IVirtualComponent comp) {
+        return getApplicationDeploymentPlan(getApplicationDeploymentPlanFile(comp));
+    }
+
+    public static JAXBElement getWebDeploymentPlan(IVirtualComponent comp) {
+        return getWebDeploymentPlan(getWebDeploymentPlanFile(comp));
+    }
+
+    public static JAXBElement getOpenEjbDeploymentPlan(IVirtualComponent comp) {
+        return getOpenEjbDeploymentPlan(getOpenEjbDeploymentPlanFile(comp));
+    }
+
+    public static JAXBElement getConnectorDeploymentPlan(IVirtualComponent comp) {
+        return getConnectorDeploymentPlan(getConnectorDeploymentPlanFile(comp));
+    }
+
+    public static JAXBElement getApplicationDeploymentPlan(IFile file) {
+        Trace.tracePoint("ENTRY", "GeronimoV21Utils.getApplicationDeploymentPlan", file);
+
+        if (file.getName().equals(APP_PLAN_NAME) && file.exists()) {
+        	return JAXBUtils.unmarshalDeploymentPlan(file);
+        }
+
+        Trace.tracePoint("EXIT", "GeronimoV21Utils.getApplicationDeploymentPlan", null);
+        return null;
+    }
+
+    public static JAXBElement getApplicationClientDeploymentPlan(IFile file) {
+        Trace.tracePoint("ENTRY", "GeronimoV21Utils.getApplicationClientDeploymentPlan", file);
+
+        if (file.getName().equals(APP_CLIENT_PLAN_NAME) && file.exists()) {
+        	return JAXBUtils.unmarshalDeploymentPlan(file);
+        }
+
+        Trace.tracePoint("EXIT", "GeronimoV21Utils.getApplicationClientDeploymentPlan", null);
+        return null;
+    }
+
+    public static JAXBElement getWebDeploymentPlan(IFile file) {
+        Trace.tracePoint("ENTRY", "GeronimoV21Utils.getWebDeploymentPlan", file);
+
+        if (file.getName().equals(WEB_PLAN_NAME) && file.exists()) {
+        	return JAXBUtils.unmarshalDeploymentPlan(file);
+        }
+
+        Trace.tracePoint("EXIT", "GeronimoV21Utils.getWebDeploymentPlan", null);
+        return null;
+    }
+
+    public static JAXBElement getOpenEjbDeploymentPlan(IFile file) {
+        Trace.tracePoint("ENTRY", "GeronimoV21Utils.getOpenEjbDeploymentPlan", file);
+
+        if (file.getName().equals(OPENEJB_PLAN_NAME) && file.exists()) {
+        	return JAXBUtils.unmarshalDeploymentPlan(file);
+        }
+
+        Trace.tracePoint("EXIT", "GeronimoV21Utils.getOpenEjbDeploymentPlan", null);
+        return null;
+    }
+
+    public static JAXBElement getConnectorDeploymentPlan(IFile file) {
+        Trace.tracePoint("ENTRY", "GeronimoV21Utils.getConnectorDeploymentPlan", file);
+
+        if (file.getName().equals(CONNECTOR_PLAN_NAME) && file.exists()) {
+        	return JAXBUtils.unmarshalDeploymentPlan(file);
+        }
+
+        Trace.tracePoint("EXIT", "GeronimoV21Utils.getConnectorDeploymentPlan", null);
+        return null;
+    }
+    
+}

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/jaxb/JAXBModelUtils.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/jaxb/JAXBModelUtils.java?rev=666281&r1=666280&r2=666281&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/jaxb/JAXBModelUtils.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/jaxb/JAXBModelUtils.java Tue Jun 10 12:08:35 2008
@@ -21,6 +21,7 @@
 import javax.xml.bind.JAXBElement;
 
 import org.apache.geronimo.jee.application.Application;
+import org.apache.geronimo.jee.applicationclient.ApplicationClient;
 import org.apache.geronimo.jee.connector.Connector;
 import org.apache.geronimo.jee.deployment.Environment;
 import org.apache.geronimo.jee.openejb.OpenejbJar;
@@ -91,6 +92,9 @@
         else if (Connector.class.isInstance (plan)) {
             return ((Connector)plan).getEnvironment() == null ? null : ((Connector)plan).getEnvironment();
         }
+        else if (ApplicationClient.class.isInstance (plan)) {
+            return ((ApplicationClient)plan).getClientEnvironment() == null ? null : ((ApplicationClient)plan).getClientEnvironment();
+        }
         return null;
     }
     
@@ -108,6 +112,9 @@
         else if (Connector.class.isInstance (plan)) {
             ((Connector)plan).setEnvironment (environment);
         }
+        else if (ApplicationClient.class.isInstance (plan)) {
+            ((ApplicationClient)plan).setClientEnvironment (environment);
+        }
     }
 
     public static List getGbeans (JAXBElement element) {
@@ -124,13 +131,16 @@
         else if (Connector.class.isInstance (plan)) {
             return ((Connector)plan).getService() == null ? null : ((Connector)plan).getService();
         }
+        else if (ApplicationClient.class.isInstance (plan)) {
+            return ((ApplicationClient)plan).getService() == null ? null : ((ApplicationClient)plan).getService();
+        }
         return null;
     }
 
     public static List getGbeanRefs (JAXBElement element) {
         Object plan = element.getValue();
-        if (WebApp.class.isInstance (plan)) {
-            return ((WebApp)plan).getServiceOrPersistence() == null ? null : ((WebApp)plan).getServiceOrPersistence();
+        if (ApplicationClient.class.isInstance (plan)) {
+            return ((ApplicationClient)plan).getGbeanRef() == null ? null : ((ApplicationClient)plan).getGbeanRef();
         }
         return null;
     }

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/editors/GeronimoFormContentLoader.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/editors/GeronimoFormContentLoader.java?rev=666281&r1=666280&r2=666281&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/editors/GeronimoFormContentLoader.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/editors/GeronimoFormContentLoader.java Tue Jun 10 12:08:35 2008
@@ -21,13 +21,12 @@
 import javax.xml.bind.JAXBElement;
 import javax.xml.bind.JAXBException;
 
-import org.apache.geronimo.jee.security.Security;
 import org.apache.geronimo.st.core.jaxb.JAXBUtils;
 import org.apache.geronimo.st.ui.CommonMessages;
 import org.apache.geronimo.st.ui.editors.AbstractGeronimoDeploymentPlanEditor;
 import org.apache.geronimo.st.ui.editors.AbstractGeronimoFormContentLoader;
 import org.apache.geronimo.st.v21.core.GeronimoV21Utils;
-import org.apache.geronimo.st.v21.core.jaxb.JAXBModelUtils;
+import org.apache.geronimo.st.v21.ui.pages.AppClientGeneralPage;
 import org.apache.geronimo.st.v21.ui.pages.AppGeneralPage;
 import org.apache.geronimo.st.v21.ui.pages.ConnectorOverviewPage;
 import org.apache.geronimo.st.v21.ui.pages.DeploymentPage;
@@ -38,7 +37,6 @@
 import org.eclipse.core.resources.IFile;
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.forms.editor.FormEditor;
-import org.eclipse.ui.forms.editor.FormPage;
 
 public class GeronimoFormContentLoader extends AbstractGeronimoFormContentLoader {
 
@@ -50,7 +48,7 @@
     public void addApplicationPlanPages(FormEditor editor) throws PartInitException {
         editor.addPage(new AppGeneralPage(editor, "appgeneralpage", CommonMessages.editorTabGeneral));
         editor.addPage(new SecurityPage(editor, "securitypage", CommonMessages.editorTabSecurity));
-        editor.addPage(getApplicationDeploymentPage(editor));
+        editor.addPage(createDeploymentFormPage(editor));
     }
 
     /*
@@ -60,7 +58,7 @@
      */
     public void addConnectorPlanPages(FormEditor editor) throws PartInitException {
         editor.addPage(new ConnectorOverviewPage(editor, "connectoroverview", CommonMessages.editorTabGeneral));
-        editor.addPage(getConnectorDeploymentPage(editor));
+        editor.addPage(createDeploymentFormPage(editor));
     }
 
     /*
@@ -69,12 +67,12 @@
      * @see org.apache.geronimo.st.ui.editors.AbstractGeronimoFormContentLoader#addApplicationPlanPages(org.eclipse.ui.forms.editor.FormEditor)
      */
     public void addApplicationClientPlanPages(FormEditor editor) throws PartInitException {
-        editor.addPage(new AppGeneralPage(editor, "appgeneralpage", CommonMessages.editorTabGeneral));
-        editor.addPage(new SecurityPage(editor, "securitypage", CommonMessages.editorTabSecurity));
-        editor.addPage(getApplicationDeploymentPage(editor));
+        editor.addPage(new AppClientGeneralPage(editor, "appgeneralpage", CommonMessages.editorTabGeneral));
+        editor.addPage(createNamingFormPage(editor));
+        //editor.addPage(new SecurityPage(editor, "securitypage", CommonMessages.editorTabSecurity));
+        editor.addPage(createDeploymentFormPage(editor));
     }
 
-
     /*
      * (non-Javadoc)
      * 
@@ -84,7 +82,7 @@
         editor.addPage(new EjbOverviewPage(editor, "ejboverview", CommonMessages.editorTabGeneral));
         // TODO Add naming page but broken down for each bean type
         editor.addPage(new SecurityPage(editor, "securitypage", CommonMessages.editorTabSecurity));
-        editor.addPage(getEjbJarDeploymentPage(editor));
+        editor.addPage(createDeploymentFormPage(editor));
     }
 
     /*
@@ -96,9 +94,9 @@
         AbstractGeronimoDeploymentPlanEditor geronimoEditor = (AbstractGeronimoDeploymentPlanEditor)editor;
         JAXBElement plan = geronimoEditor.getDeploymentPlan();
         editor.addPage(new WebGeneralPage(editor, "generalpage", CommonMessages.editorTabGeneral));
-        editor.addPage(getWebNamingPage(editor));
+        editor.addPage(createNamingFormPage(editor));
         editor.addPage(new SecurityPage(editor, "securitypage", CommonMessages.editorTabSecurity));
-        editor.addPage(getWebDeploymentPage(editor));
+        editor.addPage(createDeploymentFormPage(editor));
     }
 
     /*
@@ -114,53 +112,6 @@
         JAXBUtils.marshalDeploymentPlan(deploymentPlan, file);
     }
 
-    protected FormPage getWebNamingPage(FormEditor editor) {
-        NamingFormPage formPage = createNamingFormPage(editor);
-//        WebPackage pkg = null; //WebFactory.eINSTANCE.getWebPackage();
-//        formPage.ejbLocalRef = pkg.getWebApp_EjbLocalRef();
-//        formPage.ejbRef = pkg.getWebApp_EjbRef();
-//        formPage.resEnvRef = pkg.getWebApp_ResourceEnvRef();
-//        formPage.resRef = pkg.getWebApp_ResourceRef();
-//        formPage.gbeanRef = pkg.getWebApp_GbeanRef();
-//        formPage.serviceRef = pkg.getWebApp_ServiceRef();
-        return formPage;
-    }
-
-    protected FormPage getWebDeploymentPage(FormEditor editor) {
-        DeploymentPage formPage = createDeploymentFormPage(editor);
-//        formPage.environment = WebFactory.eINSTANCE.getWebPackage().getWebApp_Environment();
-//        formPage.gbeanERef = WebFactory.eINSTANCE.getWebPackage().getWebApp_Gbean();
-        return formPage;
-    }
-
-    private FormPage getEjbJarDeploymentPage(FormEditor editor) {
-        DeploymentPage formPage = createDeploymentFormPage(editor);
-//        formPage.environment = JarFactory.eINSTANCE.getJarPackage().getOpenejbJarType_Environment();
-//        formPage.gbeanERef = JarFactory.eINSTANCE.getJarPackage().getOpenejbJarType_Gbean();
-        return formPage;
-    }
-
-    protected FormPage getApplicationDeploymentPage(FormEditor editor) {
-        DeploymentPage formPage = createDeploymentFormPage(editor);
-//        formPage.environment = ApplicationFactory.eINSTANCE.getApplicationPackage().getApplicationType_Environment();
-//        formPage.gbeanERef = ApplicationFactory.eINSTANCE.getApplicationPackage().getApplicationType_Gbean();
-        return formPage;
-    }
-
-    private FormPage getConnectorDeploymentPage(FormEditor editor) {
-        DeploymentPage formPage = createDeploymentFormPage(editor);
-//        formPage.environment = ConnectorFactory.eINSTANCE.getConnectorPackage().getConnectorType_Environment();
-//        formPage.gbeanERef = ConnectorFactory.eINSTANCE.getConnectorPackage().getConnectorType_Gbean();
-        return formPage;
-    }
-
-    protected FormPage getApplicationClientDeploymentPage(FormEditor editor) {
-        DeploymentPage formPage = createDeploymentFormPage(editor);
-//        formPage.environment = ApplicationFactory.eINSTANCE.getApplicationPackage().getApplicationType_Environment();
-//        formPage.gbeanERef = ApplicationFactory.eINSTANCE.getApplicationPackage().getApplicationType_Gbean();
-        return formPage;
-    }
-
     private NamingFormPage createNamingFormPage(FormEditor editor) {
         return new NamingFormPage(editor, "namingpage", CommonMessages.editorTabNaming);
     }

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/AppClientGeneralPage.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/AppClientGeneralPage.java?rev=666281&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/AppClientGeneralPage.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/AppClientGeneralPage.java Tue Jun 10 12:08:35 2008
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.st.v21.ui.pages;
+
+import org.apache.geronimo.st.ui.CommonMessages;
+import org.apache.geronimo.st.ui.pages.AbstractGeronimoFormPage;
+import org.apache.geronimo.st.v21.ui.sections.AppClientClientGeneralSection;
+import org.apache.geronimo.st.v21.ui.sections.AppClientServerGeneralSection;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.editor.FormEditor;
+
+public class AppClientGeneralPage extends AbstractGeronimoFormPage {
+
+	public AppClientGeneralPage(FormEditor editor, String id, String title) {
+		super(editor, id, title);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.apache.geronimo.ui.pages.AbstractGeronimoFormPage#fillBody(org.eclipse.ui.forms.IManagedForm)
+	 */
+	protected void fillBody(IManagedForm managedForm) {
+		managedForm.addPart(new AppClientServerGeneralSection(body, toolkit, getStyle(), getDeploymentPlan()));
+        managedForm.addPart(new AppClientClientGeneralSection(body, toolkit, getStyle(), getDeploymentPlan()));
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.apache.geronimo.ui.pages.AbstractGeronimoFormPage#getFormTitle()
+	 */
+	public String getFormTitle() {
+		return CommonMessages.appClientGeneralPageTitle;
+	}
+
+}

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/AppClientGeneralPage.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/AppClientGeneralPage.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/AppClientGeneralPage.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/NamingFormPage.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/NamingFormPage.java?rev=666281&r1=666280&r2=666281&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/NamingFormPage.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/NamingFormPage.java Tue Jun 10 12:08:35 2008
@@ -18,6 +18,7 @@
 
 import java.util.List;
 
+import org.apache.geronimo.jee.applicationclient.ApplicationClient;
 import org.apache.geronimo.jee.web.WebApp;
 import org.apache.geronimo.st.ui.CommonMessages;
 import org.apache.geronimo.st.ui.editors.AbstractGeronimoDeploymentPlanEditor;
@@ -41,20 +42,27 @@
 
     public List ejbLocalRefs;
 
-    //ServiceOrPersistence is already handled on the Dependency Page.
-    //public List gbeanRefs;
+    public List gbeanRefs;
 
     public List serviceRefs;
 
     public NamingFormPage(FormEditor editor, String id, String title) {
         super(editor, id, title);
-        WebApp webapp = (WebApp)((AbstractGeronimoDeploymentPlanEditor) getEditor()).getDeploymentPlan().getValue();
-        resRefs = webapp.getResourceRef();
-        resEnvRefs = webapp.getResourceEnvRef();
-        ejbRefs = webapp.getEjbRef();
-        ejbLocalRefs = webapp.getEjbLocalRef();
-        //gbeanRefs = webapp.getServiceOrPersistence();
-        serviceRefs = webapp.getServiceRef();       
+        if (WebApp.class.isInstance (((AbstractGeronimoDeploymentPlanEditor) getEditor()).getDeploymentPlan().getValue())) {
+            WebApp webapp = (WebApp)((AbstractGeronimoDeploymentPlanEditor) getEditor()).getDeploymentPlan().getValue();
+            resRefs = webapp.getResourceRef();
+            resEnvRefs = webapp.getResourceEnvRef();
+            ejbRefs = webapp.getEjbRef();
+            ejbLocalRefs = webapp.getEjbLocalRef();
+            serviceRefs = webapp.getServiceRef();
+        } else if (ApplicationClient.class.isInstance (((AbstractGeronimoDeploymentPlanEditor) getEditor()).getDeploymentPlan().getValue())) {
+            ApplicationClient appClient = (ApplicationClient)((AbstractGeronimoDeploymentPlanEditor) getEditor()).getDeploymentPlan().getValue();
+            resRefs = appClient.getResourceRef();
+            resEnvRefs = appClient.getResourceEnvRef();
+            ejbRefs = appClient.getEjbRef();
+            gbeanRefs = appClient.getGbeanRef();
+            serviceRefs = appClient.getServiceRef();
+        }
     }
 
     /*
@@ -66,8 +74,11 @@
         managedForm.addPart(new ResourceRefSection(getDeploymentPlan(), body, toolkit, getStyle(), resRefs));
         managedForm.addPart(new ResourceEnvRefSection(getDeploymentPlan(), body, toolkit, getStyle(), resEnvRefs));
         managedForm.addPart(new EjbRefSection(getDeploymentPlan(), body, toolkit, getStyle(), ejbRefs));
-        managedForm.addPart(new EjbLocalRefSection(getDeploymentPlan(), body, toolkit, getStyle(), ejbLocalRefs));
-        //managedForm.addPart(new GBeanRefSection(getDeploymentPlan(), body, toolkit, getStyle(), gbeanRefs));
+        if (WebApp.class.isInstance (getDeploymentPlan().getValue())) {
+            managedForm.addPart(new EjbLocalRefSection(getDeploymentPlan(), body, toolkit, getStyle(), ejbLocalRefs));
+        } else if (ApplicationClient.class.isInstance (getDeploymentPlan().getValue())){
+            managedForm.addPart(new GBeanRefSection(getDeploymentPlan(), body, toolkit, getStyle(), gbeanRefs));
+        }
         managedForm.addPart(new ServiceRefSection(getDeploymentPlan(), body, toolkit, getStyle(), serviceRefs));
     }
 
@@ -79,5 +90,4 @@
     public String getFormTitle() {
         return CommonMessages.namingFormPageTitle;
     }
-
 }

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/AppClientClientGeneralSection.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/AppClientClientGeneralSection.java?rev=666281&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/AppClientClientGeneralSection.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/AppClientClientGeneralSection.java Tue Jun 10 12:08:35 2008
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.st.v21.ui.sections;
+
+import javax.xml.bind.JAXBElement;
+
+import org.apache.geronimo.jee.applicationclient.ApplicationClient;
+import org.apache.geronimo.jee.deployment.Environment;
+import org.apache.geronimo.st.ui.CommonMessages;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+public class AppClientClientGeneralSection extends CommonGeneralSection {
+
+	ApplicationClient plan;
+
+	public AppClientClientGeneralSection(Composite parent, FormToolkit toolkit, int style, JAXBElement plan) {
+		super(parent, toolkit, style, plan);
+		this.plan = (ApplicationClient) plan.getValue();
+		createClient();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.apache.geronimo.st.v21.ui.sections.CommonGeneralSection#getEnvironmentEReference()
+	 */
+	protected JAXBElement getEnvironmentEReference() {
+		return null; //ApplicationPackage.eINSTANCE.getApplicationType_Environment();
+	}
+
+    protected Environment getEnvironment(boolean create) {
+        Environment type = null;
+        Object plan = getPlan().getValue();
+        if (ApplicationClient.class.isInstance(plan)) {
+            type = ((ApplicationClient) plan).getClientEnvironment();
+            if (type == null && create) {
+                type = getDeploymentObjectFactory().createEnvironment();
+                ((ApplicationClient) plan).setClientEnvironment(type);
+            }
+        }
+
+        return type;
+    }
+
+    protected String getSectionGeneralTitle() {
+        return CommonMessages.editorSectionClientTitle;
+    }
+
+    protected String getSectionGeneralDescription() {
+        return CommonMessages.editorSectionClientDescription;
+    }
+}

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/AppClientClientGeneralSection.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/AppClientClientGeneralSection.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/AppClientClientGeneralSection.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/AppClientServerGeneralSection.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/AppClientServerGeneralSection.java?rev=666281&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/AppClientServerGeneralSection.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/AppClientServerGeneralSection.java Tue Jun 10 12:08:35 2008
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.st.v21.ui.sections;
+
+import javax.xml.bind.JAXBElement;
+
+import org.apache.geronimo.jee.applicationclient.ApplicationClient;
+import org.apache.geronimo.jee.deployment.Environment;
+import org.apache.geronimo.st.ui.CommonMessages;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+public class AppClientServerGeneralSection extends CommonGeneralSection {
+
+	ApplicationClient plan;
+
+	public AppClientServerGeneralSection(Composite parent, FormToolkit toolkit, int style, JAXBElement plan) {
+		super(parent, toolkit, style, plan);
+		this.plan = (ApplicationClient) plan.getValue();
+		createClient();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.apache.geronimo.st.v21.ui.sections.CommonGeneralSection#getEnvironmentEReference()
+	 */
+	protected JAXBElement getEnvironmentEReference() {
+		return null; //ApplicationPackage.eINSTANCE.getApplicationType_Environment();
+	}
+
+    protected Environment getEnvironment(boolean create) {
+        Environment type = null;
+        Object plan = getPlan().getValue();
+        if (ApplicationClient.class.isInstance(plan)) {
+            type = ((ApplicationClient) plan).getServerEnvironment();
+            if (type == null && create) {
+                type = getDeploymentObjectFactory().createEnvironment();
+                ((ApplicationClient) plan).setServerEnvironment(type);
+            }
+        }
+
+        return type;
+    }
+
+    protected String getSectionGeneralTitle() {
+        return CommonMessages.editorSectionServerTitle;
+    }
+
+    protected String getSectionGeneralDescription() {
+        return CommonMessages.editorSectionServerDescription;
+    }
+}

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/AppClientServerGeneralSection.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/AppClientServerGeneralSection.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/AppClientServerGeneralSection.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/CommonGeneralSection.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/CommonGeneralSection.java?rev=666281&r1=666280&r2=666281&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/CommonGeneralSection.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/CommonGeneralSection.java Tue Jun 10 12:08:35 2008
@@ -28,7 +28,6 @@
 import org.apache.geronimo.jee.deployment.Environment;
 import org.apache.geronimo.jee.deployment.ObjectFactory;
 import org.apache.geronimo.jee.application.Application;
-import org.apache.geronimo.jee.applicationclient.ApplicationClient;
 import org.apache.geronimo.jee.connector.Connector;
 import org.apache.geronimo.jee.openejb.OpenejbJar;
 import org.apache.geronimo.st.ui.CommonMessages;
@@ -75,8 +74,8 @@
 
         Section section = getSection();
 
-        section.setText(CommonMessages.editorSectionGeneralTitle);
-        section.setDescription(CommonMessages.editorSectionGeneralDescription);
+        section.setText(getSectionGeneralTitle());
+        section.setDescription(getSectionGeneralDescription());
         section.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
 
         Composite composite = toolkit.createComposite(section);
@@ -302,11 +301,7 @@
         return null;
     }
 
-
-    //
-    // Need to support both WebApp and Connector 
-    //
-    private Environment getEnvironment(boolean create) {
+    protected Environment getEnvironment(boolean create) {
         Environment type = null;
         Object plan = getPlan().getValue();
         if (WebApp.class.isInstance(plan)) {
@@ -334,8 +329,6 @@
                 ((OpenejbJar) plan).setEnvironment(type);
             }
         }
-        // TODO add support for application client
-        // figure out if this is client or server environment
 
         return type;
     }
@@ -366,7 +359,7 @@
         return null;
     }
     
-    private org.apache.geronimo.jee.deployment.ObjectFactory getDeploymentObjectFactory() {
+    protected org.apache.geronimo.jee.deployment.ObjectFactory getDeploymentObjectFactory() {
         if ( deploymentObjectFactory == null ) {
             deploymentObjectFactory = new org.apache.geronimo.jee.deployment.ObjectFactory();
         }
@@ -375,4 +368,11 @@
 
     protected abstract JAXBElement getEnvironmentEReference();
 
+    protected String getSectionGeneralTitle() {
+        return CommonMessages.editorSectionGeneralTitle;
+    }
+
+    protected String getSectionGeneralDescription() {
+        return CommonMessages.editorSectionGeneralDescription;
+    }
 }

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/GBeanRefSection.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/GBeanRefSection.java?rev=666281&r1=666280&r2=666281&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/GBeanRefSection.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/GBeanRefSection.java Tue Jun 10 12:08:35 2008
@@ -1,105 +1,85 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.geronimo.st.v21.ui.sections;
-
-import javax.xml.bind.JAXBElement;
-
-import org.apache.geronimo.st.ui.CommonMessages;
-import org.apache.geronimo.st.ui.sections.AbstractTableSection;
-import org.apache.geronimo.st.v21.ui.wizards.GBeanRefWizard;
-import org.apache.geronimo.jee.deployment.Gbean;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-
-public class GBeanRefSection extends AbstractTableSection {
-
-	Object gbeanERef;
-
-	private static final String[] COLUMN_NAMES = new String[] {
-			CommonMessages.editorGBeanRefName,
-			CommonMessages.editorGBeanRefType};
-
-	public GBeanRefSection(JAXBElement plan, Composite parent, FormToolkit toolkit, int style, Object gbeanERef) {
-		super(plan, parent, toolkit, style);
-		this.gbeanERef = gbeanERef;
-		createClient();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.sections.AbstractTableSection#getTitle()
-	 */
-	public String getTitle() {
-		return CommonMessages.editorGBeanRefTitle;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.sections.AbstractTableSection#getDescription()
-	 */
-	public String getDescription() {
-		return CommonMessages.editorGBeanRefDescription;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.sections.AbstractTableSection#getTableColumnNames()
-	 */
-	public String[] getTableColumnNames() {
-		return COLUMN_NAMES;
-	}
-
-//	/*
-//	 * (non-Javadoc)
-//	 * 
-//	 * @see org.apache.geronimo.ui.sections.AbstractTableSection#getEReference()
-//	 */
-//	public JAXBElement getEReference() {
-//		return gbeanERef;
-//	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.sections.AbstractTableSection#getWizard()
-	 */
-	public Wizard getWizard() {
-		return new GBeanRefWizard(this);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.sections.AbstractTableSection#getTableEntryObjectType()
-	 */
-	public Class getTableEntryObjectType() {
-		return Gbean.class;
-	}
-
-//	/*
-//	 * (non-Javadoc)
-//	 * 
-//	 * @see org.apache.geronimo.st.ui.sections.AbstractTableSection#getAdapterFactory()
-//	 */
-//	public AdapterFactory getAdapterFactory() {
-//		return EMFEditorContext.getFactory();
-//	}
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.st.v21.ui.sections;
+
+import java.util.List;
+
+import javax.xml.bind.JAXBElement;
+
+import org.apache.geronimo.st.ui.CommonMessages;
+import org.apache.geronimo.st.ui.providers.AdapterFactory;
+import org.apache.geronimo.st.ui.sections.AbstractTableSection;
+import org.apache.geronimo.st.v21.ui.wizards.GBeanRefWizard;
+import org.apache.geronimo.jee.naming.EjbRef;
+import org.apache.geronimo.jee.naming.GbeanRef;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+public class GBeanRefSection extends AbstractTableSection {
+
+	public GBeanRefSection(JAXBElement plan, Composite parent, FormToolkit toolkit, int style, List gbeanRef) {
+		super(plan, parent, toolkit, style);
+		this.objectContainer = gbeanRef;
+		COLUMN_NAMES = new String[] {
+		        CommonMessages.editorGBeanRefName, CommonMessages.editorGBeanRefType};
+		createClient();
+	}
+
+	public String getTitle() {
+		return CommonMessages.editorGBeanRefTitle;
+	}
+
+	public String getDescription() {
+		return CommonMessages.editorGBeanRefDescription;
+	}
+
+	public Wizard getWizard() {
+		return new GBeanRefWizard(this);
+	}
+
+	public Class getTableEntryObjectType() {
+		return GbeanRef.class;
+	}
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.st.ui.sections.AbstractTableSection#getAdapterFactory()
+     */
+    public AdapterFactory getAdapterFactory() {
+        return new AdapterFactory() {
+            public Object[] getElements(Object inputElement) {
+                if (!JAXBElement.class.isInstance(inputElement)) {
+                    return new String[] { "" };
+                }
+                return getObjectContainer().toArray();
+            }
+
+            public String getColumnText(Object element, int columnIndex) {
+                if (GbeanRef.class.isInstance(element)) {
+                    GbeanRef gbeanRef = (GbeanRef)element;
+                    switch (columnIndex) {
+                    case 0: return gbeanRef.getRefName();
+                    case 1: return gbeanRef.getRefType().get(0);
+                    }
+                }
+                return null;
+            }
+        };
+    }
+}

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/GBeanRefWizard.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/GBeanRefWizard.java?rev=666281&r1=666280&r2=666281&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/GBeanRefWizard.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/GBeanRefWizard.java Tue Jun 10 12:08:35 2008
@@ -16,17 +16,25 @@
  */
 package org.apache.geronimo.st.v21.ui.wizards;
 
+
+import java.util.List;
+
 import javax.xml.bind.JAXBElement;
 
 import org.apache.geronimo.jee.naming.GbeanRef;
-import org.apache.geronimo.jee.naming.ObjectFactory;
+import org.apache.geronimo.jee.security.Description;
 import org.apache.geronimo.st.core.jaxb.JAXBObjectFactory;
+import org.apache.geronimo.st.core.jaxb.JAXBUtils;
 import org.apache.geronimo.st.ui.CommonMessages;
 import org.apache.geronimo.st.ui.sections.AbstractTableSection;
 import org.apache.geronimo.st.ui.wizards.AbstractTableWizard;
 import org.apache.geronimo.st.v21.core.jaxb.JAXBModelUtils;
 import org.apache.geronimo.st.v21.core.jaxb.JAXBObjectFactoryImpl;
-import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
 
 public class GBeanRefWizard extends AbstractTableWizard {
 
@@ -57,7 +65,69 @@
     public String getWizardFirstPageDescription() {
         return CommonMessages.wizardPageDescription_GBeanRef;
     }
+ 
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.eclipse.jface.wizard.IWizard#addPages()
+     */
+    public void addPages() {
+        GbeanRefWizardPage page = new GbeanRefWizardPage("Page0");
+        page.setImageDescriptor(descriptor);
+        addPage(page);
+    }
+
+    // need to extend the DynamicWizardPage only so that when the Edit dialog is shown
+    // the values are brought in properly.
+    public class GbeanRefWizardPage extends DynamicWizardPage {
+        public GbeanRefWizardPage(String pageName) {
+            super(pageName);
+        }
 
+        public void createControl(Composite parent) {
+            Composite composite = createComposite(parent);
+            for (int i = 0; i < section.getTableColumnNames().length; i++) {
+                Label label = new Label(composite, SWT.LEFT);
+                String columnName = section.getTableColumnNames()[i];
+                if (!columnName.endsWith(":"))
+                    columnName = columnName.concat(":");
+                label.setText(columnName);
+                GridData data = new GridData();
+                data.horizontalAlignment = GridData.FILL;
+                label.setLayoutData(data);
+
+                Text text = new Text(composite, SWT.SINGLE | SWT.BORDER);
+                data = new GridData(GridData.HORIZONTAL_ALIGN_FILL
+                        | GridData.VERTICAL_ALIGN_FILL);
+                data.grabExcessHorizontalSpace = true;
+                data.widthHint = 100;
+                text.setLayoutData(data);
+                if (eObject != null) {
+                    if (i == 1) {
+                        // get the description
+                        GbeanRef gbeanRef = (GbeanRef) eObject;
+                        String value = gbeanRef.getRefType().get(0);
+                        if (value != null) {
+                            text.setText(value);
+                        }                        
+                    }
+                    else
+                    {
+                        String value = (String) JAXBUtils.getValue(eObject,getTableColumnEAttributes()[i]);
+                        if (value != null) {
+                            text.setText(value);
+                        }
+                    }
+                }
+                textEntries[i] = text;
+            }
+
+            doCustom(composite);
+            setControl(composite);
+            textEntries[0].setFocus();
+        }
+    }
+    
     public boolean performFinish() {
         DynamicWizardPage page = (DynamicWizardPage) getPages()[0];
 
@@ -65,29 +135,26 @@
             eObject = getEFactory().create(GbeanRef.class);
             JAXBElement plan = section.getPlan();
 
-            // add the JAXBElement of a GBean, not the GBean
-            ObjectFactory objectFactory = new ObjectFactory();
-            JAXBModelUtils.getGbeanRefs(plan).add(objectFactory.createGbeanRef((GbeanRef)eObject));
+            List gbeanRefList = JAXBModelUtils.getGbeanRefs(plan); 
+            if (gbeanRefList == null) {
+                gbeanRefList = (List)getEFactory().create(GbeanRef.class);
+            }
+            gbeanRefList.add(eObject);
         }
 
-        processEAttributes (page);
+        // NOTE!! this replaces the call to processEAttributes (page);
+        String value = page.getTextEntry(0).getText();
+        String attribute = getTableColumnEAttributes()[0];
+        JAXBUtils.setValue(eObject, attribute, value);
+
+        Description type = null;
+        GbeanRef gbeanRef = (GbeanRef) eObject;
+        gbeanRef.getRefType().add(page.getTextEntry(1).getText());
 
-        if (section.getTableViewer().getInput() == null) {
+        if (section.getTableViewer().getInput() == section.getPlan()) {
             section.getTableViewer().setInput(section.getInput());
         }
 
         return true;
     }
-
-    public void processEAttributes(IWizardPage page) {
-        if (page instanceof DynamicWizardPage) {
-            DynamicWizardPage dynamicPage = (DynamicWizardPage)page;
-            GbeanRef gbeanRef = (GbeanRef)eObject;
-            String value = dynamicPage.getTextEntry(0).getText();
-            gbeanRef.setRefName(value);
-
-            value = dynamicPage.getTextEntry(1).getText();
-            gbeanRef.getRefType().add(value);
-        }
-    }
 }



Mime
View raw message