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 [17/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/wizards/ExtModuleWizard.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/wizards/ExtModuleWizard.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/wizards/ExtModuleWizard.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/wizards/ExtModuleWizard.java Thu Nov 17 02:19:12 2011
@@ -1,333 +1,333 @@
-/*
- * 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.wizards;
-
-import java.util.List;
-
-import javax.xml.bind.JAXBElement;
-
-import org.apache.geronimo.j2ee.application.ApplicationType;
-import org.apache.geronimo.j2ee.application.ExtModuleType;
-import org.apache.geronimo.j2ee.application.PathType;
-import org.apache.geronimo.jaxbmodel.common.operations.JAXBObjectFactory;
-import org.apache.geronimo.st.ui.CommonMessages;
-import org.apache.geronimo.st.ui.sections.AbstractTableSection;
-import org.apache.geronimo.st.ui.wizards.AbstractTableWizard;
-import org.apache.geronimo.j2ee.jaxbmodel.operations.JAXBObjectFactoryImpl;
-import org.eclipse.swt.SWT;
-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.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-
-/*
- * @version $Rev: 720616 $ $Date: 2008-11-26 05:49:55 +0800 (Wed, 26 Nov 2008) $
- */
-public class ExtModuleWizard extends AbstractTableWizard {
-
- public ExtModuleWizard(AbstractTableSection section) {
- super(section);
- }
-
- public JAXBObjectFactory getEFactory() {
- return JAXBObjectFactoryImpl.getInstance();
- }
-
- public String[] getTableColumnEAttributes() {
- return new String[] { "ModuleType", "Path", "InternalPath",
- "GroupId", "ArtifactId", "Version", "Type" };
- }
-
- public String getAddWizardWindowTitle() {
- return CommonMessages.wizardNewTitle_ExtModule;
- }
-
- public String getEditWizardWindowTitle() {
- return CommonMessages.wizardEditTitle_ExtModule;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.wizard.IWizard#addPages()
- */
- public void addPages() {
- addPage(new ModuleWizardPage("Page0"));
- }
-
- // need to extend the DynamicWizardPage only so that when the Edit dialog is shown
- // the values are brought in properly.
- public class ModuleWizardPage extends AbstractTableWizardPage {
- protected Button[] buttonList = new Button[6];
-
- public ModuleWizardPage(String pageName) {
- super(pageName);
- }
-
- public void createControl(Composite parent) {
- Composite composite = createComposite(parent);
- GridData data;
- ExtModuleType extModule = (ExtModuleType)eObject;
-
- // First we need a set of radio buttons to determine what kind of module we are
- // dealing with.
- Group group = new Group (composite, SWT.NONE);
- Button button = new Button (group, SWT.RADIO);
- button.setText(CommonMessages.connector);
- buttonList[0] = button;
- button = new Button (group, SWT.RADIO);
- button.setText(CommonMessages.ejb);
- buttonList[1] = button;
- button = new Button (group, SWT.RADIO);
- button.setText(CommonMessages.java);
- buttonList[2] = button;
- button = new Button (group, SWT.RADIO);
- button.setText(CommonMessages.web);
- buttonList[3] = button;
- GridLayout gridLayout = new GridLayout();
- gridLayout.numColumns = 4;
- group.setLayout(gridLayout);
- data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- data.horizontalSpan = 2;
- group.setLayoutData(data);
-
- Group group2 = new Group (composite, SWT.NONE);
- for (int i = 1; i < section.getTableColumnNames().length; i++) {
- if (i == 2) {
- button = new Button (group2, SWT.RADIO);
- button.setText(CommonMessages.internalPath);
- buttonList[4] = button;
- data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.horizontalSpan = 2;
- button.setLayoutData(data);
- }
- if (i == 3) {
- button = new Button (group2, SWT.RADIO);
- button.setText(CommonMessages.externalPath);
- buttonList[5] = button;
- data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.horizontalSpan = 2;
- button.setLayoutData(data);
- }
- Text text;
-
- if (i == 1) {
- Label label = new Label(group, SWT.LEFT);
- String columnName = section.getTableColumnNames()[i];
- if (!columnName.endsWith(":"))
- columnName = columnName.concat(":");
- label.setText(columnName);
- data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- label.setLayoutData(data);
-
- text = new Text(group, SWT.SINGLE | SWT.BORDER);
- data = new GridData(GridData.HORIZONTAL_ALIGN_FILL
- | GridData.VERTICAL_ALIGN_FILL);
- data.grabExcessHorizontalSpace = true;
- data.widthHint = 100;
- data.horizontalSpan = 3;
- text.setLayoutData(data);
- }
- else {
- Label label = new Label(group2, SWT.LEFT);
- String columnName = section.getTableColumnNames()[i];
- if (!columnName.endsWith(":"))
- columnName = columnName.concat(":");
- label.setText(columnName);
- data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- label.setLayoutData(data);
-
- text = new Text(group2, SWT.SINGLE | SWT.BORDER);
- data = new GridData(GridData.HORIZONTAL_ALIGN_FILL
- | GridData.VERTICAL_ALIGN_FILL);
- data.grabExcessHorizontalSpace = true;
- data.widthHint = 100;
- text.setLayoutData(data);
- }
-
- if (extModule != null) {
- if (i == 1) {
- if (extModule.getConnector() != null) {
- text.setText(extModule.getConnector().getValue());
- buttonList[0].setSelection(true);
- }
- else if (extModule.getEjb() != null) {
- text.setText(extModule.getEjb().getValue());
- buttonList[1].setSelection(true);
- }
- else if (extModule.getJava() != null) {
- text.setText(extModule.getJava().getValue());
- buttonList[2].setSelection(true);
- }
- else if (extModule.getWeb() != null) {
- text.setText(extModule.getWeb().getValue());
- buttonList[3].setSelection(true);
- }
- }
- else if (i == 2 && extModule.getInternalPath() != null) {
- text.setText(extModule.getInternalPath());
- }
- else if (i > 2 && extModule.getExternalPath() != null) {
- String value= extModule.getExternalPath();
- text.setText(value);
-// try {
-// value = (String) JAXBUtils.getValue(pattern,getTableColumnEAttributes()[i]);
-// } catch (Exception e1) {
-// value = e1.getMessage();
-// }
-// if (value != null) {
-// text.setText(value);
-// }
- }
- }
- textEntries[i - 1] = text;
- }
- gridLayout = new GridLayout();
- gridLayout.numColumns = 2;
- group2.setLayout(gridLayout);
- data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- data.horizontalSpan = 2;
- group2.setLayoutData(data);
-
- buttonList[4].addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- if (buttonList[4].getSelection()) {
- toggle();
- }
- }
- });
- buttonList[5].addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- if (buttonList[5].getSelection()) {
- toggle();
- }
- }
- });
-
- if (extModule == null) {
- buttonList[0].setSelection(true);
- buttonList[4].setSelection(true);
- }
- else if (extModule.getInternalPath() != null) {
- buttonList[4].setSelection(true);
- }
- else {
- buttonList[5].setSelection(true);
- }
- toggle();
-
- doCustom(composite);
- setControl(composite);
- textEntries[0].setFocus();
- }
-
- private void toggle () {
- textEntries[1].setEnabled(buttonList[4].getSelection());
- textEntries[2].setEnabled(buttonList[5].getSelection());
- textEntries[3].setEnabled(buttonList[5].getSelection());
- textEntries[4].setEnabled(buttonList[5].getSelection());
- textEntries[5].setEnabled(buttonList[5].getSelection());
- }
-
- public String getWizardPageTitle() {
- return CommonMessages.wizardPageTitle_ExtModule;
- }
-
- public String getWizardPageDescription() {
- return CommonMessages.wizardPageDescription_ExtModule;
- }
- }
-
- public boolean performFinish() {
- ModuleWizardPage page = (ModuleWizardPage) getPages()[0];
- PathType path;
- ExtModuleType extModule;
-
- if (eObject == null) {
- eObject = getEFactory().create(ExtModuleType.class);
- JAXBElement plan = section.getPlan();
-
- extModule = (ExtModuleType)eObject;
-
- List extModuleList = ((ApplicationType)plan.getValue()).getExtModule();
- if (extModuleList == null) {
- extModuleList = (List)getEFactory().create(ExtModuleType.class);
- }
- extModuleList.add(eObject);
- }
- else {
- extModule = (ExtModuleType)eObject;
- extModule.setConnector(null);
- extModule.setEjb(null);
- extModule.setJava(null);
- extModule.setWeb(null);
- extModule.setExternalPath(null);
- }
-
- // NOTE!! this replaces the call to processEAttributes (page);
- path = (PathType)getEFactory().create(PathType.class);
- path.setValue(page.getTextEntry(0).getText());
-
- if (((ModuleWizardPage)page).buttonList[0].getSelection())
- extModule.setConnector(path);
- else if (((ModuleWizardPage)page).buttonList[1].getSelection())
- extModule.setEjb(path);
- else if (((ModuleWizardPage)page).buttonList[2].getSelection())
- extModule.setJava(path);
- else if (((ModuleWizardPage)page).buttonList[3].getSelection())
- extModule.setWeb(path);
-
- if (page.buttonList[4].getSelection()) {
- extModule.setInternalPath (page.getTextEntry(1).getText());
- extModule.setExternalPath(null);
- }
- else if (page.buttonList[5].getSelection()) {
-
- StringBuilder sb = new StringBuilder();
- for (int i = 2; i < 6; i++) {
- String value = page.getTextEntry(i).getText();
- sb.append(value).append("/");
- }
- //remove last "/"
- sb.deleteCharAt(sb.length()-1);
-
- //for 1.1 external path is in this format: groupid/artifactid/version/type
- extModule.setExternalPath(sb.toString());
-
- extModule.setInternalPath(null);
- }
-
- if (section.getViewer().getInput() == section.getPlan()) {
- section.getViewer().setInput(section.getInput());
- }
-
- return true;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.st.v11.ui.wizards;
+
+import java.util.List;
+
+import javax.xml.bind.JAXBElement;
+
+import org.apache.geronimo.j2ee.application.ApplicationType;
+import org.apache.geronimo.j2ee.application.ExtModuleType;
+import org.apache.geronimo.j2ee.application.PathType;
+import org.apache.geronimo.jaxbmodel.common.operations.JAXBObjectFactory;
+import org.apache.geronimo.st.ui.CommonMessages;
+import org.apache.geronimo.st.ui.sections.AbstractTableSection;
+import org.apache.geronimo.st.ui.wizards.AbstractTableWizard;
+import org.apache.geronimo.j2ee.jaxbmodel.operations.JAXBObjectFactoryImpl;
+import org.eclipse.swt.SWT;
+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.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+
+/*
+ * @version $Rev$ $Date$
+ */
+public class ExtModuleWizard extends AbstractTableWizard {
+
+ public ExtModuleWizard(AbstractTableSection section) {
+ super(section);
+ }
+
+ public JAXBObjectFactory getEFactory() {
+ return JAXBObjectFactoryImpl.getInstance();
+ }
+
+ public String[] getTableColumnEAttributes() {
+ return new String[] { "ModuleType", "Path", "InternalPath",
+ "GroupId", "ArtifactId", "Version", "Type" };
+ }
+
+ public String getAddWizardWindowTitle() {
+ return CommonMessages.wizardNewTitle_ExtModule;
+ }
+
+ public String getEditWizardWindowTitle() {
+ return CommonMessages.wizardEditTitle_ExtModule;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.wizard.IWizard#addPages()
+ */
+ public void addPages() {
+ addPage(new ModuleWizardPage("Page0"));
+ }
+
+ // need to extend the DynamicWizardPage only so that when the Edit dialog is shown
+ // the values are brought in properly.
+ public class ModuleWizardPage extends AbstractTableWizardPage {
+ protected Button[] buttonList = new Button[6];
+
+ public ModuleWizardPage(String pageName) {
+ super(pageName);
+ }
+
+ public void createControl(Composite parent) {
+ Composite composite = createComposite(parent);
+ GridData data;
+ ExtModuleType extModule = (ExtModuleType)eObject;
+
+ // First we need a set of radio buttons to determine what kind of module we are
+ // dealing with.
+ Group group = new Group (composite, SWT.NONE);
+ Button button = new Button (group, SWT.RADIO);
+ button.setText(CommonMessages.connector);
+ buttonList[0] = button;
+ button = new Button (group, SWT.RADIO);
+ button.setText(CommonMessages.ejb);
+ buttonList[1] = button;
+ button = new Button (group, SWT.RADIO);
+ button.setText(CommonMessages.java);
+ buttonList[2] = button;
+ button = new Button (group, SWT.RADIO);
+ button.setText(CommonMessages.web);
+ buttonList[3] = button;
+ GridLayout gridLayout = new GridLayout();
+ gridLayout.numColumns = 4;
+ group.setLayout(gridLayout);
+ data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ data.grabExcessHorizontalSpace = true;
+ data.horizontalSpan = 2;
+ group.setLayoutData(data);
+
+ Group group2 = new Group (composite, SWT.NONE);
+ for (int i = 1; i < section.getTableColumnNames().length; i++) {
+ if (i == 2) {
+ button = new Button (group2, SWT.RADIO);
+ button.setText(CommonMessages.internalPath);
+ buttonList[4] = button;
+ data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ data.horizontalSpan = 2;
+ button.setLayoutData(data);
+ }
+ if (i == 3) {
+ button = new Button (group2, SWT.RADIO);
+ button.setText(CommonMessages.externalPath);
+ buttonList[5] = button;
+ data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ data.horizontalSpan = 2;
+ button.setLayoutData(data);
+ }
+ Text text;
+
+ if (i == 1) {
+ Label label = new Label(group, SWT.LEFT);
+ String columnName = section.getTableColumnNames()[i];
+ if (!columnName.endsWith(":"))
+ columnName = columnName.concat(":");
+ label.setText(columnName);
+ data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ label.setLayoutData(data);
+
+ text = new Text(group, SWT.SINGLE | SWT.BORDER);
+ data = new GridData(GridData.HORIZONTAL_ALIGN_FILL
+ | GridData.VERTICAL_ALIGN_FILL);
+ data.grabExcessHorizontalSpace = true;
+ data.widthHint = 100;
+ data.horizontalSpan = 3;
+ text.setLayoutData(data);
+ }
+ else {
+ Label label = new Label(group2, SWT.LEFT);
+ String columnName = section.getTableColumnNames()[i];
+ if (!columnName.endsWith(":"))
+ columnName = columnName.concat(":");
+ label.setText(columnName);
+ data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ label.setLayoutData(data);
+
+ text = new Text(group2, SWT.SINGLE | SWT.BORDER);
+ data = new GridData(GridData.HORIZONTAL_ALIGN_FILL
+ | GridData.VERTICAL_ALIGN_FILL);
+ data.grabExcessHorizontalSpace = true;
+ data.widthHint = 100;
+ text.setLayoutData(data);
+ }
+
+ if (extModule != null) {
+ if (i == 1) {
+ if (extModule.getConnector() != null) {
+ text.setText(extModule.getConnector().getValue());
+ buttonList[0].setSelection(true);
+ }
+ else if (extModule.getEjb() != null) {
+ text.setText(extModule.getEjb().getValue());
+ buttonList[1].setSelection(true);
+ }
+ else if (extModule.getJava() != null) {
+ text.setText(extModule.getJava().getValue());
+ buttonList[2].setSelection(true);
+ }
+ else if (extModule.getWeb() != null) {
+ text.setText(extModule.getWeb().getValue());
+ buttonList[3].setSelection(true);
+ }
+ }
+ else if (i == 2 && extModule.getInternalPath() != null) {
+ text.setText(extModule.getInternalPath());
+ }
+ else if (i > 2 && extModule.getExternalPath() != null) {
+ String value= extModule.getExternalPath();
+ text.setText(value);
+// try {
+// value = (String) JAXBUtils.getValue(pattern,getTableColumnEAttributes()[i]);
+// } catch (Exception e1) {
+// value = e1.getMessage();
+// }
+// if (value != null) {
+// text.setText(value);
+// }
+ }
+ }
+ textEntries[i - 1] = text;
+ }
+ gridLayout = new GridLayout();
+ gridLayout.numColumns = 2;
+ group2.setLayout(gridLayout);
+ data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ data.grabExcessHorizontalSpace = true;
+ data.horizontalSpan = 2;
+ group2.setLayoutData(data);
+
+ buttonList[4].addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ if (buttonList[4].getSelection()) {
+ toggle();
+ }
+ }
+ });
+ buttonList[5].addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ if (buttonList[5].getSelection()) {
+ toggle();
+ }
+ }
+ });
+
+ if (extModule == null) {
+ buttonList[0].setSelection(true);
+ buttonList[4].setSelection(true);
+ }
+ else if (extModule.getInternalPath() != null) {
+ buttonList[4].setSelection(true);
+ }
+ else {
+ buttonList[5].setSelection(true);
+ }
+ toggle();
+
+ doCustom(composite);
+ setControl(composite);
+ textEntries[0].setFocus();
+ }
+
+ private void toggle () {
+ textEntries[1].setEnabled(buttonList[4].getSelection());
+ textEntries[2].setEnabled(buttonList[5].getSelection());
+ textEntries[3].setEnabled(buttonList[5].getSelection());
+ textEntries[4].setEnabled(buttonList[5].getSelection());
+ textEntries[5].setEnabled(buttonList[5].getSelection());
+ }
+
+ public String getWizardPageTitle() {
+ return CommonMessages.wizardPageTitle_ExtModule;
+ }
+
+ public String getWizardPageDescription() {
+ return CommonMessages.wizardPageDescription_ExtModule;
+ }
+ }
+
+ public boolean performFinish() {
+ ModuleWizardPage page = (ModuleWizardPage) getPages()[0];
+ PathType path;
+ ExtModuleType extModule;
+
+ if (eObject == null) {
+ eObject = getEFactory().create(ExtModuleType.class);
+ JAXBElement plan = section.getPlan();
+
+ extModule = (ExtModuleType)eObject;
+
+ List extModuleList = ((ApplicationType)plan.getValue()).getExtModule();
+ if (extModuleList == null) {
+ extModuleList = (List)getEFactory().create(ExtModuleType.class);
+ }
+ extModuleList.add(eObject);
+ }
+ else {
+ extModule = (ExtModuleType)eObject;
+ extModule.setConnector(null);
+ extModule.setEjb(null);
+ extModule.setJava(null);
+ extModule.setWeb(null);
+ extModule.setExternalPath(null);
+ }
+
+ // NOTE!! this replaces the call to processEAttributes (page);
+ path = (PathType)getEFactory().create(PathType.class);
+ path.setValue(page.getTextEntry(0).getText());
+
+ if (((ModuleWizardPage)page).buttonList[0].getSelection())
+ extModule.setConnector(path);
+ else if (((ModuleWizardPage)page).buttonList[1].getSelection())
+ extModule.setEjb(path);
+ else if (((ModuleWizardPage)page).buttonList[2].getSelection())
+ extModule.setJava(path);
+ else if (((ModuleWizardPage)page).buttonList[3].getSelection())
+ extModule.setWeb(path);
+
+ if (page.buttonList[4].getSelection()) {
+ extModule.setInternalPath (page.getTextEntry(1).getText());
+ extModule.setExternalPath(null);
+ }
+ else if (page.buttonList[5].getSelection()) {
+
+ StringBuilder sb = new StringBuilder();
+ for (int i = 2; i < 6; i++) {
+ String value = page.getTextEntry(i).getText();
+ sb.append(value).append("/");
+ }
+ //remove last "/"
+ sb.deleteCharAt(sb.length()-1);
+
+ //for 1.1 external path is in this format: groupid/artifactid/version/type
+ extModule.setExternalPath(sb.toString());
+
+ extModule.setInternalPath(null);
+ }
+
+ if (section.getViewer().getInput() == section.getPlan()) {
+ section.getViewer().setInput(section.getInput());
+ }
+
+ return true;
+ }
+}
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/wizards/ExtModuleWizard.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/wizards/ExtModuleWizard.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/wizards/ExtModuleWizard.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/wizards/FacetInstallPage.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/wizards/FacetInstallPage.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/wizards/FacetInstallPage.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/wizards/GBeanRefWizard.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/wizards/GBeanRefWizard.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/wizards/GBeanRefWizard.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/wizards/GBeanWizard.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/wizards/GBeanWizard.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/wizards/GBeanWizard.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/wizards/MessageDestWizard.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/wizards/MessageDestWizard.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/wizards/MessageDestWizard.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/wizards/MessageDestWizard.java Thu Nov 17 02:19:12 2011
@@ -1,191 +1,191 @@
-/*
- * 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.wizards;
-
-import java.util.List;
-
-import javax.xml.bind.JAXBElement;
-
-import org.apache.geronimo.j2ee.naming.MessageDestinationType;
-import org.apache.geronimo.j2ee.naming.PatternType;
-import org.apache.geronimo.jaxbmodel.common.operations.JAXBObjectFactory;
-import org.apache.geronimo.jaxbmodel.common.operations.JAXBUtils;
-import org.apache.geronimo.st.ui.CommonMessages;
-import org.apache.geronimo.st.ui.internal.Messages;
-import org.apache.geronimo.st.ui.sections.AbstractTableSection;
-import org.apache.geronimo.st.ui.wizards.AbstractTableWizard;
-import org.apache.geronimo.j2ee.jaxbmodel.operations.JAXBModelUtils;
-import org.apache.geronimo.j2ee.jaxbmodel.operations.JAXBObjectFactoryImpl;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * @version $Rev: 720616 $ $Date: 2008-11-26 05:49:55 +0800 (Wed, 26 Nov 2008) $
- */
-public class MessageDestWizard extends AbstractTableWizard {
-
- public MessageDestWizard(AbstractTableSection section) {
- super(section);
- }
-
- public JAXBObjectFactory getEFactory() {
- return JAXBObjectFactoryImpl.getInstance();
- }
-
- public String[] getTableColumnEAttributes() {
- return new String[] { "MessageDestinationName", "AdminObjectModule", "AdminObjectLink",
- "GroupId", "ArtifactId", "Version", "Module", "Name"};
- }
-
- public String getAddWizardWindowTitle() {
- return CommonMessages.wizardNewTitle_MessageDest;
- }
-
- public String getEditWizardWindowTitle() {
- return CommonMessages.wizardEditTitle_MessageDest;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.wizard.IWizard#addPages()
- */
- public void addPages() {
- addPage(new MessageDestWizardPage("Page0"));
- }
-
- // need to extend the DynamicWizardPage only so that when the Edit dialog is shown
- // the values are brought in properly.
- public class MessageDestWizardPage extends AbstractTableWizardPage {
- public MessageDestWizardPage(String pageName) {
- super(pageName);
- }
-
- public void createControl(Composite parent) {
- Composite composite = createComposite(parent);
- for (int i = 0; i < section.getTableColumnNames().length; i++) {
- Label label = new Label(composite, SWT.LEFT);
- String columnName = section.getTableColumnNames()[i];
- if (!columnName.endsWith(":"))
- columnName = columnName.concat(":");
- label.setText(columnName);
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- label.setLayoutData(data);
-
- Text text = new Text(composite, SWT.SINGLE | SWT.BORDER);
- data = new GridData(GridData.HORIZONTAL_ALIGN_FILL
- | GridData.VERTICAL_ALIGN_FILL);
- data.grabExcessHorizontalSpace = true;
- data.widthHint = 100;
- text.setLayoutData(data);
- if (eObject != null) {
- if (i > 2) {
- // get the pattern value
- PatternType pattern = ((MessageDestinationType) eObject).getPattern();
- String value = null;
- try {
- value = (String) JAXBUtils.getValue(pattern,getTableColumnEAttributes()[i]);
- } catch (Exception e) {
- MessageDialog.openError(Display.getCurrent().getActiveShell(), Messages.error, e.getMessage());
- }
- if (value != null) {
- text.setText(value);
- }
- }
- else
- {
- String value = null;
- try {
- value = (String) JAXBUtils.getValue(eObject,getTableColumnEAttributes()[i]);
- } catch (Exception e) {
- MessageDialog.openError(Display.getCurrent().getActiveShell(), Messages.error, e.getMessage());
- }
- if (value != null) {
- text.setText(value);
- }
- }
- }
- textEntries[i] = text;
- }
-
- doCustom(composite);
- setControl(composite);
- textEntries[0].setFocus();
- }
-
- public String getWizardPageTitle() {
- return CommonMessages.wizardPageTitle_MessageDest;
- }
-
- public String getWizardPageDescription() {
- return CommonMessages.wizardPageDescription_MessageDest;
- }
- }
-
- public boolean performFinish() {
- AbstractTableWizardPage page = (AbstractTableWizardPage) getPages()[0];
- PatternType msgPattern;
- MessageDestinationType messageDest;
-
- if (eObject == null) {
- eObject = getEFactory().create(MessageDestinationType.class);
- JAXBElement plan = section.getPlan();
-
- messageDest = (MessageDestinationType)eObject;
- msgPattern = (PatternType)getEFactory().create(PatternType.class);
- messageDest.setPattern(msgPattern);
-
- List msgDestList = JAXBModelUtils.getMessageDestinations(plan);
- if (msgDestList == null) {
- msgDestList = (List)getEFactory().create(MessageDestinationType.class);
- }
- msgDestList.add(eObject);
- }
-
- // NOTE!! this replaces the call to processEAttributes (page);
- messageDest =(MessageDestinationType) eObject;
- msgPattern = messageDest.getPattern();
- for (int i = 0; i < 8; i++) {
- String value = page.getTextEntry(i).getText();
- String attribute = getTableColumnEAttributes()[i];
- if (i < 3)
- try {
- JAXBUtils.setValue(eObject, attribute, value);
- } catch (Exception e) {
- MessageDialog.openError(Display.getCurrent().getActiveShell(), Messages.error, e.getMessage());
- }
- else
- try {
- JAXBUtils.setValue(msgPattern, attribute, value);
- } catch (Exception e) {
- MessageDialog.openError(Display.getCurrent().getActiveShell(), Messages.error, e.getMessage());
- }
- }
-
- if (section.getViewer().getInput() == section.getPlan()) {
- section.getViewer().setInput(section.getInput());
- }
-
- return true;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.st.v11.ui.wizards;
+
+import java.util.List;
+
+import javax.xml.bind.JAXBElement;
+
+import org.apache.geronimo.j2ee.naming.MessageDestinationType;
+import org.apache.geronimo.j2ee.naming.PatternType;
+import org.apache.geronimo.jaxbmodel.common.operations.JAXBObjectFactory;
+import org.apache.geronimo.jaxbmodel.common.operations.JAXBUtils;
+import org.apache.geronimo.st.ui.CommonMessages;
+import org.apache.geronimo.st.ui.internal.Messages;
+import org.apache.geronimo.st.ui.sections.AbstractTableSection;
+import org.apache.geronimo.st.ui.wizards.AbstractTableWizard;
+import org.apache.geronimo.j2ee.jaxbmodel.operations.JAXBModelUtils;
+import org.apache.geronimo.j2ee.jaxbmodel.operations.JAXBObjectFactoryImpl;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class MessageDestWizard extends AbstractTableWizard {
+
+ public MessageDestWizard(AbstractTableSection section) {
+ super(section);
+ }
+
+ public JAXBObjectFactory getEFactory() {
+ return JAXBObjectFactoryImpl.getInstance();
+ }
+
+ public String[] getTableColumnEAttributes() {
+ return new String[] { "MessageDestinationName", "AdminObjectModule", "AdminObjectLink",
+ "GroupId", "ArtifactId", "Version", "Module", "Name"};
+ }
+
+ public String getAddWizardWindowTitle() {
+ return CommonMessages.wizardNewTitle_MessageDest;
+ }
+
+ public String getEditWizardWindowTitle() {
+ return CommonMessages.wizardEditTitle_MessageDest;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.wizard.IWizard#addPages()
+ */
+ public void addPages() {
+ addPage(new MessageDestWizardPage("Page0"));
+ }
+
+ // need to extend the DynamicWizardPage only so that when the Edit dialog is shown
+ // the values are brought in properly.
+ public class MessageDestWizardPage extends AbstractTableWizardPage {
+ public MessageDestWizardPage(String pageName) {
+ super(pageName);
+ }
+
+ public void createControl(Composite parent) {
+ Composite composite = createComposite(parent);
+ for (int i = 0; i < section.getTableColumnNames().length; i++) {
+ Label label = new Label(composite, SWT.LEFT);
+ String columnName = section.getTableColumnNames()[i];
+ if (!columnName.endsWith(":"))
+ columnName = columnName.concat(":");
+ label.setText(columnName);
+ GridData data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ label.setLayoutData(data);
+
+ Text text = new Text(composite, SWT.SINGLE | SWT.BORDER);
+ data = new GridData(GridData.HORIZONTAL_ALIGN_FILL
+ | GridData.VERTICAL_ALIGN_FILL);
+ data.grabExcessHorizontalSpace = true;
+ data.widthHint = 100;
+ text.setLayoutData(data);
+ if (eObject != null) {
+ if (i > 2) {
+ // get the pattern value
+ PatternType pattern = ((MessageDestinationType) eObject).getPattern();
+ String value = null;
+ try {
+ value = (String) JAXBUtils.getValue(pattern,getTableColumnEAttributes()[i]);
+ } catch (Exception e) {
+ MessageDialog.openError(Display.getCurrent().getActiveShell(), Messages.error, e.getMessage());
+ }
+ if (value != null) {
+ text.setText(value);
+ }
+ }
+ else
+ {
+ String value = null;
+ try {
+ value = (String) JAXBUtils.getValue(eObject,getTableColumnEAttributes()[i]);
+ } catch (Exception e) {
+ MessageDialog.openError(Display.getCurrent().getActiveShell(), Messages.error, e.getMessage());
+ }
+ if (value != null) {
+ text.setText(value);
+ }
+ }
+ }
+ textEntries[i] = text;
+ }
+
+ doCustom(composite);
+ setControl(composite);
+ textEntries[0].setFocus();
+ }
+
+ public String getWizardPageTitle() {
+ return CommonMessages.wizardPageTitle_MessageDest;
+ }
+
+ public String getWizardPageDescription() {
+ return CommonMessages.wizardPageDescription_MessageDest;
+ }
+ }
+
+ public boolean performFinish() {
+ AbstractTableWizardPage page = (AbstractTableWizardPage) getPages()[0];
+ PatternType msgPattern;
+ MessageDestinationType messageDest;
+
+ if (eObject == null) {
+ eObject = getEFactory().create(MessageDestinationType.class);
+ JAXBElement plan = section.getPlan();
+
+ messageDest = (MessageDestinationType)eObject;
+ msgPattern = (PatternType)getEFactory().create(PatternType.class);
+ messageDest.setPattern(msgPattern);
+
+ List msgDestList = JAXBModelUtils.getMessageDestinations(plan);
+ if (msgDestList == null) {
+ msgDestList = (List)getEFactory().create(MessageDestinationType.class);
+ }
+ msgDestList.add(eObject);
+ }
+
+ // NOTE!! this replaces the call to processEAttributes (page);
+ messageDest =(MessageDestinationType) eObject;
+ msgPattern = messageDest.getPattern();
+ for (int i = 0; i < 8; i++) {
+ String value = page.getTextEntry(i).getText();
+ String attribute = getTableColumnEAttributes()[i];
+ if (i < 3)
+ try {
+ JAXBUtils.setValue(eObject, attribute, value);
+ } catch (Exception e) {
+ MessageDialog.openError(Display.getCurrent().getActiveShell(), Messages.error, e.getMessage());
+ }
+ else
+ try {
+ JAXBUtils.setValue(msgPattern, attribute, value);
+ } catch (Exception e) {
+ MessageDialog.openError(Display.getCurrent().getActiveShell(), Messages.error, e.getMessage());
+ }
+ }
+
+ if (section.getViewer().getInput() == section.getPlan()) {
+ section.getViewer().setInput(section.getInput());
+ }
+
+ return true;
+ }
+}
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/wizards/MessageDestWizard.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/wizards/MessageDestWizard.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/wizards/MessageDestWizard.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/wizards/ModuleWizard.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/wizards/ModuleWizard.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/wizards/ModuleWizard.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/wizards/ModuleWizard.java Thu Nov 17 02:19:12 2011
@@ -1,216 +1,216 @@
-/*
- * 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.wizards;
-
-import java.util.List;
-
-import javax.xml.bind.JAXBElement;
-
-import org.apache.geronimo.j2ee.application.ApplicationType;
-import org.apache.geronimo.j2ee.application.ModuleType;
-import org.apache.geronimo.j2ee.application.PathType;
-import org.apache.geronimo.jaxbmodel.common.operations.JAXBObjectFactory;
-import org.apache.geronimo.st.ui.CommonMessages;
-import org.apache.geronimo.st.ui.sections.AbstractTableSection;
-import org.apache.geronimo.st.ui.wizards.AbstractTableWizard;
-import org.apache.geronimo.j2ee.jaxbmodel.operations.JAXBObjectFactoryImpl;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-
-/*
- * @version $Rev: 720616 $ $Date: 2008-11-26 05:49:55 +0800 (Wed, 26 Nov 2008) $
- */
-public class ModuleWizard extends AbstractTableWizard {
-
- public ModuleWizard(AbstractTableSection section) {
- super(section);
- }
-
- public JAXBObjectFactory getEFactory() {
- return JAXBObjectFactoryImpl.getInstance();
- }
-
- public String[] getTableColumnEAttributes() {
- return new String[] { "ModuleType", "Path", "AltDd" };
- }
-
- public String getAddWizardWindowTitle() {
- return CommonMessages.wizardNewTitle_Module;
- }
-
- public String getEditWizardWindowTitle() {
- return CommonMessages.wizardEditTitle_Module;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.wizard.IWizard#addPages()
- */
- public void addPages() {
- addPage(new ModuleWizardPage("Page0"));
- }
-
- // need to extend the DynamicWizardPage only so that when the Edit dialog is shown
- // the values are brought in properly.
- public class ModuleWizardPage extends AbstractTableWizardPage {
- protected Button[] buttonList = new Button[4];
-
- public ModuleWizardPage(String pageName) {
- super(pageName);
- }
-
- public void createControl(Composite parent) {
- Composite composite = createComposite(parent);
- GridData data;
- ModuleType module = (ModuleType)eObject;
-
- // First we need a set of radio buttons to determine what kind of module we are
- // dealing with.
- Group group = new Group (composite, SWT.NONE);
- Button button = new Button (group, SWT.RADIO);
- button.setText(CommonMessages.connector);
- buttonList[0] = button;
- button = new Button (group, SWT.RADIO);
- button.setText(CommonMessages.ejb);
- buttonList[1] = button;
- button = new Button (group, SWT.RADIO);
- button.setText(CommonMessages.java);
- buttonList[2] = button;
- button = new Button (group, SWT.RADIO);
- button.setText(CommonMessages.web);
- buttonList[3] = button;
- FillLayout fillLayout = new FillLayout();
- fillLayout.type = SWT.HORIZONTAL;
- group.setLayout(fillLayout);
- data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.horizontalSpan = 2;
- group.setLayoutData(data);
-
- for (int i = 1; i < section.getTableColumnNames().length; i++) {
- Label label = new Label(composite, SWT.LEFT);
- String columnName = section.getTableColumnNames()[i];
- if (!columnName.endsWith(":"))
- columnName = columnName.concat(":");
- label.setText(columnName);
- data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- label.setLayoutData(data);
-
- Text text = new Text(composite, SWT.SINGLE | SWT.BORDER);
- data = new GridData(GridData.HORIZONTAL_ALIGN_FILL
- | GridData.VERTICAL_ALIGN_FILL);
- data.grabExcessHorizontalSpace = true;
- data.widthHint = 100;
- text.setLayoutData(data);
- if (module != null) {
- if (i == 1) {
- if (module.getConnector() != null) {
- text.setText(module.getConnector().getValue());
- buttonList[0].setSelection(true);
- }
- else if (module.getEjb() != null) {
- text.setText(module.getEjb().getValue());
- buttonList[1].setSelection(true);
- }
- else if (module.getJava() != null) {
- text.setText(module.getJava().getValue());
- buttonList[2].setSelection(true);
- }
- else if (module.getWeb() != null) {
- text.setText(module.getWeb().getValue());
- buttonList[3].setSelection(true);
- }
- }
- else if (i == 2 && module.getAltDd() != null) {
- text.setText(module.getAltDd().getValue());
- }
- }
- textEntries[i - 1] = text;
- }
-
- doCustom(composite);
- setControl(composite);
- textEntries[0].setFocus();
- }
-
- public String getWizardPageTitle() {
- return CommonMessages.wizardPageTitle_Module;
- }
-
- public String getWizardPageDescription() {
- return CommonMessages.wizardPageDescription_Module;
- }
- }
-
- public boolean performFinish() {
- AbstractTableWizardPage page = (AbstractTableWizardPage) getPages()[0];
- PathType path;
- ModuleType module;
-
- if (eObject == null) {
- eObject = getEFactory().create(ModuleType.class);
- JAXBElement plan = section.getPlan();
-
- module = (ModuleType)eObject;
-
- List moduleList = ((ApplicationType)plan.getValue()).getModule();
- if (moduleList == null) {
- moduleList = (List)getEFactory().create(ModuleType.class);
- }
- moduleList.add(eObject);
- }
- else {
- module = (ModuleType)eObject;
- module.setConnector(null);
- module.setEjb(null);
- module.setJava(null);
- module.setWeb(null);
- }
-
- // NOTE!! this replaces the call to processEAttributes (page);
- path = (PathType)getEFactory().create(PathType.class);
- path.setValue(page.getTextEntry(0).getText());
-
- if (((ModuleWizardPage)page).buttonList[0].getSelection())
- module.setConnector(path);
- else if (((ModuleWizardPage)page).buttonList[1].getSelection())
- module.setEjb(path);
- else if (((ModuleWizardPage)page).buttonList[2].getSelection())
- module.setJava(path);
- else if (((ModuleWizardPage)page).buttonList[3].getSelection())
- module.setWeb(path);
-
- String altDD = page.getTextEntry(1).getText();
- path = (PathType)getEFactory().create(PathType.class);
- path.setValue(altDD);
- module.setAltDd(path);
-
- if (section.getViewer().getInput() == section.getPlan()) {
- section.getViewer().setInput(section.getInput());
- }
-
- return true;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.st.v11.ui.wizards;
+
+import java.util.List;
+
+import javax.xml.bind.JAXBElement;
+
+import org.apache.geronimo.j2ee.application.ApplicationType;
+import org.apache.geronimo.j2ee.application.ModuleType;
+import org.apache.geronimo.j2ee.application.PathType;
+import org.apache.geronimo.jaxbmodel.common.operations.JAXBObjectFactory;
+import org.apache.geronimo.st.ui.CommonMessages;
+import org.apache.geronimo.st.ui.sections.AbstractTableSection;
+import org.apache.geronimo.st.ui.wizards.AbstractTableWizard;
+import org.apache.geronimo.j2ee.jaxbmodel.operations.JAXBObjectFactoryImpl;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+
+/*
+ * @version $Rev$ $Date$
+ */
+public class ModuleWizard extends AbstractTableWizard {
+
+ public ModuleWizard(AbstractTableSection section) {
+ super(section);
+ }
+
+ public JAXBObjectFactory getEFactory() {
+ return JAXBObjectFactoryImpl.getInstance();
+ }
+
+ public String[] getTableColumnEAttributes() {
+ return new String[] { "ModuleType", "Path", "AltDd" };
+ }
+
+ public String getAddWizardWindowTitle() {
+ return CommonMessages.wizardNewTitle_Module;
+ }
+
+ public String getEditWizardWindowTitle() {
+ return CommonMessages.wizardEditTitle_Module;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.wizard.IWizard#addPages()
+ */
+ public void addPages() {
+ addPage(new ModuleWizardPage("Page0"));
+ }
+
+ // need to extend the DynamicWizardPage only so that when the Edit dialog is shown
+ // the values are brought in properly.
+ public class ModuleWizardPage extends AbstractTableWizardPage {
+ protected Button[] buttonList = new Button[4];
+
+ public ModuleWizardPage(String pageName) {
+ super(pageName);
+ }
+
+ public void createControl(Composite parent) {
+ Composite composite = createComposite(parent);
+ GridData data;
+ ModuleType module = (ModuleType)eObject;
+
+ // First we need a set of radio buttons to determine what kind of module we are
+ // dealing with.
+ Group group = new Group (composite, SWT.NONE);
+ Button button = new Button (group, SWT.RADIO);
+ button.setText(CommonMessages.connector);
+ buttonList[0] = button;
+ button = new Button (group, SWT.RADIO);
+ button.setText(CommonMessages.ejb);
+ buttonList[1] = button;
+ button = new Button (group, SWT.RADIO);
+ button.setText(CommonMessages.java);
+ buttonList[2] = button;
+ button = new Button (group, SWT.RADIO);
+ button.setText(CommonMessages.web);
+ buttonList[3] = button;
+ FillLayout fillLayout = new FillLayout();
+ fillLayout.type = SWT.HORIZONTAL;
+ group.setLayout(fillLayout);
+ data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ data.horizontalSpan = 2;
+ group.setLayoutData(data);
+
+ for (int i = 1; i < section.getTableColumnNames().length; i++) {
+ Label label = new Label(composite, SWT.LEFT);
+ String columnName = section.getTableColumnNames()[i];
+ if (!columnName.endsWith(":"))
+ columnName = columnName.concat(":");
+ label.setText(columnName);
+ data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ label.setLayoutData(data);
+
+ Text text = new Text(composite, SWT.SINGLE | SWT.BORDER);
+ data = new GridData(GridData.HORIZONTAL_ALIGN_FILL
+ | GridData.VERTICAL_ALIGN_FILL);
+ data.grabExcessHorizontalSpace = true;
+ data.widthHint = 100;
+ text.setLayoutData(data);
+ if (module != null) {
+ if (i == 1) {
+ if (module.getConnector() != null) {
+ text.setText(module.getConnector().getValue());
+ buttonList[0].setSelection(true);
+ }
+ else if (module.getEjb() != null) {
+ text.setText(module.getEjb().getValue());
+ buttonList[1].setSelection(true);
+ }
+ else if (module.getJava() != null) {
+ text.setText(module.getJava().getValue());
+ buttonList[2].setSelection(true);
+ }
+ else if (module.getWeb() != null) {
+ text.setText(module.getWeb().getValue());
+ buttonList[3].setSelection(true);
+ }
+ }
+ else if (i == 2 && module.getAltDd() != null) {
+ text.setText(module.getAltDd().getValue());
+ }
+ }
+ textEntries[i - 1] = text;
+ }
+
+ doCustom(composite);
+ setControl(composite);
+ textEntries[0].setFocus();
+ }
+
+ public String getWizardPageTitle() {
+ return CommonMessages.wizardPageTitle_Module;
+ }
+
+ public String getWizardPageDescription() {
+ return CommonMessages.wizardPageDescription_Module;
+ }
+ }
+
+ public boolean performFinish() {
+ AbstractTableWizardPage page = (AbstractTableWizardPage) getPages()[0];
+ PathType path;
+ ModuleType module;
+
+ if (eObject == null) {
+ eObject = getEFactory().create(ModuleType.class);
+ JAXBElement plan = section.getPlan();
+
+ module = (ModuleType)eObject;
+
+ List moduleList = ((ApplicationType)plan.getValue()).getModule();
+ if (moduleList == null) {
+ moduleList = (List)getEFactory().create(ModuleType.class);
+ }
+ moduleList.add(eObject);
+ }
+ else {
+ module = (ModuleType)eObject;
+ module.setConnector(null);
+ module.setEjb(null);
+ module.setJava(null);
+ module.setWeb(null);
+ }
+
+ // NOTE!! this replaces the call to processEAttributes (page);
+ path = (PathType)getEFactory().create(PathType.class);
+ path.setValue(page.getTextEntry(0).getText());
+
+ if (((ModuleWizardPage)page).buttonList[0].getSelection())
+ module.setConnector(path);
+ else if (((ModuleWizardPage)page).buttonList[1].getSelection())
+ module.setEjb(path);
+ else if (((ModuleWizardPage)page).buttonList[2].getSelection())
+ module.setJava(path);
+ else if (((ModuleWizardPage)page).buttonList[3].getSelection())
+ module.setWeb(path);
+
+ String altDD = page.getTextEntry(1).getText();
+ path = (PathType)getEFactory().create(PathType.class);
+ path.setValue(altDD);
+ module.setAltDd(path);
+
+ if (section.getViewer().getInput() == section.getPlan()) {
+ section.getViewer().setInput(section.getInput());
+ }
+
+ return true;
+ }
+}
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/wizards/ModuleWizard.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/wizards/ModuleWizard.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/wizards/ModuleWizard.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/wizards/ResourceEnvRefWizard.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/wizards/ResourceEnvRefWizard.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/wizards/ResourceEnvRefWizard.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/wizards/ResourceRefWizard.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/wizards/ResourceRefWizard.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/wizards/ResourceRefWizard.java
------------------------------------------------------------------------------
svn:mime-type = text/plain