You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by mc...@apache.org on 2008/06/28 03:21:09 UTC
svn commit: r672450 [2/2] - in /geronimo/devtools/eclipse-plugin/trunk:
assembly/src/main/assembly/ eclipse/ features/org.apache.geronimo.feature/
features/org.apache.geronimo.v20.feature/
features/org.apache.geronimo.v21.feature/ plugins/org.apache.ge...
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ExtModuleWizard.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ExtModuleWizard.java?rev=672450&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ExtModuleWizard.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ExtModuleWizard.java Fri Jun 27 18:21:07 2008
@@ -0,0 +1,327 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.st.v21.ui.wizards;
+
+import java.util.List;
+
+import javax.xml.bind.JAXBElement;
+
+import org.apache.geronimo.st.core.jaxb.JAXBObjectFactory;
+import org.apache.geronimo.st.core.jaxb.JAXBUtils;
+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.st.v21.core.jaxb.JAXBObjectFactoryImpl;
+import org.apache.geronimo.jee.application.Application;
+import org.apache.geronimo.jee.application.ExtModule;
+import org.apache.geronimo.jee.application.Path;
+import org.apache.geronimo.jee.deployment.Pattern;
+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;
+ }
+
+ public String getWizardFirstPageTitle() {
+ return CommonMessages.wizardPageTitle_ExtModule;
+ }
+
+ public String getWizardFirstPageDescription() {
+ return CommonMessages.wizardPageDescription_ExtModule;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.wizard.IWizard#addPages()
+ */
+ public void addPages() {
+ ModuleWizardPage page = new ModuleWizardPage("Page0");
+ page.setImageDescriptor(descriptor);
+ addPage(page);
+ }
+
+ // need to extend the DynamicWizardPage only so that when the Edit dialog is shown
+ // the values are brought in properly.
+ public class ModuleWizardPage extends DynamicWizardPage {
+ protected Button[] buttonList = new Button[6];
+
+ public ModuleWizardPage(String pageName) {
+ super(pageName);
+ }
+
+ public void createControl(Composite parent) {
+ Composite composite = createComposite(parent);
+ GridData data;
+ ExtModule extModule = (ExtModule)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) {
+ Pattern pattern = extModule.getExternalPath();
+ String value = (String) JAXBUtils.getValue(pattern,getTableColumnEAttributes()[i]);
+ 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 boolean performFinish() {
+ ModuleWizardPage page = (ModuleWizardPage) getPages()[0];
+ Path path;
+ ExtModule extModule;
+
+ if (eObject == null) {
+ eObject = getEFactory().create(ExtModule.class);
+ JAXBElement plan = section.getPlan();
+
+ extModule = (ExtModule)eObject;
+
+ List extModuleList = ((Application)plan.getValue()).getExtModule();
+ if (extModuleList == null) {
+ extModuleList = (List)getEFactory().create(ExtModule.class);
+ }
+ extModuleList.add(eObject);
+ }
+ else {
+ extModule = (ExtModule)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 = (Path)getEFactory().create(Path.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()) {
+ Pattern pattern = (Pattern)getEFactory().create(Pattern.class);
+ extModule.setExternalPath(pattern);
+ for (int i = 2; i < 6; i++) {
+ String value = page.getTextEntry(i).getText();
+ String attribute = getTableColumnEAttributes()[i + 1];
+ JAXBUtils.setValue(pattern, attribute, value);
+ }
+ extModule.setInternalPath(null);
+ }
+
+ if (section.getTableViewer().getInput() == section.getPlan()) {
+ section.getTableViewer().setInput(section.getInput());
+ }
+
+ return true;
+ }
+}
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ExtModuleWizard.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ExtModuleWizard.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ExtModuleWizard.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/FacetInstallPage.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/FacetInstallPage.java?rev=672450&r1=672449&r2=672450&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/FacetInstallPage.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/FacetInstallPage.java Fri Jun 27 18:21:07 2008
@@ -28,6 +28,9 @@
import org.eclipse.swt.widgets.Text;
import org.eclipse.wst.common.project.facet.ui.AbstractFacetWizardPage;
+/**
+ * @version $Rev$ $Date$
+ */
public class FacetInstallPage extends AbstractFacetWizardPage {
private DeploymentPlanInstallConfig config;
Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/GBeanRefWizard.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/GBeanRefWizard.java?rev=672450&r1=672449&r2=672450&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/GBeanRefWizard.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/GBeanRefWizard.java Fri Jun 27 18:21:07 2008
@@ -36,6 +36,9 @@
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
+/**
+ * @version $Rev$ $Date$
+ */
public class GBeanRefWizard extends AbstractTableWizard {
public GBeanRefWizard(AbstractTableSection section) {
Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/GBeanWizard.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/GBeanWizard.java?rev=672450&r1=672449&r2=672450&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/GBeanWizard.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/GBeanWizard.java Fri Jun 27 18:21:07 2008
@@ -27,6 +27,9 @@
import org.apache.geronimo.st.v21.core.jaxb.JAXBModelUtils;
import org.apache.geronimo.st.v21.core.jaxb.JAXBObjectFactoryImpl;
+/**
+ * @version $Rev$ $Date$
+ */
public class GBeanWizard extends AbstractTableWizard {
public GBeanWizard(AbstractTableSection section) {
Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ImportWizard.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ImportWizard.java?rev=672450&r1=672449&r2=672450&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ImportWizard.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ImportWizard.java Fri Jun 27 18:21:07 2008
@@ -19,6 +19,9 @@
import org.apache.geronimo.st.ui.CommonMessages;
import org.apache.geronimo.st.ui.sections.AbstractTableSection;
+/**
+ * @version $Rev$ $Date$
+ */
public class ImportWizard extends DependencyWizard {
/**
Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/MessageDestWizard.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/MessageDestWizard.java?rev=672450&r1=672449&r2=672450&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/MessageDestWizard.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/MessageDestWizard.java Fri Jun 27 18:21:07 2008
@@ -35,6 +35,9 @@
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
+/**
+ * @version $Rev$ $Date$
+ */
public class MessageDestWizard extends AbstractTableWizard {
public MessageDestWizard(AbstractTableSection section) {
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ModuleWizard.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ModuleWizard.java?rev=672450&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ModuleWizard.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ModuleWizard.java Fri Jun 27 18:21:07 2008
@@ -0,0 +1,218 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.st.v21.ui.wizards;
+
+import java.util.List;
+
+import javax.xml.bind.JAXBElement;
+
+import org.apache.geronimo.st.core.jaxb.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.st.v21.core.jaxb.JAXBObjectFactoryImpl;
+import org.apache.geronimo.jee.application.Application;
+import org.apache.geronimo.jee.application.Module;
+import org.apache.geronimo.jee.application.Path;
+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;
+ }
+
+ public String getWizardFirstPageTitle() {
+ return CommonMessages.wizardPageTitle_Module;
+ }
+
+ public String getWizardFirstPageDescription() {
+ return CommonMessages.wizardPageDescription_Module;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.wizard.IWizard#addPages()
+ */
+ public void addPages() {
+ ModuleWizardPage page = new ModuleWizardPage("Page0");
+ page.setImageDescriptor(descriptor);
+ addPage(page);
+ }
+
+ // need to extend the DynamicWizardPage only so that when the Edit dialog is shown
+ // the values are brought in properly.
+ public class ModuleWizardPage extends DynamicWizardPage {
+ protected Button[] buttonList = new Button[4];
+
+ public ModuleWizardPage(String pageName) {
+ super(pageName);
+ }
+
+ public void createControl(Composite parent) {
+ Composite composite = createComposite(parent);
+ GridData data;
+ Module module = (Module)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 boolean performFinish() {
+ DynamicWizardPage page = (DynamicWizardPage) getPages()[0];
+ Path path;
+ Module module;
+
+ if (eObject == null) {
+ eObject = getEFactory().create(Module.class);
+ JAXBElement plan = section.getPlan();
+
+ module = (Module)eObject;
+
+ List moduleList = ((Application)plan.getValue()).getModule();
+ if (moduleList == null) {
+ moduleList = (List)getEFactory().create(Module.class);
+ }
+ moduleList.add(eObject);
+ }
+ else {
+ module = (Module)eObject;
+ module.setConnector(null);
+ module.setEjb(null);
+ module.setJava(null);
+ module.setWeb(null);
+ }
+
+ // NOTE!! this replaces the call to processEAttributes (page);
+ path = (Path)getEFactory().create(Path.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 = (Path)getEFactory().create(Path.class);
+ path.setValue(altDD);
+ module.setAltDd(path);
+
+ if (section.getTableViewer().getInput() == section.getPlan()) {
+ section.getTableViewer().setInput(section.getInput());
+ }
+
+ return true;
+ }
+}
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ModuleWizard.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ModuleWizard.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ModuleWizard.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ResourceEnvRefWizard.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ResourceEnvRefWizard.java?rev=672450&r1=672449&r2=672450&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ResourceEnvRefWizard.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ResourceEnvRefWizard.java Fri Jun 27 18:21:07 2008
@@ -22,6 +22,9 @@
import org.apache.geronimo.st.ui.wizards.AbstractTableWizard;
import org.apache.geronimo.st.v21.core.jaxb.JAXBObjectFactoryImpl;
+/**
+ * @version $Rev$ $Date$
+ */
public class ResourceEnvRefWizard extends AbstractTableWizard {
Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ResourceRefWizard.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ResourceRefWizard.java?rev=672450&r1=672449&r2=672450&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ResourceRefWizard.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ResourceRefWizard.java Fri Jun 27 18:21:07 2008
@@ -22,6 +22,9 @@
import org.apache.geronimo.st.ui.wizards.AbstractTableWizard;
import org.apache.geronimo.st.v21.core.jaxb.JAXBObjectFactoryImpl;
+/**
+ * @version $Rev$ $Date$
+ */
public class ResourceRefWizard extends AbstractTableWizard {
public ResourceRefWizard(AbstractTableSection section) {
Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/SecurityRoleWizard.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/SecurityRoleWizard.java?rev=672450&r1=672449&r2=672450&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/SecurityRoleWizard.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/SecurityRoleWizard.java Fri Jun 27 18:21:07 2008
@@ -37,6 +37,9 @@
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
+/**
+ * @version $Rev$ $Date$
+ */
public class SecurityRoleWizard extends AbstractTableWizard {
public SecurityRoleWizard(AbstractTableSection section) {
Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ServiceRefWizard.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ServiceRefWizard.java?rev=672450&r1=672449&r2=672450&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ServiceRefWizard.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ServiceRefWizard.java Fri Jun 27 18:21:07 2008
@@ -22,6 +22,9 @@
import org.apache.geronimo.st.ui.wizards.AbstractTableWizard;
import org.apache.geronimo.st.v21.core.jaxb.JAXBObjectFactoryImpl;
+/**
+ * @version $Rev$ $Date$
+ */
public class ServiceRefWizard extends AbstractTableWizard {
public ServiceRefWizard(AbstractTableSection section) {