Rational Developer for Power Systems Software
V7.6

com.ibm.etools.iseries.edit.codeassist.base
Class ISeriesEditorCodeAssistProcessor

java.lang.Object
  extended by com.ibm.etools.iseries.edit.codeassist.base.ISeriesEditorCodeAssistProcessor
Direct Known Subclasses:
ISeriesEditorDefaultCodeAssistProcessor, ISeriesEditorRPGILECodeAssistProcessor

public abstract class ISeriesEditorCodeAssistProcessor
extends Object


Field Summary
protected  Image _defaultImage
           
protected static char[] _deliminators
           
protected static char[] _delimiters
           
protected  HashMap _imageMap
           
protected  Image _infoImage
           
protected  Image _keywordImage
           
protected  int _lastProposalCase
           
protected  LpexSourceViewer _sourceViewer
           
protected  Image _templateImage
           
protected  IContextInformationValidator fValidator
           
 
Constructor Summary
ISeriesEditorCodeAssistProcessor(LpexSourceViewer sourceViewer)
          Constructor
 
Method Summary
protected  void addToMatches(String[][] proposals, ISeriesEditorProposalMatches matches, String imageID)
           
protected  void addToMatches(String[] proposals, String[] helps, ISeriesEditorProposalMatches matches, String imageID)
           
protected  void addToMatches(String[] proposals, String help, ISeriesEditorProposalMatches matches, String imageID)
           
protected  void addToMatches(String proposal, String help, ISeriesEditorProposalMatches matches, String imageID)
           
protected  void compareAndAddToMatches(String currentText, String[][] proposals, ISeriesEditorProposalMatches matches, String imageID)
           
protected  void compareAndAddToMatches(String currentText, String[] proposals, String[] helps, ISeriesEditorProposalMatches matches, String imageID)
           
protected  void compareAndAddToMatches(String currentText, String[] proposals, String[] helps, String[] postHelps, ISeriesEditorProposalMatches matches, String imageID)
           
protected  void compareAndAddToMatches(String currentText, String[] proposals, String help, ISeriesEditorProposalMatches matches, String imageID)
           
protected  void compareAndAddToMatches(String currentText, String completion, String help, ISeriesEditorProposalMatches matches, String imageID)
           
protected  void compareAndAddToMatches(String currentText, String completion, String help, ISeriesEditorProposalMatches matches, String imageID, boolean moreParameters)
           
protected  boolean compareTextAt(int column, String compareStr)
           
 ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int documentOffset)
          Return a list of completion proposals, based on the current cursor location in the text viewer.
 IContextInformation[] computeContextInformation(ITextViewer viewer, int documentOffsetBad)
          Return information about possible contexts, based on the current cursor location in the text viewer.
protected  ICompletionProposal createCompletionProposal(ISeriesEditorProposalMatch match, int replacementLength, int replacementOffset, int DSOffSet, int completionMode, boolean isReadonly, int theCase, String currentText, String currentFullText, int iCurrentLinePosition)
           
 int currentElement()
           
 int currentPosition()
           
protected  List findFunctionalMatches(String searchStr, ISeriesEditorFunctionalProposalMatch[] toSearch, int minParams)
           
protected  LpexDocumentLocation findLastPositionOf(char compareChar, int position, int element)
           
protected  LpexDocumentLocation findLastPositionOf(String compareString, int position, int element)
           
protected  ISeriesEditorProposalMatch findMatch(String searchStr, ISeriesEditorProposalMatch[] toSearch)
           
protected  String formatTemplateProposal(int columnOffset, String proposal)
           
protected  LpexView getActiveView()
          Retrieves the active LPEX view
protected  int getCase(String currentText, String currentFullText, int iCurrentLinePosition)
           
protected  char getCharAt(int column)
           
protected  char getCharAt(int column, int element)
           
 char[] getCompletionProposalAutoActivationCharacters()
          Return the characters which, when entered by the user, should automatically trigger the presentation of possible completions.
 char[] getContextInformationAutoActivationCharacters()
          Return the characters which, when entered by the user, should automatically trigger the presentation of context information.
 IContextInformationValidator getContextInformationValidator()
          Return a validator which will be used to determine when displayed post-insertion context information (tip) should be dismissed.
abstract  ISeriesEditorProposalMatches getContextMatches(int documentOffset, String currentText)
           
protected  String getCurrentFullText()
           
protected  String getCurrentText()
          Get the current whitespace-delimited document text preceding the cursor, for purposes of content assist.
protected  String getCurrentTextIgnoreParentheses()
          Get the current whitespace-delimited document text preceding the cursor, for purposes of content assist.
protected  int getCursorArgument(int position, int element, boolean continuation, int minColumn)
           
protected  int getCursorArgument(String functionName, int position, int element, boolean continuation, int minColumn)
           
 String getErrorMessage()
           
protected  String getFirstTextBetween(int scolumn, int fcolumn, boolean preserveCase, int element)
           
protected  Image getInfoImage()
           
protected  char getNextDeliminator()
           
protected  char getNextDeliminator(boolean ignoreSpaces)
           
protected  int getPositionOfNextDeliminator()
           
protected  int getPositionOfPreviousDeliminator()
           
protected  char getPreviousChar(int position, int element)
           
protected  char getPreviousChar(int position, int element, boolean lettersOnly)
           
protected  char getPreviousDeliminator()
           
protected  String getPreviousText()
           
protected  String getPreviousText(int position)
           
abstract  ISeriesEditorProposalMatches getProposalMatches(int documentOffset, String currentText)
           
protected  Image getTemplateImage()
           
protected  ISeriesTemplate[] getTemplates()
           
protected  String getTextAt(int column, boolean preserveCase)
           
protected  String getTextAt(int column, boolean preserveCase, int element)
           
protected  String getTextInRange(int startPosition, int endPosition, int element)
           
protected  String getTokenText(int position, int minPosition, int element)
           
protected  Image getTypeImage(String typeID)
           
protected abstract  boolean inParamBlock(int position, int element, int minPosition)
           
protected abstract  boolean inParamBlock(String functionName, int position, int element, int minPosition)
           
protected  boolean inParams()
           
protected  boolean inParams(int position, int element, int minPosition)
           
protected  boolean inParams(String functionName, int position, int element, int minPosition)
           
protected  boolean isDeliminator(char c)
           
protected  boolean isDelimiter(char c)
           
protected  boolean isTextBefore(int position)
           
 boolean lineHasCharBefore(int position, int element, char c)
           
protected  void processTemplates(String context, int iCurrentLinePosition, String currentText, ISeriesEditorProposalMatches matches)
           
protected  String stripLeadingChars(String currentText, int fromColumn, int toColumn)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_sourceViewer

protected LpexSourceViewer _sourceViewer

_lastProposalCase

protected int _lastProposalCase

_templateImage

protected Image _templateImage

_defaultImage

protected Image _defaultImage

_infoImage

protected Image _infoImage

_keywordImage

protected Image _keywordImage

_imageMap

protected HashMap _imageMap

_deliminators

protected static final char[] _deliminators

_delimiters

protected static final char[] _delimiters

fValidator

protected IContextInformationValidator fValidator
Constructor Detail

ISeriesEditorCodeAssistProcessor

public ISeriesEditorCodeAssistProcessor(LpexSourceViewer sourceViewer)
Constructor

Method Detail

getTemplates

protected ISeriesTemplate[] getTemplates()

getContextInformationValidator

public IContextInformationValidator getContextInformationValidator()
Return a validator which will be used to determine when displayed post-insertion context information (tip) should be dismissed. May return null if the processor is incapable of computing context information.

See Also:
IContentAssistProcessor#getContextInformationValidator()

getContextInformationAutoActivationCharacters

public char[] getContextInformationAutoActivationCharacters()
Return the characters which, when entered by the user, should automatically trigger the presentation of context information.

See Also:
IContentAssistProcessor#getContextInformationAutoActivationCharacters()

getCompletionProposalAutoActivationCharacters

public char[] getCompletionProposalAutoActivationCharacters()
Return the characters which, when entered by the user, should automatically trigger the presentation of possible completions.

See Also:
IContentAssistProcessor#getCompletionProposalAutoActivationCharacters()

getErrorMessage

public String getErrorMessage()
See Also:
IContentAssistProcessor#getErrorMessage()

computeContextInformation

public IContextInformation[] computeContextInformation(ITextViewer viewer,
                                                       int documentOffsetBad)
Return information about possible contexts, based on the current cursor location in the text viewer.

Parameters:
viewer - the LpexTextViewer requesting context information
documentOffset - ignored - content assist at the current cursor position is currently assumed
See Also:
IContentAssistProcessor#computeContextInformation(ITextViewer,int)

computeCompletionProposals

public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer,
                                                        int documentOffset)
Return a list of completion proposals, based on the current cursor location in the text viewer.

Parameters:
viewer - the LpexTextViewer requesting content-assist proposals
documentOffset - ignored - content assist at the current cursor position is currently assumed
See Also:
IContentAssistProcessor#computeCompletionProposals(ITextViewer,int)

createCompletionProposal

protected ICompletionProposal createCompletionProposal(ISeriesEditorProposalMatch match,
                                                       int replacementLength,
                                                       int replacementOffset,
                                                       int DSOffSet,
                                                       int completionMode,
                                                       boolean isReadonly,
                                                       int theCase,
                                                       String currentText,
                                                       String currentFullText,
                                                       int iCurrentLinePosition)

formatTemplateProposal

protected String formatTemplateProposal(int columnOffset,
                                        String proposal)

processTemplates

protected void processTemplates(String context,
                                int iCurrentLinePosition,
                                String currentText,
                                ISeriesEditorProposalMatches matches)

getInfoImage

protected Image getInfoImage()

getTemplateImage

protected Image getTemplateImage()

getTypeImage

protected Image getTypeImage(String typeID)

compareAndAddToMatches

protected void compareAndAddToMatches(String currentText,
                                      String completion,
                                      String help,
                                      ISeriesEditorProposalMatches matches,
                                      String imageID)

compareAndAddToMatches

protected void compareAndAddToMatches(String currentText,
                                      String completion,
                                      String help,
                                      ISeriesEditorProposalMatches matches,
                                      String imageID,
                                      boolean moreParameters)

compareAndAddToMatches

protected void compareAndAddToMatches(String currentText,
                                      String[] proposals,
                                      String[] helps,
                                      ISeriesEditorProposalMatches matches,
                                      String imageID)

compareAndAddToMatches

protected void compareAndAddToMatches(String currentText,
                                      String[] proposals,
                                      String[] helps,
                                      String[] postHelps,
                                      ISeriesEditorProposalMatches matches,
                                      String imageID)

compareAndAddToMatches

protected void compareAndAddToMatches(String currentText,
                                      String[] proposals,
                                      String help,
                                      ISeriesEditorProposalMatches matches,
                                      String imageID)

compareAndAddToMatches

protected void compareAndAddToMatches(String currentText,
                                      String[][] proposals,
                                      ISeriesEditorProposalMatches matches,
                                      String imageID)

addToMatches

protected void addToMatches(String[] proposals,
                            String[] helps,
                            ISeriesEditorProposalMatches matches,
                            String imageID)

addToMatches

protected void addToMatches(String[][] proposals,
                            ISeriesEditorProposalMatches matches,
                            String imageID)

addToMatches

protected void addToMatches(String[] proposals,
                            String help,
                            ISeriesEditorProposalMatches matches,
                            String imageID)

addToMatches

protected void addToMatches(String proposal,
                            String help,
                            ISeriesEditorProposalMatches matches,
                            String imageID)

findFunctionalMatches

protected List findFunctionalMatches(String searchStr,
                                     ISeriesEditorFunctionalProposalMatch[] toSearch,
                                     int minParams)

findMatch

protected ISeriesEditorProposalMatch findMatch(String searchStr,
                                               ISeriesEditorProposalMatch[] toSearch)

getCurrentText

protected String getCurrentText()
Get the current whitespace-delimited document text preceding the cursor, for purposes of content assist. Based on this partial text typed by the user, a table of completion proposals will be built up when the user asks for it (or is automatically triggered) - see #computeCompletionProposals().


getCurrentTextIgnoreParentheses

protected String getCurrentTextIgnoreParentheses()
Get the current whitespace-delimited document text preceding the cursor, for purposes of content assist. Based on this partial text typed by the user, a table of completion proposals will be built up when the user asks for it (or is automatically triggered) - see #computeCompletionProposals().


getPositionOfPreviousDeliminator

protected int getPositionOfPreviousDeliminator()

getPreviousDeliminator

protected char getPreviousDeliminator()

getPositionOfNextDeliminator

protected int getPositionOfNextDeliminator()

getNextDeliminator

protected char getNextDeliminator()

getNextDeliminator

protected char getNextDeliminator(boolean ignoreSpaces)

getPreviousText

protected String getPreviousText()

getPreviousText

protected String getPreviousText(int position)

isDeliminator

protected boolean isDeliminator(char c)

isDelimiter

protected boolean isDelimiter(char c)

getCase

protected int getCase(String currentText,
                      String currentFullText,
                      int iCurrentLinePosition)

findLastPositionOf

protected LpexDocumentLocation findLastPositionOf(char compareChar,
                                                  int position,
                                                  int element)

findLastPositionOf

protected LpexDocumentLocation findLastPositionOf(String compareString,
                                                  int position,
                                                  int element)

getPreviousChar

protected char getPreviousChar(int position,
                               int element)

getPreviousChar

protected char getPreviousChar(int position,
                               int element,
                               boolean lettersOnly)

inParams

protected boolean inParams()

inParams

protected boolean inParams(int position,
                           int element,
                           int minPosition)

inParams

protected boolean inParams(String functionName,
                           int position,
                           int element,
                           int minPosition)

getCharAt

protected char getCharAt(int column)

getCharAt

protected char getCharAt(int column,
                         int element)

getTextAt

protected String getTextAt(int column,
                           boolean preserveCase)

getFirstTextBetween

protected String getFirstTextBetween(int scolumn,
                                     int fcolumn,
                                     boolean preserveCase,
                                     int element)

getTextAt

protected String getTextAt(int column,
                           boolean preserveCase,
                           int element)

stripLeadingChars

protected String stripLeadingChars(String currentText,
                                   int fromColumn,
                                   int toColumn)

compareTextAt

protected boolean compareTextAt(int column,
                                String compareStr)

getCurrentFullText

protected String getCurrentFullText()

getTokenText

protected String getTokenText(int position,
                              int minPosition,
                              int element)

isTextBefore

protected boolean isTextBefore(int position)

getTextInRange

protected String getTextInRange(int startPosition,
                                int endPosition,
                                int element)

getCursorArgument

protected int getCursorArgument(int position,
                                int element,
                                boolean continuation,
                                int minColumn)

getCursorArgument

protected int getCursorArgument(String functionName,
                                int position,
                                int element,
                                boolean continuation,
                                int minColumn)

lineHasCharBefore

public boolean lineHasCharBefore(int position,
                                 int element,
                                 char c)

currentElement

public int currentElement()

currentPosition

public int currentPosition()

getContextMatches

public abstract ISeriesEditorProposalMatches getContextMatches(int documentOffset,
                                                               String currentText)

getProposalMatches

public abstract ISeriesEditorProposalMatches getProposalMatches(int documentOffset,
                                                                String currentText)

inParamBlock

protected abstract boolean inParamBlock(String functionName,
                                        int position,
                                        int element,
                                        int minPosition)

inParamBlock

protected abstract boolean inParamBlock(int position,
                                        int element,
                                        int minPosition)

getActiveView

protected LpexView getActiveView()
Retrieves the active LPEX view

Returns:
the active LPEX view
Since:
6.0.1.5/7.0.2

Rational Developer for Power Systems Software
V7.6

Copyright 2011 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.