iSeries Remote Systems
v6.0.1

com.ibm.etools.iseries.editor.codeassist.cobol
Class CompletionProcessor

java.lang.Object
  extended bycom.ibm.etools.iseries.editor.codeassist.cobol.CompletionProcessor
All Implemented Interfaces:
com.ibm.lpex.alef.contentassist.IContentAssistProcessor
Direct Known Subclasses:
CobolCompletionProcessor

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

Abstract class for code assist on LPEX editor. This class implements IContentAssistProcessor, which prepares code assist functions. Subclass should be implemented for each language.

LPEX editor uses methods of this class or subclass's methods for code assist.

See Also:
IContentAssistProcessor

Field Summary
protected static boolean fDebug
          Flag if debug information is outputted.
 
Constructor Summary
CompletionProcessor(com.ibm.lpex.core.LpexParser iSeriesParser)
          Construct an object of CompletionProcessor.
 
Method Summary
 com.ibm.lpex.alef.contentassist.ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int documentOffset)
          Return a list of completion proposals based on the specified location within the document that corresponds to the current cursor position within the text viewer.
 com.ibm.lpex.alef.contentassist.IContextInformation[] computeContextInformation(ITextViewer viewer, int documentOffset)
          Return a list of information about possible contexts, based on the specified location within the document that corresponds to the current cursor position within the text viewer.
 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 used to determine when displayed context information should be dismissed.
 String getErrorMessage()
          Return the reason why this content assist processor was unable to produce any completion proposals or context information.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fDebug

protected static boolean fDebug
Flag if debug information is outputted.

Constructor Detail

CompletionProcessor

public CompletionProcessor(com.ibm.lpex.core.LpexParser iSeriesParser)
Construct an object of CompletionProcessor.

This method creates a new processor, and also creates a language parser used for parsing the source file and syntax libraries for check the language syntax.

Method Detail

computeCompletionProposals

public com.ibm.lpex.alef.contentassist.ICompletionProposal[] computeCompletionProposals(ITextViewer viewer,
                                                                                        int documentOffset)
Return a list of completion proposals based on the specified location within the document that corresponds to the current cursor position within the text viewer. LPEX currently ignores documentOffset, assuming the current cursor position.

When the user requests code assist, LPEX invokes this method and presents the returned proposals.

This method gets the current statement string from the parser, and gets the possible syntax elements by using syntax library, and then creats the proposals based on defined syntax elements in the source file.

Specified by:
computeCompletionProposals in interface com.ibm.lpex.alef.contentassist.IContentAssistProcessor
Parameters:
viewer - the LpexTextViewer requesting content-assist proposals.
documentOffset - ignored (LPEX's content assist will probably always pass a -1 here anyway), content assist at the current cursor position is assumed.
Returns:
an arry of complition proposals, or null if no proposals are possible.
See Also:
IContentAssistProcessor.computeCompletionProposals(ITextViewer, int).

computeContextInformation

public com.ibm.lpex.alef.contentassist.IContextInformation[] computeContextInformation(ITextViewer viewer,
                                                                                       int documentOffset)
Return a list of information about possible contexts, based on the specified location within the document that corresponds to the current cursor position within the text viewer. LPEX currently ignores documentOffset, assuming the current cursor position. Current implementation always returns null.

When the user requests syntax assist, LPEX invokes this method and presents the returned information

This method will be implemented in the future.

Specified by:
computeContextInformation in interface com.ibm.lpex.alef.contentassist.IContentAssistProcessor
Parameters:
viewer - the LpexTextViewer requesting information about possible contexts.
documentOffset - ignored (LPEX's content assist will probably always pass a -1 here anyway), content assist at the current cursor position is assumed.
Returns:
an arry of information about possible contexts, or null if no information are possible.
See Also:
IContentAssistProcessor.computeContextInformation(ITextViewer, int).

getCompletionProposalAutoActivationCharacters

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

Specified by:
getCompletionProposalAutoActivationCharacters in interface com.ibm.lpex.alef.contentassist.IContentAssistProcessor
Returns:
the auto activation characters for completion proposal, or null if no auto activation is desired.
See Also:
IContentAssistProcessor.getCompletionProposalAutoActivationCharacters()

getContextInformationAutoActivationCharacters

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

Specified by:
getContextInformationAutoActivationCharacters in interface com.ibm.lpex.alef.contentassist.IContentAssistProcessor
Returns:
the auto activation characters for context information, or null if no auto activation is desired.
See Also:
IContentAssistProcessor.getContextInformationAutoActivationCharacters()

getErrorMessage

public String getErrorMessage()
Return the reason why this content assist processor was unable to produce any completion proposals or context information.

Specified by:
getErrorMessage in interface com.ibm.lpex.alef.contentassist.IContentAssistProcessor
Returns:
an error message, or null if no error occurred.
See Also:
IContentAssistProcessor.getErrorMessage()

getContextInformationValidator

public com.ibm.lpex.alef.contentassist.IContextInformationValidator getContextInformationValidator()
Return a validator used to determine when displayed context information should be dismissed. May only return null if the processor is incapable of computing context information. Current implementation always returns null.

Specified by:
getContextInformationValidator in interface com.ibm.lpex.alef.contentassist.IContentAssistProcessor
Returns:
a context information validator, or null if the processor is incapable of computing context information.
See Also:
IContentAssistProcessor.getContextInformationValidator()

iSeries Remote Systems
v6.0.1

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.