Oxygen XML Editor 11.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.

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

Since:
11.2

Method Summary
 File chooseFile(String title, String[] allowedExtensions, String filterDescr)
          Displays a file chooser for selecting a File.
 File chooseFile(String title, String[] allowedExtensions, String filterDescr, boolean openForSave)
          Displays a file chooser for selecting a File.
 URL chooseURL(String title, String[] allowedExtensions, String filterDescr)
          Displays an URL chooser for selecting an URL.
 boolean close(URL url)
          Closes the editor specified by the URL.
 boolean closeAll()
          Closes all the editors.
 void delete(URL url)
          Delete the resource identified by the specified URL.
 Object getParentFrame()
          Get the parent main frame.
 boolean isStandalone()
          Check if the extension is used in the Oxygen stand alone or Eclipse plugin version.
 boolean open(URL url)
          Opens the file at the specified URL in a new editor.
 void refreshInProject(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.
 int showConfirmDialog(String title, String message, String[] buttonNames, int[] buttonIds)
          Shows a question message dialog.
 void showErrorMessage(String message)
          Presents an error message dialog.
 void showInformationMessage(String message)
          Presents an information message dialog.
 void showStatusMessage(String statusMessage)
          Show a status message.
 

Method Detail

getParentFrame

Object getParentFrame()
Get the parent main frame.

Returns:
The parent frame (JFrame) of the Oxygen application or the parent shell (org.eclipse.swt.widgets.Shell) if this is the Eclipse implementation.

chooseFile

File chooseFile(String title,
                String[] allowedExtensions,
                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

File chooseFile(String title,
                String[] allowedExtensions,
                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

URL chooseURL(String title,
              String[] allowedExtensions,
              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.

showConfirmDialog

int showConfirmDialog(String title,
                      String message,
                      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(String message)
Presents an error message dialog.

Parameters:
message - The error message.

showInformationMessage

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

Parameters:
message - The information message.

showStatusMessage

void showStatusMessage(String statusMessage)
Show a status message.

Parameters:
statusMessage - The status message

open

boolean open(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.

saveAll

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


close

boolean close(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(URL url)
            throws IOException
Delete the resource identified by the specified URL. Currently supported protocols are:

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

refreshInProject

void refreshInProject(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

Oxygen XML Editor 11.2 Author API

© Copyright SyncRO Soft SRL 2002 - 2010.