Package ro.sync.exml.workspace.api
Interface Workspace
- All Superinterfaces:
ApplicationInformationAccess
,ColorThemeUtilities
,WorkspaceUtilities
- All Known Subinterfaces:
AuthorWorkspaceAccess
,EclipsePluginWorkspace
,PluginWorkspace
,StandalonePluginWorkspace
,WebappPluginWorkspace
Provides access to workspace specific information and actions.
- Since:
- 11.2
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Closes the editor specified by the URL.boolean
closeAll()
Closes all the editors.createNewEditor
(String extension, String contentType, String content) This is available only in the standalone Oxygen version (not available in the Oxygen Eclipse plugin).
Create a new "Untitled" editor.createNewEditor
(URL saveTo, String extension, String contentType, 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 the resource identified by the specifiedURL
.boolean
Deprecated.This method returns false also when running inside the WebApp.boolean
Opens the file at the specifiedURL
in a new editor.boolean
Opens the file at the specifiedURL
in a new editor.boolean
Opens the file at the specifiedURL
in a new editor by specifying an imposed page and an imposed content type.void
refreshInProject
(URL url) If 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
(String parentFrameTitle) Set a title on the parent frame.Methods inherited from interface ro.sync.exml.workspace.api.application.ApplicationInformationAccess
getApplicationName, getApplicationType, getLicenseInformationProvider, getPlatform, getPreferencesDirectory, getUserInterfaceLanguage, getVersion, getVersionBuildID
Methods inherited from interface ro.sync.exml.workspace.api.util.ColorThemeUtilities
getColorTheme, getImageInverter
Methods inherited from interface ro.sync.exml.workspace.api.WorkspaceUtilities
chooseDirectory, chooseDirectory, chooseFile, chooseFile, chooseFile, chooseFiles, chooseURL, chooseURL, chooseURL, chooseURLPath, chooseURLPath, clearImageCache, createJavaProcess, createProcess, getDataSourceAccess, getImageUtilities, getParentFrame, getTemplateManager, openInExternalApplication, openInExternalApplication, openInExternalApplication, showConfirmDialog, showConfirmDialog, showErrorMessage, showErrorMessage, showInformationMessage, showStatusMessage, showStatusMessage, showWarningDialog, showWarningDialog, showWarningMessage, startProcess
-
Method Details
-
open
Opens the file at the specifiedURL
in a new editor. If the URL is already opened, the editor tab which contains it will be brought to front.- Parameters:
url
- The URL of the file to be opened.- Returns:
true
if the operation has succeeded.
-
open
Opens the file at the specifiedURL
in a new editor. If the URL is already opened, the editor tab which contains it will be brought to front.- Parameters:
url
- The URL of the file to be opened.imposedPage
- The imposed page for opening the URL. One of the page related constants fromEditorPageConstants
.- Returns:
true
if the operation has succeeded.- Since:
- 13
-
open
Opens the file at the specifiedURL
in a new editor by specifying an imposed page and an imposed content type. If the URL is already opened, the editor tab which contains it will be brought to front. The imposed content type is used only in the Oxygen standalone application, it is not used in the Author Component and Eclipse plugin applications.- Parameters:
url
- The URL of the file to be opened.imposedPage
- The imposed page for opening the URL. Can benull
to perform the default behavior.imposedContentType
- The imposed content type, one of the constants in the interface ro.sync.exml.editor.ContentTypes.
This is useful if for example the URL does not have a file extension (maybe it is a CMS resource) but the caller of the API knows that it is XML. In this case the caller can provide the "text/xml" imposed content type for it to avoid Oxygen asking what type of resource the URL is.
Another use case is for DITA Map URLs without an extension. The caller can pass the "application/ditamap" content type value to the API. In the standalone application Oxygen will ask the user where to open the DITA Map (DITA Maps Manager or the main editor) and will continue the open procedure.
In the Oxygen Eclipse plugin the DITA Map will be opened directly in the DITA Maps Manager view.
Can benull
to perform the default behavior.- Returns:
true
if the operation has succeeded.- Since:
- 15.2
-
saveAll
void saveAll()Saves the content of all opened and unsaved editors. -
close
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, andfalse
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, andfalse
if the editors are still open.
-
delete
Delete the resource identified by the specifiedURL
. Currently supported protocols are:- file://
- zip://
- ftp://
- sftp://
- http://
- https://
- Parameters:
url
- The URL from where to delete a resource.- Throws:
IOException
- If an I/O exception occurs.
-
refreshInProject
If 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
-
createNewEditor
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
-
createNewEditor
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:
saveTo
- The URL where the new file will be saved when the save operation is invoked for the first time.extension
- The editor extension ("xml" or "dita" or "xsl" or "xsd", etc...). May be null if the saveTo URL is specified.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. Can be
null
if the URL is already opened in the application. - Since:
- 22
-
isStandalone
Deprecated.This method returns false also when running inside the WebApp. UseApplicationInformationAccess.getPlatform()
instead.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 orfalse
if it is the Oxygen Eclipse plug-in version.
-
setParentFrameTitle
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
-