org.fife.rsta.ac.perl
Class PerlCompletionProvider

java.lang.Object
  extended by org.fife.ui.autocomplete.CompletionProviderBase
      extended by org.fife.ui.autocomplete.LanguageAwareCompletionProvider
          extended by org.fife.rsta.ac.c.CCompletionProvider
              extended by org.fife.rsta.ac.perl.PerlCompletionProvider
All Implemented Interfaces:
CompletionProvider, ToolTipSupplier

public class PerlCompletionProvider
extends CCompletionProvider

A completion provider for Perl. It provides:

To toggle whether parameter assistance wraps your parameters in parens, use the setUseParensWithFunctions(boolean) method.

Version:
1.0
Author:
Robert Futrell

Field Summary
 
Fields inherited from class org.fife.ui.autocomplete.CompletionProviderBase
EMPTY_STRING
 
Constructor Summary
PerlCompletionProvider()
           
 
Method Summary
protected  void addShorthandCompletions(DefaultCompletionProvider codeCP)
          Adds shorthand completions to the code completion provider.
protected  CompletionProvider createCodeCompletionProvider()
          Returns the provider to use when editing code.
protected  CompletionProvider createStringCompletionProvider()
          Returns the completion provider to use when the caret is in a string.
protected  List getCompletionsImpl(JTextComponent comp)
          
 char getParameterListEnd()
          Overridden to return the null char (meaning "no end character") if the user doesn't want to use parens around their functions.
 char getParameterListStart()
          Overridden to return the null char (meaning "no start character") if the user doesn't want to use parens around their functions.
 boolean getUseParensWithFunctions()
          Returns whether the user wants to use parens around parameters to functions.
protected  String getXmlResource()
          Returns the name of the XML resource to load (on classpath or a file).
 void setUseParensWithFunctions(boolean use)
          Sets whether the user wants to use parens around parameters to functions.
 
Methods inherited from class org.fife.rsta.ac.c.CCompletionProvider
createCommentCompletionProvider, loadCodeCompletionsFromXml
 
Methods inherited from class org.fife.ui.autocomplete.LanguageAwareCompletionProvider
clearParameterizedCompletionParams, getAlreadyEnteredText, getCommentCompletionProvider, getCompletionsAt, getDefaultCompletionProvider, getDocCommentCompletionProvider, getParameterizedCompletions, getParameterListSeparator, getStringCompletionProvider, getToolTipText, isAutoActivateOkay, setCommentCompletionProvider, setDefaultCompletionProvider, setDocCommentCompletionProvider, setParameterizedCompletionParams, setStringCompletionProvider
 
Methods inherited from class org.fife.ui.autocomplete.CompletionProviderBase
getCompletions, getListCellRenderer, getParameterChoicesProvider, getParent, setAutoActivationRules, setListCellRenderer, setParameterChoicesProvider, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PerlCompletionProvider

public PerlCompletionProvider()
Method Detail

addShorthandCompletions

protected void addShorthandCompletions(DefaultCompletionProvider codeCP)
Adds shorthand completions to the code completion provider.

Overrides:
addShorthandCompletions in class CCompletionProvider
Parameters:
codeCP - The code completion provider.

createCodeCompletionProvider

protected CompletionProvider createCodeCompletionProvider()
Returns the provider to use when editing code.

Overrides:
createCodeCompletionProvider in class CCompletionProvider
Returns:
The provider.
See Also:
CCompletionProvider.createCommentCompletionProvider(), CCompletionProvider.createStringCompletionProvider(), CCompletionProvider.loadCodeCompletionsFromXml(DefaultCompletionProvider), CCompletionProvider.addShorthandCompletions(DefaultCompletionProvider)

createStringCompletionProvider

protected CompletionProvider createStringCompletionProvider()
Returns the completion provider to use when the caret is in a string.

Overrides:
createStringCompletionProvider in class CCompletionProvider
Returns:
The provider.
See Also:
CCompletionProvider.createCodeCompletionProvider(), CCompletionProvider.createCommentCompletionProvider()

getCompletionsImpl

protected List getCompletionsImpl(JTextComponent comp)

Overrides:
getCompletionsImpl in class LanguageAwareCompletionProvider

getParameterListEnd

public char getParameterListEnd()
Overridden to return the null char (meaning "no end character") if the user doesn't want to use parens around their functions.

Specified by:
getParameterListEnd in interface CompletionProvider
Overrides:
getParameterListEnd in class LanguageAwareCompletionProvider
Returns:
The end character for parameters list, or the null char if none.
See Also:
getUseParensWithFunctions()

getParameterListStart

public char getParameterListStart()
Overridden to return the null char (meaning "no start character") if the user doesn't want to use parens around their functions.

Specified by:
getParameterListStart in interface CompletionProvider
Overrides:
getParameterListStart in class LanguageAwareCompletionProvider
Returns:
The start character for parameters list, or the null char if none.
See Also:
getUseParensWithFunctions()

getUseParensWithFunctions

public boolean getUseParensWithFunctions()
Returns whether the user wants to use parens around parameters to functions.

Returns:
Whether to use parens around parameters to functions.
See Also:
setUseParensWithFunctions(boolean)

getXmlResource

protected String getXmlResource()
Returns the name of the XML resource to load (on classpath or a file).

Overrides:
getXmlResource in class CCompletionProvider
Returns:
The resource to load.

setUseParensWithFunctions

public void setUseParensWithFunctions(boolean use)
Sets whether the user wants to use parens around parameters to functions.

Parameters:
use - Whether to use parens around parameters to functions.
See Also:
getUseParensWithFunctions()


Copyright © 2003-2011. All Rights Reserved.