|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.globalmentor.beans.BoundPropertyObject
com.guiseframework.AbstractGuiseSession
public abstract class AbstractGuiseSession
An abstract implementation that keeps track of the components of a user session.
| Field Summary |
|---|
| Fields inherited from class com.globalmentor.beans.BoundPropertyObject |
|---|
NO_PROPERTY_CHANGE_LISTENERS, NO_VETOABLE_CHANGE_LISTENERS |
| Fields inherited from interface com.guiseframework.GuiseSession |
|---|
INPUT_STRATEGY_PROPERTY, LOCALE_PROPERTY, ORIENTATION_PROPERTY, PRINCIPAL_PROPERTY, THEME_URI_PROPERTY, TIME_ZONE_PROPERTY |
| Constructor Summary | |
|---|---|
AbstractGuiseSession(GuiseApplication application,
Platform platform)
Application and platform constructor. |
|
| Method Summary | ||
|---|---|---|
void |
beginModalNavigation(ModalNavigationPanel<?> modalNavigationPanel,
ModalNavigation modalNavigation)
Begins modal interaction for a particular modal panel. |
|
void |
clearRequestedNavigation()
Removes any requests for navigation. |
|
Component |
createBusyComponent()
Creates a component to indicate Guise busy status. |
|
protected Component |
createComponent(java.lang.Class<? extends Component> componentClass)
Creates the component for the given class. |
|
protected InputEvent |
createInputEvent(Input input)
Creates an input event for the given input. |
|
com.globalmentor.net.URIPath |
createTempPublicResource(java.lang.String baseName,
java.lang.String extension)
Creates a temporary resource available at a public application navigation path but with access restricted to this session. |
|
java.lang.String |
dereferenceString(java.lang.String string)
Dereferences a string by replacing any string references with a string from the resources. |
|
java.net.URI |
dereferenceURI(java.net.URI uri,
java.lang.String... suffixes)
Dereferences a URI by looking up any references from the resources if necessary. |
|
void |
destroy()
Called when the session is destroyed. |
|
boolean |
endModalNavigation(ModalNavigationPanel<?> modalNavigationPanel)
Ends modal interaction for a particular modal panel. |
|
protected void |
fireNavigated(Component component,
NavigationEvent navigationEvent)
Fires a NavigationEvent to all NavigationListeners in the given component hierarchy. |
|
void |
fireNavigated(java.net.URI referrerURI)
Fires a NavigationEvent to all NavigationListeners in the session application frame hierarchy. |
|
ActionPrototype |
getAboutApplicationActionPrototype()
|
|
GuiseApplication |
getApplication()
|
|
ApplicationFrame |
getApplicationFrame()
Returns the application frame, which is available after initialize() has been called. |
|
Bookmark |
getBookmark()
Reports the current bookmark relative to the current navigation path. |
|
java.lang.Boolean |
getBooleanResource(java.lang.String resourceKey)
Retrieves a Boolean resource from the resource bundle. |
|
java.lang.Boolean |
getBooleanResource(java.lang.String resourceKey,
java.lang.Boolean defaultValue)
Retrieves a Boolean resource from the resource bundle, using a specified default if no such resource is available. |
|
Breadcrumb |
getBreadcrumb(com.globalmentor.net.URIPath navigationPath)
Retrieves a breadcrumb for a particular navigation path. |
|
java.util.List<Breadcrumb> |
getBreadcrumbs(com.globalmentor.net.URIPath navigationPath)
Retrieves breadcrumbs for all the segments of a particular navigation path. |
|
java.text.Collator |
getCollatorInstance()
Retrieves an instance of a collator appropriate for the current locale. |
|
Color |
getColorResource(java.lang.String resourceKey)
Retrieves a Color resource from the resource bundle. |
|
Color |
getColorResource(java.lang.String resourceKey,
Color defaultValue)
Retrieves a Color resource from the resource bundle, using a specified default if no such resource is available. |
|
|
getConfiguration(java.lang.Class<C> configurationClass)
Returns the configuration for the given configuration type. |
|
java.net.URI |
getDepictionRootURI()
Reports the current depiction root URI of the session. |
|
java.net.URI |
getDepictionURI(com.globalmentor.net.URIPath navigationPath,
java.lang.String... suffixes)
Determines the URI to use for depiction based upon a navigation path. |
|
java.net.URI |
getDepictionURI(java.net.URI navigationURI,
java.lang.String... suffixes)
Determines the URI to use for depiction based upon a navigation URI. |
|
Component |
getDestinationComponent(ComponentDestination destination)
Retrieves the component bound to the given destination. |
|
InputStrategy |
getInputStrategy()
|
|
java.lang.Integer |
getIntegerResource(java.lang.String resourceKey)
Retrieves an Integer resource from the resource bundle. |
|
java.lang.Integer |
getIntegerResource(java.lang.String resourceKey,
java.lang.Integer defaultValue)
Retrieves an Integer resource from the resource bundle, using a specified default if no such resource is available. |
|
java.util.Locale |
getLocale()
|
|
java.io.Writer |
getLogWriter()
|
|
ModalNavigation |
getModalNavigation()
|
|
Component |
getNavigationComponent(com.globalmentor.net.URIPath path)
Retrieves the component bound to the given application context-relative path. |
|
com.globalmentor.net.URIPath |
getNavigationPath()
Reports the navigation path relative to the application context path. |
|
Orientation |
getOrientation()
|
|
Platform |
getPlatform()
|
|
com.globalmentor.urf.URFResource |
getPreferences(java.lang.Class<?> objectClass)
Retrieves the saved preference properties for a given class. |
|
java.security.Principal |
getPrincipal()
|
|
Navigation |
getRequestedNavigation()
|
|
|
getResource(java.lang.String resourceKey)
Retrieves an object resource from the resource bundle. |
|
|
getResource(java.lang.String resourceKey,
T defaultValue)
Retrieves an object resource from the resource bundle, using a specified default if no such resource is available. |
|
java.util.ResourceBundle |
getResourceBundle()
Retrieves a resource bundle to be used by this session. |
|
java.lang.String |
getStringResource(java.lang.String resourceKey)
Retrieves a string resource from the resource bundle. |
|
java.lang.String |
getStringResource(java.lang.String resourceKey,
java.lang.String defaultValue)
Retrieves a string resource from the resource bundle, using a specified default if no such resource is available. |
|
Theme |
getTheme()
Returns the current session theme. |
|
java.net.URI |
getThemeURI()
|
|
java.util.TimeZone |
getTimeZone()
|
|
java.net.URI |
getURIResource(java.lang.String resourceKey)
Retrieves a URI resource from the resource bundle. |
|
java.net.URI |
getURIResource(java.lang.String resourceKey,
java.net.URI defaultValue)
Retrieves a URI resource from the resource bundle, using a specified default if no such resource is available. |
|
java.util.UUID |
getUUID()
|
|
void |
initialize()
Called when the session is initialized. |
|
void |
initializeComponent(Component component)
Initializes a component, optionally with a description in a TURF resource file. |
|
void |
initializeComponent(Component component,
java.io.InputStream descriptionInputStream)
Initializes a component from the contents of an URF description input stream. |
|
void |
initializeComponentFromResource(Component component,
java.lang.String resourceKey)
Initializes a component with a description in an TURF resource file. |
|
boolean |
input(Input input)
Processes input such as a keystroke, a mouse click, or a command. |
|
boolean |
isModalNavigation()
|
|
void |
log(InformationLevel level,
java.lang.String subject,
java.lang.String predicate,
java.lang.String object,
java.util.Map<?,?> parameters,
java.lang.CharSequence comment)
Logs the given session-related information. |
|
void |
log(java.lang.String subject,
java.lang.String predicate,
java.lang.String object,
java.util.Map<?,?> parameters,
java.lang.CharSequence comment)
Logs the given session-related information with a default log level of InformationLevel.LOG. |
|
void |
navigate(java.net.URI uri)
Requests navigation to the specified URI. |
|
void |
navigate(com.globalmentor.net.URIPath path)
Requests navigation to the specified path. |
|
void |
navigate(com.globalmentor.net.URIPath path,
Bookmark bookmark)
Requests navigation to the specified path and bookmark. |
|
void |
navigate(com.globalmentor.net.URIPath path,
Bookmark bookmark,
java.lang.String viewportID)
Requests navigation to the specified path and bookmark in an identified viewport. |
|
void |
navigate(com.globalmentor.net.URIPath path,
java.lang.String viewportID)
Requests navigation to the specified path in an identified viewport. |
|
void |
navigate(java.net.URI uri,
java.lang.String viewportID)
Requests navigation to the specified URI in an identified viewport. |
|
void |
navigateModal(java.net.URI uri,
ModalNavigationListener modalListener)
Requests modal navigation to the specified URI. |
|
void |
navigateModal(com.globalmentor.net.URIPath path,
Bookmark bookmark,
ModalNavigationListener modalListener)
Requests modal navigation to the specified path and bookmark. |
|
void |
navigateModal(com.globalmentor.net.URIPath path,
ModalNavigationListener modalListener)
Requests modal navigation to the specified path. |
|
void |
notify(Notification... notifications)
Notifies the user of one or more notifications to be presented in sequence. |
|
protected void |
notify(Notification notification,
java.lang.Runnable afterNotify)
Notifies the user of the given notification information, with optional logic to be executed after notification takes place. |
|
void |
notify(java.lang.Runnable afterNotify,
Notification... notifications)
Notifies the user of one or more notifications to be presented in sequence, with optional logic to be executed after all notifications have taken place. |
|
void |
notify(java.lang.Runnable afterNotify,
java.lang.Throwable... errors)
Notifies the user of the given error in sequence, with optional logic to be executed after notification takes place. |
|
void |
notify(java.lang.Throwable... errors)
Notifies the user of the given errors in sequence. |
|
protected ModalNavigation |
peekModalNavigation()
|
|
protected ModalNavigation |
pollModalNavigation()
|
|
protected ModalNavigation |
popModalNavigation()
|
|
protected void |
pushModalNavigation(ModalNavigation modalNavigation)
Pushes the given model navigation onto the top of the stack. |
|
Component |
releaseDestinationComponent(ComponentDestination destination)
Releases the component bound to the given destination. |
|
protected void |
releaseResourceBundle()
Unloads the current resource bundle so that the next call to getResourceBundle() will load the resource bundle anew. |
|
protected
|
removeConfiguration(java.lang.Class<C> configurationClass)
Removes a configuration of the given type. |
|
java.util.Locale |
requestLocale(java.util.List<java.util.Locale> requestedLocales)
Requests that the locale be changed to one of the given locales. |
|
java.net.URI |
resolveURI(java.net.URI uri,
java.lang.String... suffixes)
Resolves a URI against the application base path, looking up the URI from the resources if necessary. |
|
void |
setBookmark(Bookmark bookmark)
Changes the bookmark of the current navigation path. |
|
protected
|
setConfiguration(C configuration)
Sets the given configuration, associating it with its class. |
|
protected
|
setConfiguration(java.lang.Class<C> configurationClass,
C configuration)
Sets the given configuration. |
|
protected void |
setConfigurations(com.globalmentor.config.Configuration... configurations)
Sets the given configurations, associating them with their respective classes. |
|
void |
setDepictionRootURI(java.net.URI depictionBaseURI)
Sets the depiction root URI of the session. |
|
void |
setInputStrategy(InputStrategy newInputStrategy)
Sets the strategy for processing input. |
|
void |
setLocale(java.util.Locale newLocale)
Sets the current session locale. |
|
void |
setLogWriter(java.io.Writer logWriter)
Sets the log writer. |
|
void |
setNavigation(com.globalmentor.net.URIPath navigationPath,
Bookmark bookmark,
java.net.URI referrerURI)
Sets the new navigation path and bookmark, firing a navigation event if appropriate. |
|
void |
setNavigationPath(com.globalmentor.net.URIPath navigationPath)
Changes the navigation path of the session. |
|
void |
setOrientation(Orientation newOrientation)
Sets the default orientation. |
|
void |
setPreferences(java.lang.Class<?> objectClass,
com.globalmentor.urf.URFResource preferences)
Saves preference properties for a given class. |
|
void |
setPrincipal(java.security.Principal newPrincipal)
Sets the current principal (e.g. |
|
void |
setThemeURI(java.net.URI newThemeURI)
Sets the URI of the session theme. |
|
void |
setTimeZone(java.util.TimeZone newTimeZone)
Sets the current session time zone. |
|
| Methods inherited from class com.globalmentor.beans.BoundPropertyObject |
|---|
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, createPostponedPropertyChangeEvent, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, getForwardPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyChangeSupport, getRepeatPropertyChangeListener, getRepeatVetoableChangeListener, getVetoableChangeListeners, getVetoableChangeListeners, getVetoableChangeSupport, hasPropertyChangeListeners, hasVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.globalmentor.beans.PropertyBindable |
|---|
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, hasPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener |
| Constructor Detail |
|---|
public AbstractGuiseSession(GuiseApplication application,
Platform platform)
application - The Guise application to which this session belongs.platform - The platform on which this session's objects are depicted.
java.lang.NullPointerException - if the given application and/or platform is null.| Method Detail |
|---|
protected void setConfigurations(com.globalmentor.config.Configuration... configurations)
configurations - The configurations to set.protected <C extends com.globalmentor.config.Configuration> C setConfiguration(C configuration)
C - The type of configuration being set.configuration - The configuration to set.
null if there was no previous configuration for that class.
java.lang.NullPointerException - if the given configuration is null.
protected <C extends com.globalmentor.config.Configuration> C setConfiguration(java.lang.Class<C> configurationClass,
C configuration)
C - The type of configuration being set.configurationClass - The class with which to associate the configuration.configuration - The configuration to set.
null if there was no previous configuration for that class.public <C extends com.globalmentor.config.Configuration> C getConfiguration(java.lang.Class<C> configurationClass)
getConfiguration in interface com.globalmentor.config.ConfigurationManagedC - The type of configuration to retrieve.configurationClass - The class of configuration to retrieve.
null if there was no configuration for that class.protected <C extends com.globalmentor.config.Configuration> C removeConfiguration(java.lang.Class<C> configurationClass)
C - The type of configuration being removed.configurationClass - The class with which the configuration is associated.
null if there was no previous configuration for that class.public java.util.UUID getUUID()
getUUID in interface GuiseSessionpublic GuiseApplication getApplication()
getApplication in interface GuiseSessionpublic java.io.Writer getLogWriter()
getLogWriter in interface GuiseSessionpublic void setLogWriter(java.io.Writer logWriter)
setLogWriter in interface GuiseSessionlogWriter - The writer for writing to the log file, which may not be thread-safe.
java.lang.NullPointerException - if the given log writer is null.public java.net.URI getDepictionRootURI()
getDepictionRootURI in interface GuiseSessionpublic void setDepictionRootURI(java.net.URI depictionBaseURI)
setDepictionRootURI in interface GuiseSessiondepictionBaseURI - The new depiction root URI of the session.
public final java.net.URI getDepictionURI(com.globalmentor.net.URIPath navigationPath,
java.lang.String... suffixes)
This implementation delegates to getDepictionURI(URI, String...).
getDepictionURI in interface GuiseSessionnavigationPath - The navigation path, which may be absolute or relative to the application.suffixes - The suffixes, if any, to append to a resource key in a URI reference.
GuiseSession.dereferenceURI(URI, String...),
GuiseSession.getDepictionRootURI(),
GuiseApplication.getDepictionURI(URI, URIPath)
public java.net.URI getDepictionURI(java.net.URI navigationURI,
java.lang.String... suffixes)
getDepictionURI in interface GuiseSessionnavigationURI - The navigation URI, which may be absolute or relative to the application.suffixes - The suffixes, if any, to append to a resource key in a URI reference.
dereferenceURI(URI, String...),
GuiseApplication.getDepictionURI(URI, URI)public ApplicationFrame getApplicationFrame()
initialize() has been called.
This method must not be called before initialization has occurred.
getApplicationFrame in interface GuiseSessionjava.lang.IllegalStateException - if this session has not yet been initialized.
public com.globalmentor.urf.URFResource getPreferences(java.lang.Class<?> objectClass)
throws java.io.IOException
getPreferences in interface GuiseSessionobjectClass - The class for which preference properties should be returned.
java.lang.NullPointerException - if the given class is null.
java.io.IOException - if there was an error retrieving preferences.
public void setPreferences(java.lang.Class<?> objectClass,
com.globalmentor.urf.URFResource preferences)
throws java.io.IOException
setPreferences in interface GuiseSessionobjectClass - The class for which preference properties should be saved.preferences - The preferences to save for the given class.
java.lang.NullPointerException - if the given class and/or preferences is null.
java.io.IOException - if there was an error storing preferences.public Platform getPlatform()
getPlatform in interface GuiseSessionpublic InputStrategy getInputStrategy()
getInputStrategy in interface GuiseSessionnull if this session has no input strategy.public void setInputStrategy(InputStrategy newInputStrategy)
setInputStrategy in interface GuiseSessionnewInputStrategy - The new strategy for processing input, or null if this session is to have no input strategy.GuiseSession.INPUT_STRATEGY_PROPERTYpublic java.util.TimeZone getTimeZone()
getTimeZone in interface GuiseSessionpublic void setTimeZone(java.util.TimeZone newTimeZone)
setTimeZone in interface GuiseSessionnewTimeZone - The new session time zone.
java.lang.NullPointerException - if the given time zone is null.GuiseSession.TIME_ZONE_PROPERTYpublic java.util.Locale getLocale()
getLocale in interface GuiseSessionpublic void setLocale(java.util.Locale newLocale)
setLocale in interface GuiseSessionnewLocale - The new session locale.
java.lang.NullPointerException - if the given locale is null.GuiseSession.LOCALE_PROPERTY,
setOrientation(Orientation)public java.util.Locale requestLocale(java.util.List<java.util.Locale> requestedLocales)
en-US is accepted if en is supported.)
requestLocale in interface GuiseSessionrequestedLocales - The locales requested, in order of preference.
null if none of the given locales are supported by the application.GuiseApplication#getSupportedLocales(),
setLocale(Locale)public Orientation getOrientation()
getOrientation in interface GuiseSessionpublic void setOrientation(Orientation newOrientation)
setOrientation in interface GuiseSessionnewOrientation - The new default internationalization orientation of components for this session.
java.lang.NullPointerException - if the given orientation is null.GuiseSession.ORIENTATION_PROPERTY
public java.util.ResourceBundle getResourceBundle()
throws java.util.MissingResourceException
getXXXResource() should be used in preference to using this method directly.
If this session does not yet have a resource bundle, one will be created based upon the current theme and locale.
The returned resource bundle should only be used temporarily and should not be saved,
as the resource bundle may change if the session locale or the application resource bundle base name changes.
The resource bundle retrieved will allow hierarchical resolution in the following priority:
getResourceBundle in interface GuiseSessionjava.util.MissingResourceException - if no resource bundle for the application's specified base name can be found or there was an error loading a resource bundle.GuiseApplication.loadResourceBundle(Theme, Locale),
getTheme(),
getLocale(),
getStringResource(String),
getStringResource(String, String),
getBooleanResource(String),
getBooleanResource(String, Boolean),
getIntegerResource(String),
getIntegerResource(String, Integer),
getURIResource(String),
getURIResource(String, URI)protected void releaseResourceBundle()
getResourceBundle() will load the resource bundle anew.
This method also releases the current collator.
public <T> T getResource(java.lang.String resourceKey)
throws java.util.MissingResourceException
getResource in interface GuiseSessionresourceKey - The key of the resource to retrieve.
java.lang.NullPointerException - if the provided resource key is null.
java.util.MissingResourceException - if no resource could be found associated with the given key.getResourceBundle(),
getResource(String, Object)
public <T> T getResource(java.lang.String resourceKey,
T defaultValue)
throws java.util.MissingResourceException
getResource in interface GuiseSessionresourceKey - The key of the resource to retrieve.defaultValue - The default value to use if there is no resource associated with the given key.
java.lang.NullPointerException - if the provided resource key is null.
java.util.MissingResourceExceptiongetResourceBundle(),
getResource(String)
public java.lang.String getStringResource(java.lang.String resourceKey)
throws java.util.MissingResourceException
getStringResource in interface GuiseSessionresourceKey - The key of the resource to retrieve, or a relative path to the resource in the application's resource area.
java.lang.NullPointerException - if the provided resource key is null.
java.util.MissingResourceException - if no resource could be found associated with the given key.
java.lang.ClassCastException - if the resource associated with the given key is not an instance of String.getResourceBundle(),
getStringResource(String, String)
public java.lang.String getStringResource(java.lang.String resourceKey,
java.lang.String defaultValue)
throws java.util.MissingResourceException
getStringResource in interface GuiseSessionresourceKey - The key of the resource to retrieve, or a relative path to the resource in the application's resource area.defaultValue - The default value to use if there is no resource associated with the given key.
java.lang.NullPointerException - if the provided resource key is null.
java.lang.ClassCastException - if the resource associated with the given key is not an instance of String.
java.util.MissingResourceExceptiongetResourceBundle(),
getStringResource(String)
public java.lang.Boolean getBooleanResource(java.lang.String resourceKey)
throws java.util.MissingResourceException
Boolean resource from the resource bundle.
If the given resource is a string, it will be interpreted according to the Boolean.valueOf(java.lang.String) rules.
This is a preferred convenience method for accessing the resources in the session's resource bundle.
getBooleanResource in interface GuiseSessionresourceKey - The key of the resource to retrieve.
java.lang.NullPointerException - if the provided resource key is null.
java.util.MissingResourceException - if no resource could be found associated with the given key.
java.lang.ClassCastException - if the resource associated with the given key is not an instance of String or Boolean.getResourceBundle(),
getBooleanResource(String, Boolean)
public java.lang.Boolean getBooleanResource(java.lang.String resourceKey,
java.lang.Boolean defaultValue)
throws java.util.MissingResourceException
Boolean resource from the resource bundle, using a specified default if no such resource is available.
If the given resource is a string, it will be interpreted according to the Boolean.valueOf(java.lang.String) rules.
This is a preferred convenience method for accessing the resources in the session's resource bundle.
getBooleanResource in interface GuiseSessionresourceKey - The key of the resource to retrieve.defaultValue - The default value to use if there is no resource associated with the given key.
java.lang.NullPointerException - if the provided resource key is null.
java.lang.ClassCastException - if the resource associated with the given key is not an instance of String or Boolean.
java.util.MissingResourceExceptiongetResourceBundle(),
getBooleanResource(String)
public Color getColorResource(java.lang.String resourceKey)
throws java.util.MissingResourceException
Color resource from the resource bundle.
If the given resource is a string, it will be resolved and converted to a color using AbstractModeledColor.valueOf(CharSequence).
This is a preferred convenience method for accessing the resources in the session's resource bundle.
getColorResource in interface GuiseSessionresourceKey - The key of the resource to retrieve.
java.lang.NullPointerException - if the provided resource key is null.
java.util.MissingResourceException - if no resource could be found associated with the given key.
java.lang.ClassCastException - if the resource associated with the given key is not an instance of String or Color.
java.lang.IllegalArgumentException - if a string is provided that is not a valid color.getResourceBundle(),
getColorResource(String, Color),
AbstractModeledColor.valueOf(CharSequence)
public Color getColorResource(java.lang.String resourceKey,
Color defaultValue)
throws java.util.MissingResourceException
Color resource from the resource bundle, using a specified default if no such resource is available.
If the given resource is a string, it will be resolved and converted to a color using AbstractModeledColor.valueOf(CharSequence).
This is a preferred convenience method for accessing the resources in the session's resource bundle.
getColorResource in interface GuiseSessionresourceKey - The key of the resource to retrieve.defaultValue - The default value to use if there is no resource associated with the given key.
java.lang.NullPointerException - if the provided resource key is null.
java.lang.ClassCastException - if the resource associated with the given key is not an instance of String or Color.
java.util.MissingResourceExceptiongetResourceBundle(),
getColorResource(String),
AbstractModeledColor.valueOf(CharSequence)
public java.lang.Integer getIntegerResource(java.lang.String resourceKey)
throws java.util.MissingResourceException
Integer resource from the resource bundle.
If the given resource is a string, it will be interpreted according to the Integer.valueOf(java.lang.String) rules.
This is a preferred convenience method for accessing the resources in the session's resource bundle.
getIntegerResource in interface GuiseSessionresourceKey - The key of the resource to retrieve.
java.lang.NullPointerException - if the provided resource key is null.
java.util.MissingResourceException - if no resource could be found associated with the given key.
java.lang.ClassCastException - if the resource associated with the given key is not an instance of String or Integer.
java.lang.NumberFormatException - if the resource key identifies a string that is not a valid integer.getResourceBundle(),
getIntegerResource(String, Integer)
public java.lang.Integer getIntegerResource(java.lang.String resourceKey,
java.lang.Integer defaultValue)
throws java.util.MissingResourceException
Integer resource from the resource bundle, using a specified default if no such resource is available.
If the given resource is a string, it will be interpreted according to the Integer.valueOf(java.lang.String) rules.
This is a preferred convenience method for accessing the resources in the session's resource bundle.
getIntegerResource in interface GuiseSessionresourceKey - The key of the resource to retrieve.defaultValue - The default value to use if there is no resource associated with the given key.
java.lang.NullPointerException - if the provided resource key is null.
java.lang.ClassCastException - if the resource associated with the given key is not an instance of String or Integer.
java.util.MissingResourceExceptiongetResourceBundle(),
getIntegerResource(String)
public java.net.URI getURIResource(java.lang.String resourceKey)
throws java.util.MissingResourceException
URI resource from the resource bundle.
If the given resource is a string, it will be converted to a URI.
This is a preferred convenience method for accessing the resources in the session's resource bundle.
getURIResource in interface GuiseSessionresourceKey - The key of the resource to retrieve.
java.lang.NullPointerException - if the provided resource key is null.
java.util.MissingResourceException - if no resource could be found associated with the given key.
java.lang.ClassCastException - if the resource associated with the given key is not an instance of String or URI.
java.lang.IllegalArgumentException - if a string is provided that is not a valid URI.getResourceBundle(),
getURIResource(String, URI)
public java.net.URI getURIResource(java.lang.String resourceKey,
java.net.URI defaultValue)
throws java.util.MissingResourceException
URI resource from the resource bundle, using a specified default if no such resource is available.
If the given resource is a string, it will be converted to a URI.
This is a preferred convenience method for accessing the resources in the session's resource bundle.
getURIResource in interface GuiseSessionresourceKey - The key of the resource to retrieve.defaultValue - The default value to use if there is no resource associated with the given key.
java.lang.NullPointerException - if the provided resource key is null.
java.lang.ClassCastException - if the resource associated with the given key is not an instance of String or URI.
java.util.MissingResourceExceptiongetResourceBundle(),
getURIResource(String)public java.text.Collator getCollatorInstance()
getCollatorInstance in interface com.globalmentor.text.CollatorFactorygetCollatorInstance in interface GuiseSessiongetLocale()public java.security.Principal getPrincipal()
getPrincipal in interface GuiseSessionnull if there is no principal authenticated for this session.public void setPrincipal(java.security.Principal newPrincipal)
setPrincipal in interface GuiseSessionnewPrincipal - The new principal, or null if there should be no associated principal (e.g. the user should be logged off).GuiseSession.PRINCIPAL_PROPERTY
public Theme getTheme()
throws java.io.IOException
getTheme in interface GuiseSessionjava.io.IOException - if there is an error loading the theme.getThemeURI()public java.net.URI getThemeURI()
getThemeURI in interface GuiseSessionpublic void setThemeURI(java.net.URI newThemeURI)
getTheme() is called.
This is a bound property.
setThemeURI in interface GuiseSessionnewThemeURI - The URI of the new session theme.
java.lang.NullPointerException - if the given theme URI is null.GuiseSession.THEME_URI_PROPERTY,
getTheme()public ActionPrototype getAboutApplicationActionPrototype()
getAboutApplicationActionPrototype in interface GuiseSessionpublic Component getDestinationComponent(ComponentDestination destination)
destinationComponentMap.
getDestinationComponent in interface GuiseSessiondestination - The destination for which a component should be returned.
java.lang.NullPointerException - if the destination is null.
java.lang.IllegalStateException - if the component class bound to the destination does not provide appropriate constructors, is an interface, is abstract, or throws an exception during instantiation.public Component releaseDestinationComponent(ComponentDestination destination)
releaseDestinationComponent in interface GuiseSessiondestination - The destination for which any bound component should be released.
null if no component was bound to the given destination.
java.lang.NullPointerException - if the destination is null.public Component getNavigationComponent(com.globalmentor.net.URIPath path)
GuiseApplication#getDestination(String).
This method calls getDestinationComponent(ComponentDestination).
getNavigationComponent in interface GuiseSessionpath - The application context-relative path within the Guise container context.
java.lang.NullPointerException - if the path is null.
java.lang.IllegalArgumentException - if the provided path is absolute.
java.lang.IllegalArgumentException - if no component is appropriate to associated the given navigation path (i.e. the given navigation path is not associated with a component destination).
java.lang.IllegalStateException - if the component class bound to the path does not provide appropriate constructors, is an interface, is abstract, or throws an exception during instantiation.ComponentDestinationprotected Component createComponent(java.lang.Class<? extends Component> componentClass)
componentClass - The class representing the component to create.
java.lang.IllegalStateException - if the component class does not provide a default constructor, is an interface, is abstract, or throws an exception during instantiation.public void initializeComponent(Component component)
.turf extension.
That is, for the class MyComponent.class this method first tries to load MyComponent.turf from the same directory in the classpath.
If this is successful, the component is initialized from this URF description.
This implementation calls initializeComponent(Component, InputStream).
The component's Component.initialize() is called whether there is an URF description.
This method synchronizes on #getDocumentBuilder().
initializeComponent in interface GuiseSessioncomponent - The component to initialize.
java.util.MissingResourceException - if no resource could be found associated with the given key.
java.lang.IllegalArgumentException - if the URF description does not provide a resource description of the same type as the specified component.
java.lang.IllegalStateException - if the given component has already been initialized, or there was some other problem initializing the component.Component.initialize(),
PLOOP
public void initializeComponentFromResource(Component component,
java.lang.String resourceKey)
throws com.globalmentor.util.DataException,
java.lang.reflect.InvocationTargetException
Component.initialize() after initializing the component from the description.
This implementation calls initializeComponent(Component, InputStream).
This method synchronizes on #getDocumentBuilder().
initializeComponentFromResource in interface GuiseSessioncomponent - The component to initialize.resourceKey - The key to a TURF description resource file.
java.util.MissingResourceException - if no resource could be found associated with the given key.
java.lang.IllegalArgumentException - if the URF description does not provide a resource description of the same type as the specified component.
java.lang.IllegalStateException - if the given component has already been initialized.
com.globalmentor.util.DataException - if the data was incorrect for component initialization.
java.lang.reflect.InvocationTargetException - if a given resource indicates a Java class the constructor of which throws an exception.Component.initialize()
public void initializeComponent(Component component,
java.io.InputStream descriptionInputStream)
throws java.io.IOException,
com.globalmentor.util.DataException,
java.lang.reflect.InvocationTargetException
Component.initialize() after initializing the component from the description.
This method synchronizes on #getDocumentBuilder().
initializeComponent in interface GuiseSessioncomponent - The component to initialize.descriptionInputStream - The input stream containing an URF description.
java.lang.IllegalArgumentException - if the URF description does not provide a resource description of the same type as the specified component.
java.lang.IllegalStateException - if the given component has already been initialized.
java.io.IOException - if there is an error reading from the input stream.
com.globalmentor.util.DataException - if the data was incorrect for component initialization.
java.lang.reflect.InvocationTargetException - if a given resource indicates a Java class the constructor of which throws an exception.Component.initialize()protected void pushModalNavigation(ModalNavigation modalNavigation)
modalNavigation - The modal navigation to add.
java.lang.NullPointerException - if the given modal navigation is null.protected ModalNavigation peekModalNavigation()
null if there are no modal navigations.protected ModalNavigation pollModalNavigation()
null if there are no modal navigations on the stack.protected ModalNavigation popModalNavigation()
java.util.NoSuchElementException - if there are no modal navigations on the stack.public boolean isModalNavigation()
isModalNavigation in interface GuiseSessionpublic ModalNavigation getModalNavigation()
getModalNavigation in interface GuiseSessionnull if there are no modal navigations.
public void beginModalNavigation(ModalNavigationPanel<?> modalNavigationPanel,
ModalNavigation modalNavigation)
beginModalNavigation in interface GuiseSessionmodalNavigationPanel - The panel for which modal navigation state should begin.modalNavigation - The state of modal navigation.pushModalNavigation(ModalNavigation)public boolean endModalNavigation(ModalNavigationPanel<?> modalNavigationPanel)
endModalNavigation in interface GuiseSessionmodalNavigationPanel - The panel for which modal navigation state should be ended.
popModalNavigation(),
Frame#getReferrerURI(),
#releaseDestinationComponent(String)public com.globalmentor.net.URIPath getNavigationPath()
getNavigationPath in interface GuiseSessionjava.lang.IllegalStateException - if this message has been called before the navigation path has been initialized.public void setNavigationPath(com.globalmentor.net.URIPath navigationPath)
setNavigationPath in interface GuiseSessionnavigationPath - The navigation path relative to the application context path.
java.lang.NullPointerException - if the given navigation path is null.
java.lang.IllegalArgumentException - if the provided path is absolute.
java.lang.IllegalArgumentException - if the navigation path is not recognized (e.g. there is no destination associated with the navigation path).navigate(URIPath),
navigate(URI),
navigateModal(URIPath, ModalNavigationListener),
navigateModal(URI, ModalNavigationListener)public Bookmark getBookmark()
getBookmark in interface GuiseSessionnull if there is no bookmark specified.public void setBookmark(Bookmark bookmark)
setBookmark in interface GuiseSessionbookmark - The bookmark relative to the current navigation path, or null if there should be no bookmark.
public void setNavigation(com.globalmentor.net.URIPath navigationPath,
Bookmark bookmark,
java.net.URI referrerURI)
NavigationListeners in the component hierarchy, with the session as the source of the NavigationEvent.
This method calls setNavigationPath(URIPath) and setBookmark(Bookmark).
This implementation logs the navigation change.
setNavigation in interface GuiseSessionnavigationPath - The navigation path relative to the application context path.bookmark - The bookmark for which navigation should occur at this navigation path, or null if there is no bookmark involved in navigation.referrerURI - The URI of the referring navigation panel or other entity with no query or fragment, or null if no referring URI is known.
java.lang.NullPointerException - if the given navigation path is null.setNavigationPath(URIPath),
setBookmark(Bookmark),
getApplicationFrame()public void fireNavigated(java.net.URI referrerURI)
NavigationEvent to all NavigationListeners in the session application frame hierarchy.
fireNavigated in interface GuiseSessionreferrerURI - The URI of the referring navigation panel or other entity with no query or fragment, or null if no referring URI is known.getNavigationPath(),
getBookmark(),
getApplicationFrame(),
NavigationListener,
NavigationEvent
protected void fireNavigated(Component component,
NavigationEvent navigationEvent)
NavigationEvent to all NavigationListeners in the given component hierarchy.
component - The component to which the navigation event should be fired, along with all children, if the component or any children implement NavigationListener.navigationEvent - The navigation event to fire.NavigationListener,
NavigationEventpublic Navigation getRequestedNavigation()
getRequestedNavigation in interface GuiseSessionnull if no navigation has been requested.public void clearRequestedNavigation()
clearRequestedNavigation in interface GuiseSessionpublic void navigate(com.globalmentor.net.URIPath path)
navigate in interface GuiseSessionpath - A path that is either relative to the application context path or is absolute.
java.lang.NullPointerException - if the given path is null.navigate(URI)
public void navigate(com.globalmentor.net.URIPath path,
java.lang.String viewportID)
navigate in interface GuiseSessionpath - A path that is either relative to the application context path or is absolute.viewportID - The ID of the viewport in which navigation should occur, or null if navigation should occur in the current viewport.
java.lang.NullPointerException - if the given path is null.navigate(URI, String)
public void navigate(com.globalmentor.net.URIPath path,
Bookmark bookmark)
navigate in interface GuiseSessionpath - A path that is either relative to the application context path or is absolute.bookmark - The bookmark at the given path, or null if no bookmark should be included in the navigation.
java.lang.NullPointerException - if the given path is null.navigate(URI)
public void navigate(com.globalmentor.net.URIPath path,
Bookmark bookmark,
java.lang.String viewportID)
navigate in interface GuiseSessionpath - A path that is either relative to the application context path or is absolute.bookmark - The bookmark at the given path, or null if no bookmark should be included in the navigation.viewportID - The ID of the viewport in which navigation should occur, or null if navigation should occur in the current viewport.
java.lang.NullPointerException - if the given path is null.navigate(URI, String)public void navigate(java.net.URI uri)
navigate in interface GuiseSessionuri - Either a relative or absolute path, or an absolute URI.
java.lang.NullPointerException - if the given URI is null.
public void navigate(java.net.URI uri,
java.lang.String viewportID)
navigate in interface GuiseSessionuri - Either a relative or absolute path, or an absolute URI.viewportID - The ID of the viewport in which navigation should occur, or null if navigation should occur in the current viewport.
java.lang.NullPointerException - if the given URI is null.
public void navigateModal(com.globalmentor.net.URIPath path,
ModalNavigationListener modalListener)
navigateModal in interface GuiseSessionpath - A path that is either relative to the application context path or is absolute.modalListener - The listener to respond to the end of modal interaction.
java.lang.NullPointerException - if the given path is null.navigateModal(URI, ModalNavigationListener)
public void navigateModal(com.globalmentor.net.URIPath path,
Bookmark bookmark,
ModalNavigationListener modalListener)
navigateModal in interface GuiseSessionpath - A path that is either relative to the application context path or is absolute.bookmark - The bookmark at the given path, or null if no bookmark should be included in the navigation.modalListener - The listener to respond to the end of modal interaction.
java.lang.NullPointerException - if the given path is null.navigateModal(URI, ModalNavigationListener)
public void navigateModal(java.net.URI uri,
ModalNavigationListener modalListener)
navigateModal in interface GuiseSessionuri - Either a relative or absolute path, or an absolute URI.modalListener - The listener to respond to the end of modal interaction.
java.lang.NullPointerException - if the given URI is null.public Breadcrumb getBreadcrumb(com.globalmentor.net.URIPath navigationPath)
getBreadcrumb in interface GuiseSessionnavigationPath - The navigation path which a breadcrumb should be returned.
java.lang.NullPointerException - if the given navigation path is null.getDepictionURI(URIPath, String...)public java.util.List<Breadcrumb> getBreadcrumbs(com.globalmentor.net.URIPath navigationPath)
getBreadcrumb(URIPath) to create each segment breadcrumb.
getBreadcrumbs in interface GuiseSessionnavigationPath - The navigation path which breadcrumbs should be returned.
java.lang.NullPointerException - if the given navigation path is null.public void initialize()
initialize in interface GuiseSessionjava.lang.IllegalStateException - if the session is already initialized.destroy()public void destroy()
destroy in interface GuiseSessionjava.lang.IllegalStateException - if the session has not yet been initialized or has already been destroyed.initialize()
public com.globalmentor.net.URIPath createTempPublicResource(java.lang.String baseName,
java.lang.String extension)
throws java.io.IOException
GuiseApplication.createTempAsset(String, String, GuiseSession).
createTempPublicResource in interface GuiseSessionbaseName - The base filename to be used in generating the filename.extension - The extension to use for the temporary file.
java.lang.NullPointerException - if the given base name and/or extension is null.
java.lang.IllegalArgumentException - if the base name is the empty string.
java.io.IOException - if there is a problem creating the public resource.GuiseApplication.createTempAsset(String, String, GuiseSession),
GuiseApplication.getTempDirectory()public Component createBusyComponent()
createBusyComponent in interface GuiseSessionTheme.GLYPH_BUSYpublic boolean input(Input input)
InputEvent will be created and dispatched via the application frame.
If an input event is still not consumed after dispatching, its input is processed by the installed input strategy, if any.
input in interface GuiseSessioninput - The input to process.
true if the input was consumed and should not be processed further.
java.lang.NullPointerException - if the given input is null.
java.lang.IllegalArgumentException - if input was given that this session does not know how to process.createInputEvent(Input),
GuiseSession.getApplicationFrame(),
Component.dispatchInputEvent(InputEvent),
getInputStrategy(),
InputStrategy.input(Input),
InputEvent.isConsumed()protected InputEvent createInputEvent(Input input)
input - The input to process.
java.lang.NullPointerException - if the given input is null.
java.lang.IllegalArgumentException - if an unknown input type was given.CommandInput,
KeystrokeInput,
MouseClickInput
public void log(java.lang.String subject,
java.lang.String predicate,
java.lang.String object,
java.util.Map<?,?> parameters,
java.lang.CharSequence comment)
InformationLevel.LOG.
This is a convenience method that delegates to log(InformationLevel, String, String, String, Map, CharSequence).
log in interface GuiseSessionsubject - The log subject identification, or null if there is no related subject.predicate - The log predicate identification, or null if there is no related predicate.object - The log object identification, or null if there is no related object.parameters - The map of log parameters, or null if there are no parameters.comment - The log comment, or null if there is no log comment.
java.lang.NullPointerException - if the given log level is null.
public void log(InformationLevel level,
java.lang.String subject,
java.lang.String predicate,
java.lang.String object,
java.util.Map<?,?> parameters,
java.lang.CharSequence comment)
log in interface GuiseSessionlevel - The log information level.subject - The log subject identification, or null if there is no related subject.predicate - The log predicate identification, or null if there is no related predicate.object - The log object identification, or null if there is no related object.parameters - The map of log parameters, or null if there are no parameters.comment - The log comment, or null if there is no log comment.
java.lang.NullPointerException - if the given log level is null.public void notify(Notification... notifications)
notify(Runnable, Notification...).
notify in interface GuiseSessionnotifications - One or more notification informations to relay.
java.lang.NullPointerException - if the given notifications is null.
java.lang.IllegalArgumentException - if no notifications are given.
public void notify(java.lang.Runnable afterNotify,
Notification... notifications)
notify(Notification, Runnable).
notify in interface GuiseSessionnotifications - One or more notification informations to relay.afterNotify - The code that executes after notification has taken place, or null if no action should be taken after notification.
java.lang.NullPointerException - if the given notifications is null.
java.lang.IllegalArgumentException - if no notifications are given.
protected void notify(Notification notification,
java.lang.Runnable afterNotify)
notification - The notification information to relay.afterNotify - The code that executes after notification has taken place, or null if no action should be taken after notification.public void notify(java.lang.Throwable... errors)
notify(Runnable, Throwable...).
notify in interface GuiseSessionerrors - The errors with which to notify the user.
java.lang.NullPointerException - if the given errors is null.
java.lang.IllegalArgumentException - if no errors are given.
public void notify(java.lang.Runnable afterNotify,
java.lang.Throwable... errors)
notify(Runnable, Notification...).
notify in interface GuiseSessionerror - The error with which to notify the user.afterNotify - The code that executes after notification has taken place, or null if no action should be taken after notification.
java.lang.NullPointerException - if the given errors is null.
java.lang.IllegalArgumentException - if no errors are given.
public java.lang.String dereferenceString(java.lang.String string)
throws java.util.MissingResourceException
SOS) control character (U+0098) and ends with a String Terminator (ST) control character (U+009C).
The string between these delimiters will be used to look up a string resource using getStringResource(String).
Strings retrieved from resources will be recursively dereferenced.
String references appearing between an SOS/ST pair that that begin with the character
will be considered string values and, after they are recursively dereferenced, will be applied as formatting arguments to the remaining dereferenced text using MessageFormat.format(String, Object...).
dereferenceString in interface GuiseSessionstring - The string to be dereferenced.
java.lang.NullPointerException - if the given string is null.
java.lang.IllegalArgumentException - if a string reference has no ending String Terminator control character (U+009C).
java.util.MissingResourceException - if no resource could be found associated with a string reference.
java.lang.ClassCastException - if the resource associated with a string reference is not an instance of String.Resources.createStringResourceReference(String),
Resources.createStringValueReference(String),
getStringResource(String)
public java.net.URI dereferenceURI(java.net.URI uri,
java.lang.String... suffixes)
throws java.util.MissingResourceException
getURIResource(String).
If suffixes are given, they will be appended to the resource key in order, separated by '.'.
If no resource is associated with that resource key, a resource will be retrieved using the unadorned resource key.
URIs retrieved from resources will be recursively dereferenced without suffixes.
dereferenceURI in interface GuiseSessionuri - The URI to be dereferenced.suffixes - The suffixes, if any, to append to a resource key in a URI reference.
java.lang.NullPointerException - if the given URI is null.
java.util.MissingResourceException - if no resource could be found associated with a string reference.Resources.createURIResourceReference(String),
getURIResource(String)
public java.net.URI resolveURI(java.net.URI uri,
java.lang.String... suffixes)
throws java.util.MissingResourceException
resolveURI in interface GuiseSessionuri - The URI to be resolved.suffixes - The suffixes, if any, to append to a resource key in a URI reference.
java.lang.NullPointerException - if the given URI is null.
java.util.MissingResourceException - if no resource could be found associated with a string reference.dereferenceURI(URI, String...),
GuiseApplication.resolveURI(URI)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||