public interface DesktopTask
Desktop
.Modifier and Type | Method and Description |
---|---|
<T extends Event> |
addEventHandler(EventType<T> type,
EventHandler<? super T> handler)
Registers an event handler to this
DesktopTask . |
Compiler |
createCompiler(Object defaultLogic)
Returns a new Desktop
Compiler with default user logic. |
MailSender |
createMailSender()
Creates and returns a new mail message builder and sender.
|
NetServerClient |
createNetServerClient(String channelName)
Returns a new
NetServerClient bound to this DesktopTask . |
DesktopTask |
createTask(String plugin,
String main,
String title,
Object argument)
Creates a new
DesktopTask with supplied plugin, main, title and
argument. |
DesktopTask |
createTask(String plugin,
String main,
String title,
Object argument,
EventHandler<ModalEvent> handler)
Creates a new
DesktopTask with supplied plugin, main, title,
argument and handler. |
void |
deleteSettings(AccessLevel level,
String name)
Deletes settings with the specified access level and name.
|
String |
encodeCredentials(String userCode,
char[] password)
Returns a string with the encoding of supplied credentials.
|
Application |
getApplication()
Returns the
Application of the Desktop. |
<T> T |
getArgument(Class<T> type)
Returns the typed argument of this
DesktopTask . |
URL |
getCodeBase()
Returns the codebase of the plugin of this
DesktopTask . |
DesktopConfig |
getConfig()
Returns the configuration parameters of the Desktop.
|
DesktopTask |
getCreator()
Returns the
DesktopTask that created this DesktopTask . |
DdeTopic |
getDdeTopic()
Returns the DDE Topic of this
DesktopTask . |
Image |
getImage(String name)
Returns the image indexed by name or
null if not found. |
String |
getLeafName()
Returns the name of the tree leaf of this
DesktopTask . |
String |
getMainName()
Returns the main name of this
DesktopTask . |
NetServerManager |
getNetServerManager()
Returns the Desktop NetServer Manager.
|
Class<? extends Node> |
getPluginClass()
Returns the class of the plugin of this
DesktopTask . |
File |
getPluginDirectory()
Returns the directory of the plugin of this
DesktopTask . |
String |
getPluginName()
Returns the name of the plugin of this
DesktopTask . |
Node |
getPluginNode()
Returns the node of the plugin of this
DesktopTask . |
String |
getPluginVersion()
Returns the version of the plugin of this
DesktopTask . |
AnchorPane |
getPrimaryContentPane()
Returns the content pane of the primary
Stage . |
AnchorPane |
getPrimaryRootPane()
Returns the root pane of the primary
Stage . |
Stage |
getPrimaryStage()
Returns the primary
Stage of the Desktop. |
URL |
getSecureCodeBase()
Returns the secure codebase of the plugin of this
DesktopTask . |
String |
getServerEnvironName()
Returns the environment name of the Application Server.
|
String |
getServerPageExtension()
Returns the file extension of a page of the Application Server.
|
long |
getServerTime()
Returns the time of the Application Server (milliseconds).
|
TimeZone |
getServerTimeZone()
Returns the time zone of the Application Server.
|
Settings |
getSettings()
Returns the settings of this
DesktopTask . |
Settings |
getSharedSettings()
Returns the shared settings of the Desktop.
|
boolean |
getShowTerminateDialog()
Returns
true if this DesktopTask shows the terminate dialog. |
Stage |
getStage()
Returns the
Stage of this DesktopTask . |
DesktopStation |
getStation()
Returns the station of the Desktop.
|
int |
getUniqueID()
Returns the unique identification of the Desktop.
|
DesktopUser |
getUser()
Returns the user of the Desktop.
|
String |
getVersion()
Returns the version string of the Desktop.
|
TaskWindow |
getWindow()
Returns the window of this
DesktopTask . |
void |
initHttpSecurityHeaders(URLConnection urlconn)
Initialize the HTTP Security Headers of an
URLConnection . |
void |
initWebServicePort(Object port)
Initialize a web service port.
|
void |
initWebServicePort(Object port,
Service service,
URL codebase)
Initialize a web service port using supplied service and codebase.
|
void |
initWebServicePort(Object port,
URL endpoint)
Initialize a web service port using supplied endpoint.
|
boolean |
isTerminated()
Returns
true if this DesktopTask has terminated. |
List<String> |
listSettings(AccessLevel level,
String prefix)
Returns the names of the settings saved at specified access level
filtered by supplied name prefix.
|
void |
lockDesktop()
Locks the Desktop windows and waits for the user to supply a password.
|
void |
publish(String name,
Object data)
Sends a message to all that have subscribed to the named multicast.
|
Settings |
readSettings(AccessLevel level,
String name)
Reads settings with the specified access level and name.
|
<T extends Event> |
removeEventHandler(EventType<T> type,
EventHandler<? super T> handler)
Unregisters an event handler from this
DesktopTask . |
void |
renameSettings(AccessLevel level,
String name,
String newName)
Renames settings with the specified access level and name.
|
DesktopUser |
searchUser(UserFilter filter,
String title)
Displays a dialog to seach for a user that matches a search criteria.
|
DesktopUser |
searchUser(Window owner,
UserFilter filter,
String title)
Displays a dialog to seach for a user that matches a search criteria.
|
void |
sendMail(String recipients,
String subject,
String html)
Sends the mail message to one or more recipients.
|
void |
setShowTerminateDialog(boolean show)
Changes the whether this
DesktopTask shows the terminate dialog. |
void |
subscribe(String name,
EventHandler<MulticastEvent> handler)
Subscribes this
DesktopTask to the multicast with the specified
name. |
void |
terminate(boolean cancellable)
Terminates the execution of this
DesktopTask . |
void |
terminate(boolean cancellable,
Object result)
Terminates the execution of this modal
DesktopTask . |
void |
unsubscribe(String name,
EventHandler<MulticastEvent> handler)
Unsubscribes this
DesktopTask from the multicast with the
specified name. |
void |
writeSettings(AccessLevel level,
String name,
Settings settings)
Writes settings with the specified access level and name.
|
String getVersion()
int getUniqueID()
DesktopConfig getConfig()
DesktopUser getUser()
DesktopStation getStation()
Settings getSharedSettings() throws Exception
Exception
- if an error occurs.Compiler createCompiler(Object defaultLogic)
Compiler
with default user logic.defaultLogic
- an object with default user logic.Compiler
with default user logic.NullPointerException
- if defaultLogic
is null
.void lockDesktop()
This method will post a Runnable
to the event queue and then
return immediately to the caller. The posted Runnable
will lock
the Desktop windows at a later time.
If the Desktop is already locked, this method has no effect.
String encodeCredentials(String userCode, char[] password)
userCode
- the identification of the user.password
- the plain-text password of the user.NullPointerException
- if an argument is null
.IllegalArgumentException
- if an argument is invalid.Application getApplication()
Application
of the Desktop.Application
of the Desktop.Stage getPrimaryStage()
Stage
of the Desktop.Stage
of the Desktop.AnchorPane getPrimaryRootPane()
Stage
.Stage
.AnchorPane getPrimaryContentPane()
Stage
.Stage
.Image getImage(String name)
null
if not found.name
- the name of the required image (without extension).name
or null
if not found.NullPointerException
- if name
is null
.long getServerTime()
TimeZone getServerTimeZone()
String getServerEnvironName()
String getServerPageExtension()
void initHttpSecurityHeaders(URLConnection urlconn)
URLConnection
.urlconn
- the URL Connection to be initialized.NullPointerException
- if urlconn
is null
.void initWebServicePort(Object port) throws Exception
port
- the web service port to initialize.NullPointerException
- if port
is null
.IllegalArgumentException
- if the port
is invalid.Exception
- if another error occurs.void initWebServicePort(Object port, URL endpoint) throws Exception
port
- the web service port to initialize.endpoint
- the endpoint of the web service port.NullPointerException
- if an argument is null
.IllegalArgumentException
- if the port
is invalid.Exception
- if another error occurs.void initWebServicePort(Object port, Service service, URL codebase) throws Exception
port
- the web service port to initialize.service
- the web service associatted with the port.codebase
- the codebase used to compute the port endpoint.NullPointerException
- if an argument is null
.IllegalArgumentException
- if the port
is invalid.Exception
- if another error occurs.MailSender createMailSender() throws Exception
Exception
- if another error occurs.void sendMail(String recipients, String subject, String html) throws Exception
recipients
- the recipient mail address.subject
- the subject of the mail message.html
- the html message of the body of the message.NullPointerException
- if an argument is null
.IllegalArgumentException
- if an argument is invalid.Exception
- if another error occurs.DesktopUser searchUser(UserFilter filter, String title) throws Exception
filter
- determines if a user matches the search criteria.title
- title displayed in the search dialog (can be null).null
if the dialog is cancelled.NullPointerException
- if filter
is null
.Exception
- if an unexpected error occurs.DesktopUser searchUser(Window owner, UserFilter filter, String title) throws Exception
owner
- the window owner of the dialog.filter
- determines if a user matches the search criteria.title
- title displayed in the search dialog (can be null).null
if the dialog is cancelled.NullPointerException
- if a required argument is null
.Exception
- if an unexpected error occurs.NetServerManager getNetServerManager() throws Exception
IllegalStateException
- if NetServer Manager is not available.Exception
- if another error occurs.NetServerClient createNetServerClient(String channelName) throws Exception
NetServerClient
bound to this DesktopTask
.channelName
- the name of the NetServerChannel
.NetServerClient
bound to this DesktopTask
.NullPointerException
- if channelName
is null
.IllegalArgumentException
- if the NetServerChannel
is not defined.IllegalStateException
- if NetServer Manager is not available.Exception
- if another error occurs.String getPluginName()
DesktopTask
.DesktopTask
.String getPluginVersion()
DesktopTask
.DesktopTask
.Class<? extends Node> getPluginClass()
DesktopTask
.DesktopTask
.Node getPluginNode()
DesktopTask
.DesktopTask
.File getPluginDirectory()
DesktopTask
.DesktopTask
.URL getCodeBase()
DesktopTask
.DesktopTask
.URL getSecureCodeBase()
DesktopTask
.DesktopTask
.String getLeafName()
DesktopTask
.null
if none assigned.DesktopTask getCreator()
DesktopTask
that created this DesktopTask
.null
if creator is Desktop.String getMainName()
DesktopTask
.DesktopTask
.<T> T getArgument(Class<T> type)
DesktopTask
.T
- the required type of the argument object.type
- the required class type of the argument object.null
if none available.NullPointerException
- if type
is null
.ClassCastException
- if argument cannot be cast to type
.Settings getSettings()
DesktopTask
.DesktopTask
.TaskWindow getWindow()
DesktopTask
.DesktopTask
.Stage getStage()
Stage
of this DesktopTask
.Stage
of this DesktopTask
.DdeTopic getDdeTopic() throws Exception
DesktopTask
.DesktopTask
.Exception
- if an error occurs.boolean isTerminated()
true
if this DesktopTask
has terminated.true
if this DesktopTask
has terminated.void terminate(boolean cancellable)
DesktopTask
. This is just a
convenience method implemented by the following trivial call statement:
terminate(cancellable, null);
cancellable
- if true
the termination can be cancelled.terminate(boolean, Object)
void terminate(boolean cancellable, Object result)
DesktopTask
.
If cancellable
is true
, a dialog will be displayed asking
the user for confirmation. Otherwise, the DesktopTask
will be
terminated without confirmation.
The result
object is used to call the modal event handler
provided to createTask
. If this DesktopTask
is not modal
(i.e., was created without a modal event handler), the result
object is ignored and discarded.
cancellable
- if true
the termination can be cancelled.result
- an object with the result of the modal task (can be null).boolean getShowTerminateDialog()
true
if this DesktopTask
shows the terminate dialog.true
if this DesktopTask
shows the terminate dialog.void setShowTerminateDialog(boolean show)
DesktopTask
shows the terminate dialog.show
- if true
the terminate dialog is shown on terminate.void publish(String name, Object data) throws Exception
name
- the name of the multicast message.data
- the data of the multicast message (can be null).NullPointerException
- if name
is null
.Exception
- if another error occurs.void subscribe(String name, EventHandler<MulticastEvent> handler)
DesktopTask
to the multicast with the specified
name. The supplied multicast handler is called every time someone
publishes a multicast message with the given name.name
- the name of the multicast message.handler
- the handler to call with a published message.NullPointerException
- if an argument is null
.void unsubscribe(String name, EventHandler<MulticastEvent> handler)
DesktopTask
from the multicast with the
specified name. Nothing happens if this DesktopTask
is not
subscribed to the named multicast.name
- the name of the multicast message.handler
- the handler to call with a published message.NullPointerException
- if an argument is null
.<T extends Event> void addEventHandler(EventType<T> type, EventHandler<? super T> handler)
DesktopTask
. The handler is
called when the DesktopTask
receives an Event
of the
specified type.T
- the specific event class of the handler.type
- the type of the events to receive by the handler.handler
- the handler to register.NullPointerException
- if the type
or handler
is null
.IllegalStateException
- if the DesktopTask
has been terminated.<T extends Event> void removeEventHandler(EventType<T> type, EventHandler<? super T> handler)
DesktopTask
. One handler
might have been registered for different event types, so the caller needs
to specify the particular event type from which to unregister the
handler.T
- the specific event class of the handler.type
- the event type from which to unregister.handler
- the handler to unregister.NullPointerException
- if the type
or handler
is null
.DesktopTask createTask(String plugin, String main, String title, Object argument)
DesktopTask
with supplied plugin, main, title and
argument. This is just a convenience method implemented by the following
trivial call statement:
createTask(plugin, main, title, argument, null);
plugin
- the name of the plugin (can be null).main
- the name of the plugin class (required).title
- the title of the plugin window (can be null).argument
- a user-defined plugin argument (can be null).DesktopTask
created with supplied arguments.NullPointerException
- if a required argument is null
.createTask(String, String, String, Object, EventHandler)
DesktopTask createTask(String plugin, String main, String title, Object argument, EventHandler<ModalEvent> handler)
DesktopTask
with supplied plugin, main, title,
argument and handler. If plugin
is null
, the name
returned by getPluginName()
is used. If title
is null
, a default title is provided. The value of argument
can be
retrieved by calling getArgument(Class)
on the created task. If
handler
is not null
, the created task will be modal, and
the handler
will be called with the object provided to terminate(boolean, Object)
.plugin
- the name of the plugin (can be null).main
- the name of the plugin class (required).title
- the title of the plugin window (can be null).argument
- a user-defined plugin argument (can be null).handler
- called when the modal task terminates (can be null).DesktopTask
created with supplied arguments.NullPointerException
- if a required argument is null
.List<String> listSettings(AccessLevel level, String prefix)
level
- the access level of the settings.prefix
- the name prefix used to filter the returned names.NullPointerException
- if an argument is null
.Settings readSettings(AccessLevel level, String name) throws Exception
level
- the access level of the settings.name
- the name of the required settings.null
if not found.NullPointerException
- if an argument is null
.Exception
- if another error occurs.void writeSettings(AccessLevel level, String name, Settings settings) throws Exception
level
- the access level of the settings.name
- the name of the settings.settings
- the settings that will be saved.NullPointerException
- if an argument is null
.Exception
- if another error occurs.void renameSettings(AccessLevel level, String name, String newName)
level
- the access level of the settings.name
- the current name of the settings.newName
- the new name of the settings.NullPointerException
- if an argument is null
.void deleteSettings(AccessLevel level, String name)
level
- the access level of the settings.name
- the name of the settings.NullPointerException
- if an argument is null
.Copyright © OBCOM INGENIERIA S.A. (Chile). All Rights Reserved.