1 package de.matthias_burbach.mosaique.swing;
2
3 import de.matthias_burbach.mosaique.core.model.AbstractFileItem;
4
5 /***
6 * @author Matthias Burbach
7 */
8 public abstract class AbstractFileItemNode extends BaseMutableTreeNode {
9
10 /***
11 * @return The file item being displayed by this node.
12 */
13 public abstract AbstractFileItem getFileItem();
14
15
16
17
18
19 /***
20 * @return <code>true</code> if this node's file item has errors.
21 */
22 public boolean isErroneous() {
23 assertChildrenAreInitialized();
24 boolean result = false;
25 AbstractFileItem fileItem = getFileItem();
26 if (fileItem != null) {
27 result = fileItem.isErroneous();
28 }
29 return result;
30 }
31
32 /***
33 * @return The message of this node's file item.
34 */
35 public String getMessage() {
36 assertChildrenAreInitialized();
37 String result = null;
38 AbstractFileItem fileItem = getFileItem();
39 if (fileItem != null) {
40 result = fileItem.getMessage();
41 }
42 return result;
43 }
44 }