Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Fluegge2010-09-05 17:49:00 +0000
committerMartin Fluegge2010-09-05 17:49:00 +0000
commitdb774de81f770c928e9ed8a430ea3d2fe9b16aa7 (patch)
tree9e45e9382d554459eb43c0712d1d9edd8e43c04b
parentae53ef3c0026b63eb4a95ea7dd08dfff7a9e7338 (diff)
downloadcdo-db774de81f770c928e9ed8a430ea3d2fe9b16aa7.tar.gz
cdo-db774de81f770c928e9ed8a430ea3d2fe9b16aa7.tar.xz
cdo-db774de81f770c928e9ed8a430ea3d2fe9b16aa7.zip
enhanced ElementWizard
-rw-r--r--plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/container/ElementWizard.java25
-rw-r--r--plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/container/ElementWizardComposite.java2
-rw-r--r--plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/container/IElementWizard.java7
3 files changed, 31 insertions, 3 deletions
diff --git a/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/container/ElementWizard.java b/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/container/ElementWizard.java
index d3ba7eed15..33f5f90f16 100644
--- a/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/container/ElementWizard.java
+++ b/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/container/ElementWizard.java
@@ -10,6 +10,7 @@
*/
package org.eclipse.net4j.util.ui.container;
+import org.eclipse.net4j.util.container.IManagedContainer;
import org.eclipse.net4j.util.ui.UIUtil;
import org.eclipse.net4j.util.ui.container.IElementWizard.ValidationContext;
@@ -26,6 +27,10 @@ import org.eclipse.swt.widgets.Text;
*/
public abstract class ElementWizard implements IElementWizard, ValidationContext
{
+ private IManagedContainer container;
+
+ private String productGroup;
+
private String factoryType;
private String defaultDescription;
@@ -38,6 +43,16 @@ public abstract class ElementWizard implements IElementWizard, ValidationContext
{
}
+ protected IManagedContainer getContainer()
+ {
+ return container;
+ }
+
+ protected String getProductGroup()
+ {
+ return productGroup;
+ }
+
protected String getFactoryType()
{
return factoryType;
@@ -53,8 +68,16 @@ public abstract class ElementWizard implements IElementWizard, ValidationContext
return resultDescription;
}
- public void create(Composite parent, String factoryType, String defaultDescription, ValidationContext context)
+ public Object getResultElement()
+ {
+ return container.getElement(productGroup, factoryType, resultDescription);
+ }
+
+ public void create(Composite parent, IManagedContainer container, String productGroup, String factoryType,
+ String defaultDescription, ValidationContext context)
{
+ this.container = container;
+ this.productGroup = productGroup;
this.factoryType = factoryType;
this.defaultDescription = defaultDescription;
this.context = context;
diff --git a/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/container/ElementWizardComposite.java b/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/container/ElementWizardComposite.java
index b4a95579ed..2d9ff62bfc 100644
--- a/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/container/ElementWizardComposite.java
+++ b/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/container/ElementWizardComposite.java
@@ -139,7 +139,7 @@ public abstract class ElementWizardComposite extends Composite
{
String factoryType = factoryTypes.get(i);
IElementWizard wizard = wizards.get(i);
- wizard.create(this, factoryType, null, validationContext);
+ wizard.create(this, getContainer(), productGroup, factoryType, null, validationContext);
harvestControls(wizard);
}
diff --git a/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/container/IElementWizard.java b/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/container/IElementWizard.java
index 921a76562c..c5263bb51c 100644
--- a/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/container/IElementWizard.java
+++ b/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/container/IElementWizard.java
@@ -10,6 +10,8 @@
*/
package org.eclipse.net4j.util.ui.container;
+import org.eclipse.net4j.util.container.IManagedContainer;
+
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
@@ -19,9 +21,12 @@ import org.eclipse.swt.widgets.Control;
*/
public interface IElementWizard
{
+ public void create(Composite parent, IManagedContainer container, String productGroup, String factoryType,
+ String defaultDescription, ValidationContext context);
+
public String getResultDescription();
- public void create(Composite parent, String factoryType, String defaultDescription, ValidationContext context);
+ public Object getResultElement();
/**
* @author Eike Stepper

Back to the top