# HG changeset patch # User Ingo Weinzierl # Date 1302605699 0 # Node ID a4a68b4ee2a3d49b60c5441c183f0faa95e90518 # Parent 964abeb767717f1a8cd844255ac507808a3134de Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization). flys-client/trunk@1669 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 964abeb76771 -r a4a68b4ee2a3 flys-client/ChangeLog --- 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 + + * 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 * src/main/java/de/intevation/flys/client/client/FLYSConstants.properties, diff -r 964abeb76771 -r a4a68b4ee2a3 flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java --- 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(); + this.handlers = new ArrayList(); + 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. */ diff -r 964abeb76771 -r a4a68b4ee2a3 flys-client/src/main/java/de/intevation/flys/client/client/ui/ParameterList.java --- 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(); + old = new ArrayList(); + 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); }