Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 


Eclipse Platform
Release 3.5

org.eclipse.ltk.core.refactoring
Class CreateChangeOperation

java.lang.Object
  extended by 
org.eclipse.ltk.core.refactoring.CreateChangeOperation
All Implemented Interfaces:
IWorkspaceRunnable

public class CreateChangeOperation
extends Object
implements IWorkspaceRunnable

Operation that, when performed, creates a Change object for a given refactoring. If created with a refactoring object directly, no precondition checking is performed. If created with a CheckConditionsOperation the requested precondition checking is performed before creating the change.

If the precondition checking returns a fatal error or the status's severity exceeds a certain threshold then no change will be created.

If a change has been created the operation calls Change.initializeValidationData(IProgressMonitor) to initialize the change's validation data.

The operation should be executed via the run method offered by IWorkspace to achieve proper delta batching.

Note: this class is not intended to be extended by clients.

Since:
3.0
Restriction:
This class is not intended to be subclassed by clients.

Constructor Summary
CreateChangeOperation ( CheckConditionsOperation operation, int checkFailedSeverity)
          Creates a new operation with the given CheckConditionsOperation.
CreateChangeOperation ( Refactoring refactoring)
          Creates a new operation with the given refactoring.
 
Method Summary
  Change getChange ()
          Returns the outcome of the operation or null if an exception occurred when performing the operation or the operation hasn't been performed yet.
 int getConditionCheckingFailedSeverity ()
          Returns the condition checking failed severity used by this operation.
  RefactoringStatus getConditionCheckingStatus ()
          Returns the status of the condition checking.
 int getConditionCheckingStyle ()
          Returns the condition checking style as set to the CheckConditionsOperation.
 void run ( IProgressMonitor pm)
          Runs the operation reporting progress to and accepting cancellation requests from the given progress monitor.
 
Methods inherited from class java.lang. Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CreateChangeOperation

public CreateChangeOperation(
Refactoring refactoring)
Creates a new operation with the given refactoring. No condition checking is performed before creating the change object. It is assumed that the condition checking has already been performed outside of this operation. The operation might fail if the precondition checking has not been performed yet.

Parameters:
refactoring - the refactoring for which the change is to be created

CreateChangeOperation

public CreateChangeOperation(
CheckConditionsOperation operation,
                             int checkFailedSeverity)
Creates a new operation with the given CheckConditionsOperation. When performed the operation first checks the conditions as specified by the CheckConditionsOperation. Depending on the result of the condition checking a change object is created or not.

Parameters:
operation - the condition checking operation
checkFailedSeverity - the severity from which on the condition checking is interpreted as failed. The passed value must be greater than RefactoringStatus.OK and less than or equal RefactoringStatus.FATAL. The standard value from which on a condition check should is to be interpreted as failed can be accessed via RefactoringCore.getConditionCheckingFailedSeverity().
Method Detail

getConditionCheckingFailedSeverity

public int getConditionCheckingFailedSeverity()
Returns the condition checking failed severity used by this operation.

Returns:
the condition checking failed severity
See Also:
RefactoringStatus

run

public void run(
IProgressMonitor pm)
         throws 
CoreException
Runs the operation reporting progress to and accepting cancellation requests from the given progress monitor.

Implementors of this method should check the progress monitor for cancellation when it is safe and appropriate to do so. The cancellation request should be propagated to the caller by throwing OperationCanceledException.

Specified by:
run in interface IWorkspaceRunnable
Parameters:
pm - a progress monitor, or null if progress reporting and cancellation are not desired
Throws:
CoreException - if this operation fails.

getChange

public 
Change getChange()
Returns the outcome of the operation or null if an exception occurred when performing the operation or the operation hasn't been performed yet.

Returns:
the created change or null

getConditionCheckingStatus

public 
RefactoringStatus getConditionCheckingStatus()
Returns the status of the condition checking. Returns null if no condition checking has been requested.

Returns:
the status of the condition checking

getConditionCheckingStyle

public int getConditionCheckingStyle()
Returns the condition checking style as set to the CheckConditionsOperation. If no condition checking operation is provided (e.g. the change is created directly by calling Refactoring.createChange(IProgressMonitor) then CheckConditionsOperation.NONE is returned.

Returns:
the condition checking style

Eclipse Platform
Release 3.5

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire