KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > corext > refactoring > base > JavaStringStatusContext


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 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.corext.refactoring.base;
12
13 import org.eclipse.core.runtime.Assert;
14
15 import org.eclipse.jdt.core.ISourceRange;
16
17 import org.eclipse.ltk.core.refactoring.RefactoringStatusContext;
18
19 /**
20  * A Java string context can be used to annotate a </code>RefactoringStatusEntry<code>
21  * with detailed information about an error detected in Java source code represented
22  * by a string.
23  */

24 public class JavaStringStatusContext extends RefactoringStatusContext {
25     
26     private String JavaDoc fSource;
27     private ISourceRange fSourceRange;
28
29     /**
30      * Creates a new <code>JavaStringStatusContext</code>.
31      *
32      * @param source the source code containing the error
33      * @param range a source range inside <code>source</code> or
34      * <code>null</code> if no special source range is known.
35      */

36     public JavaStringStatusContext(String JavaDoc source, ISourceRange range){
37         Assert.isNotNull(source);
38         fSource= source;
39         fSourceRange= range;
40     }
41     
42     public String JavaDoc getSource() {
43         return fSource;
44     }
45
46     public ISourceRange getSourceRange() {
47         return fSourceRange;
48     }
49     
50     /* (non-Javadoc)
51      * @see RefactoringStatusContext#getCorrespondingElement()
52      */

53     public Object JavaDoc getCorrespondingElement() {
54         return null;
55     }
56 }
57
Popular Tags