1 18 package org.apache.beehive.netui.tags.tree; 19 20 23 public class TreeHtmlAttributeInfo implements java.io.Serializable 24 { 25 public static final int HTML_LOCATION_DIV = 0; 26 public static final int HTML_LOCATION_ICON = 1; 27 public static final int HTML_LOCATION_SELECTION_LINK = 2; 28 public static final int HTML_LOCATION_CNT = 3; 29 30 private static final int APPLY_TO_DESCENDENTS = 0x01; 31 private static final int ON_ICON = 0x02; 32 private static final int ON_SELECTION_LINK = 0x04; 33 private static final int ON_DIV = 0x08; 34 35 private String _attribute; 36 private String _value; 37 private int state; 38 private TreeElement _parent; 39 40 43 public TreeHtmlAttributeInfo() 44 { 45 } 46 47 52 public TreeHtmlAttributeInfo( String attribute, String value ) 53 { 54 setAttribute(attribute); 55 setValue(value); 56 } 57 58 62 public String getAttribute() 63 { 64 return _attribute; 65 } 66 67 71 public void setAttribute(String attribute) 72 { 73 _attribute = attribute; 74 } 75 76 80 public String getValue() 81 { 82 return _value; 83 } 84 85 89 public void setValue(String value) 90 { 91 _value = value; 92 } 93 94 99 public TreeElement getParent() 100 { 101 return _parent; 102 } 103 104 109 public void setParent(TreeElement parent) 110 { 111 _parent = parent; 112 } 113 114 118 public boolean isApplyToDescendents() 119 { 120 return ((state & APPLY_TO_DESCENDENTS) != 0); 121 } 122 123 127 public void setApplyToDescendents(boolean applyToDescendents) 128 { 129 if (applyToDescendents) 130 state = state | APPLY_TO_DESCENDENTS; 131 else 132 state = state & (-1 ^ APPLY_TO_DESCENDENTS); 133 134 } 135 136 140 public boolean isOnDiv() 141 { 142 return ((state & ON_DIV) != 0); 143 } 144 145 149 public void setOnDiv(boolean onDiv) 150 { 151 if (onDiv) 152 state = state | ON_DIV; 153 else 154 state = state & (-1 ^ ON_DIV); 155 156 } 157 158 162 public boolean isOnIcon() 163 { 164 return ((state & ON_ICON) != 0); 165 } 166 167 171 public void setOnIcon(boolean onIcon) 172 { 173 if (onIcon) 174 state = state | ON_ICON; 175 else 176 state = state & (-1 ^ ON_ICON); 177 178 } 179 180 184 public boolean isOnSelectionLink() 185 { 186 return ((state & ON_SELECTION_LINK) != 0); 187 } 188 189 193 public void setOnSelectionLink(boolean onSelectionLink) 194 { 195 if (onSelectionLink) 196 state = state | ON_SELECTION_LINK; 197 else 198 state = state & (-1 ^ ON_SELECTION_LINK); 199 } 200 } 201 | Popular Tags |