1 11 package org.eclipse.debug.core; 12 13 14 import java.util.EventObject ; 15 16 import org.eclipse.debug.internal.core.DebugCoreMessages; 17 18 143 public final class DebugEvent extends EventObject { 144 145 148 private static final long serialVersionUID = 1L; 149 150 153 public static final int RESUME= 0x0001; 154 155 158 public static final int SUSPEND= 0x0002; 159 160 163 public static final int CREATE= 0x0004; 164 165 168 public static final int TERMINATE= 0x0008; 169 170 173 public static final int CHANGE= 0x0010; 174 175 181 public static final int MODEL_SPECIFIC= 0x0020; 182 183 188 public static final int STEP_INTO= 0x0001; 189 190 195 public static final int STEP_OVER= 0x0002; 196 197 202 public static final int STEP_RETURN= 0x0004; 203 204 208 public static final int STEP_END= 0x0008; 209 210 214 public static final int BREAKPOINT= 0x0010; 215 216 220 public static final int CLIENT_REQUEST= 0x0020; 221 222 228 public static final int EVALUATION = 0x0040; 229 230 240 public static final int EVALUATION_IMPLICIT = 0x0080; 241 242 249 public static final int STATE = 0x0100; 250 251 258 public static final int CONTENT = 0x0200; 259 260 264 public static final int UNSPECIFIED = 0; 265 266 270 private int fKind= UNSPECIFIED; 271 272 276 private int fDetail= UNSPECIFIED; 277 278 283 private Object fData = null; 284 285 293 public DebugEvent(Object eventSource, int kind) { 294 this(eventSource, kind, UNSPECIFIED); 295 } 296 297 306 public DebugEvent(Object eventSource, int kind, int detail) { 307 super(eventSource); 308 if ((kind & (RESUME | SUSPEND | CREATE | TERMINATE | CHANGE | MODEL_SPECIFIC)) == 0) 309 throw new IllegalArgumentException (DebugCoreMessages.DebugEvent_illegal_kind); 310 if (kind != MODEL_SPECIFIC && detail != UNSPECIFIED && (detail & (STEP_END | STEP_INTO | STEP_OVER | STEP_RETURN | BREAKPOINT | CLIENT_REQUEST |EVALUATION | EVALUATION_IMPLICIT | STATE | CONTENT)) == 0) 311 throw new IllegalArgumentException (DebugCoreMessages.DebugEvent_illegal_detail); 312 fKind= kind; 313 fDetail= detail; 314 } 315 316 323 public int getDetail() { 324 return fDetail; 325 } 326 327 332 public int getKind() { 333 return fKind; 334 } 335 336 346 public boolean isStepStart() { 347 return (getDetail() & (STEP_INTO | STEP_OVER | STEP_RETURN)) > 0; 348 } 349 350 358 public boolean isEvaluation() { 359 return (getDetail() & (EVALUATION | EVALUATION_IMPLICIT)) > 0; 360 } 361 362 368 public void setData(Object data) { 369 fData = data; 370 } 371 372 378 public Object getData() { 379 return fData; 380 } 381 382 385 public String toString() { 386 StringBuffer buf = new StringBuffer ("DebugEvent["); if (getSource() != null) { 388 buf.append(getSource().toString()); 389 } else { 390 buf.append("null"); } 392 buf.append(", "); switch (getKind()) { 394 case CREATE: 395 buf.append("CREATE"); break; 397 case TERMINATE: 398 buf.append("TERMINATE"); break; 400 case RESUME: 401 buf.append("RESUME"); break; 403 case SUSPEND: 404 buf.append("SUSPEND"); break; 406 case CHANGE: 407 buf.append("CHANGE"); break; 409 case UNSPECIFIED: 410 buf.append("UNSPECIFIED"); break; 412 case MODEL_SPECIFIC: 413 buf.append("MODEL_SPECIFIC"); break; 415 } 416 buf.append(", "); switch (getDetail()) { 418 case BREAKPOINT: 419 buf.append("BREAKPOINT"); break; 421 case CLIENT_REQUEST: 422 buf.append("CLIENT_REQUEST"); break; 424 case STEP_END: 425 buf.append("STEP_END"); break; 427 case STEP_INTO: 428 buf.append("STEP_INTO"); break; 430 case STEP_OVER: 431 buf.append("STEP_OVER"); break; 433 case STEP_RETURN: 434 buf.append("STEP_RETURN"); break; 436 case EVALUATION: 437 buf.append("EVALUATION"); break; 439 case EVALUATION_IMPLICIT: 440 buf.append("EVALUATION_IMPLICIT"); break; 442 case STATE: 443 buf.append("STATE"); break; 445 case CONTENT: 446 buf.append("CONTENT"); break; 448 case UNSPECIFIED: 449 buf.append("UNSPECIFIED"); break; 451 default: 452 buf.append(getDetail()); 454 break; 455 } 456 buf.append("]"); return buf.toString(); 458 } 459 } 460 461 | Popular Tags |