站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc (Current Development Version)

RefactoringElementImplementation (Refactoring API) - NetBeans API Javadoc (Current Development Version)

org.netbeans.modules.refactoring.api 1.0

org.netbeans.modules.refactoring.spi
Interface RefactoringElementImplementation

All Known Implementing Classes:
SimpleRefactoringElementImplementation

public interface RefactoringElementImplementation

Interface representing a refactoring element (object affected by a refactoring) returned in a collection from AbstractRefactoring.prepare(org.netbeans.modules.refactoring.api.RefactoringSession) operation.

See Also:
RefactoringElement, SimpleRefactoringElementImpl, RefactoringSession, RefactoringElementsBag

Field Summary
static int GUARDED
          Status flag that indicates that the element cannot be enabled (if a fatal problem is associated with it)
static int NORMAL
          Status corresponding to a normal element
static int READ_ONLY
          This element is in read-only file
static int WARNING
          Status corresponding to an element that has a warning associated with it
 
Method Summary
 String getDisplayText()
          Returns text describing the refactoring formatted for display (using HTML tags).
 Lookup getLookup()
          Returns Lookup associated with this element.
 FileObject getParentFile()
          Returns file that the element affects (relates to)
 PositionBounds getPosition()
          Returns position bounds of the text to be affected by this refactoring element.
 int getStatus()
          Returns the status of this refactoring element (whether it is a normal element, or a warning.
 String getText()
          Returns text describing the refactoring element.
 boolean isEnabled()
          Indicates whether this refactoring element is enabled.
 void openInEditor()
          opens this RefactoringElement in the editor
 void performChange()
          Performs the change represented by this refactoring element.
 void setEnabled(boolean enabled)
          Enables/disables this element.
 void setStatus(int status)
          Setter for property status
 void showPreview()
          Shows this element in refactoring preview are
 void undoChange()
          Undo change done by performChange Implementation can be impty if the change is done using some high level transaction model
 

Field Detail

NORMAL

static final int NORMAL
Status corresponding to a normal element

See Also:
Constant Field Values

WARNING

static final int WARNING
Status corresponding to an element that has a warning associated with it

See Also:
Constant Field Values

GUARDED

static final int GUARDED
Status flag that indicates that the element cannot be enabled (if a fatal problem is associated with it)

See Also:
Constant Field Values

READ_ONLY

static final int READ_ONLY
This element is in read-only file

See Also:
Constant Field Values
Method Detail

getText

String getText()
Returns text describing the refactoring element.

Returns:
Text.

getDisplayText

String getDisplayText()
Returns text describing the refactoring formatted for display (using HTML tags).

Returns:
Formatted text.

isEnabled

boolean isEnabled()
Indicates whether this refactoring element is enabled.

Returns:
true if this element is enabled, otherwise false.

setEnabled

void setEnabled(boolean enabled)
Enables/disables this element.

Parameters:
enabled - If true the element is enabled, otherwise it is disabled.

performChange

void performChange()
Performs the change represented by this refactoring element. Implementation can be impty if the change is done using some high level transaction model

See Also:
BackupFacility, RefactoringElementsBag#registerFileChange, RefactoringElementsBag.registerTransaction(org.netbeans.modules.refactoring.spi.Transaction), Transaction, performChange(), undoChange()

undoChange

void undoChange()
Undo change done by performChange Implementation can be impty if the change is done using some high level transaction model

See Also:
BackupFacility, RefactoringElementsBag#registerFileChange, RefactoringElementsBag.registerTransaction(org.netbeans.modules.refactoring.spi.Transaction), Transaction, performChange(), undoChange()

getLookup

Lookup getLookup()
Returns Lookup associated with this element. Lookup items might be used by TreeElementFactories to build refactoring preview trees.

Returns:
Lookup. Might be empty.
See Also:
TreeElement, TreeElementFactory, TreeElementFactoryImplementation

getParentFile

FileObject getParentFile()
Returns file that the element affects (relates to)

Returns:
File

getPosition

PositionBounds getPosition()
Returns position bounds of the text to be affected by this refactoring element.

Returns:
position bounds

getStatus

int getStatus()
Returns the status of this refactoring element (whether it is a normal element, or a warning.

Returns:
Status of this element.

setStatus

void setStatus(int status)
Setter for property status

Parameters:
status - new value of propery status

openInEditor

void openInEditor()
opens this RefactoringElement in the editor

Since:
1.5.0

showPreview

void showPreview()
Shows this element in refactoring preview are

See Also:
org.netbeans.modules.refactoring.api.ui.UI#setComponentForRefactoringPreview

org.netbeans.modules.refactoring.api 1.0

Built on May 28 2007.  |  Portions Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.