[PATCH] no style warning for wms themes

Wald Commits scm-commit at wald.intevation.org
Wed Nov 7 10:22:59 CET 2018


# HG changeset patch
# User gernotbelger
# Date 1541582544 -3600
# Node ID cff7636035ce7cb7c8146a8ff7e493aa3efb40c4
# Parent  8cf2968dd4f9ea888ef392e8106e6b267cf1f959
no style warning for wms themes

diff -r 8cf2968dd4f9 -r cff7636035ce gwt-client/src/main/java/org/dive4elements/river/client/client/ui/ThemePanel.java
--- 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();


More information about the Dive4Elements-commits mailing list