| |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Interface IdeManager provides the entire IDE's fuctionality.
This interface supplies methods relating to the overall IDE functionality, such as saving the opened files or starting a new process.
IdeManager provides a convenient mechanism for retrieving additional
information about the result of certain actions. This information is stored in the
IdeErrorInfo object accessible through the setErrorInfo
and performCheck methods.
Current IdeManager can be obtained via static
IdeManagerAccess.getManager method:
IdeManager manager = IdeManagerAccess.getManager();| Method Summary | |
void | addCommandAndWait(Runnable command)Adds ceratin command to the commands queue and waits while this command is not executed. |
void | addCommandToQueue(Runnable command)Adds specified command to the commands queue. |
void | addCommandToQueue(Runnable command, String name)Adds specified command, identified by it's name, to the commands queue. |
String | buildDiagramURL(RwiDiagram diagram, RwiElement element)Creates URL of a specific kind referring to the specified element
of the diagram. |
String | buildEditorURL(String url, TextPosition position)Produces URL of a specific kind, referring to the position in a certain file. |
String | buildEditorURL(String url, int offset)Produces URL of a specific kind, referring to the offset in a certain file. |
Process | exec(String command)Executes specified command in a separate process. |
Process | exec(String command, String fileForOut)Executes the specified command in a separate process,
with the specifed output file. |
String | expandMacros(IdeContext context, String command)Replaces macros in command with the corresponding values. |
String[] | getArguments()Returns the list of arguments passed to 'main' method. |
String | getHomeDirectory()Returns fully qualified path of Together's root directory. |
String | getModuleHomeDirectory(Class moduleClass)Returns home folder for the module, defined by it's class. |
String | getTempFile()Returns the name of a temporary file. |
Locale | getUILocale()Returns a locale object for the Together's User Interface. |
boolean | isGUIEnabled()Checks if Together works in GUI or in a command line mode. |
boolean | isModuleActive(String moduleClassName)Checks the state of the specified activatable module. |
boolean | isModuleServiceAvailable(String serviceName)Returns true if the service with the specified name
is declared by loaded module, false otherwise. |
void | navigateByURL(String url)Opens specified internal URL if its associated handler is visible on the screen. |
void | openHelp(String url)Opens help reffered to by the specified URL. |
void | openURL(String url)Opens specified URL (Universe Resource Locator). |
IdeErrorInfo | performCheck(IdeErrorCheck check)Calls run() method of the specified IdeErrorCheck object and returns
IdeErrorInfo containing the information about possible errors that occurred. |
void | printStatus(String text)Displays the specified string in the status bar. |
void | saveAll()Saves all opened files which were changed by Together. |
void | setErrorInfo(IdeErrorInfo info)Sets specified result of certain actions. |
void | showHelp(String targetID, boolean openInDialog, Component parent)Opens help with JavaHelp reffered to by the specified targetID,
in the specified frame. |
void | showHelp(java.net.URL url, boolean openInDialog, Component parent)Opens help with JavaHelp reffered to by the specified URL. |
void | synchronize()If the data of the opened files change on the disk, automatically reloads these files. |
| Method Detail |
public void addCommandAndWait(Runnable command)
Runnable object to be added to the queuepublic void addCommandToQueue(Runnable command)
command to the commands queue.Runnable object to be added to the queuepublic void addCommandToQueue(Runnable command, String name)
Runnable object to be added to the queueString name of this commandpublic String buildDiagramURL(RwiDiagram diagram, RwiElement element)
element
of the diagram.RwiDiagram where this element is locatedRwiElement object representing the target elementString URL that contains information about the position
of the specified elementpublic String buildEditorURL(String url, TextPosition position)
position in a certain file.
If this file can be opened in the editor, returns URL of the position in this file;
otherwise returns initial URL.String URL of a fileTextPosition instanceString URL that contains information about the position in this file,
if this file can be opned in the editor;
String initial URL otherwisepublic String buildEditorURL(String url, int offset)
offset in a certain file.
If this file can be opened in the editor, returns URL of the position in this file;
otherwise returns initial URL.String URL of a fileint offset in the fileString URL that contains information about the position in this file,
if this file can be opned in the editor;
String initial URL otherwisepublic Process exec(String command)
command in a separate process.String system command to be executedProcess object for managing the subprocesspublic Process exec(String command, String fileForOut)
command in a separate process,
with the specifed output file.String system command to be executedString name of the output file of this processProcess object for managing the subprocesspublic String expandMacros(IdeContext context, String command)
command with the corresponding values.
See external tools guide for supported macro set.IdeContext object that represents the Context
(e.g. current selection) to be used by the macros. Some macros need
non-global information (class, file, etc.) to execute.
If null is passed, only those macros that do not require
this information can be executedString Source for macro substitutionnull if some macros cannot be executed, or
String command with macros replaced with the corresponding values,
if all macros where successfully processed.public String[] getArguments()
String array with argumentspublic String getHomeDirectory()
"C:\Cases\Together".String fully qualified path of Together's root directorypublic String getModuleHomeDirectory(Class moduleClass)
Class- Returns:
String home folder for this module public String getTempFile()
String name of not existing temporary filepublic Locale getUILocale()
Locale object for the Together's User Interfacepublic boolean isGUIEnabled()
true if it is allowed to display GUIpublic boolean isModuleActive(String moduleClassName)
true if activatable module is active.String name of the activatable module classtrue if module is activated, false otherwisepublic boolean isModuleServiceAvailable(String serviceName)
true if the service with the specified name
is declared by loaded module, false otherwise.String name of the service to be checkedtrue if this service is available, false otherwise.public void navigateByURL(String url)
For example, for an URL to a diagram Together will open that diagram only if the diagram pane is visible on the screen. For an URL to a file Together will open this file in the text editor only if the editor pane is visible on the screen.
String internal URL (an URL to a diagram, file etc)public void openHelp(String url)
public void openURL(String url)
"Open" means that IDE will handle specified URL in accordance with its protocol's type. For example, for the http protocol IDE will show the data reffered to by the URL in the default browser.
The URL's handler will be focused. For example, for an http address Together will focus the browser, for internal URL (to a file, diagram etc.) it will focus the corresponding pane.
String URLpublic IdeErrorInfo performCheck(IdeErrorCheck check)
run() method of the specified IdeErrorCheck object and returns
IdeErrorInfo containing the information about possible errors that occurred.IdeErrorCheck instance whose run method will be calledIdeErrorInfopublic void printStatus(String text)
String to be displayedpublic void saveAll()
public void setErrorInfo(IdeErrorInfo info)
IdeErrorInfo
object that stores errors information, this method overwrites the previous IdeErrorInfo
value.IdeErrorInfo instance that stores error detailspublic void showHelp(String targetID, boolean openInDialog, Component parent)
targetID,
in the specified frame.String ID defined in the help map fileboolean flag that defines where this help is diaplayed.
If true, shows help in the modal dialog, otherwise in the frame.
If this method is invoked from a modal dialog set this parameter to true.Cmoopnent dialog where the help was invoked.
Should not be null if openInDialog = truepublic void showHelp(java.net.URL url, boolean openInDialog, Component parent)
String URLboolean flag that defines where this help is diaplayed.
If true, shows help in the modal dialog, otherwise in the frame.
If this method is invoked from a modal dialog set this parameter to true.Cmoopnent dialog where the help was invoked.
Should not be null if openInDialog = truepublic void synchronize()
| |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||