public abstract class AbstractApplicationAdaptor extends java.lang.Object implements ApplicationListener
Modifier and Type | Field and Description |
---|---|
static java.net.URL[] |
docURLs
The URLs to open existing document(s) in the command-line.
|
static java.lang.String |
GUI_BRICKS_RESOURCE
name for the gui bricks resource which may or may not exist
|
static java.lang.String |
WILDCARD_FILE_EXTENSION
wildcard file extension
|
Constructor and Description |
---|
AbstractApplicationAdaptor()
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
applicationFinishedLaunching()
Subclasses may override this method to provide custom handling upon completion of the application having launched.
|
abstract java.lang.String |
applicationName()
Subclasses must implement this method to return the name of their application.
|
void |
applicationWillOpenInitialDocuments()
Event indicating that the application will open any initial documents.
|
void |
applicationWillQuit()
Implement ApplicationListener.
|
boolean |
canOpenDocuments()
Determine whether this application can open documents
|
void |
customizeCommands(Commander commander)
Override this method to register custom application commands.
|
void |
documentClosed(xal.extension.application.XalAbstractDocument document)
Implement ApplicationListener.
|
void |
documentCreated(xal.extension.application.XalAbstractDocument document)
Implement ApplicationListener.
|
abstract xal.extension.application.XalAbstractDocument |
generateEmptyDocument(java.lang.String type)
Generate a new empty document of the specified type.
|
WindowReference |
getDefaultWindowReference(java.lang.String tag,
java.lang.Object... parameters)
Get the window reference from the resource if any
|
static java.net.URL[] |
getDocURLs()
Get the document URLs.
|
java.net.URL |
getResourceURL(java.lang.String resourceSpec)
Get the URL to the specified resource residing within the resources directory.
|
abstract java.lang.String[] |
readableDocumentTypes()
Subclasses should implement this method to return the array of file suffixes identifying the files that can be read by the application.
|
static void |
setOptions(java.lang.String[] args)
Define some flags for launching the application, such as pre-load a default accelerator.
|
void |
setResourcesLocation(java.net.URL resourcesLocation)
Subclasses can set the location of the resources directory.
|
void |
setResourcesParentDirectory(java.io.File resourcesParentDirectory)
Convenience method to set the location of the resources directory by specifying the parent directory of resources.
|
void |
setResourcesParentDirectoryWithPath(java.lang.String resourcesParentDirectoryPath)
Convenience method to set the location of the resources directory by specifying the parent directory of resources.
|
boolean |
showsWelcomeDialogAtLaunch()
Indicates whether the welcome dialog should be displayed at launch.
|
boolean |
usesConsole()
Identifies whether the application sends standard output and standard error to the application's console or whether it should simply go to
the terminal from which the application was launched.
|
abstract java.lang.String[] |
writableDocumentTypes()
Subclasses should implement this method to return the array of file suffixes identifying the files that can be written by the application.
|
public static final java.lang.String WILDCARD_FILE_EXTENSION
public static final java.lang.String GUI_BRICKS_RESOURCE
public static java.net.URL[] docURLs
public abstract java.lang.String[] readableDocumentTypes()
public abstract java.lang.String[] writableDocumentTypes()
public final boolean canOpenDocuments()
public boolean showsWelcomeDialogAtLaunch()
public abstract xal.extension.application.XalAbstractDocument generateEmptyDocument(java.lang.String type)
type
- the type of document to create.public abstract java.lang.String applicationName()
public boolean usesConsole()
public void customizeCommands(Commander commander)
commander
- The commander with which to register commands.Commander.registerAction(Action)
public static void setOptions(java.lang.String[] args)
public static java.net.URL[] getDocURLs()
public WindowReference getDefaultWindowReference(java.lang.String tag, java.lang.Object... parameters)
public void applicationWillOpenInitialDocuments()
applicationWillOpenInitialDocuments
in interface ApplicationListener
public void applicationFinishedLaunching()
public void documentClosed(xal.extension.application.XalAbstractDocument document)
documentClosed
in interface ApplicationListener
document
- The document that has closed.public void documentCreated(xal.extension.application.XalAbstractDocument document)
documentCreated
in interface ApplicationListener
document
- The document that has been created.public void applicationWillQuit()
applicationWillQuit
in interface ApplicationListener
public void setResourcesParentDirectory(java.io.File resourcesParentDirectory)
resourcesParentDirectory
- normal file system directory specifying the location of the parent directory of the resourcespublic void setResourcesParentDirectoryWithPath(java.lang.String resourcesParentDirectoryPath)
resourcesParentDirectoryPath
- full file system directory path specifying the location of the parent directory of the resourcespublic void setResourcesLocation(java.net.URL resourcesLocation)
public java.net.URL getResourceURL(java.lang.String resourceSpec)
resourceSpec
- specification of the resource relative to the resources URL