public class ConfigurableCompletionProposal extends java.lang.Object implements java.lang.Comparable<ConfigurableCompletionProposal>, org.eclipse.jface.text.contentassist.ICompletionProposal, org.eclipse.jface.text.contentassist.ICompletionProposalExtension, org.eclipse.jface.text.contentassist.ICompletionProposalExtension2, org.eclipse.jface.text.contentassist.ICompletionProposalExtension3, org.eclipse.jface.text.contentassist.ICompletionProposalExtension4, org.eclipse.jface.text.contentassist.ICompletionProposalExtension5, org.eclipse.jface.text.contentassist.ICompletionProposalExtension6
Modifier and Type | Class and Description |
---|---|
protected static class |
ConfigurableCompletionProposal.ExitPolicy |
static interface |
ConfigurableCompletionProposal.IReplacementTextApplier |
Constructor and Description |
---|
ConfigurableCompletionProposal(java.lang.String replacementString,
int replacementOffset,
int replacementLength,
int cursorPosition)
Creates a new completion proposal based on the provided information.
|
ConfigurableCompletionProposal(java.lang.String replacementString,
int replacementOffset,
int replacementLength,
int cursorPosition,
org.eclipse.swt.graphics.Image image,
org.eclipse.jface.viewers.StyledString displayString,
org.eclipse.jface.text.contentassist.IContextInformation contextInformation,
java.lang.String additionalProposalInfo)
Creates a new completion proposal.
|
Modifier and Type | Method and Description |
---|---|
void |
apply(org.eclipse.jface.text.IDocument document) |
void |
apply(org.eclipse.jface.text.IDocument document,
char trigger,
int offset) |
void |
apply(org.eclipse.jface.text.ITextViewer viewer,
char trigger,
int stateMask,
int offset) |
int |
compareTo(ConfigurableCompletionProposal other) |
boolean |
equals(java.lang.Object obj) |
java.lang.Object |
getAdditionalData(java.lang.String key)
Used to store arbitrary data as a protocol between two or more clients unknown to this class.
|
java.lang.String |
getAdditionalProposalInfo() |
java.lang.Object |
getAdditionalProposalInfo(org.eclipse.core.runtime.IProgressMonitor monitor) |
org.eclipse.jface.text.contentassist.IContextInformation |
getContextInformation() |
int |
getContextInformationPosition() |
int |
getCursorPosition() |
java.lang.String |
getDisplayString() |
org.eclipse.swt.graphics.Image |
getImage() |
org.eclipse.jface.text.IInformationControlCreator |
getInformationControlCreator() |
PrefixMatcher |
getMatcher() |
int |
getPrefixCompletionStart(org.eclipse.jface.text.IDocument document,
int completionOffset) |
java.lang.CharSequence |
getPrefixCompletionText(org.eclipse.jface.text.IDocument document,
int completionOffset) |
int |
getPriority()
Returns the priority of the proposal.
|
int |
getReplaceContextLength() |
int |
getReplacementLength() |
int |
getReplacementOffset() |
java.lang.String |
getReplacementString() |
org.eclipse.swt.graphics.Point |
getSelection(org.eclipse.jface.text.IDocument document) |
int |
getSelectionLength() |
int |
getSelectionStart() |
org.eclipse.jface.viewers.StyledString |
getStyledDisplayString() |
ConfigurableCompletionProposal.IReplacementTextApplier |
getTextApplier() |
char[] |
getTriggerCharacters() |
int |
hashCode() |
boolean |
isAutoInsertable() |
protected boolean |
isLinkedMode() |
boolean |
isValidFor(org.eclipse.jface.text.IDocument document,
int offset) |
void |
selected(org.eclipse.jface.text.ITextViewer viewer,
boolean smartToggle) |
void |
setAdditionalData(java.lang.String key,
java.lang.Object additionalData)
Used to store arbitrary data as a protocol between two or more clients unknown to this class.
|
void |
setAdditionalProposalInfo(java.lang.Object additionalProposalInfo) |
void |
setAutoInsertable(boolean autoInsertable) |
void |
setContextInformation(org.eclipse.jface.text.contentassist.IContextInformation contextInformation) |
void |
setCursorPosition(int cursorPosition) |
void |
setDisplayString(java.lang.String displayString) |
void |
setDisplayString(org.eclipse.jface.viewers.StyledString displayString) |
void |
setHover(IEObjectHover hover) |
void |
setImage(org.eclipse.swt.graphics.Image image) |
void |
setMatcher(PrefixMatcher matcher) |
void |
setPriority(int priority) |
void |
setProposalContextResource(org.eclipse.emf.ecore.resource.Resource contextResource) |
void |
setReplaceContextLength(int replaceContextLength) |
void |
setReplacementLength(int replacementLength) |
void |
setReplacementOffset(int replacementOffset) |
void |
setReplacementString(java.lang.String replacementString) |
void |
setSelectionLength(int selectionLength) |
void |
setSelectionStart(int selectionStart) |
void |
setSimpleLinkedMode(org.eclipse.jface.text.ITextViewer viewer,
char... exitChars) |
void |
setTextApplier(ConfigurableCompletionProposal.IReplacementTextApplier textApplier) |
void |
setTriggerCharacters(char[] triggerChars) |
protected void |
setUpLinkedMode(org.eclipse.jface.text.IDocument document)
Sets up a simple linked mode at
getCursorPosition() and an exit policy that will
exit the mode when closingCharacter is typed and an exit position at
getCursorPosition() + 1 . |
java.lang.String |
toString() |
void |
unselected(org.eclipse.jface.text.ITextViewer viewer) |
boolean |
validate(org.eclipse.jface.text.IDocument document,
int offset,
org.eclipse.jface.text.DocumentEvent event) |
public ConfigurableCompletionProposal(java.lang.String replacementString, int replacementOffset, int replacementLength, int cursorPosition)
null
.replacementString
- the actual string to be inserted into the documentreplacementOffset
- the offset of the text to be replacedreplacementLength
- the length of the text to be replacedcursorPosition
- the position of the cursor following the insert relative to replacementOffsetpublic ConfigurableCompletionProposal(java.lang.String replacementString, int replacementOffset, int replacementLength, int cursorPosition, org.eclipse.swt.graphics.Image image, org.eclipse.jface.viewers.StyledString displayString, org.eclipse.jface.text.contentassist.IContextInformation contextInformation, java.lang.String additionalProposalInfo)
replacementString
- the actual string to be inserted into the documentreplacementOffset
- the offset of the text to be replacedreplacementLength
- the length of the text to be replacedcursorPosition
- the position of the cursor following the insert relative to replacementOffsetimage
- the image to display for this proposaldisplayString
- the string to be displayed for the proposalcontextInformation
- the context information associated with this proposaladditionalProposalInfo
- the additional information associated with this proposalpublic void setAdditionalData(java.lang.String key, java.lang.Object additionalData)
public java.lang.Object getAdditionalData(java.lang.String key)
public void apply(org.eclipse.jface.text.IDocument document)
apply
in interface org.eclipse.jface.text.contentassist.ICompletionProposal
public org.eclipse.swt.graphics.Point getSelection(org.eclipse.jface.text.IDocument document)
getSelection
in interface org.eclipse.jface.text.contentassist.ICompletionProposal
public org.eclipse.jface.text.contentassist.IContextInformation getContextInformation()
getContextInformation
in interface org.eclipse.jface.text.contentassist.ICompletionProposal
public org.eclipse.swt.graphics.Image getImage()
getImage
in interface org.eclipse.jface.text.contentassist.ICompletionProposal
public java.lang.String getDisplayString()
getDisplayString
in interface org.eclipse.jface.text.contentassist.ICompletionProposal
public org.eclipse.jface.viewers.StyledString getStyledDisplayString()
getStyledDisplayString
in interface org.eclipse.jface.text.contentassist.ICompletionProposalExtension6
public java.lang.String getAdditionalProposalInfo()
getAdditionalProposalInfo
in interface org.eclipse.jface.text.contentassist.ICompletionProposal
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean isAutoInsertable()
isAutoInsertable
in interface org.eclipse.jface.text.contentassist.ICompletionProposalExtension4
public void setAutoInsertable(boolean autoInsertable)
public java.lang.String getReplacementString()
public int getReplacementOffset()
public int getReplacementLength()
public int getCursorPosition()
public void setDisplayString(java.lang.String displayString)
public void setDisplayString(org.eclipse.jface.viewers.StyledString displayString)
public void setReplacementString(java.lang.String replacementString)
public void setReplacementOffset(int replacementOffset)
public void setReplacementLength(int replacementLength)
public void setCursorPosition(int cursorPosition)
public void setImage(org.eclipse.swt.graphics.Image image)
public void setContextInformation(org.eclipse.jface.text.contentassist.IContextInformation contextInformation)
public void setAdditionalProposalInfo(java.lang.Object additionalProposalInfo)
public void setProposalContextResource(org.eclipse.emf.ecore.resource.Resource contextResource)
public int getSelectionStart()
public int getSelectionLength()
public void setSelectionLength(int selectionLength)
public void setSelectionStart(int selectionStart)
public void setSimpleLinkedMode(org.eclipse.jface.text.ITextViewer viewer, char... exitChars)
protected boolean isLinkedMode()
public void apply(org.eclipse.jface.text.ITextViewer viewer, char trigger, int stateMask, int offset)
apply
in interface org.eclipse.jface.text.contentassist.ICompletionProposalExtension2
public void apply(org.eclipse.jface.text.IDocument document, char trigger, int offset)
apply
in interface org.eclipse.jface.text.contentassist.ICompletionProposalExtension
public boolean isValidFor(org.eclipse.jface.text.IDocument document, int offset)
isValidFor
in interface org.eclipse.jface.text.contentassist.ICompletionProposalExtension
public int getContextInformationPosition()
getContextInformationPosition
in interface org.eclipse.jface.text.contentassist.ICompletionProposalExtension
public char[] getTriggerCharacters()
getTriggerCharacters
in interface org.eclipse.jface.text.contentassist.ICompletionProposalExtension
public void setTriggerCharacters(char[] triggerChars)
public void selected(org.eclipse.jface.text.ITextViewer viewer, boolean smartToggle)
selected
in interface org.eclipse.jface.text.contentassist.ICompletionProposalExtension2
public void unselected(org.eclipse.jface.text.ITextViewer viewer)
unselected
in interface org.eclipse.jface.text.contentassist.ICompletionProposalExtension2
public boolean validate(org.eclipse.jface.text.IDocument document, int offset, org.eclipse.jface.text.DocumentEvent event)
validate
in interface org.eclipse.jface.text.contentassist.ICompletionProposalExtension2
public void setMatcher(PrefixMatcher matcher)
public PrefixMatcher getMatcher()
public void setReplaceContextLength(int replaceContextLength)
public int getReplaceContextLength()
public void setPriority(int priority)
public int getPriority()
public int compareTo(ConfigurableCompletionProposal other)
compareTo
in interface java.lang.Comparable<ConfigurableCompletionProposal>
protected void setUpLinkedMode(org.eclipse.jface.text.IDocument document)
getCursorPosition()
and an exit policy that will
exit the mode when closingCharacter
is typed and an exit position at
getCursorPosition() + 1
.document
- the documentpublic void setTextApplier(ConfigurableCompletionProposal.IReplacementTextApplier textApplier)
public ConfigurableCompletionProposal.IReplacementTextApplier getTextApplier()
public org.eclipse.jface.text.IInformationControlCreator getInformationControlCreator()
getInformationControlCreator
in interface org.eclipse.jface.text.contentassist.ICompletionProposalExtension3
public java.lang.CharSequence getPrefixCompletionText(org.eclipse.jface.text.IDocument document, int completionOffset)
getPrefixCompletionText
in interface org.eclipse.jface.text.contentassist.ICompletionProposalExtension3
public int getPrefixCompletionStart(org.eclipse.jface.text.IDocument document, int completionOffset)
getPrefixCompletionStart
in interface org.eclipse.jface.text.contentassist.ICompletionProposalExtension3
public void setHover(IEObjectHover hover)
public java.lang.Object getAdditionalProposalInfo(org.eclipse.core.runtime.IProgressMonitor monitor)
getAdditionalProposalInfo
in interface org.eclipse.jface.text.contentassist.ICompletionProposalExtension5
public java.lang.String toString()
toString
in class java.lang.Object