# HG changeset patch # User Ingo Weinzierl # Date 1297934257 0 # Node ID 8d9075c07667c778f7ec866a5a0ead3b10b42039 # Parent fa0aad20af53de08bb6dbff76609ad2b95248179 Enhanced the CollectionView: there are radio buttons for each module and a button to select one of those. flys-client/trunk@1322 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r fa0aad20af53 -r 8d9075c07667 flys-client/ChangeLog --- a/flys-client/ChangeLog Thu Feb 17 08:31:33 2011 +0000 +++ b/flys-client/ChangeLog Thu Feb 17 09:17:37 2011 +0000 @@ -1,3 +1,18 @@ +2011-02-16 Ingo Weinzierl + + * src/main/java/de/intevation/flys/client/client/ui/CollectionView.java: + This view will now display radio buttons to choose between the module + 'WINFO', 'MINFO', 'Map' and 'Fix-Analyse'. A button is shown to create an + artifact of the selected module. + + NOTE: The next step here is to use the returning artifact with its + description and display widgets based on these information. + + * src/main/java/de/intevation/flys/client/client/FLYSMessages_en.properties, + src/main/java/de/intevation/flys/client/client/FLYSMessages_de.properties, + src/main/java/de/intevation/flys/client/client/FLYSMessages.java: Added + i18n strings for the CollectionView's 'next' button. + 2011-02-16 Ingo Weinzierl * src/main/java/de/intevation/flys/client/shared/model/ArtifactDescription.java, diff -r fa0aad20af53 -r 8d9075c07667 flys-client/src/main/java/de/intevation/flys/client/client/FLYSMessages.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSMessages.java Thu Feb 17 08:31:33 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSMessages.java Thu Feb 17 09:17:37 2011 +0000 @@ -43,5 +43,8 @@ @DefaultMessage("TODO FIX ANALYSE TODO") String fix(); + + @DefaultMessage("Next") + String next(); } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : diff -r fa0aad20af53 -r 8d9075c07667 flys-client/src/main/java/de/intevation/flys/client/client/FLYSMessages_de.properties --- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSMessages_de.properties Thu Feb 17 08:31:33 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSMessages_de.properties Thu Feb 17 09:17:37 2011 +0000 @@ -10,3 +10,4 @@ minfo = MINFO map = Karte fix = Fixierungsanalyse +next = Weiter diff -r fa0aad20af53 -r 8d9075c07667 flys-client/src/main/java/de/intevation/flys/client/client/FLYSMessages_en.properties --- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSMessages_en.properties Thu Feb 17 08:31:33 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSMessages_en.properties Thu Feb 17 09:17:37 2011 +0000 @@ -10,3 +10,4 @@ minfo = MINFO map = Map fix = TODO FIX ANALYSE TODO +next = Next diff -r fa0aad20af53 -r 8d9075c07667 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 Thu Feb 17 08:31:33 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java Thu Feb 17 09:17:37 2011 +0000 @@ -2,20 +2,25 @@ import com.google.gwt.core.client.GWT; import com.google.gwt.i18n.client.DateTimeFormat; -import com.google.gwt.user.client.ui.RadioButton; +import com.google.gwt.user.client.rpc.AsyncCallback; import com.smartgwt.client.widgets.Canvas; +import com.smartgwt.client.widgets.IButton; import com.smartgwt.client.widgets.Window; +import com.smartgwt.client.widgets.events.ClickEvent; +import com.smartgwt.client.widgets.events.ClickHandler; import com.smartgwt.client.widgets.form.DynamicForm; import com.smartgwt.client.widgets.form.fields.RadioGroupItem; -import com.smartgwt.client.widgets.layout.HLayout; import com.smartgwt.client.widgets.layout.VLayout; import com.smartgwt.client.widgets.tab.Tab; -import com.smartgwt.client.widgets.tab.TabSet; +import de.intevation.flys.client.shared.model.Artifact; import de.intevation.flys.client.shared.model.Collection; +import de.intevation.flys.client.client.FLYS; import de.intevation.flys.client.client.FLYSMessages; +import de.intevation.flys.client.client.services.ArtifactService; +import de.intevation.flys.client.client.services.ArtifactServiceAsync; /** @@ -23,12 +28,23 @@ */ public class CollectionView extends Window { + /** The ArtifactService used to communicate with the Artifact server. */ + protected ArtifactServiceAsync artifactService = + GWT.create(ArtifactService.class); + /** The message class that provides i18n strings.*/ FLYSMessages messages = GWT.create(FLYSMessages.class); + /** The FLYS instance used to call services.*/ + protected FLYS flys; + /** The collection to be displayed.*/ protected Collection collection; + /** TODO The artifact needs to be removed here after the Collection stuff in + * the server has been finished! */ + protected Artifact artifact; + /** The parameter tab.*/ protected Tab parameterTab; @@ -42,7 +58,8 @@ * * @param collection The collection to be displayed. */ - public CollectionView(Collection collection) { + public CollectionView(FLYS flys, Collection collection) { + this.flys = flys; this.collection = collection; init(); @@ -88,7 +105,7 @@ * @return a Canvas that displays the plugins of FLYS. */ protected Canvas renderNew() { - HLayout layout = new HLayout(); + VLayout layout = new VLayout(); layout.setWidth100(); DynamicForm form = new DynamicForm(); @@ -104,9 +121,45 @@ form.setFields(radio); + IButton go = new IButton(messages.next()); + go.addClickHandler(new ClickHandler() { + public void onClick(ClickEvent event) { + artifactService.create("winfo", new AsyncCallback() { + public void onFailure(Throwable caught) { + GWT.log("Could not create the new artifact."); + GWT.log(caught.getMessage()); + } + + public void onSuccess(Artifact artifact) { + GWT.log("Successfully created a new artifact."); + setArtifact(artifact); + } + }); + } + }); + layout.addMember(form); + layout.addMember(go); return layout; } + + + /** + * Set the current artifact. + * + * @param artifact The new artifact. + */ + protected void setArtifact(Artifact artifact) { + this.artifact = artifact; + + updateView(); + } + + + protected void updateView() { + GWT.log("Update the view of the artifact: " + artifact.getUuid()); + // TODO display the artifact information / data + } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :