eXchaNGeR

org.xngr
Class XService

java.lang.Object
  |
  +--org.xngr.XService

public abstract class XService
extends Object

The representation of a service in the system. Services implementations should extend this class and implement the relevant methods for this class.

Version:
$Revision: 1.4 $, $Date: 2002/11/04 10:23:35 $
Author:
Edwin Dankert

Constructor Summary
XService()
           
 
Method Summary
abstract  boolean close()
          Closes the service, this method is called by the 'browser application' when the user wants to exit the application.
abstract  XAction[] getActions(XElementType type)
          Returns a list of actions for the element-type supplied.
abstract  XDecorator getDecorator(XElementType type)
          Returns a decorator for the element-type.
 XManager getManager()
          Returns the manager that allows the service to interact with other services and allows the service to get a programmatic handle to documents and elements that are already 'internal' to the browser application.
 XProperties getProperties()
          Returns the properties for this service.
 void open(String[] params)
          Deprecated. Please use the open( XElement) method instead.
abstract  void open(XElement element)
          Opens a process with an element from a document as argument.
 void setManager(XManager manager)
          Sets the manager that allows the service to interact with other services and allows the service to get a programmatic handle to documents and elements that are already 'internal' to the browser application.
 void setProperties(XProperties properties)
          Sets the properties for this service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XService

public XService()
Method Detail

setManager

public final void setManager(XManager manager)
Sets the manager that allows the service to interact with other services and allows the service to get a programmatic handle to documents and elements that are already 'internal' to the browser application.

The manager is automatically set by a browser application when a new service is instantiated.

Parameters:
manager - the global manager.

getManager

public XManager getManager()
Returns the manager that allows the service to interact with other services and allows the service to get a programmatic handle to documents and elements that are already 'internal' to the browser application.
Returns:
the manager.

setProperties

public final void setProperties(XProperties properties)
Sets the properties for this service. The properties are automatically set by a browser application when a new service is instantiated.

The properties are persisted by the browser application and could therefor be used by the the service to store service specific properties, like storing the last opened document, the last screen size and position and more...

Parameters:
properties - the service specific properties.

getProperties

public XProperties getProperties()
Returns the properties for this service.

The properties are persisted by the browser application and could therefor be used by the the service to store service specific properties, like storing the last opened document, the last screen size and position and more...

Returns:
the properties.

getDecorator

public abstract XDecorator getDecorator(XElementType type)
Returns a decorator for the element-type. The decorator will be used to display the element in a human readable form on the screen. This method will only be called when the service is set as a default service for the element-type supplied.
Parameters:
type - the element-type.
Returns:
the decorator for the element-type.

getActions

public abstract XAction[] getActions(XElementType type)
Returns a list of actions for the element-type supplied.
Parameters:
type - the element-type.
Returns:
the actions for the element-type.

open

public void open(String[] params)
Deprecated. Please use the open( XElement) method instead.

Starts a service with an array of strings as parameters,
Parameters:
params - the parameters set by the user.

open

public abstract void open(XElement element)
Opens a process with an element from a document as argument. Only elements that are associated with this service will be passed to this method.
Parameters:
element - the element to open the process with.

close

public abstract boolean close()
Closes the service, this method is called by the 'browser application' when the user wants to exit the application. This can be used to save any data still 'un'saved and to close all open frames.
Returns:
false when the 'browser application' should stop its exit process, because this service cannot be closed yet. Note: The browser, in some cases, might not be able to stop the exit process!

eXchaNGeR

Copyright © 2002, Cladonia Ltd., All Rights Reserved