|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.fife.rtext.plugins.tools.Tool
public class Tool
An "external tool."
Constructor Summary | |
---|---|
Tool()
Constructor. |
|
Tool(java.lang.String name,
java.lang.String desc)
Constructor. |
Method Summary | |
---|---|
void |
addArg(java.lang.String arg)
Adds a command line argument for this tool. |
java.lang.String |
checkForErrors()
Does basic checking to ensure that this program can run (the program exists, the directory to run in exists, etc.). |
void |
clearArgs()
Clears the command line arguments. |
void |
clearEnvVars()
Clears the environment variables associated with this tool. |
int |
compareTo(Tool t2)
Compares this tool to another by name, lexicographically. |
boolean |
equals(java.lang.Object o)
Returns whether this tool and another have the same name. |
void |
execute(ProcessRunnerOutputListener l)
Runs this tool in a separate thread. |
java.lang.String |
getAccelerator()
Returns the accelerator to use to activate this tool in a menu. |
boolean |
getAppendEnvironmentVars()
Returns whether this tool should append any environment variables it defines to RText's current environment. |
java.lang.String[] |
getArgs()
Returns the command line arguments for this Tool, as an array. |
java.lang.String |
getDescription()
Returns a description of this tool. |
java.lang.String |
getDirectory()
Returns the directory the tool will run in. |
java.util.Map<java.lang.String,java.lang.String> |
getEnvVars()
Returns a copy of the environment variable map for this tool. |
java.lang.String |
getName()
Returns the name of this tool. |
java.lang.String |
getProgram()
Returns the program to launch. |
int |
hashCode()
Returns the hash code of this tool. |
boolean |
kill()
Forcibly terminates this tool's external process, if it is running. |
static void |
main(java.lang.String[] args)
|
void |
putEnvVar(java.lang.String name,
java.lang.String value)
Sets an environment variable for this tool. |
void |
setAccelerator(java.lang.String accelerator)
Sets the accelerator to use to activate this tool in a menu. |
void |
setAppendEnvironmentVars(boolean append)
Sets whether this tool should append any environment variables it defines to RText's current environment. |
void |
setArgs(java.lang.String[] args)
Sets the command line arguments to this tool. |
void |
setDescription(java.lang.String desc)
Sets a description of this tool. |
void |
setDirectory(java.lang.String dir)
Sets the directory for this tool to run in. |
void |
setEnvVars(java.util.Map<java.lang.String,java.lang.String> vars)
Sets the environment variables for this tool. |
void |
setName(java.lang.String name)
Sets the name of this tool. |
void |
setProgram(java.lang.String program)
Sets the program to launch. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Tool()
Tool(String, String)
constructor is preferred over this one.
public Tool(java.lang.String name, java.lang.String desc)
name
- The name of this tool.desc
- A description of this tool. This may be null
.Method Detail |
---|
public void addArg(java.lang.String arg)
arg
- The argument. This cannot be null
.clearArgs()
,
setProgram(String)
public java.lang.String checkForErrors()
null
if the program
should be able to run.execute(ProcessRunnerOutputListener)
public void clearArgs()
addArg(String)
public void clearEnvVars()
putEnvVar(String, String)
public int compareTo(Tool t2)
compareTo
in interface java.lang.Comparable<Tool>
t2
- The other tool.
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public void execute(ProcessRunnerOutputListener l)
l
- Listens for events as this tool runs. This may be
null
.checkForErrors()
public java.lang.String getAccelerator()
null
if there is none.setAccelerator(String)
public boolean getAppendEnvironmentVars()
false
, RText's environment is not
appended.setAppendEnvironmentVars(boolean)
public java.lang.String[] getArgs()
setArgs(String[])
public java.lang.String getDescription()
null
if none
is defined.setDescription(String)
public java.util.Map<java.lang.String,java.lang.String> getEnvVars()
setEnvVars(Map)
public java.lang.String getName()
setName(String)
public java.lang.String getProgram()
setProgram(String)
public java.lang.String getDirectory()
setDirectory(String)
public int hashCode()
hashCode
in class java.lang.Object
public boolean kill()
public void putEnvVar(java.lang.String name, java.lang.String value)
name
- The name of the environment variable.value
- The value of the variable. If this is null
,
then this variable will not be set with a special value.clearEnvVars()
public void setAccelerator(java.lang.String accelerator)
accelerator
- The accelerator to use, or null
for
none.getAccelerator()
public void setAppendEnvironmentVars(boolean append)
append
- Whether to append the environment variables defined. If
this value is false
, RText's environment is not
appended.getAppendEnvironmentVars()
public void setArgs(java.lang.String[] args)
args
- The new command line arguments.getArgs()
public void setDescription(java.lang.String desc)
desc
- A description of this tool. This may be null
.getDescription()
public void setDirectory(java.lang.String dir)
dir
- The directory. This cannot be null
.getDirectory()
public void setEnvVars(java.util.Map<java.lang.String,java.lang.String> vars)
vars
- The new environment variables for this tool.getEnvVars()
public void setName(java.lang.String name)
name
- The name of this tool.getName()
public void setProgram(java.lang.String program)
program
- The program. This cannot be null
.getProgram()
,
addArg(String)
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |