KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ant > internal > ui > debug > model > AntDebugElement


1 /*******************************************************************************
2  * Copyright (c) 2004, 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.ant.internal.ui.debug.model;
12
13 import org.eclipse.ant.internal.ui.AntUIPlugin;
14 import org.eclipse.ant.internal.ui.debug.IAntDebugConstants;
15 import org.eclipse.core.runtime.IStatus;
16 import org.eclipse.core.runtime.Status;
17 import org.eclipse.debug.core.DebugException;
18 import org.eclipse.debug.core.DebugPlugin;
19 import org.eclipse.debug.core.model.DebugElement;
20
21 /**
22  * Common function of Ant debug model elements
23  */

24 public abstract class AntDebugElement extends DebugElement {
25     
26     /**
27      * Constructs a new debug element contained in the given
28      * debug target.
29      *
30      * @param target debug target
31      */

32     public AntDebugElement(AntDebugTarget target) {
33         super(target);
34     }
35     
36     /* (non-Javadoc)
37      * @see org.eclipse.debug.core.model.IDebugElement#getModelIdentifier()
38      */

39     public String JavaDoc getModelIdentifier() {
40         return IAntDebugConstants.ID_ANT_DEBUG_MODEL;
41     }
42     
43     protected void abort(String JavaDoc message, Throwable JavaDoc e) throws DebugException {
44         throw new DebugException(new Status(IStatus.ERROR, AntUIPlugin.getUniqueIdentifier(),
45                 DebugPlugin.INTERNAL_ERROR, message, e));
46     }
47     
48     /**
49      * Throws a debug exception with the given message, error code, and underlying
50      * exception.
51      */

52     protected void throwDebugException(String JavaDoc message) throws DebugException {
53         throw new DebugException(new Status(IStatus.ERROR, AntUIPlugin.getUniqueIdentifier(),
54             DebugException.TARGET_REQUEST_FAILED, message, null));
55     }
56     
57     protected AntDebugTarget getAntDebugTarget() {
58         return (AntDebugTarget)super.getDebugTarget();
59     }
60 }
61
Popular Tags