01: package org.enhydra.kelp.ant.node;
02:
03: //Kelp imports
04: import org.enhydra.kelp.common.node.OtterDocumentNode;
05: import org.enhydra.kelp.common.node.OtterNode;
06: import org.enhydra.kelp.common.PropUtil;
07:
08: // Enhydra imports
09: import org.enhydra.xml.xmlc.XMLCException;
10:
11: // Standard imports
12: import java.io.IOException;
13:
14: /**
15: * <p>Title: </p>
16: * <p>Description: </p>
17: * <p>Copyright: Copyright (c) 2003</p>
18: * <p>Company: </p>
19: * @author Damir Milovic
20: * @version 1.0
21: */
22:
23: public class AntDocumentNode extends AntFileNode implements
24: OtterDocumentNode {
25:
26: protected String staticFile = "false";
27:
28: public AntDocumentNode(OtterNode n) {
29: super (n);
30: }
31:
32: public AntDocumentNode(OtterNode node, String filePath) {
33: super (node, filePath);
34: }
35:
36: // Implements OtterDocumentNode --------------------------------------------
37: /**
38: * Override setSelected() from AntFileNode
39: * @param b
40: */
41: public void setSelected(boolean b) {
42: super .setSelected(b);
43: if (b) {
44: setStatic(false);
45: }
46:
47: }
48:
49: public boolean isStatic() {
50: String in = staticFile; // See FIXME above definition of staticFile
51: return PropUtil.stringToBoolean(in, false);
52: }
53:
54: public void setStatic(boolean b) {
55: staticFile = PropUtil.booleanToString(b); //if not selected for XMLC, then it is static resource
56: if (b) {
57: setSelected(false);
58: }
59: }
60:
61: public void preCompile() throws XMLCException, IOException {
62: //We don't need this method becouse Ant is used for compilation
63: throw new java.lang.UnsupportedOperationException(
64: "Method preCompile() not implemented.");
65: }
66: }
|