changeset 224:a4a68b4ee2a3

Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization). flys-client/trunk@1669 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 12 Apr 2011 10:54:59 +0000
parents 964abeb76771
children 9040663aee01
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java flys-client/src/main/java/de/intevation/flys/client/client/ui/ParameterList.java
diffstat 3 files changed, 62 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Tue Apr 12 10:51:39 2011 +0000
+++ b/flys-client/ChangeLog	Tue Apr 12 10:54:59 2011 +0000
@@ -1,3 +1,10 @@
+2011-04-12  Ingo Weinzierl <ingo@intevation.de>
+
+	* src/main/java/de/intevation/flys/client/client/ui/ParameterList.java,
+	  src/main/java/de/intevation/flys/client/client/ui/CollectionView.java:
+	  Added new constructors that enables us to create instances with an
+	  existing parameterization (with a given artifact).
+
 2011-04-12  Ingo Weinzierl <ingo@intevation.de>
 
 	* src/main/java/de/intevation/flys/client/client/FLYSConstants.properties,
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java	Tue Apr 12 10:51:39 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java	Tue Apr 12 10:54:59 2011 +0000
@@ -102,12 +102,34 @@
         addCollectionChangeHandler(this);
 
         parameterList.addParameterChangeHandler(this);
-        parameterList.addParameterChangeHandler(parameterList);
 
         init();
     }
 
 
+    public CollectionView(FLYS flys, Collection collection, Artifact artifact) {
+        this.flys          = flys;
+        this.tabs          = new TabSet();
+        this.outputTabs    = new HashMap<String, OutputTab>();
+        this.handlers      = new ArrayList<CollectionChangeHandler>();
+        this.layout        = new VLayout();
+        this.parameterList = new ParameterList(
+            flys,
+            this,
+            messages.new_project(),
+            artifact);
+
+        addCollectionChangeHandler(this);
+
+        parameterList.addParameterChangeHandler(this);
+
+        init();
+
+        setCollection(collection);
+        setArtifact(artifact);
+    }
+
+
     /**
      * This method handles the initial layout stuff.
      */
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/ParameterList.java	Tue Apr 12 10:51:39 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/ParameterList.java	Tue Apr 12 10:54:59 2011 +0000
@@ -91,10 +91,37 @@
         oldItems          = new VLayout();
         currentItems      = new VLayout();
 
+        addParameterChangeHandler(this);
+
         init();
     }
 
 
+    public ParameterList(
+        FLYS           flys,
+        CollectionView cView,
+        String         title,
+        Artifact       artifact)
+    {
+        super(title);
+
+        this.cView    = cView;
+        this.flys     = flys;
+        this.artifact = artifact;
+
+        parameterHandlers = new ArrayList<ParameterChangeHandler>();
+        old               = new ArrayList<DataList>();
+        oldItems          = new VLayout();
+        currentItems      = new VLayout();
+
+        init();
+
+        addParameterChangeHandler(this);
+
+        setArtifact(artifact);
+    }
+
+
     protected void init() {
         HLayout rootLayout = new HLayout();
         rootLayout.setMembersMargin(20);
@@ -120,9 +147,11 @@
         rootLayout.addMember(left);
         rootLayout.addMember(helperPanel);
 
-        Canvas moduleSelection = renderNew();
-        moduleSelection.setLayoutAlign(VerticalAlignment.TOP);
-        currentItems.addMember(moduleSelection);
+        if (artifact == null) {
+            Canvas moduleSelection = renderNew();
+            moduleSelection.setLayoutAlign(VerticalAlignment.TOP);
+            currentItems.addMember(moduleSelection);
+        }
 
         setPane(rootLayout);
     }

http://dive4elements.wald.intevation.org