geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From de...@apache.org
Subject svn commit: r921247 [6/11] - in /geronimo/devtools/eclipse-plugin/trunk: ./ features/org.apache.geronimo.v30.feature/ plugins/org.apache.geronimo.runtime.v30/ plugins/org.apache.geronimo.runtime.v30/META-INF/ plugins/org.apache.geronimo.st.v30.core/ pl...
Date Wed, 10 Mar 2010 08:31:32 GMT
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/DependencySection.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/DependencySection.java?rev=921247&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/DependencySection.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/DependencySection.java Wed Mar 10 08:31:28 2010
@@ -0,0 +1,142 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.st.v21.ui.sections;
+
+import java.util.List;
+
+import javax.xml.bind.JAXBElement;
+
+import org.apache.geronimo.jee.deployment.Dependencies;
+import org.apache.geronimo.jee.deployment.Dependency;
+import org.apache.geronimo.jee.deployment.Environment;
+import org.apache.geronimo.st.ui.CommonMessages;
+import org.apache.geronimo.st.ui.sections.AbstractTableSection;
+import org.apache.geronimo.st.v21.ui.Activator;
+import org.apache.geronimo.st.v21.ui.wizards.DependencyWizard;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.IContentProvider;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class DependencySection extends AbstractTableSection {
+
+    boolean isServerEnvironment;
+    protected Environment environment;
+
+    public DependencySection(JAXBElement plan, Environment environment, Composite parent, FormToolkit toolkit, int style) {
+        this(plan, environment, parent, toolkit, style, true);
+    }
+
+    public DependencySection(JAXBElement plan, Environment environment, Composite parent, FormToolkit toolkit, int style, boolean isServerEnvironment) {
+        super(plan, parent, toolkit, style);
+        this.environment = environment;
+        this.isServerEnvironment = isServerEnvironment; 
+        this.COLUMN_NAMES = new String[] {
+                CommonMessages.groupId, CommonMessages.artifactId, CommonMessages.version, CommonMessages.artifactType
+        };
+        createClient();
+        getSection().setExpanded(false);
+    }
+
+    public String getTitle() {
+        if (isServerEnvironment) {
+            return CommonMessages.editorSectionDependenciesTitle;
+        } else {
+            return CommonMessages.editorSectionClientDependenciesTitle;
+        }
+    }
+
+    public String getDescription() {
+        if (isServerEnvironment) {
+            return CommonMessages.editorSectionDependenciesDescription;
+        } else {
+            return CommonMessages.editorSectionClientDependenciesDescription;
+        }
+    }
+
+    public List getObjectContainer() {
+        return getDependencies().getDependency();
+    }
+
+    private Dependencies getDependencies() {
+        if (environment == null) {
+            environment = new Environment();
+        }
+        if (environment.getDependencies() == null) {
+            environment.setDependencies(new Dependencies());
+        }
+        return environment.getDependencies();
+    }
+
+    @Override
+    public Wizard getWizard() {
+        return new DependencyWizard(this);
+    }
+
+    public ImageDescriptor getImageDescriptor() {
+        return Activator.imageDescriptorFromPlugin("org.eclipse.jdt.ui", "icons/full/obj16/jar_obj.gif");
+    }
+
+    public Class getTableEntryObjectType() {
+        return Dependency.class;
+    }
+
+    public Object getInput() {
+        return getDependencies();
+    }
+
+    @Override
+    public IContentProvider getContentProvider() {
+        return new ContentProvider() {
+            @Override
+            public Object[] getElements(Object inputElement) {
+                if (!Dependencies.class.isInstance(inputElement)) {
+                    return new String[] { "" };
+                }
+                return ((Dependencies) inputElement).getDependency().toArray();
+            }
+        };
+    }
+
+    @Override
+    public ITableLabelProvider getLabelProvider() {
+        return new LabelProvider() {
+            @Override
+            public String getColumnText(Object element, int columnIndex) {
+                if (Dependency.class.isInstance(element)) {
+                    Dependency dependency = (Dependency) element;
+                    switch (columnIndex) {
+                    case 0:
+                        return dependency.getGroupId();
+                    case 1:
+                        return dependency.getArtifactId();
+                    case 2:
+                        return dependency.getVersion();
+                    case 3:
+                        return dependency.getType();
+                    }
+                }
+                return "";
+            }
+        };
+    }
+}

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

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

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

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/EjbLocalRefSection.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/EjbLocalRefSection.java?rev=921247&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/EjbLocalRefSection.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/EjbLocalRefSection.java Wed Mar 10 08:31:28 2010
@@ -0,0 +1,85 @@
+/*
+ * 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.naming.EjbLocalRef;
+import org.apache.geronimo.st.ui.CommonMessages;
+import org.apache.geronimo.st.ui.sections.AbstractTableSection;
+import org.apache.geronimo.st.v21.ui.Activator;
+import org.apache.geronimo.st.v21.ui.wizards.EjbLocalRefWizard;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class EjbLocalRefSection extends AbstractTableSection {
+
+    public EjbLocalRefSection(JAXBElement plan, Composite parent, FormToolkit toolkit, int style, List ejbLocalRefs) {
+        super(plan, parent, toolkit, style);
+        this.objectContainer = ejbLocalRefs;
+        COLUMN_NAMES = new String[] {
+                CommonMessages.name, CommonMessages.editorEjbRefEjbLink };
+        createClient();
+    }
+
+    public String getTitle() {
+        return CommonMessages.editorEjbLocalRefTitle;
+    }
+
+    public String getDescription() {
+        return CommonMessages.editorEjbLocalRefDescription;
+    }
+
+    public Wizard getWizard() {
+        return new EjbLocalRefWizard(this);
+    }
+
+    public ImageDescriptor getImageDescriptor() {
+        return Activator.imageDescriptorFromPlugin("org.eclipse.jst.j2ee", "icons/full/obj16/ejb_local_ref_obj.gif");
+    }
+
+    public Class getTableEntryObjectType() {
+        return EjbLocalRef.class;
+    }
+
+    @Override
+    public ITableLabelProvider getLabelProvider() {
+        return new LabelProvider() {
+            @Override
+            public String getColumnText(Object element, int columnIndex) {
+                if (EjbLocalRef.class.isInstance(element)) {
+                    EjbLocalRef ejbLocalRef = (EjbLocalRef) element;
+                    switch (columnIndex) {
+                    case 0:
+                        return ejbLocalRef.getRefName();
+                    case 1:
+                        return ejbLocalRef.getEjbLink();
+                    }
+                }
+                return null;
+            }
+        };
+    }
+}

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

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

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

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/EjbRefSection.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/EjbRefSection.java?rev=921247&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/EjbRefSection.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/EjbRefSection.java Wed Mar 10 08:31:28 2010
@@ -0,0 +1,92 @@
+/*
+ * 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.naming.EjbRef;
+import org.apache.geronimo.st.ui.CommonMessages;
+import org.apache.geronimo.st.ui.sections.AbstractTableSection;
+import org.apache.geronimo.st.v21.ui.Activator;
+import org.apache.geronimo.st.v21.ui.wizards.EjbRefWizard;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class EjbRefSection extends AbstractTableSection {
+
+    /**
+     * @param plan
+     * @param parent
+     * @param toolkit
+     * @param style
+     */
+    public EjbRefSection(JAXBElement plan, Composite parent, FormToolkit toolkit, int style, List ejbRefs) {
+        super(plan, parent, toolkit, style);
+        this.objectContainer = ejbRefs;
+        COLUMN_NAMES = new String[] {
+                CommonMessages.name, CommonMessages.editorEjbRefEjbLink };
+        createClient();
+        getSection().setExpanded(false);
+    }
+
+    public String getTitle() {
+        return CommonMessages.editorEjbRefTitle;
+    }
+
+    public String getDescription() {
+        return CommonMessages.editorEjbRefDescription;
+    }
+
+    public Wizard getWizard() {
+        return new EjbRefWizard(this);
+    }
+
+    public ImageDescriptor getImageDescriptor() {
+        return Activator.imageDescriptorFromPlugin("org.eclipse.jst.j2ee", "icons/full/obj16/ejbRef_obj.gif");
+    }
+
+    public Class getTableEntryObjectType() {
+        return EjbRef.class;
+    }
+
+    @Override
+    public ITableLabelProvider getLabelProvider() {
+        return new LabelProvider() {
+            @Override
+            public String getColumnText(Object element, int columnIndex) {
+                if (EjbRef.class.isInstance(element)) {
+                    EjbRef ejbRef = (EjbRef) element;
+                    switch (columnIndex) {
+                    case 0:
+                        return ejbRef.getRefName();
+                    case 1:
+                        return ejbRef.getEjbLink();
+                    }
+                }
+                return null;
+            }
+        };
+    }
+}

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

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

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

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/EjbRelationSection.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/EjbRelationSection.java?rev=921247&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/EjbRelationSection.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/EjbRelationSection.java Wed Mar 10 08:31:28 2010
@@ -0,0 +1,173 @@
+/*
+ * 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.openejb.EjbRelation;
+import org.apache.geronimo.jee.openejb.EjbRelationshipRole;
+import org.apache.geronimo.jee.openejb.Relationships;
+import org.apache.geronimo.st.ui.CommonMessages;
+import org.apache.geronimo.st.ui.sections.AbstractTreeSection;
+import org.apache.geronimo.st.v21.ui.Activator;
+import org.apache.geronimo.st.v21.ui.wizards.EjbRelationWizard;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class EjbRelationSection extends AbstractTreeSection {
+    public EjbRelationSection(JAXBElement plan, Composite parent, FormToolkit toolkit, int style, Relationships relationships) {
+        super(plan, parent, toolkit, style);
+        this.objectContainer = relationships == null ? null : relationships.getEjbRelation();
+        createClient();
+    }
+
+    @Override
+    public String getTitle() {
+        return CommonMessages.editorEjbRelationTitle;
+    }
+
+    @Override
+    public String getDescription() {
+        return CommonMessages.editorEjbRelationDescription;
+    }
+
+    @Override
+    public Wizard getWizard() {
+        return new EjbRelationWizard(this);
+    }
+
+    @Override
+    public Class getTableEntryObjectType() {
+        return EjbRelation.class;
+    }
+
+    @Override
+    protected void activateAddButton() {
+        if (tree.getSelectionCount() == 0 || tree.getSelection()[0].getParentItem() == null ||
+            tree.getSelection()[0].getParentItem().getParentItem() == null) {
+            addButton.setEnabled(true);
+        } else {
+            addButton.setEnabled(false);
+        }
+    }
+
+    public Object getSelectedObject () {
+        if (tree.getSelection().length == 0) {
+            return null;
+        }
+        return tree.getSelection()[0].getData();
+    }
+
+    @Override
+    public void removeItem(Object anItem) {
+        if (EjbRelation.class.isInstance(anItem)) {
+            getObjectContainer().remove(anItem);
+        }
+        else if (EjbRelationshipRole.class.isInstance(anItem)) {
+            EjbRelation relation = (EjbRelation)tree.getSelection()[0].getParentItem().getData();
+            relation.getEjbRelationshipRole().remove(anItem);
+        }
+        else if (EjbRelationshipRole.RoleMapping.CmrFieldMapping.class.isInstance(anItem)) {
+            EjbRelationshipRole role = (EjbRelationshipRole)tree.getSelection()[0].getParentItem().getData();
+            role.getRoleMapping().getCmrFieldMapping().remove(anItem);
+        }
+    }
+    
+    @Override
+    public Object getInput() {
+        if (objectContainer != null) {
+            return objectContainer;
+        }
+        return super.getInput();
+    }
+
+    public void resetInput (Relationships relationships) {
+        objectContainer = relationships.getEjbRelation();
+        getViewer().setInput(objectContainer);
+    }
+
+    @Override
+    public ITreeContentProvider getContentProvider() {
+        return new ContentProvider() {
+            @Override
+            public Object[] getElements(Object inputElement) {
+                return getChildren(inputElement);
+            }
+
+            @Override
+            public Object[] getChildren(Object parentElement) {
+                if (List.class.isInstance(parentElement)) {
+                    return ((List)parentElement).toArray();
+                }
+                if (EjbRelation.class.isInstance(parentElement)) {
+                    EjbRelation relation = (EjbRelation)parentElement;
+                    return relation.getEjbRelationshipRole().toArray();
+                }
+                if (EjbRelationshipRole.class.isInstance(parentElement)) {
+                    EjbRelationshipRole role = (EjbRelationshipRole)parentElement;
+                    if (role.getRoleMapping() != null) {
+                        return role.getRoleMapping().getCmrFieldMapping().toArray();
+                    }
+                }
+                return new String[] {};
+            }
+        };
+    }
+
+    @Override
+    public ILabelProvider getLabelProvider() {
+        return new LabelProvider() {
+            @Override
+            public String getText(Object element) {
+                if (EjbRelation.class.isInstance(element)) {
+                    EjbRelation relation = (EjbRelation)element;
+                    return "EJB Relation: name = \"" + relation.getEjbRelationName() +
+                            "\", MTM table name = \"" + relation.getManyToManyTableName() + "\"";
+                }
+                if (EjbRelationshipRole.class.isInstance(element)) {
+                    EjbRelationshipRole role = (EjbRelationshipRole)element;
+                    return "EJB Relationship Role: name = \"" + role.getEjbRelationshipRoleName() +
+                            "\", source = \"" + role.getRelationshipRoleSource().getEjbName() +
+                            "\", CMR field name = \"" + role.getCmrField().getCmrFieldName() + "\"";
+                }
+                if (EjbRelationshipRole.RoleMapping.CmrFieldMapping.class.isInstance(element)) {
+                    EjbRelationshipRole.RoleMapping.CmrFieldMapping fieldMapping =
+                            (EjbRelationshipRole.RoleMapping.CmrFieldMapping)element;
+                    return "CMR Field Mapping: key column = \"" + fieldMapping.getKeyColumn() +
+                            "\", foreign key column = \"" + fieldMapping.getForeignKeyColumn() + "\"";
+                }
+
+                return null;
+            }
+
+            @Override
+            public Image getImage(Object arg0) {
+                return Activator.imageDescriptorFromPlugin("org.eclipse.jst.j2ee",
+                        "icons/full/obj16/module_web_obj.gif").createImage();
+            }
+        };
+    }
+}

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

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

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

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/ExtModuleSection.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/ExtModuleSection.java?rev=921247&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/ExtModuleSection.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/ExtModuleSection.java Wed Mar 10 08:31:28 2010
@@ -0,0 +1,159 @@
+/*
+ * 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.application.ExtModule;
+import org.apache.geronimo.st.ui.CommonMessages;
+import org.apache.geronimo.st.ui.sections.AbstractTableSection;
+import org.apache.geronimo.st.v21.ui.pages.ConnectorPage;
+import org.apache.geronimo.st.v21.ui.pages.DeploymentPage;
+import org.apache.geronimo.st.v21.ui.wizards.ExtModuleWizard;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.ui.forms.IFormPart;
+import org.eclipse.ui.forms.editor.FormEditor;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+/*
+ * @version $Rev$ $Date$
+ */
+public class ExtModuleSection extends AbstractTableSection {
+
+	public ExtModuleSection(JAXBElement plan, Composite parent,
+			FormToolkit toolkit, int style, List extModules) {
+		super(plan, parent, toolkit, style);
+		this.objectContainer = extModules;
+		COLUMN_NAMES = new String[] { CommonMessages.moduleType,
+				CommonMessages.path, CommonMessages.internalPath,
+				CommonMessages.groupId, CommonMessages.artifactId,
+				CommonMessages.version, CommonMessages.artifactType };
+		createClient();
+	}
+
+	public String getTitle() {
+		return CommonMessages.editorSectionExtModuleTitle;
+	}
+
+	public String getDescription() {
+		return CommonMessages.editorSectionExtModuleDescription;
+	}
+
+	public Wizard getWizard() {
+		return new ExtModuleWizard(this);
+	}
+
+	public Class getTableEntryObjectType() {
+		return ExtModule.class;
+	}
+
+	protected void notifyOthers() {
+		notifyDBPoolSectionToRefresh();
+	}
+
+	/*
+	 * After add, remove, edit ext-module, notify the dbpoolSection to refresh.
+	 * If the connectorpage has not been initialized,then catch a
+	 * NullPointerException and just ignore it.
+	 */
+	private void notifyDBPoolSectionToRefresh() {
+		try {
+			DeploymentPage deploymentPage = (DeploymentPage) this
+					.getManagedForm().getContainer();
+			FormEditor editor = deploymentPage.getEditor();
+			IFormPart[] parts = editor.findPage("connectorpage")
+					.getManagedForm().getParts();
+			DBPoolSection dbpoolSection = null;
+			for (IFormPart part : parts) {
+				if (DBPoolSection.class.isInstance(part)) {
+					dbpoolSection = (DBPoolSection) part;
+				}
+			}
+			dbpoolSection.getViewer().refresh();
+		} catch (NullPointerException e) {
+			// Ignore, this exception happens when the connectorpage hasn't been
+			// initialized
+		}
+	}
+
+	@Override
+	public ITableLabelProvider getLabelProvider() {
+		return new LabelProvider() {
+			@Override
+			public String getColumnText(Object element, int columnIndex) {
+				if (ExtModule.class.isInstance(element)) {
+					ExtModule extModule = (ExtModule) element;
+					switch (columnIndex) {
+					case 0:
+						if (extModule.getConnector() != null) {
+							return "connector";
+						} else if (extModule.getEjb() != null) {
+							return "ejb";
+						} else if (extModule.getJava() != null) {
+							return "java";
+						} else if (extModule.getWeb() != null) {
+							return "web";
+						}
+						return "";
+					case 1:
+						if (extModule.getConnector() != null) {
+							return extModule.getConnector().getValue();
+						} else if (extModule.getEjb() != null) {
+							return extModule.getEjb().getValue();
+						} else if (extModule.getJava() != null) {
+							return extModule.getJava().getValue();
+						} else if (extModule.getWeb() != null) {
+							return extModule.getWeb().getValue();
+						}
+						return "";
+					case 2:
+						if (extModule.getInternalPath() != null) {
+							return extModule.getInternalPath();
+						}
+						return "";
+					case 3:
+						if (extModule.getExternalPath() != null) {
+							return extModule.getExternalPath().getGroupId();
+						}
+						return "";
+					case 4:
+						if (extModule.getExternalPath() != null) {
+							return extModule.getExternalPath().getArtifactId();
+						}
+						return "";
+					case 5:
+						if (extModule.getExternalPath() != null) {
+							return extModule.getExternalPath().getVersion();
+						}
+						return "";
+					case 6:
+						if (extModule.getExternalPath() != null) {
+							return extModule.getExternalPath().getType();
+						}
+						return "";
+					}
+				}
+				return null;
+			}
+		};
+	}
+}

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

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

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

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/GBeanRefSection.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/GBeanRefSection.java?rev=921247&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/GBeanRefSection.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/GBeanRefSection.java Wed Mar 10 08:31:28 2010
@@ -0,0 +1,205 @@
+/*
+ * 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.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.JAXBElement;
+
+import org.apache.geronimo.jee.naming.GbeanRef;
+import org.apache.geronimo.jee.naming.Pattern;
+import org.apache.geronimo.jee.web.WebApp;
+import org.apache.geronimo.st.ui.CommonMessages;
+import org.apache.geronimo.st.ui.sections.AbstractTreeSection;
+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.GBeanRefWizard;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class GBeanRefSection extends AbstractTreeSection {
+
+	public GBeanRefSection(JAXBElement plan, Composite parent, FormToolkit toolkit, int style, List gbeanRef) {
+		super(plan, parent, toolkit, style);
+		//this.objectContainer = gbeanRef;
+	      this.objectContainer = new ArrayList(gbeanRef.size());
+	        for (int i = 0; i < gbeanRef.size(); i++) {
+	            if (GbeanRef.class.isInstance(gbeanRef.get(i))) {
+	                this.objectContainer.add(gbeanRef.get(i));
+	            }
+	            else if (GbeanRef.class.isInstance(((JAXBElement)gbeanRef.get(i)).getValue())) {
+	                this.objectContainer.add(gbeanRef.get(i));
+	            }
+	        }
+		createClient();
+	}
+
+    @Override
+	public String getTitle() {
+		return CommonMessages.editorGBeanRefTitle;
+	}
+
+    @Override
+	public String getDescription() {
+		return CommonMessages.editorGBeanRefDescription;
+	}
+
+    @Override
+	public Wizard getWizard() {
+		return new GBeanRefWizard(this);
+	}
+
+    @Override
+	public Class getTableEntryObjectType() {
+		return GbeanRef.class;
+	}
+
+    @Override
+    public Object getInput() {
+        if (objectContainer != null) {
+            return objectContainer;
+        }
+        return super.getInput();
+    }
+
+    @Override
+    protected void activateAddButton() {
+        if (tree.getSelectionCount() == 0 || tree.getSelection()[0].getParentItem() == null) {
+            addButton.setEnabled(true);
+        } else {
+            addButton.setEnabled(false);
+        }
+    }
+
+    public GbeanRef getSelectedObject () {
+        if (tree.getSelection().length == 0) {
+            return null;
+        }
+        Object object;
+        if (tree.getSelection()[0].getParentItem() == null) {
+            object = tree.getSelection()[0].getData();
+        }
+        else {
+            object = tree.getSelection()[0].getParentItem().getData();
+        }
+        if (GbeanRef.class.isInstance(object)) {
+            return (GbeanRef)object;
+        }
+        else {
+            return (GbeanRef)((JAXBElement)object).getValue();
+        }
+    }
+    
+    @Override
+    public void removeItem(Object anItem) {
+        if (GbeanRef.class.isInstance(anItem) || JAXBElement.class.isInstance(anItem)) {
+            getObjectContainer().remove(anItem);
+            JAXBModelUtils.getGbeanRefs(getPlan()).remove(anItem);
+        }
+        else if (String.class.isInstance(anItem)) {
+            Object object = tree.getSelection()[0].getParentItem().getData();
+            if (GbeanRef.class.isInstance(object)) {
+                ((GbeanRef)object).getRefType().remove(anItem);
+            }
+            else {
+                ((GbeanRef)((JAXBElement)object).getValue()).getRefType().remove(anItem);
+            }
+        }
+        else if (Pattern.class.isInstance(anItem)) {
+            Object object = tree.getSelection()[0].getParentItem().getData();
+            if (GbeanRef.class.isInstance(object)) {
+                ((GbeanRef)object).getPattern().remove(anItem);
+            }
+            else {
+                ((GbeanRef)((JAXBElement)object).getValue()).getPattern().remove(anItem);
+            }
+        }
+    }
+
+    @Override
+    public ITreeContentProvider getContentProvider() {
+        return new ContentProvider() {
+            @Override
+            public Object[] getElements(Object inputElement) {
+                return getChildren(inputElement);
+            }
+
+            @Override
+            public Object[] getChildren(Object parentElement) {
+                if (List.class.isInstance(parentElement)) {
+                    return ((List)parentElement).toArray();
+                }
+                if (JAXBElement.class.isInstance(parentElement)) {
+                    parentElement = ((JAXBElement)parentElement).getValue();
+                }
+                if (GbeanRef.class.isInstance(parentElement)) {
+                    GbeanRef gbeanRef = (GbeanRef)parentElement;
+                    Object[] typeList = gbeanRef.getRefType().toArray();
+                    Object[] patternList = gbeanRef.getPattern().toArray();
+                    Object[] fullList = new Object[typeList.length + patternList.length];
+                    System.arraycopy(typeList, 0, fullList, 0, typeList.length);
+                    System.arraycopy(patternList, 0, fullList, typeList.length, patternList.length);
+                    return fullList;
+                }
+                return new String[] {};
+            }
+        };
+    }
+
+    @Override
+    public ILabelProvider getLabelProvider() {
+        return new LabelProvider() {
+            @Override
+            public String getText(Object element) {
+                if (JAXBElement.class.isInstance(element)) {
+                    element = ((JAXBElement)element).getValue();
+                }
+                if (GbeanRef.class.isInstance(element)) {
+                    GbeanRef gbeanRef = (GbeanRef)element;
+                    return "Gbean Ref: name = \"" + gbeanRef.getRefName() + "\"";
+                }
+                else if (String.class.isInstance(element)) {
+                    return "Gbean type: name = \"" + (String)element + "\"";
+                }
+                else if (Pattern.class.isInstance(element)) {
+                    Pattern pattern = (Pattern)element;
+                    return "Pattern: name = \"" + pattern.getName() + 
+                            "\", group = \"" + pattern.getGroupId() + 
+                            "\", artifact = \"" + pattern.getArtifactId() + 
+                            "\", version = \"" + pattern.getVersion() + 
+                            "\", module = \"" + pattern.getModule() + "\"";
+                }
+
+                return null;
+            }
+
+            @Override
+            public Image getImage(Object arg0) {
+                return Activator.imageDescriptorFromPlugin("org.eclipse.jst.j2ee",
+                        "icons/full/obj16/module_web_obj.gif").createImage();
+            }
+        };
+    }
+}

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

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

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

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/GBeanSection.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/GBeanSection.java?rev=921247&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/GBeanSection.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/GBeanSection.java Wed Mar 10 08:31:28 2010
@@ -0,0 +1,219 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.st.v21.ui.sections;
+
+import java.util.List;
+
+import javax.xml.bind.JAXBElement;
+
+import org.apache.geronimo.jee.deployment.Attribute;
+import org.apache.geronimo.jee.deployment.Gbean;
+import org.apache.geronimo.jee.deployment.Pattern;
+import org.apache.geronimo.jee.deployment.Reference;
+import org.apache.geronimo.st.ui.CommonMessages;
+import org.apache.geronimo.st.ui.sections.AbstractTreeSection;
+import org.apache.geronimo.st.v21.ui.Activator;
+import org.apache.geronimo.st.v21.ui.pages.DeploymentPage;
+import org.apache.geronimo.st.v21.ui.wizards.GBeanWizard;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.IFormPart;
+import org.eclipse.ui.forms.editor.FormEditor;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class GBeanSection extends AbstractTreeSection {
+
+    public GBeanSection(JAXBElement plan, List gbeans, Composite parent,
+	    FormToolkit toolkit, int style) {
+	super(plan, parent, toolkit, style);
+	this.objectContainer = gbeans;
+	createClient();
+    }
+
+    @Override
+    public String getTitle() {
+	return CommonMessages.editorSectionGBeanTitle;
+    }
+
+    @Override
+    public String getDescription() {
+	return CommonMessages.editorSectionGBeanDescription;
+    }
+
+    @Override
+    public Wizard getWizard() {
+	return new GBeanWizard(this);
+    }
+
+    @Override
+    public Class getTableEntryObjectType() {
+	return Gbean.class;
+    }
+
+    @Override
+    protected void activateAddButton() {
+	if (tree.getSelectionCount() == 0
+		|| tree.getSelection()[0].getParentItem() == null) {
+	    addButton.setEnabled(true);
+	} else {
+	    addButton.setEnabled(false);
+	}
+    }
+
+    public Gbean getSelectedObject() {
+	if (tree.getSelection().length == 0) {
+	    return null;
+	}
+	return (Gbean) ((JAXBElement) tree.getSelection()[0].getData())
+		.getValue();
+    }
+
+    @Override
+    public void removeItem(Object anItem) {
+	JAXBElement element = (JAXBElement) tree.getSelection()[0].getData();
+	Object object = element.getValue();
+	if (Gbean.class.isInstance(object)) {
+	    objectContainer.remove(anItem);
+	} else {
+	    Gbean gbean = (Gbean) ((JAXBElement) tree.getSelection()[0]
+		    .getParentItem().getData()).getValue();
+	    gbean.getAttributeOrXmlAttributeOrReference().remove(element);
+	}
+    }
+
+    @Override
+    public Object getInput() {
+	if (objectContainer != null) {
+	    return objectContainer;
+	}
+	return super.getInput();
+    }
+
+    protected void notifyOthers() {
+	notifySecurityRealmSectionToRefresh();
+    }
+
+    /*
+     * After add, remove, edit ext-module, notify the dbpoolSection to refresh.
+     * If the connectorpage has not been initialized,then catch a
+     * NullPointerException and just ignore it.
+     */
+    private void notifySecurityRealmSectionToRefresh() {
+	try {
+	    DeploymentPage deploymentPage = (DeploymentPage) this
+		    .getManagedForm().getContainer();
+	    FormEditor editor = deploymentPage.getEditor();
+	    IFormPart[] parts = editor.findPage("securitypage")
+		    .getManagedForm().getParts();
+	    SecurityRealmSection securityRealmSection = null;
+	    for (IFormPart part : parts) {
+		if (SecurityRealmSection.class.isInstance(part)) {
+		    securityRealmSection = (SecurityRealmSection) part;
+		}
+	    }
+	    securityRealmSection.getViewer().refresh();
+	} catch (NullPointerException e) {
+	    // Ignore, this exception happens when the connectorpage hasn't been
+	    // initialized
+	}
+    }
+
+    @Override
+    public ITreeContentProvider getContentProvider() {
+	return new ContentProvider() {
+	    @Override
+	    public Object[] getElements(Object inputElement) {
+		return getChildren(inputElement);
+	    }
+
+	    @Override
+	    public Object[] getChildren(Object parentElement) {
+		if (List.class.isInstance(parentElement)) {
+		    return ((List) parentElement).toArray();
+		}
+		if (JAXBElement.class.isInstance(parentElement)) {
+		    Object object = ((JAXBElement) parentElement).getValue();
+		    if (Gbean.class.isInstance(object)) {
+			Gbean gbean = (Gbean) object;
+			return gbean.getAttributeOrXmlAttributeOrReference()
+				.toArray();
+		    }
+		}
+		return new String[] {};
+	    }
+	};
+    }
+
+    @Override
+    public ILabelProvider getLabelProvider() {
+	return new LabelProvider() {
+	    @Override
+	    public String getText(Object element) {
+		if (JAXBElement.class.isInstance(element)) {
+		    Object object = ((JAXBElement) element).getValue();
+		    if (Gbean.class.isInstance(object)) {
+			Gbean gbean = (Gbean) object;
+			return "GBean: name = \"" + gbean.getName()
+				+ "\", class = \"" + gbean.getClazz() + "\"";
+		    } else if (Attribute.class.isInstance(object)) {
+			Attribute attribute = (Attribute) object;
+			return "Attribute: name = \"" + attribute.getName()
+				+ "\", type = \"" + attribute.getType()
+				+ "\", value = \"" + attribute.getValue()
+				+ "\"";
+		    } else if (Pattern.class.isInstance(object)) {
+			Pattern dependency = (Pattern) object;
+			return "Dependency: group = \""
+				+ dependency.getGroupId() + "\", artifact = \""
+				+ dependency.getArtifactId()
+				+ "\", version = \"" + dependency.getVersion()
+				+ "\", module = \"" + dependency.getModule()
+				+ "\", type = \"" + dependency.getType()
+				+ "\", custom name = \""
+				+ dependency.getCustomFoo() + "\"";
+		    } else if (Reference.class.isInstance(object)) {
+			Reference reference = (Reference) object;
+			return "Reference: name = \"" + reference.getName()
+				+ "\", group = \"" + reference.getGroupId()
+				+ "\", artifact = \""
+				+ reference.getArtifactId()
+				+ "\", version = \"" + reference.getVersion()
+				+ "\", module = \"" + reference.getModule()
+				+ "\", type = \"" + reference.getType()
+				+ "\", custom name = \""
+				+ reference.getCustomFoo() + "\"";
+		    }
+		}
+
+		return null;
+	    }
+
+	    @Override
+	    public Image getImage(Object arg0) {
+		return Activator.imageDescriptorFromPlugin(
+			"org.eclipse.jst.j2ee",
+			"icons/full/obj16/accessbean_obj.gif").createImage();
+	    }
+	};
+    }
+}

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

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

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

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/MessageDestSection.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/MessageDestSection.java?rev=921247&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/MessageDestSection.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/MessageDestSection.java Wed Mar 10 08:31:28 2010
@@ -0,0 +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.sections;
+
+import java.util.List;
+
+import javax.xml.bind.JAXBElement;
+
+import org.apache.geronimo.jee.naming.MessageDestination;
+import org.apache.geronimo.st.ui.CommonMessages;
+import org.apache.geronimo.st.ui.sections.AbstractTableSection;
+import org.apache.geronimo.st.v21.ui.wizards.MessageDestWizard;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class MessageDestSection extends AbstractTableSection {
+
+    public MessageDestSection(JAXBElement plan, Composite parent, FormToolkit toolkit, int style, List messageDest) {
+        super(plan, parent, toolkit, style);
+        this.objectContainer = messageDest;
+        COLUMN_NAMES = new String[] {
+                CommonMessages.messageDestinationName, CommonMessages.adminModule, CommonMessages.adminLink, 
+                CommonMessages.groupId, CommonMessages.artifactId, CommonMessages.version,
+                CommonMessages.moduleId, CommonMessages.name };
+        createClient();
+    }
+
+    public String getTitle() {
+        return CommonMessages.editorSectionMessageDestTitle;
+    }
+
+    public String getDescription() {
+        return CommonMessages.editorSectionMessageDestDescription;
+    }
+
+    public Wizard getWizard() {
+        return new MessageDestWizard(this);
+    }
+
+    public Class getTableEntryObjectType() {
+        return MessageDestination.class;
+    }
+
+    @Override
+    public ITableLabelProvider getLabelProvider() {
+        return new LabelProvider() {
+            @Override
+            public String getColumnText(Object element, int columnIndex) {
+                if (MessageDestination.class.isInstance(element)) {
+                    MessageDestination msgDest = (MessageDestination) element;
+                    switch (columnIndex) {
+                    case 0:
+                        return msgDest.getMessageDestinationName();
+                    case 1:
+                        return msgDest.getAdminObjectModule();
+                    case 2:
+                        return msgDest.getAdminObjectLink();
+                    case 3:
+                        return msgDest.getPattern().getGroupId();
+                    case 4:
+                        return msgDest.getPattern().getArtifactId();
+                    case 5:
+                        return msgDest.getPattern().getVersion();
+                    case 6:
+                        return msgDest.getPattern().getModule();
+                    case 7:
+                        return msgDest.getPattern().getName();
+                    }
+                }
+                return null;
+            }
+        };
+    }
+}

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

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

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

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/ModuleSection.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/ModuleSection.java?rev=921247&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/ModuleSection.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/ModuleSection.java Wed Mar 10 08:31:28 2010
@@ -0,0 +1,102 @@
+/*
+ * 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.application.Module;
+import org.apache.geronimo.st.ui.CommonMessages;
+import org.apache.geronimo.st.ui.sections.AbstractTableSection;
+import org.apache.geronimo.st.v21.ui.wizards.ModuleWizard;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+/*
+ * @version $Rev$ $Date$
+ */
+public class ModuleSection extends AbstractTableSection {
+
+    public ModuleSection(JAXBElement plan, Composite parent, FormToolkit toolkit, int style, List modules) {
+        super(plan, parent, toolkit, style);
+        this.objectContainer = modules;
+        COLUMN_NAMES = new String[] {
+                CommonMessages.moduleType, CommonMessages.path, CommonMessages.altDD };
+        createClient();
+    }
+
+    public String getTitle() {
+        return CommonMessages.editorSectionModuleTitle;
+    }
+
+    public String getDescription() {
+        return CommonMessages.editorSectionModuleDescription;
+    }
+
+    public Wizard getWizard() {
+        return new ModuleWizard(this);
+    }
+
+    public Class getTableEntryObjectType() {
+        return Module.class;
+    }
+
+    @Override
+    public ITableLabelProvider getLabelProvider() {
+        return new LabelProvider() {
+            @Override
+            public String getColumnText(Object element, int columnIndex) {
+                if (Module.class.isInstance(element)) {
+                    Module module = (Module) element;
+                    switch (columnIndex) {
+                    case 0:
+                        if (module.getConnector() != null) {
+                            return "connector";
+                        } else if (module.getEjb() != null) {
+                            return "ejb";
+                        } else if (module.getJava() != null) {
+                            return "java";
+                        } else if (module.getWeb() != null) {
+                            return "web";
+                        }
+                        return "";
+                    case 1:
+                        if (module.getConnector() != null) {
+                            return module.getConnector().getValue();
+                        } else if (module.getEjb() != null) {
+                            return module.getEjb().getValue();
+                        } else if (module.getJava() != null) {
+                            return module.getJava().getValue();
+                        } else if (module.getWeb() != null) {
+                            return module.getWeb().getValue();
+                        }
+                        return "";
+                    case 2:
+                        if (module.getAltDd() != null) {
+                            return module.getAltDd().getValue();
+                        }
+                        return "";
+                    }
+                }
+                return null;
+            }
+        };
+    }
+}

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

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

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

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/OpenEjbJarCMPSection.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/OpenEjbJarCMPSection.java?rev=921247&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/OpenEjbJarCMPSection.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/OpenEjbJarCMPSection.java Wed Mar 10 08:31:28 2010
@@ -0,0 +1,300 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.st.v21.ui.sections;
+
+import javax.xml.bind.JAXBElement;
+
+import org.apache.geronimo.jee.naming.ResourceLocator;
+import org.apache.geronimo.jee.naming.ObjectFactory;
+import org.apache.geronimo.jee.naming.Pattern;
+import org.apache.geronimo.jee.openejb.OpenejbJar;
+import org.apache.geronimo.st.ui.CommonMessages;
+import org.apache.geronimo.st.ui.internal.Messages;
+import org.apache.geronimo.st.ui.sections.AbstractSectionPart;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Section;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class OpenEjbJarCMPSection extends AbstractSectionPart {
+
+    protected Text resourceLink;
+
+    protected Text url;
+
+    protected Text artifact;
+
+    protected Text group;
+
+    protected Text module;
+
+    protected Text name;
+
+    protected Text version;
+
+    protected Button specifyAsLink;
+
+    protected Button specifyAsUrl;
+
+    protected Button specifyAsPattern;
+
+    OpenejbJar plan;
+    
+    private ObjectFactory namingFactory;
+
+    /**
+     * @param parent
+     * @param toolkit
+     * @param style
+     * @param plan
+     */
+    public OpenEjbJarCMPSection(Composite parent, FormToolkit toolkit, int style, JAXBElement plan) {
+        super(parent, toolkit, style, plan);
+        this.plan = (OpenejbJar) plan.getValue();
+        namingFactory = new ObjectFactory();
+        createClient();
+    }
+
+    protected void createClient() {
+        Section section = getSection();
+
+        section.setText(Messages.cmpConnectionSection);
+        section.setDescription(Messages.cmpConnectionSectionDescription);
+        section.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
+
+        Composite composite = toolkit.createComposite(section);
+        GridLayout layout = new GridLayout();
+        layout.numColumns = 2;
+        layout.marginHeight = 5;
+        layout.marginWidth = 10;
+        layout.verticalSpacing = 5;
+        layout.horizontalSpacing = 15;
+        composite.setLayout(layout);
+        composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+        section.setClient(composite);
+
+        specifyAsLink = toolkit.createButton(composite, CommonMessages.useResourceLink, SWT.RADIO);
+        GridData data = new GridData();
+        data.horizontalSpan = 2;
+        specifyAsLink.setLayoutData(data);
+
+        ResourceLocator locator = plan.getCmpConnectionFactory();
+
+        toolkit.createLabel(composite, CommonMessages.resourceLink);
+        String value = locator != null ? locator.getResourceLink() : null;
+        resourceLink = toolkit.createText(composite, value, SWT.BORDER);
+        resourceLink.setLayoutData(createTextFieldGridData());
+        resourceLink.addModifyListener(new ModifyListener() {
+            public void modifyText(ModifyEvent e) {
+                getResourceLocator().setResourceLink(resourceLink.getText());
+                markDirty();
+            }
+        });
+        
+        specifyAsUrl = toolkit.createButton(composite, CommonMessages.useUrl, SWT.RADIO);
+        data = new GridData();
+        data.horizontalSpan = 2;
+        specifyAsUrl.setLayoutData(data);
+
+        toolkit.createLabel(composite, CommonMessages.url);
+        value = locator != null ? locator.getUrl() : null;
+        url = toolkit.createText(composite, value, SWT.BORDER);
+        url.setLayoutData(createTextFieldGridData());
+        url.addModifyListener(new ModifyListener() {
+            public void modifyText(ModifyEvent e) {
+                getResourceLocator().setUrl(url.getText());
+                markDirty();
+            }
+        });
+
+        specifyAsPattern = toolkit.createButton(composite, CommonMessages.useResourcePattern, SWT.RADIO);
+        specifyAsPattern.setLayoutData(data);
+
+        toolkit.createLabel(composite, CommonMessages.groupId);
+        value = locator != null && locator.getPattern() != null ? locator.getPattern().getGroupId()
+                : null;
+        group = toolkit.createText(composite, value, SWT.BORDER);
+        group.setLayoutData(createTextFieldGridData());
+        group.addModifyListener(new ModifyListener() {
+            public void modifyText(ModifyEvent e) {
+                getPattern().setGroupId(group.getText());
+                markDirty();
+            }
+        });
+
+        toolkit.createLabel(composite, CommonMessages.artifactId);
+        value = locator != null && locator.getPattern() != null ? locator.getPattern().getArtifactId()
+                : null;
+        artifact = toolkit.createText(composite, value, SWT.BORDER);
+        artifact.setLayoutData(createTextFieldGridData());
+        artifact.addModifyListener(new ModifyListener() {
+            public void modifyText(ModifyEvent e) {
+                getPattern().setArtifactId(artifact.getText());
+                markDirty();
+            }
+        });
+
+        toolkit.createLabel(composite, CommonMessages.moduleId);
+        value = locator != null && locator.getPattern() != null ? locator.getPattern().getModule()
+                : null;
+        module = toolkit.createText(composite, value, SWT.BORDER);
+        module.setLayoutData(createTextFieldGridData());
+        module.addModifyListener(new ModifyListener() {
+            public void modifyText(ModifyEvent e) {
+                getPattern().setModule(module.getText());
+                markDirty();
+            }
+        });
+
+        toolkit.createLabel(composite, CommonMessages.name);
+        value = locator != null && locator.getPattern() != null ? locator.getPattern().getName()
+                : null;
+        name = toolkit.createText(composite, value, SWT.BORDER);
+        name.setLayoutData(createTextFieldGridData());
+        name.addModifyListener(new ModifyListener() {
+            public void modifyText(ModifyEvent e) {
+                getPattern().setName(name.getText());
+                markDirty();
+            }
+        });
+
+        toolkit.createLabel(composite, CommonMessages.version);
+        value = locator != null && locator.getPattern() != null ? locator.getPattern().getVersion()
+                : null;
+        version = toolkit.createText(composite, value, SWT.BORDER);
+        version.setLayoutData(createTextFieldGridData());
+        version.addModifyListener(new ModifyListener() {
+            public void modifyText(ModifyEvent e) {
+                getPattern().setVersion(version.getText());
+                markDirty();
+            }
+        });
+
+        specifyAsLink.addSelectionListener(new SelectionAdapter() {
+            public void widgetSelected(SelectionEvent e) {
+                if (specifyAsLink.getSelection()) {
+                    getResourceLocator().setUrl(null);
+                    getResourceLocator().setPattern(null);
+                    if (resourceLink.getText().length() > 0) {
+                        getResourceLocator().setResourceLink(resourceLink.getText());
+                    }
+                    markDirty();
+                    toggle();
+                }
+            }
+        });
+
+        specifyAsUrl.addSelectionListener(new SelectionAdapter() {
+            public void widgetSelected(SelectionEvent e) {
+                if (specifyAsUrl.getSelection()) {
+                    getResourceLocator().setResourceLink(null);
+                    getResourceLocator().setPattern(null);
+                    if (url.getText().length() > 0) {
+                        getResourceLocator().setUrl(url.getText());
+                    }
+                    markDirty();
+                    toggle();
+                }
+            }
+        });
+ 
+        specifyAsPattern.addSelectionListener(new SelectionAdapter() {
+            public void widgetSelected(SelectionEvent e) {
+                if (specifyAsPattern.getSelection()) {
+              	    getResourceLocator().setResourceLink (null);
+                    getResourceLocator().setUrl (null);
+
+                    if (group.getText().length() > 0) {
+                        getPattern().setGroupId(group.getText());
+                    }
+                    if (artifact.getText().length() > 0) {
+                        getPattern().setArtifactId(artifact.getText());
+                    }
+                    if (module.getText().length() > 0) {
+                        getPattern().setModule(module.getText());
+                    }
+                    if (name.getText().length() > 0) {
+                        getPattern().setName(name.getText());
+                    }
+                    if (version.getText().length() > 0) {
+                        getPattern().setVersion(version.getText());
+                    }
+                    markDirty();
+                    toggle();
+                }
+            }
+        });
+
+        if (locator != null) {
+            if (locator.getResourceLink() != null) {
+                specifyAsLink.setSelection(true);
+            } else if (locator.getUrl() != null) {
+                specifyAsUrl.setSelection(true);
+            } else if (locator.getPattern() != null) {
+                specifyAsPattern.setSelection(true);
+            }
+        }
+
+        toggle();
+    }
+
+    public void toggle() {
+        resourceLink.setEnabled(specifyAsLink.getSelection());
+        url.setEnabled(specifyAsUrl.getSelection());
+        artifact.setEnabled(specifyAsPattern.getSelection());
+        group.setEnabled(specifyAsPattern.getSelection());
+        module.setEnabled(specifyAsPattern.getSelection());
+        name.setEnabled(specifyAsPattern.getSelection());
+        version.setEnabled(specifyAsPattern.getSelection());
+    }
+
+    /**
+     * @return
+     */
+    private ResourceLocator getResourceLocator() {
+        ResourceLocator locator = plan.getCmpConnectionFactory();
+        if (locator == null) {
+            locator = namingFactory.createResourceLocator();
+            plan.setCmpConnectionFactory(locator);
+        }
+        return locator;
+    }
+
+    /**
+     * @return
+     */
+    private Pattern getPattern() {
+        ResourceLocator locator = getResourceLocator();
+        Pattern pattern = locator.getPattern();
+        if (pattern == null) {
+            pattern = namingFactory.createPattern();
+            locator.setPattern(pattern);
+        }
+        return pattern;
+    }
+}

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

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

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

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/OpenEjbJarGeneralSection.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/OpenEjbJarGeneralSection.java?rev=921247&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/OpenEjbJarGeneralSection.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/OpenEjbJarGeneralSection.java Wed Mar 10 08:31:28 2010
@@ -0,0 +1,102 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.st.v21.ui.sections;
+
+import javax.xml.bind.JAXBElement;
+
+import org.apache.geronimo.jee.openejb.OpenejbJar;
+import org.apache.geronimo.jee.openejb.ObjectFactory;
+import org.apache.geronimo.st.ui.CommonMessages;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class OpenEjbJarGeneralSection extends CommonGeneralSection {
+
+    protected Text ejbqlCompilerFactory;
+
+    protected Text dbSyntaxFactory;
+
+    protected Button enforceForeignKeyConstraints;
+    
+    OpenejbJar plan;
+
+    public OpenEjbJarGeneralSection(Composite parent, FormToolkit toolkit, int style, JAXBElement plan) {
+        super(parent, toolkit, style, plan);
+        this.plan = (OpenejbJar) plan.getValue();
+        createClient();
+    }
+
+    protected void createClient() {
+        super.createClient();
+        Composite composite = (Composite) getSection().getClient();
+
+        createLabel(composite, CommonMessages.editorejbqlCompilerFactory);
+
+        ejbqlCompilerFactory = toolkit.createText(composite, plan.getEjbQlCompilerFactory(), SWT.BORDER);
+        ejbqlCompilerFactory.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
+        ejbqlCompilerFactory.addModifyListener(new ModifyListener() {
+            public void modifyText(ModifyEvent e) {
+                plan.setEjbQlCompilerFactory(ejbqlCompilerFactory.getText());
+                markDirty();
+            }
+        });
+
+        createLabel(composite, CommonMessages.editordbSyntaxFactory);
+
+        dbSyntaxFactory = toolkit.createText(composite, plan.getDbSyntaxFactory(), SWT.BORDER);
+        dbSyntaxFactory.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
+        dbSyntaxFactory.addModifyListener(new ModifyListener() {
+            public void modifyText(ModifyEvent e) {
+                plan.setDbSyntaxFactory(dbSyntaxFactory.getText());
+                markDirty();
+            }
+        });
+
+        enforceForeignKeyConstraints = toolkit.createButton(composite, CommonMessages.enforceForeignKeyConstraints, SWT.CHECK);
+        enforceForeignKeyConstraints.setSelection(plan.getEnforceForeignKeyConstraints() != null);
+        GridData data = new GridData();
+        data.horizontalSpan = 2;
+        enforceForeignKeyConstraints.setLayoutData(data);
+
+        enforceForeignKeyConstraints.addSelectionListener(new SelectionListener() {
+            public void widgetDefaultSelected(SelectionEvent e) {
+            }
+
+            public void widgetSelected(SelectionEvent e) {
+            	if (enforceForeignKeyConstraints.getSelection()) {
+            		ObjectFactory objFactory = new ObjectFactory();
+            		plan.setEnforceForeignKeyConstraints(objFactory.createEmpty());
+            	}
+            	else {
+            		plan.setEnforceForeignKeyConstraints(null);
+            	}
+                markDirty();
+            }
+        });
+    }
+}

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

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

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

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/PersContextRefSection.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/PersContextRefSection.java?rev=921247&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/PersContextRefSection.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/PersContextRefSection.java Wed Mar 10 08:31:28 2010
@@ -0,0 +1,178 @@
+/*
+ * 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.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.JAXBElement;
+
+import org.apache.geronimo.jee.naming.PersistenceContextRef;
+import org.apache.geronimo.jee.naming.Property;
+import org.apache.geronimo.st.ui.CommonMessages;
+import org.apache.geronimo.st.ui.sections.AbstractTreeSection;
+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.PersContextRefWizard;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class PersContextRefSection extends AbstractTreeSection {
+    
+	public PersContextRefSection(JAXBElement plan, Composite parent, FormToolkit toolkit, int style, List persContextRefs) {
+		super(plan, parent, toolkit, style);
+		this.objectContainer = new ArrayList(persContextRefs.size());
+		for (int i = 0; i < persContextRefs.size(); i++) {
+		    if (PersistenceContextRef.class.isInstance(((JAXBElement)persContextRefs.get(i)).getValue())) {
+		        this.objectContainer.add(persContextRefs.get(i));
+		    }
+		}
+		createClient();
+	}
+
+    @Override
+	public String getTitle() {
+		return CommonMessages.editorPersContextRefTitle;
+	}
+
+    @Override
+	public String getDescription() {
+		return CommonMessages.editorPersContextRefDescription;
+	}
+
+    @Override
+	public Wizard getWizard() {
+		return new PersContextRefWizard(this);
+	}
+
+    @Override
+	public Class getTableEntryObjectType() {
+		return PersistenceContextRef.class;
+	}
+
+    @Override
+    public Object getInput() {
+        if (objectContainer != null) {
+            return objectContainer;
+        }
+        return super.getInput();
+    }
+
+    @Override
+    protected void activateAddButton() {
+        if (tree.getSelectionCount() == 0 || tree.getSelection()[0].getParentItem() == null) {
+            addButton.setEnabled(true);
+        } else {
+            addButton.setEnabled(false);
+        }
+    }
+
+    public PersistenceContextRef getSelectedObject () {
+        if (tree.getSelection().length == 0) {
+            return null;
+        }
+        Object object;
+        if (tree.getSelection()[0].getParentItem() == null) {
+            object = tree.getSelection()[0].getData();
+        }
+        else {
+            object = tree.getSelection()[0].getParentItem().getData();
+        }
+        return (PersistenceContextRef)((JAXBElement)object).getValue();
+    }
+    
+    @Override
+    public void removeItem(Object anItem) {
+        if (JAXBElement.class.isInstance(anItem)) {
+            getObjectContainer().remove(anItem);
+            JAXBModelUtils.getGbeanRefs(getPlan()).remove(anItem);
+        }
+        else if (Property.class.isInstance(anItem)) {
+            Object object = tree.getSelection()[0].getParentItem().getData();
+            ((PersistenceContextRef)((JAXBElement)object).getValue()).getProperty().remove(anItem);
+        }
+    }
+
+    @Override
+    public ITreeContentProvider getContentProvider() {
+        return new ContentProvider() {
+            @Override
+            public Object[] getElements(Object inputElement) {
+                return getChildren(inputElement);
+            }
+
+            @Override
+            public Object[] getChildren(Object parentElement) {
+                if (List.class.isInstance(parentElement)) {
+                    return ((List)parentElement).toArray();
+                }
+                if (JAXBElement.class.isInstance(parentElement)) {
+                    return ((PersistenceContextRef)((JAXBElement)parentElement).getValue()).getProperty().toArray();
+                }
+                return new String[] {};
+            }
+        };
+    }
+
+    @Override
+    public ILabelProvider getLabelProvider() {
+        return new LabelProvider() {
+            @Override
+            public String getText(Object element) {
+                if (JAXBElement.class.isInstance(element)) {
+                    PersistenceContextRef contextRef = (PersistenceContextRef)((JAXBElement)element).getValue();
+                    String temp = "Persistence Context Ref: name = \"" + contextRef.getPersistenceContextRefName() +
+                                  "\", type = \"" + contextRef.getPersistenceContextType().value();
+                    if (contextRef.getPersistenceUnitName() != null)
+                        temp += "\", unit name = \"" + contextRef.getPersistenceUnitName();
+                    if (contextRef.getPattern() != null && contextRef.getPattern().getName() != null)
+                        temp += "\", pattern name = \"" + contextRef.getPattern().getName();
+                    if (contextRef.getPattern() != null && contextRef.getPattern().getGroupId() != null)
+                        temp += "\", pattern group = \"" + contextRef.getPattern().getGroupId();
+                    if (contextRef.getPattern() != null && contextRef.getPattern().getArtifactId() != null)
+                        temp += "\", pattern artifact = \"" + contextRef.getPattern().getArtifactId();
+                    if (contextRef.getPattern() != null && contextRef.getPattern().getVersion() != null)
+                        temp += "\", pattern version = \"" + contextRef.getPattern().getVersion();
+                    if (contextRef.getPattern() != null && contextRef.getPattern().getModule() != null)
+                        temp += "\", pattern module = \"" + contextRef.getPattern().getModule();
+                    temp += "\"";
+                    return temp;
+                }
+                else if (Property.class.isInstance(element)) {
+                    Property property = (Property)element;
+                    return "Property: key = \"" + property.getKey() + 
+                            "\", value = \"" + property.getValue() + "\"";
+                }
+
+                return null;
+            }
+
+            @Override
+            public Image getImage(Object arg0) {
+                return Activator.imageDescriptorFromPlugin("org.eclipse.jst.j2ee",
+                        "icons/full/obj16/module_web_obj.gif").createImage();
+            }
+        };
+    }
+}

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

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

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



Mime
View raw message