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 interface
This interface is a non-regression utility. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.eclipse.jface.text.contentassist.IContentAssistantExtension2
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
assistSessionEnded
(org.eclipse.jface.text.contentassist.ContentAssistEvent event) void
assistSessionStarted
(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 String
extractPrefix
(org.eclipse.jface.text.IDocument document, int offset) Extracts the prefix at the given offset in the given document.protected String
extractPrefix
(org.eclipse.jface.text.ITextViewer viewer, int offset) char[]
char[]
org.eclipse.jface.text.contentassist.IContextInformationValidator
protected org.eclipse.jface.text.templates.TemplateContextType
getContextType
(org.eclipse.jface.text.ITextViewer viewer, org.eclipse.jface.text.IRegion region) protected org.eclipse.swt.graphics.Image
getImage
(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) void
orderProposalsAlphabetically
(boolean order) Reorder proposals.void
restrictProposalsToMatchingCases
(boolean restrict) Tells this processor to restrict is proposals to those starting with matching cases.void
restrictProposalsToVisibility
(boolean restrict) Tells this processor to restrict its proposal to those element visible in the actual invocation context.void
selectionChanged
(org.eclipse.jface.text.contentassist.ICompletionProposal proposal, boolean smartToggle) void
setCompletionProposalAutoActivationCharacters
(char[] activationSet) Sets this processor's set of characters triggering the activation of the completion proposal computation.void
Methods 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:
computeCompletionProposals
in interfaceorg.eclipse.jface.text.contentassist.IContentAssistProcessor
- Overrides:
computeCompletionProposals
in 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:
computeContextInformation
in interfaceorg.eclipse.jface.text.contentassist.IContentAssistProcessor
- Overrides:
computeContextInformation
in classorg.eclipse.jface.text.templates.TemplateCompletionProcessor
- See Also:
-
IContentAssistProcessor.computeContextInformation(org.eclipse.jface.text.ITextViewer, int)
-
getCompletionProposalAutoActivationCharacters
public char[] getCompletionProposalAutoActivationCharacters()- Specified by:
getCompletionProposalAutoActivationCharacters
in interfaceorg.eclipse.jface.text.contentassist.IContentAssistProcessor
- Overrides:
getCompletionProposalAutoActivationCharacters
in classorg.eclipse.jface.text.templates.TemplateCompletionProcessor
- See Also:
-
IContentAssistProcessor.getCompletionProposalAutoActivationCharacters()
-
getContextInformationAutoActivationCharacters
public char[] getContextInformationAutoActivationCharacters()- Specified by:
getContextInformationAutoActivationCharacters
in interfaceorg.eclipse.jface.text.contentassist.IContentAssistProcessor
- Overrides:
getContextInformationAutoActivationCharacters
in classorg.eclipse.jface.text.templates.TemplateCompletionProcessor
- See Also:
-
IContentAssistProcessor.getContextInformationAutoActivationCharacters()
-
getContextInformationValidator
public org.eclipse.jface.text.contentassist.IContextInformationValidator getContextInformationValidator()- Specified by:
getContextInformationValidator
in interfaceorg.eclipse.jface.text.contentassist.IContentAssistProcessor
- Overrides:
getContextInformationValidator
in 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
-true
if 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
-true
if 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:
getErrorMessage
in interfaceorg.eclipse.jface.text.contentassist.IContentAssistProcessor
- Overrides:
getErrorMessage
in classorg.eclipse.jface.text.templates.TemplateCompletionProcessor
- See Also:
-
IContentAssistProcessor.getErrorMessage()
-
getTemplates
- Specified by:
getTemplates
in 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:
getContextType
in 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:
getImage
in classorg.eclipse.jface.text.templates.TemplateCompletionProcessor
- See Also:
-
TemplateCompletionProcessor.getImage(org.eclipse.jface.text.templates.Template)
-
extractPrefix
- Overrides:
extractPrefix
in 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:
assistSessionStarted
in 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:
assistSessionEnded
in 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:
selectionChanged
in interfaceorg.eclipse.jface.text.contentassist.ICompletionListener
- See Also:
-
ICompletionListener.selectionChanged(org.eclipse.jface.text.contentassist.ICompletionProposal, boolean)
-