org.drools.eclipse.dsl.editor.completion
Class DSLRuleCompletionProcessor

java.lang.Object
  extended by org.drools.eclipse.editors.completion.AbstractCompletionProcessor
      extended by org.drools.eclipse.editors.completion.DefaultCompletionProcessor
          extended by org.drools.eclipse.editors.completion.RuleCompletionProcessor
              extended by org.drools.eclipse.dsl.editor.completion.DSLRuleCompletionProcessor
All Implemented Interfaces:
org.eclipse.jface.text.contentassist.IContentAssistProcessor

public class DSLRuleCompletionProcessor
extends RuleCompletionProcessor

For handling DSL rules.


Field Summary
 
Fields inherited from class org.drools.eclipse.editors.completion.DefaultCompletionProcessor
IMPORT_PATTERN, METHOD_ICON, VARIABLE_ICON
 
Constructor Summary
DSLRuleCompletionProcessor(AbstractRuleEditor editor)
           
 
Method Summary
protected  void addLHSCompletionProposals(List list, int documentOffset, org.drools.lang.Location location, String prefix, String backText)
           
protected  void addRHSCompletionProposals(List list, int documentOffset, String prefix, String backText, String conditions, String consequence)
           
protected  DSLRuleEditor getDSLRuleEditor()
           
 String getLastLine(String backText)
          because of how the backText works, we need to get the last line, so that we can pass it to the DSLUtility
 String getLastNonDashLine(String backText)
          Returns the last line that doesn't start with a dash
protected  List getProposals(DSLAdapter adapter, String obj, String last, boolean firstLine)
          The DSLTree is configurable.
 
Methods inherited from class org.drools.eclipse.editors.completion.RuleCompletionProcessor
addAllNewProposals, containsProposal, getCompletionProposals, mvelifyProposals, processMacros
 
Methods inherited from class org.drools.eclipse.editors.completion.DefaultCompletionProcessor
doesNotContainFieldCompletion, getAllClassProposals, getAttributes, getClassesInPackage, getFunctions, getGlobals, getImports, getJavaCompletionProposals, getJavaCompletionProposals, getPackage, getPossibleProposals, getUniqueImports, requestJavaCompletionProposals, requestJavaCompletionProposals
 
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
 

Constructor Detail

DSLRuleCompletionProcessor

public DSLRuleCompletionProcessor(AbstractRuleEditor editor)
Method Detail

getDSLRuleEditor

protected DSLRuleEditor getDSLRuleEditor()

addRHSCompletionProposals

protected void addRHSCompletionProposals(List list,
                                         int documentOffset,
                                         String prefix,
                                         String backText,
                                         String conditions,
                                         String consequence)
Overrides:
addRHSCompletionProposals in class RuleCompletionProcessor

addLHSCompletionProposals

protected void addLHSCompletionProposals(List list,
                                         int documentOffset,
                                         org.drools.lang.Location location,
                                         String prefix,
                                         String backText)
Overrides:
addLHSCompletionProposals in class RuleCompletionProcessor

getLastLine

public String getLastLine(String backText)
because of how the backText works, we need to get the last line, so that we can pass it to the DSLUtility

Parameters:
backText -
Returns:

getLastNonDashLine

public String getLastNonDashLine(String backText)
Returns the last line that doesn't start with a dash

Parameters:
backText -
Returns:

getProposals

protected List getProposals(DSLAdapter adapter,
                            String obj,
                            String last,
                            boolean firstLine)
The DSLTree is configurable. It can either return just the child of the last token found, or it can traverse the tree and generate all the combinations beneath the last matching node. TODO I don't know how to add configuration to the editor, so it needs to be hooked up to the configuration for the editor later.

Parameters:
last -
Returns:


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