com.togethersoft.openapi.ide
Interface IdeManager


public interface IdeManager

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();

Author:
TogetherSoft
See Also: IdeAccess, performCheck(com.togethersoft.openapi.ide.IdeErrorCheck), setErrorInfo(com.togethersoft.openapi.ide.IdeErrorInfo)

Method Summary
 voidaddCommandAndWait(Runnable command)
          Adds ceratin command to the commands queue and waits while this command is not executed.
 voidaddCommandToQueue(Runnable command)
          Adds specified command to the commands queue.
 voidaddCommandToQueue(Runnable command, String name)
          Adds specified command, identified by it's name, to the commands queue.
 StringbuildDiagramURL(RwiDiagram diagram, RwiElement element)
          Creates URL of a specific kind referring to the specified element of the diagram.
 StringbuildEditorURL(String url, TextPosition position)
          Produces URL of a specific kind, referring to the position in a certain file.
 StringbuildEditorURL(String url, int offset)
          Produces URL of a specific kind, referring to the offset in a certain file.
 Processexec(String command)
          Executes specified command in a separate process.
 Processexec(String command, String fileForOut)
          Executes the specified command in a separate process, with the specifed output file.
 StringexpandMacros(IdeContext context, String command)
          Replaces macros in command with the corresponding values.
 String[]getArguments()
          Returns the list of arguments passed to 'main' method.
 IdeCommandManagergetCommandManager()
          Deprecated.  
 IdeConfigManagergetConfigManager()
          Deprecated.  
 IdeDiagramManagergetDiagramManager()
          Deprecated.  
 IdeEditorManagergetEditorManager()
          Deprecated.  
 StringgetHomeDirectory()
          Returns fully qualified path of Together's root directory.
 IdeMessageManagergetMessageManager()
          Deprecated.  
 StringgetModuleHomeDirectory(Class moduleClass)
          Returns home folder for the module, defined by it's class.
 IdeProgressIndicatorgetProgressIndicator()
          Deprecated.  
 IdeProjectManagergetProjectManager()
          Deprecated.  
 StringgetTempFile()
          Returns the name of a temporary file.
 LocalegetUILocale()
          Returns a locale object for the Together's User Interface.
 IdeUndoManagergetUndoManager()
          Deprecated.  
 IdeWindowManagergetWindowManager()
          Deprecated.  
 booleanisGUIEnabled()
          Checks if Together works in GUI or in a command line mode.
 booleanisModuleActive(String moduleClassName)
          Checks the state of the specified activatable module.
 booleanisModuleServiceAvailable(String serviceName)
          Returns true if the service with the specified name
is declared by loaded module, false otherwise.
 voidnavigateByURL(String url)
          Opens specified internal URL if its associated handler is visible on the screen.
 voidopenApplicationHelp(String topic, Component parent)
          Opens help with JavaHelp reffered to by the specified topic.
 voidopenHelp(String url)
          Deprecated.  
 voidopenURL(String url)
          Opens specified URL (Universe Resource Locator).
 IdeErrorInfoperformCheck(IdeErrorCheck check)
          Calls run() method of the specified IdeErrorCheck object and returns
IdeErrorInfo containing the information about possible errors that occurred.
 voidprintStatus(String text)
          Displays the specified string in the status bar.
 voidsaveAll()
          Saves all opened files which were changed by Together.
 voidsetErrorInfo(IdeErrorInfo info)
          Sets specified result of certain actions.
 voidshowHelp(String targetID, boolean openInModalDialog, Component parent)
          Deprecated.  
 voidshowHelp(java.net.URL url, boolean openInModalDialog, Component parent)
          Deprecated.  
 voidsynchronize()
          If the data of the opened files change on the disk, automatically reloads these files.

Method Detail

addCommandAndWait

public void addCommandAndWait(Runnable command)
Adds ceratin command to the commands queue and waits while this command is not executed.
Parameters:
command Runnable object to be added to the queue
Since:
Together 4.0

addCommandToQueue

public void addCommandToQueue(Runnable command)
Adds specified command to the commands queue.
Parameters:
command Runnable object to be added to the queue

addCommandToQueue

public void addCommandToQueue(Runnable command, String name)
Adds specified command, identified by it's name, to the commands queue.
Parameters:
command Runnable object to be added to the queue
name String name of this command
Since:
Together 4.0

buildDiagramURL

public String buildDiagramURL(RwiDiagram diagram, RwiElement element)
Creates URL of a specific kind referring to the specified element of the diagram.
Parameters:
diagram RwiDiagram where this element is located
element RwiElement object representing the target element
Returns: String URL that contains information about the position of the specified element

buildEditorURL

public String buildEditorURL(String url, TextPosition position)
Produces URL of a specific kind, referring to the 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.
Parameters:
url String URL of a file
position TextPosition instance
Returns: String URL that contains information about the position in this file,
if this file can be opned in the editor; String initial URL otherwise
See Also:
buildEditorURL(java.lang.String,int)

buildEditorURL

public String buildEditorURL(String url, int offset)
Produces URL of a specific kind, referring to the 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.
Parameters:
url String URL of a file
position int offset in the file
Returns: String URL that contains information about the position in this file,
if this file can be opned in the editor; String initial URL otherwise
See Also:
buildEditorURL(java.lang.String,com.togethersoft.openapi.util.text.TextPosition)

exec

public Process exec(String command)
Executes specified command in a separate process.
Parameters:
command String system command to be executed
Returns: Process object for managing the subprocess

exec

public Process exec(String command, String fileForOut)
Executes the specified command in a separate process, with the specifed output file.
Parameters:
command String system command to be executed
fileForOut String name of the output file of this process
Returns: Process object for managing the subprocess

expandMacros

public String expandMacros(IdeContext context, String command)
Replaces macros in command with the corresponding values.
See external tools guide for supported macro set.
Parameters:
context 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 executed
command String Source for macro substitution
Returns: null if some macros cannot be executed, or
String command with macros replaced with the corresponding values,
if all macros where successfully processed.

getArguments

public String[] getArguments()
Returns the list of arguments passed to 'main' method.
Returns: String array with arguments

getCommandManager

public IdeCommandManager getCommandManager()
Deprecated.
Returns: IdeCommandManager
See Also:
IdeCommandManager

getConfigManager

public IdeConfigManager getConfigManager()
Deprecated.
Returns: IdeConfigManager
See Also:
IdeConfigManager

getDiagramManager

public IdeDiagramManager getDiagramManager()
Deprecated.
Returns: IdeDiagramManager
See Also:
IdeDiagramManager

getEditorManager

public IdeEditorManager getEditorManager()
Deprecated.
Returns: IdeEditorManager
See Also:
IdeEditorManager

getHomeDirectory

public String getHomeDirectory()
Returns fully qualified path of Together's root directory. For example, if Together is
installed in C:\Cases\Together, then this method will return "C:\Cases\Together".
Returns: String fully qualified path of Together's root directory

getMessageManager

public IdeMessageManager getMessageManager()
Deprecated.
Returns: IdeMessageManager
See Also:
IdeMessageManager

getModuleHomeDirectory

public String getModuleHomeDirectory(Class moduleClass)
Returns home folder for the module, defined by it's class.
Parameters:
module Class
Returns: String home folder for this module
Since:
Together 4.0

getProgressIndicator

public IdeProgressIndicator getProgressIndicator()
Deprecated.
Returns: IdeProgressIndicator
See Also:
IdeProgressIndicator

getProjectManager

public IdeProjectManager getProjectManager()
Deprecated.
Returns: IdeProjectManager
See Also:
IdeProjectManager

getTempFile

public String getTempFile()
Returns the name of a temporary file.
Returns: String name of not existing temporary file

getUILocale

public Locale getUILocale()
Returns a locale object for the Together's User Interface.
Returns: Locale object for the Together's User Interface

getUndoManager

public IdeUndoManager getUndoManager()
Deprecated.

getWindowManager

public IdeWindowManager getWindowManager()
Deprecated.
Returns: IdeWindowManager
See Also:
IdeWindowManager

isGUIEnabled

public boolean isGUIEnabled()
Checks if Together works in GUI or in a command line mode.
Together may perform many useful tasks in the command-line mode. In this case
GUI is not shown. Modules should coordinate own GUI with this setting.
Returns: true if it is allowed to display GUI

isModuleActive

public boolean isModuleActive(String moduleClassName)
Checks the state of the specified activatable module. Returns true if activatable module is active.
Parameters:
moduleClassName String name of the activatable module class
Returns: true if module is activated, false otherwise
Since:
Together 4.0

isModuleServiceAvailable

public boolean isModuleServiceAvailable(String serviceName)
Returns true if the service with the specified name
is declared by loaded module, false otherwise.
Parameters:
serviceName String name of the service to be checked
Returns: true if this service is available, false otherwise.
Since:
Together 4.0

navigateByURL

public void navigateByURL(String url)
Opens specified internal URL if its associated handler is visible on the screen.


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.

Parameters:
url String internal URL (an URL to a diagram, file etc)
See Also:
openURL(java.lang.String)

openApplicationHelp

public void openApplicationHelp(String topic, Component parent)
Opens help with JavaHelp reffered to by the specified topic.
Parameters:
topic String topic defined in the help config.
parent Component dialog where the help was invoked.
Since:
Together 6.0

openHelp

public void openHelp(String url)
Deprecated.
Parameters:
url the string with URL
See Also:
openApplicationHelp

openURL

public void openURL(String url)
Opens specified URL (Universe Resource Locator).

"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.

Parameters:
url String URL
See Also:
navigateByURL(java.lang.String)

performCheck

public IdeErrorInfo performCheck(IdeErrorCheck check)
Calls run() method of the specified IdeErrorCheck object and returns
IdeErrorInfo containing the information about possible errors that occurred.
Parameters:
check IdeErrorCheck instance whose run method will be called
Returns: IdeErrorInfo
See Also:
IdeErrorCheck, IdeErrorInfo

printStatus

public void printStatus(String text)
Displays the specified string in the status bar.
Parameters:
text String to be displayed

saveAll

public void saveAll()
Saves all opened files which were changed by Together.
See Also:
synchronize()

setErrorInfo

public void setErrorInfo(IdeErrorInfo info)
Sets specified result of certain actions. As there is only one IdeErrorInfo
object that stores errors information, this method overwrites the previous IdeErrorInfo value.
Parameters:
info IdeErrorInfo instance that stores error details
See Also:
IdeErrorInfo, performCheck(com.togethersoft.openapi.ide.IdeErrorCheck)

showHelp

public void showHelp(String targetID, boolean openInModalDialog, Component parent)
Deprecated.
Parameters:
targetID String ID defined in the help map file
openInModalDialog boolean flag that defines how this help is diaplayed.
If true shows help in the modal dialog.
parent Component dialog where the help was invoked.
Since:
Together 4.0
See Also:
openApplicationHelp

showHelp

public void showHelp(java.net.URL url, boolean openInModalDialog, Component parent)
Deprecated.
Parameters:
url java.net.URL specified URL
openInModalDialog boolean flag that defines how this help is diaplayed.
If true shows help in the modal dialog.
parent Component dialog where the help was invoked.
Since:
Together 4.0
See Also:
openApplicationHelp

synchronize

public void synchronize()
If the data of the opened files change on the disk, automatically reloads these files.