KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > xml > refactoring > ui > j > spi > RefactoringElementImplementation


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19 package org.netbeans.modules.xml.refactoring.ui.j.spi;
20
21 //import org.netbeans.jmi.javamodel.Element;
22
import org.netbeans.modules.xml.refactoring.ui.j.api.RefactoringElement;
23 import org.openide.filesystems.FileObject;
24 import org.openide.text.PositionBounds;
25
26 /** Interface representing a refactoring element (object affected by a refactoring)
27  * returned in a collection from {@link org.netbeans.modules.refactoring.api.AbstractRefactoring#prepare} operation.
28  * <p>
29  *
30  * @author Martin Matula
31  * @see RefactoringElement
32  * @see SimpleRefactoringElementImpl
33  */

34 public interface RefactoringElementImplementation {
35     /** Status corresponding to a normal element */
36     int NORMAL = RefactoringElement.NORMAL;
37     /** Status corresponding to an element that has a warning associated with it */
38     int WARNING = RefactoringElement.WARNING;
39     /** Status flag that indicates that the element cannot be enabled (if a fatal
40      * problem is associated with it) */

41     int GUARDED = RefactoringElement.GUARDED;
42     /** This element is in read-only file */
43     int READ_ONLY = RefactoringElement.READ_ONLY;
44     
45     /** Returns text describing the refactoring element.
46      * @return Text.
47      */

48     String JavaDoc getText();
49     
50     /** Returns text describing the refactoring formatted for display (using HTML tags).
51      * @return Formatted text.
52      */

53     String JavaDoc getDisplayText();
54     
55     /** Indicates whether this refactoring element is enabled.
56      * @return <code>true</code> if this element is enabled, otherwise <code>false</code>.
57      */

58     boolean isEnabled();
59     
60     /** Enables/disables this element.
61      * @param enabled If <code>true</code> the element is enabled, otherwise it is disabled.
62      */

63     void setEnabled(boolean enabled);
64     
65     /** Performs the change represented by this refactoring element.
66      */

67     void performChange();
68     
69     /** Returns Java element associated with this refactoring element.
70      * @return MDR Java element.
71      */

72 // Element getJavaElement();
73

74     /** Returns file that the element affects (relates to)
75      * @return File
76      */

77     FileObject getParentFile();
78     
79     /** Returns position bounds of the text to be affected by this refactoring element.
80      */

81     PositionBounds getPosition();
82     
83     /** Returns the status of this refactoring element (whether it is a normal element,
84      * or a warning.
85      * @return Status of this element.
86      */

87     int getStatus();
88     
89     /**
90      * Setter for property status
91      * @param status new value of propery status
92      */

93     void setStatus(int status);
94     
95     /**
96      * opens this RefactoringElement in the editor
97      * @since 1.5.0
98      */

99     void openInEditor();
100 }
101
Popular Tags