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

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

org.netbeans.modules.refactoring.api 1.0

org.netbeans.modules.refactoring.api
Class AbstractRefactoring

java.lang.Object
  extended by org.netbeans.modules.refactoring.api.AbstractRefactoring
Direct Known Subclasses:
MoveRefactoring, MultipleCopyRefactoring, RenameRefactoring, SafeDeleteRefactoring, SingleCopyRefactoring, WhereUsedQuery

public abstract class AbstractRefactoring
extends Object

Abstract superclass for particular refactorings. Methods should be typically called in following order:

See Also:
RefactoringSession

Field Summary
static int INIT
          Initial state
static int PARAMETERS_CHECK
          Parameters check state.
static int PRE_CHECK
          Pre-check state.
static int PREPARE
          Prepare state.
 
Constructor Summary
protected AbstractRefactoring(Lookup refactoringSource)
           
 
Method Summary
 void addProgressListener(ProgressListener listener)
          Registers ProgressListener to receive events.
 void cancelRequest()
          Asynchronous request to cancel ongoing long-term request (such as preCheck(), checkParameters() or prepare())
 Problem checkParameters()
          Checks if this refactoring has correctly set all parameters.
 Problem fastCheckParameters()
          This method checks parameters.
 Context getContext()
          getter for refactoring Context
 Lookup getRefactoringSource()
          Object being refactored
 Problem preCheck()
          Perform checks to ensure that the preconditions are met for the implemented refactoring.
 Problem prepare(RefactoringSession session)
          Collects and returns a set of refactoring elements - objects that will be affected by the refactoring.
 void removeProgressListener(ProgressListener listener)
          Removes ProgressListener from the list of listeners.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INIT

public static final int INIT
Initial state

See Also:
Constant Field Values

PRE_CHECK

public static final int PRE_CHECK
Pre-check state.

See Also:
Constant Field Values

PARAMETERS_CHECK

public static final int PARAMETERS_CHECK
Parameters check state.

See Also:
Constant Field Values

PREPARE

public static final int PREPARE
Prepare state.

See Also:
Constant Field Values
Constructor Detail

AbstractRefactoring

protected AbstractRefactoring(Lookup refactoringSource)
Method Detail

preCheck

public final Problem preCheck()
Perform checks to ensure that the preconditions are met for the implemented refactoring.

Returns:
Chain of problems encountered or null if no problems were found.

prepare

public final Problem prepare(RefactoringSession session)
Collects and returns a set of refactoring elements - objects that will be affected by the refactoring.

Parameters:
session - RefactoringSession that the operation will use to return instances of RefactoringElement class representing objects that will be affected by the refactoring.
Returns:
Chain of problems encountered or null in no problems were found.

checkParameters

public final Problem checkParameters()
Checks if this refactoring has correctly set all parameters.

Returns:
Returns instancef Problem or null

fastCheckParameters

public final Problem fastCheckParameters()
This method checks parameters. Its implementation is fast and allows on-line checking of errors. If you want complete check of parameters, use #checkParameters()

Returns:
Returns instance of Problem or null

addProgressListener

public final void addProgressListener(ProgressListener listener)
Registers ProgressListener to receive events.

Parameters:
listener - The listener to register.

removeProgressListener

public final void removeProgressListener(ProgressListener listener)
Removes ProgressListener from the list of listeners.

Parameters:
listener - The listener to remove.

getContext

public final Context getContext()
getter for refactoring Context

Returns:
context in which the refactoring was invoked.
See Also:
Context

getRefactoringSource

public final Lookup getRefactoringSource()
Object being refactored

Returns:

cancelRequest

public final void cancelRequest()
Asynchronous request to cancel ongoing long-term request (such as preCheck(), checkParameters() or prepare())


org.netbeans.modules.refactoring.api 1.0

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