org.drools.eclipse.editors.completion
Class DefaultCompletionProcessor

java.lang.Object
  extended by org.drools.eclipse.editors.completion.AbstractCompletionProcessor
      extended by org.drools.eclipse.editors.completion.DefaultCompletionProcessor
All Implemented Interfaces:
org.eclipse.jface.text.contentassist.IContentAssistProcessor
Direct Known Subclasses:
GlobalCompletionProcessor, ImportCompletionProcessor, RuleCompletionProcessor

public class DefaultCompletionProcessor
extends AbstractCompletionProcessor

This is the basic completion processor that is used when the editor is outside of a rule block partition. The provides the content assistance for basic rule assembly stuff. This processor will also read behind the current editing position, to provide some context to help provide the pop up list.


Field Summary
protected static org.eclipse.swt.graphics.Image CLASS_ICON
           
protected static Pattern IMPORT_PATTERN
           
protected static org.eclipse.swt.graphics.Image METHOD_ICON
           
protected static org.eclipse.swt.graphics.Image VARIABLE_ICON
           
 
Constructor Summary
DefaultCompletionProcessor(AbstractRuleEditor editor)
           
 
Method Summary
protected static boolean doesNotContainFieldCompletion(String completion, List completions)
           
protected  List getAllClassProposals(String classNameStart, int documentOffset, String prefix)
           
protected  Map getAttributes()
           
protected  List<String> getClassesInPackage()
           
protected  List getCompletionProposals(org.eclipse.jface.text.ITextViewer viewer, int documentOffset)
          Returns a list of RuleCompletionProposals.
protected  List getFunctions()
           
protected  List<org.drools.lang.descr.GlobalDescr> getGlobals()
           
protected  List<String> getImports()
           
protected  List<RuleCompletionProposal> getJavaCompletionProposals(int documentOffset, String javaText, String prefix, Map params)
           
protected  List<RuleCompletionProposal> getJavaCompletionProposals(int documentOffset, String javaText, String prefix, Map params, boolean useDrools, boolean useContext)
           
protected  String getPackage()
           
protected  List<RuleCompletionProposal> getPossibleProposals(org.eclipse.jface.text.ITextViewer viewer, int documentOffset, String backText, String prefix)
           
protected  Set getUniqueImports()
           
protected  void requestJavaCompletionProposals(String javaText, String prefix, int documentOffset, Map params, Collection results)
           
protected  void requestJavaCompletionProposals(String javaText, String prefix, int documentOffset, Map params, Collection results, boolean useDrools, boolean useContext)
           
 
Methods inherited from class org.drools.eclipse.editors.completion.AbstractCompletionProcessor
computeCompletionProposals, computeContextInformation, filterProposalsOnPrefix, getCompletionProposalAutoActivationCharacters, getContextInformationAutoActivationCharacters, getContextInformationValidator, getEditor, getErrorMessage, readBackwards
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IMPORT_PATTERN

protected static final Pattern IMPORT_PATTERN

VARIABLE_ICON

protected static final org.eclipse.swt.graphics.Image VARIABLE_ICON

METHOD_ICON

protected static final org.eclipse.swt.graphics.Image METHOD_ICON

CLASS_ICON

protected static final org.eclipse.swt.graphics.Image CLASS_ICON
Constructor Detail

DefaultCompletionProcessor

public DefaultCompletionProcessor(AbstractRuleEditor editor)
Method Detail

getCompletionProposals

protected List getCompletionProposals(org.eclipse.jface.text.ITextViewer viewer,
                                      int documentOffset)
Description copied from class: AbstractCompletionProcessor
Returns a list of RuleCompletionProposals.

Specified by:
getCompletionProposals in class AbstractCompletionProcessor
Returns:

getAllClassProposals

protected List getAllClassProposals(String classNameStart,
                                    int documentOffset,
                                    String prefix)

getPossibleProposals

protected List<RuleCompletionProposal> getPossibleProposals(org.eclipse.jface.text.ITextViewer viewer,
                                                            int documentOffset,
                                                            String backText,
                                                            String prefix)

getJavaCompletionProposals

protected List<RuleCompletionProposal> getJavaCompletionProposals(int documentOffset,
                                                                  String javaText,
                                                                  String prefix,
                                                                  Map params)

getJavaCompletionProposals

protected List<RuleCompletionProposal> getJavaCompletionProposals(int documentOffset,
                                                                  String javaText,
                                                                  String prefix,
                                                                  Map params,
                                                                  boolean useDrools,
                                                                  boolean useContext)

doesNotContainFieldCompletion

protected static boolean doesNotContainFieldCompletion(String completion,
                                                       List completions)

requestJavaCompletionProposals

protected void requestJavaCompletionProposals(String javaText,
                                              String prefix,
                                              int documentOffset,
                                              Map params,
                                              Collection results)

requestJavaCompletionProposals

protected void requestJavaCompletionProposals(String javaText,
                                              String prefix,
                                              int documentOffset,
                                              Map params,
                                              Collection results,
                                              boolean useDrools,
                                              boolean useContext)

getPackage

protected String getPackage()

getImports

protected List<String> getImports()

getUniqueImports

protected Set getUniqueImports()

getFunctions

protected List getFunctions()

getAttributes

protected Map getAttributes()

getGlobals

protected List<org.drools.lang.descr.GlobalDescr> getGlobals()

getClassesInPackage

protected List<String> getClassesInPackage()


Copyright © 2001-2012 JBoss by Red Hat. All Rights Reserved.