Class AtlCompletionProcessor
java.lang.Object
org.eclipse.jface.text.templates.TemplateCompletionProcessor
org.eclipse.m2m.atl.adt.ui.text.atl.AtlCompletionProcessor
- All Implemented Interfaces:
org.eclipse.jface.text.contentassist.ICompletionListener,org.eclipse.jface.text.contentassist.IContentAssistProcessor
public class AtlCompletionProcessor
extends org.eclipse.jface.text.templates.TemplateCompletionProcessor
implements org.eclipse.jface.text.contentassist.IContentAssistProcessor, org.eclipse.jface.text.contentassist.ICompletionListener
The completion processor, provides content assist.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceThis interface is a non-regression utility. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.eclipse.jface.text.contentassist.IContentAssistantExtension2 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidassistSessionEnded(org.eclipse.jface.text.contentassist.ContentAssistEvent event) voidassistSessionStarted(org.eclipse.jface.text.contentassist.ContentAssistEvent event) org.eclipse.jface.text.contentassist.ICompletionProposal[]computeCompletionProposals(org.eclipse.jface.text.ITextViewer refViewer, int documentOffset) org.eclipse.jface.text.contentassist.ICompletionProposal[]computeCompletionProposals(org.eclipse.jface.text.ITextViewer viewer, org.eclipse.jface.text.IDocument document, int offset) Computes the ATL completion proposals from a viewer or a document.org.eclipse.jface.text.contentassist.IContextInformation[]computeContextInformation(org.eclipse.jface.text.ITextViewer viewer, int offset) static StringextractPrefix(org.eclipse.jface.text.IDocument document, int offset) Extracts the prefix at the given offset in the given document.protected StringextractPrefix(org.eclipse.jface.text.ITextViewer viewer, int offset) char[]char[]org.eclipse.jface.text.contentassist.IContextInformationValidatorprotected org.eclipse.jface.text.templates.TemplateContextTypegetContextType(org.eclipse.jface.text.ITextViewer viewer, org.eclipse.jface.text.IRegion region) protected org.eclipse.swt.graphics.ImagegetImage(org.eclipse.jface.text.templates.Template template) Returns the source manager, which contains the main ATL file model.protected org.eclipse.jface.text.templates.Template[]getTemplates(String contextTypeId) voidorderProposalsAlphabetically(boolean order) Reorder proposals.voidrestrictProposalsToMatchingCases(boolean restrict) Tells this processor to restrict is proposals to those starting with matching cases.voidrestrictProposalsToVisibility(boolean restrict) Tells this processor to restrict its proposal to those element visible in the actual invocation context.voidselectionChanged(org.eclipse.jface.text.contentassist.ICompletionProposal proposal, boolean smartToggle) voidsetCompletionProposalAutoActivationCharacters(char[] activationSet) Sets this processor's set of characters triggering the activation of the completion proposal computation.voidMethods inherited from class org.eclipse.jface.text.templates.TemplateCompletionProcessor
createContext, createProposal, createProposal, getRelevance
-
Field Details
-
fContentAssistant
protected org.eclipse.jface.text.contentassist.IContentAssistantExtension2 fContentAssistant
-
-
Constructor Details
-
AtlCompletionProcessor
public AtlCompletionProcessor(org.eclipse.ui.IEditorPart editor) Constructor.- Parameters:
editor- the editor part
-
-
Method Details
-
getSourceManager
Returns the source manager, which contains the main ATL file model.- Returns:
- the source manager
-
setRecorder
-
computeCompletionProposals
public org.eclipse.jface.text.contentassist.ICompletionProposal[] computeCompletionProposals(org.eclipse.jface.text.ITextViewer refViewer, int documentOffset) - Specified by:
computeCompletionProposalsin interfaceorg.eclipse.jface.text.contentassist.IContentAssistProcessor- Overrides:
computeCompletionProposalsin classorg.eclipse.jface.text.templates.TemplateCompletionProcessor- See Also:
-
IContentAssistProcessor.computeCompletionProposals(org.eclipse.jface.text.ITextViewer, int)
-
computeCompletionProposals
public org.eclipse.jface.text.contentassist.ICompletionProposal[] computeCompletionProposals(org.eclipse.jface.text.ITextViewer viewer, org.eclipse.jface.text.IDocument document, int offset) throws org.eclipse.jface.text.BadLocationException Computes the ATL completion proposals from a viewer or a document.- Parameters:
viewer- the current viewerdocument- the documentoffset- the offset- Returns:
- the proposals
- Throws:
org.eclipse.jface.text.BadLocationException
-
computeContextInformation
public org.eclipse.jface.text.contentassist.IContextInformation[] computeContextInformation(org.eclipse.jface.text.ITextViewer viewer, int offset) - Specified by:
computeContextInformationin interfaceorg.eclipse.jface.text.contentassist.IContentAssistProcessor- Overrides:
computeContextInformationin classorg.eclipse.jface.text.templates.TemplateCompletionProcessor- See Also:
-
IContentAssistProcessor.computeContextInformation(org.eclipse.jface.text.ITextViewer, int)
-
getCompletionProposalAutoActivationCharacters
public char[] getCompletionProposalAutoActivationCharacters()- Specified by:
getCompletionProposalAutoActivationCharactersin interfaceorg.eclipse.jface.text.contentassist.IContentAssistProcessor- Overrides:
getCompletionProposalAutoActivationCharactersin classorg.eclipse.jface.text.templates.TemplateCompletionProcessor- See Also:
-
IContentAssistProcessor.getCompletionProposalAutoActivationCharacters()
-
getContextInformationAutoActivationCharacters
public char[] getContextInformationAutoActivationCharacters()- Specified by:
getContextInformationAutoActivationCharactersin interfaceorg.eclipse.jface.text.contentassist.IContentAssistProcessor- Overrides:
getContextInformationAutoActivationCharactersin classorg.eclipse.jface.text.templates.TemplateCompletionProcessor- See Also:
-
IContentAssistProcessor.getContextInformationAutoActivationCharacters()
-
getContextInformationValidator
public org.eclipse.jface.text.contentassist.IContextInformationValidator getContextInformationValidator()- Specified by:
getContextInformationValidatorin interfaceorg.eclipse.jface.text.contentassist.IContentAssistProcessor- Overrides:
getContextInformationValidatorin classorg.eclipse.jface.text.templates.TemplateCompletionProcessor- See Also:
-
IContentAssistProcessor.getContextInformationValidator()
-
orderProposalsAlphabetically
public void orderProposalsAlphabetically(boolean order) Reorder proposals.- Parameters:
order- the order to set.
-
restrictProposalsToMatchingCases
public void restrictProposalsToMatchingCases(boolean restrict) Tells this processor to restrict is proposals to those starting with matching cases.- Parameters:
restrict-trueif proposals should be restricted
-
restrictProposalsToVisibility
public void restrictProposalsToVisibility(boolean restrict) Tells this processor to restrict its proposal to those element visible in the actual invocation context.- Parameters:
restrict-trueif proposals should be restricted
-
setCompletionProposalAutoActivationCharacters
public void setCompletionProposalAutoActivationCharacters(char[] activationSet) Sets this processor's set of characters triggering the activation of the completion proposal computation.- Parameters:
activationSet- the activation set
-
getErrorMessage
- Specified by:
getErrorMessagein interfaceorg.eclipse.jface.text.contentassist.IContentAssistProcessor- Overrides:
getErrorMessagein classorg.eclipse.jface.text.templates.TemplateCompletionProcessor- See Also:
-
IContentAssistProcessor.getErrorMessage()
-
getTemplates
- Specified by:
getTemplatesin classorg.eclipse.jface.text.templates.TemplateCompletionProcessor- See Also:
-
TemplateCompletionProcessor.getTemplates(java.lang.String)
-
getContextType
protected org.eclipse.jface.text.templates.TemplateContextType getContextType(org.eclipse.jface.text.ITextViewer viewer, org.eclipse.jface.text.IRegion region) - Specified by:
getContextTypein classorg.eclipse.jface.text.templates.TemplateCompletionProcessor- See Also:
-
TemplateCompletionProcessor.getContextType(org.eclipse.jface.text.ITextViewer, org.eclipse.jface.text.IRegion)
-
getImage
protected org.eclipse.swt.graphics.Image getImage(org.eclipse.jface.text.templates.Template template) - Specified by:
getImagein classorg.eclipse.jface.text.templates.TemplateCompletionProcessor- See Also:
-
TemplateCompletionProcessor.getImage(org.eclipse.jface.text.templates.Template)
-
extractPrefix
- Overrides:
extractPrefixin classorg.eclipse.jface.text.templates.TemplateCompletionProcessor- See Also:
-
TemplateCompletionProcessor.extractPrefix(org.eclipse.jface.text.ITextViewer, int)
-
extractPrefix
Extracts the prefix at the given offset in the given document.- Parameters:
document- the documentoffset- the given offset- Returns:
- the prefix
-
assistSessionStarted
public void assistSessionStarted(org.eclipse.jface.text.contentassist.ContentAssistEvent event) - Specified by:
assistSessionStartedin interfaceorg.eclipse.jface.text.contentassist.ICompletionListener- See Also:
-
ICompletionListener.assistSessionStarted(org.eclipse.jface.text.contentassist.ContentAssistEvent)
-
assistSessionEnded
public void assistSessionEnded(org.eclipse.jface.text.contentassist.ContentAssistEvent event) - Specified by:
assistSessionEndedin interfaceorg.eclipse.jface.text.contentassist.ICompletionListener- See Also:
-
ICompletionListener.assistSessionEnded(org.eclipse.jface.text.contentassist.ContentAssistEvent)
-
selectionChanged
public void selectionChanged(org.eclipse.jface.text.contentassist.ICompletionProposal proposal, boolean smartToggle) - Specified by:
selectionChangedin interfaceorg.eclipse.jface.text.contentassist.ICompletionListener- See Also:
-
ICompletionListener.selectionChanged(org.eclipse.jface.text.contentassist.ICompletionProposal, boolean)
-