1 23 24 package org.enhydra.kelp.forte.node; 25 26 import org.enhydra.tool.common.PathHandle; 28 29 import org.enhydra.kelp.common.Constants; 31 import org.enhydra.kelp.common.PropUtil; 32 import org.enhydra.kelp.common.node.OtterProject; 33 import org.enhydra.kelp.common.node.OtterNode; 34 import org.enhydra.kelp.common.node.OtterDocumentNode; 35 import org.enhydra.kelp.common.node.PropertyKeys; 36 37 import org.openide.nodes.Node; 39 40 import java.io.IOException ; 42 43 50 public class ForteDocumentNode extends ForteNode implements OtterDocumentNode { 51 52 public ForteDocumentNode(XMLCDataObject n) { 57 super(n); 58 } 59 60 67 public ForteDocumentNode(OtterNode otterNode, String path) { 68 super(otterNode, path); 69 } 70 71 public boolean isSelected() 72 { 73 String in = getProperty(NAME_SELECTED); 74 return PropUtil.stringToBoolean(in, false); 75 } 76 77 public void setSelected(boolean b) { 78 setProperty(NAME_SELECTED, PropUtil.booleanToString(b)); 79 if (b) { 80 setStatic(false); 81 } 82 } 83 84 public boolean isStatic() { 85 String in = getProperty(NAME_RESOURCE_STATIC); 86 87 return PropUtil.stringToBoolean(in, false); 88 } 89 90 public void setStatic(boolean b) { 91 setProperty(NAME_RESOURCE_STATIC, 92 PropUtil.booleanToString(b)); 93 if (b) { 94 setSelected(false); 95 } 96 } 97 98 public void preCompile() { 99 100 113 } 114 115 public String getProperty(String property) 116 { 117 String out = ""; 118 119 if (nativeNode != null) { 120 out = ((XMLCDataObject)nativeNode).getProperty(property); 121 } 122 123 return out; 124 } 125 126 133 public void setProperty(String property, String value) 134 { 135 if (nativeNode != null) { 136 ((XMLCDataObject)nativeNode).setProperty(property, value); 137 } 138 } 139 140 public String getXMLCOptionFilePath() 141 { 142 return getProperty(NAME_XMLC_OPTION_FILEPATH); 143 } 144 145 public void setXMLCOptionFilePath(String in) 146 { 147 setProperty(NAME_XMLC_OPTION_FILEPATH, in); } 148 149 public String getXMLCParameters() 150 { 151 return getProperty(NAME_XMLC_PARAMETERS); 152 } 153 154 public void setXMLCParameters(String in) 155 { 156 setProperty(NAME_XMLC_PARAMETERS, in); 157 } 158 } 159 | Popular Tags |