changeset 9575:cff7636035ce

no style warning for wms themes
author gernotbelger
date Wed, 07 Nov 2018 10:22:24 +0100
parents 8cf2968dd4f9
children c5c53e52f190
files gwt-client/src/main/java/org/dive4elements/river/client/client/ui/ThemePanel.java
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/ThemePanel.java	Tue Nov 06 13:19:54 2018 +0100
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/ThemePanel.java	Wed Nov 07 10:22:24 2018 +0100
@@ -30,6 +30,7 @@
 import org.dive4elements.river.client.shared.model.CollectionItemAttribute;
 import org.dive4elements.river.client.shared.model.FacetRecord;
 import org.dive4elements.river.client.shared.model.OutputMode;
+import org.dive4elements.river.client.shared.model.Style;
 import org.dive4elements.river.client.shared.model.Theme;
 import org.dive4elements.river.client.shared.model.ThemeList;
 
@@ -633,6 +634,14 @@
     }
 
     protected void showStyleEditor(final CollectionItemAttribute cia, final FacetRecord record) {
+
+        final Theme theme = record.getTheme();
+        final Style style = cia.getStyle(theme.getFacet(), theme.getIndex());
+        if (style == null) {
+            SC.warn(this.MSG.error_no_theme_styles_found());
+            return;
+        }
+
         final StyleEditorWindow win = new StyleEditorWindow(getCollection(), cia, record);
         win.setThemePanel(this);
         win.centerInPage();

http://dive4elements.wald.intevation.org