Mercurial > dive4elements > river
annotate flys-client/src/main/java/de/intevation/flys/client/shared/model/DefaultArtifact.java @ 5462:f2371f3aaf03
Show top level folder icons only if node has no factory
If you have an empty folder the folder icon is still shown.
This makes it possible to add functional "Top Level" entries
in the Datacage
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Tue, 26 Mar 2013 18:29:13 +0100 |
parents | 5b8919ef601d |
children |
rev | line source |
---|---|
10
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.client.shared.model; |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
2 |
870
d5fb88ba99d2
Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
3 import java.util.List; |
d5fb88ba99d2
Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
4 |
10
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
5 |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
6 /** |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
7 * The default implementation of an artifact that might be used in the client. |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
8 * |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
9 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
10 */ |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
11 public class DefaultArtifact implements Artifact { |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
12 |
855
2c48d75c4ab7
Minor cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
227
diff
changeset
|
13 /** The artifact's uuid. */ |
10
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
14 protected String uuid; |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
15 |
855
2c48d75c4ab7
Minor cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
227
diff
changeset
|
16 /** The artifacts hash value. */ |
10
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
17 protected String hash; |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
18 |
862
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
855
diff
changeset
|
19 /** Determines if the artifact is in background mode.*/ |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
855
diff
changeset
|
20 protected boolean inBackground; |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
855
diff
changeset
|
21 |
870
d5fb88ba99d2
Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
22 protected List<CalculationMessage> messages; |
d5fb88ba99d2
Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
23 |
855
2c48d75c4ab7
Minor cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
227
diff
changeset
|
24 /** The current artifact description. */ |
10
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
25 protected ArtifactDescription artifactDescription; |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
26 |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
27 /** |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
28 * This constructor should not be used to create new instances of this |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
29 * class. An empty artifact without uuid and hash will be the result of |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
30 * this constructor call. |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
31 */ |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
32 public DefaultArtifact() { |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
33 } |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
34 |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
35 |
862
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
855
diff
changeset
|
36 public DefaultArtifact(String uuid, String hash) { |
870
d5fb88ba99d2
Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
37 this(uuid, hash, false, null); |
862
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
855
diff
changeset
|
38 } |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
855
diff
changeset
|
39 |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
855
diff
changeset
|
40 |
10
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
41 /** |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
42 * This constructor creates a new artifact instance with a uuid and a hash. |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
43 * |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
44 * @param uuid The artifact's uuid. |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
45 * @param hash The artifact's hash. |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
46 */ |
870
d5fb88ba99d2
Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
47 public DefaultArtifact( |
d5fb88ba99d2
Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
48 String uuid, |
d5fb88ba99d2
Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
49 String hash, |
d5fb88ba99d2
Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
50 boolean inBackground, |
d5fb88ba99d2
Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
51 List<CalculationMessage> messages |
d5fb88ba99d2
Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
52 ) { |
862
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
855
diff
changeset
|
53 this.uuid = uuid; |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
855
diff
changeset
|
54 this.hash = hash; |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
855
diff
changeset
|
55 this.inBackground = inBackground; |
870
d5fb88ba99d2
Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
56 this.messages = messages; |
10
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
57 } |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
58 |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
59 |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
60 public String getUuid() { |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
61 return uuid; |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
62 } |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
63 |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
64 |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
65 public String getHash() { |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
66 return hash; |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
67 } |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
68 |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
69 |
227
7f7f6d2c4b2c
We can now distinuish between different artifact types based on its name in the DESCRIBE. The ArtifactCreator returns concrete instances of Artifacts now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
10
diff
changeset
|
70 public String getName() { |
7f7f6d2c4b2c
We can now distinuish between different artifact types based on its name in the DESCRIBE. The ArtifactCreator returns concrete instances of Artifacts now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
10
diff
changeset
|
71 return "default"; |
7f7f6d2c4b2c
We can now distinuish between different artifact types based on its name in the DESCRIBE. The ArtifactCreator returns concrete instances of Artifacts now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
10
diff
changeset
|
72 } |
7f7f6d2c4b2c
We can now distinuish between different artifact types based on its name in the DESCRIBE. The ArtifactCreator returns concrete instances of Artifacts now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
10
diff
changeset
|
73 |
7f7f6d2c4b2c
We can now distinuish between different artifact types based on its name in the DESCRIBE. The ArtifactCreator returns concrete instances of Artifacts now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
10
diff
changeset
|
74 |
862
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
855
diff
changeset
|
75 public boolean isInBackground() { |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
855
diff
changeset
|
76 return inBackground; |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
855
diff
changeset
|
77 } |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
855
diff
changeset
|
78 |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
855
diff
changeset
|
79 |
870
d5fb88ba99d2
Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
80 public List<CalculationMessage> getBackgroundMessages() { |
d5fb88ba99d2
Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
81 return messages; |
d5fb88ba99d2
Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
82 } |
d5fb88ba99d2
Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
83 |
d5fb88ba99d2
Display status message and progress information in the WSPLGEN loading panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
84 |
10
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
85 public ArtifactDescription getArtifactDescription() { |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
86 return artifactDescription; |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
87 } |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
88 |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
89 |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
90 public void setArtifactDescription(ArtifactDescription description) { |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
91 this.artifactDescription = description; |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
92 } |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
93 } |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
94 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |