Mercurial > dive4elements > river
diff flys-client/src/main/java/de/intevation/flys/client/client/ui/ThemePanel.java @ 1422:25be27e33b77
#421 Ask the user before removing themes from chart or map.
flys-client/trunk@3364 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Thu, 08 Dec 2011 06:51:20 +0000 |
parents | 78542ff1f562 |
children | bc06a671ef60 |
line wrap: on
line diff
--- 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(); + } + } + } + }); } });