org.fife.rsta.ac.perl
Class PerlLanguageSupport

java.lang.Object
  extended by org.fife.rsta.ac.AbstractLanguageSupport
      extended by org.fife.rsta.ac.perl.PerlLanguageSupport
All Implemented Interfaces:
LanguageSupport

public class PerlLanguageSupport
extends AbstractLanguageSupport

Language support for Perl.

Version:
1.0
Author:
Robert Futrell

Field Summary
 
Fields inherited from interface org.fife.rsta.ac.LanguageSupport
PROPERTY_LANGUAGE_PARSER
 
Constructor Summary
PerlLanguageSupport()
          Constructor.
 
Method Summary
protected  ListCellRenderer createDefaultCompletionCellRenderer()
          Creates the default cell renderer to use when none is specified.
static File getDefaultPerlInstallLocation()
          Returns the location of the first Perl install located on the user's PATH.
 PerlParser getParser(RSyntaxTextArea textArea)
          Returns the Perl parser running on a text area with this Java language support installed.
 String getPerl5LibOverride()
          Returns the value to use for PERL5LIB when parsing Perl code.
static File getPerlInstallLocation()
          Returns the Perl install that is being used for syntax checking.
 boolean getUseParensWithFunctions()
          Returns whether parens are inserted when auto-completing functions.
static boolean getUseSystemPerldoc()
          Returns whether to use the system "perldoc" command when getting descriptions of Perl functions.
 boolean getWarningsEnabled()
          Returns whether warnings are enabled when checking syntax.
 void install(RSyntaxTextArea textArea)
          Installs this support.
 boolean isParsingEnabled()
          Returns whether text areas with this language support installed are parsed for syntax errors.
 boolean isTaintModeEnabled()
          Returns whether taint mode is enabled when checking syntax.
 void setParsingEnabled(boolean enabled)
          Toggles whether text areas with this language support installed are parsed for syntax errors.
 void setPerl5LibOverride(String override)
          Sets the value to use for PERL5LIB when parsing Perl code.
static void setPerlInstallLocation(File loc)
          Sets the Perl install to use for syntax checking, perldoc, etc.
 void setTaintModeEnabled(boolean enabled)
          Toggles whether taint mode is enabled when checking syntax.
 void setUseParensWithFunctions(boolean use)
          Toggles whether parens are inserted when auto-completing functions.
static void setUseSystemPerldoc(boolean use)
          Sets whether to use the system "perldoc" command when getting descriptions of Perl functions.
 void setWarningsEnabled(boolean enabled)
          Toggles whether warnings are returned when checking syntax.
 void uninstall(RSyntaxTextArea textArea)
          Uninstalls this support.
 
Methods inherited from class org.fife.rsta.ac.AbstractLanguageSupport
createAutoCompletion, getAutoActivationDelay, getAutoCompletionFor, getDefaultCompletionCellRenderer, getShowDescWindow, getTextAreas, installImpl, isAutoActivationEnabled, isAutoCompleteEnabled, isParameterAssistanceEnabled, setAutoActivationDelay, setAutoActivationEnabled, setAutoCompleteEnabled, setDefaultCompletionCellRenderer, setParameterAssistanceEnabled, setShowDescWindow, uninstallImpl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PerlLanguageSupport

public PerlLanguageSupport()
Constructor.

Method Detail

createDefaultCompletionCellRenderer

protected ListCellRenderer createDefaultCompletionCellRenderer()
Creates the default cell renderer to use when none is specified. Subclasses can override this method if there is a "better" default renderer for a specific language.

Overrides:
createDefaultCompletionCellRenderer in class AbstractLanguageSupport
Returns:
The default renderer for the completion list.

getDefaultPerlInstallLocation

public static File getDefaultPerlInstallLocation()
Returns the location of the first Perl install located on the user's PATH.

Returns:
The "default" location at which Perl is installed.
See Also:
getPerlInstallLocation()

getPerlInstallLocation

public static File getPerlInstallLocation()
Returns the Perl install that is being used for syntax checking.

Returns:
The location at which Perl is installed, or null if none is currently selected.
See Also:
setPerlInstallLocation(File)

getParser

public PerlParser getParser(RSyntaxTextArea textArea)
Returns the Perl parser running on a text area with this Java language support installed.

Parameters:
textArea - The text area.
Returns:
The Perl parser. This will be null if the text area does not have this PerlLanguageSupport installed.

getPerl5LibOverride

public String getPerl5LibOverride()
Returns the value to use for PERL5LIB when parsing Perl code.

Returns:
The value, or null to use the system default.
See Also:
setPerl5LibOverride(String)

getUseParensWithFunctions

public boolean getUseParensWithFunctions()
Returns whether parens are inserted when auto-completing functions.

Returns:
Whether parens are inserted.
See Also:
setUseParensWithFunctions(boolean)

getUseSystemPerldoc

public static boolean getUseSystemPerldoc()
Returns whether to use the system "perldoc" command when getting descriptions of Perl functions. If this is false, then a built-in snapshot of Perl 5.10 descriptions will be used. This will perform better, but may be out of date if your version of Perl is newer.

Note that this parameter is ignored if getPerlInstallLocation() returns null.

Returns:
Whether to use the system "perldoc" command.
See Also:
setUseSystemPerldoc(boolean)

getWarningsEnabled

public boolean getWarningsEnabled()
Returns whether warnings are enabled when checking syntax.

Returns:
Whether warnings are enabled.
See Also:
setWarningsEnabled(boolean)

install

public void install(RSyntaxTextArea textArea)
Installs this support.

Parameters:
textArea - The text area to install onto.
See Also:
LanguageSupport.uninstall(RSyntaxTextArea)

isParsingEnabled

public boolean isParsingEnabled()
Returns whether text areas with this language support installed are parsed for syntax errors.

Note that if getPerlInstallLocation() returns null or an invalid value, parsing will not occur even if this value is true.

Returns:
Whether parsing is enabled.
See Also:
setParsingEnabled(boolean)

isTaintModeEnabled

public boolean isTaintModeEnabled()
Returns whether taint mode is enabled when checking syntax.

Returns:
Whether taint mode is enabled.
See Also:
setTaintModeEnabled(boolean)

setParsingEnabled

public void setParsingEnabled(boolean enabled)
Toggles whether text areas with this language support installed are parsed for syntax errors.

Parameters:
enabled - Whether parsing should be enabled.
See Also:
isParsingEnabled()

setPerl5LibOverride

public void setPerl5LibOverride(String override)
Sets the value to use for PERL5LIB when parsing Perl code.

Parameters:
override - The value, or null to use the system default.
See Also:
getPerl5LibOverride()

setPerlInstallLocation

public static void setPerlInstallLocation(File loc)
Sets the Perl install to use for syntax checking, perldoc, etc.

Parameters:
loc - The root directory of the Perl installation, or null for none.
See Also:
getPerlInstallLocation()

setTaintModeEnabled

public void setTaintModeEnabled(boolean enabled)
Toggles whether taint mode is enabled when checking syntax.

Parameters:
enabled - Whether taint mode should be enabled.
See Also:
isTaintModeEnabled()

setWarningsEnabled

public void setWarningsEnabled(boolean enabled)
Toggles whether warnings are returned when checking syntax.

Parameters:
enabled - Whether warnings are enabled.
See Also:
getWarningsEnabled()

setUseParensWithFunctions

public void setUseParensWithFunctions(boolean use)
Toggles whether parens are inserted when auto-completing functions.

Parameters:
use - Whether parens are inserted.
See Also:
getUseParensWithFunctions()

setUseSystemPerldoc

public static void setUseSystemPerldoc(boolean use)
Sets whether to use the system "perldoc" command when getting descriptions of Perl functions. If this is false, then a built-in snapshot of Perl 5.10 descriptions will be used. This will perform better, but may be out of date if your version of Perl is newer.

Note that this parameter is ignored if getPerlInstallLocation() returns null.

Parameters:
use - Whether to use the system "perldoc" command.
See Also:
getUseSystemPerldoc()

uninstall

public void uninstall(RSyntaxTextArea textArea)
Uninstalls this support.

Parameters:
textArea - The text area to uninstall from.
See Also:
LanguageSupport.install(RSyntaxTextArea)


Copyright © 2003-2011. All Rights Reserved.