1 26 package org.objectweb.util.explorer.core.menu.lib; 27 28 import org.objectweb.util.explorer.ExplorerUtils; 29 import org.objectweb.util.explorer.core.code.api.CodeDescription; 30 import org.objectweb.util.explorer.core.common.api.Description; 31 import org.objectweb.util.explorer.core.icon.api.IconDescription; 32 import org.objectweb.util.explorer.core.menu.api.AcceleratorDescription; 33 import org.objectweb.util.explorer.core.menu.api.ItemDescription; 34 import org.objectweb.util.explorer.core.menu.api.MnemonicDescription; 35 36 44 public class BasicItemDescription 45 implements ItemDescription 46 { 47 48 54 protected String label_; 55 protected boolean treeChildVisible_ = false; 56 protected boolean typeChildVisible_ = true; 57 protected CodeDescription codeDesc_; 58 protected IconDescription iconDesc_; 59 protected AcceleratorDescription acceleratorDesc_; 60 protected MnemonicDescription mnemonicDesc_; 61 62 68 74 78 protected boolean equals(BasicItemDescription itemDesc){ 79 return ExplorerUtils.compareObjects(label_, itemDesc.label_) 80 && ExplorerUtils.compareObjects(codeDesc_, itemDesc.codeDesc_); 81 } 82 83 89 92 public String getDescriptionType() { 93 return Description.ITEM_DESCRIPTION; 94 } 95 96 97 100 public boolean isEmpty() { 101 return label_==null || label_.equals("") || codeDesc_==null || codeDesc_.isEmpty(); 102 } 103 104 110 113 public void setLabel(String label) { 114 label_ = label; 115 } 116 117 120 public String getLabel() { 121 return label_; 122 } 123 124 127 public void setTreeChildVisible(boolean treeChildVisible) { 128 treeChildVisible_ = treeChildVisible; 129 } 130 131 134 public boolean getTreeChildVisible() { 135 return treeChildVisible_; 136 } 137 138 141 public void setTypeChildVisible(boolean typeChildVisible) { 142 typeChildVisible_ = typeChildVisible; 143 } 144 145 148 public boolean getTypeChildVisible() { 149 return typeChildVisible_; 150 } 151 152 155 public void setCodeDescription(CodeDescription codeDescription) { 156 codeDesc_ = codeDescription; 157 } 158 159 162 public CodeDescription getCodeDescription() { 163 return codeDesc_; 164 } 165 166 169 public void setIconDescription(IconDescription iconDescription) { 170 iconDesc_ = iconDescription; 171 } 172 173 176 public IconDescription getIconDescription() { 177 return iconDesc_; 178 } 179 180 183 public void setAcceleratorDescription(AcceleratorDescription acceleratorDescription) { 184 acceleratorDesc_ = acceleratorDescription; 185 } 186 187 190 public AcceleratorDescription getAcceleratorDescription() { 191 return acceleratorDesc_; 192 } 193 194 197 public void setMnemonicDescription(MnemonicDescription mnemonicDescription) { 198 mnemonicDesc_ = mnemonicDescription; 199 } 200 201 204 public MnemonicDescription getMnemonicDescription() { 205 return mnemonicDesc_; 206 } 207 208 214 218 public boolean equals(Object o){ 219 if(o!=null && o instanceof BasicItemDescription) 220 return equals((BasicItemDescription)o); 221 return false; 222 } 223 224 227 public String toString(){ 228 return "BasicItemDescription[" + 229 "label=" + ExplorerUtils.toString(label_) + 230 ", treeChildVisible=" + treeChildVisible_ + 231 ", typeChildVisible=" + typeChildVisible_ + 232 ", codeDesc=" + ExplorerUtils.toString(codeDesc_) + 233 ", iconDesc=" + ExplorerUtils.toString(iconDesc_) + 234 ", acceleratorDesc=" + ExplorerUtils.toString(acceleratorDesc_) + 235 ", mnemonicDesc=" + ExplorerUtils.toString(mnemonicDesc_) + 236 "]"; 237 } 238 239 } 240 241 242 | Popular Tags |