Package com.arbortext.epic
Class Application
java.lang.Object
com.arbortext.epic.Application
The
Application interface provides access to PTC Arbortext
Editor and PTC Arbortext Publishing Engine global functionality. (That
is, features that are not associated with any document, document type,
or document component.) It is implemented as a singleton: there is only
one Application object instantiation in existence.- Since:
- Epic 4.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final shortThe option has document scope.static final shortThe option has global scope.static final shortThe option name is invalid.static final intDisplay Abort, Retry, and Ignore buttons.static final intThe first button is the default.static final intThe second button is the default.static final intThe third button is the default.static final intDisplay the Error (Stop) icon.static final intDisplay the Information icon.static final intDisplay the Question icon.static final intDisplay the Warning icon.static final intDisplay OK button only.static final intDisplay OK and Cancel buttons.static final intDisplay Retry and Cancel buttons.static final intDisplay Yes and No buttons.static final intDisplay Yes, No, and Cancel buttons.static final intPerform a completeness check when reading the SGML file.static final intOpen as a specially-treated compare document.static final intOpen for writing and do not lock the underlying file.static final intProcess initialization files immediately after opening the document.static final intUse the document type specified bypubIdandsysIdto parse the SGML or XML file instead of the document type specified in the file itself.static final intOpen the document in free form mode, ignoring the document type specified in the file or by the public identifierpubIdand system identifiersysIdparameters.static final intOpen a help document.static final intSpecifies that thepubIdparameter is actually a namespace URI instead of a public identifier.static final intTreat the document as if it were created using the New dialog.static final intDo not lock the underlying file.static final intSuppress the completeness check when reading the SGML file.static final intDo not prompt the user if the document type associated with the document instance does not exist or is not compiled.static final intDo not display any parser error messages in a message window.static final intOpen the document without loading a style sheet.static final intSpecifies that the path name parameterpathis actually a string to parse instead of a file to open.static final intOpen for read only and do not lock the underlying file.static final intSpecifies that if an autosave or recovery file exists for the document, the user should be prompted to select the document to open.static final intCause the table editor to recognize tables immediately after opening the document.static final intOpen the document as an XML document even if it does not start with the XML version processing instruction.static final shortThe option has view scope.static final shortThe option has window scope. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddEventListener(String type, EventListener listener, boolean useCapture) This method allows the registration of event listeners on the event target.static voidMethod overload which omits the last parameter.static voidDisplays an alert dialog box with the specified message.static booleanMethod overload which omits the last parameter.static booleanDisplays a modal confirmation dialog box with the specified message.static CMSObjectconstructObject(String logicalId) Method overload which omits the last 2 parameters.static CMSObjectconstructObject(String logicalId, Document doc) Method overload which omits the last parameter.static CMSObjectconstructObject(String logicalId, Document doc, boolean reserved) Create a new CMSObject for the object referenced by logicalId.static ComposercreateComposer(String ccfPath) Creates aComposerobject for the givenccfPath.static DialogcreateDialogFromDocument(Document document) Method overload which omits the last 2 parameters.static DialogcreateDialogFromDocument(Document document, PropertyMap propertyMap) Method overload which omits the last parameter.static DialogcreateDialogFromDocument(Document document, PropertyMap propertyMap, Window parent) Creates a dynamic dialog box according to the content of a document.static DialogcreateDialogFromFile(String filename) Method overload which omits the last 2 parameters.static DialogcreateDialogFromFile(String filename, PropertyMap propertyMap) Method overload which omits the last parameter.static DialogcreateDialogFromFile(String filename, PropertyMap propertyMap, Window parent) Creates a dynamic dialog box according to the content of an XML file.static EventcreateEvent(String eventType) Creates an event of typeApplicationEvent.static PropertyMapCreates an emptyPropertyMapobject that is an unordered collection of name-value pairs.static StringListcreateStringList(int size) Creates an emptyStringListobject that is an ordered collection ofDOMStrings.static TableObjectStoreCreates an emptyTableObjectStoreobject that is a collection ofTableObjects.static TableTilePlexCreates an emptyTableTilePlexobject which can represent a table selection in a document.static WindowcreateWindow(String windowClass) Method overload which omits the last 5 parameters.static WindowcreateWindow(String windowClass, int flags) Method overload which omits the last 4 parameters.static WindowcreateWindow(String windowClass, int flags, Document doc) Method overload which omits the last 3 parameters.static WindowcreateWindow(String windowClass, int flags, Document doc, String geometry) Method overload which omits the last 2 parameters.static WindowcreateWindow(String windowClass, int flags, Document doc, String geometry, Window parent) Method overload which omits the last parameter.static WindowcreateWindow(String windowClass, int flags, Document doc, String geometry, Window parent, String xuiPath) Creates a window of the specifiedwindowClasswith optional components given byflags.static booleandispatchEvent(Event evt) This method allows the dispatch of events into the implementations event model.static voidSounds a beep and displays the error message specified bymessagein the status bar of the active window if possible, otherwise in a separate dialog.static DocumentA DOMDocumentthat represents the PTC Arbortext Editor or PTC Arbortext Publishing Engine active or current document .static CMSSessionRepresents the activeCMSSession(if any).static WindowAWindowobject that represents the PTC Arbortext Editor active window.static CMSAdaptergetAdapter(String adapterQName) Returns the requested adapter if available.static StringListA list of adapter qualified names for all registered adapters that are available to the application.static StringMethod overload which omits the last parameter.static StringgetCustomDirectory(String name) Returns the installation directory for a specified application.static PropertyMapReturns aPropertyMapobject containing custom properties for an application.static NodeListA DOMNodeListwhich contains all documents currently opened by PTC Arbortext Editor or PTC Arbortext Publishing Engine.static DOMImplementationTheDOMImplementationobject.static EventgetEvent()AnEventobject which stores the context of the current event.static booleanReturnstrueif the application is running in windows-mode.static booleanReturnstrueif the product has completed initialization.static booleangetIsE3()Returnstrueif the product is running as PTC Arbortext Publishing Engine, either server or interactive mode.static StringMethod overload which omits the last parameter.static StringReturns the requested locale string.static StringgetLocalizedMessage(String message) Returns the localized version of the specified message from the default message catalog file.static StringgetLocalizedMessage(String inString, Object obj) Returns the localized, substituted, and formatted string forinString.static StringgetLocalizedMessage(String inString, Object... args) Returns the localized, substituted, and formatted string for theinString.static StringgetLocalizedMessage(String inString, Object obj1, Object obj2) Returns the localized, substituted, and formated string for theinString.static StringgetLocalizedMessage(String inString, Object obj1, Object obj2, Object obj3) Returns the localized, substituted, and formated string for theinString.static StringReturns the localized, substituted, and formated string for theinString.static StringgetLocalizedMessage(String inString, Object obj1, Object obj2, Object obj3, Object obj4, Object obj5) Returns the localized, substituted, and formated string for theinString.static StringgetName()Specifies the name of the PTC Arbortext product, for example,"PTC Arbortext Editor".static StringReturns the value of the PTC Arbortext set option, in global scope.static StringListAStringListcontaining the names of all PTC Arbortext set options, excluding ACL hook names.static shortgetOptionScope(String name) Returns the scope of the PTC Arbortext set option.static StringgetPath()specifies the location of the directory that contains the program files needed to run the software.static PropertyMapReturns aPropertyMapobject containing user properties (preferences) that override custom properties set for an application.static booleanlogicalIdExists(String logicalId) Tests the existence of Logical IDs associated with any active CMS session as well as for file-system and http/https resources.static CMSSessionlogicalIdToSession(String logicalId) If the specified path is the correct Logical ID format for a connected CMS, this returns the CMSSession object associated with that session.static intmessageBox(String message) Method overload which omits the last 2 parameters.static intmessageBox(String message, int flags) Method overload which omits the last parameter.static intmessageBox(String message, int flags, String title) Displays a message box with the textmessageand optional titletitle.static DocumentMethod overload which omits the last 6 parameters.static DocumentopenDocument(String path) Method overload which omits the last 5 parameters.static DocumentopenDocument(String path, int flags) Method overload which omits the last 4 parameters.static DocumentopenDocument(String path, int flags, String name) Method overload which omits the last 3 parameters.static DocumentopenDocument(String path, int flags, String name, String pubId) Method overload which omits the last 2 parameters.static DocumentopenDocument(String path, int flags, String name, String pubId, String sysId) Method overload which omits the last parameter.static DocumentReads an XML or SGML file and creates a newDocumentobject that may be used to navigate the document's content.static voidprint()Method overload which omits the last parameter.static voidOutputs a string to the message window.static StringMethod overload which omits the last 2 parameters.static StringMethod overload which omits the last parameter.static StringDisplays a modal dialog box with the specified messageprompt, a text input field, and OK and Cancel buttons.static voidquit()Method overload which omits the last 2 parameters.static voidquit(int code) Method overload which omits the last parameter.static voidquit(int code, int status) Terminates the application with the exit statusstatus.static voidregisterIOAdapter(IOAdapter adapter, String name, String qName) Called during startup by the adapter to register itself with PTC Arbortext Editor.static voidremoveEventListener(String type, EventListener listener, boolean useCapture) This method allows the removal of event listeners from the event target.static voidRuns the macro or alias namedname.static voidsetActiveSession(CMSSession activeSession) Represents the activeCMSSession(if any).static voidSets the value of the PTC Arbortext set option, in global scope.
-
Field Details
-
OPEN_RDONLY
public static final int OPEN_RDONLYOpen for read only and do not lock the underlying file. If this is not set, the underlying file will be locked if possible and the document will be read-only if no lock was acquired.
The “checked out” status of CMS Objects will not be affected.- See Also:
-
OPEN_DOCRDWR
public static final int OPEN_DOCRDWROpen for writing and do not lock the underlying file. The document will be modifiable even though the underlying file is not locked.
If the document was already open in memory, this will additionally attempt to lock the underlying file.
The “checked out” status of CMS Objects will not be affected.- See Also:
-
OPEN_NLOCK
public static final int OPEN_NLOCKDo not lock the underlying file. Overrides all other flags which might acquire a file lock. The resulting document will not be modifiable unlessOPEN_DOCRDWRis also given.
The “checked out” status of CMS Objects will not be affected.- See Also:
-
OPEN_CC
public static final int OPEN_CCPerform a completeness check when reading the SGML file. This option is ignored for XML documents.- See Also:
-
OPEN_NOCC
public static final int OPEN_NOCCSuppress the completeness check when reading the SGML file. This option is ignored for XML documents.OPEN_NOCCis the default option for SGML documents saved by PTC Arbortext Editor and PTC Arbortext Publishing Engine.- See Also:
-
OPEN_NOMSGS
public static final int OPEN_NOMSGSDo not display any parser error messages in a message window. Instead, suppress all warnings and errors.- See Also:
-
OPEN_FORCEDT
public static final int OPEN_FORCEDTUse the document type specified bypubIdandsysIdto parse the SGML or XML file instead of the document type specified in the file itself.- See Also:
-
OPEN_HELPWIN
public static final int OPEN_HELPWINOpen a help document. (Used internally by PTC Arbortext Editor and PTC Arbortext Publishing Engine.)- See Also:
-
OPEN_XML
public static final int OPEN_XMLOpen the document as an XML document even if it does not start with the XML version processing instruction. If not specified, the document is loaded as an SGML document unless the document starts with the XML version header.- See Also:
-
OPEN_NOSTYLE
public static final int OPEN_NOSTYLEOpen the document without loading a style sheet.- See Also:
-
OPEN_NODTPROMPT
public static final int OPEN_NODTPROMPTDo not prompt the user if the document type associated with the document instance does not exist or is not compiled. Instead, returnnull.- See Also:
-
OPEN_COMPARE
public static final int OPEN_COMPAREOpen as a specially-treated compare document. (Used internally by PTC Arbortext Editor and PTC Arbortext Publishing Engine.)- See Also:
-
OPEN_RECTABLES
public static final int OPEN_RECTABLESCause the table editor to recognize tables immediately after opening the document. By default, table objects are not created until the document is displayed in a window.- See Also:
-
OPEN_EDITINIT
public static final int OPEN_EDITINITProcess initialization files immediately after opening the document. This includes sourcing the associated document type instance files (instance.acl,instance.js, andinstance.vbs) and the document command files (docname.acl, docname.js, and docname.vbs). By default, these files are not processed until the document is displayed in a window.- See Also:
-
OPEN_NEW_DOC
public static final int OPEN_NEW_DOCTreat the document as if it were created using the New dialog. In this case, the path name is set to null and the document name is of the formDocumentN.- See Also:
-
OPEN_RECOVERY_PROMPT
public static final int OPEN_RECOVERY_PROMPTSpecifies that if an autosave or recovery file exists for the document, the user should be prompted to select the document to open.- See Also:
-
OPEN_NAMESPACE_URI
public static final int OPEN_NAMESPACE_URISpecifies that thepubIdparameter is actually a namespace URI instead of a public identifier. IfOPEN_FORCEDTis also specified, then the namespace URI is used to locate the XML schema to parse the document.- See Also:
-
OPEN_FREEFORM
public static final int OPEN_FREEFORMOpen the document in free form mode, ignoring the document type specified in the file or by the public identifierpubIdand system identifiersysIdparameters.- See Also:
-
OPEN_PARSE_STRING
public static final int OPEN_PARSE_STRINGSpecifies that the path name parameterpathis actually a string to parse instead of a file to open. If the string does not contain a DOCTYPE declaration then thepubIdand orsysIdparameters must be given so the desired document type is used to parse the string or elseOPEN_FREEFORMshould be specified. If the string contains XML markup but does not start with an XML declaration thenOPEN_XMLmust also be specified.- Since:
- Arbortext 5.4
- See Also:
-
INVALID_SCOPE
public static final short INVALID_SCOPEThe option name is invalid.- See Also:
-
GLOBAL_SCOPE
public static final short GLOBAL_SCOPEThe option has global scope.- See Also:
-
DOCUMENT_SCOPE
public static final short DOCUMENT_SCOPEThe option has document scope.- See Also:
-
WINDOW_SCOPE
public static final short WINDOW_SCOPEThe option has window scope.- See Also:
-
VIEW_SCOPE
public static final short VIEW_SCOPEThe option has view scope.- See Also:
-
MBF_OK
public static final int MBF_OKDisplay OK button only. This is the default.- See Also:
-
MBF_OKCANCEL
public static final int MBF_OKCANCELDisplay OK and Cancel buttons.- See Also:
-
MBF_ABORTRETRYIGNORE
public static final int MBF_ABORTRETRYIGNOREDisplay Abort, Retry, and Ignore buttons.- See Also:
-
MBF_YESNOCANCEL
public static final int MBF_YESNOCANCELDisplay Yes, No, and Cancel buttons.- See Also:
-
MBF_YESNO
public static final int MBF_YESNODisplay Yes and No buttons.- See Also:
-
MBF_RETRYCANCEL
public static final int MBF_RETRYCANCELDisplay Retry and Cancel buttons.- See Also:
-
MBF_ICONERROR
public static final int MBF_ICONERRORDisplay the Error (Stop) icon. This icon is typically used with the Abort, Retry, and Ignore buttons.- See Also:
-
MBF_ICONQUESTION
public static final int MBF_ICONQUESTIONDisplay the Question icon. This icon is typically used with the Yes and No buttons.- See Also:
-
MBF_ICONWARNING
public static final int MBF_ICONWARNINGDisplay the Warning icon.- See Also:
-
MBF_ICONINFORMATION
public static final int MBF_ICONINFORMATIONDisplay the Information icon.- See Also:
-
MBF_DEFBUTTON1
public static final int MBF_DEFBUTTON1The first button is the default. This is the default if no other default button flag is specified.- See Also:
-
MBF_DEFBUTTON2
public static final int MBF_DEFBUTTON2The second button is the default.- See Also:
-
MBF_DEFBUTTON3
public static final int MBF_DEFBUTTON3The third button is the default.- See Also:
-
-
Constructor Details
-
Application
public Application()
-
-
Method Details
-
getDomImplementation
TheDOMImplementationobject. This is the same value that is returned by a DOMDocumentobject'simplementationattribute.- Since:
- Epic 4.0
-
getDocuments
A DOMNodeListwhich contains all documents currently opened by PTC Arbortext Editor or PTC Arbortext Publishing Engine. TheNodeListwill be updated as documents are opened and closed.- Since:
- Epic 4.0
-
getActiveDocument
A DOMDocumentthat represents the PTC Arbortext Editor or PTC Arbortext Publishing Engine active or current document . If the user interface is active, this is the document that has the focus.- Since:
- Epic 4.0
-
getLocalizedMessage
Returns the localized version of the specified message from the default message catalog file.- Parameters:
message- The message to localize.- Returns:
- The localized version of
message. If the message is not found in the message file, returnsmessage. - Since:
- Epic 4.2
-
alert
Displays an alert dialog box with the specified message.- Parameters:
message- Specifies the message to display in the dialog boxtitle- Specifies the dialog box title. If omitted, the title defaults to"Alert".- Since:
- Epic 4.2
-
alert
Method overload which omits the last parameter. -
confirm
Displays a modal confirmation dialog box with the specified message.- Parameters:
message- Specifies the message to display in the dialog boxtitle- Specifies the dialog box title. If omitted, the title defaults to"Confirm".- Returns:
- Returns
trueif the user clicks OK. Returnsfalseif the user clicks Cancel. - Since:
- Epic 4.2
-
confirm
Method overload which omits the last parameter. -
prompt
Displays a modal dialog box with the specified messageprompt, a text input field, and OK and Cancel buttons.- Parameters:
prompt- Specifies the message to display in the dialog boxvalue- Specifies the initial value displayed in the text input field.title- Specifies the dialog box title. If omitted, the title defaults to"Prompt".- Returns:
- Returns the string in the text input field if the user clicks
OK. Returns
nullif the user clicks Cancel. - Since:
- Epic 4.2
-
prompt
Method overload which omits the last parameter. -
prompt
Method overload which omits the last 2 parameters. -
getActiveWindow
AWindowobject that represents the PTC Arbortext Editor active window. If the user interface is not active, returnsnull.- Since:
- Epic 4.3
-
getEvent
AnEventobject which stores the context of the current event. This attribute can only be obtained from within an event listener.- Since:
- Epic 4.3
-
getOptionNames
AStringListcontaining the names of all PTC Arbortext set options, excluding ACL hook names.- Since:
- Epic 4.3
-
createDialogFromDocument
public static Dialog createDialogFromDocument(Document document, PropertyMap propertyMap, Window parent) Creates a dynamic dialog box according to the content of a document.- Parameters:
document- The document describing the dialog box. This must conform to the XML User Interface (XUI) document type.propertyMap- APropertyMapobject created by thecreatePropertyMapmethod to associate with theDialog. This parameter is optional and is not used by PTC Arbortext Editor or PTC Arbortext Publishing Engine.parent- The parent window of the new dynamic dialog. If this parameter is not specified or zero, the parent will be the current active window.- Returns:
- The
Dialogobject. - Since:
- Epic 4.3
-
createDialogFromDocument
Method overload which omits the last parameter. -
createDialogFromDocument
Method overload which omits the last 2 parameters. -
createDialogFromFile
Creates a dynamic dialog box according to the content of an XML file.- Parameters:
filename- The XML file containing the dialog box description. This must conform to the XML User Interface (XUI) document type.propertyMap- APropertyMapobject created by thecreatePropertyMapmethod to associate with theDialog. This parameter is optional and is not used by PTC Arbortext Editor or PTC Arbortext Publishing Engine.parent- The parent window of the new dynamic dialog. If this parameter is not specified or zero, the parent will be the current active window.- Returns:
- The
Dialogobject. - Since:
- Epic 4.3
-
createDialogFromFile
Method overload which omits the last parameter. -
createDialogFromFile
Method overload which omits the last 2 parameters. -
createStringList
Creates an emptyStringListobject that is an ordered collection ofDOMStrings.- Parameters:
size- The initial size of the array.- Returns:
- The
StringListobject. - Since:
- Epic 4.3
-
createPropertyMap
Creates an emptyPropertyMapobject that is an unordered collection of name-value pairs.- Returns:
- The
PropertyMapobject. - Since:
- Epic 4.3
-
createTableObjectStore
Creates an emptyTableObjectStoreobject that is a collection ofTableObjects.- Returns:
- The
TableObjectStoreobject. - Since:
- Epic 4.3
-
createTableTilePlex
Creates an emptyTableTilePlexobject which can represent a table selection in a document.- Returns:
- The
TableTilePlexobject. - Since:
- Epic 4.3
-
getOption
Returns the value of the PTC Arbortext set option, in global scope.- Parameters:
name- Specifies the option name.- Returns:
- The string value of the option, or
nullifnameis not a valid option name. Boolean values returnonoroff. - Since:
- Epic 4.3
-
getOptionScope
Returns the scope of the PTC Arbortext set option.- Parameters:
name- Specifies the option name.- Returns:
- A code representing the scope of the option as defined by
OptionScopeType. Ifnameis not a valid option name, returnsINVALID_SCOPE. - Since:
- Epic 4.3
-
setOption
Sets the value of the PTC Arbortext set option, in global scope. Ifnamespecifies aDocument- orView-scoped option, setting the value does not affect any existing documents or views, only newly created objects.- Parameters:
name- Specifies the option name.value- Specifies the new value of the option. Boolean values are specified using the stringonoroff.- Throws:
AOMException- Raised if the method detects an error (for example, ifnameis not a valid option).- Since:
- Epic 4.3
-
openDocument
public static Document openDocument(String path, int flags, String name, String pubId, String sysId, String stylesheet) throws AOMException Reads an XML or SGML file and creates a newDocumentobject that may be used to navigate the document's content. The method may also be used to create an empty document ifpathisnull, similar to thecreateDocumentmethod of theDOMImplementationinterface.
Thepubidandsysidarguments specify the document type for the document ifpathis omitted ornull, if the associated file does not specify a DOCTYPE declaration, or if bitOPEN_FORCEDTis included inflags. Thepubidandsysidarguments are ignored ifpathspecifies an SGML file that starts with a DOCTYPE declaration, ifOPEN_FORCEDTis not specified, or ifpathspecifies a binary document file. If the document type is not specified, is"ascii", or cannot be determined the document is opened in untagged mode.- Parameters:
path- Specifies the path name of a document directory or the file name from which to load the initial contents of the document tree. May be a"file://"or"http://"URL. If the URL specifies a server supporting WebDAV, the file will be opened for editing (Windows only). If the server does not support WebDAV, the file will be opened as read-only. Ifnullor an empty string, the document is empty.flags- A bitmask that specifies open options. Constructed by ORing the bits from theLoadFlagsenumeration.name- Specifies a name to be used for informational purposes. Ifnullor the empty string, the base name ofpathis used. Ifpathisnullor empty, an internal name is assigned.pubId- Specifies the public identifier of the document type.sysId- Specifies the system identifier of the document type.stylesheet- Specifies the style sheet to be used instead of the default style sheet for the document. If flagOPEN_NOSTYLEis set, this parameter is ignored. If the specified style sheet does not exist, an exception is raised.- Returns:
- A new
Documentobject. - Throws:
AOMException- Raised if the method detects any error.- Since:
- Epic 4.3
-
openDocument
public static Document openDocument(String path, int flags, String name, String pubId, String sysId) throws AOMException Method overload which omits the last parameter.- Throws:
AOMException
-
openDocument
public static Document openDocument(String path, int flags, String name, String pubId) throws AOMException Method overload which omits the last 2 parameters.- Throws:
AOMException
-
openDocument
Method overload which omits the last 3 parameters.- Throws:
AOMException
-
openDocument
Method overload which omits the last 4 parameters.- Throws:
AOMException
-
openDocument
Method overload which omits the last 5 parameters.- Throws:
AOMException
-
openDocument
Method overload which omits the last 6 parameters.- Throws:
AOMException
-
createComposer
Creates aComposerobject for the givenccfPath.- Parameters:
ccfPath- The path of the CCF file.- Returns:
- The
Composerobject. - Throws:
AOMException- Raised if theccfPathis invalid, or if there is an error creating theComposer.- Since:
- Epic 4.3
-
print
Outputs a string to the message window. If the user interface is not open on Windows, the message is discarded. In PTC Arbortext Publishing Engine on Windows, the message is sent to the trace window if it is open, otherwise it is discarded.- Parameters:
str- Specifies the string to print. A line break is not added. Newline characters in the string will cause line breaks. If the parameter is omitted ornull, a line break is output. This method can not be used from Visual Basic sinceprintis a reserved word in Visual Basic and can't be used as a method name on any object.- Since:
- Epic 4.3
-
print
public static void print()Method overload which omits the last parameter. -
getPath
specifies the location of the directory that contains the program files needed to run the software.- Since:
- Epic 4.4.1
-
createEvent
Creates an event of typeApplicationEvent.- Parameters:
eventType- TheeventTypeparameter specifies the type ofEventinterface to be created. If theEventinterface specified is supported by the implementation this method will return a newEventof the interface type requested. If theEventis to be dispatched via thedispatchEventmethod the appropriate event init method must be called after creation in order to initialize theEvent's values.- Returns:
- The newly created
Event - Throws:
AOMException- Raised if the implementation does not support the type ofEventinterface requested.- Since:
- Epic 4.4.1
-
run
Runs the macro or alias namedname. The name is first looked up as a macro using the active document macro scope. If no such macro is found in any scope, thennameis looked up as a command alias.- Parameters:
name- The name of the macro or alias to execute.- Throws:
AOMException- Raised ifnameis not recognized as a macro or alias or if an error occurs while executing the macro or alias.- Since:
- Epic 4.4.2
-
getHaveWindows
public static boolean getHaveWindows()Returnstrueif the application is running in windows-mode. Returnsfalseif running as PTC Arbortext Publishing Engine server or in one-shot command mode (-cspecified as a startup option).- Since:
- Epic 5.1
-
getInitDone
public static boolean getInitDone()Returnstrueif the product has completed initialization.- Since:
- Epic 5.1
-
getIsE3
public static boolean getIsE3()Returnstrueif the product is running as PTC Arbortext Publishing Engine, either server or interactive mode. Server mode can be determined by also testing thehaveWindowsattribute.- Since:
- Epic 5.1
-
getName
Specifies the name of the PTC Arbortext product, for example,"PTC Arbortext Editor". This string is not localized. The localized version of the string can be obtained by callinggetLocalizedMessageon the result.- Since:
- Epic 5.1
-
getCustomProperties
Returns aPropertyMapobject containing custom properties for an application. This object is initialized from the application-specific global parameters specified in an application'sapplication.xmlfile.- Since:
- Epic 5.1
-
getUserProperties
Returns aPropertyMapobject containing user properties (preferences) that override custom properties set for an application. This object is initialized from the user property section of theepic.wcfpreferences file. Changes made to theuserPropertiesobject are saved back to the preferences file on exit.- Since:
- Epic 5.1
-
getCustomDirectory
Returns the installation directory for a specified application. Ifnameis omitted or the null string, then the default custom directory is returned, either the first value of theAPTCUSTOMenvironment variable if set or else thecustomsubdirectory in the product installation directory.
Ifnameis a number, then this specifies the 0-based index into the list of custom directories. This allows an iterator to enumerate the list of custom directories by calling this method in a loop, incrementing the index until a null string is returned.
Ifnameis a negative integer, then the list is traversed in reverse."-1"returns the last custom directory,"-2"the second to last custom directory and so on.- Parameters:
name- Specifies the application name or index.- Returns:
- The full path name of the specified application's custom
directory or
nullifnameis not a loaded application name or if it specifies an index out of range. - Since:
- Epic 5.1
-
getCustomDirectory
Method overload which omits the last parameter. -
error
Sounds a beep and displays the error message specified bymessagein the status bar of the active window if possible, otherwise in a separate dialog. The message is also assigned to theERRORpredefined ACL variable
Theerrormethod is used by PTC Arbortext Editor to display most error messages.- Parameters:
message- Specifies the message to display.- Since:
- Epic 5.1
-
messageBox
Displays a message box with the textmessageand optional titletitle. Theflagsparameter determines what predefined buttons and icons display in the message box, and is formed by ORing the flags from the following groups of flag bits.
Specify one of the following flags to indicate the buttons that will display in the message box:- 0x00 — Display OK button only. This is the default.
- 0x01 — Display OK and Cancel buttons.
- 0x02 — Display Abort, Retry, and Ignore buttons.
- 0x03 — Display Yes, No, and Cancel buttons.
- 0x04 — Display Yes and No buttons.
- 0x05 — Display Retry and Cancel buttons.
Specify one of the following flags to indicate the icon to display in the message box. If you do not specify one of these flags, an icon does not display.- 0x10 — Display the Error (Stop) icon. This icon is typically used with the Abort, Retry, and Ignore buttons
- 0x20 — Display the Question icon. This icon is typically used with the Yes and No buttons.
- 0x30 — Display the Warning icon.
- 0x40 — Display the Information icon.
Specify one of the following flags to indicate the default button:- 0x000 — The first button is the default. This is the default if no other default button flag is specified.
- 0x100 — The second button is the default.
- 0x200 — The third button is the default.
If the dialog box has a Cancel or Ignore button, the function returns3if the Cancel or Ignore button orESCkey was pressed, or if the dialog box was closed from the Close system menu or Close button. If the dialog box does not have a Cancel or Ignore button and is closed with theESCkey or by the Close system menu or Close button, the function returns2if the dialog has only Yes and No buttons. If the dialog box only has an OK button, it returns a1.- Parameters:
message- Specifies the message to display.flags- Specifies a bitmask of options constructed by ORing the bits from theMessageBoxFlagsenumeration.title- Specifies the dialog box title. If omitted, the title defaults to"Message".- Returns:
- The return value is one of the following:
-
1- The first button (Yes, OK, Abort, or Retry) was pressed. -
2- The No button was pressed. -
3- The third button (Cancel or Ignore) was pressed.
-
- Since:
- Epic 5.1
-
messageBox
Method overload which omits the last parameter. -
messageBox
Method overload which omits the last 2 parameters. -
quit
public static void quit(int code, int status) Terminates the application with the exit statusstatus. The parametercodedetermines if the user is prompted for unsaved changes or not and has one of the values:-
0— prompt about any unsaved changes. -
1— save all modified documents without prompting. -
2— do not prompt about unsaved changes and quit without saving modified documents.
- Parameters:
code- Specifies whether unsaved changes are prompted (0), saved without prompting (1), or discarded without prompting (2). The default is 0.status- Specifies the exit status for the program. The default is 0.- Since:
- Epic 5.1
-
-
quit
public static void quit(int code) Method overload which omits the last parameter. -
quit
public static void quit()Method overload which omits the last 2 parameters. -
getAdapterQNames
A list of adapter qualified names for all registered adapters that are available to the application. These values are suitable for use with theApplication.getAdapter()method.- Since:
- Epic 5.2
-
getActiveSession
Represents the activeCMSSession(if any).- Since:
- Epic 5.2
-
setActiveSession
Represents the activeCMSSession(if any).- Since:
- Epic 5.2
-
registerIOAdapter
public static void registerIOAdapter(IOAdapter adapter, String name, String qName) throws CMSException Called during startup by the adapter to register itself with PTC Arbortext Editor. This call should be the last thing done in the initialization/loading code for the adapter. An adapter cannot be unregistered once it has been registered.- Parameters:
adapter- The adapter instance.name- The human-readable name of the adapter.qName- The qualified name that uniquely identifies this adapter. Qualified names should follow the same reverse domain name convention used by Java.- Throws:
CMSException- Raised for any error.- Since:
- Epic 5.2
-
getLocale
Returns the requested locale string.- Parameters:
category-nullor a supported locale category string.On UNIX, this returns the shorter form of the locale name regardless of the value of thecategoryparameter.On Windows, the following category strings are supported (case sensitive).categoryMethod Result nullor empty stringAbbreviated locale string (2-3 letter code). Example: ENULC_COLLATEThe locale governing certain collating functions. LC_CTYPEThe locale governing human-readable messages. LC_MESSAGESEquivalent to LC_CTYPE.LC_MONETARYThe locale governing money formatting. LC_NUMERICThe locale governing numeric formatting. LC_TIMEThe locale governing time formatting. Any other string. Method will return an empty string. - Returns:
- The requested locale string. Will be null for any unrecognized category string.
- Since:
- Epic 5.2
-
getLocale
Method overload which omits the last parameter. -
getAdapter
Returns the requested adapter if available.- Parameters:
adapterQName- Adapter qualified name.- Returns:
- The requested
CMSAdapterornullif no such adapter is registered. - Since:
- Epic 5.2
-
logicalIdToSession
If the specified path is the correct Logical ID format for a connected CMS, this returns the CMSSession object associated with that session.- Parameters:
logicalId- CMS-specific Logical ID. The existence of this Logical ID is not considered when looking for a session.- Returns:
- CMSSession which claimed ownership of the given Logical ID.
Will return
nullif no session claimed ownership. - Since:
- Epic 5.2
-
constructObject
public static CMSObject constructObject(String logicalId, Document doc, boolean reserved) throws CMSException Create a new CMSObject for the object referenced by logicalId.- Parameters:
logicalId- Logical ID for a CMS object to be referenced.doc- NULL or document to use for context information.reserved- This parameter is reserved for future use and should always befalse.- Returns:
- New object handle.
- Throws:
CMSException- Raised if the CMS object does not exist or an error occurs.- Since:
- Epic 5.2
-
constructObject
Method overload which omits the last parameter.- Throws:
CMSException
-
constructObject
Method overload which omits the last 2 parameters.- Throws:
CMSException
-
logicalIdExists
Tests the existence of Logical IDs associated with any active CMS session as well as for file-system and http/https resources.- Parameters:
logicalId- Logical ID for a CMS or a file-system or http/https resource.- Returns:
trueif the referenced object/resource exists,falseotherwise.If there is any error accessing the resource, this will returnfalseand will not throw an exception.- Since:
- Epic 5.2
-
createWindow
public static Window createWindow(String windowClass, int flags, Document doc, String geometry, Window parent, String xuiPath) throws AOMException Creates a window of the specifiedwindowClasswith optional components given byflags. The window created is not initially displayed. Use theWindow.show()method to make the window appear.- Parameters:
windowClass- Windows are of two types:-
Document class windows
that display a document tree and have a
windowClassof edit, helpwin[1-4], or msgwin[1-4]. -
Dialog class windows that
display either a list selection dialog box of
windowClasslist or xui.
0x00040is specified inflags, the global keymap for the class will be used. See theflagsbit descriptions below.-
Document class windows
that display a document tree and have a
flags- Theflagsparameter is a bit mask that depends on thewindowClassand is defined below:The following are the flag bits for list and xui class windows.-
0x1- Supply vertical scrollbar. -
0x2- Verify input (that is, set verify Item attribute). -
0x4- Supply an Apply button, -
0x8- Supply a Help button. -
0x10- For XUI dialog boxes, delete the document after the window is destroyed. In the following example,docwill be destroyed automatically afterwinis destroyed:Document doc = Application.openDocument("c:\\myproject\\myxuifile", 1);Window win = Application.createWindow("xui", 0x10, doc); -
0x040000- Make the new window a top-level window with its parent being the desktop. This flag is only useful to the xui and list class windows; the windows of all other window classes are created as top-level windows.
flagbits for document class (all non-list) windows.-
0x00001- Supply vertical scrollbar (pane). -
0x00002- Supply menu bar. -
0x00004- Supply command subwindow ifwindowClassis edit. -
0x00008- Supply message footer subwindow. -
0x00010- Automatically callADocument.close()on the attached document when the window is destroyed. (pane). -
0x00020-Supply edit toolbar (that is, Toolbar 1) (pane). -
0x00040-Attach the global window class keymap to the window instead of creating a private keymap (pane). -
0x00080- Supply horizontal scrollbar (pane). -
0x00100- Do edit command intializations, include reading the document type instance command files (instance.aclandinstance.js) and document command files (docname.acland docname.js) if they exist, and calling the ACLeditfilehookwhen a document is attached to the window. This bit applies only to edit class windows (pane). -
0x00800- Make the window a typical user edit window (as opposed to a display window). -
0x01000- Supply a table column width ruler (pane). -
0x02000- Supply a table row height ruler (pane). -
0x04000- Supply the Markup toolbar (that is, Toolbar 2). -
0x08000- Supply the Table toolbar (that is, Toolbar 3). -
0x10000- Supply the Application toolbar (that is, Toolbar 4). -
0x080000- Do not update the PTC Arbortext Editor File menu list of recently edited documents, or the Microsoft Windows list of recently edited documents with the path name associated with thedocparameter (if the0x00800flag is specified). Note that this does not apply to documents subsequently loaded in the window.
-
doc- Specifies the document tree to be attached to the window. The document must not already be displayed in another window. If it is, the function returnsnull. Ifdocisnull, a scratch document is created that will automatically be destroyed when the window is destroyed. In this case, the associated document type is ascii for edit class windows or the built-in help document type for other classes.This parameter does not apply to list class windows and is ignored if given.geometry- Specifies the initial geometry for the window and is a string of the formWxH+X+Y, whereWandHare the width and height of the window in pixels, andXandYgive the location of the upper left corner of the window.parent- An optional parameter used to specify the parent window for the new window. Only supports dialog class.xuiPath- An optional parameter used only by edit windows to supply an alternative XUI file to define the toolbars used by the edit window. IfxuiPathis not supplied (or empty), then Arbortext-path\lib\dialogs\editwindow.xmlis used.- Returns:
- A new
Windowobject. - Throws:
AOMException- Raised if the method detects any error.- Since:
- Arbortext 5.4
-
createWindow
public static Window createWindow(String windowClass, int flags, Document doc, String geometry, Window parent) throws AOMException Method overload which omits the last parameter.- Throws:
AOMException
-
createWindow
public static Window createWindow(String windowClass, int flags, Document doc, String geometry) throws AOMException Method overload which omits the last 2 parameters.- Throws:
AOMException
-
createWindow
Method overload which omits the last 3 parameters.- Throws:
AOMException
-
createWindow
Method overload which omits the last 4 parameters.- Throws:
AOMException
-
createWindow
Method overload which omits the last 5 parameters.- Throws:
AOMException
-
addEventListener
This method allows the registration of event listeners on the event target. If anEventListeneris added to anEventTargetwhile it is processing an event, it will not be triggered by the current actions but may be triggered during a later stage of event flow, such as the bubbling phase.
If multiple identicalEventListeners are registered on the sameEventTargetwith the same parameters the duplicate instances are discarded. They do not cause theEventListenerto be called twice and since they are discarded they do not need to be removed with theremoveEventListenermethod.- Parameters:
type- The event type for which the user is registeringlistener- Thelistenerparameter takes an interface implemented by the user which contains the methods to be called when the event occurs.useCapture- If true,useCaptureindicates that the user wishes to initiate capture. After initiating capture, all events of the specified type will be dispatched to the registeredEventListenerbefore being dispatched to anyEventTargetsbeneath them in the tree. Events which are bubbling upward through the tree will not trigger anEventListenerdesignated to use capture.
-
removeEventListener
This method allows the removal of event listeners from the event target. If anEventListeneris removed from anEventTargetwhile it is processing an event, it will not be triggered by the current actions.EventListeners can never be invoked after being removed.
CallingremoveEventListenerwith arguments which do not identify any currently registeredEventListeneron theEventTargethas no effect.- Parameters:
type- Specifies the event type of theEventListenerbeing removed.listener- TheEventListenerparameter indicates theEventListenerto be removed.useCapture- Specifies whether theEventListenerbeing removed was registered as a capturing listener or not. If a listener was registered twice, one with capture and one without, each must be removed separately. Removal of a capturing listener does not affect a non-capturing version of the same listener, and vice versa.
-
dispatchEvent
This method allows the dispatch of events into the implementations event model. Events dispatched in this manner will have the same capturing and bubbling behavior as events dispatched directly by the implementation. The target of the event is theEventTargeton whichdispatchEventis called.- Parameters:
evt- Specifies the event type, behavior, and contextual information to be used in processing the event.- Returns:
- The return value of
dispatchEventindicates whether any of the listeners which handled the event calledpreventDefault. IfpreventDefaultwas called the value is false, else the value is true. - Throws:
EventException- UNSPECIFIED_EVENT_TYPE_ERR: Raised if theEvent's type was not specified by initializing the event beforedispatchEventwas called. Specification of theEvent's type asnullor an empty string will also trigger this exception.
-
getLocalizedMessage
Returns the localized, substituted, and formatted string forinString.- Parameters:
inString- The pattern message to use to find the localized version.obj- The object to substitute the curly braces in the localized pattern message.- Returns:
- A localized, substituted, and formatted string. If the
localized pattern message is not found,
inStringwill be used as the pattern message - Since:
- Epic 4.2
-
getLocalizedMessage
Returns the localized, substituted, and formated string for theinString.- Parameters:
inString- The pattern message to find its localized version.obj1- The object to substitute the first curly braces.obj2- The object to substitute the second curly braces.- Returns:
- A localized, substituted, and formated string. If the
localized pattern message is not found, the
inStringwill be used as the pattern message - Since:
- Epic 4.2
-
getLocalizedMessage
Returns the localized, substituted, and formated string for theinString.- Parameters:
inString- The pattern message to find its localized version.obj1- The object to substitute the first curly braces.obj2- The object to substitute the second curly braces.obj3- The object to substitute the third curly braces.- Returns:
- A localized, substituted, and formated string. If the
localized pattern message is not found, the
inStringwill be used as the pattern message - Since:
- Epic 4.2
-
getLocalizedMessage
public static String getLocalizedMessage(String inString, Object obj1, Object obj2, Object obj3, Object obj4) Returns the localized, substituted, and formated string for theinString.- Parameters:
inString- The pattern message to find its localized version.obj1- The object to substitute the first curly braces.obj2- The object to substitute the second curly braces.obj3- The object to substitute the third curly braces.obj4- The object to substitute the fourth curly braces.- Returns:
- A localized, substituted, and formated string. If the
localized pattern message is not found, the
inStringwill be used as the pattern message - Since:
- Epic 4.2
-
getLocalizedMessage
public static String getLocalizedMessage(String inString, Object obj1, Object obj2, Object obj3, Object obj4, Object obj5) Returns the localized, substituted, and formated string for theinString.- Parameters:
inString- The pattern message to find its localized version.obj1- The object to substitute the first curly braces.obj2- The object to substitute the second curly braces.obj3- The object to substitute the third curly braces.obj4- The object to substitute the fourth curly braces.obj5- The object to substitute the fifth curly braces.- Returns:
- A localized, substituted, and formated string. If the
localized pattern message is not found, the
inStringwill be used as the pattern message - Since:
- Epic 4.2
-
getLocalizedMessage
Returns the localized, substituted, and formatted string for theinString.- Parameters:
inString- The pattern message to find its localized version.args- The objects to substitute the curly braces.- Returns:
- A localized, substituted, and formatted string. If the
localized pattern message is not found, the
inStringwill be used as the pattern message. - Since:
- Arbortext 6.0 M040
-