1 31 32 package org.opencms.workplace.explorer; 33 34 45 public class CmsExplorerContextMenuItem implements Comparable { 46 47 48 public static final String TYPE_ENTRY = "entry"; 49 50 51 public static final String TYPE_SEPARATOR = "separator"; 52 53 private String m_key; 54 private Integer m_order; 55 private String m_rules; 56 private String m_target; 57 private String m_type; 58 private String m_uri; 59 60 69 public CmsExplorerContextMenuItem( 70 String type, 71 String key, 72 String uri, 73 String rules, 74 String target, 75 Integer order) { 76 77 m_type = type; 78 m_key = key; 79 m_uri = uri; 80 m_rules = rules; 81 m_order = order; 82 m_target = target; 83 } 84 85 88 public Object clone() { 89 90 return new CmsExplorerContextMenuItem(m_type, m_key, m_uri, m_rules, m_target, m_order); 91 } 92 93 96 public int compareTo(Object obj) { 97 98 if (obj == this) { 99 return 0; 100 } 101 if (obj instanceof CmsExplorerContextMenuItem) { 102 return m_order.compareTo(((CmsExplorerContextMenuItem)obj).m_order); 103 } 104 return 0; 105 } 106 107 110 public boolean equals(Object obj) { 111 112 if (obj == this) { 113 return true; 114 } 115 if (obj instanceof CmsExplorerContextMenuItem) { 116 return ((CmsExplorerContextMenuItem)obj).m_uri.equals(m_uri); 117 } 118 return false; 119 } 120 121 126 public String getKey() { 127 128 return m_key; 129 } 130 131 136 public Integer getOrder() { 137 138 return m_order; 139 } 140 141 146 public String getRules() { 147 148 return m_rules; 149 } 150 151 156 public String getTarget() { 157 158 return m_target; 159 } 160 161 166 public String getType() { 167 168 return m_type; 169 } 170 171 176 public String getUri() { 177 178 return m_uri; 179 } 180 181 184 public int hashCode() { 185 186 return getUri().hashCode(); 187 } 188 189 194 public void setKey(String key) { 195 196 m_key = key; 197 } 198 199 204 public void setOrder(Integer order) { 205 206 m_order = order; 207 } 208 209 214 public void setRules(String rules) { 215 216 m_rules = rules; 217 } 218 219 224 public void setTarget(String target) { 225 226 m_target = target; 227 } 228 229 234 public void setType(String type) { 235 236 m_type = type; 237 } 238 239 244 public void setUri(String uri) { 245 246 m_uri = uri; 247 } 248 } | Popular Tags |