|
Oxygen XML Editor 14.2 Author API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
@API(type=NOT_EXTENDABLE, src=PUBLIC) public interface Workspace
Provides access to workspace specific information and actions.
Method Summary | |
---|---|
java.io.File |
chooseFile(java.io.File currentFileContext,
java.lang.String title,
java.lang.String[] allowedExtensions,
java.lang.String filterDescr,
boolean usedForSave)
Displays a file chooser for selecting a File . |
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 . |
java.net.URL |
chooseURL(java.lang.String title,
java.lang.String[] allowedExtensions,
java.lang.String filterDescr,
java.lang.String initialURL)
Displays an URL chooser for selecting an URL . |
java.lang.String |
chooseURLPath(java.lang.String title,
java.lang.String[] allowedExtensions,
java.lang.String filterDescr)
Displays an URL chooser for selecting an URL . |
void |
clearImageCache()
Clear the cache of images used to display images fast in the Author page. |
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 . |
DataSourceAccess |
getDataSourceAccess()
Get information about the configured data source connections. |
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. |
boolean |
open(java.net.URL url,
java.lang.String imposedPage)
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. |
int |
showConfirmDialog(java.lang.String title,
java.lang.String message,
java.lang.String[] buttonNames,
int[] buttonIds,
int initialSelectedIndex)
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 |
---|
java.lang.Object getParentFrame()
or @link java.awt.Frame (when running as a JApplet)
) of the Oxygen application or the parent shell
(Shell
) if this is the Eclipse implementation.void setParentFrameTitle(java.lang.String parentFrameTitle)
parentFrameTitle
- The new title to set on the parent frame.
If NULL, will reset to the default title.java.io.File chooseFile(java.lang.String title, java.lang.String[] allowedExtensions, java.lang.String filterDescr, boolean openForSave)
File
.
title
- The file chooser title.allowedExtensions
- Allowed file extensions. Can be null
if you want all
files filter. Example: new String[] {"xml", "dita"}.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.
null
if the user canceled the dialog.java.io.File chooseFile(java.io.File currentFileContext, java.lang.String title, java.lang.String[] allowedExtensions, java.lang.String filterDescr, boolean usedForSave)
File
.
currentFileContext
- The file which will be selected in the file chooser.
If it is a directory, it will be used as a default directory.
If it is a file (even non-existing) and the file chooser is shown for a save operation its name will also be selected in the chooser.
Can be set null
in order to use the default behavior.title
- The file chooser title.allowedExtensions
- Allowed file extensions. Can be null
if you want all
files filter. Example: new String[] {"xml", "dita"}.filterDescr
- Description for the file filter.usedForSave
- true
when the file chooser is used for saving,
false
if it is used for opening an existing file.
null
if the user canceled the dialog.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.
java.io.File chooseFile(java.lang.String title, java.lang.String[] allowedExtensions, java.lang.String filterDescr)
File
.
title
- The file chooser title.allowedExtensions
- Allowed file extensions. Can be null
if you want all
files filter. Example: new String[] {"xml", "dita"}.filterDescr
- Description for the file filter.
null
if the user canceled the dialog.java.net.URL chooseURL(java.lang.String title, java.lang.String[] allowedExtensions, java.lang.String filterDescr)
URL
.
title
- The chooser dialog title.allowedExtensions
- Allowed extensions.filterDescr
- Description for the filter.
null
if the user canceled the dialog.java.net.URL chooseURL(java.lang.String title, java.lang.String[] allowedExtensions, java.lang.String filterDescr, java.lang.String initialURL)
URL
.
title
- The chooser dialog title.allowedExtensions
- Allowed extensions.filterDescr
- Description for the filter.initialURL
- Default value for the URL (given as string). Can be null
.
null
if the user canceled the dialog.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.
java.lang.String chooseURLPath(java.lang.String title, java.lang.String[] allowedExtensions, java.lang.String filterDescr)
URL
. If the user sets a
relative path in the chooser, that path will be returned.
title
- The chooser dialog title.allowedExtensions
- Allowed extensions.filterDescr
- Description for the filter.
null
if the user canceled the dialog.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.
boolean isStandalone()
true
if this is the stand-alone Oxygen version or
false
if it is the Oxygen Eclipse plug-in version.java.lang.String getVersion()
java.lang.String getUserInterfaceLanguage()
java.lang.String getPreferencesDirectory()
int showConfirmDialog(java.lang.String title, java.lang.String message, java.lang.String[] buttonNames, int[] buttonIds)
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.
int showConfirmDialog(java.lang.String title, java.lang.String message, java.lang.String[] buttonNames, int[] buttonIds, int initialSelectedIndex)
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.initialSelectedIndex
- The index of the initial selected button. 0 based.
All Ids must be greater or equal to 0.
void showErrorMessage(java.lang.String message)
message
- The error message.void showInformationMessage(java.lang.String message)
message
- The information message.void showStatusMessage(java.lang.String statusMessage)
statusMessage
- The status messageboolean open(java.net.URL url)
URL
in a new editor.
url
- The URL of the file to be opened.
true
if the operation has succeeded.boolean open(java.net.URL url, java.lang.String imposedPage)
URL
in a new editor.
url
- The URL of the file to be opened.imposedPage
- The imposed page for opening the URL.
true
if the operation has succeeded.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.
void openInExternalApplication(java.net.URL url, boolean preferAssociatedApplication)
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.void saveAll()
boolean close(java.net.URL url)
If the editor has unsaved content, the user will be given the opportunity to save it.
url
- The url of the editor to be closed.
true
if the editor was successfully closed, and
false
if the editor could not be closed.boolean closeAll()
If there are editors with unsaved content, the user will be given the opportunity to save them.
true
if the editors were successfully closed, and
false
if the editors are still open.void delete(java.net.URL url) throws java.io.IOException
URL
.
Currently supported protocols are:
url
- The URL from where to delete a resource.
java.io.IOException
void refreshInProject(java.net.URL url)
url
- The new resourceProcessController 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)
additionalJavaArguments
- Additional Java arguments like "-Xmx256m"classpath
- The classpath.mainClass
- The main classadditionalArguments
- The additional process argumentsenvironmentalVariables
- Additional environmental variables. Can be null
startDirectory
- The directory where the process should start. Can be null
processListener
- The process listener. Can be null
ProcessListener processListener = new ProcessListener() {
public void newErrorLine(String line) {
System.err.println("Error from process " + line);
}
public void processCouldNotStart(String message) {
System.err.println("Could not start process " + message);
}
public void processEnded(int exitCode) {
System.err.println("Process ended " + exitCode);
}
public void newOutputLine(String line) {
System.out.println("Output from process: " + line);
}
};
final ProcessController processController = standalonePluginWorkspace.createJavaProcess("-Xmx256m",
new String[] {"lib/oxygen.jar", "classes"},
//The main Oxygen class
"ro.sync.exml.Oxygen",
//The URL which Oxygen will attempt to load on startup
"file:/D:/projects/eXml/samples/dita/flowers/topics/copyright.xml",
//Environmental variables to set to the process, none in mu case
null, new File("."), processListener);
//You can start a new thread here and send messages to the process using the ProcessControler
//Start the process, will block until process has finished
processController.start();
java.net.URL createNewEditor(java.lang.String extension, java.lang.String contentType, java.lang.String content)
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.
LicenseInformationProvider getLicenseInformationProvider()
void clearImageCache()
DataSourceAccess getDataSourceAccess()
DataSourceAccess
capable of providing information about the data source connections.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 14.2 Author API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |