KickJava   Java API By Example, From Geeks To Geeks.

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


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.debug.core.model.IValue;
14 import org.eclipse.debug.core.model.IVariable;
15
16 /**
17  * A property in an Ant build
18  */

19 public class AntProperty extends AntDebugElement implements IVariable {
20
21     private String JavaDoc fName;
22     private AntValue fValue;
23     private String JavaDoc fLabel;
24     
25     /**
26      * Constructs a variable associated with the debug target
27      * with the given name and value.
28      *
29      * @param target the debug target
30      * @param name property name
31      * @param value property value
32      */

33     public AntProperty(AntDebugTarget target, String JavaDoc name, String JavaDoc value) {
34         super(target);
35         fName = name;
36         fValue= new AntValue(target, value);
37     }
38     
39     /* (non-Javadoc)
40      * @see org.eclipse.debug.core.model.IVariable#getValue()
41      */

42     public IValue getValue() {
43         return fValue;
44     }
45     
46     /* (non-Javadoc)
47      * @see org.eclipse.debug.core.model.IVariable#getName()
48      */

49     public String JavaDoc getName() {
50         return fName;
51     }
52     
53     /* (non-Javadoc)
54      * @see org.eclipse.debug.core.model.IVariable#getReferenceTypeName()
55      */

56     public String JavaDoc getReferenceTypeName() {
57         return ""; //$NON-NLS-1$
58
}
59     
60     /* (non-Javadoc)
61      * @see org.eclipse.debug.core.model.IVariable#hasValueChanged()
62      */

63     public boolean hasValueChanged() {
64         return false;
65     }
66     
67     /* (non-Javadoc)
68      * @see org.eclipse.debug.core.model.IValueModification#setValue(java.lang.String)
69      */

70     public void setValue(String JavaDoc expression) {
71     }
72     
73     /* (non-Javadoc)
74      * @see org.eclipse.debug.core.model.IValueModification#setValue(org.eclipse.debug.core.model.IValue)
75      */

76     public void setValue(IValue value) {
77     }
78     
79     /* (non-Javadoc)
80      * @see org.eclipse.debug.core.model.IValueModification#supportsValueModification()
81      */

82     public boolean supportsValueModification() {
83         return false;
84     }
85     
86     /* (non-Javadoc)
87      * @see org.eclipse.debug.core.model.IValueModification#verifyValue(java.lang.String)
88      */

89     public boolean verifyValue(String JavaDoc expression) {
90         return false;
91     }
92     
93     /* (non-Javadoc)
94      * @see org.eclipse.debug.core.model.IValueModification#verifyValue(org.eclipse.debug.core.model.IValue)
95      */

96     public boolean verifyValue(IValue value) {
97         return false;
98     }
99
100     /**
101      * @return the text used to render this property
102      */

103     public String JavaDoc getText() {
104         if (fLabel == null) {
105             StringBuffer JavaDoc buffer= new StringBuffer JavaDoc(getName());
106             buffer.append("= "); //$NON-NLS-1$
107
buffer.append(fValue.getValueString());
108             fLabel= buffer.toString();
109         }
110         return fLabel;
111     }
112 }
113
Popular Tags