geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From de...@apache.org
Subject svn commit: r921247 [5/11] - in /geronimo/devtools/eclipse-plugin/trunk: ./ features/org.apache.geronimo.v30.feature/ plugins/org.apache.geronimo.runtime.v30/ plugins/org.apache.geronimo.runtime.v30/META-INF/ plugins/org.apache.geronimo.st.v30.core/ pl...
Date Wed, 10 Mar 2010 08:31:32 GMT
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/EjbOverviewPage.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/EjbOverviewPage.java?rev=921247&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/EjbOverviewPage.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/EjbOverviewPage.java Wed Mar 10 08:31:28 2010
@@ -0,0 +1,49 @@
+/*
+ * 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.pages.AbstractGeronimoFormPage;
+import org.apache.geronimo.st.v21.core.GeronimoServerInfo;
+import org.apache.geronimo.st.v21.ui.sections.OpenEjbJarCMPSection;
+import org.apache.geronimo.st.v21.ui.sections.OpenEjbJarGeneralSection;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.editor.FormEditor;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class EjbOverviewPage extends AbstractGeronimoFormPage {
+
+    public EjbOverviewPage(FormEditor editor, String id, String title) {
+        super(editor, id, title);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.st.ui.pages.AbstractGeronimoFormPage#fillBody(org.eclipse.ui.forms.IManagedForm)
+     */
+    protected void fillBody(IManagedForm managedForm) {
+        managedForm.addPart(new OpenEjbJarGeneralSection(body, toolkit, getStyle(), getDeploymentPlan()));
+        managedForm.addPart(new OpenEjbJarCMPSection(body, toolkit, getStyle(), getDeploymentPlan()));
+    }
+
+    @Override
+    protected void triggerGeronimoServerInfoUpdate() {
+        GeronimoServerInfo.getInstance().updateInfo();
+    }
+}

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

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

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

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.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.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/NamingFormPage.java?rev=921247&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/NamingFormPage.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/NamingFormPage.java Wed Mar 10 08:31:28 2010
@@ -0,0 +1,103 @@
+/*
+ * 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.jee.applicationclient.ApplicationClient;
+import org.apache.geronimo.jee.openejb.OpenejbJar;
+import org.apache.geronimo.jee.web.WebApp;
+import org.apache.geronimo.st.ui.CommonMessages;
+import org.apache.geronimo.st.ui.editors.AbstractGeronimoDeploymentPlanEditor;
+import org.apache.geronimo.st.ui.pages.AbstractGeronimoFormPage;
+import org.apache.geronimo.st.v21.core.GeronimoServerInfo;
+import org.apache.geronimo.st.v21.ui.sections.EjbLocalRefSection;
+import org.apache.geronimo.st.v21.ui.sections.EjbRefSection;
+import org.apache.geronimo.st.v21.ui.sections.EjbRelationSection;
+import org.apache.geronimo.st.v21.ui.sections.GBeanRefSection;
+import org.apache.geronimo.st.v21.ui.sections.MessageDestSection;
+import org.apache.geronimo.st.v21.ui.sections.PersContextRefSection;
+import org.apache.geronimo.st.v21.ui.sections.PersUnitRefSection;
+import org.apache.geronimo.st.v21.ui.sections.ResourceEnvRefSection;
+import org.apache.geronimo.st.v21.ui.sections.ResourceRefSection;
+import org.apache.geronimo.st.v21.ui.sections.ServiceRefSection;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.editor.FormEditor;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class NamingFormPage extends AbstractGeronimoFormPage {
+
+    public NamingFormPage(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) {
+        if (WebApp.class.isInstance (getDeploymentPlan().getValue())) {
+            WebApp webapp = (WebApp)((AbstractGeronimoDeploymentPlanEditor) getEditor()).getDeploymentPlan().getValue();
+            managedForm.addPart(new EjbRefSection(getDeploymentPlan(), body, toolkit, getStyle(), webapp.getEjbRef()));
+            managedForm.addPart(new ResourceRefSection(getDeploymentPlan(), body, toolkit, getStyle(), webapp.getResourceRef()));
+            managedForm.addPart(new ServiceRefSection(getDeploymentPlan(), body, toolkit, getStyle(), webapp.getServiceRef()));
+            managedForm.addPart(new ResourceEnvRefSection(getDeploymentPlan(), body, toolkit, getStyle(), webapp.getResourceEnvRef()));
+            managedForm.addPart(new EjbLocalRefSection(getDeploymentPlan(), body, toolkit, getStyle(), webapp.getEjbLocalRef()));
+            managedForm.addPart(new GBeanRefSection(getDeploymentPlan(), body, toolkit, getStyle(), webapp.getAbstractNamingEntry()));
+            managedForm.addPart(new PersContextRefSection(getDeploymentPlan(), body, toolkit, getStyle(), webapp.getAbstractNamingEntry()));
+            managedForm.addPart(new PersUnitRefSection(getDeploymentPlan(), body, toolkit, getStyle(), webapp.getAbstractNamingEntry()));
+            managedForm.addPart(new MessageDestSection(getDeploymentPlan(), body, toolkit, getStyle(), webapp.getMessageDestination()));
+        }
+        else if (ApplicationClient.class.isInstance (getDeploymentPlan().getValue())){
+            ApplicationClient appClient = (ApplicationClient)((AbstractGeronimoDeploymentPlanEditor) getEditor()).getDeploymentPlan().getValue();
+            managedForm.addPart(new EjbRefSection(getDeploymentPlan(), body, toolkit, getStyle(), appClient.getEjbRef()));
+            managedForm.addPart(new ResourceRefSection(getDeploymentPlan(), body, toolkit, getStyle(), appClient.getResourceRef()));
+            managedForm.addPart(new ServiceRefSection(getDeploymentPlan(), body, toolkit, getStyle(), appClient.getServiceRef()));
+            managedForm.addPart(new ResourceEnvRefSection(getDeploymentPlan(), body, toolkit, getStyle(), appClient.getResourceEnvRef()));
+            managedForm.addPart(new GBeanRefSection(getDeploymentPlan(), body, toolkit, getStyle(), appClient.getGbeanRef()));
+            managedForm.addPart(new MessageDestSection(getDeploymentPlan(), body, toolkit, getStyle(), appClient.getMessageDestination()));
+        }
+        else if (OpenejbJar.class.isInstance (getDeploymentPlan().getValue())){
+            OpenejbJar ejbJar = (OpenejbJar)((AbstractGeronimoDeploymentPlanEditor) getEditor()).getDeploymentPlan().getValue();
+            managedForm.addPart(new EjbRelationSection(getDeploymentPlan(), body, toolkit, getStyle(), ejbJar.getRelationships()));
+            managedForm.addPart(new MessageDestSection(getDeploymentPlan(), body, toolkit, getStyle(), ejbJar.getMessageDestination()));
+        }
+    }
+    
+    protected GridLayout getLayout() {
+        GridLayout layout = new GridLayout();
+        layout.numColumns = 1;
+        layout.horizontalSpacing = 20;
+        return layout;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.ui.pages.AbstractGeronimoFormPage#getFormTitle()
+     */
+    public String getFormTitle() {
+        return CommonMessages.namingFormPageTitle;
+    }
+
+    @Override
+    protected void triggerGeronimoServerInfoUpdate() {
+        GeronimoServerInfo.getInstance().updateInfo();
+    }
+}

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

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

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

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/SecurityPage.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/SecurityPage.java?rev=921247&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/SecurityPage.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/SecurityPage.java Wed Mar 10 08:31:28 2010
@@ -0,0 +1,75 @@
+/*
+ * 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.core.GeronimoServerInfo;
+import org.apache.geronimo.st.v21.core.jaxb.JAXBModelUtils;
+import org.apache.geronimo.st.v21.ui.sections.SecurityAdvancedSection;
+import org.apache.geronimo.st.v21.ui.sections.SecurityRealmSection;
+import org.apache.geronimo.st.v21.ui.sections.SecurityRoleMappingSection;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.editor.FormEditor;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class SecurityPage extends AbstractGeronimoFormPage {
+
+    public SecurityPage(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 SecurityRealmSection(getDeploymentPlan(),JAXBModelUtils.getGbeans(getDeploymentPlan()), body, toolkit, getStyle()));	
+        managedForm.addPart(new SecurityRoleMappingSection(getDeploymentPlan(), getDeploymentDescriptor(), body, toolkit, getStyle()));
+        managedForm.addPart(new SecurityAdvancedSection(getDeploymentPlan(), body, toolkit, getStyle()));
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.ui.pages.AbstractGeronimoFormPage#getLayout()
+     */
+    protected GridLayout getLayout() {
+        GridLayout layout = super.getLayout();
+        layout.numColumns = 1;
+        return layout;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.ui.pages.AbstractGeronimoFormPage#getFormTitle()
+     */
+    public String getFormTitle() {
+        return CommonMessages.securityPageTitle;
+    }
+
+    @Override
+    protected void triggerGeronimoServerInfoUpdate() {
+        GeronimoServerInfo.getInstance().updateInfo();
+    }
+
+}

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

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

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

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/ServerPluginPage.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/ServerPluginPage.java?rev=921247&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/ServerPluginPage.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/ServerPluginPage.java Wed Mar 10 08:31:28 2010
@@ -0,0 +1,112 @@
+/*
+ * 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.internal.Messages;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jface.fieldassist.ControlDecoration;
+import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.forms.ManagedForm;
+import org.eclipse.ui.forms.widgets.*;
+import org.eclipse.wst.server.ui.editor.*;
+import org.eclipse.wst.server.ui.internal.ImageResource;
+
+/**
+ * Server advanced editor page.
+ *
+ * @version $Rev$ $Date$
+ */
+public class ServerPluginPage extends ServerEditorPart {
+    protected ManagedForm managedForm;
+
+    /**
+     * ServerAdvancedPage constructor comment.
+     */
+    public ServerPluginPage() {
+        super();
+    }
+
+    /**
+     * Creates the SWT controls for this workbench part.
+     *
+     * @param parent the parent control
+     */
+    public final void createPartControl(final Composite parent) {
+        managedForm = new ManagedForm(parent);
+        setManagedForm(managedForm);
+        ScrolledForm form = managedForm.getForm();
+        FormToolkit toolkit = managedForm.getToolkit();
+        toolkit.decorateFormHeading(form.getForm());
+        form.setText(Messages.plugin);
+        form.setImage(ImageResource.getImage(ImageResource.IMG_SERVER));
+        form.getBody().setLayout(new GridLayout());
+
+        insertSections(form.getBody(), "org.eclipse.wst.server.editor.plugins");
+
+        form.reflow(true);
+    }
+
+    public void dispose() {
+        super.dispose();
+
+        if (managedForm != null) {
+            managedForm.dispose();
+            managedForm = null;
+        }
+    }
+
+    /* (non-Javadoc)
+     * Initializes the editor part with a site and input.
+     */
+    public void init(IEditorSite site, IEditorInput input) {
+        super.init(site, input);
+    }
+
+    protected void updateDecoration(ControlDecoration decoration, IStatus status) {
+        if (status != null) {
+            Image newImage = null;
+            FieldDecorationRegistry registry = FieldDecorationRegistry.getDefault();
+            switch (status.getSeverity()) {
+                case IStatus.INFO:
+                    newImage = registry.getFieldDecoration(FieldDecorationRegistry.DEC_REQUIRED).getImage();
+                    break;
+                case IStatus.WARNING:
+                    newImage = registry.getFieldDecoration(FieldDecorationRegistry.DEC_WARNING).getImage();
+                    break;
+                case IStatus.ERROR:
+                    newImage = registry.getFieldDecoration(FieldDecorationRegistry.DEC_ERROR).getImage();
+            }
+            decoration.setDescriptionText(status.getMessage());
+            decoration.setImage(newImage);
+            decoration.show();
+        } else {
+            decoration.setDescriptionText(null);
+            decoration.hide();
+        }
+    }
+
+    /*
+     * @see IWorkbenchPart#setFocus()
+     */
+    public void setFocus() {
+    }
+}

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

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

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

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/WebGeneralPage.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/WebGeneralPage.java?rev=921247&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/WebGeneralPage.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/WebGeneralPage.java Wed Mar 10 08:31:28 2010
@@ -0,0 +1,59 @@
+/*
+ * 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.core.GeronimoServerInfo;
+import org.apache.geronimo.st.v21.ui.sections.WebContainerSection;
+import org.apache.geronimo.st.v21.ui.sections.WebGeneralSection;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.editor.FormEditor;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class WebGeneralPage extends AbstractGeronimoFormPage {
+
+    public WebGeneralPage(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 WebGeneralSection(body, toolkit, getStyle(), getDeploymentPlan()));
+        managedForm.addPart(new WebContainerSection(body, toolkit, getStyle(), getDeploymentPlan()));
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.ui.pages.AbstractGeronimoFormPage#getFormTitle()
+     */
+    public String getFormTitle() {
+        return CommonMessages.webGeneralPageTitle;
+    }
+
+    @Override
+    protected void triggerGeronimoServerInfoUpdate() {
+        GeronimoServerInfo.getInstance().updateInfo();
+    }
+}

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

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

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

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/AdminObjectSection.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/AdminObjectSection.java?rev=921247&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/AdminObjectSection.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/AdminObjectSection.java Wed Mar 10 08:31:28 2010
@@ -0,0 +1,163 @@
+/*
+ * 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.jee.connector.Adminobject;
+import org.apache.geronimo.jee.connector.AdminobjectInstance;
+import org.apache.geronimo.jee.connector.ConfigPropertySetting;
+import org.apache.geronimo.st.ui.CommonMessages;
+import org.apache.geronimo.st.ui.sections.AbstractTreeSection;
+import org.apache.geronimo.st.v21.ui.Activator;
+import org.apache.geronimo.st.v21.ui.wizards.AdminObjectWizard;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class AdminObjectSection extends AbstractTreeSection {
+    public AdminObjectSection(JAXBElement plan, Composite parent, FormToolkit toolkit, int style, List adminObjects) {
+        super(plan, parent, toolkit, style);
+        this.objectContainer = adminObjects;
+        createClient();
+    }
+
+    @Override
+    public String getTitle() {
+        return CommonMessages.editorSectionAdminObjectTitle;
+    }
+
+    @Override
+    public String getDescription() {
+        return CommonMessages.editorSectionAdminObjectDescription;
+    }
+
+    @Override
+    public Wizard getWizard() {
+        return new AdminObjectWizard(this);
+    }
+
+    @Override
+    public Class getTableEntryObjectType() {
+        return Adminobject.class;
+    }
+
+    @Override
+    protected void activateAddButton() {
+        if (tree.getSelectionCount() == 0 || tree.getSelection()[0].getParentItem() == null ||
+            tree.getSelection()[0].getParentItem().getParentItem() == null) {
+            addButton.setEnabled(true);
+        } else {
+            addButton.setEnabled(false);
+        }
+    }
+
+    public Object getSelectedObject () {
+        if (tree.getSelection().length == 0) {
+            return null;
+        }
+        return tree.getSelection()[0].getData();
+    }
+
+    @Override
+    public void removeItem(Object anItem) {
+        if (Adminobject.class.isInstance(anItem)) {
+            getObjectContainer().remove(anItem);
+        }
+        else if (AdminobjectInstance.class.isInstance(anItem)) {
+            Adminobject admin = (Adminobject)tree.getSelection()[0].getParentItem().getData();
+            admin.getAdminobjectInstance().remove(anItem);
+        }
+        else if (ConfigPropertySetting.class.isInstance(anItem)) {
+            AdminobjectInstance aoInstance = (AdminobjectInstance)tree.getSelection()[0].getParentItem().getData();
+            aoInstance.getConfigPropertySetting().remove(anItem);
+        }
+    }
+    
+    @Override
+    public Object getInput() {
+        if (objectContainer != null) {
+            return objectContainer;
+        }
+        return super.getInput();
+    }
+
+    @Override
+    public ITreeContentProvider getContentProvider() {
+        return new ContentProvider() {
+            @Override
+            public Object[] getElements(Object inputElement) {
+                return getChildren(inputElement);
+            }
+
+            @Override
+            public Object[] getChildren(Object parentElement) {
+                if (List.class.isInstance(parentElement)) {
+                    return ((List)parentElement).toArray();
+                }
+                if (Adminobject.class.isInstance(parentElement)) {
+                    Adminobject admin = (Adminobject)parentElement;
+                    return admin.getAdminobjectInstance().toArray();
+                }
+                if (AdminobjectInstance.class.isInstance(parentElement)) {
+                    AdminobjectInstance aoInstance = (AdminobjectInstance)parentElement;
+                    return aoInstance.getConfigPropertySetting().toArray();
+                }
+                return new String[] {};
+            }
+        };
+    }
+
+    @Override
+    public ILabelProvider getLabelProvider() {
+        return new LabelProvider() {
+            @Override
+            public String getText(Object element) {
+                if (Adminobject.class.isInstance(element)) {
+                    Adminobject admin = (Adminobject)element;
+                    return "Admin Object: interface = \"" + admin.getAdminobjectInterface() +
+                            "\", class = \"" + admin.getAdminobjectClass() + "\"";
+                }
+                if (AdminobjectInstance.class.isInstance(element)) {
+                    AdminobjectInstance aoInstance = (AdminobjectInstance)element;
+                    return "Admin Object Instance: message destination name = \"" + aoInstance.getMessageDestinationName() + "\"";
+                }
+                if (ConfigPropertySetting.class.isInstance(element)) {
+                    ConfigPropertySetting property = (ConfigPropertySetting)element;
+                    return "Config Property Setting: name = \"" + property.getName() +
+                            "\", value = \"" + property.getValue() + "\"";
+                }
+
+                return null;
+            }
+
+            @Override
+            public Image getImage(Object arg0) {
+                return Activator.imageDescriptorFromPlugin("org.eclipse.jst.j2ee",
+                        "icons/full/obj16/module_web_obj.gif").createImage();
+            }
+        };
+    }
+}

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

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

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

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.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.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/AppClientClientGeneralSection.java?rev=921247&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/AppClientClientGeneralSection.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/AppClientClientGeneralSection.java Wed Mar 10 08:31:28 2010
@@ -0,0 +1,95 @@
+/*
+ * 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.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class AppClientClientGeneralSection extends CommonGeneralSection {
+
+    protected Text callbackHandler;
+    protected Text realmName;
+    ApplicationClient plan;
+
+    public AppClientClientGeneralSection(Composite parent, FormToolkit toolkit, int style, JAXBElement plan) {
+        super(parent, toolkit, style, plan);
+        this.plan = (ApplicationClient) plan.getValue();
+        createClient();
+    }
+
+    protected void createClient() {
+        super.createClient();
+        Composite composite = (Composite) getSection().getClient();
+
+        createLabel(composite, CommonMessages.editorCallbackHandler);
+
+        callbackHandler = toolkit.createText(composite, plan.getCallbackHandler(), SWT.BORDER);
+        callbackHandler.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
+        callbackHandler.addModifyListener(new ModifyListener() {
+            public void modifyText(ModifyEvent e) {
+                plan.setCallbackHandler(callbackHandler.getText());
+                markDirty();
+            }
+        });
+
+        createLabel(composite, CommonMessages.editorRealmName);
+
+        realmName = toolkit.createText(composite, plan.getRealmName(), SWT.BORDER);
+        realmName.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
+        realmName.addModifyListener(new ModifyListener() {
+            public void modifyText(ModifyEvent e) {
+                plan.setRealmName(realmName.getText());
+                markDirty();
+            }
+        });
+    }
+
+    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.v30.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.v30.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.v30.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.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/AppClientSecuritySection.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/AppClientSecuritySection.java?rev=921247&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/AppClientSecuritySection.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/AppClientSecuritySection.java Wed Mar 10 08:31:28 2010
@@ -0,0 +1,132 @@
+/*
+ * 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.security.Description;
+import org.apache.geronimo.jee.security.ObjectFactory;
+import org.apache.geronimo.jee.security.SubjectInfo;
+import org.apache.geronimo.st.ui.CommonMessages;
+import org.apache.geronimo.st.ui.sections.AbstractSectionPart;
+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.Text;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Section;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class AppClientSecuritySection extends AbstractSectionPart {
+
+    protected Text realm;
+
+    protected Text subjectId;
+
+    protected Text description;
+    
+	ObjectFactory securityFactory;
+    
+    public AppClientSecuritySection(Composite parent, FormToolkit toolkit, int style, JAXBElement plan) {
+        super(parent, toolkit, style, plan);
+        securityFactory = new ObjectFactory();
+        createClient();
+    }
+
+    protected void createClient() {
+
+        Section section = getSection();
+
+        section.setText(getSectionGeneralTitle());
+        section.setDescription(getSectionGeneralDescription());
+        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);
+
+        createLabel(composite, CommonMessages.editorSubjectId);
+
+        subjectId = toolkit.createText(composite, getDefaultSubject().getId(), SWT.BORDER);
+        subjectId.setLayoutData(createTextFieldGridData());
+        subjectId.addModifyListener(new ModifyListener() {
+            public void modifyText(ModifyEvent e) {
+                getDefaultSubject().setId(subjectId.getText());
+                markDirty();
+            }
+        });
+
+        createLabel(composite, CommonMessages.editorRealmName);
+
+        realm = toolkit.createText(composite, getDefaultSubject().getRealm(), SWT.BORDER);
+        realm.setLayoutData(createTextFieldGridData());
+        realm.addModifyListener(new ModifyListener() {
+            public void modifyText(ModifyEvent e) {
+                getDefaultSubject().setRealm(realm.getText());
+                markDirty();
+            }
+        });
+
+        createLabel(composite, CommonMessages.description);
+
+        if (getDefaultSubject().getDescription().size() > 0)
+            description = toolkit.createText(composite, getDefaultSubject().getDescription().get(0).getValue(), SWT.BORDER);
+        else
+            description = toolkit.createText(composite, "", SWT.BORDER);
+        description.setLayoutData(createTextFieldGridData());
+        description.addModifyListener(new ModifyListener() {
+            public void modifyText(ModifyEvent e) {
+            	Description descText = securityFactory.createDescription();
+            	descText.setValue(description.getText());
+            	getDefaultSubject().getDescription().clear();
+                getDefaultSubject().getDescription().add(descText);
+                markDirty();
+            }
+        });
+    }
+
+    private SubjectInfo getDefaultSubject () {
+    	ApplicationClient client = (ApplicationClient)getPlan().getValue();
+    	SubjectInfo subjectInfo = client.getDefaultSubject();
+    	if (subjectInfo == null) {
+    	    subjectInfo = securityFactory.createSubjectInfo();
+    	    client.setDefaultSubject(subjectInfo);
+    	}
+    	return subjectInfo;
+    }
+
+    protected String getSectionGeneralTitle() {
+        return CommonMessages.editorSectionSecurityTitle;
+    }
+
+    protected String getSectionGeneralDescription() {
+        return CommonMessages.editorSectionSecurityDescription;
+    }
+}

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

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

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

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.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.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/AppClientServerGeneralSection.java?rev=921247&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/AppClientServerGeneralSection.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/AppClientServerGeneralSection.java Wed Mar 10 08:31:28 2010
@@ -0,0 +1,61 @@
+/*
+ * 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;
+
+/**
+ * @version $Rev$ $Date$
+ */
+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();
+	}
+
+    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.v30.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.v30.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.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/AppClientServerGeneralSection.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/AppGeneralSection.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/AppGeneralSection.java?rev=921247&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/AppGeneralSection.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/AppGeneralSection.java Wed Mar 10 08:31:28 2010
@@ -0,0 +1,61 @@
+/*
+ * 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.application.Application;
+import org.apache.geronimo.st.ui.CommonMessages;
+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.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class AppGeneralSection extends CommonGeneralSection {
+
+    protected Text applicationName;
+
+    Application plan;
+
+    public AppGeneralSection(Composite parent, FormToolkit toolkit, int style, JAXBElement plan) {
+        super(parent, toolkit, style, plan);
+        this.plan = (Application) plan.getValue();
+        createClient();
+    }
+
+    protected void createClient() {
+        super.createClient();
+        Composite composite = (Composite) getSection().getClient();
+
+        createLabel(composite, CommonMessages.editorApplicationName);
+
+        applicationName = toolkit.createText(composite, plan.getApplicationName(), SWT.BORDER);
+        applicationName.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
+        applicationName.addModifyListener(new ModifyListener() {
+            public void modifyText(ModifyEvent e) {
+                plan.setApplicationName(applicationName.getText());
+                markDirty();
+            }
+        });
+    }
+}

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

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

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

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/ClassFilterSection.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/ClassFilterSection.java?rev=921247&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/ClassFilterSection.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/ClassFilterSection.java Wed Mar 10 08:31:28 2010
@@ -0,0 +1,163 @@
+/*
+ * 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.jee.deployment.ClassFilter;
+import org.apache.geronimo.jee.deployment.Environment;
+import org.apache.geronimo.st.ui.CommonMessages;
+import org.apache.geronimo.st.ui.sections.AbstractTableSection;
+import org.apache.geronimo.st.v21.core.jaxb.JAXBObjectFactoryImpl;
+import org.apache.geronimo.st.v21.ui.Activator;
+import org.apache.geronimo.st.v21.ui.wizards.ClassFilterWizard;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.IContentProvider;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class ClassFilterSection extends AbstractTableSection {
+
+    protected Environment environment;
+
+    protected boolean isServerEnvironment;
+
+    // isHiddenClasses = true for hidden classes or false for non overridable classes
+    protected boolean isHiddenClasses;
+
+    /**
+     * @param plan
+     * @param parent
+     * @param toolkit
+     * @param style
+     * @param envType
+     * @param classFilterType
+     */
+    public ClassFilterSection(JAXBElement plan, Environment environment, Composite parent, FormToolkit toolkit, int style, boolean isServerEnvironment, boolean isHiddenClasses) {
+        super(plan, parent, toolkit, style);
+        this.environment = environment;
+        this.isServerEnvironment = isServerEnvironment;
+        this.isHiddenClasses = isHiddenClasses; 
+        this.COLUMN_NAMES = new String[] {
+                CommonMessages.className
+        };
+        createClient();
+    }
+
+    public String getTitle() {
+        if (isServerEnvironment && isHiddenClasses)
+            return CommonMessages.editorSectionHiddenClassesTitle;
+        else if (!isServerEnvironment && isHiddenClasses)
+            return CommonMessages.editorSectionClientHiddenClassesTitle;
+        else if (isServerEnvironment && !isHiddenClasses)
+            return CommonMessages.editorSectionNonOverridableTitle;
+        else
+            return CommonMessages.editorSectionClientNonOverridableTitle;
+    }
+
+    public String getDescription() {
+        if (isServerEnvironment && isHiddenClasses)
+            return CommonMessages.editorSectionHiddenClassesDescription;
+        else if (!isServerEnvironment && isHiddenClasses)
+            return CommonMessages.editorSectionClientHiddenClassesDescription;
+        else if (isServerEnvironment && !isHiddenClasses)
+            return CommonMessages.editorSectionNonOverridableDescription;
+        else
+            return CommonMessages.editorSectionClientNonOverridableDescription;
+    }
+
+    public List getObjectContainer() {
+        if (environment == null) {
+            environment = (Environment)JAXBObjectFactoryImpl.getInstance().create(Environment.class);
+        }
+
+        if (getClassFilter() == null) {
+            ClassFilter filter = (ClassFilter)JAXBObjectFactoryImpl.getInstance().create(ClassFilter.class);
+            setClassFilter (filter);
+        }
+        return getClassFilter().getFilter();
+    }
+
+    public Wizard getWizard() {
+        return new ClassFilterWizard(this, isServerEnvironment);
+    }
+
+    public ClassFilter getClassFilter() {
+        if (isHiddenClasses == true)
+            return environment.getHiddenClasses();
+        else
+            return environment.getNonOverridableClasses();
+    }
+
+    public void setClassFilter (ClassFilter filter) {
+        if (isHiddenClasses == true)
+            environment.setHiddenClasses (filter);
+        else
+            environment.setNonOverridableClasses (filter);
+    }
+    
+    public ImageDescriptor getImageDescriptor() {
+        return Activator.imageDescriptorFromPlugin("org.eclipse.jdt.ui", "icons/full/obj16/jar_obj.gif");
+    }
+
+    public Class getTableEntryObjectType() {
+        return String.class;
+    }
+
+    public Object getInput() {
+        if (environment != null) {
+            return getClassFilter();
+        }
+        return super.getInput();
+    }
+    
+    @Override
+    public IContentProvider getContentProvider() {
+        return new ContentProvider() {
+            @Override
+            public Object[] getElements(Object inputElement) {
+                if (!ClassFilter.class.isInstance(inputElement)) {
+                    return new String[] { "" };
+                }
+                return ((ClassFilter) inputElement).getFilter().toArray();
+            }
+        };
+    }
+
+    @Override
+    public ITableLabelProvider getLabelProvider() {
+        return new LabelProvider() {
+            @Override
+            public String getColumnText(Object element, int columnIndex) {
+                if (String.class.isInstance(element)) {
+                    switch (columnIndex) {
+                    case 0:
+                        return (String) element;
+                    }
+                }
+                return null;
+            }
+        };
+    }
+}

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

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

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

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.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.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/CommonGeneralSection.java?rev=921247&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/CommonGeneralSection.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/CommonGeneralSection.java Wed Mar 10 08:31:28 2010
@@ -0,0 +1,363 @@
+/*
+ * 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.Iterator;
+import java.util.List;
+
+import javax.xml.bind.JAXBElement;
+
+import org.apache.geronimo.jee.web.WebApp;
+import org.apache.geronimo.jee.deployment.Artifact;
+import org.apache.geronimo.jee.deployment.Dependencies;
+import org.apache.geronimo.jee.deployment.Dependency;
+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.connector.Connector;
+import org.apache.geronimo.jee.openejb.OpenejbJar;
+import org.apache.geronimo.st.ui.CommonMessages;
+import org.apache.geronimo.st.ui.sections.AbstractSectionPart;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Section;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public abstract class CommonGeneralSection extends AbstractSectionPart {
+
+    protected Text artifactId;
+
+    protected Text groupId;
+
+    protected Text version;
+
+    protected Text type;
+
+    protected Button inverseClassLoading;
+
+    protected Button suppressDefaultEnv;
+    
+    protected Button sharedLibDepends;
+    
+    protected ObjectFactory deploymentObjectFactory = null;
+
+    public CommonGeneralSection(Composite parent, FormToolkit toolkit, int style, JAXBElement plan) {
+        super(parent, toolkit, style, plan);
+    }
+
+    protected void createClient() {
+
+        Section section = getSection();
+
+        section.setText(getSectionGeneralTitle());
+        section.setDescription(getSectionGeneralDescription());
+        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);
+
+        createLabel(composite, CommonMessages.groupId);
+
+        groupId = toolkit.createText(composite, getGroupId(), SWT.BORDER);
+        groupId.setLayoutData(createTextFieldGridData());
+        groupId.addModifyListener(new ModifyListener() {
+            public void modifyText(ModifyEvent e) {
+                getModuleId(true).setGroupId(groupId.getText());
+                markDirty();
+            }
+        });
+
+        createLabel(composite, CommonMessages.artifactId);
+
+        artifactId = toolkit.createText(composite, getArtifactId(), SWT.BORDER);
+        artifactId.setLayoutData(createTextFieldGridData());
+        artifactId.addModifyListener(new ModifyListener() {
+            public void modifyText(ModifyEvent e) {
+                getModuleId(true).setArtifactId(artifactId.getText());
+                markDirty();
+            }
+        });
+
+        createLabel(composite, CommonMessages.version);
+
+        version = toolkit.createText(composite, getVersion(), SWT.BORDER);
+        version.setLayoutData(createTextFieldGridData());
+        version.addModifyListener(new ModifyListener() {
+            public void modifyText(ModifyEvent e) {
+                getModuleId(true).setVersion(version.getText());
+                markDirty();
+            }
+        });
+
+        createLabel(composite, CommonMessages.artifactType);
+
+        type = toolkit.createText(composite, getArtifact(), SWT.BORDER);
+        type.setLayoutData(createTextFieldGridData());
+        type.addModifyListener(new ModifyListener() {
+            public void modifyText(ModifyEvent e) {
+                getModuleId(true).setType(type.getText());
+                markDirty();
+            }
+        });
+
+        inverseClassLoading = toolkit.createButton(composite, CommonMessages.inverseClassloading, SWT.CHECK);
+        inverseClassLoading.setSelection(isInverseClassloading());
+        GridData data = new GridData();
+        data.horizontalSpan = 2;
+        inverseClassLoading.setLayoutData(data);
+
+        inverseClassLoading.addSelectionListener(new SelectionListener() {
+            public void widgetDefaultSelected(SelectionEvent e) {
+            }
+
+            public void widgetSelected(SelectionEvent e) {
+                setInverseClassloading(inverseClassLoading.getSelection());
+                markDirty();
+            }
+        });
+
+        suppressDefaultEnv = toolkit.createButton(composite, CommonMessages.supressDefaultEnv, SWT.CHECK);
+        suppressDefaultEnv.setSelection(isSuppressDefaultEnvironment());
+        data = new GridData();
+        data.horizontalSpan = 2;
+        suppressDefaultEnv.setLayoutData(data);
+
+        suppressDefaultEnv.addSelectionListener(new SelectionListener() {
+            public void widgetDefaultSelected(SelectionEvent e) {
+            }
+
+            public void widgetSelected(SelectionEvent e) {
+                setSuppressDefaultEnvironment(suppressDefaultEnv.getSelection());
+                markDirty();
+            }
+        });
+        
+        sharedLibDepends = toolkit.createButton(composite, CommonMessages.sharedLibDepends, SWT.CHECK);
+        sharedLibDepends.setSelection(isSharedLibDependency());
+        data = new GridData();
+        data.horizontalSpan = 2;
+        sharedLibDepends.setLayoutData(data);
+
+        sharedLibDepends.addSelectionListener(new SelectionListener() {
+            public void widgetDefaultSelected(SelectionEvent e) {
+            }
+
+            public void widgetSelected(SelectionEvent e) {
+                setSharedLibDependency(sharedLibDepends.getSelection());
+                markDirty();
+            }
+        });
+    }
+
+    protected String getGroupId() {
+        Artifact moduleId = getModuleId(false);
+        if (moduleId != null
+                && moduleId.getGroupId() != null)
+            return moduleId.getGroupId();
+        return "";
+    }
+
+    protected String getArtifactId() {
+        Artifact moduleId = getModuleId(false);
+        if (moduleId != null
+                && moduleId.getArtifactId() != null)
+            return moduleId.getArtifactId();
+        return "";
+    }
+
+    protected String getVersion() {
+        Artifact moduleId = getModuleId(false);
+        if (moduleId != null
+                && moduleId.getVersion() != null)
+            return moduleId.getVersion();
+        return "";
+    }
+
+    protected String getArtifact() {
+        Artifact moduleId = getModuleId(false);
+        if (moduleId != null
+                && moduleId.getType() != null)
+            return moduleId.getType();
+        return "";
+    }
+
+    protected boolean isInverseClassloading() {
+        Environment type = getEnvironment(false);
+        return type != null && type.getInverseClassloading() != null;
+    }
+
+    protected boolean isSuppressDefaultEnvironment() {
+        Environment type = getEnvironment(false);
+        return type != null && type.getSuppressDefaultEnvironment() != null;
+    }
+    
+    protected boolean isSharedLibDependency() {
+        Dependencies depType = getDependencies(false);
+        if(depType != null) {
+            return getSharedLibDependency(depType) != null;
+        }
+        return false;
+    }
+
+    protected void setInverseClassloading(boolean enable) {
+        if (enable) {
+            Environment type = getEnvironment(true);
+            type.setInverseClassloading(getDeploymentObjectFactory().createEmpty());
+        } else {
+            Environment type = getEnvironment(false);
+            if (type != null) {
+                type.setInverseClassloading(null);
+            }
+        }
+    }
+
+    protected void setSuppressDefaultEnvironment(boolean enable) {
+        if (enable) {
+            Environment type = getEnvironment(true);
+            type.setSuppressDefaultEnvironment(getDeploymentObjectFactory().createEmpty());
+        } else {
+            Environment type = getEnvironment(false);
+            if (type != null) {
+                type.setSuppressDefaultEnvironment(null);
+            }
+        }
+    }
+    
+    protected void setSharedLibDependency(boolean enable) {
+        if (enable) {
+            Dependencies deptype = getDependencies(true);
+            Dependency sharedLib = getDeploymentObjectFactory().createDependency();
+            sharedLib.setGroupId("org.apache.geronimo.configs");
+            sharedLib.setArtifactId("sharedlib");
+            sharedLib.setType("car");
+            deptype.getDependency().add(sharedLib);
+        } else {
+            Dependencies deptype = getDependencies(false);
+            if (deptype != null) {
+                Artifact artifact = getSharedLibDependency(deptype);
+                if(artifact != null) {
+                    deptype.getDependency().remove(artifact);
+                }
+            }
+        }
+    }
+    
+    private Artifact getSharedLibDependency(Dependencies dependencies) {
+        Dependencies depType = getDependencies(false);
+        List dependenciesList = depType.getDependency();
+        Iterator i = dependenciesList.iterator();
+        while(i.hasNext()) {
+            Artifact artifact = (Artifact) i.next();
+            if("org.apache.geronimo.configs".equals(artifact.getGroupId()) && "sharedlib".equals(artifact.getArtifactId()) && "car".equals(artifact.getType())) {
+                return artifact;
+            }
+        }
+        return null;
+    }
+
+    protected Environment getEnvironment(boolean create) {
+        Environment type = null;
+        Object plan = getPlan().getValue();
+        if (WebApp.class.isInstance(plan)) {
+            type = ((WebApp) plan).getEnvironment();
+            if (type == null && create) {
+                type = getDeploymentObjectFactory().createEnvironment();
+                ((WebApp) plan).setEnvironment(type);
+            }
+        } else if (Connector.class.isInstance(plan)) {
+            type = ((Connector) plan).getEnvironment();
+            if (type == null && create) {
+                type = getDeploymentObjectFactory().createEnvironment();
+                ((Connector) plan).setEnvironment(type);
+            }
+        } else if (Application.class.isInstance(plan)) {
+            type = ((Application) plan).getEnvironment();
+            if (type == null && create) {
+                type = getDeploymentObjectFactory().createEnvironment();
+                ((Application) plan).setEnvironment(type);
+            }
+        } else if (OpenejbJar.class.isInstance(plan)) {
+            type = ((OpenejbJar) plan).getEnvironment();
+            if (type == null && create) {
+                type = getDeploymentObjectFactory().createEnvironment();
+                ((OpenejbJar) plan).setEnvironment(type);
+            }
+        }
+
+        return type;
+    }
+    
+    private Dependencies getDependencies(boolean create) {
+        Environment env = getEnvironment(create);
+        if(env != null) {
+            Dependencies dep = env.getDependencies();
+            if (dep == null && create) {
+                dep = getDeploymentObjectFactory().createDependencies();
+                env.setDependencies(dep);
+            }
+            return dep;
+        }
+        return null;
+    }
+
+    private Artifact getModuleId(boolean create) {
+        Environment type = getEnvironment(create);
+        if (type != null) {
+            Artifact moduleId = type.getModuleId();
+            if (moduleId == null && create) {
+                moduleId = getDeploymentObjectFactory().createArtifact();
+                type.setModuleId(moduleId);
+            }
+            return moduleId;
+        }
+        return null;
+    }
+    
+    protected org.apache.geronimo.jee.deployment.ObjectFactory getDeploymentObjectFactory() {
+        if ( deploymentObjectFactory == null ) {
+            deploymentObjectFactory = new org.apache.geronimo.jee.deployment.ObjectFactory();
+        }
+        return deploymentObjectFactory;
+    }
+
+    protected String getSectionGeneralTitle() {
+        return CommonMessages.editorSectionGeneralTitle;
+    }
+
+    protected String getSectionGeneralDescription() {
+        return CommonMessages.editorSectionGeneralDescription;
+    }
+}

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

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

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

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/ConnectorGeneralSection.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/ConnectorGeneralSection.java?rev=921247&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/ConnectorGeneralSection.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/ConnectorGeneralSection.java Wed Mar 10 08:31:28 2010
@@ -0,0 +1,37 @@
+/*
+ * 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.connector.Connector;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class ConnectorGeneralSection extends CommonGeneralSection {
+
+	Connector plan;
+
+	public ConnectorGeneralSection(Composite parent, FormToolkit toolkit, int style, JAXBElement plan) {
+		super(parent, toolkit, style, plan);
+		this.plan = (Connector) plan.getValue();
+		createClient();
+	}
+}

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

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

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

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/DBPoolSection.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/DBPoolSection.java?rev=921247&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/DBPoolSection.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/DBPoolSection.java Wed Mar 10 08:31:28 2010
@@ -0,0 +1,176 @@
+package org.apache.geronimo.st.v21.ui.sections;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.xml.bind.JAXBElement;
+
+import org.apache.geronimo.jee.application.ExtModule;
+import org.apache.geronimo.jee.connector.Connector;
+import org.apache.geronimo.jee.deployment.Gbean;
+import org.apache.geronimo.jee.deployment.Pattern;
+import org.apache.geronimo.st.ui.CommonMessages;
+import org.apache.geronimo.st.ui.sections.AbstractTableSection;
+import org.apache.geronimo.st.ui.sections.AbstractListSection.ContentProvider;
+import org.apache.geronimo.st.ui.sections.AbstractListSection.LabelProvider;
+import org.apache.geronimo.st.v21.ui.pages.ConnectorPage;
+import org.apache.geronimo.st.v21.ui.wizards.DBPoolWizard;
+import org.apache.geronimo.st.v21.ui.wizards.ExtModuleWizard;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.ui.forms.IFormPart;
+import org.eclipse.ui.forms.editor.FormEditor;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+public class DBPoolSection extends AbstractTableSection {
+
+    public DBPoolSection(JAXBElement plan, Composite parent,
+	    FormToolkit toolkit, int style, List extModules) {
+	super(plan, parent, toolkit, style);
+	this.objectContainer = extModules;
+	COLUMN_NAMES = new String[] { "Connector", "External Path", };// TODO
+								      // put
+								      // into
+								      // message
+	createClient();
+    }
+
+    @Override
+    public String getDescription() {
+	return "The following database pools are defined:";// TODO put into
+							   // message
+    }
+
+    @Override
+    public Class getTableEntryObjectType() {
+	return ExtModule.class;// TODO put into message
+    }
+
+    @Override
+    public String getTitle() {
+	return "Database Pools";// TODO put into message
+    }
+
+    @Override
+    protected Wizard getWizard() {
+	return new DBPoolWizard(this);
+    }
+
+    protected void notifyOthers() {
+	notifyExtModuleSectionToRefresh();
+    }
+
+    /*
+     * After add, remove, edit dbpool ext-module, notify the extModuleSection to
+     * refresh. If the deploymentpage has not been initialized, catch a
+     * NullPointerException and just ignore it.
+     */
+    private void notifyExtModuleSectionToRefresh() {
+	try {
+	    ConnectorPage connectorPage = (ConnectorPage) this.getManagedForm()
+		    .getContainer();
+	    FormEditor editor = connectorPage.getEditor();
+	    IFormPart[] parts = editor.findPage("deploymentpage")
+		    .getManagedForm().getParts();
+	    ExtModuleSection extModuleSection = null;
+	    for (IFormPart part : parts) {
+		if (ExtModuleSection.class.isInstance(part)) {
+		    extModuleSection = (ExtModuleSection) part;
+		}
+	    }
+	    extModuleSection.getViewer().refresh();
+	} catch (NullPointerException e) {
+	    // Ignore, this exception happens when the deployment page hasn't
+	    // been initialized
+	}
+    }
+
+    @Override
+    public ITreeContentProvider getContentProvider() {
+	return new ContentProvider() {
+	    @Override
+	    public Object[] getElements(Object inputElement) {
+		List<ExtModule> result = new ArrayList<ExtModule>();
+		List extModules = getObjectContainer();
+		Iterator it = extModules.iterator();
+		while (it.hasNext()) {
+		    ExtModule current = (ExtModule) it.next();
+		    if (isDBPoolConnectorExtModule(current)) {
+			result.add(current);
+		    }
+		}
+		return result.toArray();
+	    }
+	};
+    }
+
+    private boolean isDBPoolConnectorExtModule(ExtModule extModule) {
+	boolean result = false;
+	JAXBElement any = (JAXBElement) extModule.getAny();
+	if (any == null)
+	    return false;
+	Object anyValue = any.getValue();
+	if (Connector.class.isInstance(anyValue)) {
+	    Connector connector = (Connector) anyValue;
+	    try {
+		// if the <ext-module/> contains <connectionfactory-interface/>
+		// which value is "javax.sql.DataSource",then it is a dbpool
+		// ext-module.
+		String connectionfactoryInterface = connector
+			.getResourceadapter().get(0)
+			.getOutboundResourceadapter().getConnectionDefinition()
+			.get(0).getConnectionfactoryInterface();
+		if (connectionfactoryInterface.trim().equals(
+			"javax.sql.DataSource")) {
+		    result = true;
+		}
+	    } catch (NullPointerException e) {
+		// e.printStackTrace();
+	    }
+	}
+	return result;
+    }
+
+    @Override
+    public ITableLabelProvider getLabelProvider() {
+	return new LabelProvider() {
+	    @Override
+	    public String getColumnText(Object element, int columnIndex) {
+		if (ExtModule.class.isInstance(element)) {
+		    ExtModule extModule = (ExtModule) element;
+		    switch (columnIndex) {
+		    case 0:// connector
+			if (extModule.getConnector() != null) {
+			    return extModule.getConnector().getValue();
+			}
+			return "";
+		    case 1:// external-path
+			Pattern externalPath = extModule.getExternalPath();
+			if (externalPath != null) {
+			    String groupId = externalPath.getGroupId() != null ? externalPath
+				    .getGroupId()
+				    : "";
+			    String artifactId = externalPath.getArtifactId() != null ? externalPath
+				    .getArtifactId()
+				    : "";
+			    String version = externalPath.getVersion() != null ? externalPath
+				    .getVersion()
+				    : "";
+			    String type = externalPath.getType() != null ? externalPath
+				    .getType()
+				    : "";
+			    return groupId + "/" + artifactId + "/" + version
+				    + "/" + type;
+			}
+			return "";
+		    }
+		}
+		return null;
+	    }
+	};
+    }
+}

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

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

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



Mime
View raw message