|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.openide.loaders.ExecSupport
Support for execution of a class file. Looks for the class with the same base name as the primary file, locates a main method in it, and starts it.
Field Summary | |
protected MultiDataObject.Entry |
entry
entry to be associated with |
static String |
PROP_DEBUGGER_TYPE
Name of property providing a custom DebuggerType for a file. |
static String |
PROP_EXECUTION
Name of property providing a custom Executor for a file. |
static String |
PROP_FILE_PARAMS
Name of property providing argument parameter list. |
Constructor Summary | |
ExecSupport(MultiDataObject.Entry entry)
Create new support for given entry. |
Method Summary | |
void |
addProperties(Sheet.Set set)
Helper method that creates default properties for execution of a given support. |
protected boolean |
checkCompiled()
Deprecated. The check should be done in an action - ExecAction, ... |
void |
debug(boolean stopOnMain)
Start debugging of associated object. |
protected boolean |
debugFailed(DebuggerException ex)
Called when invocation of the debugger fails. |
protected DebuggerType |
defaultDebuggerType()
This method allows subclasses to override the default debugger type they want to use for debugging. |
protected Executor |
defaultExecutor()
This method allows subclasses to override the default executor they want to use for debugging. |
String[] |
getArguments()
Get the arguments. |
static String[] |
getArguments(MultiDataObject.Entry entry)
Get the arguments associated with a given entry. |
static DebuggerType |
getDebuggerType(MultiDataObject.Entry entry)
Retrieves the debugger type for this entry. |
static Executor |
getExecutor(MultiDataObject.Entry entry)
Get the executor for a given file object. |
static void |
setArguments(MultiDataObject.Entry entry,
String[] args)
Set execution arguments for a given entry. |
void |
setArguments(String[] args)
Set the arguments. |
static void |
setDebuggerType(MultiDataObject.Entry entry,
DebuggerType type)
Assignes a debugger type to an entry. |
static void |
setExecutor(MultiDataObject.Entry entry,
Executor exec)
Set the executor for a given file object. |
void |
start()
Start execution. |
protected boolean |
startFailed(IOException ex)
Called when invocation of the executor fails. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String PROP_FILE_PARAMS
public static final String PROP_EXECUTION
Executor
for a file.public static final String PROP_DEBUGGER_TYPE
DebuggerType
for a file.protected MultiDataObject.Entry entry
Constructor Detail |
public ExecSupport(MultiDataObject.Entry entry)
entry
- entry to create instance fromMethod Detail |
public void start()
ExecCookie
start
in interface ExecCookie
public void debug(boolean stopOnMain) throws DebuggerException
DebuggerCookie
debug
in interface DebuggerCookie
org.openide.cookies.DebuggerCookie
stopOnMain
- if true
, debugger stops on the first line of debugged codeDebuggerException
- if the session cannot be startedprotected boolean startFailed(IOException ex)
ex
- exeception that occured during executionprotected boolean debugFailed(DebuggerException ex)
ex
- exeception that occured during executionprotected boolean checkCompiled()
The default implementation checks whether CompilerCookie
is provided and
if so, creates a job and compiles the object. This behavior may be
overridden by subclasses.
true
if the object was successfully brought up to date, false
if the attempt failed (and it may be still be out of date)protected DebuggerType defaultDebuggerType()
protected Executor defaultExecutor()
public static void setExecutor(MultiDataObject.Entry entry, Executor exec) throws IOException
entry
- entry to set the executor forexec
- executor to useIOException
- if executor cannot be setpublic static Executor getExecutor(MultiDataObject.Entry entry)
entry
- entry to obtain the executor fornull
if the default should be usedpublic void setArguments(String[] args) throws IOException
ArgumentsCookie
setArguments
in interface ArgumentsCookie
org.openide.cookies.ArgumentsCookie
args
- the arguments. May be empty but not null
.IOException
- if the arguments could not be setpublic static void setArguments(MultiDataObject.Entry entry, String[] args) throws IOException
entry
- the entryargs
- array of argumentsIOException
- if arguments cannot be setpublic String[] getArguments()
ArgumentsCookie
getArguments
in interface ArgumentsCookie
org.openide.cookies.ArgumentsCookie
null
.public static String[] getArguments(MultiDataObject.Entry entry)
entry
- the entrypublic static void setDebuggerType(MultiDataObject.Entry entry, DebuggerType type) throws IOException
entry
- the object's entrytype
- the debugger type for this entryIOException
- if arguments cannot be setpublic static DebuggerType getDebuggerType(MultiDataObject.Entry entry)
entry
- the entrypublic void addProperties(Sheet.Set set)
set
- sheet set to add properties to
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |