Class AbstractGuiseSession

  • All Implemented Interfaces:
    com.globalmentor.beans.PropertyBindable, com.globalmentor.beans.PropertyConstrainable, com.globalmentor.text.CollatorFactory, io.csar.Concerned, GuiseSession
    Direct Known Subclasses:
    DefaultGuiseSession

    public abstract class AbstractGuiseSession
    extends com.globalmentor.beans.BoundPropertyObject
    implements GuiseSession
    An abstract implementation that keeps track of the components of a user session.
    Author:
    Garret Wilson
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      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.
      <C extends io.csar.Concern>
      java.util.Optional<C>
      findConcern​(java.lang.Class<C> configurationClass)  
      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()  
      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()  
      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.
      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.
      java.util.Optional<io.urf.model.UrfResourceDescription> getNavigationDescription()
      Returns a description of the resource for the current navigation path and bookmark.
      java.util.Optional<io.urf.model.UrfResourceDescription> getNavigationDescription​(com.globalmentor.net.URIPath navigationPath, Bookmark bookmark)
      Returns a description of the resource for the given navigation path and bookmark.
      com.globalmentor.net.URIPath getNavigationPath()
      Reports the navigation path relative to the application context path.
      Orientation getOrientation()  
      Platform getPlatform()  
      java.security.Principal getPrincipal()  
      Navigation getRequestedNavigation()  
      <T> T getResource​(java.lang.String resourceKey)
      Retrieves an object resource from the resource bundle.
      <T> T 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 getSiteName()
      Determines the name of the site at the current navigation path.
      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 a 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​(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)
      Requests navigation to the specified URI.
      void navigate​(java.net.URI uri, java.lang.String viewportID)
      Requests navigation to the specified URI in an identified viewport.
      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 navigateModal​(java.net.URI uri, ModalNavigationListener modalListener)
      Requests modal navigation to the specified URI.
      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 <C extends io.csar.Concern>
      java.util.Optional<C>
      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 <C extends io.csar.Concern>
      java.util.Optional<C>
      setConfiguration​(C configuration)
      Sets the given configuration, associating it with its class.
      protected <C extends io.csar.Concern>
      java.util.Optional<C>
      setConfiguration​(java.lang.Class<C> configurationClass, C configuration)
      Sets the given configuration.
      protected void setConfigurations​(io.csar.Concern... 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 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

      • AbstractGuiseSession

        public AbstractGuiseSession​(GuiseApplication application,
                                    Platform platform)
        Application and platform constructor. The session local will initially be set to the locale of the associated Guise application. No operation must be performed inside the constructor that would require the presence of the Guise session within this thread group.
        Parameters:
        application - The Guise application to which this session belongs.
        platform - The platform on which this session's objects are depicted.
        Throws:
        java.lang.NullPointerException - if the given application and/or platform is null.
    • Method Detail

      • setConfigurations

        protected void setConfigurations​(io.csar.Concern... configurations)
        Sets the given configurations, associating them with their respective classes.
        Parameters:
        configurations - The configurations to set.
      • setConfiguration

        protected <C extends io.csar.Concern> java.util.Optional<C> setConfiguration​(C configuration)
        Sets the given configuration, associating it with its class.
        Type Parameters:
        C - The type of configuration being set.
        Parameters:
        configuration - The configuration to set.
        Returns:
        The configuration previously associated with the same class, if any.
        Throws:
        java.lang.NullPointerException - if the given configuration is null.
      • setConfiguration

        protected <C extends io.csar.Concern> java.util.Optional<C> setConfiguration​(java.lang.Class<C> configurationClass,
                                                                                     C configuration)
        Sets the given configuration.
        Type Parameters:
        C - The type of configuration being set.
        Parameters:
        configurationClass - The class with which to associate the configuration.
        configuration - The configuration to set.
        Returns:
        The configuration previously associated with the given class, if any.
      • findConcern

        public <C extends io.csar.Concern> java.util.Optional<C> findConcern​(java.lang.Class<C> configurationClass)
        Specified by:
        findConcern in interface io.csar.Concerned
      • removeConfiguration

        protected <C extends io.csar.Concern> java.util.Optional<C> removeConfiguration​(java.lang.Class<C> configurationClass)
        Removes a configuration of the given type. If no configuration is associated with the specified type, no action occurs.
        Type Parameters:
        C - The type of configuration being removed.
        Parameters:
        configurationClass - The class with which the configuration is associated.
        Returns:
        The configuration previously associated with the given class, if any.
      • getUUID

        public java.util.UUID getUUID()
        Specified by:
        getUUID in interface GuiseSession
        Returns:
        The unique identifier of this session.
      • getLogWriter

        public java.io.Writer getLogWriter()
        Specified by:
        getLogWriter in interface GuiseSession
        Returns:
        The writer for writing to the log file, which may not be thread-safe.
      • setLogWriter

        public void setLogWriter​(java.io.Writer logWriter)
        Description copied from interface: GuiseSession
        Sets the log writer.
        Specified by:
        setLogWriter in interface GuiseSession
        Parameters:
        logWriter - The writer for writing to the log file, which may not be thread-safe.
      • getDepictionRootURI

        public java.net.URI getDepictionRootURI()
        Description copied from interface: GuiseSession
        Reports the current depiction root URI of the session. The depiction root URI is an absolute plain root URI. The session depiction root URI may be different for different sessions, and may not be equal to the application navigation base path resolved to the container's base URI.
        Specified by:
        getDepictionRootURI in interface GuiseSession
        Returns:
        The depiction root URI currently representing the Guise session.
      • setDepictionRootURI

        public void setDepictionRootURI​(java.net.URI depictionBaseURI)
        Description copied from interface: GuiseSession
        Sets the depiction root URI of the session. The depiction root URI is an absolute plain root URI.
        Specified by:
        setDepictionRootURI in interface GuiseSession
        Parameters:
        depictionBaseURI - The new depiction root URI of the session.
      • getDepictionURI

        public final 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. The path will first be dereferenced for the current session and then resolved to the application base path. The resulting URI may not be absolute, but can be made absolute by resolving it against the depiction root URI.

        This implementation delegates to getDepictionURI(URI, String...).

        Specified by:
        getDepictionURI in interface GuiseSession
        Parameters:
        navigationPath - 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.
        Returns:
        A URI suitable for depiction, deferenced and resolved to the application base path.
        See Also:
        GuiseSession.dereferenceURI(URI, String...), GuiseSession.getDepictionRootURI(), GuiseApplication.getDepictionURI(URI, URIPath)
      • getDepictionURI

        public java.net.URI getDepictionURI​(java.net.URI navigationURI,
                                            java.lang.String... suffixes)
        Description copied from interface: GuiseSession
        Determines the URI to use for depiction based upon a navigation URI. The URI will first be dereferenced for the current session and then resolved to the application base path. The resulting URI may not be absolute, but can be made absolute by resolving it against the depiction root URI.
        Specified by:
        getDepictionURI in interface GuiseSession
        Parameters:
        navigationURI - The navigation URI, which may be absolute or have an absolute path or a path relative to the application.
        suffixes - The suffixes, if any, to append to a resource key in a URI reference.
        Returns:
        A URI suitable for depiction, dereferenced and resolved to the application base path.
        See Also:
        GuiseSession.dereferenceURI(URI, String...), GuiseSession.getDepictionRootURI(), GuiseApplication.getDepictionURI(URI, URI)
      • getPlatform

        public Platform getPlatform()
        Specified by:
        getPlatform in interface GuiseSession
        Returns:
        The platform on which Guise objects are depicted.
      • getTimeZone

        public java.util.TimeZone getTimeZone()
        Specified by:
        getTimeZone in interface GuiseSession
        Returns:
        The current session time zone.
      • setTimeZone

        public void setTimeZone​(java.util.TimeZone newTimeZone)
        Description copied from interface: GuiseSession
        Sets the current session time zone. This is a bound property.
        Specified by:
        setTimeZone in interface GuiseSession
        Parameters:
        newTimeZone - The new session time zone.
        See Also:
        GuiseSession.TIME_ZONE_PROPERTY
      • getLocale

        public java.util.Locale getLocale()
        Specified by:
        getLocale in interface GuiseSession
        Returns:
        The current session locale.
      • requestLocale

        public java.util.Locale requestLocale​(java.util.List<java.util.Locale> requestedLocales)
        Description copied from interface: GuiseSession
        Requests that the locale be changed to one of the given locales. Each of the locales in the list are examined in order, and the first one supported by the application is used. A requested locale is accepted if a more general locale is supported. (i.e. en-US is accepted if en is supported.)
        Specified by:
        requestLocale in interface GuiseSession
        Parameters:
        requestedLocales - The locales requested, in order of preference.
        Returns:
        The accepted locale (which may be a variation of this locale), or null if none of the given locales are supported by the application.
        See Also:
        GuiseApplication.getLocales(), GuiseSession.setLocale(Locale)
      • getOrientation

        public Orientation getOrientation()
        Specified by:
        getOrientation in interface GuiseSession
        Returns:
        The default internationalization orientation of components for this session.
      • releaseResourceBundle

        protected void releaseResourceBundle()
        Unloads the current resource bundle so that the next call to getResourceBundle() will load the resource bundle anew. This method also releases the current collator.
      • getResource

        public <T> T getResource​(java.lang.String resourceKey)
                          throws java.util.MissingResourceException
        Description copied from interface: GuiseSession
        Retrieves an object resource from the resource bundle. Every resource access method should eventually call this method. This is a preferred convenience method for accessing the resources in the session's resource bundle. This method involves an implicit cast that will throw a class cast exception after the method ends if the resource is not of the expected type.
        Specified by:
        getResource in interface GuiseSession
        Type Parameters:
        T - The type of the resource.
        Parameters:
        resourceKey - The key of the resource to retrieve.
        Returns:
        The resource associated with the specified resource key.
        Throws:
        java.util.MissingResourceException - if no resource could be found associated with the given key.
        See Also:
        GuiseSession.getResourceBundle(), GuiseSession.getResource(String, Object)
      • getResource

        public <T> T getResource​(java.lang.String resourceKey,
                                 T defaultValue)
                          throws java.util.MissingResourceException
        Description copied from interface: GuiseSession
        Retrieves an object resource from the resource bundle, using a specified default if no such resource is available. This is a preferred convenience method for accessing the resources in the session's resource bundle. This method involves an implicit cast that will throw a class cast exception after the method ends if the resource is not of the expected type.
        Specified by:
        getResource in interface GuiseSession
        Type Parameters:
        T - The type of the resource.
        Parameters:
        resourceKey - The key of the resource to retrieve.
        defaultValue - The default value to use if there is no resource associated with the given key.
        Returns:
        The resource associated with the specified resource key or the default if none is available.
        Throws:
        java.util.MissingResourceException
        See Also:
        GuiseSession.getResourceBundle(), GuiseSession.getResource(String)
      • getStringResource

        public java.lang.String getStringResource​(java.lang.String resourceKey)
                                           throws java.util.MissingResourceException
        Description copied from interface: GuiseSession
        Retrieves a string resource from the resource bundle. If the resource cannot be found in the resource bundle, it will be loaded from the application's resources, if possible, treating the resource key as a locale-sensitive resource path in the application resource area. This is a preferred convenience method for accessing the resources in the session's resource bundle.
        Specified by:
        getStringResource in interface GuiseSession
        Parameters:
        resourceKey - The key of the resource to retrieve, or a relative path to the resource in the application's resource area.
        Returns:
        The resource associated with the specified resource key.
        Throws:
        java.util.MissingResourceException - if no resource could be found associated with the given key.
        See Also:
        GuiseSession.getResourceBundle(), GuiseSession.getStringResource(String, String)
      • getStringResource

        public java.lang.String getStringResource​(java.lang.String resourceKey,
                                                  java.lang.String defaultValue)
                                           throws java.util.MissingResourceException
        Description copied from interface: GuiseSession
        Retrieves a string resource from the resource bundle, using a specified default if no such resource is available. If the resource cannot be found in the resource bundle, it will be loaded from the application's resources, if possible, treating the resource key as a locale-sensitive resource path in the application resource area. This is a preferred convenience method for accessing the resources in the session's resource bundle.
        Specified by:
        getStringResource in interface GuiseSession
        Parameters:
        resourceKey - 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.
        Returns:
        The resource associated with the specified resource key or the default if none is available.
        Throws:
        java.util.MissingResourceException
        See Also:
        GuiseSession.getResourceBundle(), GuiseSession.getStringResource(String)
      • getBooleanResource

        public java.lang.Boolean getBooleanResource​(java.lang.String resourceKey)
                                             throws java.util.MissingResourceException
        Description copied from interface: GuiseSession
        Retrieves a 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.
        Specified by:
        getBooleanResource in interface GuiseSession
        Parameters:
        resourceKey - The key of the resource to retrieve.
        Returns:
        The resource associated with the specified resource key.
        Throws:
        java.util.MissingResourceException - if no resource could be found associated with the given key.
        See Also:
        GuiseSession.getResourceBundle(), GuiseSession.getBooleanResource(String, Boolean)
      • getBooleanResource

        public java.lang.Boolean getBooleanResource​(java.lang.String resourceKey,
                                                    java.lang.Boolean defaultValue)
                                             throws java.util.MissingResourceException
        Description copied from interface: GuiseSession
        Retrieves a 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.
        Specified by:
        getBooleanResource in interface GuiseSession
        Parameters:
        resourceKey - The key of the resource to retrieve.
        defaultValue - The default value to use if there is no resource associated with the given key.
        Returns:
        The resource associated with the specified resource key or the default if none is available.
        Throws:
        java.util.MissingResourceException
        See Also:
        GuiseSession.getResourceBundle(), GuiseSession.getBooleanResource(String)
      • getIntegerResource

        public java.lang.Integer getIntegerResource​(java.lang.String resourceKey)
                                             throws java.util.MissingResourceException
        Description copied from interface: GuiseSession
        Retrieves an 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.
        Specified by:
        getIntegerResource in interface GuiseSession
        Parameters:
        resourceKey - The key of the resource to retrieve.
        Returns:
        The resource associated with the specified resource key.
        Throws:
        java.util.MissingResourceException - if no resource could be found associated with the given key.
        See Also:
        GuiseSession.getResourceBundle(), GuiseSession.getIntegerResource(String, Integer)
      • getIntegerResource

        public java.lang.Integer getIntegerResource​(java.lang.String resourceKey,
                                                    java.lang.Integer defaultValue)
                                             throws java.util.MissingResourceException
        Description copied from interface: GuiseSession
        Retrieves an 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.
        Specified by:
        getIntegerResource in interface GuiseSession
        Parameters:
        resourceKey - The key of the resource to retrieve.
        defaultValue - The default value to use if there is no resource associated with the given key.
        Returns:
        The resource associated with the specified resource key or the default if none is available.
        Throws:
        java.util.MissingResourceException
        See Also:
        GuiseSession.getResourceBundle(), GuiseSession.getIntegerResource(String)
      • getURIResource

        public java.net.URI getURIResource​(java.lang.String resourceKey)
                                    throws java.util.MissingResourceException
        Description copied from interface: GuiseSession
        Retrieves a 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.
        Specified by:
        getURIResource in interface GuiseSession
        Parameters:
        resourceKey - The key of the resource to retrieve.
        Returns:
        The resource associated with the specified resource key.
        Throws:
        java.util.MissingResourceException - if no resource could be found associated with the given key.
        See Also:
        GuiseSession.getResourceBundle(), GuiseSession.getURIResource(String, URI)
      • getURIResource

        public java.net.URI getURIResource​(java.lang.String resourceKey,
                                           java.net.URI defaultValue)
                                    throws java.util.MissingResourceException
        Description copied from interface: GuiseSession
        Retrieves a 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.
        Specified by:
        getURIResource in interface GuiseSession
        Parameters:
        resourceKey - The key of the resource to retrieve.
        defaultValue - The default value to use if there is no resource associated with the given key.
        Returns:
        The resource associated with the specified resource key or the default if none is available.
        Throws:
        java.util.MissingResourceException
        See Also:
        GuiseSession.getResourceBundle(), GuiseSession.getURIResource(String)
      • getCollatorInstance

        public java.text.Collator getCollatorInstance()
        Specified by:
        getCollatorInstance in interface com.globalmentor.text.CollatorFactory
        Specified by:
        getCollatorInstance in interface GuiseSession
      • getPrincipal

        public java.security.Principal getPrincipal()
        Specified by:
        getPrincipal in interface GuiseSession
        Returns:
        The current principal (e.g. logged-in user), or null if there is no principal authenticated for this session.
      • setPrincipal

        public void setPrincipal​(java.security.Principal newPrincipal)
        Description copied from interface: GuiseSession
        Sets the current principal (e.g. logged-in user). This is a bound property.
        Specified by:
        setPrincipal in interface GuiseSession
        Parameters:
        newPrincipal - The new principal, or null if there should be no associated principal (e.g. the user should be logged off).
        See Also:
        GuiseSession.PRINCIPAL_PROPERTY
      • getTheme

        public Theme getTheme()
                       throws java.io.IOException
        Description copied from interface: GuiseSession
        Returns the current session theme. If this session's theme has not yet been loaded, this method loads the theme.
        Specified by:
        getTheme in interface GuiseSession
        Returns:
        The current session theme.
        Throws:
        java.io.IOException - if there is an error loading the theme.
        See Also:
        GuiseSession.getThemeURI()
      • getThemeURI

        public java.net.URI getThemeURI()
        Specified by:
        getThemeURI in interface GuiseSession
        Returns:
        The URI of the session theme, to be resolved against the application base path.
      • getDestinationComponent

        public Component getDestinationComponent​(ComponentDestination destination)
        Description copied from interface: GuiseSession
        Retrieves the component bound to the given destination. If a component has already been created and cached, it will be be returned; otherwise, one will be created and cached.
        Specified by:
        getDestinationComponent in interface GuiseSession
        Parameters:
        destination - The destination for which a component should be returned.
        Returns:
        The component bound to the given destination.
      • releaseDestinationComponent

        public Component releaseDestinationComponent​(ComponentDestination destination)
        Description copied from interface: GuiseSession
        Releases the component bound to the given destination.
        Specified by:
        releaseDestinationComponent in interface GuiseSession
        Parameters:
        destination - The destination for which any bound component should be released.
        Returns:
        The component previously bound to the given destination, or null if no component was bound to the given destination.
      • getNavigationDescription

        public java.util.Optional<io.urf.model.UrfResourceDescription> getNavigationDescription​(com.globalmentor.net.URIPath navigationPath,
                                                                                                Bookmark bookmark)
                                                                                         throws java.io.IOException
        Description copied from interface: GuiseSession
        Returns a description of the resource for the given navigation path and bookmark. This is a convenience method that delegates to the appropriate destination.
        Specified by:
        getNavigationDescription in interface GuiseSession
        Parameters:
        navigationPath - 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.
        Returns:
        A description of the indicated navigation path, which will not be present if nothing exists at the given navigation path.
        Throws:
        java.io.IOException - if there is an error accessing the navigation path.
        See Also:
        Destination.getDescription(GuiseSession, URIPath, Bookmark, URI)
      • createComponent

        protected Component createComponent​(java.lang.Class<? extends Component> componentClass)
        Creates the component for the given class.
        Parameters:
        componentClass - The class representing the component to create.
        Returns:
        The created component.
        Throws:
        java.lang.IllegalStateException - if the component class does not provide a default constructor, is an interface, is abstract, or throws an exception during instantiation.
      • initializeComponent

        public void initializeComponent​(Component component)
        Description copied from interface: GuiseSession
        Initializes a component, optionally with a description in a TURF resource file. This method first tries to load a PLOOP URF description of the component in a TURF file with the same name as the class file in the same directory, with an .turf extension. That is, for the class MyComponent.class this method first tries to load MyComponent.turf from the same directory. If this is successful, the component is initialized from this URF description. This implementation calls GuiseSession.initializeComponent(Component, InputStream). The component's Component.initialize() is called whether there is an URF description.
        Specified by:
        initializeComponent in interface GuiseSession
        Parameters:
        component - The component to initialize.
        See Also:
        Component.initialize(), PLOOP
      • initializeComponentFromResource

        public void initializeComponentFromResource​(Component component,
                                                    java.lang.String resourceKey)
                                             throws com.globalmentor.util.DataException,
                                                    java.lang.reflect.InvocationTargetException
        Initializes a component with a description in a TURF resource file. This method calls Component.initialize() after initializing the component from the description. This implementation calls GuiseSession.initializeComponent(Component, InputStream).

        This implementation calls initializeComponent(Component, InputStream).

        Specified by:
        initializeComponentFromResource in interface GuiseSession
        Parameters:
        component - The component to initialize.
        resourceKey - The key to a TURF description resource file.
        Throws:
        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.
        See Also:
        Component.initialize()
      • initializeComponent

        public void initializeComponent​(Component component,
                                        java.io.InputStream descriptionInputStream)
                                 throws java.io.IOException,
                                        com.globalmentor.util.DataException,
                                        java.lang.reflect.InvocationTargetException
        Description copied from interface: GuiseSession
        Initializes a component from the contents of an URF description input stream. This method calls Component.initialize() after initializing the component from the description.
        Specified by:
        initializeComponent in interface GuiseSession
        Parameters:
        component - The component to initialize.
        descriptionInputStream - The input stream containing an URF description.
        Throws:
        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.
        See Also:
        Component.initialize()
      • pushModalNavigation

        protected void pushModalNavigation​(ModalNavigation modalNavigation)
        Pushes the given model navigation onto the top of the stack.
        Parameters:
        modalNavigation - The modal navigation to add.
        Throws:
        java.lang.NullPointerException - if the given modal navigation is null.
      • peekModalNavigation

        protected ModalNavigation peekModalNavigation()
        Returns:
        The modal navigation on the top of the stack, or null if there are no modal navigations.
      • pollModalNavigation

        protected ModalNavigation pollModalNavigation()
        Returns:
        The modal navigation from the top of the stack, or null if there are no modal navigations on the stack.
      • popModalNavigation

        protected ModalNavigation popModalNavigation()
        Returns:
        The modal navigation from the top of the stack.
        Throws:
        java.util.NoSuchElementException - if there are no modal navigations on the stack.
      • isModalNavigation

        public boolean isModalNavigation()
        Specified by:
        isModalNavigation in interface GuiseSession
        Returns:
        Whether the session is in a modal navigation state.
      • beginModalNavigation

        public void beginModalNavigation​(ModalNavigationPanel<?> modalNavigationPanel,
                                         ModalNavigation modalNavigation)
        Description copied from interface: GuiseSession
        Begins modal interaction for a particular modal panel. The modal navigation is pushed onto the stack, and an event is fired to the modal listener of the modal navigation.
        Specified by:
        beginModalNavigation in interface GuiseSession
        Parameters:
        modalNavigationPanel - The panel for which modal navigation state should begin.
        modalNavigation - The state of modal navigation.
      • endModalNavigation

        public boolean endModalNavigation​(ModalNavigationPanel<?> modalNavigationPanel)
        Description copied from interface: GuiseSession
        Ends modal interaction for a particular modal panel. The panel is released from the cache so that new navigation will create a new modal panel. This method is called by modal panels and should seldom if ever be called directly. If the current modal state corresponds to the current navigation state, the current modal state is removed, the modal state's event is fired, and modal state is handed to the previous modal state, if any. Otherwise, navigation is transferred to the modal panel's referring URI, if any. If the given modal panel is not the panel at the current navigation path, the modal state is not changed, although navigation and release will still occur.
        Specified by:
        endModalNavigation in interface GuiseSession
        Parameters:
        modalNavigationPanel - The panel for which modal navigation state should be ended.
        Returns:
        true if modality actually ended for the given panel.
        See Also:
        NavigationEvent.getReferrerURI(), GuiseSession.releaseDestinationComponent(ComponentDestination)
      • getNavigationPath

        public com.globalmentor.net.URIPath getNavigationPath()
        Description copied from interface: GuiseSession
        Reports the navigation path relative to the application context path.
        Specified by:
        getNavigationPath in interface GuiseSession
        Returns:
        The path representing the current navigation location of the Guise application.
      • getBookmark

        public Bookmark getBookmark()
        Description copied from interface: GuiseSession
        Reports the current bookmark relative to the current navigation path.
        Specified by:
        getBookmark in interface GuiseSession
        Returns:
        The bookmark relative to the current navigation path, or null if there is no bookmark specified.
      • setBookmark

        public void setBookmark​(Bookmark bookmark)
        Description copied from interface: GuiseSession
        Changes the bookmark of the current navigation path. This method does not necessarily cause navigation to occur, but instead "publishes" the bookmark to indicate that it is representative of the current state of the current navigation.
        Specified by:
        setBookmark in interface GuiseSession
        Parameters:
        bookmark - The bookmark relative to the current navigation path, or null if there should be no bookmark.
      • navigate

        public void navigate​(com.globalmentor.net.URIPath path)
        Description copied from interface: GuiseSession
        Requests navigation to the specified path. The session need not perform navigation immediately or ever, and may postpone or deny navigation at some later point. Later requested navigation before navigation occurs will override this request.
        Specified by:
        navigate in interface GuiseSession
        Parameters:
        path - A path that is either relative to the application context path or is absolute.
        See Also:
        GuiseSession.navigate(URI)
      • navigate

        public void navigate​(com.globalmentor.net.URIPath path,
                             java.lang.String viewportID)
        Description copied from interface: GuiseSession
        Requests navigation to the specified path in an identified viewport. The session need not perform navigation immediately or ever, and may postpone or deny navigation at some later point. Later requested navigation before navigation occurs will override this request.
        Specified by:
        navigate in interface GuiseSession
        Parameters:
        path - 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.
        See Also:
        GuiseSession.navigate(URI, String)
      • navigate

        public void navigate​(com.globalmentor.net.URIPath path,
                             Bookmark bookmark)
        Description copied from interface: GuiseSession
        Requests navigation to the specified path and bookmark. The session need not perform navigation immediately or ever, and may postpone or deny navigation at some later point. Later requested navigation before navigation occurs will override this request.
        Specified by:
        navigate in interface GuiseSession
        Parameters:
        path - 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.
        See Also:
        GuiseSession.navigate(URI)
      • navigate

        public void navigate​(com.globalmentor.net.URIPath path,
                             Bookmark bookmark,
                             java.lang.String viewportID)
        Description copied from interface: GuiseSession
        Requests navigation to the specified path and bookmark in an identified viewport. The session need not perform navigation immediately or ever, and may postpone or deny navigation at some later point. Later requested navigation before navigation occurs will override this request.
        Specified by:
        navigate in interface GuiseSession
        Parameters:
        path - 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.
        See Also:
        GuiseSession.navigate(URI, String)
      • navigate

        public void navigate​(java.net.URI uri)
        Description copied from interface: GuiseSession
        Requests navigation to the specified URI. The session need not perform navigation immediately or ever, and may postpone or deny navigation at some later point. Later requested navigation before navigation occurs will override this request.
        Specified by:
        navigate in interface GuiseSession
        Parameters:
        uri - Either a relative or absolute path, or an absolute URI.
      • navigate

        public void navigate​(java.net.URI uri,
                             java.lang.String viewportID)
        Description copied from interface: GuiseSession
        Requests navigation to the specified URI in an identified viewport. The session need not perform navigation immediately or ever, and may postpone or deny navigation at some later point. Later requested navigation before navigation occurs will override this request.
        Specified by:
        navigate in interface GuiseSession
        Parameters:
        uri - 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.
      • navigateModal

        public void navigateModal​(com.globalmentor.net.URIPath path,
                                  ModalNavigationListener modalListener)
        Description copied from interface: GuiseSession
        Requests modal navigation to the specified path. The session need not perform navigation immediately or ever, and may postpone or deny navigation at some later point. Later requested navigation before navigation occurs will override this request.
        Specified by:
        navigateModal in interface GuiseSession
        Parameters:
        path - 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.
        See Also:
        GuiseSession.navigateModal(URI, ModalNavigationListener)
      • navigateModal

        public void navigateModal​(com.globalmentor.net.URIPath path,
                                  Bookmark bookmark,
                                  ModalNavigationListener modalListener)
        Description copied from interface: GuiseSession
        Requests modal navigation to the specified path and bookmark. The session need not perform navigation immediately or ever, and may postpone or deny navigation at some later point. Later requested navigation before navigation occurs will override this request.
        Specified by:
        navigateModal in interface GuiseSession
        Parameters:
        path - 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.
        See Also:
        GuiseSession.navigateModal(URI, ModalNavigationListener)
      • navigateModal

        public void navigateModal​(java.net.URI uri,
                                  ModalNavigationListener modalListener)
        Description copied from interface: GuiseSession
        Requests modal navigation to the specified URI. The session need not perform navigation immediately or ever, and may postpone or deny navigation at some later point. Later requested navigation before navigation occurs will override this request.
        Specified by:
        navigateModal in interface GuiseSession
        Parameters:
        uri - Either a relative or absolute path, or an absolute URI.
        modalListener - The listener to respond to the end of modal interaction.
      • getSiteName

        public java.lang.String getSiteName()
        Determines the name of the site at the current navigation path.

        This version returns null.

        Specified by:
        getSiteName in interface GuiseSession
        Returns:
        The name of the site, or null if the site has no name.
      • getBreadcrumb

        public Breadcrumb getBreadcrumb​(com.globalmentor.net.URIPath navigationPath)
        Retrieves a breadcrumb for a particular navigation path.

        This implementation uses the name of the resulting depiction URI for the breadcrumb label.

        This implementation returns a default breadcrumb; subclasses may override this method and provide customized breadcrumb information.

        Specified by:
        getBreadcrumb in interface GuiseSession
        Parameters:
        navigationPath - The navigation path which a breadcrumb should be returned.
        Returns:
        A breadcrumb for the given navigation URI.
        See Also:
        getDepictionURI(URIPath, String...)
      • getBreadcrumbs

        public java.util.List<Breadcrumb> getBreadcrumbs​(com.globalmentor.net.URIPath navigationPath)
        Retrieves breadcrumbs for all the segments of a particular navigation path. This method delegates to GuiseSession.getBreadcrumb(URIPath) to create each segment breadcrumb.

        This method delegates to getBreadcrumb(URIPath) to create each segment breadcrumb.

        Specified by:
        getBreadcrumbs in interface GuiseSession
        Parameters:
        navigationPath - The navigation path which breadcrumbs should be returned.
        Returns:
        A list of breadcrumbs for the given navigation URI.
      • createTempPublicResource

        public com.globalmentor.net.URIPath createTempPublicResource​(java.lang.String baseName,
                                                                     java.lang.String extension)
                                                              throws java.io.IOException
        Description copied from interface: GuiseSession
        Creates a temporary resource available at a public application navigation path but with access restricted to this session. The file will be created in the application's temporary file directory. If the resource is restricted to the current Guise session, the resource will be deleted when the current Guise session ends. This is a convenience method that delegates to GuiseApplication.createTempAsset(String, String, GuiseSession).
        Specified by:
        createTempPublicResource in interface GuiseSession
        Parameters:
        baseName - The base filename to be used in generating the filename.
        extension - The extension to use for the temporary file.
        Returns:
        A public application navigation path that can be used to access the resource only from this session.
        Throws:
        java.io.IOException - if there is a problem creating the public resource.
        See Also:
        GuiseApplication.createTempAsset(String, String, GuiseSession), GuiseApplication.getTempDirectory()
      • createInputEvent

        protected InputEvent createInputEvent​(Input input)
        Creates an input event for the given input.
        Parameters:
        input - The input to process.
        Returns:
        An event to represent the given input.
        Throws:
        java.lang.NullPointerException - if the given input is null.
        java.lang.IllegalArgumentException - if an unknown input type was given.
        See Also:
        CommandInput, KeystrokeInput, MouseClickInput
      • log

        public void log​(java.lang.String subject,
                        java.lang.String predicate,
                        java.lang.String object,
                        java.util.Map<?,​?> parameters,
                        java.lang.CharSequence comment)
        Description copied from interface: GuiseSession
        Logs the given session-related information with a default log level of InformationLevel.LOG. This is a convenience method that delegates to GuiseSession.log(InformationLevel, String, String, String, Map, CharSequence).
        Specified by:
        log in interface GuiseSession
        Parameters:
        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.
      • log

        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)
        Description copied from interface: GuiseSession
        Logs the given session-related information.
        Specified by:
        log in interface GuiseSession
        Parameters:
        level - 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.
      • notify

        public void notify​(Notification... notifications)
        Description copied from interface: GuiseSession
        Notifies the user of one or more notifications to be presented in sequence. The notification's label and/or icon, if specified, will be used as the dialog title and icon, respectively; if either is not specified, a label and/or icon based upon the notification's severity will be used. If the selected option to any notification is fatal, the remaining notifications will not be performed. The absence of an option selection is considered fatal only if a fatal option was presented for a given notification. This is a convenience method that delegates to GuiseSession.notify(Runnable, Notification...).
        Specified by:
        notify in interface GuiseSession
        Parameters:
        notifications - One or more notification informations to relay.
      • notify

        public 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. The notification's label and/or icon, if specified, will be used as the dialog title and icon, respectively; if either is not specified, a label and/or icon based upon the notification's severity will be used. If the selected option to any notification is fatal, the remaining notifications and the specified logic, if any, will not be performed. The absence of an option selection is considered fatal only if a fatal option was presented for a given notification.

        This implementation delegates to notify(Notification, Runnable).

        Specified by:
        notify in interface GuiseSession
        Parameters:
        afterNotify - The code that executes after notification has taken place, or null if no action should be taken after notification.
        notifications - One or more notification informations to relay.
      • notify

        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. The notification's label and/or icon, if specified, will be used as the dialog title and icon, respectively; if either is not specified, a label and/or icon based upon the notification's severity will be used. If the selected option to any notification is fatal, the remaining notifications and the specified logic, if any, will not be performed. The absence of an option selection is considered fatal only if a fatal option was presented for a given notification.
        Parameters:
        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.
      • notify

        public void notify​(java.lang.Throwable... errors)
        Description copied from interface: GuiseSession
        Notifies the user of the given errors in sequence. If the selected option to any notification is fatal, the remaining notifications will not be performed. The absence of an option selection is considered fatal only if a fatal option was presented for a given notification. This is a convenience method that delegates to GuiseSession.notify(Runnable, Throwable...).
        Specified by:
        notify in interface GuiseSession
        Parameters:
        errors - The errors with which to notify the user.
      • notify

        public void notify​(java.lang.Runnable afterNotify,
                           java.lang.Throwable... errors)
        Description copied from interface: GuiseSession
        Notifies the user of the given error in sequence, with optional logic to be executed after notification takes place. If the selected option to any notification is fatal, the remaining notifications and the specified logic, if any, will not be performed. The absence of an option selection is considered fatal only if a fatal option was presented for a given notification. This is a convenience method that delegates to GuiseSession.notify(Runnable, Notification...).
        Specified by:
        notify in interface GuiseSession
        Parameters:
        afterNotify - The code that executes after notification has taken place, or null if no action should be taken after notification.
        errors - The errors with which to notify the user.
      • dereferenceString

        public java.lang.String dereferenceString​(java.lang.String string)
                                           throws java.util.MissingResourceException
        Description copied from interface: GuiseSession
        Dereferences a string by replacing any string references with a string from the resources. A string reference begins with the Start of String ( 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 GuiseSession.getStringResource(String). Strings retrieved from resources will be recursively dereferenced.

        String references appearing between an SOS/ST pair that that begin with the character 61 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...).

        Specified by:
        dereferenceString in interface GuiseSession
        Parameters:
        string - The string to be dereferenced.
        Returns:
        The dereferenced string with any string references replaced with the appropriate string from the resources.
        Throws:
        java.util.MissingResourceException - if no resource could be found associated with a string reference.
        See Also:
        Resources.createStringResourceReference(String), Resources.createStringValueReference(String), GuiseSession.getStringResource(String)
      • dereferenceURI

        public java.net.URI dereferenceURI​(java.net.URI uri,
                                           java.lang.String... suffixes)
                                    throws java.util.MissingResourceException
        Description copied from interface: GuiseSession
        Dereferences a URI by looking up any references from the resources if necessary. If the URI has the "resource" scheme, its scheme-specific part will be used to look up the actual URI using GuiseSession.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.
        Specified by:
        dereferenceURI in interface GuiseSession
        Parameters:
        uri - The URI to be dereferenced.
        suffixes - The suffixes, if any, to append to a resource key in a URI reference.
        Returns:
        The URI dereferenced from the resources.
        Throws:
        java.util.MissingResourceException - if no resource could be found associated with a string reference.
        See Also:
        Resources.createURIResourceReference(String), GuiseSession.getURIResource(String)
      • resolveURI

        public java.net.URI resolveURI​(java.net.URI uri,
                                       java.lang.String... suffixes)
                                throws java.util.MissingResourceException
        Description copied from interface: GuiseSession
        Resolves a URI against the application base path, looking up the URI from the resources if necessary. The URI will be dereferenced before it is resolved. Relative paths will be resolved relative to the application base path. Absolute paths will be considered already resolved, as will absolute URIs. For an application base path "/path/to/application/", resolving "relative/path" will yield "/path/to/application/relative/path", while resolving "/absolute/path" will yield "/absolute/path". Resolving "http://example.com/path" will yield "http://example.com/path".
        Specified by:
        resolveURI in interface GuiseSession
        Parameters:
        uri - The URI to be resolved.
        suffixes - The suffixes, if any, to append to a resource key in a URI reference.
        Returns:
        The uri resolved against resources the application base path.
        Throws:
        java.util.MissingResourceException - if no resource could be found associated with a string reference.
        See Also:
        GuiseSession.dereferenceURI(URI, String...), GuiseApplication.resolveURI(URI)