Package io.guise.framework.platform
Interface Platform
-
- All Known Subinterfaces:
WebPlatform
- All Known Implementing Classes:
AbstractPlatform
,AbstractWebPlatform
,HTTPServletWebPlatform
public interface Platform
The platform on which Guise objects are being depicted.- Author:
- Garret Wilson
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description long
generateDepictID()
Generates a new depict ID unique to this session platform.GuiseApplication
getApplication()
ClientProduct
getClientProduct()
DepictContext
getDepictContext()
Retrieves information and functionality related to the current depiction.DepictedObject
getDepictedObject(long depictedObjectID)
Retrieves a depicted object that has been registered with the platform by the ID of the depicted object.java.util.concurrent.locks.Lock
getDepictLock()
<O extends DepictedObject>
Depictor<? super O>getDepictor(O depictedObject)
Determines the depictor appropriate for the given depicted object.Environment
getEnvironment()
java.util.Queue<? extends PlatformMessage>
getSendMessageQueue()
void
registerDepictedObject(DepictedObject depictedObject)
Registers a depicted object so that it can interact with the platform.void
selectPlatformFiles(boolean multiple, ValueSelectListener<java.util.Collection<PlatformFile>> platformFileSelectListener)
Selects one or more files on the platform, using the appropriate selection functionality for the platform.void
sendResource(com.globalmentor.net.URIPath resourcePath)
Sends a resource to the platform.void
sendResource(com.globalmentor.net.URIPath resourcePath, Bookmark bookmark)
Sends a resource to the platform with the specified bookmark.void
sendResource(java.net.URI resourceURI)
Sends a resource to the platform.void
sendResource(java.net.URI resourceURI, Bookmark bookmark)
Sends a resource to the platform.void
unregisterDepictedObject(DepictedObject depictedObject)
Unregisters a depicted object so that no longer interacts with the platform.
-
-
-
Method Detail
-
getApplication
GuiseApplication getApplication()
- Returns:
- The Guise application running on this platform.
-
getEnvironment
Environment getEnvironment()
- Returns:
- The user local environment.
-
generateDepictID
long generateDepictID()
Generates a new depict ID unique to this session platform.- Returns:
- A new depict ID unique to this session platform.
-
getDepictor
<O extends DepictedObject> Depictor<? super O> getDepictor(O depictedObject)
Determines the depictor appropriate for the given depicted object. A depictor class is located by individually looking up the depicted object class hiearchy for registered depictor classes.- Type Parameters:
O
- The type of depicted object.- Parameters:
depictedObject
- The depicted object for which a depictor should be returned.- Returns:
- A depictor to depict the given component, or
null
if no depictor is registered. - Throws:
java.lang.IllegalStateException
- if the registered depictor could not be instantiated for some reason.
-
registerDepictedObject
void registerDepictedObject(DepictedObject depictedObject)
Registers a depicted object so that it can interact with the platform.- Parameters:
depictedObject
- The depicted object to register.- Throws:
java.lang.NullPointerException
- if the given depicted object isnull
.
-
unregisterDepictedObject
void unregisterDepictedObject(DepictedObject depictedObject)
Unregisters a depicted object so that no longer interacts with the platform.- Parameters:
depictedObject
- The depicted object to unregister.- Throws:
java.lang.NullPointerException
- if the given depicted object isnull
.
-
getDepictedObject
DepictedObject getDepictedObject(long depictedObjectID)
Retrieves a depicted object that has been registered with the platform by the ID of the depicted object.- Parameters:
depictedObjectID
- The ID of the depicted object to retrieve.- Returns:
- The registered depicted object with the given ID, or
null
if there is no depicted object registered with this platform with the given ID.
-
getClientProduct
ClientProduct getClientProduct()
- Returns:
- The client software being used to access Guise on this platform.
-
getSendMessageQueue
java.util.Queue<? extends PlatformMessage> getSendMessageQueue()
- Returns:
- The thread-safe queue of messages to be delivered to the platform.
-
getDepictLock
java.util.concurrent.locks.Lock getDepictLock()
- Returns:
- The lock used for exclusive depiction on the platform.
-
getDepictContext
DepictContext getDepictContext()
Retrieves information and functionality related to the current depiction.- Returns:
- A context for the current depiction.
- Throws:
java.lang.IllegalStateException
- if no depict context can be returned in the current depiction state.
-
selectPlatformFiles
void selectPlatformFiles(boolean multiple, ValueSelectListener<java.util.Collection<PlatformFile>> platformFileSelectListener)
Selects one or more files on the platform, using the appropriate selection functionality for the platform.- Parameters:
multiple
- Whether multiple files should be allowed to be selected.platformFileSelectListener
- The listener that will be notified when platform files are selected.
-
sendResource
void sendResource(com.globalmentor.net.URIPath resourcePath)
Sends a resource to the platform.- Parameters:
resourcePath
- The path of the resource to send, relative to the application.- Throws:
java.lang.NullPointerException
- if the given path isnull
.java.lang.IllegalArgumentException
- if the given string is not a path.
-
sendResource
void sendResource(java.net.URI resourceURI)
Sends a resource to the platform.- Parameters:
resourceURI
- The URI of the resource to send, relative to the application.- Throws:
java.lang.NullPointerException
- if the given URI isnull
.
-
sendResource
void sendResource(com.globalmentor.net.URIPath resourcePath, Bookmark bookmark)
Sends a resource to the platform with the specified bookmark.- Parameters:
resourcePath
- The path of the resource to send, relative to the application.bookmark
- The bookmark at the given path, ornull
if there is no bookmark.- Throws:
java.lang.NullPointerException
- if the given path isnull
.
-
sendResource
void sendResource(java.net.URI resourceURI, Bookmark bookmark)
Sends a resource to the platform.- Parameters:
resourceURI
- The URI of the resource to send, relative to the application.bookmark
- The bookmark at the given path, ornull
if there is no bookmark.- Throws:
java.lang.NullPointerException
- if the given URI isnull
.
-
-