org.xngr.context
Class NodeContext

java.lang.Object
  extended by org.xngr.context.ServiceContext
      extended by org.xngr.context.NodeContext

public class NodeContext
extends ServiceContext

The context for a Node object, containing the node-services and actions for the node-services.

Version:
$Revision: 91 $, $Date: 2009-05-07 21:45:40 +0100 (Thu, 07 May 2009) $
Author:
Edwin Dankert

Method Summary
 java.lang.String getDescription()
          Returns the 'most appropriate' description for the context's Node.
 javax.swing.Icon getIcon()
          Returns the 'most appropriate' icon for the context's Node.
 java.util.List<Marker> getMarkers()
           
 java.lang.String getName()
          Returns the 'most appropriate' name for the context's Node.
 org.w3c.dom.Node getNode()
           
 java.util.List<NodeMarker> getNodeMarkers()
           
 java.util.List<NodeService> getNodeServices()
           
 java.util.List<Service> getServices()
           
 void open(Action action)
          Opens the supplied service using the action's service, the context's Node and the arguments defined in the action.
 void open(NodeService service)
          Opens the supplied service using a newly created version of the Context's Node and an empty HashMap as arguments.
 void open(NodeService service, java.util.Map<java.lang.String,java.lang.String> arguments)
          Opens the supplied service using the Context's Node.
 
Methods inherited from class org.xngr.context.ServiceContext
addServiceContextListener, dispose, 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

getNode

public org.w3c.dom.Node getNode()
Returns:
the associated node, this node should not be changed.

getNodeServices

public java.util.List<NodeService> getNodeServices()
Returns:
a list of node-services, this is not a 'live' list.

getNodeMarkers

public java.util.List<NodeMarker> getNodeMarkers()
Returns:
a live-list of node-markers, modifications to the list will modify the list of node-markers.

getServices

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

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.

open

public void open(NodeService service)
Opens the supplied service using a newly created version of the Context's Node and an empty HashMap as arguments.

Parameters:
service - the node-service to open.

open

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

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

open

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

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

getIcon

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

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

getName

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

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

getDescription

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

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


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