You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by ga...@apache.org on 2011/11/17 03:19:27 UTC
svn commit: r1203020 [15/29] - in
/geronimo/devtools/eclipse-plugin/branches/3.0-beta-1: eclipse/
plugins/org.apache.geronimo.j2ee.v11.jaxbmodel/
plugins/org.apache.geronimo.j2ee.v11.jaxbmodel/src/test/resources/application/
plugins/org.apache.geronimo...
Modified: geronimo/devtools/eclipse-plugin/branches/3.0-beta-1/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/branches/3.0-beta-1/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/OpenEjbJarCMPSection.java?rev=1203020&r1=1203019&r2=1203020&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/branches/3.0-beta-1/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/OpenEjbJarCMPSection.java (original)
+++ geronimo/devtools/eclipse-plugin/branches/3.0-beta-1/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/OpenEjbJarCMPSection.java Thu Nov 17 02:19:12 2011
@@ -1,300 +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.j2ee.naming.ObjectFactory;
-import org.apache.geronimo.j2ee.naming.PatternType;
-import org.apache.geronimo.j2ee.naming.ResourceLocatorType;
-import org.apache.geronimo.j2ee.openejb_jar.OpenejbJarType;
-import org.apache.geronimo.st.ui.CommonMessages;
-import org.apache.geronimo.st.ui.internal.Messages;
-import org.apache.geronimo.st.ui.sections.AbstractSectionPart;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.ui.forms.widgets.Section;
-
-/**
- * @version $Rev: 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;
- }
-}
+/*
+ * 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.j2ee.naming.ObjectFactory;
+import org.apache.geronimo.j2ee.naming.PatternType;
+import org.apache.geronimo.j2ee.naming.ResourceLocatorType;
+import org.apache.geronimo.j2ee.openejb_jar.OpenejbJarType;
+import org.apache.geronimo.st.ui.CommonMessages;
+import org.apache.geronimo.st.ui.internal.Messages;
+import org.apache.geronimo.st.ui.sections.AbstractSectionPart;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Section;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class OpenEjbJarCMPSection extends AbstractSectionPart {
+
+ protected Text resourceLink;
+
+ protected Text url;
+
+ protected Text artifact;
+
+ protected Text group;
+
+ protected Text module;
+
+ protected Text name;
+
+ protected Text version;
+
+ protected Button specifyAsLink;
+
+ protected Button specifyAsUrl;
+
+ protected Button specifyAsPattern;
+
+ 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;
+ }
+}
Propchange: geronimo/devtools/eclipse-plugin/branches/3.0-beta-1/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/OpenEjbJarCMPSection.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/devtools/eclipse-plugin/branches/3.0-beta-1/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/OpenEjbJarCMPSection.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/devtools/eclipse-plugin/branches/3.0-beta-1/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/OpenEjbJarCMPSection.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Propchange: geronimo/devtools/eclipse-plugin/branches/3.0-beta-1/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/OpenEjbJarGeneralSection.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/devtools/eclipse-plugin/branches/3.0-beta-1/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/OpenEjbJarGeneralSection.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/devtools/eclipse-plugin/branches/3.0-beta-1/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/OpenEjbJarGeneralSection.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Propchange: geronimo/devtools/eclipse-plugin/branches/3.0-beta-1/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/ResourceEnvRefSection.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/devtools/eclipse-plugin/branches/3.0-beta-1/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/ResourceEnvRefSection.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/devtools/eclipse-plugin/branches/3.0-beta-1/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/ResourceEnvRefSection.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Propchange: geronimo/devtools/eclipse-plugin/branches/3.0-beta-1/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/ResourceRefSection.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/devtools/eclipse-plugin/branches/3.0-beta-1/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/ResourceRefSection.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/devtools/eclipse-plugin/branches/3.0-beta-1/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/ResourceRefSection.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: geronimo/devtools/eclipse-plugin/branches/3.0-beta-1/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/branches/3.0-beta-1/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/SecurityAdvancedSection.java?rev=1203020&r1=1203019&r2=1203020&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/branches/3.0-beta-1/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/SecurityAdvancedSection.java (original)
+++ geronimo/devtools/eclipse-plugin/branches/3.0-beta-1/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/SecurityAdvancedSection.java Thu Nov 17 02:19:12 2011
@@ -1,460 +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());
-// }
-// }
-//}
+///*
+// * 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$ $Date$
+// */
+//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());
+// }
+// }
+//}
Propchange: geronimo/devtools/eclipse-plugin/branches/3.0-beta-1/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/SecurityAdvancedSection.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/devtools/eclipse-plugin/branches/3.0-beta-1/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/SecurityAdvancedSection.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/devtools/eclipse-plugin/branches/3.0-beta-1/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/sections/SecurityAdvancedSection.java
------------------------------------------------------------------------------
svn:mime-type = text/plain