Mercurial > dive4elements > river
diff flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapThemePanel.java @ 1303:84c50f1d939b
Added the option for the MapThemePanel to listen to Theme move events.
flys-client/trunk@2936 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Tue, 11 Oct 2011 11:50:58 +0000 |
parents | e50da1f74e58 |
children | 8a93fb299e64 |
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapThemePanel.java Mon Oct 10 15:29:39 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapThemePanel.java Tue Oct 11 11:50:58 2011 +0000 @@ -24,11 +24,17 @@ } + public interface ThemeMovedCallback { + void onThemeMoved(Theme theme, int oldIdx, int newIdx); + } + + private FLYSConstants MSG = GWT.create(FLYSConstants.class); - protected ActivateCallback activateCallback; + protected ActivateCallback activateCallback; + protected ThemeMovedCallback themeMovedCallback; public static final String GRID_FIELD_ACTIVE = "active"; @@ -39,13 +45,24 @@ public MapThemePanel( - Collection collection, - OutputMode mode, - ActivateCallback activateCallback) - { + Collection collection, + OutputMode mode, + ActivateCallback activateCallback + ) { + this(collection, mode, activateCallback, null); + } + + + public MapThemePanel( + Collection collection, + OutputMode mode, + ActivateCallback activateCallback, + ThemeMovedCallback themeMovedCallback + ) { super(collection, mode); - this.activateCallback = activateCallback; + this.activateCallback = activateCallback; + this.themeMovedCallback = themeMovedCallback; initGrid(); initLayout(); @@ -100,5 +117,13 @@ theme.setActive(active ? 1 : 0); } + + + @Override + protected void fireThemeMoved(Theme theme, int oldIdx, int newIdx) { + if (themeMovedCallback != null) { + themeMovedCallback.onThemeMoved(theme, oldIdx, newIdx); + } + } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :