geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ge...@apache.org
Subject svn commit: r240073 - in /geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui: META-INF/ src/org/apache/geronimo/ui/editors/ src/org/apache/geronimo/ui/internal/ src/org/apache/geronimo/ui/pages/ src/org/apache/geronimo/ui/sections/ src/org/ap...
Date Thu, 25 Aug 2005 13:20:22 GMT
Author: geirm
Date: Thu Aug 25 06:20:16 2005
New Revision: 240073

URL: http://svn.apache.org/viewcvs?rev=240073&view=rev
Log:
GERONIMO-913 : partial patch - failures recorded in JIRA entry


Modified:
    geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/META-INF/MANIFEST.MF
    geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/editors/DPEditor.java
    geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/Messages.java
    geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/Messages.properties
    geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/pages/NamingFormPage.java
    geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/pages/SecurityPage.java
    geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/pages/WebGeneralPage.java
    geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/ServerSecurityEditorSection.java
    geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/wizards/SecurityRoleWizard.java

Modified: geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewcvs/geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/META-INF/MANIFEST.MF?rev=240073&r1=240072&r2=240073&view=diff
==============================================================================
--- geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/META-INF/MANIFEST.MF (original)
+++ geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/META-INF/MANIFEST.MF Thu
Aug 25 06:20:16 2005
@@ -24,5 +24,6 @@
  org.eclipse.ui.editors,
  org.eclipse.ui.workbench,
  org.eclipse.ui.workbench.texteditor,
- org.eclipse.ui.browser
+ org.eclipse.ui.browser,
+ org.eclipse.wst.server.ui
 Eclipse-AutoStart: true

Modified: geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/editors/DPEditor.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/editors/DPEditor.java?rev=240073&r1=240072&r2=240073&view=diff
==============================================================================
--- geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/editors/DPEditor.java
(original)
+++ geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/editors/DPEditor.java
Thu Aug 25 06:20:16 2005
@@ -15,142 +15,32 @@
  */
 package org.apache.geronimo.ui.editors;
 
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Collections;
-
 import org.apache.geronimo.core.internal.GeronimoUtils;
 import org.apache.geronimo.ui.internal.Messages;
-import org.apache.geronimo.ui.internal.Trace;
 import org.apache.geronimo.ui.pages.NamingFormPage;
 import org.apache.geronimo.ui.pages.SecurityPage;
 import org.apache.geronimo.ui.pages.WebGeneralPage;
-import org.apache.geronimo.xml.ns.web.WebAppType;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.emf.ecore.EObject;
 import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.forms.IManagedForm;
-import org.eclipse.ui.forms.editor.FormEditor;
-import org.eclipse.ui.forms.editor.IFormPage;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.ui.forms.widgets.ScrolledForm;
-
-public class DPEditor extends FormEditor {
-
-    protected FormToolkit toolkit;
-
-    protected WebAppType plan;
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.ui.ISaveablePart#doSave(org.eclipse.core.runtime.IProgressMonitor)
-     */
-    public void doSave(IProgressMonitor monitor) {
-
-        InputStream is = null;
-        try {
-            IEditorInput input = getEditorInput();
-            if (input instanceof IFileEditorInput) {
-
-                plan.eResource().save(Collections.EMPTY_MAP);
-                commitFormPages(true);
-                editorDirtyStateChanged();
-
-            }
-        } catch (Exception e) {
-            Trace.trace(Trace.SEVERE, "Error saving", e);
-        } finally {
-            try {
-                if (is != null)
-                    is.close();
-            } catch (Exception e) {
-                // do nothing
-            }
-        }
-
-    }
-
-    private void commitFormPages(boolean onSave) {
-        IFormPage[] pages = getPages();
-        for (int i = 0; i < pages.length; i++) {
-            IFormPage page = pages[i];
-            IManagedForm mform = page.getManagedForm();
-            if (mform != null && mform.isDirty())
-                mform.commit(true);
-        }
-    }
-
-    private IFormPage[] getPages() {
-        ArrayList formPages = new ArrayList();
-        for (int i = 0; i < pages.size(); i++) {
-            Object page = pages.get(i);
-            if (page instanceof IFormPage)
-                formPages.add(page);
-        }
-        return (IFormPage[]) formPages.toArray(new IFormPage[formPages.size()]);
-    }
 
-    public void doSaveAs() {
-        // ignore
-    }
+public class DPEditor extends AbstractGeronimoDeploymentPlanEditor {
 
     /*
      * (non-Javadoc)
      * 
-     * @see org.eclipse.ui.forms.editor.FormEditor#addPages()
+     * @see org.apache.geronimo.ui.editors.AbstractGeronimoDeploymentPlanEditor#doAddPages()
      */
-    protected void addPages() {
-        try {
-            addPage(new WebGeneralPage(this, "generalpage",
-                    Messages.editorTabGeneral));
-            addPage(new NamingFormPage(this, "namingpage",
-                    Messages.editorTabNaming));
-            addPage(new SecurityPage(this, "securitypage",
-                    Messages.editorTabSecurity));
-            createPageDependencies();
-        } catch (PartInitException e) {
-            e.printStackTrace();
-        }
-
+    public void doAddPages() throws PartInitException {
+        addPage(new WebGeneralPage(this, "generalpage",
+                Messages.editorTabGeneral));
+        addPage(new NamingFormPage(this, "namingpage", Messages.editorTabNaming));
+        addPage(new SecurityPage(this, "securitypage",
+                Messages.editorTabSecurity));
     }
 
-    protected void createPageDependencies() {
-
-        ScrolledForm form = getToolkit().createScrolledForm(getContainer());
-
-        form.setText(Messages.editorTitle);
-        form.getBody().setLayout(new GridLayout());
-
-        form.reflow(true);
-
-        int index = addPage(form);
-        setPageText(index, Messages.editorTabDependencies); //$NON-NLS-1$
-
+    public EObject loadDeploymentPlan(IFile file) {
+        return GeronimoUtils.getWebDeploymentPlan(file);
     }
 
-    public void init(IEditorSite site, IEditorInput input)
-            throws PartInitException {
-        super.init(site, input);
-        if (input instanceof IFileEditorInput) {
-            IFileEditorInput fei = (IFileEditorInput) input;
-            plan = GeronimoUtils.getWebDeploymentPlan(fei.getFile());
-        }
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.ui.ISaveablePart#isSaveAsAllowed()
-     */
-    public boolean isSaveAsAllowed() {
-        return false;
-    }
-
-    public WebAppType getPlan() {
-        return plan;
-    }
 }

Modified: geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/Messages.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/Messages.java?rev=240073&r1=240072&r2=240073&view=diff
==============================================================================
--- geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/Messages.java
(original)
+++ geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/Messages.java
Thu Aug 25 06:20:16 2005
@@ -62,6 +62,10 @@
     
     public static String description;
 
+    public static String name;
+
+    public static String description;
+
     //
 
     public static String editorResourceRefDescription;
@@ -157,6 +161,24 @@
     public static String wizardPageTitle_SecurityRole;
 
     public static String wizardPageDescription_SecurityRole;
+
+    //
+
+    public static String wizardNewTitle_SecurityRole;
+
+    public static String wizardEditTitle_SecurityRole;
+
+    public static String wizardPageTitle_SecurityRole;
+
+    public static String wizardPageDescription_SecurityRole;
+
+    public static String editorSectionSecurityTitle;
+
+    public static String editorSectionSecurityDescription;
+
+    public static String username;
+
+    public static String password;
 
     static {
         NLS.initializeMessages(GeronimoUIPlugin.PLUGIN_ID

Modified: geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/Messages.properties
URL: http://svn.apache.org/viewcvs/geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/Messages.properties?rev=240073&r1=240072&r2=240073&view=diff
==============================================================================
--- geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/Messages.properties
(original)
+++ geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/Messages.properties
Thu Aug 25 06:20:16 2005
@@ -7,6 +7,11 @@
 editorSectionSecurityRolesTitle=Security Roles
 editorSectionSecurityRolesDescription=The following security roles are defined:
 
+editorSectionSecurityTitle=Security
+editorSectionSecurityDescription=Specify the security settings.
+username=User ID:
+password=Password:
+
 editorConfigId=Config Id:
 editorParentId=Parent Id:
 editorContextRoot=Context Root:

Modified: geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/pages/NamingFormPage.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/pages/NamingFormPage.java?rev=240073&r1=240072&r2=240073&view=diff
==============================================================================
--- geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/pages/NamingFormPage.java
(original)
+++ geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/pages/NamingFormPage.java
Thu Aug 25 06:20:16 2005
@@ -63,7 +63,7 @@
 
     private void fillBody(IManagedForm managedForm) {
 
-        WebAppType plan = ((DPEditor) getEditor()).getPlan();
+        WebAppType plan = (WebAppType) ((DPEditor) getEditor()).getDeploymentPlan();
 
         Composite body = managedForm.getForm().getBody();
 

Modified: geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/pages/SecurityPage.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/pages/SecurityPage.java?rev=240073&r1=240072&r2=240073&view=diff
==============================================================================
--- geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/pages/SecurityPage.java
(original)
+++ geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/pages/SecurityPage.java
Thu Aug 25 06:20:16 2005
@@ -47,7 +47,7 @@
 
     private void fillBody(IManagedForm managedForm) {
 
-        WebAppType plan = ((DPEditor) getEditor()).getPlan();
+        WebAppType plan = (WebAppType) ((DPEditor) getEditor()).getDeploymentPlan();
 
         Composite body = managedForm.getForm().getBody();
 

Modified: geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/pages/WebGeneralPage.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/pages/WebGeneralPage.java?rev=240073&r1=240072&r2=240073&view=diff
==============================================================================
--- geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/pages/WebGeneralPage.java
(original)
+++ geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/pages/WebGeneralPage.java
Thu Aug 25 06:20:16 2005
@@ -43,7 +43,7 @@
      */
     protected void createFormContent(IManagedForm managedForm) {
 
-        WebAppType plan = ((DPEditor) getEditor()).getPlan();
+        WebAppType plan = (WebAppType) ((DPEditor) getEditor()).getDeploymentPlan();
 
         ScrolledForm form = managedForm.getForm();
         form.setText(getTitle());

Modified: geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/ServerSecurityEditorSection.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/ServerSecurityEditorSection.java?rev=240073&r1=240072&r2=240073&view=diff
==============================================================================
--- geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/ServerSecurityEditorSection.java
(original)
+++ geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/ServerSecurityEditorSection.java
Thu Aug 25 06:20:16 2005
@@ -15,6 +15,115 @@
  */
 package org.apache.geronimo.ui.sections;
 
+import org.apache.geronimo.ui.internal.Messages;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.FormColors;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Section;
+import org.eclipse.wst.server.ui.editor.ServerEditorSection;
+
+/**
+ * 
+ * 
+ */
+public class ServerSecurityEditorSection extends ServerEditorSection {    
+
+    /**
+     * 
+     */
+    public ServerSecurityEditorSection() {
+        super();
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.eclipse.wst.server.ui.editor.ServerEditorSection#createSection(org.eclipse.swt.widgets.Composite)
+     */
+    public void createSection(Composite parent) {
+        super.createSection(parent);
+
+        FormToolkit toolkit = getFormToolkit(parent.getDisplay());
+
+        Section section = toolkit.createSection(parent,
+                ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED
+                        | ExpandableComposite.TITLE_BAR | Section.DESCRIPTION
+                        | ExpandableComposite.FOCUS_TITLE);
+
+        section.setText(Messages.editorSectionSecurityTitle);
+        section.setDescription(Messages.editorSectionSecurityDescription);
+        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);
+
+        // ------- Label and text field for the username -------
+        createLabel(composite, Messages.username, toolkit);
+
+        Text username = toolkit.createText(composite, "system", SWT.BORDER);
+        username.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+        username.addModifyListener(new ModifyListener() {
+            public void modifyText(ModifyEvent e) {
+               
+            }
+        });
+
+        // ------- Label and text field for the password -------
+        createLabel(composite, Messages.password, toolkit);
+
+        Text password = toolkit.createText(composite, "password", SWT.BORDER);
+        password
+                .setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
+        password.addModifyListener(new ModifyListener() {
+            public void modifyText(ModifyEvent e) {
+
+            }
+        });
+
+    }
+
+    protected Label createLabel(Composite parent, String text,
+            FormToolkit toolkit) {
+        Label label = toolkit.createLabel(parent, text);
+        label.setForeground(toolkit.getColors().getColor(FormColors.TITLE));
+        label.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+        return label;
+    }
+
+}
+/**
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ *  Licensed 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.ui.sections;
+
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.ModifyEvent;
 import org.eclipse.swt.events.ModifyListener;

Modified: geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/wizards/SecurityRoleWizard.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/wizards/SecurityRoleWizard.java?rev=240073&r1=240072&r2=240073&view=diff
==============================================================================
--- geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/wizards/SecurityRoleWizard.java
(original)
+++ geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/wizards/SecurityRoleWizard.java
Thu Aug 25 06:20:16 2005
@@ -123,3 +123,128 @@
         return true;
     }
 }
+/**
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ *  Licensed 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.ui.wizards;
+
+import org.apache.geronimo.ui.internal.Messages;
+import org.apache.geronimo.ui.sections.DynamicTableSection;
+import org.apache.geronimo.ui.sections.SecuritySection;
+import org.apache.geronimo.xml.ns.security.DescriptionType;
+import org.apache.geronimo.xml.ns.security.RoleMappingsType;
+import org.apache.geronimo.xml.ns.security.RoleType;
+import org.apache.geronimo.xml.ns.security.SecurityFactory;
+import org.apache.geronimo.xml.ns.security.SecurityPackage;
+import org.apache.geronimo.xml.ns.security.SecurityType;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.TableItem;
+
+public class SecurityRoleWizard extends DynamicAddEditWizard {
+
+    public SecurityRoleWizard(DynamicTableSection section) {
+        super(section);
+    }
+
+    public String getAddWizardWindowTitle() {
+        return Messages.wizardNewTitle_SecurityRole;
+    }
+
+    public String getEditWizardWindowTitle() {
+        return Messages.wizardEditTitle_SecurityRole;
+    }
+
+    public String getWizardFirstPageTitle() {
+        return Messages.wizardPageTitle_SecurityRole;
+    }
+
+    public String getWizardFirstPageDescription() {
+        return Messages.wizardPageDescription_SecurityRole;
+    }
+
+    public boolean performFinish() {
+        DynamicWizardPage page = (DynamicWizardPage) getPages()[0];
+
+        boolean isNew = false;
+
+        if (eObject == null) {
+            eObject = section.getEFactory().create(
+                    section.getTableColumnEAttributes()[0]
+                            .getEContainingClass());
+            EObject plan = section.getPlan();
+
+            SecurityType securityType = (SecurityType) plan
+                    .eGet(SecuritySection.securityERef);
+            if (securityType == null) {
+                securityType = SecurityFactory.eINSTANCE.createSecurityType();
+                plan.eSet(SecuritySection.securityERef, securityType);
+            }
+
+            RoleMappingsType roleMappingsType = securityType.getRoleMappings();
+            if (roleMappingsType == null) {
+                roleMappingsType = SecurityFactory.eINSTANCE
+                        .createRoleMappingsType();
+                securityType.setRoleMappings(roleMappingsType);
+            }
+
+            roleMappingsType.getRole().add(eObject);
+            isNew = true;
+        }
+
+        for (int i = 0; i < section.getTableColumnEAttributes().length; i++) {
+            String value = page.textEntries[i].getText();
+            EAttribute attribute = section.getTableColumnEAttributes()[i];
+            if (attribute.getEContainingClass().equals(eObject.eClass())) {
+                eObject.eSet(attribute, value);
+            } else {
+                if (attribute.getFeatureID() == SecurityPackage.DESCRIPTION_TYPE__LANG) {
+                    DescriptionType type = null;
+                    RoleType roleType = ((RoleType) eObject);
+                    if (roleType.getDescription().isEmpty()) {
+                        type = SecurityFactory.eINSTANCE
+                                .createDescriptionType();
+                        roleType.getDescription().add(type);
+                    } else {
+                        type = (DescriptionType) roleType.getDescription().get(
+                                0);
+                    }
+                    type.setLang(value);
+                }
+            }
+        }
+
+        String[] tableText = section.getTableText(eObject);
+
+        if (isNew) {
+            TableItem item = new TableItem(section.getTableViewer().getTable(),
+                    SWT.NONE);
+            item.setImage(section.getImage());
+            item.setData(eObject);
+            item.setText((String) eObject.eGet(SecurityPackage.eINSTANCE
+                    .getRoleType_RoleName()));
+        } else {
+            int index = section.getTableViewer().getTable().getSelectionIndex();
+            if (index != -1) {
+                TableItem item = section.getTableViewer().getTable().getItem(
+                        index);
+                item.setText(tableText);
+            }
+        }
+
+        return true;
+    }
+}



Mime
View raw message