iSeries Remote Systems
v6.0.0

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

java.lang.Object
  extended bycom.ibm.etools.iseries.editor.codeassist.base.ISeriesEditorCodeAssistProcessor
All Implemented Interfaces:
com.ibm.lpex.alef.contentassist.IContentAssistProcessor
Direct Known Subclasses:
ISeriesEditorDefaultCodeAssistProcessor, ISeriesEditorRPGILECodeAssistProcessor

public abstract class ISeriesEditorCodeAssistProcessor
extends Object
implements com.ibm.lpex.alef.contentassist.IContentAssistProcessor


Field Summary
protected  Image _defaultImage
           
protected static char[] _deliminators
           
protected  HashMap _imageMap
           
protected  Image _infoImage
           
protected  Image _keywordImage
           
protected  int _lastProposalCase
           
protected  Image _templateImage
           
protected  com.ibm.lpex.core.LpexView _view
           
protected  com.ibm.lpex.alef.contentassist.IContextInformationValidator fValidator
           
 
Constructor Summary
ISeriesEditorCodeAssistProcessor(com.ibm.lpex.core.LpexView view)
          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  boolean compareTextAt(int column, String compareStr)
           
 com.ibm.lpex.alef.contentassist.ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int documentOffset)
          Return a list of completion proposals, based on the current cursor location in the text viewer.
 com.ibm.lpex.alef.contentassist.IContextInformation[] computeContextInformation(ITextViewer viewer, int documentOffsetBad)
          Return information about possible contexts, based on the current cursor location in the text viewer.
protected  com.ibm.lpex.alef.contentassist.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  com.ibm.lpex.core.LpexDocumentLocation findLastPositionOf(char compareChar, int position, int element)
           
protected  com.ibm.lpex.core.LpexDocumentLocation findLastPositionOf(String compareString, int position, int element)
           
protected  ISeriesEditorProposalMatch findMatch(String searchStr, ISeriesEditorProposalMatch[] toSearch)
           
protected  String formatTemplateProposal(int columnOffset, String proposal)
           
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.
 com.ibm.lpex.alef.contentassist.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  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 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

_view

protected com.ibm.lpex.core.LpexView _view

_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

fValidator

protected com.ibm.lpex.alef.contentassist.IContextInformationValidator fValidator
Constructor Detail

ISeriesEditorCodeAssistProcessor

public ISeriesEditorCodeAssistProcessor(com.ibm.lpex.core.LpexView view)
Constructor

Method Detail

getTemplates

protected ISeriesTemplate[] getTemplates()

getContextInformationValidator

public com.ibm.lpex.alef.contentassist.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.

Specified by:
getContextInformationValidator in interface com.ibm.lpex.alef.contentassist.IContentAssistProcessor
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.

Specified by:
getContextInformationAutoActivationCharacters in interface com.ibm.lpex.alef.contentassist.IContentAssistProcessor
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.

Specified by:
getCompletionProposalAutoActivationCharacters in interface com.ibm.lpex.alef.contentassist.IContentAssistProcessor
See Also:
IContentAssistProcessor.getCompletionProposalAutoActivationCharacters()

getErrorMessage

public String getErrorMessage()
Specified by:
getErrorMessage in interface com.ibm.lpex.alef.contentassist.IContentAssistProcessor
See Also:
IContentAssistProcessor.getErrorMessage()

computeContextInformation

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

Specified by:
computeContextInformation in interface com.ibm.lpex.alef.contentassist.IContentAssistProcessor
Parameters:
viewer - the LpexTextViewer requesting context information
See Also:
IContentAssistProcessor.computeContextInformation(ITextViewer,int)

computeCompletionProposals

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

Specified by:
computeCompletionProposals in interface com.ibm.lpex.alef.contentassist.IContentAssistProcessor
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 com.ibm.lpex.alef.contentassist.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[] 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().


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)

getCase

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

findLastPositionOf

protected com.ibm.lpex.core.LpexDocumentLocation findLastPositionOf(char compareChar,
                                                                    int position,
                                                                    int element)

findLastPositionOf

protected com.ibm.lpex.core.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)

iSeries Remote Systems
v6.0.0

Copyright © 2005 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.