KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > debug > core > model > JDIPlaceholderValue


1 /*******************************************************************************
2  * Copyright (c) 2007 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.jdt.internal.debug.core.model;
12
13 /**
14  * This class is used to create a variable/value that displays a warning message to the user.
15  * Currently used to inform users that references are not available for the current VM.
16  * It extends <code>JDINullValue</code> so that most actions will ignore it, but returns the
17  * message instead of "null" for it's value.
18  *
19  * @since 3.3
20  */

21 public class JDIPlaceholderValue extends JDINullValue {
22
23     private String JavaDoc fMessage;
24     
25     /**
26      * Constructor, passes the debug target to the super class.
27      * @param target debug target this value belongs to
28      */

29     public JDIPlaceholderValue(JDIDebugTarget target, String JavaDoc message) {
30         super(target);
31         fMessage = message;
32     }
33     
34     /**
35      * @return the message supplied in the constructor
36      * @see org.eclipse.jdt.internal.debug.core.model.JDINullValue#getValueString()
37      */

38     public String JavaDoc getValueString() {
39         return fMessage;
40     }
41             
42     /**
43      * @return the message supplied in the constructor
44      * @see org.eclipse.jdt.internal.debug.core.model.JDINullValue#toString()
45      */

46     public String JavaDoc toString() {
47         return fMessage;
48     }
49     
50     /**
51      * Returns signature for a java string object so that the string message passed in
52      * the constructor is displayed in the detail pane.
53      * @return signature for a java string object
54      * @see org.eclipse.jdt.internal.debug.core.model.JDINullValue#getSignature()
55      */

56     public String JavaDoc getSignature() {
57         return "Ljava/lang/String;"; //$NON-NLS-1$
58
}
59     
60 }
61
Popular Tags