geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcco...@apache.org
Subject svn commit: r663673 [3/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
Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/SecuritySection.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/SecuritySection.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/sections/SecuritySection.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/SecuritySection.java Thu Jun  5 10:38:37 2008
@@ -1,233 +1,130 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.geronimo.st.v21.ui.sections;
-
-import java.util.List;
-
-import javax.xml.bind.JAXBElement;
-
-import org.apache.geronimo.jee.security.Description;
-import org.apache.geronimo.jee.security.Role;
-import org.apache.geronimo.jee.security.RoleMappings;
-import org.apache.geronimo.jee.security.Security;
-import org.apache.geronimo.st.ui.CommonMessages;
-import org.apache.geronimo.st.ui.providers.AdapterFactory;
-import org.apache.geronimo.st.ui.sections.AbstractTableSection;
-import org.apache.geronimo.st.v21.core.jaxb.JAXBModelUtils;
-import org.apache.geronimo.st.v21.ui.Activator;
-import org.apache.geronimo.st.v21.ui.wizards.SecurityRoleWizard;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-
-public class SecuritySection extends AbstractTableSection {
-
-	public RoleMappings roleMappings;
-
-	Text roleNameText;
-
-	Text roleDescriptionText;
-
-	private static final String[] COLUMN_NAMES = new String[] { CommonMessages.name };
-
-	/**
-	 * @param plan
-	 * @param parent
-	 * @param toolkit
-	 * @param style
-	 */
-	public SecuritySection(JAXBElement plan, Composite parent, FormToolkit toolkit, int style, RoleMappings roleMappings) {
-		super(plan, parent, toolkit, style);
-		this.roleMappings = roleMappings;
-		createClient();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.sections.AbstractTableSection#getTitle()
-	 */
-	public String getTitle() {
-		return CommonMessages.editorSectionSecurityRolesTitle;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.sections.AbstractTableSection#getDescription()
-	 */
-	public String getDescription() {
-		return CommonMessages.editorSectionSecurityRolesDescription;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.sections.AbstractTableSection#getTableColumnNames()
-	 */
-	public String[] getTableColumnNames() {
-		return COLUMN_NAMES;
-	}
-
-	public List getObjectContainer() {
-		return roleMappings.getRole();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.sections.AbstractTableSection#getWizard()
-	 */
-	public Wizard getWizard() {
-		return new SecurityRoleWizard(this);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.sections.AbstractTableSection#getTableEntryObjectType()
-	 */
-	public Class getTableEntryObjectType() {
-		return Role.class;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.sections.AbstractTableSection#isHeaderVisible()
-	 */
-	public boolean isHeaderVisible() {
-		return false;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.sections.AbstractTableSection#createClient()
-	 */
-	public void createClient() {
-
-		super.createClient();
-
-		Composite detail = toolkit.createComposite(getTable().getParent());
-		GridLayout gl = new GridLayout();
-		gl.marginWidth = 4;
-		gl.marginHeight = 8;
-		gl.numColumns = 2;
-		detail.setLayout(gl);
-		detail.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
-
-		Label roleNameLabel = toolkit.createLabel(detail, CommonMessages.name
-				+ ":");
-		roleNameLabel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
-		roleNameLabel.setEnabled(true);
-
-		roleNameText = toolkit.createText(detail, "", SWT.BORDER);
-		roleNameText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
-		roleNameText.setEnabled(true);
-
-		Label roleDescriptionLabel = toolkit.createLabel(detail, CommonMessages.description
-				+ ":");
-		roleDescriptionLabel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
-		roleDescriptionLabel.setEnabled(true);
-
-		roleDescriptionText = toolkit.createText(detail, "", SWT.MULTI
-				| SWT.BORDER);
-		GridData data = new GridData(SWT.FILL, SWT.FILL, true, false);
-		data.heightHint = 50;
-		roleDescriptionText.setLayoutData(data);
-		roleDescriptionText.setEnabled(true);
-
-		getTable().addSelectionListener(new TableSelectionListener());
-
-		removeButton.addSelectionListener(new SelectionAdapter() {
-			public void widgetSelected(SelectionEvent e) {
-				roleNameText.setText("");
-				roleDescriptionText.setText("");
-			}
-		});
-
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.sections.AbstractTableSection#getInput()
-	 */
-	public Object getInput() {
-		Security sec = JAXBModelUtils.getSecurity(getPlan());//.eGet(securityERef);
-		if (sec != null) {
-			return sec.getRoleMappings();
-		}
-		return super.getInput();
-	}
-
-	public ImageDescriptor getImageDescriptor() {
-		return Activator.imageDescriptorFromPlugin("org.eclipse.jst.j2ee", "icons/full/obj16/security_role.gif");
-	}
-
-	class TableSelectionListener implements SelectionListener {
-
-		public void widgetSelected(SelectionEvent e) {
-			TableItem item = (TableItem) e.item;
-			Role role = (Role) item.getData();
-			roleNameText.setText(role.getRoleName());
-
-			if (!role.getDescription().isEmpty()) {
-				roleDescriptionText.setText(((Description) role.getDescription().get(0)).getValue());
-			} else {
-				roleDescriptionText.setText("");
-			}
-		}
-
-		public void widgetDefaultSelected(SelectionEvent e) {
-			// do nothing
-		}
-
-	}
-
-	public AdapterFactory getAdapterFactory() {
-		return new AdapterFactory() {
-			public Object[] getElements(Object inputElement) {
-				if (!RoleMappings.class.isInstance(inputElement)) {
-					return new String[] { "" };
-				}
-				RoleMappings plan = (RoleMappings)inputElement;
-				return plan.getRole().toArray();
-			}
-			public String getColumnText(Object element, int columnIndex) {
-				if (Role.class.isInstance(element)) {
-					Role role = (Role)element;
-					switch (columnIndex) {
-					case 0: return role.getRoleName();
-					}
-				}
-				return null;
-			}
-		};
-	}
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.st.v21.ui.sections;
+
+import java.util.List;
+
+import javax.xml.bind.JAXBElement;
+
+import org.apache.geronimo.jee.security.Role;
+import org.apache.geronimo.jee.security.RoleMappings;
+import org.apache.geronimo.st.ui.CommonMessages;
+import org.apache.geronimo.st.ui.providers.AdapterFactory;
+import org.apache.geronimo.st.ui.sections.AbstractTableSection;
+import org.apache.geronimo.st.v21.core.jaxb.JAXBObjectFactoryImpl;
+import org.apache.geronimo.st.v21.ui.Activator;
+import org.apache.geronimo.st.v21.ui.wizards.SecurityRoleWizard;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+public class SecuritySection extends AbstractTableSection {
+
+    public RoleMappings roleMappings;
+
+    /**
+     * @param plan
+     * @param parent
+     * @param toolkit
+     * @param style
+     */
+    public SecuritySection(JAXBElement plan, Composite parent, FormToolkit toolkit, int style, RoleMappings roleMappings) {
+        super(plan, parent, toolkit, style);
+        this.roleMappings = roleMappings;
+        this.COLUMN_NAMES = new String[] { CommonMessages.name, CommonMessages.description };
+        createClient();
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.ui.sections.AbstractTableSection#getTitle()
+     */
+    public String getTitle() {
+        return CommonMessages.editorSectionSecurityRolesTitle;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.ui.sections.AbstractTableSection#getDescription()
+     */
+    public String getDescription() {
+        return CommonMessages.editorSectionSecurityRolesDescription;
+    }
+
+    public List getObjectContainer() {
+        return roleMappings.getRole();
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.ui.sections.AbstractTableSection#getWizard()
+     */
+    public Wizard getWizard() {
+        return new SecurityRoleWizard(this);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.ui.sections.AbstractTableSection#getTableEntryObjectType()
+     */
+    public Class getTableEntryObjectType() {
+        return Role.class;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.ui.sections.AbstractTableSection#getInput()
+     */
+    public Object getInput() {
+        if (roleMappings != null) {
+            return roleMappings;
+        }
+        return super.getInput();
+    }
+
+    public ImageDescriptor getImageDescriptor() {
+        return Activator.imageDescriptorFromPlugin("org.eclipse.jst.j2ee", "icons/full/obj16/security_role.gif");
+    }
+
+    public AdapterFactory getAdapterFactory() {
+        return new AdapterFactory() {
+            public Object[] getElements(Object inputElement) {
+                if (!RoleMappings.class.isInstance(inputElement)) {
+                    return new String[] { "" };
+                }
+                RoleMappings plan = (RoleMappings)inputElement;
+                return plan.getRole().toArray();
+            }
+            public String getColumnText(Object element, int columnIndex) {
+                if (Role.class.isInstance(element)) {
+                    Role role = (Role)element;
+                    switch (columnIndex) {
+                    case 0: return role.getRoleName();
+                    case 1: return role.getDescription().get(0).getValue();
+                    }
+                }
+                return null;
+            }
+        };
+    }
+}

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/ServiceRefSection.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/ServiceRefSection.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/sections/ServiceRefSection.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/ServiceRefSection.java Thu Jun  5 10:38:37 2008
@@ -1,105 +1,82 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.geronimo.st.v21.ui.sections;
-
-import java.util.List;
-
-import javax.xml.bind.JAXBElement;
-
-import org.apache.geronimo.st.ui.CommonMessages;
-import org.apache.geronimo.st.ui.sections.AbstractTableSection;
-import org.apache.geronimo.st.v21.ui.wizards.ServiceRefWizard;
-import org.apache.geronimo.jee.naming.ServiceRef;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-
-public class ServiceRefSection extends AbstractTableSection {
-
-	List serviceRefERef;
-
-	private static final String[] COLUMN_NAMES = new String[] { CommonMessages.editorServiceRefName };
-
-	public ServiceRefSection(JAXBElement plan, Composite parent, FormToolkit toolkit, int style, List serviceRefERef) {
-		super(plan, parent, toolkit, style);
-		this.serviceRefERef = serviceRefERef;
-		createClient();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.sections.AbstractTableSection#getTitle()
-	 */
-	public String getTitle() {
-		return CommonMessages.editorServiceRefTitle;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.sections.AbstractTableSection#getDescription()
-	 */
-	public String getDescription() {
-		return CommonMessages.editorServiceRefDescription;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.sections.AbstractTableSection#getTableColumnNames()
-	 */
-	public String[] getTableColumnNames() {
-		return COLUMN_NAMES;
-	}
-
-//	/*
-//	 * (non-Javadoc)
-//	 * 
-//	 * @see org.apache.geronimo.ui.sections.AbstractTableSection#getEReference()
-//	 */
-//	public JAXBElement getEReference() {
-//		return serviceRefERef;
-//	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.sections.AbstractTableSection#getWizard()
-	 */
-	public Wizard getWizard() {
-		return new ServiceRefWizard(this);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.sections.AbstractTableSection#getTableEntryObjectType()
-	 */
-	public Class getTableEntryObjectType() {
-		return ServiceRef.class;
-	}
-
-//	/*
-//	 * (non-Javadoc)
-//	 * 
-//	 * @see org.apache.geronimo.st.ui.sections.AbstractTableSection#getAdapterFactory()
-//	 */
-//	public AdapterFactory getAdapterFactory() {
-//		return EMFEditorContext.getFactory();
-//	}
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.st.v21.ui.sections;
+
+import java.util.List;
+
+import javax.xml.bind.JAXBElement;
+
+import org.apache.geronimo.st.ui.CommonMessages;
+import org.apache.geronimo.st.ui.providers.AdapterFactory;
+import org.apache.geronimo.st.ui.sections.AbstractTableSection;
+import org.apache.geronimo.st.v21.ui.wizards.ServiceRefWizard;
+import org.apache.geronimo.jee.naming.ServiceRef;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+public class ServiceRefSection extends AbstractTableSection {
+
+    public ServiceRefSection(JAXBElement plan, Composite parent, FormToolkit toolkit, int style, List serviceRefs) {
+        super(plan, parent, toolkit, style);
+        this.objectContainer = serviceRefs;
+        COLUMN_NAMES = new String[] { CommonMessages.editorServiceRefName };
+        createClient();
+    }
+
+    public String getTitle() {
+        return CommonMessages.editorServiceRefTitle;
+    }
+
+    public String getDescription() {
+        return CommonMessages.editorServiceRefDescription;
+    }
+
+    public Wizard getWizard() {
+        return new ServiceRefWizard(this);
+    }
+
+    public Class getTableEntryObjectType() {
+        return ServiceRef.class;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.st.ui.sections.AbstractTableSection#getAdapterFactory()
+     */
+    public AdapterFactory getAdapterFactory() {
+        return new AdapterFactory() {
+            public Object[] getElements(Object inputElement) {
+                if (!JAXBElement.class.isInstance(inputElement)) {
+                    return new String[] { "" };
+                }
+                return getObjectContainer().toArray();
+            }
+
+            public String getColumnText(Object element, int columnIndex) {
+                if (ServiceRef.class.isInstance(element)) {
+                    ServiceRef serviceRef = (ServiceRef)element;
+                    switch (columnIndex) {
+                    case 0: return serviceRef.getServiceRefName();
+                    }
+                }
+                return null;
+            }
+        };
+    }
+}

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/DependencyWizard.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/DependencyWizard.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/wizards/DependencyWizard.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/DependencyWizard.java Thu Jun  5 10:38:37 2008
@@ -1,274 +1,93 @@
-/*
- * 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.wizards;
-
-import org.apache.geronimo.st.core.jaxb.JAXBObjectFactory;
-import org.apache.geronimo.st.ui.CommonMessages;
-import org.apache.geronimo.st.ui.sections.AbstractTableSection;
-import org.apache.geronimo.st.ui.wizards.AbstractTableWizard;
-import org.apache.geronimo.st.v21.core.jaxb.JAXBObjectFactoryImpl;
-import org.apache.geronimo.st.v21.ui.internal.Trace;
-import org.apache.geronimo.jee.deployment.Artifact;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-
-public class DependencyWizard extends AbstractTableWizard {
-
-	public static String wizardNewTitle_Dependency;
-
-	public static String wizardEditTitle_Dependency;
-
-	public static String wizardPageTitle_Dependency;
-
-	public static String wizardPageDescription_Dependency;
-
-	protected Label groupIdLabel;
-
-	protected Label artifactIdLabel;
-
-	protected Label versionLabel;
-	
-	protected Label typeLabel;
-
-	protected Text groupIdText;
-
-	protected Text artifactIdText;
-
-	protected Text versionText;
-	
-	protected Text typeText;
-
-	/**
-	 * @param section
-	 */
-	public DependencyWizard(AbstractTableSection section) {
-		super(section);
-        Trace.trace("Constructor Entry/Exit", "DependencyWizard");
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.wizards.DynamicAddEditWizard#getEFactory()
-	 */
-	public JAXBObjectFactory getEFactory() {
-		return JAXBObjectFactoryImpl.getInstance();
-	}
-
-//	/*
-//	 * (non-Javadoc)
-//	 * 
-//	 * @see org.apache.geronimo.ui.wizards.DynamicAddEditWizard#getTableColumnEAttributes()
-//	 */
-//	public EAttribute[] getTableColumnEAttributes() {
-//		return new EAttribute[] {};
-//	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.wizards.DynamicAddEditWizard#getAddWizardWindowTitle()
-	 */
-	public String getAddWizardWindowTitle() {
-		return CommonMessages.wizardNewTitle_Dependency;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.wizards.DynamicAddEditWizard#getEditWizardWindowTitle()
-	 */
-	public String getEditWizardWindowTitle() {
-		return CommonMessages.wizardEditTitle_Dependency;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.wizards.DynamicAddEditWizard#getWizardFirstPageTitle()
-	 */
-	public String getWizardFirstPageTitle() {
-		return CommonMessages.wizardPageTitle_Dependency;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.wizards.DynamicAddEditWizard#getWizardFirstPageDescription()
-	 */
-	public String getWizardFirstPageDescription() {
-		return CommonMessages.wizardPageDescription_Dependency;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.wizards.AbstractTableWizard#processEAttributes(org.eclipse.jface.wizard.IWizardPage)
-	 */
-	public void processEAttributes(IWizardPage page) {
-//              Trace.trace("Entry", "DependencyWizard.processEAttributes", page);
-		
-		Artifact dt = (Artifact) eObject;
-		dt.setArtifactId(artifactIdText.getText());
-		dt.setGroupId(groupIdText.getText());
-		dt.setVersion(versionText.getText());
-		dt.setType(typeText.getText());
-		
-//              Trace.trace("Exit", "DependencyWizard.processEAttributes");
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.wizard.IWizard#addPages()
-	 */
-	public void addPages() {
-//              Trace.trace("Entry", "DependencyWizard.addPages");
-		
-		WizardPage page = new DependencyWizardPage("Page0");
-		addPage(page);
-		
-//              Trace.trace("Exit", "DependencyWizard.addPages");
-	}
-
-	public class DependencyWizardPage extends WizardPage {
-		
-		public DependencyWizardPage(String pageName) {
-			super(pageName);
-           	Trace.trace("Constructor Entry", "DependencyWizardPage", pageName);
-			
-			setTitle(getWizardFirstPageTitle());
-			setDescription(getWizardFirstPageDescription());
-			
-           	Trace.trace("Constructor Exit", "DependencyWizardPage");
-		}
-
-		public DependencyWizardPage(String pageName, String title, ImageDescriptor titleImage) {
-			super(pageName, title, titleImage);
-			Trace.trace("Constructor Entry/Exit", "DependencyWizardPage", pageName, title, titleImage);
-		}
-
-		public void createControl(Composite parent) {
-//			Trace.trace("Entry", "DependencyWizardPage.createControl", parent);			
-			
-			Composite composite = new Composite(parent, SWT.NULL);
-
-			GridLayout layout = new GridLayout();
-			layout.numColumns = 2;
-			layout.horizontalSpacing = 15;
-			composite.setLayout(layout);
-			composite.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
-
-			GridData data = new GridData();
-			data = new GridData(GridData.FILL_HORIZONTAL);
-			data.horizontalSpan = 2;
-
-			groupIdLabel = new Label(composite, SWT.LEFT);
-			groupIdLabel.setText(CommonMessages.groupId);
-			groupIdLabel.setLayoutData(createLabelGridData());
-
-			groupIdText = new Text(composite, SWT.SINGLE | SWT.BORDER);
-			groupIdText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-			artifactIdLabel = new Label(composite, SWT.LEFT);
-			artifactIdLabel.setText(CommonMessages.artifactId);
-			artifactIdLabel.setLayoutData(createLabelGridData());
-
-			artifactIdText = new Text(composite, SWT.SINGLE | SWT.BORDER);
-			artifactIdText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-			versionLabel = new Label(composite, SWT.LEFT);
-			versionLabel.setText(CommonMessages.version);
-			versionLabel.setLayoutData(createLabelGridData());
-
-			versionText = new Text(composite, SWT.SINGLE | SWT.BORDER);
-			versionText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-			
-			typeLabel = new Label(composite, SWT.LEFT);
-			typeLabel.setText(CommonMessages.type);
-			typeLabel.setLayoutData(createLabelGridData());
-
-			typeText = new Text(composite, SWT.SINGLE | SWT.BORDER);
-			typeText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-			if (eObject != null) {
-				Artifact artifact = (Artifact)eObject;
-				groupIdText.setText(artifact.getGroupId());
-				artifactIdText.setText(artifact.getArtifactId());
-				versionText.setText(artifact.getVersion());
-				typeText.setText(artifact.getType());
-//				if (eObject.eIsSet(DeploymentPackage.eINSTANCE.getArtifactType_ArtifactId())) {
-//					artifactIdText.setText(eObject.eGet(DeploymentPackage.eINSTANCE.getArtifactType_ArtifactId()).toString());
-//				}
-//				if (eObject.eIsSet(DeploymentPackage.eINSTANCE.getArtifactType_GroupId())) {
-//					groupIdText.setText(eObject.eGet(DeploymentPackage.eINSTANCE.getArtifactType_GroupId()).toString());
-//				}
-//				if (eObject.eIsSet(DeploymentPackage.eINSTANCE.getArtifactType_Version())) {
-//					versionText.setText(eObject.eGet(DeploymentPackage.eINSTANCE.getArtifactType_Version()).toString());
-//				}
-//				if (eObject.eIsSet(DeploymentPackage.eINSTANCE.getArtifactType_Type())) {
-//					typeText.setText(eObject.eGet(DeploymentPackage.eINSTANCE.getArtifactType_Type()).toString());
-//				}
-			}
-
-			setControl(composite);
-//			Trace.trace("Exit", "DependencyWizardPage.createControl");
-		}
-	}
-
-	public GridData createLabelGridData() {
-//		Trace.trace("Entry", "DependencyWizard.createLabelGridData");
-//		Trace.trace("Exit", "DependencyWizard.createLabelGridData", new GridData(GridData.HORIZONTAL_ALIGN_FILL));
-
-		return new GridData(GridData.HORIZONTAL_ALIGN_FILL);
-	}
-	
-	
-	/* (non-Javadoc)
-	 * @see org.apache.geronimo.st.ui.wizards.AbstractTableWizard#performFinish()
-	 */
-//	public boolean performFinish() {		
-////		Trace.trace("Entry", "DependencyWizard.performFinish");
-//		
-//		if (eObject == null) {
-////			eObject = getEFactory().create(section.getTableEntryObjectType());
-////			EObject plan = section.getPlan();
-////			DependenciesType dependenciesType = ((EnvironmentType) plan.eGet(section.getEReference())).getDependencies();
-////			if(dependenciesType == null) {
-////				dependenciesType = DeploymentFactory.eINSTANCE.createDependenciesType();
-////				((EnvironmentType) plan.eGet(section.getEReference())).setDependencies(dependenciesType);
-////			}
-////			dependenciesType.getDependency().add(eObject);
-//		}
-//
-//		processEAttributes(getPages()[0]);
-//		
-//		if (section.getTableViewer().getInput() == null) {
-//			section.getTableViewer().setInput(section.getInput());
-//		}
-//
-////		Trace.trace("Exit", "DependencyWizard.performFinish", true);
-//		return true;
-//	}
-}
+/*
+ * 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.wizards;
+
+import javax.xml.bind.JAXBElement;
+
+import org.apache.geronimo.st.core.jaxb.JAXBObjectFactory;
+import org.apache.geronimo.st.ui.CommonMessages;
+import org.apache.geronimo.st.ui.sections.AbstractTableSection;
+import org.apache.geronimo.st.ui.wizards.AbstractTableWizard;
+import org.apache.geronimo.st.v21.core.jaxb.JAXBModelUtils;
+import org.apache.geronimo.st.v21.core.jaxb.JAXBObjectFactoryImpl;
+import org.apache.geronimo.jee.deployment.Dependency;
+import org.apache.geronimo.jee.deployment.Dependencies;
+import org.apache.geronimo.jee.deployment.Environment;
+
+public class DependencyWizard extends AbstractTableWizard {
+
+    public DependencyWizard(AbstractTableSection section) {
+        super(section);
+    }
+
+    public JAXBObjectFactory getEFactory() {
+        return JAXBObjectFactoryImpl.getInstance();
+    }
+
+    public String[] getTableColumnEAttributes() {
+        return new String[] {"GroupId", "ArtifactId", "Version", "Type" };
+    }
+
+    public String getAddWizardWindowTitle() {
+        return CommonMessages.wizardNewTitle_Dependency;
+    }
+
+    public String getEditWizardWindowTitle() {
+        return CommonMessages.wizardEditTitle_Dependency;
+    }
+
+    public String getWizardFirstPageTitle() {
+        return CommonMessages.wizardPageTitle_Dependency;
+    }
+
+    public String getWizardFirstPageDescription() {
+        return CommonMessages.wizardPageDescription_Dependency;
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.geronimo.st.ui.wizards.AbstractTableWizard#performFinish()
+     */
+    public boolean performFinish() {
+        DynamicWizardPage page = (DynamicWizardPage) getPages()[0];
+
+        if (eObject == null) {
+            eObject = getEFactory().create(Dependency.class);
+            JAXBElement plan = section.getPlan();
+
+            Environment environment = JAXBModelUtils.getEnvironment(plan);
+            if (environment == null) {
+                environment = (Environment)getEFactory().create(Environment.class);
+                JAXBModelUtils.setEnvironment (plan, environment);
+            }
+
+            Dependencies dependencies = environment.getDependencies();
+            if (dependencies == null) {
+                dependencies = (Dependencies)getEFactory().create(Dependencies.class);
+                environment.setDependencies (dependencies);
+            }
+            dependencies.getDependency().add((Dependency)eObject);
+        }
+
+        processEAttributes (page);
+
+        if (section.getTableViewer().getInput() == null) {
+            section.getTableViewer().setInput(section.getInput());
+        }
+
+        return true;
+    }
+}

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/EjbLocalRefWizard.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/EjbLocalRefWizard.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/wizards/EjbLocalRefWizard.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/EjbLocalRefWizard.java Thu Jun  5 10:38:37 2008
@@ -1,75 +1,54 @@
-/*
- * 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.wizards;
-
-import org.apache.geronimo.st.ui.CommonMessages;
-import org.apache.geronimo.st.ui.sections.AbstractTableSection;
-import org.apache.geronimo.st.ui.wizards.AbstractTableWizard;
-
-public class EjbLocalRefWizard extends AbstractTableWizard {
-
-	public EjbLocalRefWizard(AbstractTableSection section) {
-		super(section);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.wizards.DynamicAddEditWizard#getAddWizardWindowTitle()
-	 */
-	public String getAddWizardWindowTitle() {
-		return CommonMessages.wizardNewTitle_EjbLocalRef;
-	}
-
-//	public EFactory getEFactory() {
-//		return NamingFactory.eINSTANCE;
-//	}
-//
-//	public EAttribute[] getTableColumnEAttributes() {
-//		return new EAttribute[] {
-//				NamingPackage.eINSTANCE.getEjbLocalRefType_RefName(),
-//				NamingPackage.eINSTANCE.getEjbLocalRefType_EjbLink() };
-//	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.wizards.DynamicAddEditWizard#getEditWizardWindowTitle()
-	 */
-	public String getEditWizardWindowTitle() {
-		return CommonMessages.wizardEditTitle_EjbLocalRef;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.wizards.DynamicAddEditWizard#getWizardFirstPageTitle()
-	 */
-	public String getWizardFirstPageTitle() {
-		return CommonMessages.wizardPageTitle_EjbLocalRef;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.wizards.DynamicAddEditWizard#getWizardFirstPageDescription()
-	 */
-	public String getWizardFirstPageDescription() {
-		return CommonMessages.wizardPageDescription_EjbLocalRef;
-	}
-
-}
+/*
+ * 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.wizards;
+
+import org.apache.geronimo.st.core.jaxb.JAXBObjectFactory;
+import org.apache.geronimo.st.ui.CommonMessages;
+import org.apache.geronimo.st.ui.sections.AbstractTableSection;
+import org.apache.geronimo.st.ui.wizards.AbstractTableWizard;
+import org.apache.geronimo.st.v21.core.jaxb.JAXBObjectFactoryImpl;
+
+public class EjbLocalRefWizard extends AbstractTableWizard {
+
+    public EjbLocalRefWizard(AbstractTableSection section) {
+        super(section);
+    }
+
+    public JAXBObjectFactory getEFactory() {
+        return JAXBObjectFactoryImpl.getInstance();
+    }
+
+    public String[] getTableColumnEAttributes() {
+        return new String[] { "RefName", "EjbLink" };
+    }
+
+    public String getAddWizardWindowTitle() {
+        return CommonMessages.wizardNewTitle_EjbLocalRef;
+    }
+
+    public String getEditWizardWindowTitle() {
+        return CommonMessages.wizardEditTitle_EjbLocalRef;
+    }
+
+    public String getWizardFirstPageTitle() {
+        return CommonMessages.wizardPageTitle_EjbLocalRef;
+    }
+
+    public String getWizardFirstPageDescription() {
+        return CommonMessages.wizardPageDescription_EjbLocalRef;
+    }
+}

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/EjbRefWizard.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/EjbRefWizard.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/wizards/EjbRefWizard.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/EjbRefWizard.java Thu Jun  5 10:38:37 2008
@@ -1,75 +1,54 @@
-/*
- * 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.wizards;
-
-import org.apache.geronimo.st.ui.CommonMessages;
-import org.apache.geronimo.st.ui.sections.AbstractTableSection;
-import org.apache.geronimo.st.ui.wizards.AbstractTableWizard;
-
-public class EjbRefWizard extends AbstractTableWizard {
-
-	public EjbRefWizard(AbstractTableSection section) {
-		super(section);
-	}
-
-//	public EFactory getEFactory() {
-//		return NamingFactory.eINSTANCE;
-//	}
-//
-//	public EAttribute[] getTableColumnEAttributes() {
-//		return new EAttribute[] {
-//				NamingPackage.eINSTANCE.getEjbRefType_RefName(),
-//				NamingPackage.eINSTANCE.getEjbRefType_EjbLink() };
-//	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.wizards.DynamicAddEditWizard#getAddWizardWindowTitle()
-	 */
-	public String getAddWizardWindowTitle() {
-		return CommonMessages.wizardNewTitle_EjbRef;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.wizards.DynamicAddEditWizard#getEditWizardWindowTitle()
-	 */
-	public String getEditWizardWindowTitle() {
-		return CommonMessages.wizardEditTitle_EjbRef;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.wizards.DynamicAddEditWizard#getWizardFirstPageTitle()
-	 */
-	public String getWizardFirstPageTitle() {
-		return CommonMessages.wizardPageTitle_EjbRef;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.wizards.DynamicAddEditWizard#getWizardFirstPageDescription()
-	 */
-	public String getWizardFirstPageDescription() {
-		return CommonMessages.wizardPageDescription_EjbRef;
-	}
-
-}
+/*
+ * 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.wizards;
+
+import org.apache.geronimo.st.core.jaxb.JAXBObjectFactory;
+import org.apache.geronimo.st.ui.CommonMessages;
+import org.apache.geronimo.st.ui.sections.AbstractTableSection;
+import org.apache.geronimo.st.ui.wizards.AbstractTableWizard;
+import org.apache.geronimo.st.v21.core.jaxb.JAXBObjectFactoryImpl;
+
+public class EjbRefWizard extends AbstractTableWizard {
+
+    public EjbRefWizard(AbstractTableSection section) {
+        super(section);
+    }
+
+    public JAXBObjectFactory getEFactory() {
+        return JAXBObjectFactoryImpl.getInstance();
+    }
+
+    public String[] getTableColumnEAttributes() {
+        return new String[] { "RefName", "EjbLink" };
+    }
+
+    public String getAddWizardWindowTitle() {
+        return CommonMessages.wizardNewTitle_EjbRef;
+    }
+
+    public String getEditWizardWindowTitle() {
+        return CommonMessages.wizardEditTitle_EjbRef;
+    }
+
+    public String getWizardFirstPageTitle() {
+        return CommonMessages.wizardPageTitle_EjbRef;
+    }
+
+    public String getWizardFirstPageDescription() {
+        return CommonMessages.wizardPageDescription_EjbRef;
+    }
+}

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/GBeanRefWizard.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/GBeanRefWizard.java?rev=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/wizards/GBeanRefWizard.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/GBeanRefWizard.java Thu Jun  5 10:38:37 2008
@@ -1,75 +1,93 @@
-/*
- * 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.wizards;
-
-import org.apache.geronimo.st.ui.CommonMessages;
-import org.apache.geronimo.st.ui.sections.AbstractTableSection;
-import org.apache.geronimo.st.ui.wizards.AbstractTableWizard;
-
-public class GBeanRefWizard extends AbstractTableWizard {
-
-	public GBeanRefWizard(AbstractTableSection section) {
-		super(section);
-	}
-
-//	public EFactory getEFactory() {
-//		return NamingFactory.eINSTANCE;
-//	}
-//
-//	public EAttribute[] getTableColumnEAttributes() {
-//		return new EAttribute[] {
-//				NamingPackage.eINSTANCE.getGbeanRefType_RefName(),
-//				NamingPackage.eINSTANCE.getGbeanRefType_RefType()};
-//	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.wizards.DynamicAddEditWizard#getAddWizardWindowTitle()
-	 */
-	public String getAddWizardWindowTitle() {
-		return CommonMessages.wizardNewTitle_GBeanRef;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.wizards.DynamicAddEditWizard#getEditWizardWindowTitle()
-	 */
-	public String getEditWizardWindowTitle() {
-		return CommonMessages.wizardEditTitle_GBeanRef;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.wizards.DynamicAddEditWizard#getWizardFirstPageTitle()
-	 */
-	public String getWizardFirstPageTitle() {
-		return CommonMessages.wizardPageTitle_GBeanRef;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.wizards.DynamicAddEditWizard#getWizardFirstPageDescription()
-	 */
-	public String getWizardFirstPageDescription() {
-		return CommonMessages.wizardPageDescription_GBeanRef;
-	}
-
-}
+/*
+ * 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.wizards;
+
+import javax.xml.bind.JAXBElement;
+
+import org.apache.geronimo.jee.naming.GbeanRef;
+import org.apache.geronimo.jee.naming.ObjectFactory;
+import org.apache.geronimo.st.core.jaxb.JAXBObjectFactory;
+import org.apache.geronimo.st.ui.CommonMessages;
+import org.apache.geronimo.st.ui.sections.AbstractTableSection;
+import org.apache.geronimo.st.ui.wizards.AbstractTableWizard;
+import org.apache.geronimo.st.v21.core.jaxb.JAXBModelUtils;
+import org.apache.geronimo.st.v21.core.jaxb.JAXBObjectFactoryImpl;
+import org.eclipse.jface.wizard.IWizardPage;
+
+public class GBeanRefWizard extends AbstractTableWizard {
+
+    public GBeanRefWizard(AbstractTableSection section) {
+        super(section);
+    }
+
+    public JAXBObjectFactory getEFactory() {
+        return JAXBObjectFactoryImpl.getInstance();
+    }
+
+    public String[] getTableColumnEAttributes() {
+         return new String[] { "RefName", "RefType" };
+    }
+
+    public String getAddWizardWindowTitle() {
+        return CommonMessages.wizardNewTitle_GBeanRef;
+    }
+
+    public String getEditWizardWindowTitle() {
+        return CommonMessages.wizardEditTitle_GBeanRef;
+    }
+
+    public String getWizardFirstPageTitle() {
+        return CommonMessages.wizardPageTitle_GBeanRef;
+    }
+
+    public String getWizardFirstPageDescription() {
+        return CommonMessages.wizardPageDescription_GBeanRef;
+    }
+
+    public boolean performFinish() {
+        DynamicWizardPage page = (DynamicWizardPage) getPages()[0];
+
+        if (eObject == null) {
+            eObject = getEFactory().create(GbeanRef.class);
+            JAXBElement plan = section.getPlan();
+
+            // add the JAXBElement of a GBean, not the GBean
+            ObjectFactory objectFactory = new ObjectFactory();
+            JAXBModelUtils.getGbeanRefs(plan).add(objectFactory.createGbeanRef((GbeanRef)eObject));
+        }
+
+        processEAttributes (page);
+
+        if (section.getTableViewer().getInput() == null) {
+            section.getTableViewer().setInput(section.getInput());
+        }
+
+        return true;
+    }
+
+    public void processEAttributes(IWizardPage page) {
+        if (page instanceof DynamicWizardPage) {
+            DynamicWizardPage dynamicPage = (DynamicWizardPage)page;
+            GbeanRef gbeanRef = (GbeanRef)eObject;
+            String value = dynamicPage.getTextEntry(0).getText();
+            gbeanRef.setRefName(value);
+
+            value = dynamicPage.getTextEntry(1).getText();
+            gbeanRef.getRefType().add(value);
+        }
+    }
+}

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/GBeanWizard.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/GBeanWizard.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/wizards/GBeanWizard.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/GBeanWizard.java Thu Jun  5 10:38:37 2008
@@ -1,78 +1,80 @@
-/*
- * 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.wizards;
-
-import org.apache.geronimo.st.core.jaxb.JAXBObjectFactory;
-import org.apache.geronimo.st.ui.CommonMessages;
-import org.apache.geronimo.st.ui.sections.AbstractTableSection;
-import org.apache.geronimo.st.ui.wizards.AbstractTableWizard;
-import org.apache.geronimo.st.v21.core.jaxb.JAXBObjectFactoryImpl;
-
-public class GBeanWizard extends AbstractTableWizard {
-
-	/**
-	 * @param section
-	 */
-	public GBeanWizard(AbstractTableSection section) {
-		super(section);
-	}
-
-	public JAXBObjectFactory getEFactory() {
-		return JAXBObjectFactoryImpl.getInstance();
-	}
-	
-	public String[] getTableColumnEAttributes() {
-		return new String[] { "Name", "Clazz" };
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.wizards.DynamicAddEditWizard#getAddWizardWindowTitle()
-	 */
-	public String getAddWizardWindowTitle() {
-		return CommonMessages.wizardNewTitle_GBean;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.wizards.DynamicAddEditWizard#getEditWizardWindowTitle()
-	 */
-	public String getEditWizardWindowTitle() {
-		return CommonMessages.wizardEditTitle_GBean;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.wizards.DynamicAddEditWizard#getWizardFirstPageTitle()
-	 */
-	public String getWizardFirstPageTitle() {
-		return CommonMessages.wizardEditTitle_GBean;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.wizards.DynamicAddEditWizard#getWizardFirstPageDescription()
-	 */
-	public String getWizardFirstPageDescription() {
-		return CommonMessages.wizardPageTitle_GBean;
-	}
-
-}
+/*
+ * 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.wizards;
+
+import javax.xml.bind.JAXBElement;
+
+import org.apache.geronimo.jee.deployment.Gbean;
+import org.apache.geronimo.jee.deployment.ObjectFactory;
+import org.apache.geronimo.st.core.jaxb.JAXBObjectFactory;
+import org.apache.geronimo.st.ui.CommonMessages;
+import org.apache.geronimo.st.ui.sections.AbstractTableSection;
+import org.apache.geronimo.st.ui.wizards.AbstractTableWizard;
+import org.apache.geronimo.st.v21.core.jaxb.JAXBModelUtils;
+import org.apache.geronimo.st.v21.core.jaxb.JAXBObjectFactoryImpl;
+
+public class GBeanWizard extends AbstractTableWizard {
+
+    public GBeanWizard(AbstractTableSection section) {
+        super(section);
+    }
+
+    public JAXBObjectFactory getEFactory() {
+        return JAXBObjectFactoryImpl.getInstance();
+    }
+    
+    public String[] getTableColumnEAttributes() {
+        return new String[] { "Name", "Clazz" };
+    }
+
+    public String getAddWizardWindowTitle() {
+        return CommonMessages.wizardNewTitle_GBean;
+    }
+
+    public String getEditWizardWindowTitle() {
+        return CommonMessages.wizardEditTitle_GBean;
+    }
+
+    public String getWizardFirstPageTitle() {
+        return CommonMessages.wizardEditTitle_GBean;
+    }
+
+    public String getWizardFirstPageDescription() {
+        return CommonMessages.wizardPageTitle_GBean;
+    }
+
+    public boolean performFinish() {
+        DynamicWizardPage page = (DynamicWizardPage) getPages()[0];
+
+        if (eObject == null) {
+            eObject = getEFactory().create(Gbean.class);
+            JAXBElement plan = section.getPlan();
+
+            // add the JAXBElement of a GBean, not the GBean
+            ObjectFactory objectFactory = new ObjectFactory();
+            JAXBModelUtils.getGbeans(plan).add(objectFactory.createGbean((Gbean)eObject));
+        }
+
+        processEAttributes (page);
+
+        if (section.getTableViewer().getInput() == null) {
+            section.getTableViewer().setInput(section.getInput());
+        }
+
+        return true;
+    }
+}

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ResourceEnvRefWizard.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ResourceEnvRefWizard.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/wizards/ResourceEnvRefWizard.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ResourceEnvRefWizard.java Thu Jun  5 10:38:37 2008
@@ -1,78 +1,55 @@
-/*
- * 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.wizards;
-
-import org.apache.geronimo.st.ui.CommonMessages;
-import org.apache.geronimo.st.ui.sections.AbstractTableSection;
-import org.apache.geronimo.st.ui.wizards.AbstractTableWizard;
-
-public class ResourceEnvRefWizard extends AbstractTableWizard {
-
-	/**
-	 * @param section
-	 */
-	public ResourceEnvRefWizard(AbstractTableSection section) {
-		super(section);
-	}
-
-//	public EFactory getEFactory() {
-//		return NamingFactory.eINSTANCE;
-//	}
-//
-//	public EAttribute[] getTableColumnEAttributes() {
-//		return new EAttribute[] {
-//				NamingPackage.eINSTANCE.getResourceEnvRefType_RefName(),
-//				NamingPackage.eINSTANCE.getResourceEnvRefType_MessageDestinationLink() };
-//	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.wizards.DynamicAddEditWizard#getAddWizardWindowTitle()
-	 */
-	public String getAddWizardWindowTitle() {
-		return CommonMessages.wizardPageTitle_ResEnvRef;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.wizards.DynamicAddEditWizard#getEditWizardWindowTitle()
-	 */
-	public String getEditWizardWindowTitle() {
-		return CommonMessages.wizardEditTitle_ResEnvRef;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.wizards.DynamicAddEditWizard#getWizardFirstPageTitle()
-	 */
-	public String getWizardFirstPageTitle() {
-		return CommonMessages.wizardPageTitle_ResEnvRef;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.wizards.DynamicAddEditWizard#getWizardFirstPageDescription()
-	 */
-	public String getWizardFirstPageDescription() {
-		return CommonMessages.wizardPageDescription_ResEnvRef;
-	}
-
-}
+/*
+ * 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.wizards;
+
+import org.apache.geronimo.st.core.jaxb.JAXBObjectFactory;
+import org.apache.geronimo.st.ui.CommonMessages;
+import org.apache.geronimo.st.ui.sections.AbstractTableSection;
+import org.apache.geronimo.st.ui.wizards.AbstractTableWizard;
+import org.apache.geronimo.st.v21.core.jaxb.JAXBObjectFactoryImpl;
+
+public class ResourceEnvRefWizard extends AbstractTableWizard {
+
+ 
+    public ResourceEnvRefWizard(AbstractTableSection section) {
+        super(section);
+    }
+
+    public JAXBObjectFactory getEFactory() {
+        return JAXBObjectFactoryImpl.getInstance();
+    }
+
+    public String[] getTableColumnEAttributes() {
+        return new String[] { "RefName", "MessageDestinationLink" };
+    }
+
+    public String getAddWizardWindowTitle() {
+        return CommonMessages.wizardPageTitle_ResEnvRef;
+    }
+
+    public String getEditWizardWindowTitle() {
+        return CommonMessages.wizardEditTitle_ResEnvRef;
+    }
+
+    public String getWizardFirstPageTitle() {
+        return CommonMessages.wizardPageTitle_ResEnvRef;
+    }
+
+    public String getWizardFirstPageDescription() {
+        return CommonMessages.wizardPageDescription_ResEnvRef;
+    }
+}

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ResourceRefWizard.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ResourceRefWizard.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/wizards/ResourceRefWizard.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ResourceRefWizard.java Thu Jun  5 10:38:37 2008
@@ -1,78 +1,54 @@
-/*
- * 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.wizards;
-
-import org.apache.geronimo.st.core.jaxb.JAXBObjectFactory;
-import org.apache.geronimo.st.ui.CommonMessages;
-import org.apache.geronimo.st.ui.sections.AbstractTableSection;
-import org.apache.geronimo.st.ui.wizards.AbstractTableWizard;
-import org.apache.geronimo.st.v21.core.jaxb.JAXBObjectFactoryImpl;
-
-public class ResourceRefWizard extends AbstractTableWizard {
-
-	/**
-	 * @param section
-	 */
-	public ResourceRefWizard(AbstractTableSection section) {
-		super(section);
-	}
-
-	public JAXBObjectFactory getEFactory() {
-		return JAXBObjectFactoryImpl.getInstance();
-	}
-
-	public String[] getTableColumnEAttributes() {
-		return new String[] { "RefName", "ResourceLink" };
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.wizards.DynamicAddEditWizard#getAddWizardWindowTitle()
-	 */
-	public String getAddWizardWindowTitle() {
-		return CommonMessages.wizardPageTitle_ResRef;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.wizards.DynamicAddEditWizard#getEditWizardWindowTitle()
-	 */
-	public String getEditWizardWindowTitle() {
-		return CommonMessages.wizardEditTitle_ResRef;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.wizards.DynamicAddEditWizard#getWizardFirstPageTitle()
-	 */
-	public String getWizardFirstPageTitle() {
-		return CommonMessages.wizardPageTitle_ResRef;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.wizards.DynamicAddEditWizard#getWizardFirstPageDescription()
-	 */
-	public String getWizardFirstPageDescription() {
-		return CommonMessages.wizardPageDescription_ResRef;
-	}
-
-}
+/*
+ * 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.wizards;
+
+import org.apache.geronimo.st.core.jaxb.JAXBObjectFactory;
+import org.apache.geronimo.st.ui.CommonMessages;
+import org.apache.geronimo.st.ui.sections.AbstractTableSection;
+import org.apache.geronimo.st.ui.wizards.AbstractTableWizard;
+import org.apache.geronimo.st.v21.core.jaxb.JAXBObjectFactoryImpl;
+
+public class ResourceRefWizard extends AbstractTableWizard {
+
+    public ResourceRefWizard(AbstractTableSection section) {
+        super(section);
+    }
+
+    public JAXBObjectFactory getEFactory() {
+        return JAXBObjectFactoryImpl.getInstance();
+    }
+
+    public String[] getTableColumnEAttributes() {
+        return new String[] { "RefName", "ResourceLink" };
+    }
+
+    public String getAddWizardWindowTitle() {
+        return CommonMessages.wizardPageTitle_ResRef;
+    }
+
+    public String getEditWizardWindowTitle() {
+        return CommonMessages.wizardEditTitle_ResRef;
+    }
+
+    public String getWizardFirstPageTitle() {
+        return CommonMessages.wizardPageTitle_ResRef;
+    }
+
+    public String getWizardFirstPageDescription() {
+        return CommonMessages.wizardPageDescription_ResRef;
+    }
+}

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/SecurityRoleWizard.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/SecurityRoleWizard.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/wizards/SecurityRoleWizard.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/SecurityRoleWizard.java Thu Jun  5 10:38:37 2008
@@ -1,161 +1,175 @@
-/*
- * 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.wizards;
-
-import javax.xml.bind.JAXBElement;
-
-import org.apache.geronimo.st.core.jaxb.JAXBObjectFactory;
-import org.apache.geronimo.st.ui.CommonMessages;
-import org.apache.geronimo.st.ui.sections.AbstractTableSection;
-import org.apache.geronimo.st.ui.wizards.AbstractTableWizard;
-import org.apache.geronimo.st.v21.core.jaxb.JAXBModelUtils;
-import org.apache.geronimo.st.v21.core.jaxb.JAXBObjectFactoryImpl;
-import org.apache.geronimo.st.v21.ui.sections.SecuritySection;
-import org.apache.geronimo.jee.security.Description;
-import org.apache.geronimo.jee.security.RoleMappings;
-import org.apache.geronimo.jee.security.Role;
-import org.apache.geronimo.jee.security.Security;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-
-public class SecurityRoleWizard extends AbstractTableWizard {
-
-	public SecurityRoleWizard(AbstractTableSection section) {
-		super(section);
-	}
-
-	public JAXBObjectFactory getEFactory() {
-		return JAXBObjectFactoryImpl.getInstance();
-	}
-
-	public String[] getTableColumnEAttributes() {
-		return new String[] { "RoleName" };
-	}
-
-	public String getAddWizardWindowTitle() {
-		return CommonMessages.wizardNewTitle_SecurityRole;
-	}
-
-	public String getEditWizardWindowTitle() {
-		return CommonMessages.wizardEditTitle_SecurityRole;
-	}
-
-	public String getWizardFirstPageTitle() {
-		return CommonMessages.wizardPageTitle_SecurityRole;
-	}
-
-	public String getWizardFirstPageDescription() {
-		return CommonMessages.wizardPageDescription_SecurityRole;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.wizard.IWizard#addPages()
-	 */
-	public void addPages() {
-		SecurityRoleWizardPage page = new SecurityRoleWizardPage("Page0");
-		page.setImageDescriptor(descriptor);
-		addPage(page);
-	}
-
-	public class SecurityRoleWizardPage extends DynamicWizardPage {
-
-		Text descriptionText;
-
-		public SecurityRoleWizardPage(String pageName) {
-			super(pageName);
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.apache.geronimo.ui.wizards.DynamicAddEditWizard.DynamicWizardPage#doCustom()
-		 */
-		public void doCustom(Composite parent) {
-			Label label = new Label(parent, SWT.LEFT);
-			String columnName = CommonMessages.description;
-			if (!columnName.endsWith(":"))
-				columnName = columnName.concat(":");
-			label.setText(columnName);
-			GridData data = new GridData();
-			data.horizontalAlignment = GridData.FILL;
-			label.setLayoutData(data);
-
-			descriptionText = new Text(parent, SWT.SINGLE | SWT.BORDER);
-			data = new GridData(GridData.HORIZONTAL_ALIGN_FILL
-					| GridData.VERTICAL_ALIGN_FILL);
-			data.grabExcessHorizontalSpace = true;
-			data.widthHint = 100;
-			descriptionText.setLayoutData(data);
-
-			if (eObject != null && eObject instanceof Role) {
-				Role role = (Role) eObject;
-				if (!role.getDescription().isEmpty()) {
-					Description desc = (Description) role.getDescription().get(0);
-					if (desc.getValue() != null) {
-						descriptionText.setText(desc.getValue());
-					}
-				}
-			}
-		}
-	}
-
-	public boolean performFinish() {
-		SecurityRoleWizardPage page = (SecurityRoleWizardPage) getPages()[0];
-
-		if (eObject == null) {
-			eObject = getEFactory().create(Role.class);
-			JAXBElement plan = section.getPlan();
-
-			Security security = JAXBModelUtils.getSecurity(plan);
-			if (security == null) {
-				security = (Security)getEFactory().create(Security.class);
-				JAXBModelUtils.setSecurity(plan, security);
-			}
-
-			RoleMappings roleMappings = security.getRoleMappings();
-			if (roleMappings == null) {
-				roleMappings = (RoleMappings)getEFactory().create(RoleMappings.class);
-				security.setRoleMappings(roleMappings);
-			}
-
-			roleMappings.getRole().add((Role)eObject);
-		}
-
-		processEAttributes(page);
-
-		Description type = null;
-		Role role = (Role) eObject;
-		if (role.getDescription().isEmpty()) {
-			type = (Description)getEFactory().create(Description.class);
-			role.getDescription().add(type);
-		} else {
-			type = (Description) role.getDescription().get(0);
-		}
-		type.setValue(page.descriptionText.getText());
-		
-		if (section.getTableViewer().getInput() == section.getPlan()) {
-			section.getTableViewer().setInput(section.getInput());
-		}
-
-		return true;
-	}
-}
+/*
+ * 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.wizards;
+
+import javax.xml.bind.JAXBElement;
+
+import org.apache.geronimo.st.core.jaxb.JAXBObjectFactory;
+import org.apache.geronimo.st.core.jaxb.JAXBUtils;
+import org.apache.geronimo.st.ui.CommonMessages;
+import org.apache.geronimo.st.ui.sections.AbstractTableSection;
+import org.apache.geronimo.st.ui.wizards.AbstractTableWizard;
+import org.apache.geronimo.st.ui.wizards.AbstractTableWizard.DynamicWizardPage;
+import org.apache.geronimo.st.v21.core.jaxb.JAXBModelUtils;
+import org.apache.geronimo.st.v21.core.jaxb.JAXBObjectFactoryImpl;
+import org.apache.geronimo.jee.security.Description;
+import org.apache.geronimo.jee.security.RoleMappings;
+import org.apache.geronimo.jee.security.Role;
+import org.apache.geronimo.jee.security.Security;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+
+public class SecurityRoleWizard extends AbstractTableWizard {
+
+    public SecurityRoleWizard(AbstractTableSection section) {
+        super(section);
+    }
+
+    public JAXBObjectFactory getEFactory() {
+        return JAXBObjectFactoryImpl.getInstance();
+    }
+
+    public String[] getTableColumnEAttributes() {
+        return new String[] { "RoleName", "Description" };
+    }
+
+    public String getAddWizardWindowTitle() {
+        return CommonMessages.wizardNewTitle_SecurityRole;
+    }
+
+    public String getEditWizardWindowTitle() {
+        return CommonMessages.wizardEditTitle_SecurityRole;
+    }
+
+    public String getWizardFirstPageTitle() {
+        return CommonMessages.wizardPageTitle_SecurityRole;
+    }
+
+    public String getWizardFirstPageDescription() {
+        return CommonMessages.wizardPageDescription_SecurityRole;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.eclipse.jface.wizard.IWizard#addPages()
+     */
+    public void addPages() {
+        SecurityRoleWizardPage page = new SecurityRoleWizardPage("Page0");
+        page.setImageDescriptor(descriptor);
+        addPage(page);
+    }
+
+    // need to extend the DynamicWizardPage only so that when the Edit dialog is shown
+    // the values are brought in properly.
+    public class SecurityRoleWizardPage extends DynamicWizardPage {
+        public SecurityRoleWizardPage(String pageName) {
+            super(pageName);
+        }
+
+        public void createControl(Composite parent) {
+            Composite composite = createComposite(parent);
+            for (int i = 0; i < section.getTableColumnNames().length; i++) {
+                Label label = new Label(composite, SWT.LEFT);
+                String columnName = section.getTableColumnNames()[i];
+                if (!columnName.endsWith(":"))
+                    columnName = columnName.concat(":");
+                label.setText(columnName);
+                GridData data = new GridData();
+                data.horizontalAlignment = GridData.FILL;
+                label.setLayoutData(data);
+
+                Text text = new Text(composite, SWT.SINGLE | SWT.BORDER);
+                data = new GridData(GridData.HORIZONTAL_ALIGN_FILL
+                        | GridData.VERTICAL_ALIGN_FILL);
+                data.grabExcessHorizontalSpace = true;
+                data.widthHint = 100;
+                text.setLayoutData(data);
+                if (eObject != null) {
+                    if (i == 1) {
+                        // get the description
+                        Role role = (Role) eObject;
+                        String value = role.getDescription().get(0).getValue();
+                        if (value != null) {
+                            text.setText(value);
+                        }                        
+                    }
+                    else
+                    {
+                        String value = (String) JAXBUtils.getValue(eObject,getTableColumnEAttributes()[i]);
+                        if (value != null) {
+                            text.setText(value);
+                        }
+                    }
+                }
+                textEntries[i] = text;
+            }
+
+            doCustom(composite);
+            setControl(composite);
+            textEntries[0].setFocus();
+        }
+    }
+    
+    public boolean performFinish() {
+        DynamicWizardPage page = (DynamicWizardPage) getPages()[0];
+
+        if (eObject == null) {
+            eObject = getEFactory().create(Role.class);
+            JAXBElement plan = section.getPlan();
+
+            Security security = JAXBModelUtils.getSecurity(plan);
+            if (security == null) {
+                security = (Security)getEFactory().create(Security.class);
+                JAXBModelUtils.setSecurity(plan, security);
+            }
+
+            RoleMappings roleMappings = security.getRoleMappings();
+            if (roleMappings == null) {
+                roleMappings = (RoleMappings)getEFactory().create(RoleMappings.class);
+                security.setRoleMappings(roleMappings);
+            }
+
+            roleMappings.getRole().add((Role)eObject);
+        }
+
+        // NOTE!! this replaces the call to processEAttributes (page);
+        String value = page.getTextEntry(0).getText();
+        String attribute = getTableColumnEAttributes()[0];
+        JAXBUtils.setValue(eObject, attribute, value);
+
+        Description type = null;
+        Role role = (Role) eObject;
+        if (role.getDescription().isEmpty()) {
+            type = (Description)getEFactory().create(Description.class);
+            role.getDescription().add(type);
+        } else {
+            type = (Description) role.getDescription().get(0);
+        }
+        type.setValue (page.getTextEntry(1).getText());
+
+        if (section.getTableViewer().getInput() == section.getPlan()) {
+            section.getTableViewer().setInput(section.getInput());
+        }
+
+        return true;
+    }
+}

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ServiceRefWizard.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ServiceRefWizard.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/wizards/ServiceRefWizard.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ServiceRefWizard.java Thu Jun  5 10:38:37 2008
@@ -1,76 +1,54 @@
-/*
- * 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.wizards;
-
-import org.apache.geronimo.st.ui.CommonMessages;
-import org.apache.geronimo.st.ui.sections.AbstractTableSection;
-import org.apache.geronimo.st.ui.wizards.AbstractTableWizard;
-
-public class ServiceRefWizard extends AbstractTableWizard {
-
-	/**
-	 * @param section
-	 */
-	public ServiceRefWizard(AbstractTableSection section) {
-		super(section);
-	}
-/*
-	public EFactory getEFactory() {
-		return NamingFactory.eINSTANCE;
-	}
-
-	public EAttribute[] getTableColumnEAttributes() {
-		return new EAttribute[] { NamingPackage.eINSTANCE.getServiceRefType_ServiceRefName() };
-	}
-*/
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.wizards.DynamicAddEditWizard#getAddWizardWindowTitle()
-	 */
-	public String getAddWizardWindowTitle() {
-		return CommonMessages.wizardNewTitle_ServiceRef;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.wizards.DynamicAddEditWizard#getEditWizardWindowTitle()
-	 */
-	public String getEditWizardWindowTitle() {
-		return CommonMessages.wizardEditTitle_ServiceRef;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.wizards.DynamicAddEditWizard#getWizardFirstPageTitle()
-	 */
-	public String getWizardFirstPageTitle() {
-		return CommonMessages.wizardPageTitle_ServiceRef;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.ui.wizards.DynamicAddEditWizard#getWizardFirstPageDescription()
-	 */
-	public String getWizardFirstPageDescription() {
-		return CommonMessages.wizardPageDescription_ServiceRef;
-	}
-
-}
+/*
+ * 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.wizards;
+
+import org.apache.geronimo.st.core.jaxb.JAXBObjectFactory;
+import org.apache.geronimo.st.ui.CommonMessages;
+import org.apache.geronimo.st.ui.sections.AbstractTableSection;
+import org.apache.geronimo.st.ui.wizards.AbstractTableWizard;
+import org.apache.geronimo.st.v21.core.jaxb.JAXBObjectFactoryImpl;
+
+public class ServiceRefWizard extends AbstractTableWizard {
+
+    public ServiceRefWizard(AbstractTableSection section) {
+        super(section);
+    }
+
+    public JAXBObjectFactory getEFactory() {
+        return JAXBObjectFactoryImpl.getInstance();
+    }
+
+    public String[] getTableColumnEAttributes() {
+        return new String[] { "ServiceRefName" };
+    }
+
+    public String getAddWizardWindowTitle() {
+        return CommonMessages.wizardNewTitle_ServiceRef;
+    }
+
+    public String getEditWizardWindowTitle() {
+        return CommonMessages.wizardEditTitle_ServiceRef;
+    }
+
+    public String getWizardFirstPageTitle() {
+        return CommonMessages.wizardPageTitle_ServiceRef;
+    }
+
+    public String getWizardFirstPageDescription() {
+        return CommonMessages.wizardPageDescription_ServiceRef;
+    }
+}



Mime
View raw message