public class IlvApplication extends Object implements IlvPropertyManager
IlvApplication
instance, since all the JAppFrame
components initialize themselves using an
instance of IlvApplication
. For example, an
IlvMenuBar
reads the definition of its
menu items from the settings of the application and
internationalizes the text displayed by its menu items using the
internationalization services of the application.Services provided by the application are:
Common Services
Gather the management of the settings, internationalization services, and
resolution of URLs.
addSettings(ilog.views.appframe.settings.IlvSettings)
and addXMLSettings(java.lang.String)
and are removed with the removeSettings(ilog.views.appframe.settings.IlvSettings)
method. Data of the added settings are cascaded according
to the rules detailed in the IlvSettingsManager
class.
When initializing, the application automatically adds the user settings
that have been saved during the last session of the application for the
same user. The URL to the XML file containing the user settings can be accessed
with the methods getUserSettingsURL()
and setUserSettingsURL(java.net.URL)
.
selectElement(ilog.views.appframe.settings.IlvSettingsQuery)
selectElement(String, String, Object)
select(ilog.views.appframe.settings.IlvSettingsQuery)
select(String, ilog.views.appframe.settings.IlvSettingsElement[])
select(ilog.views.appframe.settings.IlvSettingsQuery, ilog.views.appframe.settings.IlvSettingsElement[])
getSettingsManager()
.
Methods of the application that access the settings are only shortcuts
to the same methods of the associated settings manager. However, it may be
necessary to use the settings manager to access some
other settings services, like creating new layers.addResourcePropertyFile(java.lang.String)
method and are accessed with the methods getString(java.lang.String)
,
getFormattedString(java.lang.String, java.lang.Object[])
, and getImageIcon()
.
IlvResourceBundleManager
instance, which can be accessed with the method getResourceBundleManager()
.
Resource methods of the application are only shortcuts to the same
methods of the associated resource bundle manager.addURLResolver(ilog.views.appframe.util.IlvURLResolver)
and removed with the method
removeURLResolver(ilog.views.appframe.util.IlvURLResolver)
. URLs are then resolved using the method
resolveURL(java.lang.String)
.
IlvURLResolverManager
, which can be
accessed with the method getURLResolverManager()
.
URL management methods of the application are only shortcuts to the same
methods of the associated URL resolver manager.Document/View The application is the key component of the JAppFrame Document/View architecture. As illustrated in the following figure, it handles both the document templates and the main window.
<documentTemplate>
root setting element it has selected from its settings. The list of
document templates it has created can be retrieved with the methods
getDocumentTemplate(int)
and getDocumentTemplateCount()
.
addDocumentTemplate(ilog.views.appframe.docview.IlvDocumentTemplate)
method. This can be useful for adding
document templates that override some default behavior of the
IlvDocumentTemplate
class.
setMainWindow(ilog.views.appframe.docview.IlvMainWindow)
. It can be retrieved with the
method getMainWindow()
.
The application is involved in all the steps of the life cycle of documents. It creates the documents, gives access to the active document, and allows for saving and closing documents.
OPEN_DOCUMENT_CMD
and NEW_DOCUMENT_CMD
with
the methods openDocument()
and newDocument()
respectively.
It is also possible to open a document for a specified pathname with the
method openDocumentFile(java.lang.String, boolean, boolean)
and to create a new document that matches
the class of a specified object with the method newDocument(Object, boolean)
.
getActiveDocument(boolean)
,
getActiveView(boolean)
, and getActiveViewContainer()
respectively.saveActiveDocument(boolean)
, saveAsActiveDocument(boolean)
, and
saveAllDocuments()
.closeActiveDocument(boolean)
,
closeAllDocuments(boolean)
and closeDocument(ilog.views.appframe.docview.IlvDocument, boolean)
.Swing actions
The application centralizes all the services relative to Swing
actions. When initializing, the application creates IlvAction
instances for each <action>
root setting element it has
selected from its settings. New actions can be added to the application with
the method addAction(javax.swing.Action)
and removed with the method
removeAction(javax.swing.Action)
.
The JAppFrame project has changed the semantic of
Swing actions. They no longer handle the events emitted by menu items
or buttons associated with them. They only contain display properties that
allow for creating associated menu items or buttons. As all those properties
can be specified from the settings of the action - as described for the
IlvAction
class - it is no longer necessary to
implement action classes.
The application delegates the processing of action events to its registered
action handlers by implementing the interface
ActionHandler
. An action handler is responsible
for both processing action events and updating the properties of the action.
From the lowest to the highest priority, the application automatically
registers the following action handlers:
IlvDesktopPane
or an IlvMDITabbedPane
, for handling
actions of the Windows menu.addActionHandler(ilog.views.appframe.event.ActionHandler)
and to remove them with the method
removeActionHandler(ilog.views.appframe.event.ActionHandler)
.
Processing action events
From the highest to the lowest priority, action handlers are required to
process the action events. The first action handler that processes the event
stops the calling chain.
Updating actions
As in processing action events, the action handlers are required to
update the state of the actions, from the highest to the lowest priority.
The first action handler that succeeds in updating the action stops the
calling chain.
Updates of actions are automatically triggered when the application initializes
and each time the active view of the application changes. However, it is
possible to trigger the application update mechanism for one or more actions
with the methods
updateAction(java.lang.String)
, updateActionsByCategory(java.lang.String)
and
updateActions()
.
Modifier and Type | Field and Description |
---|---|
static String |
CLOSE_ALL_DOCUMENTS_CMD
Action command key for the action that closes all the open documents.
|
static String |
CLOSE_DOCUMENT_CMD
Action command key for the action that closes the active document.
|
static String |
EXIT_CMD
Action command key for the action that exits the application.
|
static String |
ICON_PROPERTY
Bound property name for the icon of the application.
|
static String |
MAIN_WINDOW_PROPERTY
Bound property name for the main window of the application.
|
static String |
MENU_BAR_PROPERTY
Bound property name for the menu bar of the application main window.
|
static String |
NEW_DOCUMENT_CMD
Action command key for the action that creates a new document.
|
static String |
NEW_DOCUMENT_ON_LAST_TEMPLATE_CMD
Action command key for the action that creates a new document of the same
type as the type of the last document created with the
newDocument()
method. |
static String |
OPEN_DOCUMENT_CMD
Action command key for the action that opens a document.
|
static int |
OPEN_FILE_MUST_EXIST
File chooser constant that determines whether the file selected in the file
chooser should exist.
|
static int |
OPEN_MODE
File chooser constant that specifies that the file chooser is displayed
for opening a file.
|
static int |
OPEN_MULTIPLE_FILES
File chooser constant that determines whether multiple files can be
selected within the file chooser.
|
static String |
REVERT_DOCUMENT_CMD
Action command key for the
Revert Document action. |
static String |
SAVE_ALL_DOCUMENTS_CMD
Action command key for the action that saves all modified documents.
|
static String |
SAVE_AS_DOCUMENT_CMD
Action command key for the
Save as action. |
static int |
SAVE_AS_MODE
File chooser constant that specifies that the file chooser is displayed
for changing a filename while processing a
SaveAs
action. |
static String |
SAVE_DOCUMENT_CMD
Action command key for the
Save action. |
static int |
SAVE_MODE
File chooser constant that specifies that the file chooser is displayed
for changing a filename.
|
static String |
SETTINGS_TYPE
Type of settings element providing the settings of the application, such as
its title or icon.
|
static String |
STATUS_BAR_PROPERTY
Bound property name for the status bar of the application main window.
|
static String |
STATUS_MESSAGE
Name of the message to send to the application to make a string
message appear in the status bar of the main window of the application.
|
static String |
TITLE_PROPERTY
Bound property name for the title of the application.
|
Constructor and Description |
---|
IlvApplication()
Creates a new
IlvApplication with the name Default . |
IlvApplication(String applicationName)
Creates a new application with the specified name.
|
IlvApplication(String[] args)
Creates the application with the specified command line parameters.
|
IlvApplication(String name,
String[] args)
Creates a new
IlvApplication with the specified
command line parameters and the specified name. |
Modifier and Type | Method and Description |
---|---|
void |
addAction(Action action)
Adds an action to the actions managed by the application.
|
void |
addActionHandler(ActionHandler handler)
Adds the specified action handler to receive action events.
|
void |
addApplicationListener(ApplicationListener listener)
Adds an application listener for receiving application events.
|
void |
addApplicationListener(String templateName,
ApplicationListener listener)
Adds an application listener to receive application events for a specific
document template.
|
void |
addClassLoader(ClassLoader classLoader)
Adds the specified
classLoader to the list of class loaders
managed by the application for loading classes and finding resources. |
void |
addDocumentTemplate(IlvDocumentTemplate docTemplate)
Adds the specified document template to the application.
|
void |
addLocaleSettingsListener(LocaleSettingsListener listener)
Adds a locale setting listener to listen to changes that occur to
the locale of the application.
|
void |
addMessageListener(MessageListener listener,
String name)
Adds the specified message
listener to receive message
event sent to the application. |
void |
addPropertyChangeListener(PropertyChangeListener listener)
Adds a listener that listens to the changes in the properties of this
application.
|
void |
addResourceBundle(ResourceBundle bundle)
Adds the specified resource
bundle to the list of
resource bundles managed by this application. |
ResourceBundle |
addResourcePropertyFile(String baseName)
Adds the specified resource bundle to the list of resource bundles
managed by the application.
|
boolean |
addSettings(IlvSettings settings)
Adds new settings to the application.
|
void |
addSettingsListener(SettingsListener listener)
Adds a settings listener to listen to settings events.
|
void |
addURLResolver(IlvURLResolver resolver)
Adds the specified URL resolver to the application.
|
IlvXMLSettings |
addXMLSettings(String filename)
Adds XML settings to the application.
|
IlvXMLSettings |
addXMLSettings(URL url)
Adds the XML settings file with the specified URL.
|
HashMap<Component,Cursor> |
applyCursor(Cursor cursor)
Sets a new cursor on all windows.
|
void |
attachDocument(IlvDocument parentDocument,
IlvDocument document)
Attaches the specified
document to the specified
parentDocument . |
boolean |
canCreateDocument(Object userData)
Determines whether the application can create a document for the
specified
userData . |
boolean |
close(boolean force)
Tries to end the application.
|
boolean |
closeActiveDocument(boolean mdiDocument)
Closes the current active document in the application.
|
boolean |
closeAllDocuments(boolean endSession)
Closes all the documents opened in the application.
|
boolean |
closeDocument(IlvDocument document,
boolean force)
Closes the specified document in the application.
|
void |
commitSettingsChanges()
Commits the changes that occurred on the application settings to the
user settings.
|
protected IlvDocumentTemplate |
createDocumentTemplate(String name)
Deprecated.
As of JViews 6.0, replaced with
createDocumentTemplate(java.lang.String, ilog.views.appframe.settings.IlvSettingsElement) .
This method is now invoked from this last method. |
protected IlvDocumentTemplate |
createDocumentTemplate(String name,
IlvSettingsElement element)
Creates a document template with the specified
name . |
void |
detachDocument(IlvDocument parentDocument,
IlvDocument document)
Detaches the specified
document from the specified
parentDocument . |
IlvDocument |
findDocument(String pathname)
Finds an open document with the specified
pathname . |
protected void |
fireApplicationEvent(ApplicationEvent event)
Notifies all the application listeners registered with the application
that the specified application
event has occurred. |
protected void |
fireLocaleSettingsEvent(LocaleSettingsEvent event)
Fires the specified locale setting
event to the locale
setting listeners added to the application. |
protected void |
firePropertyChange(String propertyName,
Object oldValue,
Object newValue)
Support method for notifying changes on the application properties:
if
oldValue and newValue are equal, this method
does nothing. |
String |
getAbbreviateForm(URL url)
Returns the abbreviated form of the specified URL.
|
Action |
getAction(String command)
Retrieves an action by its command key.
|
ActionHandler[] |
getActionHandlers(String actionCommand)
Returns an array of action handlers which can process
actions with the specified
actionCommand . |
IlvDocument |
getActiveDocument(boolean mdiDocument)
Returns the document currently active in the application.
|
IlvDocumentView |
getActiveView(boolean mdiDocument)
Returns the document view currently active in the application.
|
IlvViewContainer |
getActiveViewContainer()
Returns the container of the active document view.
|
Applet |
getApplet()
Returns the main window of the application as an applet.
|
Class<?> |
getClassForName(String classname)
Retrieves a class for the specified
classname . |
ClassLoader |
getClassLoader()
Returns the class loader associated with the application.
|
ComponentOrientation |
getComponentOrientation()
Returns the component orientation of the application.
|
protected String |
getDefaultUserSettingsPathname()
Returns the default pathname of the XML file that contains the settings
for the current application user.
|
URL |
getDocumentBase()
Returns the document base URL.
|
IlvDocumentTemplate |
getDocumentTemplate(int index)
Returns the document template at the specified storage
index
in the set of document templates managed by this application. |
IlvDocumentTemplate |
getDocumentTemplate(String name)
Retrieves the document template with the specified
name . |
int |
getDocumentTemplateCount()
Returns the number of document templates managed by this application.
|
String |
getFormattedString(String format,
Object[] params)
Returns the string resulting from the formatting of the specified
format with the parameters contained in the
params array of objects. |
ImageIcon |
getImageIcon()
Returns the icon of the application.
|
ImageIcon |
getImageIcon(String filename)
Returns an image icon for the specified filename.
|
Locale |
getLocale()
Returns the locale of the application.
|
Component |
getMainComponent()
Returns the main window of the application as a
Component . |
Container |
getMainContainer()
Returns the main window of the application as a container.
|
IlvMainWindow |
getMainWindow()
Returns the main window associated with the application.
|
String |
getName()
Returns the name of the application.
|
IlvDocument[] |
getOpenDocuments()
Returns all the open documents in the application.
|
IlvDocument[] |
getOpenDocuments(IlvDocumentTemplate documentTemplate)
Returns all the documents open in the application for the specified
documentTemplate . |
int |
getOpenedDocumentCount()
Returns the number of open documents in the application.
|
Object |
getProperty(String key)
Returns the property of the application with the specified key.
|
IlvRecentFileList |
getRecentFileList()
Returns the recent file list used by the application to store
the Most Recently Used files.
|
String |
getRecentOpenedFile(int index)
Returns the pathname at the specified storage
index in the
Most Recently Used file list managed by the application. |
int |
getRecentOpenedFileCount()
Returns the number of pathnames stored in the Most Recently Used file
list of the application.
|
IlvResourceBundleManager |
getResourceBundleManager()
Returns the resource bundle manager associated with the locale of
this application.
|
IlvSettings[] |
getSettings()
Returns the settings managed by this application.
|
IlvSettings |
getSettings(String name)
Finds the settings with the specified
name . |
IlvSettingsManager |
getSettingsManager()
Returns the settings manager that manages all the settings of the
application.
|
String |
getSoftwareProvider()
Returns the software provider name.
|
IlvSplashWindow |
getSplashWindow()
Returns the splash window currently displayed while the application
is initializing.
|
String |
getString(String key)
Retrieves a string resource for the specified key.
|
String |
getTitle()
Returns the title of the application.
|
IlvURLResolverManager |
getURLResolverManager()
Returns the URL resolver manager used by the application to resolve URLs.
|
URL |
getUserHomeDirectory()
Returns the home directory of the current application user.
|
String |
getUserSettingsSubDirectory()
Returns the subdirectory that is used for constructing the
pathname of the XML file containing the user settings for the current
application user.
|
URL |
getUserSettingsURL()
Returns the URL of the XML file containing the settings of the current
application user.
|
boolean |
initialize()
Initializes the application.
|
void |
initializeFileChooser(JFileChooser fileChooser,
String initialPathName,
int mode,
IlvFileDocumentTemplate fileTemplate)
Initializes a file chooser dialog.
|
boolean |
isApplet()
Determines whether the main window of this application is an applet.
|
boolean |
isInitialized()
Determines whether the application is initialized.
|
boolean |
isValidDocumentFile(String pathname)
Returns if the given pathname corresponds to a file that is accepted
by this application.
|
IlvDocument |
newDocument()
Creates a new document.
|
IlvDocument |
newDocument(IlvDocumentTemplate docTemplate,
boolean createViews,
Object userData)
Creates a new document for the specified document template.
|
IlvDocument |
newDocument(Object userData,
boolean createViews)
Creates a new document that embeds the specified
userData . |
IlvDocument |
newDocumentOnLastTemplate()
Creates a new document for the same document template as the one
selected in the New Document dialog box the last time it was
launched.
|
IlvDocument |
openDocument()
Prompts for a document file name and opens the corresponding document.
|
IlvDocument |
openDocument(IlvFileDocumentTemplate docTemplate)
Opens a document for the specified document template.
|
IlvDocument |
openDocumentFile(String pathname,
boolean createViews,
boolean addToMRU)
Opens a document with the specified
pathname . |
IlvDocument |
openRecentOpenedFile(int index)
Opens or activates the document file corresponding to the pathname stored
at specified
index in the list of Most Recently Used files
managed by the application. |
protected void |
quit()
Quits the application.
|
void |
readApplicationSettings()
Reads the settings of the application as the name, title, or icon of the
application.
|
void |
removeAction(Action action)
Removes an action from the list of actions managed by the application.
|
void |
removeActionHandler(ActionHandler handler)
Removes the specified action handler from the list of action handlers managed
by the application.
|
void |
removeApplicationListener(ApplicationListener listener)
Removes the specified application listener, so that it no longer receives
application events.
|
void |
removeApplicationListener(String templateName,
ApplicationListener listener)
Removes the specified listener, so that it no longer receives
application events.
|
boolean |
removeClassLoader(ClassLoader classLoader)
Removes the specified
classLoader from the list of class loaders
managed by the application. |
boolean |
removeDocumentTemplate(IlvDocumentTemplate documentTemplate)
Removes the specified
documentTemplate from the list of
document templates managed by the application. |
boolean |
removeLocaleSettingsListener(LocaleSettingsListener listener)
Removes the specified locale setting listener from the list of
listeners managed by the application.
|
void |
removeMessageListener(MessageListener listener)
Removes the specified message
listener from the list of
message listeners managed by the application. |
void |
removePropertyChangeListener(PropertyChangeListener listener)
Removes the specified listener from the list of
PropertyChange
listeners managed by the application. |
ResourceBundle |
removeResourcePropertyFile(String baseName)
Removes the resource bundle with the specified
baseName
from the application. |
boolean |
removeSettings(IlvSettings settings)
Removes the specified settings from the list of settings stored by the
application.
|
boolean |
removeSettingsListener(SettingsListener listener)
Removes the specified settings listener from the list of
settings listeners managed by the settings manager of the application.
|
boolean |
removeURLResolver(IlvURLResolver resolver)
Removes the specified URL resolver from the list of resolvers
managed by the application.
|
URL |
resolveURL(String filename)
Resolves a URL from the specified
filename . |
void |
restoreCursor()
Deprecated.
|
void |
restoreCursor(HashMap<Component,Cursor> targetComponents)
Restores the saved cursors on components.
|
boolean |
saveActiveDocument(boolean mdiDocument)
Saves the document currently active in the application.
|
boolean |
saveAllDocuments()
Saves all the modified documents open in the application.
|
boolean |
saveAsActiveDocument(boolean mdiDocument)
Saves the active document under another file name.
|
boolean |
saveDocument(IlvDocument document)
Saves the specified
document . |
boolean |
saveDocument(String pathname)
Saves the document with the specified
pathname . |
boolean |
saveDocumentModifications(IlvDocument document)
Saves the modifications of the specified document.
|
IlvSettingsElement[] |
select(IlvSettingsQuery query)
Returns the settings elements selected by the specified query.
|
IlvSettingsElement[] |
select(IlvSettingsQuery query,
IlvSettingsElement[] contextElements)
Returns the settings elements selected by the specified query starting
from the specified settings elements.
|
IlvSettingsElement[] |
select(String type,
IlvSettingsElement[] contextElements)
Returns the settings elements selected by the specified query parameters.
|
IlvSettingsElement |
selectElement(IlvSettingsQuery query)
Returns the first settings element selected by the specified query.
|
IlvSettingsElement |
selectElement(String type,
String attributeName,
Object attributeValue)
Returns the first settings element selected by the specified query
parameters.
|
void |
sendActionEvent(ActionEvent e)
Sends an action event to the action handlers of the application.
|
void |
sendActionEvent(String actionCommand)
Sends an action event to the action listeners of the application.
|
void |
sendMessage(String targetName,
MessageEvent messageEvent)
Sends the specified message event to all the message listeners registered
with the application.
|
void |
sendMessage(String targetName,
Object source,
String messageName,
Object[] params)
Sends the message
messageName to the target targetName
with the parameters params . |
void |
setActiveDocument(IlvDocument document,
IlvDocumentView view,
boolean mdiDocument)
Sets the active document of the application.
|
void |
setActiveView(IlvDocumentView view,
boolean mdiDocument)
Sets the active document view of this application.
|
void |
setCursor(Cursor cursor)
Deprecated.
replaced by
applyCursor(java.awt.Cursor) less prone to memory leaks |
void |
setDocumentBase(URL documentBase)
Sets the document base URL of the application.
|
void |
setImageIcon(ImageIcon icon)
Sets the icon of the application to the specified
icon . |
void |
setLocale(Locale locale)
Sets the locale for the application.
|
void |
setMainWindow(IlvMainWindow window)
Sets the main window of the application.
|
void |
setName(String name)
Sets the name of the application.
|
Object |
setProperty(String key,
Object value)
Sets one of the properties of the application using the associated key.
|
void |
setResourceBundleManager(IlvResourceBundleManager manager)
Sets the resource bundle manager that will manage the resource bundles
of the application.
|
void |
setSoftwareProvider(String name)
Sets the software provider.
|
void |
setSplashWindow(IlvSplashWindow splashWindow)
Sets a splash window for the application.
|
void |
setTitle(String title)
Sets the title of the application to the specified string.
|
void |
setUserHomeDirectory(URL url)
Sets the home directory for the current application user.
|
void |
setUserSettingsSubDirectory(String subDirectory)
Sets the sub directory that is used for constructing the
pathname of the XML file containing the user settings for the current
application user.
|
void |
setUserSettingsURL(URL url)
Sets the URL that accesses the settings of the current application user.
|
IlvFileChooserSelection[] |
showFileChooser(String initialPathName,
String title,
int mode,
IlvFileDocumentTemplate initialTemplate,
Component parent)
Displays a file chooser dialog.
|
boolean |
updateAction(Action action)
Asks for the display properties of the specified
action to be updated. |
boolean |
updateAction(String command)
Asks for the display properties of the action
with the specified command key to be updated.
|
void |
updateActions()
Asks for the display properties of all the actions that are
represented in all of the menu bars and toolbars of the main window
of the application to be updated.
|
void |
updateActionsByCategory(String category)
Asks for the display properties of all the actions that belong
to the specified
category to be updated. |
public static final String CLOSE_ALL_DOCUMENTS_CMD
public static final String CLOSE_DOCUMENT_CMD
public static final String OPEN_DOCUMENT_CMD
public static final String NEW_DOCUMENT_CMD
newDocument()
,
Constant Field Valuespublic static final String NEW_DOCUMENT_ON_LAST_TEMPLATE_CMD
newDocument()
method.newDocumentOnLastTemplate()
,
Constant Field Valuespublic static final String SAVE_ALL_DOCUMENTS_CMD
public static final String SAVE_DOCUMENT_CMD
Save
action.public static final String SAVE_AS_DOCUMENT_CMD
Save as
action.public static final String REVERT_DOCUMENT_CMD
Revert Document
action.public static final String EXIT_CMD
public static final int OPEN_MULTIPLE_FILES
OPEN_MODEL
.public static final int OPEN_FILE_MUST_EXIST
OPEN_MODEL
.public static final int OPEN_MODE
public static final int SAVE_MODE
public static final int SAVE_AS_MODE
SaveAs
action.public static final String TITLE_PROPERTY
public static final String ICON_PROPERTY
public static final String STATUS_MESSAGE
public static final String STATUS_BAR_PROPERTY
public static final String MENU_BAR_PROPERTY
public static final String MAIN_WINDOW_PROPERTY
public static final String SETTINGS_TYPE
public IlvApplication()
IlvApplication
with the name Default
.public IlvApplication(String applicationName)
applicationName
- The name of the application.setName(java.lang.String)
,
getName()
public IlvApplication(String[] args)
"-Unregister"
, the application
does not read and write the user settings.newDocument()
method is called for each parameter that are
equal to the string "-newDocument"
."-Unregister"
or
"-newDocument"
are
considered as file pathnames. For each specified pathname, the method
openDocumentFile(java.lang.String, boolean, boolean)
is invoked. If the specified pathname is a
relative path, it is resolved with the resolveURL(java.lang.String)
method.args
- The command line parameters.public IlvApplication(String name, String[] args)
IlvApplication
with the specified
command line parameters and the specified name.name
- The name of the applicationargs
- The command line parameters.setName(java.lang.String)
,
getName()
,
IlvApplication(String[])
public String getName()
setName(java.lang.String)
public void setName(String name)
name
- The new name of the applicationgetName()
public void setTitle(String title)
TITLE_PROPERTY
.title
- The new title of the application.getTitle()
,
TITLE_PROPERTY
public String getTitle()
setTitle(java.lang.String)
,
TITLE_PROPERTY
public void setImageIcon(ImageIcon icon)
icon
.
The icon appears in both the title bar of the Swing main window of the
application and in the title bar of the message dialogs launched by the
application.
ICON_PROPERTY
.icon
- The new icon of the application.getImageIcon()
,
ICON_PROPERTY
public ImageIcon getImageIcon()
setImageIcon(javax.swing.ImageIcon)
public void sendActionEvent(ActionEvent e)
For each action handler of the application, the application invokes
first the method ActionHandler.isProcessingAction(String)
of the action handler to determine whether it is able to process the
action. If yes, the
ActionListener.actionPerformed(java.awt.event.ActionEvent)
of the
action handler is called and the calling chain is stopped. Otherwise, the
next action handler in the calling chain is invoked.
e
- The action event to send.sendActionEvent(String)
,
updateAction(String)
,
getAction(String)
public void sendActionEvent(String actionCommand)
A new ActionEvent
is created with the specified
action command and is given as the argument of the
sendActionEvent(java.awt.event.ActionEvent)
method.
actionCommand
- the action command to build an action event fromsendActionEvent(java.awt.event.ActionEvent)
,
updateAction(String)
,
getAction(String)
public void sendMessage(String targetName, Object source, String messageName, Object[] params)
messageName
to the target targetName
with the parameters params
.targetName
- The name of the target to which the message is sent.
If null
, the message will be sent to all the message
listeners registered with the application.source
- The object that sent the message.messageName
- The name of the message.params
- The parameters of the message.addMessageListener(ilog.views.appframe.event.MessageListener, java.lang.String)
public void sendMessage(String targetName, MessageEvent messageEvent)
targetName
- The name of the target to which the message is sent.
If null
, the message will be sent to all the listeners
registered with the application.messageEvent
- The message event sent to the message listeners of the
application.addMessageListener(ilog.views.appframe.event.MessageListener, java.lang.String)
public void addMessageListener(MessageListener listener, String name)
listener
to receive message
event sent to the application.listener
- The new message listener to add.name
- The name of the listener.removeMessageListener(MessageListener)
public void removeMessageListener(MessageListener listener)
listener
from the list of
message listeners managed by the application.listener
- The message listener to remove.addMessageListener(MessageListener, String)
public void addActionHandler(ActionHandler handler)
handler
- The action handler to add.removeActionHandler(ActionHandler)
public ActionHandler[] getActionHandlers(String actionCommand)
actionCommand
.
For all the action handlers added to this application with the method
addActionHandler(ilog.views.appframe.event.ActionHandler)
, the implementation of
this method invokes the method
ActionHandler.isProcessingAction(java.lang.String)
the action handlers
and selects the one which return true
for the specified actionCommand
as the parameter.
The action handlers are stored in the returned array according
to which order they are invoked for processing an
action. The action handler at the index 0
will be the
first - and the only one - to be invoked for processing the action
with the actionCommand
. If this action handler is removed
from the application, the action handler at the index 1
will be the first to be invoked, and so on.
As action handlers are susceptible to process several action commands, note that it can be dangerous to remove action handlers which behavior is not known from the remover.
actionCommand
- The action command key.addActionHandler(ActionHandler)
,
removeActionHandler(ActionHandler)
public void removeActionHandler(ActionHandler handler)
handler
- The handler to remove.addActionHandler(ilog.views.appframe.event.ActionHandler)
public Action getAction(String command)
addAction(javax.swing.Action)
for the action with property
Action.ACTION_COMMAND_KEY
equal to the specified command
.command
- The command key of the action to retrieve.null
if no actions could be found.public void addAction(Action action)
ActionListener.actionPerformed(java.awt.event.ActionEvent)
method of the action is called when an action event occurs for this action.action
- The new action to add.getAction(java.lang.String)
,
removeAction(javax.swing.Action)
public void removeAction(Action action)
action
- The action to remove.addAction(javax.swing.Action)
public boolean initialize()
true
if the application can be initialized;
false
otherwise.isInitialized()
public boolean isInitialized()
initialize()
method
has been invoked.true
if the application is initialized;
false
otherwise.initialize()
public boolean close(boolean force)
quit()
.force
- If true
, the user cannot cancel
the closing operation and all the open documents are closed even if they
are modified. If false
, the user is prompted to save
modified open documents. At this stage, he/she can cancel the operation.true
if the application can terminate;
false
otherwise.public boolean addSettings(IlvSettings settings)
IlvSettingsManager.APPLICATION_DATA_LAYER
.settings
- The settings to add.addXMLSettings(java.net.URL)
,
addXMLSettings(String)
,
IlvSettingsManager
,
getSettingsManager()
,
removeSettings(ilog.views.appframe.settings.IlvSettings)
public IlvXMLSettings addXMLSettings(String filename)
IlvSettingsManager.APPLICATION_DATA_LAYER
.filename
- The file name of the XML file to add.IlvXMLSettings
instance if the operation is successful; null
if the
specified file name could not be resolved into a valid pathname or if the
content of this file does not correspond to a valid XML file.addSettings(ilog.views.appframe.settings.IlvSettings)
,
addXMLSettings(java.net.URL)
,
IlvSettingsManager
,
addURLResolver(ilog.views.appframe.util.IlvURLResolver)
,
IlvXMLSettings
,
addSettings(ilog.views.appframe.settings.IlvSettings)
,
getSettingsManager()
,
removeSettings(ilog.views.appframe.settings.IlvSettings)
public IlvXMLSettings addXMLSettings(URL url)
IlvSettingsManager.APPLICATION_DATA_LAYER
.url
- The URL of the XML settings file to add.IlvXMLSettings
instance if the operation is successful; null
, if the
content of this file does not correspond to a valid XML file.addSettings(ilog.views.appframe.settings.IlvSettings)
,
addXMLSettings(String)
,
IlvSettingsManager
,
addURLResolver(ilog.views.appframe.util.IlvURLResolver)
,
IlvXMLSettings
,
addSettings(ilog.views.appframe.settings.IlvSettings)
,
getSettingsManager()
,
removeSettings(ilog.views.appframe.settings.IlvSettings)
public boolean removeSettings(IlvSettings settings)
true
if the specified settings belong to the
application; false
otherwise.addSettings(ilog.views.appframe.settings.IlvSettings)
,
addXMLSettings(String)
,
addXMLSettings(java.net.URL)
,
IlvSettingsManager
,
getSettingsManager()
public IlvSettings getSettings(String name)
name
.name
- The name of the settings to retrieve.null
if no
settings could be found with this name.public IlvSettings[] getSettings()
public void addSettingsListener(SettingsListener listener)
listener
- The listener to add.removeSettingsListener(ilog.views.appframe.settings.SettingsListener)
public boolean removeSettingsListener(SettingsListener listener)
listener
- The listener to remove.true
if the listener was previously added to the
application; false
otherwise.addSettingsListener(ilog.views.appframe.settings.SettingsListener)
public IlvSettingsManager getSettingsManager()
public IlvSettingsElement selectElement(IlvSettingsQuery query)
query
- The query that selects the element to retrieve.null
if no settings element could be found.IlvSettingsQuery
,
IlvSettingsElement
,
IlvSettingsManager
,
selectElement(String, String, Object)
public IlvSettingsElement selectElement(String type, String attributeName, Object attributeValue)
attributeName
value equal to attributeValue
is
returned.
type
- The type of the element to retrieve.attributeName
- The name of the attribute to match the value from.attributeValue
- The value of the attribute to be compared.null
if no settings elements could be found.IlvSettingsQuery
,
IlvSettingsElement
,
IlvSettingsManager
,
selectElement(ilog.views.appframe.settings.IlvSettingsQuery)
public IlvSettingsElement[] select(IlvSettingsQuery query)
query
- The query that selects the elements to be returned.IlvSettingsQuery
,
IlvSettingsElement
,
IlvSettingsManager
,
select(String, ilog.views.appframe.settings.IlvSettingsElement[])
public IlvSettingsElement[] select(String type, IlvSettingsElement[] contextElements)
type
- The type of the settings elements to select.contextElements
- The elements to start the selection from. If
null
, the selection starts from the root elements of all
the settings added to the application.IlvSettingsQuery
,
IlvSettingsElement
,
IlvSettingsManager
,
select(ilog.views.appframe.settings.IlvSettingsQuery)
,
IlvSettingsElement.getChildren(String)
public IlvSettingsElement[] select(IlvSettingsQuery query, IlvSettingsElement[] contextElements)
query
- The query that selects the elements to retrieve.contextElements
- The elements to start the selection from. If
null
, the selection starts from the root elements of all
the settings added to the application.IlvSettingsElement.getChildren(ilog.views.appframe.settings.IlvSettingsQuery)
,
select(String, ilog.views.appframe.settings.IlvSettingsElement[])
public void commitSettingsChanges()
public void addLocaleSettingsListener(LocaleSettingsListener listener)
listener
- The listener to add.removeLocaleSettingsListener(ilog.views.appframe.settings.LocaleSettingsListener)
public boolean removeLocaleSettingsListener(LocaleSettingsListener listener)
listener
- The listener to remove.true
if the listener was previously added to the
application; false
otherwise.addLocaleSettingsListener(ilog.views.appframe.settings.LocaleSettingsListener)
protected void fireLocaleSettingsEvent(LocaleSettingsEvent event)
event
to the locale
setting listeners added to the application.event
- The event to fire.addLocaleSettingsListener(ilog.views.appframe.settings.LocaleSettingsListener)
public void setMainWindow(IlvMainWindow window)
window
- The main window to associate with the application.getMainWindow()
,
MAIN_WINDOW_PROPERTY
public Component getMainComponent()
Component
.null
if no main window
has been associated with the application or if the main window is not
a component.getMainWindow()
public IlvMainWindow getMainWindow()
public Container getMainContainer()
null
if no main window
has been associated with the application or if the main window is not
a container.getMainWindow()
public boolean isApplet()
true
if the main window is an applet;
false
otherwise.getApplet()
public Applet getApplet()
null
if the main window of the
application is not an applet.isApplet()
public void readApplicationSettings()
protected IlvDocumentTemplate createDocumentTemplate(String name, IlvSettingsElement element)
name
.
This method is invoked when the application creates its document
templates from the settings. This method can be overridden to
provide a specific document template for the specified document template
name. By default, a new instance of IlvFileDocumentTemplate
is returned.name
- The name of the document template to create.element
- The settings element that defines the document template
to create.@Deprecated protected IlvDocumentTemplate createDocumentTemplate(String name)
createDocumentTemplate(java.lang.String, ilog.views.appframe.settings.IlvSettingsElement)
.
This method is now invoked from this last method.name
.
This method is invoked when the application creates its document
templates from the settings. This method can be overridden to
provide a specific document template for the specified document template
name. By default, a new instance of IlvFileDocumentTemplate
is returned.name
- The name of the document template to create.public int getDocumentTemplateCount()
getDocumentTemplate(int)
public IlvDocumentTemplate getDocumentTemplate(int index)
index
in the set of document templates managed by this application.index
- The storage index of the document template to return.getDocumentTemplateCount()
public IlvDocumentTemplate getDocumentTemplate(String name)
name
.name
- The name of the document template to retrieve.null
if
no document template can be found with this name.public void addDocumentTemplate(IlvDocumentTemplate docTemplate)
Since document templates should be specified in settings and automatically
created by the application, this method is useful for specifying
an IlvDocumentTemplate
inheriting
class instance for a specific type of document.
docTemplate
- The new document template to be added.removeDocumentTemplate(ilog.views.appframe.docview.IlvDocumentTemplate)
public boolean removeDocumentTemplate(IlvDocumentTemplate documentTemplate)
documentTemplate
from the list of
document templates managed by the application. The method tries first
to close the documents that have been opened by the document template.
A save confirmation dialog is displayed for documents with the specified
document template that have been modified. If the application user
presses the Cancel button, the document cannot be closed and
the removal process of the document template will be stopped.documentTemplate
- The document template to remove.true
if the document template can be removed or
false
if the document template was not previously added to
the application or if a document with this document template cannot be
closed.addDocumentTemplate(ilog.views.appframe.docview.IlvDocumentTemplate)
public IlvDocument openDocument()
null
if the user has canceled
the file chooser dialog or if the creation of the document failed.public IlvDocument openDocument(IlvFileDocumentTemplate docTemplate)
docTemplate
- The document template that specifies the type
of document the file chooser can select.null
if the
user cancels the file chooser or if a document could not be
opened for the selected pathname.public IlvDocument openDocumentFile(String pathname, boolean createViews, boolean addToMRU)
pathname
.
If an open document is found with the same pathname, it will be activated
and the method will return this document.
Otherwise, a new document is created by the file document template
of the application that matches the specified pathname
.pathname
- The file to open.createViews
- If true
, document views will be created
for the document as specified in the settings of the document template.
If false
, no document view is created.addToMRU
- If true
, the specified pathname is added to
the Most Recently Used file list managed by the application. If
false
, the pathname is not added to this list.null
if
no file document template matches the pathname or if the newly created
document cannot be initialized from the specified file.openDocument()
,
IlvFileDocumentTemplate.matchPathName(java.net.URL)
public boolean isValidDocumentFile(String pathname)
pathname
- The file to validatetrue
if the file is accepted by this applicationpublic void initializeFileChooser(JFileChooser fileChooser, String initialPathName, int mode, IlvFileDocumentTemplate fileTemplate)
fileChooser
- The file chooser to initialize.initialPathName
- The pathname to select in the file chooser. If
null
, the last selected pathname will be selected.mode
- The mode for opening the file chooser. This mode must be a
combination of one or more of the following constants:fileTemplate
- The document template file that provides the
file filters to set to the file chooser. If null
, all the
document template files of the application are used for initializing
the file chooser filters.IlvFileDocumentTemplate.initializeFileChooser(javax.swing.JFileChooser, boolean)
,
showFileChooser(java.lang.String, java.lang.String, int, ilog.views.appframe.docview.IlvFileDocumentTemplate, java.awt.Component)
public IlvFileChooserSelection[] showFileChooser(String initialPathName, String title, int mode, IlvFileDocumentTemplate initialTemplate, Component parent)
initialPathName
- The pathname to select in the file chooser. If
null
, the last selected pathname is selected.title
- The title to display in the file chooser. If null
,
a default title will be displayed, depending on the mode the file chooser is
opened in.mode
- The mode for opening the file chooser. This mode must be a
combination of one or more of the following constant values:initialTemplate
- The document template file that provides the
file filters of the file chooser. If null
, all the
document template files specified to the application are used for
initializing the file chooser filters.parent
- The parent component of the file chooser dialog;
see JFileChooser.showDialog(java.awt.Component, java.lang.String)
for details.
If null
, it is set to the main window of the
application if it is a component.null
if no pathnames are
chosen.public IlvDocument newDocument()
NEW_DOCUMENT_CMD
. If at least two document
templates are registered, a dialog box will be shown to let the user
select the type of document to create (the document template with which to
create the new document).
null
if the user cancels
the new document dialog or if the application has no document templates.newDocumentOnLastTemplate()
,
NEW_DOCUMENT_CMD
public IlvDocument newDocumentOnLastTemplate()
This method is invoked when processing the action with the
command key NEW_DOCUMENT_ON_LAST_TEMPLATE_CMD
.
If the application has only one document template, it
will automatically be selected and this method will have the same behavior as the
newDocument()
method.
If no document template has previously been selected in the New Document dialog box and if more than one document template can be selected for creating a new document, the New Dialog box will be launched.
null
if the user cancels the New Document
dialog or if the new document
cannot be created or initialized.newDocument()
,
NEW_DOCUMENT_ON_LAST_TEMPLATE_CMD
public IlvDocument newDocument(IlvDocumentTemplate docTemplate, boolean createViews, Object userData)
docTemplate
- The document template to use for creating a new document.createViews
- If true
, document views are created
for the newly created document as defined in the settings of the specified
document template.userData
- The user data given as the parameter to the
IlvDocument.initializeDocument(java.lang.Object)
method of the newly created document.false
otherwise.newDocument(Object, boolean)
public IlvDocument newDocument(Object userData, boolean createViews)
userData
.
The method IlvDocumentTemplate.matchData(java.lang.Object)
of all the document templates of the application is called with
the specified data as the parameter. The returned matching level that is
the closest to 0
and positive selects the document
template that will create the document associated with the data. If two
document templates have the same matching level for the data,
the first document template added to the application will be selected.
If no matching document template can be found, no document will be created.
userData
- The data to create an embedded document for.
It is given as the parameter to the
IlvDocument.initializeDocument(java.lang.Object)
method of the newly created document.createViews
- If true
, document views will be created
for the newly created document as defined in the settings of the selected
document template.newDocument(ilog.views.appframe.docview.IlvDocumentTemplate, boolean, Object)
,
canCreateDocument(java.lang.Object)
public boolean canCreateDocument(Object userData)
userData
.true
if at least one document template registered with
the application matches the specified userData
or
false
otherwise.newDocument(Object, boolean)
,
IlvDocumentTemplate.matchData(java.lang.Object)
public boolean saveAllDocuments()
true
if all the modified documents can be saved or
false
if the application user has canceled the saving operation
when prompted to save a modified document.protected void quit()
close(boolean)
method after checking that
the application can be closed. At this stage, all the documents opened by
the application have been closed.
The default implementation of this method invokes the code
System.exit(0)
. It can be overridden in order not to exit the
application.
public boolean closeAllDocuments(boolean endSession)
endSession
- The value true
specifies that this method is called
during a process that must end the session. The user is not prompted
for saving the modified documents open in the application. If false
,
the user will be prompted to save modifications for each modified document.
The user is then able to cancel the operation.true
if all the open documents could be closed or
false
otherwise. It can fail if the application user has canceled the saving operation
when prompted to save a modified document.public boolean closeActiveDocument(boolean mdiDocument)
CLOSE_DOCUMENT_CMD
action event.mdiDocument
- Same meaning as the parameter of
the getActiveDocument(boolean)
method. When called for processing
the CLOSE_DOCUMENT_CMD
action event, this parameter is
true
.true
if the active document has been closed or
false
if the application does not contain any
documents or if the active document could not be closed.getActiveDocument(boolean)
,
closeDocument(ilog.views.appframe.docview.IlvDocument, boolean)
public boolean closeDocument(IlvDocument document, boolean force)
document
- The document to closeforce
- If true
, the document will be closed, even though
it has been modified, without asking the user for confirmation. If
false
, the user is asked to save the document if it has been
modified and can cancel the operation.true
if the specified document could be closed;
false
otherwise.IlvDocumentTemplate.closeDocument(ilog.views.appframe.docview.IlvDocument, boolean)
,
closeActiveDocument(boolean)
public boolean saveActiveDocument(boolean mdiDocument)
mdiDocument
- Same meaning as the parameter of
the getActiveDocument(boolean)
method. When called for processing
the SAVE_DOCUMENT_CMD
action event, this parameter is
true
.true
, if the application contains an active document
and if this document can be saved; false
otherwise.saveDocument(IlvDocument)
,
getActiveDocument(boolean)
public boolean saveDocument(String pathname)
pathname
.pathname
- The pathname of the document to save. It must have the
syntax of a URL.true
if saving is successful; false
otherwise.public boolean saveDocument(IlvDocument document)
document
.document
- The document to save.true
if the document could be saved;
false
otherwise.public boolean saveDocumentModifications(IlvDocument document)
true
.
document
.document
- the document to save.true
if the document could be saved successfully;
false
otherwise.public boolean saveAsActiveDocument(boolean mdiDocument)
mdiDocument
- Same meaning as the parameter of
the getActiveDocument(boolean)
method. When called for processing
the SAVE_AS_DOCUMENT_CMD
action event, this parameter is
true
.true
, if the active document has been saved;
false
otherwise.public IlvDocument findDocument(String pathname)
pathname
.pathname
- The pathname of the document to find. It must have the
syntax of a URL.null
if no documents could be found.public int getOpenedDocumentCount()
public IlvDocument[] getOpenDocuments()
public IlvDocument[] getOpenDocuments(IlvDocumentTemplate documentTemplate)
documentTemplate
.documentTemplate
- The document template to retrieve the
open documents from.public IlvDocument openRecentOpenedFile(int index)
index
in the list of Most Recently Used files
managed by the application.index
- The index in the Most Recently Used file list. The value
0
corresponds to the most recently used file.null
if the
MRU list is empty or if the pathname at the specified index is no longer
valid.getRecentFileList()
,
getRecentOpenedFile(int)
public String getRecentOpenedFile(int index)
index
in the
Most Recently Used file list managed by the application.index
- the index in the MRU file list.null
if the
MRU file list is empty.getRecentFileList()
public int getRecentOpenedFileCount()
getRecentFileList()
,
getRecentOpenedFile(int)
public IlvRecentFileList getRecentFileList()
public IlvDocument getActiveDocument(boolean mdiDocument)
mdiDocument
parameter is true
,
the document currently active in the MDI client of the main window of the
application is returned, even if another document view not contained
by the MDI client (a static view) is currently active.
If the value of the mdiDocument
parameter is false
,
the document view currently active in the application is returned, even if
it is in the MDI client zone of the main window of the application.mdiDocument
- If true
, the view currently active in the
MDI client zone of the main window of the application is returned;
if false
, the document view currently active is returned.null
if no document
is currently active in the application.setActiveDocument(ilog.views.appframe.docview.IlvDocument, ilog.views.appframe.docview.IlvDocumentView, boolean)
,
getActiveView(boolean)
public void setActiveDocument(IlvDocument document, IlvDocumentView view, boolean mdiDocument)
document
- The open document to activate in the application.view
- The view of the specified document that has been activated.mdiDocument
- Same meaning as the parameter of the
getActiveDocument(boolean)
method.getActiveDocument(boolean)
,
setActiveView(ilog.views.appframe.docview.IlvDocumentView, boolean)
public void setActiveView(IlvDocumentView view, boolean mdiDocument)
view
- The document view that has the focus in the application.mdiDocument
- Same meaning as the parameter of the
getActiveDocument(boolean)
method.public IlvDocumentView getActiveView(boolean mdiDocument)
mdiDocument
- Same meaning as the parameter of the
getActiveDocument(boolean)
method.null
if no document
view is currently active in the application.setActiveView(ilog.views.appframe.docview.IlvDocumentView, boolean)
,
getActiveDocument(boolean)
public IlvViewContainer getActiveViewContainer()
public void addApplicationListener(ApplicationListener listener)
listener
- The application listener to add.removeApplicationListener(ilog.views.appframe.event.ApplicationListener)
public void addApplicationListener(String templateName, ApplicationListener listener)
templateName
- The name of the document template for which
document events will be fired to the listener.listener
- The application listener to add.removeApplicationListener(String, ilog.views.appframe.event.ApplicationListener)
public void removeApplicationListener(ApplicationListener listener)
listener
- The application listener to remove.addApplicationListener(ilog.views.appframe.event.ApplicationListener)
public void removeApplicationListener(String templateName, ApplicationListener listener)
templateName
- The name of the document template for which
document and view events were fired to the listener.listener
- The application listener to remove.addApplicationListener(String, ilog.views.appframe.event.ApplicationListener)
protected void fireApplicationEvent(ApplicationEvent event)
event
has occurred.public void attachDocument(IlvDocument parentDocument, IlvDocument document)
document
to the specified
parentDocument
.
When closing, the parentDocument
first closes
its attached documents, containing the specified document
.parentDocument
- The document to attach a document to.document
- The document to attach.detachDocument(ilog.views.appframe.docview.IlvDocument, ilog.views.appframe.docview.IlvDocument)
public void detachDocument(IlvDocument parentDocument, IlvDocument document)
document
from the specified
parentDocument
.
As a consequence, the parentDocument
does not close
the document
when it closes itself.parentDocument
- The document to detach a document from.document
- The document to detach.attachDocument(ilog.views.appframe.docview.IlvDocument, ilog.views.appframe.docview.IlvDocument)
public boolean updateAction(String command)
ActionHandler
handlers to
update the action, from the action handler of highest priority to the
lowest. The first action handler that handles the action update stops the
calling chain.All menu items and buttons within menu bars and toolbars that are associated with this action automatically reflect the property changes.
command
- The command key of the action to be updated.true
if an action with the specified command key has
been found and if this action has been successfully updated;
false
otherwise.updateAction(javax.swing.Action)
,
updateActionsByCategory(java.lang.String)
,
ActionHandler.updateAction(javax.swing.Action)
public boolean updateAction(Action action)
action
to be updated. This method use the same update mechanism as described
for the method updateAction(String)
.true
if the action could be updated; false
otherwise.updateAction(String)
,
updateActionsByCategory(java.lang.String)
,
ActionHandler.updateAction(javax.swing.Action)
public void updateActions()
updateAction(String)
.public void updateActionsByCategory(String category)
category
to be updated. Action categories are defined in the settings
of the action as described for the IlvAction
class.
The same update mechanism is used as the one
described for the method updateAction(String)
.public ClassLoader getClassLoader()
null
is
returned.public void addClassLoader(ClassLoader classLoader)
classLoader
to the list of class loaders
managed by the application for loading classes and finding resources.classLoader
- The class loader to add.removeClassLoader(java.lang.ClassLoader)
,
getClassLoader()
public boolean removeClassLoader(ClassLoader classLoader)
classLoader
from the list of class loaders
managed by the application.classLoader
- The class loader to remove.true
if the class loader was previously added to
the application; false
otherwise.addClassLoader(java.lang.ClassLoader)
,
getClassLoader()
public Class<?> getClassForName(String classname)
classname
. The class
is searched for in the system class loader and within all the class loaders
added to the application.classname
- The classname to retrieve a class from.null
if no class is found with the specified name.public void setLocale(Locale locale)
locale
- The new locale of the application.getLocale()
public Locale getLocale()
setLocale(java.util.Locale)
public IlvResourceBundleManager getResourceBundleManager()
public void setResourceBundleManager(IlvResourceBundleManager manager)
manager
- The new resource bundle manager.getResourceBundleManager()
public ResourceBundle addResourcePropertyFile(String baseName)
baseName
- The base property filename to create a resource bundle from.null
if no resource bundle can be created.addResourceBundle(java.util.ResourceBundle)
,
removeResourcePropertyFile(java.lang.String)
public ResourceBundle removeResourcePropertyFile(String baseName)
baseName
from the application.baseName
- The base name that was used for creating
the resource bundle to be removed.baseName
and the current locale or null
if the resource bundle has not been added to the manager.addResourcePropertyFile(java.lang.String)
public void addResourceBundle(ResourceBundle bundle)
bundle
to the list of
resource bundles managed by this application.bundle
- The new resource bundle.public ImageIcon getImageIcon(String filename)
filename
- The file name of the image icon to retrieve - can be a key
to a string resource.null
if
no image icons created for this file name could be found.public String getString(String key)
key
- The Key of the string resource to retrieve.public String getFormattedString(String format, Object[] params)
format
with the parameters contained in the
params
array of objects.
See the documentation of the java.text.MessageFormat
class
for the details of the format protocol.
format
- The format to be used - can be a key to a string resource.params
- The array of parameters used for the formatting.public ComponentOrientation getComponentOrientation()
An right-to-left component orientation is enabled if the resource bundle has an entry "Orientation=RTL", regardless of the locale.
public HashMap<Component,Cursor> applyCursor(Cursor cursor)
HashMap list = application.applyCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); try { ... } finally { application.restoreCursor(list); }
cursor
- the new cursorrestoreCursor(java.util.HashMap<java.awt.Component, java.awt.Cursor>)
public void restoreCursor(HashMap<Component,Cursor> targetComponents)
targetComponents
- the list returned by applyCursor(java.awt.Cursor)
applyCursor(java.awt.Cursor)
@Deprecated public void setCursor(Cursor cursor)
applyCursor(java.awt.Cursor)
less prone to memory leaksrestoreCursor(java.util.HashMap<java.awt.Component, java.awt.Cursor>)
.cursor
- The new cursor for the application frame.restoreCursor(java.util.HashMap<java.awt.Component, java.awt.Cursor>)
@Deprecated public void restoreCursor()
restoreCursor(java.util.HashMap<java.awt.Component, java.awt.Cursor>)
setCursor(java.awt.Cursor)
method.public URL getUserSettingsURL()
setUserSettingsURL(java.net.URL)
, it will be returned.
Otherwise, the implementation of this method tries to construct a URL
from the pathname returned by the method
getDefaultUserSettingsPathname()
.null
if the URL could
not be constructed.public void setUserSettingsURL(URL url)
getDefaultUserSettingsPathname()
url
- The URL that accesses the user settings XML file.protected String getDefaultUserSettingsPathname()
<User Home>/<SoftwareProvider>/<Sub directory>/<Application name>/settings.xml
where:
<User Home>
is the user home directory accessed with
the methods getUserHomeDirectory()
and setUserHomeDirectory(java.net.URL)
.<SoftwareProvider>
is the software provider accessed with
the methods getSoftwareProvider()
and setSoftwareProvider(java.lang.String)
.<Sub directory>
is a subdirectory accessed with the methods
getUserSettingsSubDirectory()
and setUserSettingsSubDirectory(java.lang.String)
.<Application name>
is the application name accessed with the methods
getName()
and setName(java.lang.String)
.public URL getUserHomeDirectory()
setUserHomeDirectory(java.net.URL)
public void setUserHomeDirectory(URL url)
url
- The URL of the new user home directory.getUserHomeDirectory()
public String getSoftwareProvider()
setSoftwareProvider(java.lang.String)
, this name will be returned.
Otherwise, this method returns "RogueWave"
.setSoftwareProvider(String)
,
getUserSettingsURL()
public void setSoftwareProvider(String name)
name
- The name of the software provider.getSoftwareProvider()
public String getUserSettingsSubDirectory()
getDefaultUserSettingsPathname()
,
setUserSettingsSubDirectory(java.lang.String)
,
getUserSettingsURL()
public void setUserSettingsSubDirectory(String subDirectory)
subDirectory
- The subdirectory.getUserSettingsSubDirectory()
,
getDefaultUserSettingsPathname()
public URL resolveURL(String filename)
filename
.filename
- The file name to resolve a URL from.public String getAbbreviateForm(URL url)
url
- The URL to get an abbreviated form from.resolveURL(java.lang.String)
,
IlvURLResolver
,
IlvURLResolver.getAbbreviateForm(java.net.URL)
public void addURLResolver(IlvURLResolver resolver)
resolver
- The new URL resolver to add to the application.IlvURLResolverManager.addResolver(ilog.views.appframe.util.IlvURLResolver)
public boolean removeURLResolver(IlvURLResolver resolver)
resolver
- The URL resolver to remove.true
if the application contains the specified
URL resolver; false
otherwise.addURLResolver(ilog.views.appframe.util.IlvURLResolver)
,
IlvURLResolverManager.removeResolver(ilog.views.appframe.util.IlvURLResolver)
public IlvURLResolverManager getURLResolverManager()
public URL getDocumentBase()
null
if not
set with the setDocumentBase(java.net.URL)
method.setDocumentBase(java.net.URL)
public void setDocumentBase(URL documentBase)
documentBase
- The document base URL.getDocumentBase()
public Object setProperty(String key, Object value)
PropertyChangeEvent
is sent to
property change listeners.setProperty
in interface IlvPropertyManager
key
- The non-null
property key.value
- An Object
value. If it is equal to
null
, the property with the specified key will be removed.getProperty(java.lang.String)
,
addPropertyChangeListener(java.beans.PropertyChangeListener)
public Object getProperty(String key)
getProperty
in interface IlvPropertyManager
key
- The non-null
property key.null
if the specified property was not found.setProperty(java.lang.String, java.lang.Object)
public void addPropertyChangeListener(PropertyChangeListener listener)
addPropertyChangeListener
in interface IlvPropertyManager
listener
- The listener to addremovePropertyChangeListener(java.beans.PropertyChangeListener)
,
setProperty(java.lang.String, java.lang.Object)
public void removePropertyChangeListener(PropertyChangeListener listener)
PropertyChange
listeners managed by the application.removePropertyChangeListener
in interface IlvPropertyManager
listener
- The listener to remove.addPropertyChangeListener(java.beans.PropertyChangeListener)
protected void firePropertyChange(String propertyName, Object oldValue, Object newValue)
oldValue
and newValue
are equal, this method
does nothing. Otherwise, a PropertyChange
event is fired
to each listener.propertyName
- The name of the property that was changed.oldValue
- The old value of the property.newValue
- The new value of the property.IlvDefaultPropertyManager.firePropertyChange(java.lang.String, java.lang.Object, java.lang.Object)
,
addPropertyChangeListener(java.beans.PropertyChangeListener)
public void setSplashWindow(IlvSplashWindow splashWindow)
splashWindow
is displayed. The splash window is closed when the main window of the
application is displayed.
This method should be invoked before the application is initialized.splashWindow
- The splash window to display while the application is
initializing.getSplashWindow()
public IlvSplashWindow getSplashWindow()
null
if
no splash window has been set using the method setSplashWindow(ilog.views.appframe.swing.IlvSplashWindow)
or if the application and its main window have been initialized.setSplashWindow(ilog.views.appframe.swing.IlvSplashWindow)
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.