Oxygen XML Editor 12.2 Author API

ro.sync.exml.workspace.api
Interface Workspace

All Known Subinterfaces:
AuthorWorkspaceAccess, PluginWorkspace, StandalonePluginWorkspace

public interface Workspace

Provides access to workspace specific information and actions.

Since:
11.2

Method Summary
 java.io.File chooseFile(java.lang.String title, java.lang.String[] allowedExtensions, java.lang.String filterDescr)
          Displays a file chooser for selecting a File.
 java.io.File chooseFile(java.lang.String title, java.lang.String[] allowedExtensions, java.lang.String filterDescr, boolean openForSave)
          Displays a file chooser for selecting a File.
 java.net.URL chooseURL(java.lang.String title, java.lang.String[] allowedExtensions, java.lang.String filterDescr)
          Displays an URL chooser for selecting an URL.
 boolean close(java.net.URL url)
          Closes the editor specified by the URL.
 boolean closeAll()
          Closes all the editors.
 ProcessController createJavaProcess(java.lang.String additionalJavaArguments, java.lang.String[] classpath, java.lang.String mainClass, java.lang.String additionalArguments, java.util.Map<java.lang.String,java.lang.String> environmentalVariables, java.io.File startDirectory, ProcessListener processListener)
          Prepare a Java process for execution.
 java.net.URL createNewEditor(java.lang.String extension, java.lang.String contentType, java.lang.String content)
          This is available only in the standalone Oxygen version (not available in the Oxygen Eclipse plugin).
Create a new "Untitled" editor.
 void delete(java.net.URL url)
          Delete the resource identified by the specified URL.
 LicenseInformationProvider getLicenseInformationProvider()
          Get information about the license used in the current Oxygen application.
 java.lang.Object getParentFrame()
          Get the parent main frame.
 java.lang.String getPreferencesDirectory()
          Get the directory where the Oxygen preferences are saved.
 java.lang.String getUserInterfaceLanguage()
          Get the language used to display the GUI controls (buttons, label) in Oxygen.
 java.lang.String getVersion()
          Get the current version of the Oxygen/Author product.
 boolean isStandalone()
          Check if the extension is used in the Oxygen stand alone or Eclipse plugin version.
 boolean open(java.net.URL url)
          Opens the file at the specified URL in a new editor.
 void openInExternalApplication(java.net.URL url, boolean preferAssociatedApplication)
          Open in the associated system application
 void refreshInProject(java.net.URL url)
          In a new file appeared as a child of a folder in the project, use this method to refresh the parent folder.
 void saveAll()
          Saves the content of all opened and unsaved editors.
 void setParentFrameTitle(java.lang.String parentFrameTitle)
          Set a title on the parent frame.
 int showConfirmDialog(java.lang.String title, java.lang.String message, java.lang.String[] buttonNames, int[] buttonIds)
          Shows a question message dialog.
 void showErrorMessage(java.lang.String message)
          Presents an error message dialog.
 void showInformationMessage(java.lang.String message)
          Presents an information message dialog.
 void showStatusMessage(java.lang.String statusMessage)
          Show a status message.
 

Method Detail

getParentFrame

java.lang.Object getParentFrame()
Get the parent main frame.

Returns:
The parent frame (or @link java.awt.Frame (when running as a JApplet)) of the Oxygen application or the parent shell (org.eclipse.swt.widgets.Shell) if this is the Eclipse implementation.

setParentFrameTitle

void setParentFrameTitle(java.lang.String parentFrameTitle)
Set a title on the parent frame. This is available only in the standalone Oxygen version (not available in the Oxygen Eclipse plugin). If NULL, will reset to the default title.

Parameters:
parentFrameTitle - The new title to set on the parent frame. If NULL, will reset to the default title.
Since:
12.1

*********************************
EXPERIMENTAL - Subject to change
********************************

Please note that this API is not marked as final and it can change in one of the next versions of the application. If you have suggestions, comments about it, please let us know.


chooseFile

java.io.File chooseFile(java.lang.String title,
                        java.lang.String[] allowedExtensions,
                        java.lang.String filterDescr,
                        boolean openForSave)
Displays a file chooser for selecting a File.

Parameters:
title - The file chooser title.
allowedExtensions - Allowed file extensions.
filterDescr - Description for the file filter.
openForSave - true when the file chooser is used for saving, false if it is used for opening an existing file.
Returns:
The chosen file or null if the user canceled the dialog.

chooseFile

java.io.File chooseFile(java.lang.String title,
                        java.lang.String[] allowedExtensions,
                        java.lang.String filterDescr)
Displays a file chooser for selecting a File.

Parameters:
title - The file chooser title.
allowedExtensions - Allowed file extensions.
filterDescr - Description for the file filter.
Returns:
The chosen file or null if the user canceled the dialog.

chooseURL

java.net.URL chooseURL(java.lang.String title,
                       java.lang.String[] allowedExtensions,
                       java.lang.String filterDescr)
Displays an URL chooser for selecting an URL.

Parameters:
title - The chooser dialog title.
allowedExtensions - Allowed extensions.
filterDescr - Description for the filter.
Returns:
The chosen URL or null if the user canceled the dialog.

isStandalone

boolean isStandalone()
Check if the extension is used in the Oxygen stand alone or Eclipse plugin version.

Returns:
true if this is the stand-alone Oxygen version or false if it is the Oxygen Eclipse plug-in version.

getVersion

java.lang.String getVersion()
Get the current version of the Oxygen/Author product. Can be used to decide if some extension functions are available or not.

Returns:
The version of the Oxygen application in which the extension runs. Returns a string like: 11.2
Since:
12

getUserInterfaceLanguage

java.lang.String getUserInterfaceLanguage()
Get the language used to display the GUI controls (buttons, label) in Oxygen. Examples of format: en_US, fr_FR, de_DE, jp_JP, it_IT, nl_NL

Returns:
The language used to display the GUI controls (buttons, label) in Oxygen.
Since:
12.1

*********************************
EXPERIMENTAL - Subject to change
********************************

Please note that this API is not marked as final and it can change in one of the next versions of the application. If you have suggestions, comments about it, please let us know.


getPreferencesDirectory

java.lang.String getPreferencesDirectory()
Get the directory where the Oxygen preferences are saved. Can be used to save additional user data there.

Returns:
the directory where the Oxygen preferences are saved. Returns a string like: c:\\Documents and Settings\\username\\com.oxygenxml
Since:
12.1

*********************************
EXPERIMENTAL - Subject to change
********************************

Please note that this API is not marked as final and it can change in one of the next versions of the application. If you have suggestions, comments about it, please let us know.


showConfirmDialog

int showConfirmDialog(java.lang.String title,
                      java.lang.String message,
                      java.lang.String[] buttonNames,
                      int[] buttonIds)
Shows a question message dialog.

Parameters:
title - The dialog title.
message - The message to be presented to the user.
buttonNames - The names of the buttons representing the choices in the dialog.
buttonIds - The id for each button. Used to identify which button was pressed. All Ids must be greater or equal to 0.
Returns:
the id of the pressed button or -1 if the dialog was closed by other means.

showErrorMessage

void showErrorMessage(java.lang.String message)
Presents an error message dialog.

Parameters:
message - The error message.

showInformationMessage

void showInformationMessage(java.lang.String message)
Presents an information message dialog.

Parameters:
message - The information message.

showStatusMessage

void showStatusMessage(java.lang.String statusMessage)
Show a status message.

Parameters:
statusMessage - The status message

open

boolean open(java.net.URL url)
Opens the file at the specified URL in a new editor.

Parameters:
url - The URL of the file to be opened.
Returns:
true if the operation has succeeded.

openInExternalApplication

void openInExternalApplication(java.net.URL url,
                               boolean preferAssociatedApplication)
Open in the associated system application

Parameters:
url - The URL to open.
preferAssociatedApplication - If true will prefer the system associated application and if this fails, open in the browser if false will open in the browser.
Since:
12

saveAll

void saveAll()
Saves the content of all opened and unsaved editors.


close

boolean close(java.net.URL url)
Closes the editor specified by the URL.

If the editor has unsaved content, the user will be given the opportunity to save it.

Parameters:
url - The url of the editor to be closed.
Returns:
true if the editor was successfully closed, and false if the editor could not be closed.

closeAll

boolean closeAll()
Closes all the editors.

If there are editors with unsaved content, the user will be given the opportunity to save them.

Returns:
true if the editors were successfully closed, and false if the editors are still open.

delete

void delete(java.net.URL url)
            throws java.io.IOException
Delete the resource identified by the specified URL. Currently supported protocols are:

Parameters:
url - The URL from where to delete a resource.
Throws:
java.io.IOException

refreshInProject

void refreshInProject(java.net.URL url)
In a new file appeared as a child of a folder in the project, use this method to refresh the parent folder.

Parameters:
url - The new resource

createJavaProcess

ProcessController createJavaProcess(java.lang.String additionalJavaArguments,
                                    java.lang.String[] classpath,
                                    java.lang.String mainClass,
                                    java.lang.String additionalArguments,
                                    java.util.Map<java.lang.String,java.lang.String> environmentalVariables,
                                    java.io.File startDirectory,
                                    ProcessListener processListener)
Prepare a Java process for execution. It also sets on the Java process the Oxygen HTTP proxy configuration.

Parameters:
additionalJavaArguments - Additional Java arguments
classpath - The classpath.
mainClass - The main class
additionalArguments - The additional process arguments
commandLine - The entire command line. Not null.
environmentalVariables - Additional environmental variables. Can be null
startDirectory - The directory where the process should start. Can be null
processListener - The process listener. Can be null
Returns:
Access to the process.
Since:
12.1

*********************************
EXPERIMENTAL - Subject to change
********************************

Please note that this API is not marked as final and it can change in one of the next versions of the application. If you have suggestions, comments about it, please let us know.


createNewEditor

java.net.URL createNewEditor(java.lang.String extension,
                             java.lang.String contentType,
                             java.lang.String content)
This is available only in the standalone Oxygen version (not available in the Oxygen Eclipse plugin).
Create a new "Untitled" editor. The editor content is not saved on disk, this method is equivalent to using the "File->New" action.

Parameters:
extension - The editor extension ("xml" or "dita" or "xsl" or "xsd", etc...)
contentType - The content type which can take values like: "text/xml" or "text/xsl" or "text/xsd", etc... If NULL, the content type will be automatically detected from the extension.
content - The XML content will be used to load the new editor from.
Returns:
The URL of the created new editor.
Since:
12.1

*********************************
EXPERIMENTAL - Subject to change
********************************

Please note that this API is not marked as final and it can change in one of the next versions of the application. If you have suggestions, comments about it, please let us know.


getLicenseInformationProvider

LicenseInformationProvider getLicenseInformationProvider()
Get information about the license used in the current Oxygen application.

Returns:
The license information provider
Since:
12.1

*********************************
EXPERIMENTAL - Subject to change
********************************

Please note that this API is not marked as final and it can change in one of the next versions of the application. If you have suggestions, comments about it, please let us know.


Oxygen XML Editor 12.2 Author API

© Copyright SyncRO Soft SRL 2002 - 2010.