geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcco...@apache.org
Subject svn commit: r663673 [1/3] - in /geronimo/devtools/eclipse-plugin/trunk/plugins: org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/ org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/sections/ org.apache.geronimo....
Date Thu, 05 Jun 2008 17:38:37 GMT
Author: mcconne
Date: Thu Jun  5 10:38:37 2008
New Revision: 663673

URL: http://svn.apache.org/viewvc?rev=663673&view=rev
Log:
GERONIMODEVTOOLS-346 Patch to fix all deployment plan editor list boxes -- Thanks to BJ Reed for this awesome patch !!

Modified:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.properties
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/sections/AbstractTableSection.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/wizards/AbstractTableWizard.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/jaxb/JAXBModelUtils.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/jaxb/JAXBObjectFactoryImpl.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/editors/GeronimoFormContentLoader.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/NamingFormPage.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/SecurityPage.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/CommonGeneralSection.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/DependencySection.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/EjbLocalRefSection.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/EjbRefSection.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/GBeanSection.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/ResourceEnvRefSection.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/ResourceRefSection.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/SecuritySection.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/ServiceRefSection.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/DependencyWizard.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/EjbLocalRefWizard.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/EjbRefWizard.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/GBeanRefWizard.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/GBeanWizard.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ResourceEnvRefWizard.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ResourceRefWizard.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/SecurityRoleWizard.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ServiceRefWizard.java

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.properties
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.properties?rev=663673&r1=663672&r2=663673&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.properties (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.properties Thu Jun  5 10:38:37 2008
@@ -81,7 +81,7 @@
 editorResourceEnvRefTitle=Resource Environment References
 editorResourceEnvRefDescription=The following resource environment references are defined:
 editorResEnvRefNameTitle=Reference Name
-editorResEnvRefMsgDestTitle=Message destination
+editorResEnvRefMsgDestTitle=Message Destination
 
 editorGBeanRefTitle=GBean References
 editorGBeanRefDescription=The following gbean references are defined:
@@ -161,10 +161,10 @@
 defaultRole=Default Role:
 
 dependencyGroupLabel=Dependency type and location
-groupId=Group Id:
-artifactId=Artifact Id:
-version=Version:
-type=Artifact Type:
+groupId=Group Id
+artifactId=Artifact Id
+version=Version
+type=Artifact Type
 
 editorTabGeneral=General
 editorTabNaming=Naming
@@ -199,7 +199,7 @@
 install=Download and Install
 jvmWarning={0} is currently only certified on a 1.5 JVM. Use of any other version is not currently supported.
 installTitle=Install Confirmation
-installMessage=Install {0} to {1} ?
+installMessage=Install Apache Geronimo to {0} ?
 tooltipLoc=A location of an existing {0} installation or a path to install to.
 tooltipInstall=Downloads the selected {0} distribution and installs it to the specified location.
 tooltipJetty=Selects the Jetty distribution of Geronimo to install.

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/sections/AbstractTableSection.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/sections/AbstractTableSection.java?rev=663673&r1=663672&r2=663673&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/sections/AbstractTableSection.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/sections/AbstractTableSection.java Thu Jun  5 10:38:37 2008
@@ -54,247 +54,256 @@
  */
 public abstract class AbstractTableSection extends AbstractSectionPart {
 
-	private static final String[] COLUMN_NAMES = new String[] {};
+    protected String[] COLUMN_NAMES = new String[] {};
 
-	private Table table;
+    private Table table;
 
-	private TableViewer tableViewer;
+    private TableViewer tableViewer;
 
-	protected Button addButton;
-
-	protected Button editButton;
-
-	protected Button removeButton;
-
-	public AbstractTableSection(Section section) {
-		super(section);
-	}
-
-	/**
-	 * @param plan
-	 * @param parent
-	 * @param toolkit
-	 * @param style
-	 * 
-	 * Subclasses should call createClient() in constructor
-	 */
-	public AbstractTableSection(JAXBElement plan, Composite parent,
-			FormToolkit toolkit, int style) {
-		super(parent, toolkit, style, plan);
-	}
-
-	public void createClient() {
-
-		if (getTableEntryObjectType() == null)
-			throw new NullPointerException();
-		
-
-		getSection().setText(getTitle());
-		getSection().setDescription(getDescription());
-		getSection().setLayoutData(getSectionLayoutData());
-		Composite composite = createTableComposite(getSection());
-		getSection().setClient(composite);
-		table = createTable(composite);
-
-		tableViewer = new TableViewer(getTable());
-		tableViewer.setContentProvider(new ContentProvider(getAdapterFactory()));
-		tableViewer.setLabelProvider(new LabelProvider(getAdapterFactory()));
-		tableViewer.setInput(getInput());
-
-		tableViewer.addFilter(new ViewerFilter() {
-			public boolean select(Viewer viewer, Object parentElement,
-					Object element) {
-				return AbstractTableSection.this.filter(viewer, parentElement, element);
-			}
-		});
-
-		if (getTableColumnNames().length > 0) {
-			tableViewer.setColumnProperties(getTableColumnNames());
-		}
-
-		Composite buttonComp = createButtonComposite(composite);
-		createAddButton(toolkit, buttonComp);
-		createRemoveButton(toolkit, buttonComp);
-		createEditButton(toolkit, buttonComp);
-
-	}
-
-	public Object getInput() {
-		return getPlan();
-	}
-
-	protected boolean filter(Viewer viewer, Object parentElement, Object element) {
-		System.out.println( getTableEntryObjectType() + ":" + element );
-		return getTableEntryObjectType().isInstance(element);
-	}
-
-	protected Composite createTableComposite(Composite parent) {
-		Composite composite = toolkit.createComposite(parent);
-		composite.setLayout(getSectionCompositeLayout());
-		composite.setLayoutData(getTableCompositeLayoutData());
-		return composite;
-	}
-
-	protected GridData getSectionLayoutData() {
-		return new GridData(SWT.FILL, SWT.FILL, false, false);
-	}
-
-	protected GridData getTableCompositeLayoutData() {
-		return new GridData(SWT.FILL, SWT.FILL, false, false);
-	}
-
-	protected GridLayout getSectionCompositeLayout() {
-		GridLayout layout = new GridLayout();
-		layout.numColumns = 2;
-		layout.marginHeight = 5;
-		layout.marginWidth = 10;
-		layout.verticalSpacing = 5;
-		layout.horizontalSpacing = 15;
-		return layout;
-	}
-
-	protected Table createTable(Composite composite) {
-		Table table = new Table(composite, SWT.BORDER | SWT.FULL_SELECTION
-				| SWT.V_SCROLL | SWT.SINGLE);
-		if (isHeaderVisible()) {
-			table.setHeaderVisible(true);
-		}
-
-		GridData data = new GridData(SWT.FILL, SWT.FILL, false, false);
-		data.heightHint = 60;
-		data.widthHint = 400;
-		table.setLayoutData(data);
-
-		TableLayout tableLayout = new TableLayout();
-		table.setLayout(tableLayout);
-
-		for (int i = 0; i < getTableColumnNames().length; i++) {
-			tableLayout.addColumnData(new ColumnWeightData(35));
-			TableColumn tableColumn = new TableColumn(table, SWT.NONE);
-			tableColumn.setText(getTableColumnNames()[i]);
-		}
-
-		return table;
-	}
-
-	protected Composite createButtonComposite(Composite parent) {
-		Composite buttonComp = new Composite(parent, SWT.NONE);
-		GridLayout layout = new GridLayout();
-		layout.horizontalSpacing = 2;
-		layout.verticalSpacing = 2;
-		layout.marginWidth = 0;
-		layout.marginHeight = 0;
-		layout.numColumns = 1;
-		buttonComp.setLayout(layout);
-		buttonComp.setBackground(toolkit.getColors().getBackground());
-		buttonComp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
-		return buttonComp;
-	}
-
-	protected void createRemoveButton(FormToolkit toolkit, Composite buttonComp) {
-		removeButton = toolkit.createButton(buttonComp, CommonMessages.remove, SWT.NONE);
-		removeButton.addSelectionListener(new SelectionAdapter() {
-			public void widgetSelected(SelectionEvent e) {
-				int[] selectedIndices = table.getSelectionIndices();
-				for (int i = 0; i < selectedIndices.length; i++) {
-					TableItem tableItem = table.getItem(selectedIndices[i]);
-					Object type = tableItem.getData();
-					table.remove(selectedIndices[i]);
-					getObjectContainer().remove(type);
-					markDirty();
-				}
-			}
-		});
-		removeButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
-	}
-
-	protected void createAddButton(FormToolkit toolkit, Composite buttonComp) {
-		addButton = toolkit.createButton(buttonComp, CommonMessages.add, SWT.NONE);
-
-		addButton.addSelectionListener(new SelectionAdapter() {
-			public void widgetSelected(SelectionEvent e) {
-				Wizard wizard = getWizard();
-				if (wizard != null) {
-					WizardDialog dialog = new WizardDialog(Display.getCurrent().getActiveShell(), wizard);
-
-					dialog.open();
-
-					if (dialog.getReturnCode() == Dialog.OK) {
-						markDirty();
-					}
-				}
-			}
-		});
-
-		addButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
-	}
-
-	protected void createEditButton(FormToolkit toolkit, Composite buttonComp) {
-		editButton = toolkit.createButton(buttonComp, CommonMessages.edit, SWT.NONE);
-
-		editButton.addSelectionListener(new SelectionAdapter() {
-			public void widgetSelected(SelectionEvent e) {
-				Object o = ((StructuredSelection) getTableViewer().getSelection()).getFirstElement();
-				if (o != null) {
-					Wizard wizard = getWizard();
-					if (wizard != null) {
-						if (wizard instanceof AbstractTableWizard) {
-							((AbstractTableWizard) wizard).setEObject(o);
-						}
-						WizardDialog dialog = new WizardDialog(Display.getCurrent().getActiveShell(), wizard);
-						dialog.open();
-						if (dialog.getReturnCode() == Dialog.OK) {
-							markDirty();
-							// TODO notify listeners
-						}
-					}
-				}
-			}
-		});
-
-		editButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
-	}
-
-	public TableViewer getTableViewer() {
-		return tableViewer;
-	}
-
-	protected boolean isHeaderVisible() {
-		return true;
-	}
-
-	protected Table getTable() {
-		return table;
-	}
-
-	public String[] getTableColumnNames() {
-		return COLUMN_NAMES;
-	}
-
-	abstract public String getTitle();
-
-	abstract public String getDescription();
-
-	abstract public Wizard getWizard();
-
-//	abstract public EReference getEReference();
-
-	abstract public Class getTableEntryObjectType();
-	
-	public List getObjectContainer() {
-		return new ArrayList();
-	}
-	
-	public AdapterFactory getAdapterFactory() { 
-		return new AdapterFactory() {
-			public Object[] getElements(Object inputElement) {
-				return new String[] { "" };
-			}
-			public String getColumnText(Object element, int columnIndex) {
-				return "";
-			}
-		};
-	};
-	
+    protected Button addButton;
 
+    protected Button editButton;
+
+    protected Button removeButton;
+    
+    protected List objectContainer;
+
+    public AbstractTableSection(Section section) {
+        super(section);
+    }
+
+    /**
+     * @param plan
+     * @param parent
+     * @param toolkit
+     * @param style
+     * 
+     * Subclasses should call createClient() in constructor
+     */
+    public AbstractTableSection(JAXBElement plan, Composite parent,
+            FormToolkit toolkit, int style) {
+        super(parent, toolkit, style, plan);
+    }
+
+    public void createClient() {
+
+        if (getTableEntryObjectType() == null)
+            throw new NullPointerException();
+        
+
+        getSection().setText(getTitle());
+        getSection().setDescription(getDescription());
+        getSection().setLayoutData(getSectionLayoutData());
+        Composite composite = createTableComposite(getSection());
+        getSection().setClient(composite);
+        table = createTable(composite);
+
+        tableViewer = new TableViewer(getTable());
+        tableViewer.setContentProvider(new ContentProvider(getAdapterFactory()));
+        tableViewer.setLabelProvider(new LabelProvider(getAdapterFactory()));
+        tableViewer.setInput(getInput());
+
+        tableViewer.addFilter(new ViewerFilter() {
+            public boolean select(Viewer viewer, Object parentElement,
+                    Object element) {
+                return AbstractTableSection.this.filter(viewer, parentElement, element);
+            }
+        });
+
+        if (getTableColumnNames().length > 0) {
+            tableViewer.setColumnProperties(getTableColumnNames());
+        }
+
+        Composite buttonComp = createButtonComposite(composite);
+        createAddButton(toolkit, buttonComp);
+        createRemoveButton(toolkit, buttonComp);
+        createEditButton(toolkit, buttonComp);
+
+    }
+
+    public Object getInput() {
+        return getPlan();
+    }
+
+    protected boolean filter(Viewer viewer, Object parentElement, Object element) {
+        return getTableEntryObjectType().isInstance(element);
+    }
+
+    protected Composite createTableComposite(Composite parent) {
+        Composite composite = toolkit.createComposite(parent);
+        composite.setLayout(getSectionCompositeLayout());
+        composite.setLayoutData(getTableCompositeLayoutData());
+        return composite;
+    }
+
+    protected GridData getSectionLayoutData() {
+        return new GridData(SWT.FILL, SWT.FILL, false, false);
+    }
+
+    protected GridData getTableCompositeLayoutData() {
+        return new GridData(SWT.FILL, SWT.FILL, false, false);
+    }
+
+    protected GridLayout getSectionCompositeLayout() {
+        GridLayout layout = new GridLayout();
+        layout.numColumns = 2;
+        layout.marginHeight = 5;
+        layout.marginWidth = 10;
+        layout.verticalSpacing = 5;
+        layout.horizontalSpacing = 15;
+        return layout;
+    }
+
+    protected Table createTable(Composite composite) {
+        Table table = new Table(composite, SWT.BORDER | SWT.FULL_SELECTION
+                | SWT.V_SCROLL | SWT.SINGLE);
+        if (isHeaderVisible()) {
+            table.setHeaderVisible(true);
+        }
+
+        GridData data = new GridData(SWT.FILL, SWT.FILL, false, false);
+        data.heightHint = 60;
+        data.widthHint = 400;
+        table.setLayoutData(data);
+
+        TableLayout tableLayout = new TableLayout();
+        table.setLayout(tableLayout);
+
+        for (int i = 0; i < getTableColumnNames().length; i++) {
+            tableLayout.addColumnData(new ColumnWeightData(35));
+            TableColumn tableColumn = new TableColumn(table, SWT.NONE);
+            tableColumn.setText(getTableColumnNames()[i]);
+        }
+
+        return table;
+    }
+
+    protected Composite createButtonComposite(Composite parent) {
+        Composite buttonComp = new Composite(parent, SWT.NONE);
+        GridLayout layout = new GridLayout();
+        layout.horizontalSpacing = 2;
+        layout.verticalSpacing = 2;
+        layout.marginWidth = 0;
+        layout.marginHeight = 0;
+        layout.numColumns = 1;
+        buttonComp.setLayout(layout);
+        buttonComp.setBackground(toolkit.getColors().getBackground());
+        buttonComp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
+        return buttonComp;
+    }
+
+    protected void createRemoveButton(FormToolkit toolkit, Composite buttonComp) {
+        removeButton = toolkit.createButton(buttonComp, CommonMessages.remove, SWT.NONE);
+        removeButton.addSelectionListener(new SelectionAdapter() {
+            public void widgetSelected(SelectionEvent e) {
+                int[] selectedIndices = table.getSelectionIndices();
+                for (int i = 0; i < selectedIndices.length; i++) {
+                    TableItem tableItem = table.getItem(selectedIndices[i]);
+                    Object type = tableItem.getData();
+                    removeItem (type);
+                    table.remove(selectedIndices[i]);
+                    getTableViewer().refresh();
+                    markDirty();
+                }
+            }
+        });
+        removeButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+    }
+
+    protected void createAddButton(FormToolkit toolkit, Composite buttonComp) {
+        addButton = toolkit.createButton(buttonComp, CommonMessages.add, SWT.NONE);
+
+        addButton.addSelectionListener(new SelectionAdapter() {
+            public void widgetSelected(SelectionEvent e) {
+                Wizard wizard = getWizard();
+                if (wizard != null) {
+                    WizardDialog dialog = new WizardDialog(Display.getCurrent().getActiveShell(), wizard);
+
+                    dialog.open();
+
+                    if (dialog.getReturnCode() == Dialog.OK) {
+                        getTableViewer().refresh();
+                        markDirty();
+                    }
+                }
+            }
+        });
+
+        addButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+    }
+
+    protected void createEditButton(FormToolkit toolkit, Composite buttonComp) {
+        editButton = toolkit.createButton(buttonComp, CommonMessages.edit, SWT.NONE);
+
+        editButton.addSelectionListener(new SelectionAdapter() {
+            public void widgetSelected(SelectionEvent e) {
+                Object o = ((StructuredSelection) getTableViewer().getSelection()).getFirstElement();
+                if (o != null) {
+                    Wizard wizard = getWizard();
+                    if (wizard != null) {
+                        if (wizard instanceof AbstractTableWizard) {
+                            ((AbstractTableWizard) wizard).setEObject(o);
+                        }
+                        WizardDialog dialog = new WizardDialog(Display.getCurrent().getActiveShell(), wizard);
+                        dialog.open();
+                        if (dialog.getReturnCode() == Dialog.OK) {
+                            getTableViewer().refresh();
+                            markDirty();
+                        }
+                    }
+                }
+            }
+        });
+
+        editButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+    }
+
+    public TableViewer getTableViewer() {
+        return tableViewer;
+    }
+
+    protected boolean isHeaderVisible() {
+        return true;
+    }
+
+    protected Table getTable() {
+        return table;
+    }
+
+    public String[] getTableColumnNames() {
+        return COLUMN_NAMES;
+    }
+
+    abstract public String getTitle();
+
+    abstract public String getDescription();
+
+    abstract public Wizard getWizard();
+
+    abstract public Class getTableEntryObjectType();
+
+    public void removeItem (Object anItem) {
+        getObjectContainer().remove(anItem);
+    }
+
+    public List getObjectContainer() {
+        if (objectContainer == null) {
+            objectContainer = new ArrayList();
+        }
+        return objectContainer;
+    }
+
+    public AdapterFactory getAdapterFactory() { 
+        return new AdapterFactory() {
+            public Object[] getElements(Object inputElement) {
+                if (!JAXBElement.class.isInstance(inputElement)) {
+                    return new String[] { "" };
+                }
+                return getObjectContainer().toArray();
+            }
+            public String getColumnText(Object element, int columnIndex) {
+                return "";
+            }
+        };
+    };
 }

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/wizards/AbstractTableWizard.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/wizards/AbstractTableWizard.java?rev=663673&r1=663672&r2=663673&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/wizards/AbstractTableWizard.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/wizards/AbstractTableWizard.java Thu Jun  5 10:38:37 2008
@@ -16,7 +16,6 @@
  */
 package org.apache.geronimo.st.ui.wizards;
 
-import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.geronimo.st.core.jaxb.JAXBObjectFactory;
@@ -39,159 +38,146 @@
  */
 public abstract class AbstractTableWizard extends Wizard implements TableWizard {
 
-	protected AbstractTableSection section;
+    protected AbstractTableSection section;
 
-	protected Object eObject;
+    protected Object eObject;
 
-	protected ImageDescriptor descriptor = Activator.imageDescriptorFromPlugin("org.apache.geronimo.ui", "icons/bigG.gif");
+    protected ImageDescriptor descriptor = Activator.imageDescriptorFromPlugin("org.apache.geronimo.ui", "icons/bigG.gif");
 
-	/**
-	 * 
-	 */
-	public AbstractTableWizard(AbstractTableSection section) {
-		super();
-		this.section = section;
-		setWindowTitle(getAddWizardWindowTitle());
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.wizard.Wizard#performFinish()
-	 */
-	public boolean performFinish() {
-
-		if (eObject == null) {
-			eObject = getEFactory().create(section.getTableEntryObjectType());
-			List container = section.getObjectContainer();
-			container.add(eObject);
-			System.out.println( "-==--=-=" + container );
-		}
-
-		processEAttributes(getPages()[0]);
-
-		return true;
-	}
-
-	public void processEAttributes(IWizardPage page) {
-		if (page instanceof DynamicWizardPage) {
-			for (int i = 0; i < getTableColumnEAttributes().length; i++) {
-				String value = ((DynamicWizardPage) page).textEntries[i].getText();
-				String attribute = getTableColumnEAttributes()[i];
-				JAXBUtils.setValue(eObject, attribute, value);
-//				if (attribute.getEContainingClass().equals(eObject.eClass())) {
-//					if (value != null && value.trim().length() != 0) {
-//						if(attribute.isMany()) {
-//							((EList) eObject.eGet(attribute)).add(value);
-//						} else {
-//							eObject.eSet(attribute, value);
-//						}
-//					}
-//				} else {
-//					// TODO
-//				}
-			}
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.wizard.IWizard#addPages()
-	 */
-	public void addPages() {
-		WizardPage page = new DynamicWizardPage("Page0");
-		page.setImageDescriptor(descriptor);
-		addPage(page);
-	}
-
-	/**
-	 * @param section
-	 */
-	public void setSection(AbstractTableSection section) {
-		this.section = section;
-	}
-
-	/**
-	 * @param object
-	 */
-	public void setEObject(Object object) {
-		eObject = object;
-	}
-
-	public class DynamicWizardPage extends WizardPage {
-
-		Text[] textEntries = new Text[getTableColumnEAttributes().length];
-
-		public DynamicWizardPage(String pageName) {
-			super(pageName);
-			setTitle(getWizardFirstPageTitle());
-			setDescription(getWizardFirstPageDescription());
-		}
-
-		public DynamicWizardPage(String pageName, String title,
-				ImageDescriptor titleImage) {
-			super(pageName, title, titleImage);
-		}
-
-		public void createControl(Composite parent) {
-			Composite composite = createComposite(parent);
-			for (int i = 0; i < section.getTableColumnNames().length; i++) {
-				Label label = new Label(composite, SWT.LEFT);
-				String columnName = section.getTableColumnNames()[i];
-				if (!columnName.endsWith(":"))
-					columnName = columnName.concat(":");
-				label.setText(columnName);
-				GridData data = new GridData();
-				data.horizontalAlignment = GridData.FILL;
-				label.setLayoutData(data);
-
-				Text text = new Text(composite, SWT.SINGLE | SWT.BORDER);
-				data = new GridData(GridData.HORIZONTAL_ALIGN_FILL
-						| GridData.VERTICAL_ALIGN_FILL);
-				data.grabExcessHorizontalSpace = true;
-				data.widthHint = 100;
-				text.setLayoutData(data);
-				if (eObject != null) {
-					String value = (String) JAXBUtils.getValue(eObject,getTableColumnEAttributes()[i]);
-					if (value != null) {
-						text.setText(value);
-					}
-				}
-				textEntries[i] = text;
-			}
-
-			doCustom(composite);
-			setControl(composite);
-			textEntries[0].setFocus();
-		}
-
-		public Composite createComposite(Composite parent) {
-			Composite composite = new Composite(parent, SWT.NULL);
-			GridLayout layout = new GridLayout();
-			layout.numColumns = 2;
-			composite.setLayout(layout);
-			GridData data = new GridData();
-			data.verticalAlignment = GridData.FILL;
-			data.horizontalAlignment = GridData.FILL;
-			data.widthHint = 300;
-			composite.setLayoutData(data);
-			return composite;
-		}
-
-		public void doCustom(Composite parent) {
-
-		}
-
-	}
-	
-	public String[] getTableColumnEAttributes() {
-		return new String[] { "", "" };
-	}
-
-	//todo: should be removed
-	public JAXBObjectFactory getEFactory() {
-		return null;
-	}
-	
+    /**
+     * 
+     */
+    public AbstractTableWizard(AbstractTableSection section) {
+        super();
+        this.section = section;
+        setWindowTitle(getAddWizardWindowTitle());
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.eclipse.jface.wizard.Wizard#performFinish()
+     */
+    public boolean performFinish() {
+
+        if (eObject == null) {
+            eObject = getEFactory().create(section.getTableEntryObjectType());
+            List objectContainer = section.getObjectContainer();
+            objectContainer.add(eObject);
+        }
+
+        processEAttributes(getPages()[0]);
+        
+        if (section.getTableViewer().getInput() == null) {
+            section.getTableViewer().setInput(section.getInput());
+        }
+        
+        return true;
+    }
+
+    public abstract String[] getTableColumnEAttributes();
+
+    public void processEAttributes(IWizardPage page) {
+        if (page instanceof DynamicWizardPage) {
+            for (int i = 0; i < getTableColumnEAttributes().length; i++) {
+                String value = ((DynamicWizardPage) page).textEntries[i].getText();
+                String attribute = getTableColumnEAttributes()[i];
+                JAXBUtils.setValue(eObject, attribute, value);
+            }
+        }
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.eclipse.jface.wizard.IWizard#addPages()
+     */
+    public void addPages() {
+        WizardPage page = new DynamicWizardPage("Page0");
+        page.setImageDescriptor(descriptor);
+        addPage(page);
+    }
+
+    /**
+     * @param section
+     */
+    public void setSection(AbstractTableSection section) {
+        this.section = section;
+    }
+
+    /**
+     * @param object
+     */
+    public void setEObject(Object object) {
+        eObject = object;
+    }
+
+    public class DynamicWizardPage extends WizardPage {
+
+        protected Text[] textEntries = new Text[getTableColumnEAttributes().length];
+
+        public DynamicWizardPage(String pageName) {
+            super(pageName);
+            setTitle(getWizardFirstPageTitle());
+            setDescription(getWizardFirstPageDescription());
+        }
+
+        public DynamicWizardPage(String pageName, String title,
+                ImageDescriptor titleImage) {
+            super(pageName, title, titleImage);
+        }
+
+        public void createControl(Composite parent) {
+            Composite composite = createComposite(parent);
+            for (int i = 0; i < section.getTableColumnNames().length; i++) {
+                Label label = new Label(composite, SWT.LEFT);
+                String columnName = section.getTableColumnNames()[i];
+                if (!columnName.endsWith(":"))
+                    columnName = columnName.concat(":");
+                label.setText(columnName);
+                GridData data = new GridData();
+                data.horizontalAlignment = GridData.FILL;
+                label.setLayoutData(data);
+
+                Text text = new Text(composite, SWT.SINGLE | SWT.BORDER);
+                data = new GridData(GridData.HORIZONTAL_ALIGN_FILL
+                        | GridData.VERTICAL_ALIGN_FILL);
+                data.grabExcessHorizontalSpace = true;
+                data.widthHint = 100;
+                text.setLayoutData(data);
+                if (eObject != null) {
+                    String value = (String) JAXBUtils.getValue(eObject,getTableColumnEAttributes()[i]);
+                    if (value != null) {
+                        text.setText(value);
+                    }
+                }
+                textEntries[i] = text;
+            }
+
+            doCustom(composite);
+            setControl(composite);
+            textEntries[0].setFocus();
+        }
+
+        public Composite createComposite(Composite parent) {
+            Composite composite = new Composite(parent, SWT.NULL);
+            GridLayout layout = new GridLayout();
+            layout.numColumns = 2;
+            composite.setLayout(layout);
+            GridData data = new GridData();
+            data.verticalAlignment = GridData.FILL;
+            data.horizontalAlignment = GridData.FILL;
+            data.widthHint = 300;
+            composite.setLayoutData(data);
+            return composite;
+        }
+
+        public void doCustom(Composite parent) {
+
+        }
+
+        public Text getTextEntry (int object) {
+            return textEntries[object];
+        }   
+    }
 }

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/jaxb/JAXBModelUtils.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/jaxb/JAXBModelUtils.java?rev=663673&r1=663672&r2=663673&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/jaxb/JAXBModelUtils.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/jaxb/JAXBModelUtils.java Thu Jun  5 10:38:37 2008
@@ -18,61 +18,121 @@
 
 import java.util.List;
 
-import javax.xml.bind.JAXBContext;
 import javax.xml.bind.JAXBElement;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Unmarshaller;
 
+import org.apache.geronimo.jee.application.Application;
+import org.apache.geronimo.jee.connector.Connector;
 import org.apache.geronimo.jee.deployment.Environment;
+import org.apache.geronimo.jee.openejb.OpenejbJar;
 import org.apache.geronimo.jee.security.Security;
 import org.apache.geronimo.jee.web.WebApp;
-import org.apache.geronimo.st.v21.core.Activator;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
 
 /**
  * @version $Rev$ $Date$
  */
 public class JAXBModelUtils {
 	
-	public static Security getSecurity(JAXBElement element) {
-		Object plan = element.getValue();
-		if ( WebApp.class.isInstance( plan ) ) {
-			return ((WebApp)plan).getSecurity() == null ? null : (Security)((WebApp)plan).getSecurity().getValue();
-		}
-		return null;
-	}
-	
-	public static void setSecurity(JAXBElement element, Security security) {
-		Object plan = element.getValue();
-		if ( WebApp.class.isInstance( plan ) ) {
-			((WebApp)plan).setSecurity((new org.apache.geronimo.jee.security.ObjectFactory()).createSecurity( security ) );
-		}
-	}
-	
-	public static Environment getEnvironment(JAXBElement element) {
-		Object plan = element.getValue();
-		if ( WebApp.class.isInstance( plan ) ) {
-			System.out.println( "Element : " + ((WebApp)plan).getEnvironment() );
-			return ((WebApp)plan).getEnvironment() == null ? null : ((WebApp)plan).getEnvironment();
-		}
-		return null;
-	}
-	
-	public static List getServiceOrPersistence(JAXBElement element) {
-		Object plan = element.getValue();
-		if ( WebApp.class.isInstance( plan ) ) {
-			return ((WebApp)plan).getServiceOrPersistence() == null ? null : ((WebApp)plan).getServiceOrPersistence();
-		}
-		return null;
-	}
-	
-	public static List getGbeans(JAXBElement element) {
-		Object plan = element.getValue();
-		if ( WebApp.class.isInstance( plan ) ) {
-//			return ((WebApp)plan).getGbeans() == null ? null : ((WebApp)plan).getGbeans();
-		}
-		return null;
-	}
+    
+    public static Security getSecurity (JAXBElement element) {
+        Object plan = element.getValue();
+        if (WebApp.class.isInstance (plan)) {
+            if (((WebApp)plan).getSecurity() == null) {
+                setSecurity (element, new org.apache.geronimo.jee.security.ObjectFactory().createSecurity());
+            }
+            Security security = (Security)((WebApp)plan).getSecurity().getValue();
+            if (security.getRoleMappings() == null) {
+                security.setRoleMappings (new org.apache.geronimo.jee.security.ObjectFactory().createRoleMappings());
+            }
+            return security;
+        } else if (Application.class.isInstance (plan)) {
+            if (((Application)plan).getSecurity() == null) {
+                setSecurity (element, new org.apache.geronimo.jee.security.ObjectFactory().createSecurity());
+            }
+            Security security = (Security)((Application)plan).getSecurity().getValue();
+            if (security.getRoleMappings() == null) {
+                security.setRoleMappings (new org.apache.geronimo.jee.security.ObjectFactory().createRoleMappings());
+            }
+            return security;
+        } else if (OpenejbJar.class.isInstance (plan)) {
+            if (((OpenejbJar)plan).getSecurity() == null) {
+                setSecurity (element, new org.apache.geronimo.jee.security.ObjectFactory().createSecurity());
+            }
+            Security security = (Security)((OpenejbJar)plan).getSecurity().getValue();
+            if (security.getRoleMappings() == null) {
+                security.setRoleMappings (new org.apache.geronimo.jee.security.ObjectFactory().createRoleMappings());
+            }
+            return security;
+        }
+        return null;
+    }
+    
+    public static void setSecurity (JAXBElement element, Security security) {
+        Object plan = element.getValue();
+        if ( WebApp.class.isInstance( plan ) ) {
+            ((WebApp)plan).setSecurity((new org.apache.geronimo.jee.security.ObjectFactory()).createSecurity( security ) );
+        } else if (Application.class.isInstance(plan)) {
+            ((Application)plan).setSecurity((new org.apache.geronimo.jee.security.ObjectFactory()).createSecurity( security ) );
+        } else if (OpenejbJar.class.isInstance(plan)) {
+            ((OpenejbJar)plan).setSecurity((new org.apache.geronimo.jee.security.ObjectFactory()).createSecurity( security ) );
+        }
+    }
+    
+    public static Environment getEnvironment(JAXBElement element) {
+        Object plan = element.getValue();
+        if (WebApp.class.isInstance (plan)) {
+            return ((WebApp)plan).getEnvironment() == null ? null : ((WebApp)plan).getEnvironment();
+        }
+        else if (Application.class.isInstance (plan)) {
+            return ((Application)plan).getEnvironment() == null ? null : ((Application)plan).getEnvironment();
+        }
+        else if (OpenejbJar.class.isInstance (plan)) {
+            return ((OpenejbJar)plan).getEnvironment() == null ? null : ((OpenejbJar)plan).getEnvironment();
+        }
+        else if (Connector.class.isInstance (plan)) {
+            return ((Connector)plan).getEnvironment() == null ? null : ((Connector)plan).getEnvironment();
+        }
+        return null;
+    }
+    
+    public static void setEnvironment (JAXBElement element, Environment environment) {
+        Object plan = element.getValue();
+        if (WebApp.class.isInstance (plan)) {
+            ((WebApp)plan).setEnvironment (environment);
+        }
+        else if (Application.class.isInstance (plan)) {
+            ((Application)plan).setEnvironment (environment);
+        }
+        else if (OpenejbJar.class.isInstance (plan)) {
+            ((OpenejbJar)plan).setEnvironment (environment);
+        }
+        else if (Connector.class.isInstance (plan)) {
+            ((Connector)plan).setEnvironment (environment);
+        }
+    }
+
+    public static List getGbeans (JAXBElement element) {
+        Object plan = element.getValue();
+        if (WebApp.class.isInstance (plan)) {
+            return ((WebApp)plan).getServiceOrPersistence() == null ? null : ((WebApp)plan).getServiceOrPersistence();
+        }
+        else if (Application.class.isInstance (plan)) {
+            return ((Application)plan).getService() == null ? null : ((Application)plan).getService();
+        }
+        else if (OpenejbJar.class.isInstance (plan)) {
+            return ((OpenejbJar)plan).getService() == null ? null : ((OpenejbJar)plan).getService();
+        }
+        else if (Connector.class.isInstance (plan)) {
+            return ((Connector)plan).getService() == null ? null : ((Connector)plan).getService();
+        }
+        return null;
+    }
+
+    public static List getGbeanRefs (JAXBElement element) {
+        Object plan = element.getValue();
+        if (WebApp.class.isInstance (plan)) {
+            return ((WebApp)plan).getServiceOrPersistence() == null ? null : ((WebApp)plan).getServiceOrPersistence();
+        }
+        return null;
+    }
 
 }

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/jaxb/JAXBObjectFactoryImpl.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/jaxb/JAXBObjectFactoryImpl.java?rev=663673&r1=663672&r2=663673&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/jaxb/JAXBObjectFactoryImpl.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/jaxb/JAXBObjectFactoryImpl.java Thu Jun  5 10:38:37 2008
@@ -20,9 +20,14 @@
 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.Gbean;
-import org.apache.geronimo.jee.naming.ObjectFactory;
+import org.apache.geronimo.jee.naming.EjbRef;
+import org.apache.geronimo.jee.naming.EjbLocalRef;
+import org.apache.geronimo.jee.naming.GbeanRef;
+import org.apache.geronimo.jee.naming.ResourceEnvRef;
 import org.apache.geronimo.jee.naming.ResourceRef;
+import org.apache.geronimo.jee.naming.ServiceRef;
 import org.apache.geronimo.jee.security.Description;
 import org.apache.geronimo.jee.security.RoleMappings;
 import org.apache.geronimo.jee.security.Role;
@@ -33,39 +38,50 @@
  */
 public class JAXBObjectFactoryImpl implements JAXBObjectFactory {
 
-	private static JAXBObjectFactoryImpl instance = new JAXBObjectFactoryImpl();
-	
-	private JAXBObjectFactoryImpl() {
-		
-	}
-	
-	public static JAXBObjectFactoryImpl getInstance() {
-		return instance;
-	}
-	
-	public Object create(Class type) {
-		System.out.println( type );
-		if ( type.equals( ResourceRef.class ) ) {
-			return (new ObjectFactory()).createResourceRef();
-		} else if ( type.equals( Security.class ) ) {
-			return (new org.apache.geronimo.jee.security.ObjectFactory()).createSecurity();
-		} else if ( type.equals( RoleMappings.class ) ) {
-			return (new org.apache.geronimo.jee.security.ObjectFactory()).createRoleMappings();
-		} else if ( type.equals( Description.class ) ) {
-			return (new org.apache.geronimo.jee.security.ObjectFactory()).createDescription();
-		} else if ( type.equals( Role.class ) ) {
-			return (new org.apache.geronimo.jee.security.ObjectFactory()).createRole();
-		} else if ( type.equals( Gbean.class ) ) {
-			return (new org.apache.geronimo.jee.deployment.ObjectFactory()).createGbean();
-		} else if ( type.equals( Artifact.class ) ) {
-			return (new org.apache.geronimo.jee.deployment.ObjectFactory()).createArtifact();
-		} else if ( type.equals( Dependencies.class ) ) {
-			return (new org.apache.geronimo.jee.deployment.ObjectFactory()).createDependencies();
-		} else if ( type.equals( Dependency.class ) ) {
-			return (new org.apache.geronimo.jee.deployment.ObjectFactory()).createDependency();
-		}
-		
-		return null;
-	}
+    private static JAXBObjectFactoryImpl instance = new JAXBObjectFactoryImpl();
+    
+    private JAXBObjectFactoryImpl() {
+        
+    }
+    
+    public static JAXBObjectFactoryImpl getInstance() {
+        return instance;
+    }
+    
+    public Object create(Class type) {
+        if ( type.equals( ResourceRef.class ) ) {
+            return (new org.apache.geronimo.jee.naming.ObjectFactory()).createResourceRef();
+        } else if ( type.equals( ResourceEnvRef.class ) ) {
+            return (new org.apache.geronimo.jee.naming.ObjectFactory()).createResourceEnvRef();
+        } else if ( type.equals( EjbRef.class ) ) {
+            return (new org.apache.geronimo.jee.naming.ObjectFactory()).createEjbRef();
+        } else if ( type.equals( GbeanRef.class ) ) {
+            return (new org.apache.geronimo.jee.naming.ObjectFactory()).createGbeanRef();
+        } else if ( type.equals( ServiceRef.class ) ) {
+            return (new org.apache.geronimo.jee.naming.ObjectFactory()).createServiceRef();
+        } else if ( type.equals( EjbLocalRef.class ) ) {
+            return (new org.apache.geronimo.jee.naming.ObjectFactory()).createEjbLocalRef();
+        } else if ( type.equals( Security.class ) ) {
+            return (new org.apache.geronimo.jee.security.ObjectFactory()).createSecurity();
+        } else if ( type.equals( RoleMappings.class ) ) {
+            return (new org.apache.geronimo.jee.security.ObjectFactory()).createRoleMappings();
+        } else if ( type.equals( Description.class ) ) {
+            return (new org.apache.geronimo.jee.security.ObjectFactory()).createDescription();
+        } else if ( type.equals( Role.class ) ) {
+            return (new org.apache.geronimo.jee.security.ObjectFactory()).createRole();
+        } else if ( type.equals( Gbean.class ) ) {
+            return (new org.apache.geronimo.jee.deployment.ObjectFactory()).createGbean();
+        } else if ( type.equals( Artifact.class ) ) {
+            return (new org.apache.geronimo.jee.deployment.ObjectFactory()).createArtifact();
+        } else if ( type.equals( Dependencies.class ) ) {
+            return (new org.apache.geronimo.jee.deployment.ObjectFactory()).createDependencies();
+        } else if ( type.equals( Dependency.class ) ) {
+            return (new org.apache.geronimo.jee.deployment.ObjectFactory()).createDependency();
+        } else if ( type.equals( Environment.class ) ) {
+            return (new org.apache.geronimo.jee.deployment.ObjectFactory()).createEnvironment();
+        }
+        
+        return null;
+    }
 
 }

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/editors/GeronimoFormContentLoader.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/editors/GeronimoFormContentLoader.java?rev=663673&r1=663672&r2=663673&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/editors/GeronimoFormContentLoader.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/editors/GeronimoFormContentLoader.java Thu Jun  5 10:38:37 2008
@@ -1,171 +1,171 @@
-/*
- * 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.editors;
-
-import java.io.IOException;
-
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.JAXBException;
-
-import org.apache.geronimo.jee.security.Security;
-import org.apache.geronimo.st.core.jaxb.JAXBUtils;
-import org.apache.geronimo.st.ui.CommonMessages;
-import org.apache.geronimo.st.ui.editors.AbstractGeronimoDeploymentPlanEditor;
-import org.apache.geronimo.st.ui.editors.AbstractGeronimoFormContentLoader;
-import org.apache.geronimo.st.v21.core.GeronimoV21Utils;
-import org.apache.geronimo.st.v21.core.jaxb.JAXBModelUtils;
-import org.apache.geronimo.st.v21.ui.pages.AppGeneralPage;
-import org.apache.geronimo.st.v21.ui.pages.ConnectorOverviewPage;
-import org.apache.geronimo.st.v21.ui.pages.DeploymentPage;
-import org.apache.geronimo.st.v21.ui.pages.EjbOverviewPage;
-import org.apache.geronimo.st.v21.ui.pages.NamingFormPage;
-import org.apache.geronimo.st.v21.ui.pages.SecurityPage;
-import org.apache.geronimo.st.v21.ui.pages.WebGeneralPage;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.forms.editor.FormEditor;
-import org.eclipse.ui.forms.editor.FormPage;
-
-public class GeronimoFormContentLoader extends AbstractGeronimoFormContentLoader {
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.st.ui.editors.AbstractGeronimoFormContentLoader#addApplicationPlanPages(org.eclipse.ui.forms.editor.FormEditor)
-	 */
-	public void addApplicationPlanPages(FormEditor editor) throws PartInitException {
-		editor.addPage(new AppGeneralPage(editor, "appgeneralpage", CommonMessages.editorTabGeneral));
-		editor.addPage(new SecurityPage(editor, "securitypage", CommonMessages.editorTabSecurity, null));
-		editor.addPage(getApplicationDeploymentPage(editor));
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.st.ui.editors.AbstractGeronimoFormContentLoader#addConnectorPlanPages(org.eclipse.ui.forms.editor.FormEditor)
-	 */
-	public void addConnectorPlanPages(FormEditor editor) throws PartInitException {
-		editor.addPage(new ConnectorOverviewPage(editor, "connectoroverview", CommonMessages.editorTabGeneral));
-		editor.addPage(getConnectorDeploymentPage(editor));
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.st.ui.editors.AbstractGeronimoFormContentLoader#addApplicationPlanPages(org.eclipse.ui.forms.editor.FormEditor)
-	 */
-	public void addApplicationClientPlanPages(FormEditor editor) throws PartInitException {
-		editor.addPage(new AppGeneralPage(editor, "appgeneralpage", CommonMessages.editorTabGeneral));
-		editor.addPage(new SecurityPage(editor, "securitypage", CommonMessages.editorTabSecurity, null));
-		editor.addPage(getApplicationDeploymentPage(editor));
-	}
-
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.st.ui.editors.AbstractGeronimoFormContentLoader#addOpenEjbPlanPages()
-	 */
-	public void addOpenEjbPlanPages(FormEditor editor) throws PartInitException {
-		editor.addPage(new EjbOverviewPage(editor, "ejboverview", CommonMessages.editorTabGeneral));
-		// TODO Add naming page but broken down for each bean type
-		editor.addPage(new SecurityPage(editor, "securitypage", CommonMessages.editorTabSecurity, null));
-		editor.addPage(getEjbJarDeploymentPage(editor));
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.st.ui.editors.AbstractGeronimoFormContentLoader#addWebPlanPages()
-	 */
-	public void addWebPlanPages(FormEditor editor) throws PartInitException {
-		AbstractGeronimoDeploymentPlanEditor geronimoEditor = (AbstractGeronimoDeploymentPlanEditor)editor;
-		JAXBElement plan = geronimoEditor.getDeploymentPlan();
-		editor.addPage(new WebGeneralPage(editor, "generalpage", CommonMessages.editorTabGeneral));
-		editor.addPage(getWebNamingPage(editor));
-		editor.addPage(new SecurityPage(editor, "securitypage", CommonMessages.editorTabSecurity, (Security)JAXBModelUtils.getSecurity( plan )));
-		editor.addPage(getWebDeploymentPage(editor));
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.st.ui.editors.IGeronimoFormContentLoader#loadDeploymentPlan(org.eclipse.core.resources.IFile)
-	 */
-	public JAXBElement loadDeploymentPlan(IFile file) {
-		return GeronimoV21Utils.getDeploymentPlan(file);
-	}
-	
-	public void saveDeploymentPlan(JAXBElement deploymentPlan, IFile file) throws IOException, JAXBException {
-		JAXBUtils.marshalDeploymentPlan(deploymentPlan, file);
-	}
-
-	protected FormPage getWebNamingPage(FormEditor editor) {
-		NamingFormPage formPage = createNamingFormPage(editor);
-//		WebPackage pkg = null; //WebFactory.eINSTANCE.getWebPackage();
-//		formPage.ejbLocalRef = pkg.getWebApp_EjbLocalRef();
-//		formPage.ejbRef = pkg.getWebApp_EjbRef();
-//		formPage.resEnvRef = pkg.getWebApp_ResourceEnvRef();
-//		formPage.resRef = pkg.getWebApp_ResourceRef();
-//		formPage.gbeanRef = pkg.getWebApp_GbeanRef();
-//		formPage.serviceRef = pkg.getWebApp_ServiceRef();
-		return formPage;
-	}
-
-	protected FormPage getWebDeploymentPage(FormEditor editor) {
-		DeploymentPage formPage = createDeploymentFormPage(editor);
-//		formPage.environment = WebFactory.eINSTANCE.getWebPackage().getWebApp_Environment();
-//		formPage.gbeanERef = WebFactory.eINSTANCE.getWebPackage().getWebApp_Gbean();
-		return formPage;
-	}
-
-	private FormPage getEjbJarDeploymentPage(FormEditor editor) {
-		DeploymentPage formPage = createDeploymentFormPage(editor);
-//		formPage.environment = JarFactory.eINSTANCE.getJarPackage().getOpenejbJarType_Environment();
-//		formPage.gbeanERef = JarFactory.eINSTANCE.getJarPackage().getOpenejbJarType_Gbean();
-		return formPage;
-	}
-
-	protected FormPage getApplicationDeploymentPage(FormEditor editor) {
-		DeploymentPage formPage = createDeploymentFormPage(editor);
-//		formPage.environment = ApplicationFactory.eINSTANCE.getApplicationPackage().getApplicationType_Environment();
-//		formPage.gbeanERef = ApplicationFactory.eINSTANCE.getApplicationPackage().getApplicationType_Gbean();
-		return formPage;
-	}
-
-	private FormPage getConnectorDeploymentPage(FormEditor editor) {
-		DeploymentPage formPage = createDeploymentFormPage(editor);
-//		formPage.environment = ConnectorFactory.eINSTANCE.getConnectorPackage().getConnectorType_Environment();
-//		formPage.gbeanERef = ConnectorFactory.eINSTANCE.getConnectorPackage().getConnectorType_Gbean();
-		return formPage;
-	}
-
-	protected FormPage getApplicationClientDeploymentPage(FormEditor editor) {
-		DeploymentPage formPage = createDeploymentFormPage(editor);
-//		formPage.environment = ApplicationFactory.eINSTANCE.getApplicationPackage().getApplicationType_Environment();
-//		formPage.gbeanERef = ApplicationFactory.eINSTANCE.getApplicationPackage().getApplicationType_Gbean();
-		return formPage;
-	}
-
-	private NamingFormPage createNamingFormPage(FormEditor editor) {
-		return new NamingFormPage(editor, "namingpage", CommonMessages.editorTabNaming);
-	}
-
-	private DeploymentPage createDeploymentFormPage(FormEditor editor) {
-		return new DeploymentPage(editor, "deploymentpage", CommonMessages.editorTabDeployment);
-	}
-}
+/*
+ * 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.editors;
+
+import java.io.IOException;
+
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.JAXBException;
+
+import org.apache.geronimo.jee.security.Security;
+import org.apache.geronimo.st.core.jaxb.JAXBUtils;
+import org.apache.geronimo.st.ui.CommonMessages;
+import org.apache.geronimo.st.ui.editors.AbstractGeronimoDeploymentPlanEditor;
+import org.apache.geronimo.st.ui.editors.AbstractGeronimoFormContentLoader;
+import org.apache.geronimo.st.v21.core.GeronimoV21Utils;
+import org.apache.geronimo.st.v21.core.jaxb.JAXBModelUtils;
+import org.apache.geronimo.st.v21.ui.pages.AppGeneralPage;
+import org.apache.geronimo.st.v21.ui.pages.ConnectorOverviewPage;
+import org.apache.geronimo.st.v21.ui.pages.DeploymentPage;
+import org.apache.geronimo.st.v21.ui.pages.EjbOverviewPage;
+import org.apache.geronimo.st.v21.ui.pages.NamingFormPage;
+import org.apache.geronimo.st.v21.ui.pages.SecurityPage;
+import org.apache.geronimo.st.v21.ui.pages.WebGeneralPage;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.forms.editor.FormEditor;
+import org.eclipse.ui.forms.editor.FormPage;
+
+public class GeronimoFormContentLoader extends AbstractGeronimoFormContentLoader {
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.st.ui.editors.AbstractGeronimoFormContentLoader#addApplicationPlanPages(org.eclipse.ui.forms.editor.FormEditor)
+     */
+    public void addApplicationPlanPages(FormEditor editor) throws PartInitException {
+        editor.addPage(new AppGeneralPage(editor, "appgeneralpage", CommonMessages.editorTabGeneral));
+        editor.addPage(new SecurityPage(editor, "securitypage", CommonMessages.editorTabSecurity));
+        editor.addPage(getApplicationDeploymentPage(editor));
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.st.ui.editors.AbstractGeronimoFormContentLoader#addConnectorPlanPages(org.eclipse.ui.forms.editor.FormEditor)
+     */
+    public void addConnectorPlanPages(FormEditor editor) throws PartInitException {
+        editor.addPage(new ConnectorOverviewPage(editor, "connectoroverview", CommonMessages.editorTabGeneral));
+        editor.addPage(getConnectorDeploymentPage(editor));
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.st.ui.editors.AbstractGeronimoFormContentLoader#addApplicationPlanPages(org.eclipse.ui.forms.editor.FormEditor)
+     */
+    public void addApplicationClientPlanPages(FormEditor editor) throws PartInitException {
+        editor.addPage(new AppGeneralPage(editor, "appgeneralpage", CommonMessages.editorTabGeneral));
+        editor.addPage(new SecurityPage(editor, "securitypage", CommonMessages.editorTabSecurity));
+        editor.addPage(getApplicationDeploymentPage(editor));
+    }
+
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.st.ui.editors.AbstractGeronimoFormContentLoader#addOpenEjbPlanPages()
+     */
+    public void addOpenEjbPlanPages(FormEditor editor) throws PartInitException {
+        editor.addPage(new EjbOverviewPage(editor, "ejboverview", CommonMessages.editorTabGeneral));
+        // TODO Add naming page but broken down for each bean type
+        editor.addPage(new SecurityPage(editor, "securitypage", CommonMessages.editorTabSecurity));
+        editor.addPage(getEjbJarDeploymentPage(editor));
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.st.ui.editors.AbstractGeronimoFormContentLoader#addWebPlanPages()
+     */
+    public void addWebPlanPages(FormEditor editor) throws PartInitException {
+        AbstractGeronimoDeploymentPlanEditor geronimoEditor = (AbstractGeronimoDeploymentPlanEditor)editor;
+        JAXBElement plan = geronimoEditor.getDeploymentPlan();
+        editor.addPage(new WebGeneralPage(editor, "generalpage", CommonMessages.editorTabGeneral));
+        editor.addPage(getWebNamingPage(editor));
+        editor.addPage(new SecurityPage(editor, "securitypage", CommonMessages.editorTabSecurity));
+        editor.addPage(getWebDeploymentPage(editor));
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.st.ui.editors.IGeronimoFormContentLoader#loadDeploymentPlan(org.eclipse.core.resources.IFile)
+     */
+    public JAXBElement loadDeploymentPlan(IFile file) {
+        return GeronimoV21Utils.getDeploymentPlan(file);
+    }
+    
+    public void saveDeploymentPlan(JAXBElement deploymentPlan, IFile file) throws IOException, JAXBException {
+        JAXBUtils.marshalDeploymentPlan(deploymentPlan, file);
+    }
+
+    protected FormPage getWebNamingPage(FormEditor editor) {
+        NamingFormPage formPage = createNamingFormPage(editor);
+//        WebPackage pkg = null; //WebFactory.eINSTANCE.getWebPackage();
+//        formPage.ejbLocalRef = pkg.getWebApp_EjbLocalRef();
+//        formPage.ejbRef = pkg.getWebApp_EjbRef();
+//        formPage.resEnvRef = pkg.getWebApp_ResourceEnvRef();
+//        formPage.resRef = pkg.getWebApp_ResourceRef();
+//        formPage.gbeanRef = pkg.getWebApp_GbeanRef();
+//        formPage.serviceRef = pkg.getWebApp_ServiceRef();
+        return formPage;
+    }
+
+    protected FormPage getWebDeploymentPage(FormEditor editor) {
+        DeploymentPage formPage = createDeploymentFormPage(editor);
+//        formPage.environment = WebFactory.eINSTANCE.getWebPackage().getWebApp_Environment();
+//        formPage.gbeanERef = WebFactory.eINSTANCE.getWebPackage().getWebApp_Gbean();
+        return formPage;
+    }
+
+    private FormPage getEjbJarDeploymentPage(FormEditor editor) {
+        DeploymentPage formPage = createDeploymentFormPage(editor);
+//        formPage.environment = JarFactory.eINSTANCE.getJarPackage().getOpenejbJarType_Environment();
+//        formPage.gbeanERef = JarFactory.eINSTANCE.getJarPackage().getOpenejbJarType_Gbean();
+        return formPage;
+    }
+
+    protected FormPage getApplicationDeploymentPage(FormEditor editor) {
+        DeploymentPage formPage = createDeploymentFormPage(editor);
+//        formPage.environment = ApplicationFactory.eINSTANCE.getApplicationPackage().getApplicationType_Environment();
+//        formPage.gbeanERef = ApplicationFactory.eINSTANCE.getApplicationPackage().getApplicationType_Gbean();
+        return formPage;
+    }
+
+    private FormPage getConnectorDeploymentPage(FormEditor editor) {
+        DeploymentPage formPage = createDeploymentFormPage(editor);
+//        formPage.environment = ConnectorFactory.eINSTANCE.getConnectorPackage().getConnectorType_Environment();
+//        formPage.gbeanERef = ConnectorFactory.eINSTANCE.getConnectorPackage().getConnectorType_Gbean();
+        return formPage;
+    }
+
+    protected FormPage getApplicationClientDeploymentPage(FormEditor editor) {
+        DeploymentPage formPage = createDeploymentFormPage(editor);
+//        formPage.environment = ApplicationFactory.eINSTANCE.getApplicationPackage().getApplicationType_Environment();
+//        formPage.gbeanERef = ApplicationFactory.eINSTANCE.getApplicationPackage().getApplicationType_Gbean();
+        return formPage;
+    }
+
+    private NamingFormPage createNamingFormPage(FormEditor editor) {
+        return new NamingFormPage(editor, "namingpage", CommonMessages.editorTabNaming);
+    }
+
+    private DeploymentPage createDeploymentFormPage(FormEditor editor) {
+        return new DeploymentPage(editor, "deploymentpage", CommonMessages.editorTabDeployment);
+    }
+}

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/NamingFormPage.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/NamingFormPage.java?rev=663673&r1=663672&r2=663673&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/NamingFormPage.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/NamingFormPage.java Thu Jun  5 10:38:37 2008
@@ -1,78 +1,83 @@
-/*
- * 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 java.util.List;
-
-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.ui.sections.EjbLocalRefSection;
-import org.apache.geronimo.st.v21.ui.sections.EjbRefSection;
-import org.apache.geronimo.st.v21.ui.sections.GBeanRefSection;
-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.ui.forms.IManagedForm;
-import org.eclipse.ui.forms.editor.FormEditor;
-
-public class NamingFormPage extends AbstractGeronimoFormPage {
-
-	public List resRefs;
-
-	public List resEnvRefs;
-
-	public List ejbRefs;
-
-	public List ejbLocalRefs;
-
-	public List gbeanRefs;
-
-	public List serviceRefs;
-
-	public NamingFormPage(FormEditor editor, String id, String title) {
-		super(editor, id, title);
-		WebApp webapp = (WebApp)((AbstractGeronimoDeploymentPlanEditor) getEditor()).getDeploymentPlan().getValue();
-		resRefs = webapp.getResourceRef();
-		serviceRefs = webapp.getServiceRef();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.pages.AbstractGeronimoFormPage#fillBody(org.eclipse.ui.forms.IManagedForm)
-	 */
-	protected void fillBody(IManagedForm managedForm) {
-		managedForm.addPart(new ResourceRefSection(getDeploymentPlan(), body, toolkit, getStyle(), resRefs));
-		managedForm.addPart(new ResourceEnvRefSection(getDeploymentPlan(), body, toolkit, getStyle(), resEnvRefs));
-		managedForm.addPart(new EjbRefSection(getDeploymentPlan(), body, toolkit, getStyle(), ejbRefs));
-		managedForm.addPart(new EjbLocalRefSection(getDeploymentPlan(), body, toolkit, getStyle(), ejbLocalRefs));
-		managedForm.addPart(new GBeanRefSection(getDeploymentPlan(), body, toolkit, getStyle(), gbeanRefs));
-		managedForm.addPart(new ServiceRefSection(getDeploymentPlan(), body, toolkit, getStyle(), serviceRefs));
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.pages.AbstractGeronimoFormPage#getFormTitle()
-	 */
-	public String getFormTitle() {
-		return CommonMessages.namingFormPageTitle;
-	}
-
-}
+/*
+ * 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 java.util.List;
+
+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.ui.sections.EjbLocalRefSection;
+import org.apache.geronimo.st.v21.ui.sections.EjbRefSection;
+import org.apache.geronimo.st.v21.ui.sections.GBeanRefSection;
+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.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.editor.FormEditor;
+
+public class NamingFormPage extends AbstractGeronimoFormPage {
+
+    public List resRefs;
+
+    public List resEnvRefs;
+
+    public List ejbRefs;
+
+    public List ejbLocalRefs;
+
+    //ServiceOrPersistence is already handled on the Dependency Page.
+    //public List gbeanRefs;
+
+    public List serviceRefs;
+
+    public NamingFormPage(FormEditor editor, String id, String title) {
+        super(editor, id, title);
+        WebApp webapp = (WebApp)((AbstractGeronimoDeploymentPlanEditor) getEditor()).getDeploymentPlan().getValue();
+        resRefs = webapp.getResourceRef();
+        resEnvRefs = webapp.getResourceEnvRef();
+        ejbRefs = webapp.getEjbRef();
+        ejbLocalRefs = webapp.getEjbLocalRef();
+        //gbeanRefs = webapp.getServiceOrPersistence();
+        serviceRefs = webapp.getServiceRef();       
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.ui.pages.AbstractGeronimoFormPage#fillBody(org.eclipse.ui.forms.IManagedForm)
+     */
+    protected void fillBody(IManagedForm managedForm) {
+        managedForm.addPart(new ResourceRefSection(getDeploymentPlan(), body, toolkit, getStyle(), resRefs));
+        managedForm.addPart(new ResourceEnvRefSection(getDeploymentPlan(), body, toolkit, getStyle(), resEnvRefs));
+        managedForm.addPart(new EjbRefSection(getDeploymentPlan(), body, toolkit, getStyle(), ejbRefs));
+        managedForm.addPart(new EjbLocalRefSection(getDeploymentPlan(), body, toolkit, getStyle(), ejbLocalRefs));
+        //managedForm.addPart(new GBeanRefSection(getDeploymentPlan(), body, toolkit, getStyle(), gbeanRefs));
+        managedForm.addPart(new ServiceRefSection(getDeploymentPlan(), body, toolkit, getStyle(), serviceRefs));
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.ui.pages.AbstractGeronimoFormPage#getFormTitle()
+     */
+    public String getFormTitle() {
+        return CommonMessages.namingFormPageTitle;
+    }
+
+}

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.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.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/SecurityPage.java?rev=663673&r1=663672&r2=663673&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/SecurityPage.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/pages/SecurityPage.java Thu Jun  5 10:38:37 2008
@@ -1,67 +1,66 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.geronimo.st.v21.ui.pages;
-
-import org.apache.geronimo.st.ui.CommonMessages;
-import org.apache.geronimo.st.ui.pages.AbstractGeronimoFormPage;
-import org.apache.geronimo.st.v21.ui.sections.SecurityRootSection;
-import org.apache.geronimo.st.v21.ui.sections.SecuritySection;
-import org.apache.geronimo.jee.security.Security;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.ui.forms.IManagedForm;
-import org.eclipse.ui.forms.editor.FormEditor;
-
-public class SecurityPage extends AbstractGeronimoFormPage {
-
-	public Security security;
-
-	public SecurityPage(FormEditor editor, String id, String title, Security security) {
-		super(editor, id, title);
-		this.security = security;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.pages.AbstractGeronimoFormPage#fillBody(org.eclipse.ui.forms.IManagedForm)
-	 */
-	protected void fillBody(IManagedForm managedForm) {
-		managedForm.addPart(new SecurityRootSection(body, toolkit, getStyle(), getDeploymentPlan(), security));
-		managedForm.addPart(new SecuritySection(getDeploymentPlan(), body, toolkit, getStyle(), security == null ? null : security.getRoleMappings()));
-	}
-
-	/*
-	 * (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;
-	}
-
-}
+/*
+ * 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.security.Security;
+import org.apache.geronimo.st.ui.CommonMessages;
+import org.apache.geronimo.st.ui.pages.AbstractGeronimoFormPage;
+import org.apache.geronimo.st.v21.core.jaxb.JAXBModelUtils;
+import org.apache.geronimo.st.v21.ui.sections.SecurityRootSection;
+import org.apache.geronimo.st.v21.ui.sections.SecuritySection;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.editor.FormEditor;
+
+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) {
+        Security security = (Security)JAXBModelUtils.getSecurity(getDeploymentPlan());
+        managedForm.addPart(new SecurityRootSection(body, toolkit, getStyle(), getDeploymentPlan(), security));
+        managedForm.addPart(new SecuritySection(getDeploymentPlan(), body, toolkit, getStyle(), security.getRoleMappings()));
+    }
+
+    /*
+     * (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;
+    }
+
+}



Mime
View raw message