/*----------------------------------------------------------------------------
Copyright © 1998 Object International Software GmbH
----------------------------------------------------------------------------*/
package oisoft.togetherx.scriptapi;
import java.awt.Window;
import java.util.Properties;
import oisoft.togetherx.scriptapi.UML.UMLModel;
//----------------------------------------------------------------------------
/**
** The <i>APIManager</i> interface offers access to all the
** Together/J 2.0 model interfaces and services.
** A reference to this interface is passed as the only parameter
** of <i>Script.doIt()</i> method.
** The interface contains in addition some common utility methods.
** @version 2.1.05 14.06.1998
** @author Andrei Ivanov
** @see Script
** @see Script#doIt
** @see oisoft.togetherx.scriptapi.UML.UMLModel
*/
public interface APIManager
{
/** Use this method when you begin to work with a UML package
to access its elements and properties.
@return Reference to the root interface of the hierarchy of UML elements.
@see oisoft.togetherx.scriptapi.UML.UMLModel
*/
public UMLModel getUMLModel();
/** Use this method for getting the full path of the output document.
Usually the implementation launches the standard "Save As" dialog.
(Compare with <i>getOutputDirectory()</i>, which returns the full
path to directory).
@return Full path to the selected document
@param strExtension extension defining the file type you wish to open
@see #getOutputDirectory
@see #openExternalViewer
*/
public String getOutputStream(String strExtension);
/** Use this method for getting the full path of the output directory.
Usually the implementation launches the standard "Save As" or
"Choose directory" dialog.
(Compare with <i>getOutputStream()</i>, which returns the full
path to file)
@return Full path to the selected directory
@param strExtension extension defining the filter for files
you wish to be displayed in the dialog
@see #getOutputStream
*/
public String getOutputDirectory(String strExtension);
/** Use this method to put error messages into the Together/J
message window.
@param strMessage Message to display
*/
public void createMessage(String strMessage);
/** Use these methods to put any messages into the Together/J
Message window. It is possible to navigate to edit panel from message window,
if url is path to java-file.
@param strFolder Name of message group
@param strMessage Message to display
@param strPath Path to file contains error
@param line Line of error
@param col Column of error
@param strType Type of message. Use "Error" for error messages and "Warning" for warnings
@since 345
*/
public void createMessage(String strFolder, String strMessage, String strPath, int line, int col, String strType);
public void createMessage(String strFolder, String strMessage, String strType);
public boolean warningMessage(String message );
/**
Used to create an (initially invisible) top level, Together owned window or dialog. A window created
using this entrypoint will behave correctly when Together is minimized/maximized via a system command.
@param title the title of the window when displayed.
@param modal determines if the resulting window should be modal
@since 345
*/
public Window createDialog(String title, boolean modal);
/** Use these methods (in overloaded forms) when you wish to customize
some <b>JavaBean</b> property for your script or some other object.
When you call <i>customize()</i> method, Together/J displays a panel
with the properties of object being customized
and those properties should meet the standard JavaBeans name convention.
You can use properties of standard types and of the
<i>java.io.File</i> type.
The first form of this method invokes the default customization dialog.
The second form of this method allows to control the dialog title and
user's response (due to the return value).
The third form of this method allows in addition to control
the Help support for the dialog:
Pass the HTML help file name, which will display on clicking the Help button.
You can use the Create Script master for examples
of customization and for automatic adding properties
to a script.
@param customizableObject Object to be customized
@param strTitle a title for the customization dialog (only for second and third form)
@param strHelpFile a Help file invoked by clicking the Help button (only for third form)
@return <b>true</b> - if user finish the dialog with OK, and <br>
<b>false</b> - if user click Cancel (only for second and third form)
*/
public void customize(Object customizableObject);
public boolean customize(Object customizableObject, String strTitle);
public boolean customize(Object customizableObject, String strTitle, String strHelpFile);
/** Use this method to access the system properties,
Together/J properties, or properties of your script.
The <i>Properties</i> this method returns are collected
from the system properties and properties from the
<tt>host.properties</tt> and <tt>together.properties</tt> files.
You can add your own properties and modify existing ones -
they will be saved for future use.
For example:<br><tt>
...<br>
Properties props = apiManager.getHostProperties();<br>
props.put("some_script.some_property", "some_value");<br>
...<br></tt>
@return Properties collection
*/
public Properties getHostProperties();
/** Use this method for getting the full path to the Together/J
installation directory.
@return Full product installation path
*/
public String getIdeRootDir();
/** Use this method when you wish to open the output
document in the associated application.
The document should be previously created. The implementation
launches the application associated with the file extension
using <tt>oistart</tt>.
@param strOutputName Full path to the document to be opened
@see #getOutputStream
*/
public void openExternalViewer(String strOutputName);
}
//----------------------------------------------------------------------------
|