1 26 package org.objectweb.util.explorer.core.dnd.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.dnd.api.DnDDescription; 32 33 41 public class BasicDnDDescription 42 implements DnDDescription 43 { 44 45 51 52 protected String actionType_; 53 54 55 protected String label_; 56 57 58 protected CodeDescription codeDesc_; 59 60 66 72 76 protected boolean equals(BasicDnDDescription dndDesc){ 77 return ExplorerUtils.compareObjects(label_, dndDesc.label_) 78 && ExplorerUtils.compareObjects(codeDesc_, dndDesc.codeDesc_); 79 } 80 81 87 90 public String getDescriptionType() { 91 return Description.DND_DESCRIPTION; 92 } 93 94 97 public boolean isEmpty() { 98 return label_==null || label_.equals("") || codeDesc_==null || codeDesc_.isEmpty(); 99 } 100 101 107 110 public void setType(String actionType) { 111 actionType_ = actionType; 112 } 113 114 117 public String getType() { 118 return actionType_; 119 } 120 121 124 public void setLabel(String label) { 125 label_ = label; 126 } 127 128 131 public String getLabel() { 132 return label_; 133 } 134 135 138 public void setCodeDescription(CodeDescription codeDesc) { 139 codeDesc_ = codeDesc; 140 } 141 142 145 public CodeDescription getCodeDescription() { 146 return codeDesc_; 147 } 148 149 155 159 public boolean equals(Object o){ 160 if(o!=null && o instanceof BasicDnDDescription) 161 return equals((BasicDnDDescription)o); 162 return false; 163 } 164 165 168 public String toString(){ 169 return "BasicDnDDescription[" + 170 "type=" + actionType_ + 171 ", label=" + ExplorerUtils.toString(label_) + 172 ", codeDesc=" + ExplorerUtils.toString(codeDesc_) + 173 "]"; 174 } 175 176 } 177 | Popular Tags |