@API(type=NOT_EXTENDABLE, src=PUBLIC) public interface WorkspaceUtilities extends ColorThemeUtilities, ApplicationInformationAccess
Modifier and Type | Method and Description |
---|---|
java.io.File |
chooseDirectory()
Displays a directory chooser for selecting a directory.
|
java.io.File |
chooseDirectory(java.io.File startingDir)
Displays a directory chooser.
|
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.io.File[] |
chooseFiles(java.io.File currentFileContext,
java.lang.String title,
java.lang.String[] allowedExtensions,
java.lang.String filterDescr)
Displays a file chooser for selecting multiple
File s. |
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.net.URL |
chooseURL(java.lang.String title,
java.lang.String[] allowedExtensions,
java.lang.String filterDescr,
java.lang.String initialURL,
java.lang.String urlLabel,
java.lang.String okLabel)
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 . |
java.lang.String |
chooseURLPath(java.lang.String title,
java.lang.String[] allowedExtensions,
java.lang.String filterDescr,
java.lang.String initialURL)
Displays an URL chooser for selecting an
URL . |
void |
clearImageCache()
Deprecated.
Replaced by
getImageUtilities() |
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.
|
ProcessController |
createProcess(ProcessListener processListener,
java.lang.String name,
java.io.File workingDirectory,
java.lang.String cmdLine,
boolean showConsole)
Create a process that executes a given command line.
|
DataSourceAccess |
getDataSourceAccess()
Get information about the configured data source connections.
|
ImageUtilities |
getImageUtilities()
Get access to image related utilities, support to register custom image handlers or to reset the images cache.
|
java.lang.Object |
getParentFrame()
Get the parent main frame.
|
TemplateManager |
getTemplateManager()
Get access to all new file templates.
|
void |
openInExternalApplication(java.lang.String url,
boolean preferAssociatedApplication,
java.lang.String mediaType)
Open in the associated system application.
|
void |
openInExternalApplication(java.net.URL url,
boolean preferAssociatedApplication)
Open in the associated system application
|
void |
openInExternalApplication(java.net.URL url,
boolean preferAssociatedApplication,
java.lang.String mediaType)
Open in the associated system application
|
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 |
showErrorMessage(java.lang.String message,
java.lang.Throwable exception)
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.
|
void |
showStatusMessage(java.lang.String statusMessage,
OperationStatus status)
Show a status message and set a corresponding status color.
|
void |
showWarningMessage(java.lang.String message)
Presents a warning message dialog.
|
void |
startProcess(java.lang.String name,
java.io.File workingDirectory,
java.lang.String cmdLine,
boolean showConsole)
Start a process that executes a given command line.
|
getColorTheme, getImageInverter
getApplicationName, getApplicationType, getLicenseInformationProvider, getPlatform, getPreferencesDirectory, getUserInterfaceLanguage, getVersion, getVersionBuildID
java.lang.Object getParentFrame()
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.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.io.File[] chooseFiles(java.io.File currentFileContext, java.lang.String title, java.lang.String[] allowedExtensions, java.lang.String filterDescr)
File
s.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.null
if the user canceled the dialog.java.io.File chooseDirectory()
null
if the user canceled the dialog.java.io.File chooseDirectory(java.io.File startingDir)
startingDir
- The starting directory. May be null
.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.java.net.URL chooseURL(java.lang.String title, java.lang.String[] allowedExtensions, java.lang.String filterDescr, java.lang.String initialURL, java.lang.String urlLabel, java.lang.String okLabel)
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
.urlLabel
- The label used for describing the URL field. If null
, the value will be: "URL:".okLabel
- The label of the "OK" button. If null
the value will be "OK".null
if the user canceled the dialog.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.java.lang.String chooseURLPath(java.lang.String title, java.lang.String[] allowedExtensions, java.lang.String filterDescr, java.lang.String initialURL)
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.initialURL
- The initial URL to set in the field.null
if the user canceled the dialog.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 showErrorMessage(java.lang.String message, java.lang.Throwable exception)
message
- The error message.exception
- An exception for which the stack trace will be shown when the "More details" link is clicked.void showWarningMessage(java.lang.String message)
message
- The warning message.void showInformationMessage(java.lang.String message)
message
- The information message.void showStatusMessage(java.lang.String statusMessage)
statusMessage
- The status messagevoid showStatusMessage(java.lang.String statusMessage, OperationStatus status)
statusMessage
- The message.status
- The status that gives the color.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 openInExternalApplication(java.net.URL url, boolean preferAssociatedApplication, java.lang.String mediaType)
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.mediaType
- The media type of the URL to open.void openInExternalApplication(java.lang.String url, boolean preferAssociatedApplication, java.lang.String mediaType)
url
- The URL to open.preferAssociatedApplication
- If true
, it will prefer the system associated application
and if this fails, it will open in the browser. If false
the resource will be opened in the browser.mediaType
- The media type of the URL to open.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)
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();
void startProcess(java.lang.String name, java.io.File workingDirectory, java.lang.String cmdLine, boolean showConsole)
name
- The name of the process.workingDirectory
- The directory where the process is started.cmdLine
- The command line to be executed. Can contain editor variables.showConsole
- True
to show the console.ProcessController createProcess(ProcessListener processListener, java.lang.String name, java.io.File workingDirectory, java.lang.String cmdLine, boolean showConsole)
processListener
- The process handlername
- The name of the process.workingDirectory
- The directory where the process is started.cmdLine
- The command line to be executed. Can contain editor variables.showConsole
- True
to show the console.null
if for example the process is already running.@Deprecated void clearImageCache()
getImageUtilities()
ImageUtilities
API to clear the image cache.DataSourceAccess getDataSourceAccess()
DataSourceAccess
capable of providing information about the data source connections.ImageUtilities getImageUtilities()
TemplateManager getTemplateManager()
© Copyright Syncro Soft SRL 2002 - 2023. All rights reserved.