You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by sp...@apache.org on 2005/10/05 21:42:47 UTC
svn commit: r295092 - in
/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui:
internal/Messages.properties sections/DependencySection.java
wizards/DependencyWizard.java
Author: sppatel
Date: Wed Oct 5 12:42:43 2005
New Revision: 295092
URL: http://svn.apache.org/viewcvs?rev=295092&view=rev
Log:
partial implementation of performFinish()
Modified:
geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/Messages.properties
geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/DependencySection.java
geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/wizards/DependencyWizard.java
Modified: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/Messages.properties
URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/Messages.properties?rev=295092&r1=295091&r2=295092&view=diff
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/Messages.properties (original)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/Messages.properties Wed Oct 5 12:42:43 2005
@@ -77,9 +77,9 @@
wizardPageDescription_Dependency=Provide details for this dependency.
dependencyGroupLabel=Dependency type and location
-serverRepos=Server repository
+serverRepos=Specify dependency by path
uri=URI:
-mavenArtifact=Maven artifact
+mavenArtifact=Specify Maven-style dependency
groupId=Group Id:
artifactId=Artifact Id:
version=Version:
Modified: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/DependencySection.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/DependencySection.java?rev=295092&r1=295091&r2=295092&view=diff
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/DependencySection.java (original)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/DependencySection.java Wed Oct 5 12:42:43 2005
@@ -17,8 +17,11 @@
import org.apache.geronimo.ui.internal.Messages;
import org.apache.geronimo.ui.wizards.DependencyWizard;
+import org.apache.geronimo.xml.ns.deployment.DependencyType;
import org.apache.geronimo.xml.ns.deployment.DeploymentFactory;
+import org.apache.geronimo.xml.ns.deployment.DeploymentPackage;
import org.apache.geronimo.xml.ns.j2ee.application.ApplicationFactory;
+import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EFactory;
import org.eclipse.emf.ecore.EObject;
@@ -27,6 +30,7 @@
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.TableItem;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.Section;
@@ -89,7 +93,8 @@
* @see org.apache.geronimo.ui.sections.DynamicTableSection#getEReference()
*/
public EReference getEReference() {
- return ApplicationFactory.eINSTANCE.getApplicationPackage().getApplicationType_Dependency();
+ return ApplicationFactory.eINSTANCE.getApplicationPackage()
+ .getApplicationType_Dependency();
}
/*
@@ -107,7 +112,7 @@
* @see org.apache.geronimo.ui.sections.DynamicTableSection#getTableColumnEAttributes()
*/
public EAttribute[] getTableColumnEAttributes() {
- return new EAttribute[]{};
+ return new EAttribute[] {};
}
/*
@@ -135,6 +140,39 @@
*/
public boolean isHeaderVisible() {
return false;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.geronimo.ui.sections.DynamicTableSection#fillTableItems()
+ */
+ protected void fillTableItems() {
+ EList list = (EList) getPlan().eGet(getEReference());
+
+ for (int j = 0; j < list.size(); j++) {
+ TableItem item = new TableItem(table, SWT.NONE);
+ String[] tableTextData = getTableText((EObject) list.get(j));
+ item.setImage(getImage());
+ item.setText(tableTextData);
+ item.setData((EObject) list.get(j));
+ }
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.geronimo.ui.sections.DynamicTableSection#getTableText(org.eclipse.emf.ecore.EObject)
+ */
+ public String[] getTableText(EObject eObject) {
+ DependencyType dt = (DependencyType) eObject;
+ if (dt.eIsSet(DeploymentPackage.eINSTANCE.getDependencyType_Uri())) {
+ return new String[] { dt.getUri() };
+ } else {
+ return new String[] { dt.getGroupId() + "/" + dt.getArtifactId()
+ + "-" + dt.getVersion() + ".jar" };
+ }
}
}
Modified: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/wizards/DependencyWizard.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/wizards/DependencyWizard.java?rev=295092&r1=295091&r2=295092&view=diff
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/wizards/DependencyWizard.java (original)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/wizards/DependencyWizard.java Wed Oct 5 12:42:43 2005
@@ -17,6 +17,10 @@
import org.apache.geronimo.ui.internal.Messages;
import org.apache.geronimo.ui.sections.DynamicTableSection;
+import org.apache.geronimo.xml.ns.deployment.DependencyType;
+import org.apache.geronimo.xml.ns.deployment.DeploymentFactory;
+import org.apache.geronimo.xml.ns.deployment.DeploymentPackage;
+import org.eclipse.emf.common.util.EList;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
@@ -109,6 +113,25 @@
* @see org.eclipse.jface.wizard.IWizard#performFinish()
*/
public boolean performFinish() {
+ if (eObject == null) {
+ eObject = DeploymentFactory.eINSTANCE.createDependencyType();
+ ((EList) section.getPlan().eGet(section.getEReference())).add(eObject);
+ }
+
+ DependencyType dt = (DependencyType) eObject;
+
+ if (uriButton.getSelection()) {
+ dt.setUri(uriText.getText());
+ dt.eUnset(DeploymentPackage.eINSTANCE.getDependencyType_ArtifactId());
+ dt.eUnset(DeploymentPackage.eINSTANCE.getDependencyType_GroupId());
+ dt.eUnset(DeploymentPackage.eINSTANCE.getDependencyType_Version());
+ } else {
+ dt.setArtifactId(artifactIdText.getText());
+ dt.setGroupId(groupIdText.getText());
+ dt.setVersion(versionText.getText());
+ dt.eUnset(DeploymentPackage.eINSTANCE.getDependencyType_Uri());
+ }
+
return true;
}
@@ -178,7 +201,7 @@
groupIdLabel = new Label(group, SWT.LEFT);
groupIdLabel.setText(Messages.groupId);
- groupIdLabel.setLayoutData(labelData);
+ groupIdLabel.setLayoutData(labelData);
groupIdText = new Text(group, SWT.SINGLE | SWT.BORDER);
groupIdText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
@@ -197,19 +220,19 @@
versionText = new Text(group, SWT.SINGLE | SWT.BORDER);
versionText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
+
groupIdLabel.setEnabled(false);
groupIdText.setEnabled(false);
artifactIdLabel.setEnabled(false);
artifactIdText.setEnabled(false);
versionLabel.setEnabled(false);
- versionText.setEnabled(false);
+ versionText.setEnabled(false);
uriButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
if (uriButton.getSelection()) {
toggle();
- }
+ }
}
});