geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sppa...@apache.org
Subject svn commit: r295129 - in /geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui: internal/ pages/ sections/
Date Wed, 05 Oct 2005 22:24:59 GMT
Author: sppatel
Date: Wed Oct  5 15:24:50 2005
New Revision: 295129

URL: http://svn.apache.org/viewcvs?rev=295129&view=rev
Log:
refactor so common sections can be shared across multiple models

Modified:
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/GeronimoUIPlugin.java
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/pages/WebGeneralPage.java
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/AbstractSectionPart.java
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/BeansSection.java
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/DependencySection.java
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/DynamicTableSection.java
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/EjbLocalRefSection.java
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/EjbRefSection.java
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/ResourceEnvRefSection.java
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/ResourceRefSection.java
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/SecuritySection.java

Modified: 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=295129&r1=295128&r2=295129&view=diff
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/GeronimoUIPlugin.java
(original)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/GeronimoUIPlugin.java
Wed Oct  5 15:24:50 2005
@@ -18,7 +18,7 @@
 import java.io.IOException;
 
 import org.eclipse.core.runtime.Platform;
-import org.eclipse.ui.plugin.*;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
 
 /**
  * The main plugin class to be used in the desktop.

Modified: 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=295129&r1=295128&r2=295129&view=diff
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/pages/WebGeneralPage.java
(original)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/pages/WebGeneralPage.java
Wed Oct  5 15:24:50 2005
@@ -16,9 +16,12 @@
 package org.apache.geronimo.ui.pages;
 
 import org.apache.geronimo.ui.editors.WebEditor;
+import org.apache.geronimo.ui.sections.DependencySection;
 import org.apache.geronimo.ui.sections.WebGeneralSection;
 import org.apache.geronimo.xml.ns.web.WebAppType;
+import org.apache.geronimo.xml.ns.web.WebPackage;
 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;
@@ -36,29 +39,34 @@
         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;
+        layout.makeColumnsEqualWidth = true;
+        form.getBody().setLayout(layout);
+        fillBody(managedForm);
+        form.reflow(true);
+    }
+
+    private void fillBody(IManagedForm managedForm) {
 
         WebAppType plan = (WebAppType) ((WebEditor) getEditor())
                 .getDeploymentPlan();
 
-        ScrolledForm form = managedForm.getForm();
-        form.setText(getTitle());
-        form.getBody().setLayout(new GridLayout());
-
-        // create web plan general section
-        WebGeneralSection sec = new WebGeneralSection(form.getBody(),
-                managedForm.getToolkit(), ExpandableComposite.TWISTIE
-                        | ExpandableComposite.EXPANDED
-                        | ExpandableComposite.TITLE_BAR | Section.DESCRIPTION
-                        | ExpandableComposite.FOCUS_TITLE, plan);
-        managedForm.addPart(sec);
+        Composite body = managedForm.getForm().getBody();
 
-        form.reflow(true);
+        int style = ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED
+                | ExpandableComposite.TITLE_BAR | Section.DESCRIPTION
+                | ExpandableComposite.FOCUS_TITLE;
+
+        managedForm.addPart(new WebGeneralSection(body, managedForm
+                .getToolkit(), style, plan));
+
+        managedForm.addPart(new DependencySection(plan, WebPackage.eINSTANCE
+                .getWebAppType_Dependency(), body, managedForm.getToolkit(),
+                style));
     }
-
 }

Modified: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/AbstractSectionPart.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/AbstractSectionPart.java?rev=295129&r1=295128&r2=295129&view=diff
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/AbstractSectionPart.java
(original)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/AbstractSectionPart.java
Wed Oct  5 15:24:50 2005
@@ -21,6 +21,8 @@
 import org.eclipse.ui.forms.widgets.Section;
 
 public abstract class AbstractSectionPart extends SectionPart {
+    
+    protected FormToolkit toolkit;
 
     /**
      * @param section
@@ -36,6 +38,7 @@
      */
     public AbstractSectionPart(Composite parent, FormToolkit toolkit, int style) {
         super(parent, toolkit, style);
+        this.toolkit = toolkit;
     }
 
     /*

Modified: 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=295129&r1=295128&r2=295129&view=diff
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/BeansSection.java
(original)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/BeansSection.java
Wed Oct  5 15:24:50 2005
@@ -22,19 +22,10 @@
 import org.eclipse.jface.wizard.Wizard;
 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
@@ -43,7 +34,7 @@
     public BeansSection(EObject plan, Composite parent, FormToolkit toolkit,
             int style) {
         super(plan, parent, toolkit, style);
-        // TODO Auto-generated constructor stub
+        create();
     }
 
     /* (non-Javadoc)

Modified: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/DependencySection.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/DependencySection.java?rev=295129&r1=295128&r2=295129&view=diff
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/DependencySection.java
(original)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/DependencySection.java
Wed Oct  5 15:24:50 2005
@@ -20,7 +20,7 @@
 import org.apache.geronimo.xml.ns.deployment.DependencyType;
 import org.apache.geronimo.xml.ns.deployment.DeploymentFactory;
 import org.apache.geronimo.xml.ns.deployment.DeploymentPackage;
-import org.apache.geronimo.xml.ns.j2ee.application.ApplicationFactory;
+import org.apache.geronimo.xml.ns.j2ee.application.ApplicationPackage;
 import org.eclipse.emf.common.util.EList;
 import org.eclipse.emf.ecore.EAttribute;
 import org.eclipse.emf.ecore.EFactory;
@@ -39,14 +39,7 @@
     /**
      * Must be a set to a ERef type of XPackage.eINSTANCE.getXType_Dependency();
      */
-    public EReference dependenciesERef;
-
-    /**
-     * @param section
-     */
-    public DependencySection(Section section) {
-        super(section);
-    }
+    private EReference dependenciesERef;
 
     /**
      * @param plan
@@ -58,6 +51,7 @@
             Composite parent, FormToolkit toolkit, int style) {
         super(plan, parent, toolkit, style);
         this.dependenciesERef = dependenciesERef;
+        create();
     }
 
     /*
@@ -93,8 +87,7 @@
      * @see org.apache.geronimo.ui.sections.DynamicTableSection#getEReference()
      */
     public EReference getEReference() {
-        return ApplicationFactory.eINSTANCE.getApplicationPackage()
-                .getApplicationType_Dependency();
+        return ApplicationPackage.eINSTANCE.getApplicationType_Dependency();
     }
 
     /*

Modified: 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=295129&r1=295128&r2=295129&view=diff
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/DynamicTableSection.java
(original)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/DynamicTableSection.java
Wed Oct  5 15:24:50 2005
@@ -68,13 +68,23 @@
         super(section);
     }
 
+    /**
+     * @param plan
+     * @param parent
+     * @param toolkit
+     * @param style
+     * 
+     * Subclasses should call create() in constructor
+     */
     public DynamicTableSection(EObject plan, Composite parent,
             FormToolkit toolkit, int style) {
         super(parent, toolkit, style);
         this.plan = plan;
-
+    }
+    
+    public void create() {
         if (isValid()) {
-            createClient(getSection(), toolkit);
+            createClient();
         }
     }
 
@@ -84,14 +94,14 @@
                 && getTableColumnNames() != null;
     }
 
-    public void createClient(Section section, FormToolkit toolkit) {
+    public void createClient() {
 
-        section.setText(getTitle());
-        section.setDescription(getDescription());
+        getSection().setText(getTitle());
+        getSection().setDescription(getDescription());
 
-        configureSection(section);
+        configureSection(getSection());
 
-        Composite composite = createTableComposite(section, toolkit);
+        Composite composite = createTableComposite(getSection(), toolkit);
         createTable(composite);
         fillTableItems();
 

Modified: 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=295129&r1=295128&r2=295129&view=diff
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/EjbLocalRefSection.java
(original)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/EjbLocalRefSection.java
Wed Oct  5 15:24:50 2005
@@ -33,6 +33,7 @@
     public EjbLocalRefSection(WebAppType plan, Composite parent,
             FormToolkit toolkit, int style) {
         super(plan, parent, toolkit, style);
+        create();
     }
 
     /*

Modified: 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=295129&r1=295128&r2=295129&view=diff
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/EjbRefSection.java
(original)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/EjbRefSection.java
Wed Oct  5 15:24:50 2005
@@ -47,6 +47,7 @@
     public EjbRefSection(EObject plan, Composite parent, FormToolkit toolkit,
             int style) {
         super(plan, parent, toolkit, style);
+        create();
     }
 
     /*

Modified: 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=295129&r1=295128&r2=295129&view=diff
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/ResourceEnvRefSection.java
(original)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/ResourceEnvRefSection.java
Wed Oct  5 15:24:50 2005
@@ -33,6 +33,7 @@
     public ResourceEnvRefSection(WebAppType plan, Composite parent,
             FormToolkit toolkit, int style) {
         super(plan, parent, toolkit, style);
+        create();
     }
 
     /*

Modified: 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=295129&r1=295128&r2=295129&view=diff
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/ResourceRefSection.java
(original)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/ResourceRefSection.java
Wed Oct  5 15:24:50 2005
@@ -33,6 +33,7 @@
     public ResourceRefSection(WebAppType plan, Composite parent,
             FormToolkit toolkit, int style) {
         super(plan, parent, toolkit, style);
+        create();
     }
 
     /*

Modified: 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=295129&r1=295128&r2=295129&view=diff
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/SecuritySection.java
(original)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/SecuritySection.java
Wed Oct  5 15:24:50 2005
@@ -60,7 +60,7 @@
     public SecuritySection(WebAppType plan, Composite parent,
             FormToolkit toolkit, int style) {
         super(plan, parent, toolkit, style);
-
+        create();
     }
 
     /**
@@ -133,15 +133,13 @@
         return false;
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.geronimo.ui.sections.DynamicTableSection#createClient(org.eclipse.ui.forms.widgets.Section,
-     *      org.eclipse.ui.forms.widgets.FormToolkit)
+
+    /* (non-Javadoc)
+     * @see org.apache.geronimo.ui.sections.DynamicTableSection#createClient()
      */
-    public void createClient(Section section, FormToolkit toolkit) {
+    public void createClient() {
 
-        super.createClient(section, toolkit);
+        super.createClient();
 
         Composite detail = toolkit.createComposite(table.getParent());
         GridLayout gl = new GridLayout();



Mime
View raw message