org.xngr.context
Class FileContext

java.lang.Object
  extended by org.xngr.context.ServiceContext
      extended by org.xngr.context.URIServiceContext
          extended by org.xngr.context.FileContext
Direct Known Subclasses:
DocumentContext

public class FileContext
extends URIServiceContext

The context for a File/URI object, containing the file-services and actions for the file-services.

Version:
$Revision: 42 $, $Date: 2009-03-18 23:12:35 +0000 (Wed, 18 Mar 2009) $
Author:
Edwin Dankert

Method Summary
 java.lang.String getDescription()
          Returns the most appropriate description for the context's URI.
 java.util.List<FileMarker> getFileMarkers()
           
 java.util.List<FileService> getFileServices()
           
 javax.swing.Icon getIcon()
          Returns the most appropriate icon for the context's URI.
 java.util.List<Marker> getMarkers()
           
 java.lang.String getName()
          Returns the most appropriate name for the context's URI.
 java.util.List<Service> getServices()
           
 void open(Action action)
          Opens the supplied service using the action's service, the context's URI and the arguments defined in the action.
 void open(FileService service)
          Opens the supplied service using the Context's URI and an empty HashMap as arguments.
 void open(FileService service, java.util.Map<java.lang.String,java.lang.String> arguments)
          Opens the supplied service using the Context's URI.
 
Methods inherited from class org.xngr.context.URIServiceContext
dispose, getURI
 
Methods inherited from class org.xngr.context.ServiceContext
addServiceContextListener, fireActionsChanged, fireMarkersChanged, fireServicesChanged, getActions, removeServiceContextListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getFileServices

public java.util.List<FileService> getFileServices()
Returns:
a live-list of file-services, modifications to the list will modify the list of file-services.

getFileMarkers

public java.util.List<FileMarker> getFileMarkers()
Returns:
a live-list of file-markers, modifications to the list will modify the list of file-markers.

getServices

public java.util.List<Service> getServices()
Specified by:
getServices in class ServiceContext
Returns:
a list of all the services associated with the file context, this is not a 'live' list.

open

public void open(FileService service)
Opens the supplied service using the Context's URI and an empty HashMap as arguments.

Parameters:
service - the file-service to open.

open

public void open(Action action)
Opens the supplied service using the action's service, the context's URI and the arguments defined in the action.

Parameters:
action - the action to open the service for.

getIcon

public javax.swing.Icon getIcon()
Returns the most appropriate icon for the context's URI. This method iterates through the services starting with the 'most specific' service and ending with the least specific service, returning the first icon it finds. The method returns null when no icon can be found.

Returns:
the icon for the context's uri or null when no icon can be found.

getName

public java.lang.String getName()
Returns the most appropriate name for the context's URI. This method iterates through the services starting with the 'most specific' service and ending with the 'least specific' service, returning the first name it finds. The method returns null when no name can be found.

Returns:
the name for the context's uri or null if no name can be found.

getDescription

public java.lang.String getDescription()
Returns the most appropriate description for the context's URI. This method iterates through the services starting with the 'most specific' service and ending with the 'least specific' service, returning the first description it finds. The method returns null when no description can be found.

Returns:
the description for the context's uri or null if no description can be found.

open

public void open(FileService service,
                 java.util.Map<java.lang.String,java.lang.String> arguments)
Opens the supplied service using the Context's URI.

Parameters:
service - the document-service to open.
arguments - the arguments

getMarkers

public java.util.List<Marker> getMarkers()
Specified by:
getMarkers in class ServiceContext
Returns:
a list of all the markers associated with the context, this is not a 'live' list.


Copyright © 2002-2009 Edwin Dankert. All Rights Reserved.