geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From de...@apache.org
Subject svn commit: r818883 [4/7] - in /geronimo/devtools/eclipse-plugin/trunk/plugins: org.apache.geronimo.runtime.v11/ org.apache.geronimo.st.v11.core/ org.apache.geronimo.st.v11.core/src/main/ org.apache.geronimo.st.v11.core/src/main/java/ org.apache.geroni...
Date Fri, 25 Sep 2009 15:26:17 GMT
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/ExtModuleSection.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/ExtModuleSection.java?rev=818883&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/ExtModuleSection.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/ExtModuleSection.java Fri Sep 25 15:26:14 2009
@@ -0,0 +1,135 @@
+/*
+ * 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.v11.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.v11.ui.wizards.ExtModuleWizard;
+import org.apache.geronimo.xml.ns.j2ee.application_1.ExtModuleType;
+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: 690385 $ $Date: 2008-08-30 04:43:47 +0800 (Sat, 30 Aug 2008) $
+ */
+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 ExtModuleType.class;
+    }
+
+    @Override
+    public ITableLabelProvider getLabelProvider() {
+        return new LabelProvider() {
+            @Override
+            public String getColumnText(Object element, int columnIndex) {
+                if (ExtModuleType.class.isInstance(element)) {
+                	ExtModuleType extModule = (ExtModuleType) 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) {
+                        	String externalPath = extModule.getExternalPath();
+                        	//suppose external path is in format of "groupId/artifactId/version/type"
+                        	String[] segments = externalPath.split("/");
+                            return segments[0];
+                        }
+                        return "";
+                    case 4:
+                        if (extModule.getExternalPath() != null) {
+                        	String externalPath = extModule.getExternalPath();
+                        	//suppose external path is in format of "groupId/artifactId/version/type"
+                        	String[] segments = externalPath.split("/");
+                            return segments[1];
+                        }
+                        return "";
+                    case 5:
+                        if (extModule.getExternalPath() != null) {
+                        	String externalPath = extModule.getExternalPath();
+                        	//suppose external path is in format of "groupId/artifactId/version/type"
+                        	String[] segments = externalPath.split("/");
+                            return segments[2];
+                        }
+                        return "";
+                    case 6:
+                        if (extModule.getExternalPath() != null) {
+                        	String externalPath = extModule.getExternalPath();
+                        	//suppose external path is in format of "groupId/artifactId/version/type"
+                        	String[] segments = externalPath.split("/");
+                            return segments[3];
+                        }
+                        return "";
+                    }
+                }
+                return null;
+            }
+        };
+    }
+}

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/GBeanRefSection.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/GBeanRefSection.java?rev=818883&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/GBeanRefSection.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/GBeanRefSection.java Fri Sep 25 15:26:14 2009
@@ -0,0 +1,204 @@
+/*
+ * 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.v11.ui.sections;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.JAXBElement;
+
+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.v11.ui.Activator;
+import org.apache.geronimo.st.v11.ui.wizards.GBeanRefWizard;
+import org.apache.geronimo.xml.ns.deployment_1.PatternType;
+import org.apache.geronimo.xml.ns.naming_1.GbeanRefType;
+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 (GbeanRefType.class.isInstance(gbeanRef.get(i))) {
+	                this.objectContainer.add(gbeanRef.get(i));
+	            }
+	            else if (GbeanRefType.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 GbeanRefType.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 GbeanRefType 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 (GbeanRefType.class.isInstance(object)) {
+            return (GbeanRefType)object;
+        }
+        else {
+            return (GbeanRefType)((JAXBElement)object).getValue();
+        }
+    }
+    
+    @Override
+    public void removeItem(Object anItem) {
+        if (GbeanRefType.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 (GbeanRefType.class.isInstance(object)) {
+                ((GbeanRefType)object).getRefType().remove(anItem);
+            }
+            else {
+                ((GbeanRefType)((JAXBElement)object).getValue()).getRefType().remove(anItem);
+            }
+        }
+        else if (PatternType.class.isInstance(anItem)) {
+            Object object = tree.getSelection()[0].getParentItem().getData();
+            if (GbeanRefType.class.isInstance(object)) {
+                ((GbeanRefType)object).getPattern().remove(anItem);
+            }
+            else {
+                ((GbeanRefType)((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 (GbeanRefType.class.isInstance(parentElement)) {
+                	GbeanRefType gbeanRef = (GbeanRefType)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 (GbeanRefType.class.isInstance(element)) {
+                	GbeanRefType gbeanRef = (GbeanRefType)element;
+                    return "Gbean Ref: name = \"" + gbeanRef.getRefName() + "\"";
+                }
+                else if (String.class.isInstance(element)) {
+                    return "Gbean type: name = \"" + (String)element + "\"";
+                }
+                else if (PatternType.class.isInstance(element)) {
+                	PatternType pattern = (PatternType)element;
+                    return "Pattern: name = \"" + pattern.getCustomFoo() + 
+                            "\", 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();
+            }
+        };
+    }
+}

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/GBeanSection.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/GBeanSection.java?rev=818883&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/GBeanSection.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/GBeanSection.java Fri Sep 25 15:26:14 2009
@@ -0,0 +1,180 @@
+/*
+ * 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.v11.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.AbstractTreeSection;
+import org.apache.geronimo.st.v11.ui.Activator;
+import org.apache.geronimo.st.v11.ui.wizards.GBeanWizard;
+import org.apache.geronimo.xml.ns.deployment_1.AttributeType;
+import org.apache.geronimo.xml.ns.deployment_1.GbeanType;
+import org.apache.geronimo.xml.ns.deployment_1.PatternType;
+import org.apache.geronimo.xml.ns.deployment_1.ReferenceType;
+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: 688452 $ $Date: 2008-08-24 01:56:20 -0400 (Sun, 24 Aug 2008) $
+ */
+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 GbeanType.class;
+    }
+
+    @Override
+    protected void activateAddButton() {
+        if (tree.getSelectionCount() == 0 || tree.getSelection()[0].getParentItem() == null) {
+            addButton.setEnabled(true);
+        } else {
+            addButton.setEnabled(false);
+        }
+    }
+
+    public GbeanType getSelectedObject () {
+        if (tree.getSelection().length == 0) {
+            return null;
+        }
+        return (GbeanType)((JAXBElement)tree.getSelection()[0].getData()).getValue();
+    }
+    
+    @Override
+    public void removeItem(Object anItem) {
+        JAXBElement element =(JAXBElement)tree.getSelection()[0].getData(); 
+        Object object = element.getValue();
+        if (GbeanType.class.isInstance(object)) {
+            objectContainer.remove(anItem);
+        }
+        else {
+        	GbeanType gbean = (GbeanType)((JAXBElement)tree.getSelection()[0].getParentItem().getData()).getValue();
+            gbean.getAttributeOrXmlAttributeOrReference().remove(element);
+        }
+    }
+    
+    @Override
+    public Object getInput() {
+        if (objectContainer != null) {
+            return objectContainer;
+        }
+        return super.getInput();
+    }
+
+    @Override
+    public ITreeContentProvider getContentProvider() {
+        return new ContentProvider() {
+            @Override
+            public Object[] getElements(Object inputElement) {
+                return getChildren(inputElement);
+            }
+
+            @Override
+            public Object[] getChildren(Object parentElement) {
+                if (List.class.isInstance(parentElement)) {
+                    return ((List)parentElement).toArray();
+                }
+                if (JAXBElement.class.isInstance(parentElement)) {
+                    Object object = ((JAXBElement)parentElement).getValue();
+                    if (GbeanType.class.isInstance(object)) {
+                    	GbeanType gbean = (GbeanType)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 (GbeanType.class.isInstance(object)) {
+                    	GbeanType gbean = (GbeanType)object;
+                        return "GBean: name = \"" + gbean.getName() +
+                                "\", class = \"" + gbean.getClazz() + "\"";
+                    }
+                    else if (AttributeType.class.isInstance(object)) {
+                    	AttributeType attribute = (AttributeType)object;
+                        return "Attribute: name = \"" + attribute.getName() + 
+                                "\", type = \"" + attribute.getType() + 
+                                "\", value = \"" + attribute.getValue() + "\"";
+                    }
+                    else if (PatternType.class.isInstance(object)) {
+                    	PatternType dependency = (PatternType)object;
+                        return "Dependency: group = \"" + dependency.getGroupId() +
+                                "\", artifact = \"" + dependency.getArtifactId() +
+                                "\", version = \"" + dependency.getVersion() +
+                                "\", module = \"" + dependency.getModule() +
+                                "\", type = \"" + dependency.getType() +
+                                "\", custom name = \"" + dependency.getCustomFoo() + "\"";
+                    }
+                    else if (ReferenceType.class.isInstance(object)) {
+                    	ReferenceType reference = (ReferenceType)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();
+            }
+        };
+    }
+}

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/MessageDestSection.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/MessageDestSection.java?rev=818883&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/MessageDestSection.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/MessageDestSection.java Fri Sep 25 15:26:14 2009
@@ -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.v11.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.v11.ui.wizards.MessageDestWizard;
+import org.apache.geronimo.xml.ns.naming_1.MessageDestinationType;
+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: 688452 $ $Date: 2008-08-24 13:56:20 +0800 (Sun, 24 Aug 2008) $
+ */
+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 MessageDestinationType.class;
+    }
+
+    @Override
+    public ITableLabelProvider getLabelProvider() {
+        return new LabelProvider() {
+            @Override
+            public String getColumnText(Object element, int columnIndex) {
+                if (MessageDestinationType.class.isInstance(element)) {
+                	MessageDestinationType msgDest = (MessageDestinationType) 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;
+            }
+        };
+    }
+}

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/ModuleSection.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/ModuleSection.java?rev=818883&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/ModuleSection.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/ModuleSection.java Fri Sep 25 15:26:14 2009
@@ -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.v11.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.v11.ui.wizards.ModuleWizard;
+import org.apache.geronimo.xml.ns.j2ee.application_1.ModuleType;
+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: 688452 $ $Date: 2008-08-24 13:56:20 +0800 (Sun, 24 Aug 2008) $
+ */
+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 ModuleType.class;
+    }
+
+    @Override
+    public ITableLabelProvider getLabelProvider() {
+        return new LabelProvider() {
+            @Override
+            public String getColumnText(Object element, int columnIndex) {
+                if (ModuleType.class.isInstance(element)) {
+                	ModuleType module = (ModuleType) 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;
+            }
+        };
+    }
+}

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/OpenEjbJarCMPSection.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/OpenEjbJarCMPSection.java?rev=818883&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/OpenEjbJarCMPSection.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/OpenEjbJarCMPSection.java Fri Sep 25 15:26:14 2009
@@ -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.v11.ui.sections;
+
+import javax.xml.bind.JAXBElement;
+
+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.apache.geronimo.xml.ns.naming_1.ObjectFactory;
+import org.apache.geronimo.xml.ns.naming_1.PatternType;
+import org.apache.geronimo.xml.ns.naming_1.ResourceLocatorType;
+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;
+import org.openejb.xml.ns.openejb_jar_2.OpenejbJarType;
+
+/**
+ * @version $Rev: 700249 $ $Date: 2008-09-30 04:50:12 +0800 (Tue, 30 Sep 2008) $
+ */
+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;
+
+    OpenejbJarType 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 = (OpenejbJarType) 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);
+
+        ResourceLocatorType 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 ResourceLocatorType getResourceLocator() {
+    	ResourceLocatorType locator = plan.getCmpConnectionFactory();
+        if (locator == null) {
+            locator = namingFactory.createResourceLocatorType();
+            plan.setCmpConnectionFactory(locator);
+        }
+        return locator;
+    }
+
+    /**
+     * @return
+     */
+    private PatternType getPattern() {
+        ResourceLocatorType locator = getResourceLocator();
+        PatternType pattern = locator.getPattern();
+        if (pattern == null) {
+            pattern = namingFactory.createPatternType();
+            locator.setPattern(pattern);
+        }
+        return pattern;
+    }
+}

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/OpenEjbJarGeneralSection.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/OpenEjbJarGeneralSection.java?rev=818883&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/OpenEjbJarGeneralSection.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/OpenEjbJarGeneralSection.java Fri Sep 25 15:26:14 2009
@@ -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.v11.ui.sections;
+
+import javax.xml.bind.JAXBElement;
+
+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;
+import org.openejb.xml.ns.openejb_jar_2.ObjectFactory;
+import org.openejb.xml.ns.openejb_jar_2.OpenejbJarType;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class OpenEjbJarGeneralSection extends CommonGeneralSection {
+
+    protected Text ejbqlCompilerFactory;
+
+    protected Text dbSyntaxFactory;
+
+    protected Button enforceForeignKeyConstraints;
+    
+    OpenejbJarType plan;
+
+    public OpenEjbJarGeneralSection(Composite parent, FormToolkit toolkit, int style, JAXBElement plan) {
+        super(parent, toolkit, style, plan);
+        this.plan = (OpenejbJarType) 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.createEmptyType());
+            	}
+            	else {
+            		plan.setEnforceForeignKeyConstraints(null);
+            	}
+                markDirty();
+            }
+        });
+    }
+}

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/ResourceEnvRefSection.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/ResourceEnvRefSection.java?rev=818883&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/ResourceEnvRefSection.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/ResourceEnvRefSection.java Fri Sep 25 15:26:14 2009
@@ -0,0 +1,86 @@
+/*
+ * 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.v11.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.v11.ui.Activator;
+import org.apache.geronimo.st.v11.ui.wizards.ResourceEnvRefWizard;
+import org.apache.geronimo.xml.ns.naming_1.ResourceEnvRefType;
+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 ResourceEnvRefSection extends AbstractTableSection {
+
+
+    public ResourceEnvRefSection(JAXBElement plan, Composite parent, FormToolkit toolkit, int style, List resourceEnvRefs) {
+        super(plan, parent, toolkit, style);
+        this.objectContainer = resourceEnvRefs;
+        COLUMN_NAMES = new String[] {
+                CommonMessages.editorResEnvRefNameTitle, CommonMessages.editorResEnvRefMsgDestTitle };
+        createClient();
+    }
+
+    public String getTitle() {
+        return CommonMessages.editorResourceEnvRefTitle;
+    }
+
+    public String getDescription() {
+        return CommonMessages.editorResourceEnvRefDescription;
+    }
+
+    public Wizard getWizard() {
+        return new ResourceEnvRefWizard(this);
+    }
+
+    public ImageDescriptor getImageDescriptor() {
+        return Activator.imageDescriptorFromPlugin("org.eclipse.jst.j2ee", "icons/full/obj16/res_env_ref_obj.gif");
+    }
+
+    public Class getTableEntryObjectType() {
+        return ResourceEnvRefType.class;
+    }
+
+    @Override
+    public ITableLabelProvider getLabelProvider() {
+        return new LabelProvider() {
+            @Override
+            public String getColumnText(Object element, int columnIndex) {
+                if (ResourceEnvRefType.class.isInstance(element)) {
+                	ResourceEnvRefType resourceEnvRef = (ResourceEnvRefType) element;
+                    switch (columnIndex) {
+                    case 0:
+                        return resourceEnvRef.getRefName();
+                    case 1:
+                        return resourceEnvRef.getMessageDestinationLink();
+                    }
+                }
+                return null;
+            }
+        };
+    }
+}

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/ResourceRefSection.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/ResourceRefSection.java?rev=818883&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/ResourceRefSection.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/ResourceRefSection.java Fri Sep 25 15:26:14 2009
@@ -0,0 +1,86 @@
+/*
+ * 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.v11.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.v11.ui.Activator;
+import org.apache.geronimo.st.v11.ui.wizards.ResourceRefWizard;
+import org.apache.geronimo.xml.ns.naming_1.ResourceRefType;
+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 ResourceRefSection extends AbstractTableSection {
+
+    public ResourceRefSection(JAXBElement plan, Composite parent, FormToolkit toolkit, int style, List resourceRefs) {
+        super(plan, parent, toolkit, style);
+        this.objectContainer = resourceRefs;
+        COLUMN_NAMES = new String[] {
+                CommonMessages.editorResRefNameTitle, CommonMessages.editorResRefLinkTitle};
+        createClient();
+        getSection().setExpanded(false);
+    }
+
+    public String getTitle() {
+        return CommonMessages.editorResourceRefTitle;
+    }
+
+    public String getDescription() {
+        return CommonMessages.editorResourceRefDescription;
+    }
+
+    public Wizard getWizard() {
+        return new ResourceRefWizard(this);
+    }
+
+    public ImageDescriptor getImageDescriptor() {
+        return Activator.imageDescriptorFromPlugin("org.eclipse.jst.j2ee", "icons/full/obj16/resourceRef_obj.gif");
+    }
+
+    public Class getTableEntryObjectType() {
+        return ResourceRefType.class;
+    }
+
+    @Override
+    public ITableLabelProvider getLabelProvider() {
+        return new LabelProvider() {
+            @Override
+            public String getColumnText(Object element, int columnIndex) {
+                if (ResourceRefType.class.isInstance(element)) {
+                	ResourceRefType resourceRef = (ResourceRefType) element;
+                    switch (columnIndex) {
+                    case 0:
+                        return resourceRef.getRefName();
+                    case 1:
+                        return resourceRef.getResourceLink();
+                    }
+                }
+                return null;
+            }
+        };
+    }
+}

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/SecurityAdvancedSection.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/SecurityAdvancedSection.java?rev=818883&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/SecurityAdvancedSection.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/SecurityAdvancedSection.java Fri Sep 25 15:26:14 2009
@@ -0,0 +1,460 @@
+///*
+// * 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.v11.ui.sections;
+//
+//import java.util.ArrayList;
+//import java.util.Hashtable;
+//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.core.jaxb.JAXBModelUtils;
+//import org.apache.geronimo.st.v11.ui.wizards.SecurityRunAsSubjectWizard;
+//import org.apache.geronimo.xml.ns.deployment_1.PatternType;
+//import org.apache.geronimo.xml.ns.security_1.RoleMappingsType;
+//import org.apache.geronimo.xml.ns.security_1.RoleType;
+//import org.apache.geronimo.xml.ns.security_1.SecurityType;
+//import org.eclipse.jface.dialogs.Dialog;
+//import org.eclipse.jface.viewers.IBaseLabelProvider;
+//import org.eclipse.jface.viewers.IContentProvider;
+//import org.eclipse.jface.viewers.Viewer;
+//import org.eclipse.jface.wizard.Wizard;
+//import org.eclipse.jface.wizard.WizardDialog;
+//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.Combo;
+//import org.eclipse.swt.widgets.Composite;
+//import org.eclipse.swt.widgets.Display;
+//import org.eclipse.swt.widgets.Text;
+//import org.eclipse.ui.forms.widgets.FormToolkit;
+//import org.eclipse.ui.forms.widgets.Section;
+//
+///**
+// * @version $Rev: 723874 $ $Date: 2008-12-06 05:30:03 +0800 (Sat, 06 Dec 2008) $
+// */
+//public class SecurityAdvancedSection extends AbstractTableSection {
+//
+//    private static final String SPECIFY_CREDENTIAL_STORE_MANUALLY = "<specify manually>";
+//
+//    protected Text credentialStoreRef;
+//    protected Button specifyCredentialStoreRefButton;
+//    protected Button deleteCredentialStoreRefButton;
+//
+//    private Hashtable<String, Pattern> credentialStoreList = new Hashtable<String, Pattern>();
+//
+//    protected Combo defaultSubjectRealmName;
+//
+//    protected Combo defaultSubjectId;
+//
+//    protected Button doAsCurrentCaller;
+//
+//    protected Button useContextHandler;
+//
+//    public SecurityAdvancedSection(JAXBElement plan, Composite parent, FormToolkit toolkit, int style) {
+//        super(plan, parent, toolkit, style);
+//        createClient();
+//    }
+//
+//    public void createClient() {
+//        Section section = getSection();
+//        section.setText(getTitle());
+//        section.setDescription(getDescription());
+//        section.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
+//        Composite clientComposite = createComposite(getSection(), 3);
+//        section.setClient(clientComposite);
+//
+//        Composite composite1 = createComposite(clientComposite, 2);
+//        composite1.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 3, 1));
+//
+//        doAsCurrentCaller = toolkit.createButton(composite1, CommonMessages.securityDoasCurrentCaller,
+//                SWT.CHECK);
+//        doAsCurrentCaller.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
+//        doAsCurrentCaller.addSelectionListener(new SelectionAdapter() {
+//            public void widgetSelected(SelectionEvent e) {
+//                setDoAsCurrentCaller();
+//                markDirty();
+//            }
+//        });
+//        doAsCurrentCaller.setSelection(isDoasCurrentCaller());
+//
+//        useContextHandler = toolkit.createButton(composite1, CommonMessages.securityUseContextHandler,
+//                SWT.CHECK);
+//        useContextHandler.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
+//        useContextHandler.addSelectionListener(new SelectionAdapter() {
+//            public void widgetSelected(SelectionEvent e) {
+//                setUseContextHandler();
+//                markDirty();
+//            }
+//        });
+//        useContextHandler.setSelection(isUseContextHandler());
+//
+//        createLabel(clientComposite, CommonMessages.securityCredentialStore);
+//        credentialStoreRef = new Text(clientComposite, SWT.READ_ONLY| SWT.BORDER);
+//        credentialStoreRef.setText("<credential store ref name will go here>");
+//        GridData gridData = new GridData(SWT.FILL, SWT.CENTER, false, false);
+//        gridData.widthHint = 300;
+//        credentialStoreRef.setLayoutData(gridData);
+//
+//        Composite composite2 = toolkit.createComposite(clientComposite);
+//        GridLayout layout = new GridLayout();
+//        layout.numColumns = 2;
+//        layout.marginHeight = 5;
+//        layout.marginWidth = 0;
+//        layout.verticalSpacing = 5;
+//        layout.horizontalSpacing = 5;
+//        composite2.setLayout(layout);
+//        composite2.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+//        specifyCredentialStoreRefButton = toolkit.createButton(composite2, CommonMessages.edit, SWT.NONE);
+//        specifyCredentialStoreRefButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
+//        specifyCredentialStoreRefButton.addSelectionListener(new SelectionAdapter() {
+//            @Override
+//            public void widgetSelected(SelectionEvent e) {
+//                Wizard wizard = getCredentialStoreRefWizard();
+//                WizardDialog dialog = new WizardDialog(Display.getCurrent().getActiveShell(), wizard);
+//                dialog.open();
+//                if (dialog.getReturnCode() == Dialog.OK) {
+//                    setCredentialStoreRef();
+//                    toggleAdvancedSettings();
+//                    markDirty();
+//                }
+//            }
+//        });
+//        deleteCredentialStoreRefButton = toolkit.createButton(composite2, CommonMessages.remove, SWT.NONE);
+//        deleteCredentialStoreRefButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
+//        deleteCredentialStoreRefButton.addSelectionListener(new SelectionAdapter(){
+//            @Override
+//            public void widgetSelected(SelectionEvent e) {
+//            }
+//        });
+//
+//        createLabel(clientComposite, CommonMessages.securityDefaultSubject);
+//        createLabel(clientComposite, "");
+//        createLabel(clientComposite, "");
+//        //group = createGroup(clientComposite, CommonMessages.securityDefaultSubject);
+//
+//        //createLabel(clientComposite, "");
+//        //Composite composite3 = createComposite(clientComposite, 2);
+//        //composite3.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1));
+//        createLabel(clientComposite, CommonMessages.securityDefaultSubjectRealmName).setLayoutData(
+//                new GridData(SWT.RIGHT, SWT.CENTER, false, false));
+//        defaultSubjectRealmName = new Combo(clientComposite, SWT.SINGLE | SWT.DROP_DOWN);
+//        defaultSubjectRealmName.add(getDefaultSubjectRealmName());
+//        defaultSubjectRealmName.select(0);
+//        gridData = new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1);
+//        gridData.widthHint = 100;
+//        defaultSubjectRealmName.setLayoutData(gridData);
+//        defaultSubjectRealmName.addModifyListener(new ModifyListener() {
+//            public void modifyText(ModifyEvent e) {
+//                setDefaultSubject();
+//                markDirty();
+//            }
+//        });
+//        defaultSubjectRealmName.pack();
+//
+//        //createLabel(clientComposite, "");
+//        //Composite composite4 = createComposite(clientComposite, 2);
+//        //composite4.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1));
+//        createLabel(clientComposite, CommonMessages.securityDefaultSubjectId).setLayoutData(
+//                new GridData(SWT.RIGHT, SWT.CENTER, false, false));
+//        defaultSubjectId = new Combo(clientComposite, SWT.SINGLE | SWT.DROP_DOWN);
+//        defaultSubjectId.add(getDefaultSubjectId());
+//        defaultSubjectId.select(0);
+//        gridData = new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1);
+//        gridData.widthHint = 100;
+//        defaultSubjectId.setLayoutData(gridData);
+//        defaultSubjectId.addModifyListener(new ModifyListener() {
+//            public void modifyText(ModifyEvent e) {
+//                setDefaultSubject();
+//                markDirty();
+//            }
+//        });
+//        defaultSubjectId.pack();
+//
+//        //group = createGroup(clientComposite, CommonMessages.securityRunAsSubjects);
+//        createLabel(clientComposite, "").setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1));
+//        createLabel(clientComposite, CommonMessages.securityRunAsSubjects).setLayoutData(
+//                new GridData(SWT.LEFT, SWT.TOP, false, false));
+//        createViewer(clientComposite);
+//        viewer.setContentProvider(getContentProvider());
+//        viewer.setLabelProvider(getLabelProvider());
+//        viewer.setInput(getInput());
+//
+//        Composite buttonComposite = createButtonComposite(clientComposite);
+//        createAddButton(buttonComposite);
+//        createRemoveButton(buttonComposite);
+//        createEditButton(buttonComposite);
+//        activateButtons();
+//
+//        section.setExpanded(false);
+//        toggleAdvancedSettings();
+//    }
+//
+//    private Wizard getCredentialStoreRefWizard() {
+//        return null;
+//    }
+//
+//    private void toggleAdvancedSettings() {
+//        boolean enable = false;
+//        if (getSecurity() != null && getSecurity().getCredentialStoreRef() != null) {
+//            enable = true;
+//        }
+//        defaultSubjectRealmName.setEnabled(enable);
+//        defaultSubjectId.setEnabled(enable);
+//        table.setEnabled(enable);
+//        activateAddButton();
+//    }
+//
+//    @Override
+//    public Object getInput() {
+//        return SecurityRoleMappingSection.getRoleMappings(getPlan(), false);
+//    }
+//
+//    @Override
+//    public IContentProvider getContentProvider() {
+//        return new ContentProvider() {
+//            @Override
+//            public Object[] getElements(Object inputElement) {
+//                if (inputElement instanceof RoleMappingsType) {
+//                    return ((RoleMappingsType) inputElement).getRole().toArray();
+//                }
+//                return super.getElements(inputElement);
+//            }
+//        };
+//    }
+//
+//    @Override
+//    protected boolean filter(Viewer viewer, Object parentElement, Object element) {
+//        if (element instanceof RoleType) {
+//            return ((RoleType) element).getRunAsSubject() != null;
+//        }
+//        return false;
+//    }
+//
+//    @Override
+//    public IBaseLabelProvider getLabelProvider() {
+//        return new LabelProvider() {
+//            @Override
+//            public String getColumnText(Object element, int columnIndex) {
+//                if (element instanceof RoleType) {
+//                	RoleType role = (RoleType) element;
+//                    switch (columnIndex) {
+//                    case 0:
+//                        return role.getRoleName();
+//                    case 1:
+//                        return role.getRunAsSubject().getRealm();
+//                    case 2:
+//                        return role.getRunAsSubject().getId();
+//                    }
+//                }
+//                return "";
+//            }
+//        };
+//    }
+//
+//    @Override
+//    protected void removeItem(Object selectedItem) {
+//        if (selectedItem instanceof RoleType) {
+//            ((RoleType) selectedItem).setRunAsSubject(null);
+//            return;
+//        }
+//        super.removeItem(selectedItem);
+//    }
+//
+//    @Override
+//    protected Wizard getWizard() {
+//        return new SecurityRunAsSubjectWizard(this);
+//    }
+//
+//    @Override
+//    public void activateAddButton() {
+//        if (getSecurity() != null && getSecurity().getCredentialStoreRef() != null
+//                && getRolesWithoutRunAsSubject().length > 0) {
+//            addButton.setEnabled(true);
+//        } else {
+//            addButton.setEnabled(false);
+//        }
+//    }
+//
+//    public RoleType getRole(String roleName) {
+//        List<RoleType> roles = SecurityRoleMappingSection.getRoles(getPlan(), false);
+//        for (int i = 0; i < roles.size(); i++) {
+//        	RoleType role = roles.get(i);
+//            if (role.getRoleName().equals(roleName)) {
+//                return role;
+//            }
+//        }
+//        return null;
+//    }
+//
+//    public String[] getRolesWithoutRunAsSubject() {
+//        List<RoleType> roles = SecurityRoleMappingSection.getRoles(getPlan(), false);
+//        List<RoleType> rolesWithoutRunAsSubject = new ArrayList<RoleType>();
+//        for (int i = 0; i < roles.size(); i++) {
+//        	RoleType role = roles.get(i);
+//            if(role.getRunAsSubject() == null) {
+//                rolesWithoutRunAsSubject.add(role);
+//            }
+//        }
+//        String[] roleNames = new String[rolesWithoutRunAsSubject.size()];
+//        for (int i = 0; i < rolesWithoutRunAsSubject.size(); i++) {
+//            roleNames[i] = rolesWithoutRunAsSubject.get(i).getRoleName();
+//        }
+//        return roleNames;
+//    }
+//
+//    /*private void populateCredentialStores() {
+//        String credentialStoreRefName = getCredentialStoreRefName();
+//        if (credentialStoreRefName.length() > 0) {
+//            credentialStoreRef.add(""); //users will select this empty string to unset credentialStoreRef
+//        }
+//        credentialStoreRef.add(credentialStoreRefName);
+//        List<Pattern> deployedCredentialStores = GeronimoServerInfo.getInstance().getDeployedCredentialStores();
+//        Pattern pattern = new Pattern();
+//        pattern.setCustomFoo(credentialStoreRefName);
+//        if (deployedCredentialStores.contains(pattern)) {
+//            deployedCredentialStores.remove(pattern);
+//        }
+//        for (int i = 0; i < deployedCredentialStores.size(); i++) {
+//            credentialStoreRef.add(deployedCredentialStores.get(i).toString());
+//        }
+//        credentialStoreRef.add(SPECIFY_CREDENTIAL_STORE_MANUALLY);
+//    }*/
+//
+//    @Override
+//    public List getObjectContainer() {
+//        return getSecurity().getRoleMappings().getRole();
+//    }
+//
+//    @Override
+//    public Class getTableEntryObjectType() {
+//        return Role.class;
+//    }
+//
+//    @Override
+//    public String[] getTableColumnNames() {
+//        return new String[] { CommonMessages.securityRunAsSubjectRole, CommonMessages.securityRunAsSubjectRealm,
+//                CommonMessages.securityRunAsSubjectId };
+//    }
+//
+//    @Override
+//    public String getTitle() {
+//        return CommonMessages.editorSectionSecurityAdvancedTitle;
+//    }
+//
+//    @Override
+//    public String getDescription() {
+//        return CommonMessages.editorSectionSecurityAdvancedDescription;
+//    }
+//
+//    private SecurityType getSecurity() {
+//        return JAXBModelUtils.getSecurity(getPlan());
+//    }
+//
+//    private String getCredentialStoreRefName() {
+//        if (getSecurity() != null) {
+//            PatternType credentialStoreRef = getSecurity().getCredentialStoreRef();
+//            if (credentialStoreRef != null) {
+//                return credentialStoreRef.getCustomFoo();
+//            }
+//        }
+//        return "";
+//    }
+//
+//    private String getDefaultSubjectRealmName() {
+//        if (getSecurity() != null) {
+//            SubjectInfo subjectInfo = getSecurity().getDefaultSubject();
+//            if (subjectInfo != null) {
+//                return subjectInfo.getRealm();
+//            }
+//        }
+//        return "";
+//    }
+//
+//    private String getDefaultSubjectId() {
+//        if (getSecurity() != null) {
+//            SubjectInfo subjectInfo = getSecurity().getDefaultSubject();
+//            if (subjectInfo != null) {
+//                return subjectInfo.getId();
+//            }
+//        }
+//        return "";
+//    }
+//
+//    private boolean isDoasCurrentCaller() {
+//        if (getSecurity() != null) {
+//            return getSecurity().isDoasCurrentCaller();
+//        }
+//        return false;
+//    }
+//
+//    private boolean isUseContextHandler() {
+//        if (getSecurity() != null) {
+//            return getSecurity().isUseContextHandler();
+//        }
+//        return false;
+//    }
+//
+//    private void setCredentialStoreRef() {
+//        if (getSecurity() != null) {
+//            String credentialStoreRefName = credentialStoreRef.getText();
+//            if (credentialStoreRefName.trim().length() > 0) {
+//            	PatternType credentialStoreRef = new PatternType();
+//                // credentialStoreRef.setGroupId("org.apache.geronimo.framework");
+//                // credentialStoreRef.setArtifactId("server-security-config");
+//                //credentialStoreRef.setCustomFoo(credentialStoreRef.getText());
+//                getSecurity().setCredentialStoreRef(credentialStoreRef);
+//            } else {
+//                getSecurity().setCredentialStoreRef(null);
+//            }
+//        }
+//    }
+//
+//    private void setDefaultSubject() {
+//        if (getSecurity() != null) {
+//            String realmName = defaultSubjectRealmName.getText();
+//            String realmId = defaultSubjectId.getText();
+//            if (realmName.trim().length() > 0 && realmId.trim().length() > 0) {
+//                SubjectInfo defaultSubject = new SubjectInfo();
+//                defaultSubject.setRealm(realmName);
+//                defaultSubject.setId(realmId);
+//                getSecurity().setDefaultSubject(defaultSubject);
+//            } else {
+//                getSecurity().setDefaultSubject(null);
+//            }
+//        }
+//    }
+//
+//    private void setDoAsCurrentCaller() {
+//        if (getSecurity() != null) {
+//            getSecurity().setDoasCurrentCaller(doAsCurrentCaller.getSelection());
+//        }
+//    }
+//
+//    private void setUseContextHandler() {
+//        if (getSecurity() != null) {
+//            getSecurity().setUseContextHandler(useContextHandler.getSelection());
+//        }
+//    }
+//}



Mime
View raw message