console
Class ConsolePlugin

java.lang.Object
  extended by org.gjt.sp.jedit.EditPlugin
      extended by org.gjt.sp.jedit.EBPlugin
          extended by console.ConsolePlugin
All Implemented Interfaces:
org.gjt.sp.jedit.EBComponent

public class ConsolePlugin
extends org.gjt.sp.jedit.EBPlugin

ConsolePlugin

Version:
$Id: ConsolePlugin.java 9546 2007-05-21 19:07:12Z ezust $

Nested Class Summary
 
Nested classes/interfaces inherited from class org.gjt.sp.jedit.EditPlugin
org.gjt.sp.jedit.EditPlugin.Broken, org.gjt.sp.jedit.EditPlugin.Deferred
 
Field Summary
static java.lang.String CMD_PATH
           
static java.lang.String MENU
           
static int NO_ERROR
          Return value of #parseLine() if the text does not match a known error pattern.
 
Constructor Summary
ConsolePlugin()
           
 
Method Summary
static void compile(org.gjt.sp.jedit.View view, org.gjt.sp.jedit.Buffer buffer)
           
static java.lang.String expandSystemShellVariables(org.gjt.sp.jedit.View view, java.lang.String text)
          Expands embedded environment variables in the same manner as the system shell.
static org.gjt.sp.jedit.ActionSet getAllCommands()
           
static java.lang.String getClassName(org.gjt.sp.jedit.Buffer buffer)
          Returns the name of the specified buffer without the extension, appended to the buffer's package name.
static org.gjt.sp.jedit.EditAction[] getCommandoCommands()
           
static Console getConsole(org.gjt.sp.jedit.View v)
           
static java.lang.String getConsoleSettingsDirectory()
           
static java.lang.String getPackageName(org.gjt.sp.jedit.Buffer buffer)
          A utility method that returns the name of the package containing the current buffer.
static java.lang.String getPackageRoot(org.gjt.sp.jedit.Buffer buffer)
          Returns the directory containing the root of the package of the current buffer.
static org.gjt.sp.jedit.ActionSet getShellSwitchActions()
           
static org.gjt.sp.jedit.EditAction[] getSwitchActions()
           
static SystemShell getSystemShell()
           
static java.lang.String getSystemShellVariableValue(org.gjt.sp.jedit.View view, java.lang.String var)
          Returns the value of the specified system shell environment variable.
static java.lang.String getUserCommandDirectory()
           
 void handleMessage(org.gjt.sp.jedit.EBMessage msg)
           
static int parseLine(org.gjt.sp.jedit.View view, java.lang.String text, java.lang.String directory, errorlist.DefaultErrorSource errorSource)
          parseLine() Publicly documented class for parsing output of user defined programs through the system shell error parser.
static void rescanCommands()
          Dynamicly generates two ActionSets, one for Commando commands, and one for Shells.
static void run(org.gjt.sp.jedit.View view, org.gjt.sp.jedit.Buffer buffer)
           
static void scanDirectory(java.lang.String directory)
          Given a filename, performs translations so that it's a command name
static void scanJarFile()
           
static void setSystemShellVariableValue(java.lang.String var, java.lang.String value)
          Sets the value of the specified system shell environment variable.
 void start()
           
 void stop()
           
 
Methods inherited from class org.gjt.sp.jedit.EditPlugin
createBrowserMenuItems, createMenuItems, createMenuItems, createOptionPanes, getClassName, getPluginHome, getPluginHome, getPluginHome, getPluginJAR, getResourceAsOutputStream, getResourceAsOutputStream, getResourceAsStream, getResourceAsStream, getResourcePath, getResourcePath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MENU

public static final java.lang.String MENU
See Also:
Constant Field Values

CMD_PATH

public static final java.lang.String CMD_PATH
See Also:
Constant Field Values

NO_ERROR

public static final int NO_ERROR
Return value of #parseLine() if the text does not match a known error pattern.

See Also:
Constant Field Values
Constructor Detail

ConsolePlugin

public ConsolePlugin()
Method Detail

getSystemShell

public static SystemShell getSystemShell()

getShellSwitchActions

public static org.gjt.sp.jedit.ActionSet getShellSwitchActions()
Returns:
a dynamically generated list of actions based on which console Shells are available.

getAllCommands

public static org.gjt.sp.jedit.ActionSet getAllCommands()
Returns:
all commands that are represented as .xml commando files.

start

public void start()
Overrides:
start in class org.gjt.sp.jedit.EditPlugin

parseLine

public static int parseLine(org.gjt.sp.jedit.View view,
                            java.lang.String text,
                            java.lang.String directory,
                            errorlist.DefaultErrorSource errorSource)
parseLine() Publicly documented class for parsing output of user defined programs through the system shell error parser.

Returns:
-1 if no error/warning, or an ErrorType. Possible values are:

stop

public void stop()
Overrides:
stop in class org.gjt.sp.jedit.EditPlugin

handleMessage

public void handleMessage(org.gjt.sp.jedit.EBMessage msg)
Specified by:
handleMessage in interface org.gjt.sp.jedit.EBComponent
Overrides:
handleMessage in class org.gjt.sp.jedit.EBPlugin

getConsoleSettingsDirectory

public static java.lang.String getConsoleSettingsDirectory()

scanDirectory

public static void scanDirectory(java.lang.String directory)
Given a filename, performs translations so that it's a command name


scanJarFile

public static void scanJarFile()

rescanCommands

public static void rescanCommands()
Dynamicly generates two ActionSets, one for Commando commands, and one for Shells. Grabs the commando files from the jar file as well as user settings.


getSwitchActions

public static org.gjt.sp.jedit.EditAction[] getSwitchActions()

getCommandoCommands

public static org.gjt.sp.jedit.EditAction[] getCommandoCommands()

compile

public static void compile(org.gjt.sp.jedit.View view,
                           org.gjt.sp.jedit.Buffer buffer)

getConsole

public static Console getConsole(org.gjt.sp.jedit.View v)

run

public static void run(org.gjt.sp.jedit.View view,
                       org.gjt.sp.jedit.Buffer buffer)

getPackageName

public static java.lang.String getPackageName(org.gjt.sp.jedit.Buffer buffer)
A utility method that returns the name of the package containing the current buffer. note: these might not be needed anymore as of 4.3pre3

Parameters:
buffer - The buffer

getClassName

public static java.lang.String getClassName(org.gjt.sp.jedit.Buffer buffer)
Returns the name of the specified buffer without the extension, appended to the buffer's package name. note: this might not be needed with the new JARClassloader

Parameters:
buffer - The buffer

getPackageRoot

public static java.lang.String getPackageRoot(org.gjt.sp.jedit.Buffer buffer)
Returns the directory containing the root of the package of the current buffer. For example, if the buffer is located in /home/slava/Stuff/example/Example.java and contains a package example statement, this method will return /home/slava/Stuff.

Parameters:
buffer - The buffer

expandSystemShellVariables

public static java.lang.String expandSystemShellVariables(org.gjt.sp.jedit.View view,
                                                          java.lang.String text)
Expands embedded environment variables in the same manner as the system shell.

Parameters:
view - The view
text - The string to expand

getSystemShellVariableValue

public static java.lang.String getSystemShellVariableValue(org.gjt.sp.jedit.View view,
                                                           java.lang.String var)
Returns the value of the specified system shell environment variable.

Parameters:
view - The view
var - The variable name

setSystemShellVariableValue

public static void setSystemShellVariableValue(java.lang.String var,
                                               java.lang.String value)
Sets the value of the specified system shell environment variable.

Parameters:
view - The view
var - The variable name
value - The value

getUserCommandDirectory

public static java.lang.String getUserCommandDirectory()