|
Eclipse JDT Release 3.8 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.jdt.ui.text.java.correction.ChangeCorrectionProposal
public class ChangeCorrectionProposal
Implementation of a Java completion proposal to be used for quick fix and quick assist proposals
that are based on a Change. The proposal offers additional proposal information (based on
the Change).
| Field Summary |
|---|
| Fields inherited from interface org.eclipse.jdt.ui.text.java.correction.ICommandAccess |
|---|
ASSIST_SUFFIX, COMMAND_ID_PREFIX |
| Constructor Summary | |
|---|---|
ChangeCorrectionProposal(String name,
Change change,
int relevance)
Constructs a change correction proposal. |
|
ChangeCorrectionProposal(String name,
Change change,
int relevance,
Image image)
Constructs a change correction proposal. |
|
| Method Summary | |
|---|---|
void |
apply(IDocument document)
|
protected Change |
createChange()
Creates the change for this proposal. |
String |
getAdditionalProposalInfo()
|
Object |
getAdditionalProposalInfo(IProgressMonitor monitor)
|
Change |
getChange()
Returns the change that will be executed when the proposal is applied. |
String |
getCommandId()
Returns the id of the command that should invoke this correction proposal. |
IContextInformation |
getContextInformation()
|
String |
getDisplayString()
|
Image |
getImage()
|
String |
getName()
Returns the name of the proposal. |
int |
getRelevance()
Returns the relevance of this completion proposal. |
Point |
getSelection(IDocument document)
|
StyledString |
getStyledDisplayString()
|
protected void |
performChange(IEditorPart activeEditor,
IDocument document)
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 |
setImage(Image image)
Sets the proposal's image or null if no image is desired. |
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 |
| Constructor Detail |
|---|
public ChangeCorrectionProposal(String name,
Change change,
int relevance,
Image image)
name - the name that is displayed in the proposal selection dialogchange - 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 proposalimage - the image that is displayed for this proposal or null if no image
is desired
public ChangeCorrectionProposal(String name,
Change change,
int relevance)
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 Detail |
|---|
public void apply(IDocument document)
apply in interface ICompletionProposal
protected void performChange(IEditorPart activeEditor,
IDocument document)
throws CoreException
Subclasses may extend, but must call the super implementation.
activeEditor - the editor currently active or null if no editor is activedocument - the document of the editor currently active or null if no editor
is visible
CoreException - when the invocation of the change failedpublic String getAdditionalProposalInfo()
getAdditionalProposalInfo in interface ICompletionProposalpublic Object getAdditionalProposalInfo(IProgressMonitor monitor)
getAdditionalProposalInfo in interface ICompletionProposalExtension5public IContextInformation getContextInformation()
getContextInformation in interface ICompletionProposalpublic String getDisplayString()
getDisplayString in interface ICompletionProposalpublic StyledString getStyledDisplayString()
getStyledDisplayString in interface ICompletionProposalExtension6public String getName()
public Image getImage()
getImage in interface ICompletionProposalpublic Point getSelection(IDocument document)
getSelection in interface ICompletionProposalpublic void setImage(Image image)
null if no image is desired.
image - the desired image.
public final Change getChange()
throws CoreException
createChange() to compute the change.
null in rare cases if creation of
the change failed
CoreException - when the change could not be created
protected Change createChange()
throws CoreException
ChangeCorrectionProposal(String, Change, int, Image).
Subclasses may override.
CoreException - if the creation of the change failedpublic void setDisplayName(String name)
name - the name to setpublic int getRelevance()
IJavaCompletionProposalThe relevance is used to determine if this proposal is more relevant than another proposal.
getRelevance in interface IJavaCompletionProposalpublic void setRelevance(int relevance)
relevance - the relevance to setgetRelevance()public String getCommandId()
ICommandAccess
getCommandId in interface ICommandAccessnull if this proposal does not have a command.
This id must start with ICommandAccess.COMMAND_ID_PREFIX to be recognized as a correction
command. In addition, the id must end with ICommandAccess.ASSIST_SUFFIX to be recognized as
a quick assist command.public void setCommandId(String commandId)
commandId - The proposal id for this proposal or null if no command
should be assigned to this proposal.
|
Eclipse JDT Release 3.8 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Guidelines for using Eclipse APIs.
Copyright (c) 2000, 2012 IBM Corporation and others. All rights reserved.