Package org.eclipse.jdt.core.manipulation

# Class ChangeCorrectionProposalCore

java.lang.Object
org.eclipse.jdt.core.manipulation.ChangeCorrectionProposalCore

Direct Known Subclasses:
  `ChangeCorrectionProposal`, `CUCorrectionProposalCore`

public class ChangeCorrectionProposalCore extends Object

Since:
  1.11

## Field Summary

Fields
Modifier and Type
Field
Description
`protected Change`
`fChange`
`protected String`
`fName`
`protected int`
`fRelevance`

## Constructor Summary

Constructors
Constructor
Description
`ChangeCorrectionProposalCore(String name, Change change, int relevance)`
Constructs a change correction proposal.

## Method Summary

Modifier and Type
Method
Description
`void`
`apply()`
`protected Change`
`createChange()`
Creates the change for this proposal.
`Object`
`getAdditionalProposalInfo(IProgressMonitor monitor)`
`Change`
`getChange()`
Returns the change that will be executed when the proposal is applied.
`String`
`getCommandId()`
`Change`
`getCurrentChange()`
`String`
`getName()`
Returns the name of the proposal.
`int`
`getRelevance()`
`protected void`
`performChange()`
Performs the change associated with this proposal.
`void`
`setCommandId(String commandId)`
Set the proposal id to allow assigning a shortcut to the correction proposal.
`void`
`setDisplayName(String name)`
Sets the display name.
`void`
`setRelevance(int relevance)`
Sets the relevance.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### fChange

protected Change fChange

### fName

protected String fName

### fRelevance

protected int fRelevance

## Constructor Details

### ChangeCorrectionProposalCore

public ChangeCorrectionProposalCore(String name, Change change, int relevance)
Constructs a change correction proposal.

Parameters:
  `name` - the name that is displayed in the proposal selection dialog
  `change` - the change that is executed when the proposal is applied or `null` if the change will be created by implementors of `createChange()`
  `relevance` - the relevance of this proposal

## Method Details

### apply

public void apply() throws CoreException

Throws:
  `CoreException`

### performChange

protected void performChange() throws CoreException
Performs the change associated with this proposal.

Subclasses may extend, but must call the super implementation.

Throws:
  `CoreException` - when the invocation of the change failed

### getAdditionalProposalInfo

public Object getAdditionalProposalInfo(IProgressMonitor monitor)

### getName

public String getName()
Returns the name of the proposal.

Returns:
  the name of the proposal

### getChange

public Change getChange() throws CoreException
Returns the change that will be executed when the proposal is applied. This method calls `createChange()` to compute the change.

Returns:
  the change for this proposal, can be `null` in rare cases if creation of the change failed
Throws:
  `CoreException` - when the change could not be created

### getCurrentChange

public Change getCurrentChange()

Returns:
  The current change, or null if not initialized yet
Since:
  1.20

### createChange

protected Change createChange() throws CoreException
Creates the change for this proposal. This method is only called once and only when no change has been passed in {#ChangeCorrectionProposal(String, Change, int, Image)}. Subclasses may override.

Returns:
  the created change
Throws:
  `CoreException` - if the creation of the change failed

### setDisplayName

public void setDisplayName(String name)
Sets the display name.

Parameters:
  `name` - the name to set

### getRelevance

public int getRelevance()

### setRelevance

public void setRelevance(int relevance)
Sets the relevance.

Parameters:
  `relevance` - the relevance to set
See Also:
  - `getRelevance()`

### getCommandId

public String getCommandId()

Returns:
  the command id
Since:
  1.20

### setCommandId

public void setCommandId(String commandId)
Set the proposal id to allow assigning a shortcut to the correction proposal.

Parameters:
  `commandId` - The proposal id for this proposal or `null` if no command should be assigned to this proposal.
Since:
  1.20