# HG changeset patch # User Ingo Weinzierl # Date 1300386005 0 # Node ID 1d0be51ab93b3291e42be95bd23cea50ca94b995 # Parent a2923d63f530d65a5e919691b6d1b4b1854f0471 The DataList has a label now. flys-client/trunk@1508 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r a2923d63f530 -r 1d0be51ab93b flys-client/ChangeLog --- a/flys-client/ChangeLog Thu Mar 17 16:44:51 2011 +0000 +++ b/flys-client/ChangeLog Thu Mar 17 18:20:05 2011 +0000 @@ -1,3 +1,12 @@ +2011-03-17 Ingo Weinzierl + + * src/main/java/de/intevation/flys/client/shared/model/DataList.java: + Added a constructor to create a DataList with a label. + + * src/main/java/de/intevation/flys/client/server/ArtifactDescriptionFactory.java: + Read the label of the static state data objects and create the DataList + objects with this attribute. + 2011-03-17 Ingo Weinzierl * src/main/java/de/intevation/flys/client/shared/model/DataList.java: This diff -r a2923d63f530 -r 1d0be51ab93b flys-client/src/main/java/de/intevation/flys/client/server/ArtifactDescriptionFactory.java --- a/flys-client/src/main/java/de/intevation/flys/client/server/ArtifactDescriptionFactory.java Thu Mar 17 16:44:51 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/server/ArtifactDescriptionFactory.java Thu Mar 17 18:20:05 2011 +0000 @@ -177,6 +177,10 @@ String name = XMLUtils.xpathString( tmp, "@art:name", ArtifactNamespaceContext.INSTANCE); + String uiprovider = XMLUtils.xpathString( + tmp, "@art:uiprovider", ArtifactNamespaceContext.INSTANCE); + String label = XMLUtils.xpathString( + tmp, "@art:label", ArtifactNamespaceContext.INSTANCE); NodeList dataNodes = (NodeList) XMLUtils.xpath( tmp, @@ -189,7 +193,7 @@ } int size = dataNodes.getLength(); - DataList list = new DataList(name, size); + DataList list = new DataList(name, size, uiprovider, label); for (int j = 0; j < size; j++) { Node dataNode = dataNodes.item(j); diff -r a2923d63f530 -r 1d0be51ab93b flys-client/src/main/java/de/intevation/flys/client/shared/model/DataList.java --- a/flys-client/src/main/java/de/intevation/flys/client/shared/model/DataList.java Thu Mar 17 16:44:51 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/shared/model/DataList.java Thu Mar 17 18:20:05 2011 +0000 @@ -31,6 +31,12 @@ } + /** + * Constructor. + * + * @param state The name of the state that this list belongs to. + * @param size The initial size of the list. + */ public DataList(String state, int size) { this.state = state; this.data = new ArrayList(size); @@ -41,7 +47,9 @@ * A constructor that creates a new DataList without Data objects and no * UIProvider. Size defines the initial size of the list. * + * @param state The name of the state that this list belongs to. * @param size The initial size of the list. + * @param uiprovider The UIProvider that should be used to render this list. */ public DataList(String state, int size, String uiprovider) { this(state, size); @@ -50,6 +58,21 @@ /** + * A constructor that creates a new DataList without Data objects and no + * UIProvider. Size defines the initial size of the list. + * + * @param state The name of the state that this list belongs to. + * @param size The initial size of the list. + * @param uiprovider The UIProvider that should be used to render this list. + * @param label The label. + */ + public DataList(String state, int size, String uiprovider, String label) { + this(state, size, uiprovider); + this.label = label; + } + + + /** * Adds a new Data object to the list. * * @param obj The Data object. @@ -92,6 +115,15 @@ /** + * Returns the whole list of Data objects. + * + * @return the whole list of Data objects. + */ + public List getAll() { + return data; + } + + /** * Returns the number of Data objects in the list. * * @param the number of Data objects in the list.