# HG changeset patch # User Ingo Weinzierl # Date 1323327080 0 # Node ID 25be27e33b77fa58a928d55e08fcdf606092fa2a # Parent d50c3262e63888c327e17d64e039eeeb8cca8c7c #421 Ask the user before removing themes from chart or map. flys-client/trunk@3364 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r d50c3262e638 -r 25be27e33b77 flys-client/ChangeLog --- a/flys-client/ChangeLog Tue Dec 06 09:08:48 2011 +0000 +++ b/flys-client/ChangeLog Thu Dec 08 06:51:20 2011 +0000 @@ -1,3 +1,18 @@ +2011-12-08 Ingo Weinzierl + + flys/issue421 (Diagramm: Löschen eines Thema ohne Rückfrage beim Nutzer) + + * src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties, + src/main/java/de/intevation/flys/client/client/FLYSConstants.properties, + src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties, + src/main/java/de/intevation/flys/client/client/FLYSConstants.java: Added + strings used when the user is asked if he is sure to remove selected + themes. + + * src/main/java/de/intevation/flys/client/client/ui/ThemePanel.java, + src/main/java/de/intevation/flys/client/client/ui/map/MapThemePanel.java: + Ask before removing themes. + 2011-12-06 Ingo Weinzierl * src/main/java/de/intevation/flys/client/client/ui/map/MapThemePanel.java: diff -r d50c3262e638 -r 25be27e33b77 flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java Tue Dec 06 09:08:48 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java Thu Dec 08 06:51:20 2011 +0000 @@ -104,6 +104,8 @@ String pan(); + String askThemeRemove(); + String fix(); String next(); diff -r d50c3262e638 -r 25be27e33b77 flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties --- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties Tue Dec 06 09:08:48 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties Thu Dec 08 06:51:20 2011 +0000 @@ -135,6 +135,7 @@ zoom_out = images/zoom-out.png zoom_back = images/zoom-back.png pan = images/pan.png +askThemeRemove = Are you sure that you want to remove the selected theme / themes? discharge_curve = Discharge Curves at Gauges computed_discharge_curve = Discharge Curve diff -r d50c3262e638 -r 25be27e33b77 flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties --- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties Tue Dec 06 09:08:48 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties Thu Dec 08 06:51:20 2011 +0000 @@ -135,6 +135,7 @@ zoom_out = images/zoom-out.png zoom_back = images/zoom-back.png pan = images/pan.png +askThemeRemove = Sind Sie sicher, dass sie die gew\u00e4hlten / das gew\u00e4lte Thema l\u00f6eschen wollen? discharge_curve = Abflusskurven an Pegeln computed_discharge_curve = Abflusskurve diff -r d50c3262e638 -r 25be27e33b77 flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties --- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties Tue Dec 06 09:08:48 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties Thu Dec 08 06:51:20 2011 +0000 @@ -135,6 +135,7 @@ zoom_out = images/zoom-out.png zoom_back = images/zoom-back.png pan = images/pan.png +askThemeRemove = Are you sure that you want to remove the selected theme / themes? discharge_curve = Discharge Curves at Gauges computed_discharge_curve = Discharge Curve diff -r d50c3262e638 -r 25be27e33b77 flys-client/src/main/java/de/intevation/flys/client/client/ui/ThemePanel.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/ThemePanel.java Tue Dec 06 09:08:48 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/ThemePanel.java Thu Dec 08 06:51:20 2011 +0000 @@ -7,6 +7,7 @@ import com.google.gwt.user.client.rpc.AsyncCallback; import com.smartgwt.client.util.SC; +import com.smartgwt.client.util.BooleanCallback; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.grid.ListGrid; import com.smartgwt.client.widgets.grid.ListGridRecord; @@ -397,15 +398,21 @@ remove.addClickHandler(new ClickHandler() { public void onClick(MenuItemClickEvent evt) { - for (ListGridRecord record: records) { - FacetRecord facet = (FacetRecord) record; + SC.ask(MSG.askThemeRemove(), new BooleanCallback() { + @Override + public void execute(Boolean value) { + if (value) { + for (ListGridRecord record: records) { + FacetRecord facet = (FacetRecord) record; + Theme theme = facet.getTheme(); + theme.setVisible(0); + theme.setActive(0); - Theme theme = facet.getTheme(); - theme.setVisible(0); - theme.setActive(0); - } - - updateCollection(); + updateCollection(); + } + } + } + }); } }); diff -r d50c3262e638 -r 25be27e33b77 flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapThemePanel.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapThemePanel.java Tue Dec 06 09:08:48 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapThemePanel.java Thu Dec 08 06:51:20 2011 +0000 @@ -2,6 +2,8 @@ import com.google.gwt.core.client.GWT; +import com.smartgwt.client.util.SC; +import com.smartgwt.client.util.BooleanCallback; import com.smartgwt.client.types.ImageStyle; import com.smartgwt.client.types.ListGridFieldType; import com.smartgwt.client.types.VerticalAlignment; @@ -259,18 +261,25 @@ item.addClickHandler(new ClickHandler() { @Override public void onClick(MenuItemClickEvent evt) { - for (ListGridRecord record: records) { - FacetRecord facet = (FacetRecord) record; + SC.ask(MSG.askThemeRemove(), new BooleanCallback() { + @Override + public void execute(Boolean value) { + if (value) { + for (ListGridRecord record: records) { + FacetRecord facet = (FacetRecord) record; - Theme theme = facet.getTheme(); - theme.setVisible(0); - theme.setActive(0); + Theme theme = facet.getTheme(); + theme.setVisible(0); + theme.setActive(0); - AttributedTheme at = (AttributedTheme) theme; - getMapOutputTab().removeLayer(at.getAttr("layers")); - } + AttributedTheme at = (AttributedTheme) theme; + getMapOutputTab().removeLayer(at.getAttr("layers")); + } - updateCollection(); + updateCollection(); + } + } + }); } });