comparison flys-client/src/main/java/de/intevation/flys/client/shared/model/CollectionItemAttribute.java @ 1285:0f3b19df1880

Added new service and model for collection item attributes. flys-client/trunk@2871 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Raimund Renkert <raimund.renkert@intevation.de>
date Fri, 30 Sep 2011 10:57:56 +0000
parents
children bdc270ea6195
comparison
equal deleted inserted replaced
1284:cdb1505a32f1 1285:0f3b19df1880
1 package de.intevation.flys.client.shared.model;
2
3 import java.io.Serializable;
4
5 import java.util.List;
6 import java.util.ArrayList;
7
8
9 /**
10 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a>
11 */
12 public class CollectionItemAttribute implements Serializable {
13
14 protected List<Style> styles;
15
16 public CollectionItemAttribute() {
17 styles = new ArrayList<Style>();
18 }
19
20 public void appendStyle (Style style) {
21 this.styles.add(style);
22 }
23
24 public void removeStyle (String name) {
25 for (int i = 0; i < styles.size(); i++) {
26 if (styles.get(i).getName().equals(name)) {
27 styles.remove(i);
28 }
29 }
30 }
31
32 public Style getStyle(String name) {
33 for (int i = 0; i < styles.size(); i++) {
34 if (styles.get(i).getName().equals(name)) {
35 return styles.get(i);
36 }
37 }
38 return null;
39 }
40
41 public Style getStyle(int i) {
42 return styles.get(i);
43 }
44
45 public int getNumStyles() {
46 return styles.size();
47 }
48 }

http://dive4elements.wald.intevation.org