|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--de.netcomputing.anyj.scripting.AnyJAPI
This class is a collection of methods, which can be used from scripts.
This is the first version of the API, so it contains just a view essential methods.
The current API is useful to integrate external functionality.
It is to weak at this point to create major extensions or enhancements.
The AnyJ API basically follows a functional approach. At least we think this makes
it more easy for us to keep the API stable. Exposing the underlying design of AnyJ would make
internal redesign of AnyJ more expensive.
What you can do using scripting
Constructor Summary | |
AnyJAPI()
|
Method Summary | |
void |
addMenuStructure(java.lang.String[] newMenu)
define the structure of the main menu. |
java.util.List |
chooseFromList(java.lang.String dlgTitle,
java.lang.String title,
java.util.List items,
java.util.List initialSel,
int width,
int height)
Lets the user choose from a List of items. |
void |
closeEditor(java.lang.String path,
boolean askIfModified)
Closes the given file if opened. |
AJSDirDiffResult |
compareDirs(java.io.File a,
java.io.File b,
java.io.FilenameFilter filter,
boolean ignoreComments,
boolean ignoreWhiteSpace)
compare two direcories 'a', 'b' |
java.util.Vector |
dirContent(java.io.File dir,
java.lang.String ending,
boolean recursive)
returns a vector of File objects, whose name ends with the gioven ending (use '' to return everything). if ending == "none", only directories are enumerated. |
int |
executeExternalProcess(java.lang.String outputLabel,
java.lang.String workingDirectory,
java.lang.String commandline)
Execute an External Process synchrounous (return when process has finished). |
AJSTextDocument |
getDocumentIfOpen(java.lang.String absPath)
returns an AJSTextDocument if it is currently opened. null otherwise. |
java.util.Hashtable |
getEnvironment()
returns the current environment of AnyJ. |
java.lang.String |
getInterpreterClasspath()
return the classpath used by the interpreter this is anyj.jar, your workspaces runtime classpath and all jars found in the [anyjuserhome]/scripts directory |
java.awt.Frame |
getMainWindow()
returns the main window of AnyJ. |
java.util.Vector |
getOpenedFiles()
returns a Vector of absolute files (Strings) currently opened in the Editor |
AJSOutput |
getOrCreateOutputPanel(java.lang.String name)
get (or create if not present) an output panel in AnyJ's output pane |
boolean |
invokeService(java.lang.String service,
java.lang.Object argument0)
invoke a service (a menu item) with the given argument. the name should look like: [category][blank][full name as seen in menu] look in the Preferences,'menus and Shortcuts' to obtain the category of a menu item. e.g. |
void |
openDirDiff(java.io.File pathA,
java.io.File pathB)
Opens a directory diffview on the given files |
void |
openEditor(java.lang.String path)
Opens the given file in AnyJ. |
void |
openFileDiff(java.lang.String title,
java.lang.String leftTitle,
java.lang.String rightTitle,
java.io.File pathA,
java.io.File pathB)
Opens a diffview on the given files |
void |
registerMenuHandler(AJExternalService serv)
registers a new userdefined (scripting) menu item (=Service). |
java.lang.String |
ressolveSymbolicVariables(java.lang.String s)
same as 'ressolveSymbolicVariables( s, getEnvironment() );' |
java.lang.String |
ressolveSymbolicVariables(java.lang.String s,
java.util.Hashtable environment)
replace all occurences of ($varName) by the result of looking up 'varName' in the given 'environment' Hashtable |
void |
runScript(java.lang.String fileName)
runs a script (by interpreting). |
void |
setMenuStructure(java.lang.String[] newMenu)
define the structure of the main menu. |
void |
setPopupMenuStructure(java.lang.String[] newMenu)
Deprecated. |
java.util.List |
splitSeparatedString(java.lang.String stringToSplit,
java.lang.String separator)
Splits a String into a list of strings |
static AnyJAPI |
This()
The one and only API object. |
void |
updateFileTree()
synchronizes filebrowser and browser outlines (e.g. files have been added externally). |
void |
updateMenus()
refresh the menu structure in order to show newly added Services (see registerMenuHandler(..)) |
void |
waitForLongRunningJobEnd()
waits until all currently running jobs have finished (e.g. build all, build changed, cvs commands) |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AnyJAPI()
Method Detail |
public static AnyJAPI This()
public AJSDirDiffResult compareDirs(java.io.File a, java.io.File b, java.io.FilenameFilter filter, boolean ignoreComments, boolean ignoreWhiteSpace) throws java.lang.Exception
public AJSOutput getOrCreateOutputPanel(java.lang.String name)
public boolean invokeService(java.lang.String service, java.lang.Object argument0)
public void runScript(java.lang.String fileName)
'"#userdata/scripts/"+fileName'
public java.awt.Frame getMainWindow()
public java.lang.String ressolveSymbolicVariables(java.lang.String s)
public java.lang.String ressolveSymbolicVariables(java.lang.String s, java.util.Hashtable environment)
public java.util.Hashtable getEnvironment()
public void registerMenuHandler(AJExternalService serv)
public AJSTextDocument getDocumentIfOpen(java.lang.String absPath)
public int executeExternalProcess(java.lang.String outputLabel, java.lang.String workingDirectory, java.lang.String commandline)
public void waitForLongRunningJobEnd()
public java.lang.String getInterpreterClasspath()
public java.util.Vector dirContent(java.io.File dir, java.lang.String ending, boolean recursive)
public void openEditor(java.lang.String path)
public void openFileDiff(java.lang.String title, java.lang.String leftTitle, java.lang.String rightTitle, java.io.File pathA, java.io.File pathB)
public void openDirDiff(java.io.File pathA, java.io.File pathB)
public void closeEditor(java.lang.String path, boolean askIfModified)
public java.util.Vector getOpenedFiles()
public void updateFileTree()
public void setMenuStructure(java.lang.String[] newMenu)
public void addMenuStructure(java.lang.String[] newMenu)
public void setPopupMenuStructure(java.lang.String[] newMenu)
public java.util.List splitSeparatedString(java.lang.String stringToSplit, java.lang.String separator)
public java.util.List chooseFromList(java.lang.String dlgTitle, java.lang.String title, java.util.List items, java.util.List initialSel, int width, int height)
public void updateMenus()
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |