Package org.eclipse.m2m.atl.adt.ui.text.atl

## 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 Classes
`static interface` `AtlCompletionProcessor.IATLCompletionRecorder` This interface is a non-regression utility.

### Field Summary

Fields
`protected org.eclipse.jface.text.contentassist.IContentAssistantExtension2` `fContentAssistant`

### Constructor Summary

Constructors
`AtlCompletionProcessor​(org.eclipse.ui.IEditorPart editor)` Constructor.

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`void` `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 java.lang.String` `extractPrefix​(org.eclipse.jface.text.IDocument document, int offset)` Extracts the prefix at the given offset in the given document.
`protected java.lang.String` `extractPrefix​(org.eclipse.jface.text.ITextViewer viewer, int offset)`
`char[]` `getCompletionProposalAutoActivationCharacters()`
`char[]` `getContextInformationAutoActivationCharacters()`
`org.eclipse.jface.text.contentassist.IContextInformationValidator` `getContextInformationValidator()`
`protected org.eclipse.jface.text.templates.TemplateContextType` `getContextType​(org.eclipse.jface.text.ITextViewer viewer, org.eclipse.jface.text.IRegion region)`
`java.lang.String` `getErrorMessage()`
`protected org.eclipse.swt.graphics.Image` `getImage​(org.eclipse.jface.text.templates.Template template)`
`AtlSourceManager` `getSourceManager()` Returns the source manager, which contains the main ATL file model.
`protected org.eclipse.jface.text.templates.Template[]` `getTemplates​(java.lang.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` `setRecorder​(AtlCompletionProcessor.IATLCompletionRecorder recorder)`

### Methods inherited from class org.eclipse.jface.text.templates.TemplateCompletionProcessor

`createContext, createProposal, createProposal, getRelevance`

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

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

### Field Detail

#### fContentAssistant

    protected org.eclipse.jface.text.contentassist.IContentAssistantExtension2 fContentAssistant

### Constructor Detail

#### AtlCompletionProcessor

    public AtlCompletionProcessor​(org.eclipse.ui.IEditorPart editor)

Constructor.

Parameters:
  `editor` - the editor part

### Method Detail

#### getSourceManager

    public AtlSourceManager getSourceManager()

Returns the source manager, which contains the main ATL file model.

Returns:
  the source manager

#### setRecorder

    public void setRecorder​(AtlCompletionProcessor.IATLCompletionRecorder recorder)

#### computeCompletionProposals

    public org.eclipse.jface.text.contentassist.ICompletionProposal[] computeCompletionProposals​(org.eclipse.jface.text.ITextViewer refViewer,
                                                                                                 int documentOffset)

Specified by:
  `computeCompletionProposals` in interface `org.eclipse.jface.text.contentassist.IContentAssistProcessor`
Overrides:
  `computeCompletionProposals` in class `org.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 viewer
  `document` - the document
  `offset` - 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 interface `org.eclipse.jface.text.contentassist.IContentAssistProcessor`
Overrides:
  `computeContextInformation` in class `org.eclipse.jface.text.templates.TemplateCompletionProcessor`
See Also:
  `IContentAssistProcessor.computeContextInformation(org.eclipse.jface.text.ITextViewer, int)`

#### getCompletionProposalAutoActivationCharacters

    public char[] getCompletionProposalAutoActivationCharacters()

Specified by:
  `getCompletionProposalAutoActivationCharacters` in interface `org.eclipse.jface.text.contentassist.IContentAssistProcessor`
Overrides:
  `getCompletionProposalAutoActivationCharacters` in class `org.eclipse.jface.text.templates.TemplateCompletionProcessor`
See Also:
  `IContentAssistProcessor.getCompletionProposalAutoActivationCharacters()`

#### getContextInformationAutoActivationCharacters

    public char[] getContextInformationAutoActivationCharacters()

Specified by:
  `getContextInformationAutoActivationCharacters` in interface `org.eclipse.jface.text.contentassist.IContentAssistProcessor`
Overrides:
  `getContextInformationAutoActivationCharacters` in class `org.eclipse.jface.text.templates.TemplateCompletionProcessor`
See Also:
  `IContentAssistProcessor.getContextInformationAutoActivationCharacters()`

#### getContextInformationValidator

    public org.eclipse.jface.text.contentassist.IContextInformationValidator getContextInformationValidator()

Specified by:
  `getContextInformationValidator` in interface `org.eclipse.jface.text.contentassist.IContentAssistProcessor`
Overrides:
  `getContextInformationValidator` in class `org.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

    public java.lang.String getErrorMessage()

Specified by:
  `getErrorMessage` in interface `org.eclipse.jface.text.contentassist.IContentAssistProcessor`
Overrides:
  `getErrorMessage` in class `org.eclipse.jface.text.templates.TemplateCompletionProcessor`
See Also:
  `IContentAssistProcessor.getErrorMessage()`

#### getTemplates

    protected org.eclipse.jface.text.templates.Template[] getTemplates​(java.lang.String contextTypeId)

Specified by:
  `getTemplates` in class `org.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 class `org.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 class `org.eclipse.jface.text.templates.TemplateCompletionProcessor`
See Also:
  `TemplateCompletionProcessor.getImage(org.eclipse.jface.text.templates.Template)`

#### extractPrefix

    protected java.lang.String extractPrefix​(org.eclipse.jface.text.ITextViewer viewer,
                                             int offset)

Overrides:
  `extractPrefix` in class `org.eclipse.jface.text.templates.TemplateCompletionProcessor`
See Also:
  `TemplateCompletionProcessor.extractPrefix(org.eclipse.jface.text.ITextViewer, int)`

#### extractPrefix

    public static java.lang.String extractPrefix​(org.eclipse.jface.text.IDocument document,
                                                 int offset)

Extracts the prefix at the given offset in the given document.

Parameters:
  `document` - the document
  `offset` - the given offset
Returns:
  the prefix

#### assistSessionStarted

    public void assistSessionStarted​(org.eclipse.jface.text.contentassist.ContentAssistEvent event)

Specified by:
  `assistSessionStarted` in interface `org.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 interface `org.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 interface `org.eclipse.jface.text.contentassist.ICompletionListener`
See Also:
  `ICompletionListener.selectionChanged(org.eclipse.jface.text.contentassist.ICompletionProposal, boolean)`