changeset 1473:71ba43bd0e3f

Added convenient accessor. flys-client/trunk@3518 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Thu, 22 Dec 2011 08:53:15 +0000
parents a2b0b2af529f
children 0ba23e6fef0c
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/shared/model/ThemeList.java
diffstat 2 files changed, 21 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Thu Dec 22 07:17:52 2011 +0000
+++ b/flys-client/ChangeLog	Thu Dec 22 08:53:15 2011 +0000
@@ -1,3 +1,8 @@
+2011-12-22	Felix Wolfsteller	<felix.wolfsteller@intevation.de>
+
+	* src/main/java/de/intevation/flys/client/shared/model/ThemeList.java:
+	  (getTheme): New, search theme(s) with uuid.
+
 2011-12-22	Felix Wolfsteller	<felix.wolfsteller@intevation.de>
 
 	* src/main/java/de/intevation/flys/client/client/ui/chart/CrossSectionChartThemePanel.java:
--- a/flys-client/src/main/java/de/intevation/flys/client/shared/model/ThemeList.java	Thu Dec 22 07:17:52 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/shared/model/ThemeList.java	Thu Dec 22 08:53:15 2011 +0000
@@ -35,6 +35,22 @@
 
 
     /**
+     * Returns (first) theme of which the artifact has given uuid, null if none
+     * found.
+     * @param uuid Artifacts identifier for which to search theme.
+     * @return theme of which getArtifact() equals given uuid.
+    */
+    public Theme getTheme(String uuid) {
+        for (Theme theme: themes) {
+            if (theme.getArtifact().equals(uuid)) {
+                return theme;
+            }
+        }
+        return null;
+    }
+
+
+    /**
      * Returns a theme at a specific position. <b>NOTE: Themes start at position
      * 1. So, take care in loops, that might start at index 0!</b>
      *

http://dive4elements.wald.intevation.org