geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sppa...@apache.org
Subject svn commit: r280909 [51/52] - in /geronimo/devtools/trunk/modules/eclipse-plugin: ./ features/ features/org.apache.geronimo.feature/ org.apache.geronimo.core/ org.apache.geronimo.deployment.model/ org.apache.geronimo.feature/ org.apache.geronimo.runtim...
Date Wed, 14 Sep 2005 19:01:03 GMT
Added: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/editors/AbstractGeronimoDeploymentPlanEditor.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/editors/AbstractGeronimoDeploymentPlanEditor.java?rev=280909&view=auto
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/editors/AbstractGeronimoDeploymentPlanEditor.java (added)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/editors/AbstractGeronimoDeploymentPlanEditor.java Wed Sep 14 11:59:30 2005
@@ -0,0 +1,146 @@
+/**
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ *  Licensed 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.ui.editors;
+
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Collections;
+
+import org.apache.geronimo.ui.internal.Trace;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.editor.FormEditor;
+import org.eclipse.ui.forms.editor.IFormPage;
+
+/**
+ * 
+ * 
+ */
+public abstract class AbstractGeronimoDeploymentPlanEditor extends FormEditor {
+
+    private EObject deploymentPlan;
+
+    /**
+     * 
+     */
+    public AbstractGeronimoDeploymentPlanEditor() {
+        super();
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.eclipse.ui.part.EditorPart#doSave(org.eclipse.core.runtime.IProgressMonitor)
+     */
+    public void doSave(IProgressMonitor monitor) {
+        InputStream is = null;
+        try {
+            IEditorInput input = getEditorInput();
+            if (input instanceof IFileEditorInput) {
+
+                deploymentPlan.eResource().save(Collections.EMPTY_MAP);
+                commitFormPages(true);
+                editorDirtyStateChanged();
+
+            }
+        } catch (Exception e) {
+            Trace.trace(Trace.SEVERE, "Error saving", e);
+        } finally {
+            try {
+                if (is != null)
+                    is.close();
+            } catch (Exception e) {
+                // do nothing
+            }
+        }
+    }
+    
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.forms.editor.FormEditor#addPages()
+     */
+    protected void addPages() {
+        try {
+            doAddPages();
+        } catch (PartInitException e1) {          
+            e1.printStackTrace();
+        }   
+    }
+    
+    abstract public void doAddPages() throws PartInitException;
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.eclipse.ui.part.EditorPart#doSaveAs()
+     */
+    public final void doSaveAs() {
+        // do nothing
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.eclipse.ui.part.EditorPart#isSaveAsAllowed()
+     */
+    public boolean isSaveAsAllowed() {
+        return false;
+    }
+
+    public void commitFormPages(boolean onSave) {
+        IFormPage[] pages = getPages();
+        for (int i = 0; i < pages.length; i++) {
+            IFormPage page = pages[i];
+            IManagedForm mform = page.getManagedForm();
+            if (mform != null && mform.isDirty())
+                mform.commit(true);
+        }
+    }
+
+    public IFormPage[] getPages() {
+        ArrayList formPages = new ArrayList();
+        for (int i = 0; i < pages.size(); i++) {
+            Object page = pages.get(i);
+            if (page instanceof IFormPage)
+                formPages.add(page);
+        }
+        return (IFormPage[]) formPages.toArray(new IFormPage[formPages.size()]);
+    }
+
+    public EObject getDeploymentPlan() {
+        return deploymentPlan;
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.IEditorPart#init(org.eclipse.ui.IEditorSite, org.eclipse.ui.IEditorInput)
+     */
+    public void init(IEditorSite site, IEditorInput input)
+            throws PartInitException {
+        super.init(site, input);
+        if (input instanceof IFileEditorInput) {
+            IFileEditorInput fei = (IFileEditorInput) input;
+            deploymentPlan = loadDeploymentPlan(fei.getFile());
+        }
+    }
+
+    abstract public EObject loadDeploymentPlan(IFile file);
+
+}

Added: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/editors/DPEditor.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/editors/DPEditor.java?rev=280909&view=auto
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/editors/DPEditor.java (added)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/editors/DPEditor.java Wed Sep 14 11:59:30 2005
@@ -0,0 +1,46 @@
+/**
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ *  Licensed 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.ui.editors;
+
+import org.apache.geronimo.core.internal.GeronimoUtils;
+import org.apache.geronimo.ui.internal.Messages;
+import org.apache.geronimo.ui.pages.NamingFormPage;
+import org.apache.geronimo.ui.pages.SecurityPage;
+import org.apache.geronimo.ui.pages.WebGeneralPage;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.ui.PartInitException;
+
+public class DPEditor extends AbstractGeronimoDeploymentPlanEditor {
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.ui.editors.AbstractGeronimoDeploymentPlanEditor#doAddPages()
+     */
+    public void doAddPages() throws PartInitException {
+        addPage(new WebGeneralPage(this, "generalpage",
+                Messages.editorTabGeneral));
+        addPage(new NamingFormPage(this, "namingpage", Messages.editorTabNaming));
+        addPage(new SecurityPage(this, "securitypage",
+                Messages.editorTabSecurity));
+    }
+
+    public EObject loadDeploymentPlan(IFile file) {
+        return GeronimoUtils.getWebDeploymentPlan(file);
+    }
+
+}
\ No newline at end of file

Added: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/editors/OpenEjbPlanEditor.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/editors/OpenEjbPlanEditor.java?rev=280909&view=auto
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/editors/OpenEjbPlanEditor.java (added)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/editors/OpenEjbPlanEditor.java Wed Sep 14 11:59:30 2005
@@ -0,0 +1,51 @@
+/**
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ *  Licensed 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.ui.editors;
+
+import org.apache.geronimo.core.internal.GeronimoUtils;
+import org.apache.geronimo.ui.internal.Messages;
+import org.apache.geronimo.ui.pages.EjbOverviewPage;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.ui.PartInitException;
+/**
+ * 
+ * 
+ */
+public class OpenEjbPlanEditor extends AbstractGeronimoDeploymentPlanEditor {
+
+    /**
+     * 
+     */
+    public OpenEjbPlanEditor() {
+        super();
+    }
+
+    public void doAddPages() throws PartInitException {
+        addPage(new EjbOverviewPage(this, "ejboverview",
+                Messages.editorTabGeneral));
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.ui.editors.AbstractGeronimoDeploymentPlanEditor#loadDeploymentPlan(org.eclipse.core.resources.IFile)
+     */
+    public EObject loadDeploymentPlan(IFile file) {
+        return GeronimoUtils.getOpenEjbDeploymentPlan(file);
+    }
+
+}

Added: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/GeronimoUIPlugin.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/GeronimoUIPlugin.java?rev=280909&view=auto
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/GeronimoUIPlugin.java (added)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/GeronimoUIPlugin.java Wed Sep 14 11:59:30 2005
@@ -0,0 +1,65 @@
+/**
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ *  Licensed 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.ui.internal;
+
+import java.io.IOException;
+
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.ui.plugin.*;
+
+/**
+ * The main plugin class to be used in the desktop.
+ */
+public class GeronimoUIPlugin extends AbstractUIPlugin {
+    protected static final String PLUGIN_ID = "org.apache.geronimo.ui";
+
+    private static final String ICONS_DIRECTORY = "icons/";
+
+    private static String iconLocation;
+
+    private static GeronimoUIPlugin singleton;
+
+    /**
+     * The constructor.
+     */
+    public GeronimoUIPlugin() {
+        super();
+        singleton = this;
+    }
+
+    /**
+     * Returns the singleton instance of this plugin.
+     * 
+     * @return org.apache.geronimo.ui.internal.GeronimoUIPlugin
+     */
+    public static GeronimoUIPlugin getInstance() {
+        return singleton;
+    }
+
+    public static String getIconLocation() {
+        if (iconLocation == null) {
+            try {
+                iconLocation = Platform.resolve(
+                        GeronimoUIPlugin.getInstance().getBundle()
+                                .getEntry("/")).getPath()
+                        + ICONS_DIRECTORY;
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+        return iconLocation;
+    }
+}
\ No newline at end of file

Added: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/Messages.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/Messages.java?rev=280909&view=auto
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/Messages.java (added)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/Messages.java Wed Sep 14 11:59:30 2005
@@ -0,0 +1,173 @@
+/**
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ *  Licensed 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.ui.internal;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * Translated messages.
+ */
+public class Messages extends NLS {
+
+    public static String editorTabGeneral;
+
+    public static String editorTabNaming;
+
+    public static String editorTabSecurity;
+
+    public static String editorTabDependencies;
+
+    public static String errorCouldNotOpenFile;
+
+    public static String editorTitle;
+
+    public static String editorSectionGeneralTitle;
+
+    public static String editorSectionGeneralDescription;
+
+    public static String editorConfigId;
+
+    public static String editorParentId;
+
+    public static String editorContextRoot;
+
+    public static String editorClassloader;
+
+    public static String editorClassloaderServer;
+
+    public static String editorClassloaderWebApp;
+
+    public static String securityRealmName;
+
+    //
+
+    public static String editorSectionSecurityRolesTitle;
+
+    public static String editorSectionSecurityRolesDescription;
+
+    public static String name;
+
+    public static String description;
+
+    //
+
+    public static String editorResourceRefDescription;
+
+    public static String editorResourceRefTitle;
+
+    public static String editorResRefTargetNameTitle;
+
+    public static String editorResRefLinkTitle;
+
+    public static String editorResRefNameTitle;
+
+    //
+
+    public static String editorResourceEnvRefDescription;
+
+    public static String editorResourceEnvRefTitle;
+
+    public static String editorResEnvRefMsgDestTitle;
+
+    public static String editorResEnvRefNameTitle;
+
+    //
+
+    public static String editorEjbLocalRefDescription;
+
+    public static String editorEjbLocalRefTitle;
+
+    public static String editorEjbRefTargetName;
+
+    public static String editorEjbRefEjbLink;
+
+    //
+
+    public static String editorEjbRefDescription;
+
+    public static String editorEjbRefTitle;
+
+    // Buttons
+
+    public static String add;
+
+    public static String remove;
+
+    public static String edit;
+
+    // Wizard/Wizard Pages
+
+    public static String wizardNewTitle_ResRef;
+
+    public static String wizardEditTitle_ResRef;
+
+    public static String wizardPageTitle_ResRef;
+
+    public static String wizardPageDescription_ResRef;
+
+    //
+
+    public static String wizardNewTitle_ResEnvRef;
+
+    public static String wizardEditTitle_ResEnvRef;
+
+    public static String wizardPageTitle_ResEnvRef;
+
+    public static String wizardPageDescription_ResEnvRef;
+
+    //
+
+    public static String wizardNewTitle_EjbRef;
+
+    public static String wizardEditTitle_EjbRef;
+
+    public static String wizardPageTitle_EjbRef;
+
+    public static String wizardPageDescription_EjbRef;
+
+    //
+
+    public static String wizardNewTitle_EjbLocalRef;
+
+    public static String wizardEditTitle_EjbLocalRef;
+
+    public static String wizardPageTitle_EjbLocalRef;
+
+    public static String wizardPageDescription_EjbLocalRef;
+
+    //
+
+    public static String wizardNewTitle_SecurityRole;
+
+    public static String wizardEditTitle_SecurityRole;
+
+    public static String wizardPageTitle_SecurityRole;
+
+    public static String wizardPageDescription_SecurityRole;
+
+    public static String editorSectionSecurityTitle;
+
+    public static String editorSectionSecurityDescription;
+
+    public static String username;
+
+    public static String password;
+
+    static {
+        NLS.initializeMessages(GeronimoUIPlugin.PLUGIN_ID
+                + ".internal.Messages", Messages.class);
+    }
+}
\ No newline at end of file

Added: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/Messages.properties
URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/Messages.properties?rev=280909&view=auto
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/Messages.properties (added)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/Messages.properties Wed Sep 14 11:59:30 2005
@@ -0,0 +1,77 @@
+errorCouldNotOpenFile=Could not open file
+
+editorTitle=Geronimo Deployment Plan Editor
+editorSectionGeneralTitle=General
+editorSectionGeneralDescription=Edit the common deployment settings.
+
+editorSectionSecurityRolesTitle=Security Roles
+editorSectionSecurityRolesDescription=The following security roles are defined:
+
+editorSectionSecurityTitle=Security
+editorSectionSecurityDescription=Specify the security settings.
+username=User ID:
+password=Password:
+
+editorConfigId=Config Id:
+editorParentId=Parent Id:
+editorContextRoot=Context Root:
+securityRealmName=Security realm name:
+editorClassloader=Search order used by the classloader to locate classes:
+editorClassloaderServer=Search the Geronimo server environment first (recomended)
+editorClassloaderWebApp=Search the web app first
+
+editorResourceRefTitle=Resource References
+editorResourceRefDescription=The following resource references are defined:
+editorResRefTargetNameTitle=Target Name
+editorResRefLinkTitle=Resource Link
+editorResRefNameTitle=Reference Name
+
+editorResourceEnvRefTitle=Resource Environment References
+editorResourceEnvRefDescription=The following resource environment references are defined:
+editorResEnvRefNameTitle=Reference Name
+editorResEnvRefMsgDestTitle=Message destination
+
+editorEjbRefDescription = The following ejb references are defined:
+editorEjbRefTitle = EJB References
+editorEjbRefTargetName=Target Name
+editorEjbRefEjbLink=EJB Link
+
+editorEjbLocalRefDescription=The following ejb local refererencs are defined:
+editorEjbLocalRefTitle=EJB Local References
+
+add=Add
+remove=Remove
+edit=Edit
+
+wizardNewTitle_ResRef=New Resource Reference
+wizardEditTitle_ResRef=Edit Resource Reference
+wizardPageTitle_ResRef=Resource Reference Details
+wizardPageDescription_ResRef=Provide details for this resource reference.
+    
+wizardNewTitle_ResEnvRef=New Resource Enviornment Reference
+wizardEditTitle_ResEnvRef=Edit Resource Enviornment Reference
+wizardPageTitle_ResEnvRef=Resource Enviornment Reference Details
+wizardPageDescription_ResEnvRef=Provide details for this resource enviornment reference.
+
+wizardNewTitle_EjbRef=New EJB Reference
+wizardEditTitle_EjbRef=Edit EJB Reference
+wizardPageTitle_EjbRef=EJB Reference Details
+wizardPageDescription_EjbRef=Provide details for this ejb reference.
+
+wizardNewTitle_EjbLocalRef=New EJB Local Reference
+wizardEditTitle_EjbLocalRef=Edit EJB Local Reference
+wizardPageTitle_EjbLocalRef=EJB Reference Local Details
+wizardPageDescription_EjbLocalRef=Provide details for this ejb local reference.
+
+wizardNewTitle_SecurityRole=New Security Role
+wizardEditTitle_SecurityRole=Edit Security Role
+wizardPageTitle_SecurityRole=Security Rolel Details
+wizardPageDescription_SecurityRole=Provide details for this security role.
+
+editorTabGeneral=General
+editorTabNaming=Naming
+editorTabSecurity=Security
+editorTabDependencies=Dependencies
+
+name=Name
+description=Description
\ No newline at end of file

Added: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/Trace.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/Trace.java?rev=280909&view=auto
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/Trace.java (added)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/Trace.java Wed Sep 14 11:59:30 2005
@@ -0,0 +1,84 @@
+/**
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ *  Licensed 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.ui.internal;
+
+/**
+ * Helper class to route trace output.
+ */
+public class Trace {
+    /**
+     * Config trace event.
+     */
+    public static byte CONFIG = 0;
+
+    /**
+     * Warning trace event.
+     */
+    public static byte WARNING = 1;
+
+    /**
+     * Severe trace event.
+     */
+    public static byte SEVERE = 2;
+
+    /**
+     * Finest trace event.
+     */
+    public static byte FINEST = 3;
+
+    /**
+     * Parsing trace event.
+     */
+    public static byte PARSING = 4;
+
+    /**
+     * Trace constructor comment.
+     */
+    private Trace() {
+        super();
+    }
+
+    /**
+     * Trace the given text.
+     * 
+     * @param level
+     *            the trace level
+     * @param s
+     *            a message
+     */
+    public static void trace(byte level, String s) {
+        trace(level, s, null);
+    }
+
+    /**
+     * Trace the given message and exception.
+     * 
+     * @param level
+     *            the trace level
+     * @param s
+     *            a message
+     * @param t
+     *            a throwable
+     */
+    public static void trace(byte level, String s, Throwable t) {
+        if (!GeronimoUIPlugin.getInstance().isDebugging())
+            return;
+
+        System.out.println(GeronimoUIPlugin.PLUGIN_ID + " " + s);
+        if (t != null)
+            t.printStackTrace();
+    }
+}
\ No newline at end of file

Added: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/pages/EjbOverviewPage.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/pages/EjbOverviewPage.java?rev=280909&view=auto
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/pages/EjbOverviewPage.java (added)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/pages/EjbOverviewPage.java Wed Sep 14 11:59:30 2005
@@ -0,0 +1,46 @@
+/**
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ *  Licensed 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.ui.pages;
+
+import org.eclipse.ui.forms.editor.FormEditor;
+import org.eclipse.ui.forms.editor.FormPage;
+
+/**
+ * 
+ *
+ */
+public class EjbOverviewPage extends FormPage {
+
+    /**
+     * @param editor
+     * @param id
+     * @param title
+     */
+    public EjbOverviewPage(FormEditor editor, String id, String title) {
+        super(editor, id, title);
+        // TODO Auto-generated constructor stub
+    }
+
+    /**
+     * @param id
+     * @param title
+     */
+    public EjbOverviewPage(String id, String title) {
+        super(id, title);
+        // TODO Auto-generated constructor stub
+    }
+
+}

Added: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/pages/NamingFormPage.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/pages/NamingFormPage.java?rev=280909&view=auto
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/pages/NamingFormPage.java (added)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/pages/NamingFormPage.java Wed Sep 14 11:59:30 2005
@@ -0,0 +1,87 @@
+/**
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ *  Licensed 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.ui.pages;
+
+import org.apache.geronimo.ui.editors.DPEditor;
+import org.apache.geronimo.ui.sections.EjbLocalRefSection;
+import org.apache.geronimo.ui.sections.EjbRefSection;
+import org.apache.geronimo.ui.sections.ResourceEnvRefSection;
+import org.apache.geronimo.ui.sections.ResourceRefSection;
+import org.apache.geronimo.xml.ns.web.WebAppType;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.editor.FormEditor;
+import org.eclipse.ui.forms.editor.FormPage;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
+import org.eclipse.ui.forms.widgets.ScrolledForm;
+import org.eclipse.ui.forms.widgets.Section;
+
+public class NamingFormPage extends FormPage {
+
+    public NamingFormPage(FormEditor editor, String id, String title) {
+        super(editor, id, title);
+    }
+
+    public NamingFormPage(String id, String title) {
+        super(id, title);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.eclipse.ui.forms.editor.FormPage#createFormContent(org.eclipse.ui.forms.IManagedForm)
+     */
+    protected void createFormContent(IManagedForm managedForm) {
+
+        ScrolledForm form = managedForm.getForm();
+        form.setText(getTitle());
+        GridLayout layout = new GridLayout();
+        layout.numColumns = 2;
+        layout.horizontalSpacing = 20;
+
+        form.getBody().setLayout(layout);
+
+        fillBody(managedForm);
+
+        form.reflow(true);
+
+    }
+
+    private void fillBody(IManagedForm managedForm) {
+
+        WebAppType plan = (WebAppType) ((DPEditor) getEditor()).getDeploymentPlan();
+
+        Composite body = managedForm.getForm().getBody();
+
+        int style = ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED
+                | ExpandableComposite.TITLE_BAR | Section.DESCRIPTION
+                | ExpandableComposite.FOCUS_TITLE;
+
+        managedForm.addPart(new ResourceRefSection(plan, body, managedForm
+                .getToolkit(), style));
+
+        managedForm.addPart(new ResourceEnvRefSection(plan, body, managedForm
+                .getToolkit(), style));
+
+        managedForm.addPart(new EjbRefSection(plan, body, managedForm
+                .getToolkit(), style));
+
+        managedForm.addPart(new EjbLocalRefSection(plan, body, managedForm
+                .getToolkit(), style));
+    }
+
+}

Added: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/pages/SecurityPage.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/pages/SecurityPage.java?rev=280909&view=auto
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/pages/SecurityPage.java (added)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/pages/SecurityPage.java Wed Sep 14 11:59:30 2005
@@ -0,0 +1,62 @@
+package org.apache.geronimo.ui.pages;
+
+import org.apache.geronimo.ui.editors.DPEditor;
+import org.apache.geronimo.ui.sections.SecuritySection;
+import org.apache.geronimo.xml.ns.web.WebAppType;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.editor.FormEditor;
+import org.eclipse.ui.forms.editor.FormPage;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
+import org.eclipse.ui.forms.widgets.ScrolledForm;
+import org.eclipse.ui.forms.widgets.Section;
+
+public class SecurityPage extends FormPage {
+
+    public SecurityPage(FormEditor editor, String id, String title) {
+        super(editor, id, title);
+        // TODO Auto-generated constructor stub
+    }
+
+    public SecurityPage(String id, String title) {
+        super(id, title);
+        // TODO Auto-generated constructor stub
+    }
+    
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.eclipse.ui.forms.editor.FormPage#createFormContent(org.eclipse.ui.forms.IManagedForm)
+     */
+    protected void createFormContent(IManagedForm managedForm) {
+
+        ScrolledForm form = managedForm.getForm();
+        form.setText(getTitle());
+        GridLayout layout = new GridLayout();
+        layout.numColumns = 1;
+        layout.horizontalSpacing = 20;
+
+        form.getBody().setLayout(layout);
+
+        fillBody(managedForm);
+
+        form.reflow(true);
+
+    }
+
+    private void fillBody(IManagedForm managedForm) {
+
+        WebAppType plan = (WebAppType) ((DPEditor) getEditor()).getDeploymentPlan();
+
+        Composite body = managedForm.getForm().getBody();
+
+        int style = ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED
+                | ExpandableComposite.TITLE_BAR | Section.DESCRIPTION
+                | ExpandableComposite.FOCUS_TITLE;
+
+        managedForm.addPart(new SecuritySection(plan, body, managedForm
+                .getToolkit(), style));
+    }
+
+}

Added: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/pages/WebGeneralPage.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/pages/WebGeneralPage.java?rev=280909&view=auto
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/pages/WebGeneralPage.java (added)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/pages/WebGeneralPage.java Wed Sep 14 11:59:30 2005
@@ -0,0 +1,63 @@
+/**
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ *  Licensed 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.ui.pages;
+
+import org.apache.geronimo.ui.editors.DPEditor;
+import org.apache.geronimo.ui.sections.WebGeneralSection;
+import org.apache.geronimo.xml.ns.web.WebAppType;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.editor.FormEditor;
+import org.eclipse.ui.forms.editor.FormPage;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
+import org.eclipse.ui.forms.widgets.ScrolledForm;
+import org.eclipse.ui.forms.widgets.Section;
+
+public class WebGeneralPage extends FormPage {
+
+    public WebGeneralPage(FormEditor editor, String id, String title) {
+        super(editor, id, title);
+    }
+
+    public WebGeneralPage(String id, String title) {
+        super(id, title);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.eclipse.ui.forms.editor.FormPage#createFormContent(org.eclipse.ui.forms.IManagedForm)
+     */
+    protected void createFormContent(IManagedForm managedForm) {
+
+        WebAppType plan = (WebAppType) ((DPEditor) getEditor()).getDeploymentPlan();
+
+        ScrolledForm form = managedForm.getForm();
+        form.setText(getTitle());
+        form.getBody().setLayout(new GridLayout());
+
+        // create web plan general section
+        WebGeneralSection sec = new WebGeneralSection(plan, form.getBody(),
+                managedForm.getToolkit(), ExpandableComposite.TWISTIE
+                        | ExpandableComposite.EXPANDED
+                        | ExpandableComposite.TITLE_BAR | Section.DESCRIPTION
+                        | ExpandableComposite.FOCUS_TITLE);
+        managedForm.addPart(sec);
+
+        form.reflow(true);
+    }
+
+}

Added: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/BeansSection.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/BeansSection.java?rev=280909&view=auto
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/BeansSection.java (added)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/BeansSection.java Wed Sep 14 11:59:30 2005
@@ -0,0 +1,109 @@
+/**
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ *  Licensed 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.ui.sections;
+
+import org.apache.geronimo.ui.wizards.DynamicAddEditWizard;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EFactory;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Section;
+
+/**
+ * 
+ *
+ */
+public class BeansSection extends DynamicTableSection {
+
+    /**
+     * @param section
+     */
+    public BeansSection(Section section) {
+        super(section);
+        // TODO Auto-generated constructor stub
+    }
+
+    /**
+     * @param plan
+     * @param parent
+     * @param toolkit
+     * @param style
+     */
+    public BeansSection(EObject plan, Composite parent, FormToolkit toolkit,
+            int style) {
+        super(plan, parent, toolkit, style);
+        // TODO Auto-generated constructor stub
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.geronimo.ui.sections.DynamicTableSection#getTitle()
+     */
+    public String getTitle() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.geronimo.ui.sections.DynamicTableSection#getDescription()
+     */
+    public String getDescription() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.geronimo.ui.sections.DynamicTableSection#getEFactory()
+     */
+    public EFactory getEFactory() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.geronimo.ui.sections.DynamicTableSection#getEReference()
+     */
+    public EReference getEReference() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.geronimo.ui.sections.DynamicTableSection#getTableColumnNames()
+     */
+    public String[] getTableColumnNames() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.geronimo.ui.sections.DynamicTableSection#getTableColumnEAttributes()
+     */
+    public EAttribute[] getTableColumnEAttributes() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.geronimo.ui.sections.DynamicTableSection#getWizard()
+     */
+    public DynamicAddEditWizard getWizard() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+}

Added: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/DynamicTableSection.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/DynamicTableSection.java?rev=280909&view=auto
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/DynamicTableSection.java (added)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/DynamicTableSection.java Wed Sep 14 11:59:30 2005
@@ -0,0 +1,336 @@
+/**
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ *  Licensed 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.ui.sections;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.geronimo.ui.internal.GeronimoUIPlugin;
+import org.apache.geronimo.ui.internal.Messages;
+import org.apache.geronimo.ui.wizards.DynamicAddEditWizard;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EFactory;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.ColumnWeightData;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TableLayout;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.ui.forms.SectionPart;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Section;
+
+public abstract class DynamicTableSection extends SectionPart {
+
+    private EObject plan;
+
+    protected Table table;
+
+    protected TableViewer tableViewer;
+
+    private ImageDescriptor defaultDescriptor = GeronimoUIPlugin
+            .imageDescriptorFromPlugin("org.apache.geronimo.ui",
+                    "icons/obj16/geronimo.gif");
+
+    private Image defaultImage = defaultDescriptor.createImage();
+
+    public DynamicTableSection(Section section) {
+        super(section);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.eclipse.ui.forms.IFormPart#commit(boolean)
+     * 
+     * Overriding this method as a workaround as switching tabs on a dirty
+     * editor commits the page and marks the part as not dirty.
+     */
+    public void commit(boolean onSave) {
+        boolean currentDirtyState = isDirty();
+        super.commit(onSave);
+        if (!onSave && currentDirtyState) {
+            markDirty();
+        }
+    }
+
+    public DynamicTableSection(EObject plan, Composite parent,
+            FormToolkit toolkit, int style) {
+        super(parent, toolkit, style);
+        this.plan = plan;
+
+        if (isValid()) {
+            createClient(getSection(), toolkit);
+        }
+    }
+
+    private boolean isValid() {
+        return getEFactory() != null && getEReference() != null
+                && getTableColumnEAttributes() != null
+                && getTableColumnNames() != null;
+    }
+
+    public void createClient(Section section, FormToolkit toolkit) {
+
+        section.setText(getTitle());
+        section.setDescription(getDescription());
+
+        configureSection(section);
+
+        Composite composite = createTableComposite(section, toolkit);
+        createTable(composite);
+        fillTableItems();
+
+        tableViewer = new TableViewer(table);
+
+        if (getTableColumnNames().length > 0) {
+            tableViewer.setColumnProperties(getTableColumnNames());
+        }
+
+        Composite buttonComp = createButtonComposite(toolkit, composite);
+        createAddButton(toolkit, buttonComp);
+        createRemoveButton(toolkit, buttonComp);
+        createEditButton(toolkit, buttonComp);
+
+    }
+
+    protected Composite createTableComposite(Section section,
+            FormToolkit toolkit) {
+        Composite composite = toolkit.createComposite(section);
+        GridLayout layout = new GridLayout();
+        layout.numColumns = 3;
+        layout.marginHeight = 5;
+        layout.marginWidth = 10;
+        layout.verticalSpacing = 5;
+        layout.horizontalSpacing = 15;
+        composite.setLayout(layout);
+        composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
+        section.setClient(composite);
+        return composite;
+    }
+
+    protected void configureSection(Section section) {
+        section.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
+    }
+
+    protected void fillTableItems() {
+        EList list = (EList) plan.eGet(getEReference());
+
+        for (int j = 0; j < list.size(); j++) {
+            TableItem item = new TableItem(table, SWT.NONE);
+            String[] tableTextData = getTableText((EObject) list.get(j));
+            item.setImage(getImage());
+            item.setText(tableTextData);
+            item.setData((EObject) list.get(j));
+        }
+    }
+
+    protected void createTable(Composite composite) {
+        table = new Table(composite, SWT.BORDER | SWT.FULL_SELECTION
+                | SWT.V_SCROLL | SWT.SINGLE);
+        if (isHeaderVisible()) {
+            table.setHeaderVisible(true);
+        }
+
+        GridData data = new GridData(SWT.FILL, SWT.FILL, false, false);
+        data.heightHint = 60;
+        data.widthHint = 400;
+        table.setLayoutData(data);
+
+        TableLayout tableLayout = new TableLayout();
+        table.setLayout(tableLayout);
+
+        for (int i = 0; i < getTableColumnNames().length; i++) {
+            tableLayout.addColumnData(new ColumnWeightData(35));
+            TableColumn tableColumn = new TableColumn(table, SWT.NONE);
+            tableColumn.setText(getTableColumnNames()[i]);
+        }
+
+    }
+
+    protected Composite createButtonComposite(FormToolkit toolkit,
+            Composite parent) {
+        GridLayout layout;
+        Composite buttonComp = new Composite(parent, SWT.NONE);
+        layout = new GridLayout();
+        layout.horizontalSpacing = 2;
+        layout.verticalSpacing = 2;
+        layout.marginWidth = 0;
+        layout.marginHeight = 0;
+        layout.numColumns = 1;
+        buttonComp.setLayout(layout);
+        buttonComp.setBackground(toolkit.getColors().getBackground());
+        buttonComp
+                .setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
+        return buttonComp;
+    }
+
+    protected void createRemoveButton(FormToolkit toolkit, Composite buttonComp) {
+        Button del = toolkit
+                .createButton(buttonComp, Messages.remove, SWT.NONE);
+        del.addSelectionListener(new SelectionAdapter() {
+            public void widgetSelected(SelectionEvent e) {
+                int[] selectedIndices = table.getSelectionIndices();
+                for (int i = 0; i < selectedIndices.length; i++) {
+                    TableItem tableItem = table.getItem(selectedIndices[i]);
+                    EObject type = (EObject) (tableItem.getData());
+                    table.remove(selectedIndices[i]);
+                    EcoreUtil.remove(type);
+                    markDirty();
+                }
+            }
+        });
+        del.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+    }
+
+    protected void createAddButton(FormToolkit toolkit, Composite buttonComp) {
+        Button add = toolkit.createButton(buttonComp, Messages.add, SWT.NONE);
+
+        add.addSelectionListener(new SelectionAdapter() {
+            public void widgetSelected(SelectionEvent e) {
+                DynamicAddEditWizard wizard = getWizard();
+                if (wizard != null) {
+                    WizardDialog dialog = new WizardDialog(Display.getCurrent()
+                            .getActiveShell(), wizard);
+
+                    dialog.open();
+
+                    if (dialog.getReturnCode() == Dialog.OK) {
+                        markDirty();
+                    }
+                }
+            }
+        });
+
+        add.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+    }
+
+    protected void createEditButton(FormToolkit toolkit, Composite buttonComp) {
+        Button add = toolkit.createButton(buttonComp, Messages.edit, SWT.NONE);
+
+        add.addSelectionListener(new SelectionAdapter() {
+            public void widgetSelected(SelectionEvent e) {
+                Object o = ((StructuredSelection) getTableViewer()
+                        .getSelection()).getFirstElement();
+
+                if (o != null) {
+
+                    DynamicAddEditWizard wizard = getWizard();
+                    if (wizard != null) {
+                        wizard.setEObject((EObject) o);
+
+                        WizardDialog dialog = new WizardDialog(Display
+                                .getCurrent().getActiveShell(), wizard);
+
+                        dialog.open();
+
+                        if (dialog.getReturnCode() == Dialog.OK) {
+                            markDirty();
+                        }
+                    }
+                }
+
+            }
+        });
+        add.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+    }
+
+    public String[] getTableText(EObject eObject) {
+        List tableText = new ArrayList();
+        for (int i = 0; i < getTableColumnEAttributes().length; i++) {
+            if (getTableColumnEAttributes()[i].getEContainingClass().equals(
+                    eObject.eClass())) {
+                String value = (String) eObject
+                        .eGet(getTableColumnEAttributes()[i]);
+                if (value != null) {
+                    tableText.add(value);
+                } else {
+                    tableText.add("");
+                }
+            }
+        }
+        return (String[]) tableText.toArray(new String[tableText.size()]);
+    }
+
+    public Image getImage() {
+        return defaultImage;
+    }
+
+    public TableViewer getTableViewer() {
+        return tableViewer;
+    }
+
+    public EObject getPlan() {
+        return plan;
+    }
+
+    public boolean isHeaderVisible() {
+        return true;
+    }
+
+    /**
+     * @return
+     */
+    abstract public String getTitle();
+
+    /**
+     * @return
+     */
+    abstract public String getDescription();
+
+    /**
+     * @return
+     */
+    abstract public EFactory getEFactory();
+
+    /**
+     * @return
+     */
+    abstract public EReference getEReference();
+
+    /**
+     * @return
+     */
+    abstract public String[] getTableColumnNames();
+
+    /**
+     * @return
+     */
+    abstract public EAttribute[] getTableColumnEAttributes();
+
+    /**
+     * @return
+     */
+    abstract public DynamicAddEditWizard getWizard();
+
+}

Added: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/EjbLocalRefSection.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/EjbLocalRefSection.java?rev=280909&view=auto
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/EjbLocalRefSection.java (added)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/EjbLocalRefSection.java Wed Sep 14 11:59:30 2005
@@ -0,0 +1,105 @@
+/**
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ *  Licensed 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.ui.sections;
+
+import org.apache.geronimo.ui.internal.Messages;
+import org.apache.geronimo.ui.wizards.DynamicAddEditWizard;
+import org.apache.geronimo.ui.wizards.EjbLocalRefWizard;
+import org.apache.geronimo.xml.ns.naming.NamingFactory;
+import org.apache.geronimo.xml.ns.naming.NamingPackage;
+import org.apache.geronimo.xml.ns.web.WebAppType;
+import org.apache.geronimo.xml.ns.web.WebFactory;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EFactory;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+public class EjbLocalRefSection extends DynamicTableSection {
+
+    public EjbLocalRefSection(WebAppType plan, Composite parent,
+            FormToolkit toolkit, int style) {
+        super(plan, parent, toolkit, style);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.ui.sections.DynamicTableSection#getTitle()
+     */
+    public String getTitle() {
+        return Messages.editorEjbLocalRefTitle;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.ui.sections.DynamicTableSection#getDescription()
+     */
+    public String getDescription() {
+        return Messages.editorEjbLocalRefDescription;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.ui.sections.DynamicTableSection#getEFactory()
+     */
+    public EFactory getEFactory() {
+        return NamingFactory.eINSTANCE;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.ui.sections.DynamicTableSection#getEReference()
+     */
+    public EReference getEReference() {
+        return WebFactory.eINSTANCE.getWebPackage().getWebAppType_EjbLocalRef();
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.ui.sections.DynamicTableSection#getTableColumnNames()
+     */
+    public String[] getTableColumnNames() {
+        return new String[] { Messages.editorEjbRefTargetName,
+                Messages.editorEjbRefEjbLink };
+
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.ui.sections.DynamicTableSection#getTableColumnEAttributes()
+     */
+    public EAttribute[] getTableColumnEAttributes() {
+        return new EAttribute[] {
+                NamingPackage.eINSTANCE.getEjbLocalRefType_TargetName(),
+                NamingPackage.eINSTANCE.getEjbLocalRefType_EjbLink() };
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.ui.sections.DynamicTableSection#getWizard()
+     */
+    public DynamicAddEditWizard getWizard() {
+        return new EjbLocalRefWizard(this);
+    }
+
+}

Added: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/EjbRefSection.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/EjbRefSection.java?rev=280909&view=auto
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/EjbRefSection.java (added)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/EjbRefSection.java Wed Sep 14 11:59:30 2005
@@ -0,0 +1,118 @@
+/**
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ *  Licensed 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.ui.sections;
+
+import org.apache.geronimo.ui.internal.Messages;
+import org.apache.geronimo.ui.wizards.DynamicAddEditWizard;
+import org.apache.geronimo.ui.wizards.EjbRefWizard;
+import org.apache.geronimo.xml.ns.naming.NamingFactory;
+import org.apache.geronimo.xml.ns.naming.NamingPackage;
+import org.apache.geronimo.xml.ns.web.WebFactory;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EFactory;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Section;
+
+public class EjbRefSection extends DynamicTableSection {
+
+    /**
+     * @param section
+     */
+    public EjbRefSection(Section section) {
+        super(section);
+    }
+
+    /**
+     * @param plan
+     * @param parent
+     * @param toolkit
+     * @param style
+     */
+    public EjbRefSection(EObject plan, Composite parent, FormToolkit toolkit,
+            int style) {
+        super(plan, parent, toolkit, style);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.ui.sections.DynamicTableSection#getTitle()
+     */
+    public String getTitle() {
+        return Messages.editorEjbRefTitle;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.ui.sections.DynamicTableSection#getDescription()
+     */
+    public String getDescription() {
+        return Messages.editorEjbRefDescription;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.ui.sections.DynamicTableSection#getEFactory()
+     */
+    public EFactory getEFactory() {
+        return NamingFactory.eINSTANCE;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.ui.sections.DynamicTableSection#getEReference()
+     */
+    public EReference getEReference() {
+        return WebFactory.eINSTANCE.getWebPackage().getWebAppType_EjbRef();
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.ui.sections.DynamicTableSection#getTableColumnNames()
+     */
+    public String[] getTableColumnNames() {
+        return new String[] { Messages.editorEjbRefTargetName,
+                Messages.editorEjbRefEjbLink };
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.ui.sections.DynamicTableSection#getTableColumnEAttributes()
+     */
+    public EAttribute[] getTableColumnEAttributes() {
+        return new EAttribute[] {
+                NamingPackage.eINSTANCE.getEjbRefType_TargetName(),
+                NamingPackage.eINSTANCE.getEjbRefType_EjbLink() };
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.ui.sections.DynamicTableSection#getWizard()
+     */
+    public DynamicAddEditWizard getWizard() {
+        return new EjbRefWizard(this);
+    }
+
+}

Added: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/ResourceEnvRefSection.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/ResourceEnvRefSection.java?rev=280909&view=auto
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/ResourceEnvRefSection.java (added)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/ResourceEnvRefSection.java Wed Sep 14 11:59:30 2005
@@ -0,0 +1,106 @@
+/**
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ *  Licensed 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.ui.sections;
+
+import org.apache.geronimo.ui.internal.Messages;
+import org.apache.geronimo.ui.wizards.DynamicAddEditWizard;
+import org.apache.geronimo.ui.wizards.ResourceEnvRefWizard;
+import org.apache.geronimo.xml.ns.naming.NamingFactory;
+import org.apache.geronimo.xml.ns.naming.NamingPackage;
+import org.apache.geronimo.xml.ns.web.WebAppType;
+import org.apache.geronimo.xml.ns.web.WebFactory;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EFactory;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+public class ResourceEnvRefSection extends DynamicTableSection {
+
+    public ResourceEnvRefSection(WebAppType plan, Composite parent,
+            FormToolkit toolkit, int style) {
+        super(plan, parent, toolkit, style);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.ui.sections.DynamicTableSection#getTitle()
+     */
+    public String getTitle() {
+        return Messages.editorResourceEnvRefTitle;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.ui.sections.DynamicTableSection#getDescription()
+     */
+    public String getDescription() {
+        return Messages.editorResourceEnvRefDescription;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.ui.sections.DynamicTableSection#getEFactory()
+     */
+    public EFactory getEFactory() {
+        return NamingFactory.eINSTANCE;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.ui.sections.DynamicTableSection#getEReference()
+     */
+    public EReference getEReference() {
+        return WebFactory.eINSTANCE.getWebPackage()
+                .getWebAppType_ResourceEnvRef();
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.ui.sections.DynamicTableSection#getTableColumnNames()
+     */
+    public String[] getTableColumnNames() {
+        return new String[] { Messages.editorResEnvRefNameTitle,
+                Messages.editorResEnvRefMsgDestTitle };
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.ui.sections.DynamicTableSection#getTableColumnEAttributes()
+     */
+    public EAttribute[] getTableColumnEAttributes() {
+        return new EAttribute[] {
+                NamingPackage.eINSTANCE.getResourceEnvRefType_RefName(),
+                NamingPackage.eINSTANCE
+                        .getResourceEnvRefType_MessageDestinationLink() };
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.ui.sections.DynamicTableSection#getWizard()
+     */
+    public DynamicAddEditWizard getWizard() {
+        return new ResourceEnvRefWizard(this);
+    }
+
+}

Added: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/ResourceRefSection.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/ResourceRefSection.java?rev=280909&view=auto
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/ResourceRefSection.java (added)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/ResourceRefSection.java Wed Sep 14 11:59:30 2005
@@ -0,0 +1,110 @@
+/**
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ *  Licensed 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.ui.sections;
+
+import org.apache.geronimo.ui.internal.Messages;
+import org.apache.geronimo.ui.wizards.DynamicAddEditWizard;
+import org.apache.geronimo.ui.wizards.ResourceRefWizard;
+import org.apache.geronimo.xml.ns.naming.NamingFactory;
+import org.apache.geronimo.xml.ns.naming.NamingPackage;
+import org.apache.geronimo.xml.ns.web.WebAppType;
+import org.apache.geronimo.xml.ns.web.WebFactory;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EFactory;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+public class ResourceRefSection extends DynamicTableSection {
+
+    public ResourceRefSection(WebAppType plan, Composite parent,
+            FormToolkit toolkit, int style) {
+        super(plan, parent, toolkit, style);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.ui.sections.DynamicTableSection#getTitle()
+     */
+    public String getTitle() {
+        return Messages.editorResourceRefTitle;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.ui.sections.DynamicTableSection#getDescription()
+     */
+    public String getDescription() {
+        return Messages.editorResourceRefDescription;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.ui.sections.DynamicTableSection#getEFactory()
+     */
+    public EFactory getEFactory() {
+        return NamingFactory.eINSTANCE;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.ui.sections.DynamicTableSection#getEReference()
+     */
+    public EReference getEReference() {
+        return WebFactory.eINSTANCE.getWebPackage().getWebAppType_ResourceRef();
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.ui.sections.DynamicTableSection#getTableColumnNames()
+     */
+    public String[] getTableColumnNames() {
+        return new String[] { Messages.editorResRefNameTitle,
+                Messages.editorResRefLinkTitle,
+                Messages.editorResRefTargetNameTitle };
+    }
+
+    public Class getWizardClass() {
+        return ResourceRefWizard.class;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.ui.sections.DynamicTableSection#getTableColumnEAttributes()
+     */
+    public EAttribute[] getTableColumnEAttributes() {
+        return new EAttribute[] {
+                NamingPackage.eINSTANCE.getResourceRefType_RefName(),
+                NamingPackage.eINSTANCE.getResourceRefType_ResourceLink(),
+                NamingPackage.eINSTANCE.getResourceRefType_TargetName() };
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.ui.sections.DynamicTableSection#getWizard()
+     */
+    public DynamicAddEditWizard getWizard() {
+        return new ResourceRefWizard(this);
+    }
+
+}

Added: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/SecuritySection.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/SecuritySection.java?rev=280909&view=auto
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/SecuritySection.java (added)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/SecuritySection.java Wed Sep 14 11:59:30 2005
@@ -0,0 +1,235 @@
+/**
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ *  Licensed 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.ui.sections;
+
+import org.apache.geronimo.ui.internal.Messages;
+import org.apache.geronimo.ui.wizards.DynamicAddEditWizard;
+import org.apache.geronimo.ui.wizards.SecurityRoleWizard;
+import org.apache.geronimo.xml.ns.security.DescriptionType;
+import org.apache.geronimo.xml.ns.security.RoleType;
+import org.apache.geronimo.xml.ns.security.SecurityFactory;
+import org.apache.geronimo.xml.ns.security.SecurityPackage;
+import org.apache.geronimo.xml.ns.security.SecurityType;
+import org.apache.geronimo.xml.ns.web.WebAppType;
+import org.apache.geronimo.xml.ns.web.impl.WebPackageImpl;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EFactory;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Section;
+
+/**
+ * 
+ * 
+ */
+public class SecuritySection extends DynamicTableSection {
+
+    public static EReference securityERef = WebPackageImpl.eINSTANCE
+            .getWebAppType_Security();
+
+    /**
+     * @param plan
+     * @param parent
+     * @param toolkit
+     * @param style
+     */
+    public SecuritySection(WebAppType plan, Composite parent,
+            FormToolkit toolkit, int style) {
+        super(plan, parent, toolkit, style);
+
+    }
+
+    /**
+     * @return
+     */
+    public String getTitle() {
+        return Messages.editorSectionSecurityRolesTitle;
+    }
+
+    /**
+     * @return
+     */
+    public String getDescription() {
+        return Messages.editorSectionSecurityRolesDescription;
+    }
+
+    /**
+     * @return
+     */
+    public EFactory getEFactory() {
+        return SecurityFactory.eINSTANCE;
+    }
+
+    /**
+     * @return
+     */
+    public EReference getEReference() {
+        return SecurityFactory.eINSTANCE.getSecurityPackage()
+                .getRoleMappingsType_Role();
+    }
+
+    /**
+     * @return
+     */
+    public String[] getTableColumnNames() {
+        return new String[] { Messages.name, Messages.description };
+    }
+
+    /**
+     * @return
+     */
+    public EAttribute[] getTableColumnEAttributes() {
+        return new EAttribute[] {
+                SecurityPackage.eINSTANCE.getRoleType_RoleName(),
+                SecurityPackage.eINSTANCE.getDescriptionType_Lang() };
+    }
+
+    /**
+     * @return
+     */
+    public DynamicAddEditWizard getWizard() {
+        return new SecurityRoleWizard(this);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.ui.sections.DynamicTableSection#configureSection(org.eclipse.ui.forms.widgets.Section)
+     */
+    protected void configureSection(Section section) {
+        section.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.ui.sections.DynamicTableSection#showTableColumNames()
+     */
+    public boolean isHeaderVisible() {
+        return false;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.ui.sections.DynamicTableSection#createClient(org.eclipse.ui.forms.widgets.Section,
+     *      org.eclipse.ui.forms.widgets.FormToolkit)
+     */
+    public void createClient(Section section, FormToolkit toolkit) {
+
+        super.createClient(section, toolkit);
+
+        Composite detail = toolkit.createComposite(table.getParent());
+        GridLayout gl = new GridLayout();
+        gl.marginWidth = 4;
+        gl.marginHeight = 8;
+        gl.numColumns = 2;
+        detail.setLayout(gl);
+        detail.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+
+        Label roleNameLabel = toolkit.createLabel(detail, Messages.name + ":");
+        roleNameLabel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false,
+                false));
+        roleNameLabel.setEnabled(true);
+
+        Text roleNameText = toolkit.createText(detail, "", SWT.BORDER);
+        roleNameText
+                .setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+        roleNameText.setEnabled(true);
+
+        Label roleDescriptionLabel = toolkit.createLabel(detail,
+                Messages.description + ":");
+        roleDescriptionLabel.setLayoutData(new GridData(SWT.FILL, SWT.FILL,
+                false, false));
+        roleDescriptionLabel.setEnabled(true);
+
+        Text roleDescriptionText = toolkit.createText(detail, "", SWT.MULTI
+                | SWT.BORDER);
+        GridData data = new GridData(SWT.FILL, SWT.FILL, true, false);
+        data.heightHint = 50;
+        roleDescriptionText.setLayoutData(data);
+        roleDescriptionText.setEnabled(true);
+
+        table.addSelectionListener(new TableSelectionListener(roleNameText,
+                roleDescriptionText));
+
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.ui.sections.DynamicTableSection#fillTableItems()
+     */
+    protected void fillTableItems() {
+
+        SecurityType secType = (SecurityType) getPlan().eGet(securityERef);
+
+        if (secType != null) {
+
+            EList list = (EList) (secType.getRoleMappings().getRole());
+
+            for (int j = 0; j < list.size(); j++) {
+                TableItem item = new TableItem(table, SWT.NONE);
+                String[] tableTextData = getTableText((EObject) list.get(j));
+                item.setImage(getImage());
+                item.setText(tableTextData);
+                item.setData((EObject) list.get(j));
+            }
+        }
+    }
+
+    class TableSelectionListener implements SelectionListener {
+
+        Text roleName;
+
+        Text description;
+
+        public TableSelectionListener(Text roleName, Text description) {
+            this.roleName = roleName;
+            this.description = description;
+        }
+
+        public void widgetSelected(SelectionEvent e) {
+            TableItem item = (TableItem) e.item;
+            RoleType roleType = (RoleType) item.getData();
+            roleName.setText(roleType.getRoleName());
+
+            if (!roleType.getDescription().isEmpty()) {
+                description.setText(((DescriptionType) roleType
+                        .getDescription().get(0)).getLang());
+            } else {
+                description.setText("");
+            }
+        }
+
+        public void widgetDefaultSelected(SelectionEvent e) {
+            // do nothing
+        }
+
+    }
+
+}

Added: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/ServerSecurityEditorSection.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/ServerSecurityEditorSection.java?rev=280909&view=auto
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/ServerSecurityEditorSection.java (added)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/ServerSecurityEditorSection.java Wed Sep 14 11:59:30 2005
@@ -0,0 +1,150 @@
+/**
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ *  Licensed 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.ui.sections;
+
+import org.apache.geronimo.core.internal.GeronimoServer;
+import org.apache.geronimo.ui.commands.SetPasswordCommand;
+import org.apache.geronimo.ui.commands.SetUsernameCommand;
+import org.apache.geronimo.ui.internal.Messages;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.forms.FormColors;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Section;
+import org.eclipse.wst.server.ui.editor.ServerEditorSection;
+
+/**
+ * 
+ * 
+ */
+public class ServerSecurityEditorSection extends ServerEditorSection {
+
+    Text username;
+
+    Text password;
+
+    GeronimoServer gs;
+
+    /**
+     * 
+     */
+    public ServerSecurityEditorSection() {
+        super();
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.eclipse.wst.server.ui.editor.ServerEditorSection#createSection(org.eclipse.swt.widgets.Composite)
+     */
+    public void createSection(Composite parent) {
+        super.createSection(parent);
+
+        FormToolkit toolkit = getFormToolkit(parent.getDisplay());
+
+        Section section = toolkit.createSection(parent,
+                ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED
+                        | ExpandableComposite.TITLE_BAR | Section.DESCRIPTION
+                        | ExpandableComposite.FOCUS_TITLE);
+
+        section.setText(Messages.editorSectionSecurityTitle);
+        section.setDescription(Messages.editorSectionSecurityDescription);
+        section.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
+
+        Composite composite = toolkit.createComposite(section);
+        GridLayout layout = new GridLayout();
+        layout.numColumns = 2;
+        layout.marginHeight = 5;
+        layout.marginWidth = 10;
+        layout.verticalSpacing = 5;
+        layout.horizontalSpacing = 15;
+        composite.setLayout(layout);
+        composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+        section.setClient(composite);
+
+        // ------- Label and text field for the username -------
+        createLabel(composite, Messages.username, toolkit);
+
+        username = toolkit.createText(composite, getUserName(), SWT.BORDER);
+        username.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+        username.addModifyListener(new ModifyListener() {
+            public void modifyText(ModifyEvent e) {
+                execute(new SetUsernameCommand(server, username.getText()));
+            }
+        });
+
+        // ------- Label and text field for the password -------
+        createLabel(composite, Messages.password, toolkit);
+
+        password = toolkit.createText(composite, getPassword(), SWT.BORDER);
+        password
+                .setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
+        password.addModifyListener(new ModifyListener() {
+            public void modifyText(ModifyEvent e) {
+                execute(new SetPasswordCommand(server, password.getText()));
+            }
+        });
+
+    }
+
+    protected Label createLabel(Composite parent, String text,
+            FormToolkit toolkit) {
+        Label label = toolkit.createLabel(parent, text);
+        label.setForeground(toolkit.getColors().getColor(FormColors.TITLE));
+        label.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+        return label;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.eclipse.wst.server.ui.editor.ServerEditorSection#init(org.eclipse.ui.IEditorSite,
+     *      org.eclipse.ui.IEditorInput)
+     */
+    public void init(IEditorSite site, IEditorInput input) {
+        super.init(site, input);
+        gs = (GeronimoServer) server.getAdapter(GeronimoServer.class);
+        if (gs == null) {
+            gs = (GeronimoServer) server.loadAdapter(GeronimoServer.class,
+                    new NullProgressMonitor());
+        }
+    }
+
+    private String getUserName() {
+        if (gs != null) {
+            return gs.getAdminID();
+        }
+        return "";
+    }
+
+    private String getPassword() {
+        if (gs != null) {
+            return gs.getAdminPassword();
+        }
+        return "";
+    }
+
+}



Mime
View raw message