fedora.client.objecteditor
Class ContentHandlerFactory

java.lang.Object
  extended by fedora.client.objecteditor.ContentHandlerFactory

public abstract class ContentHandlerFactory
extends java.lang.Object

Provides type-appropriate ContentViewer and ContentEditor instances.


Constructor Summary
ContentHandlerFactory()
           
 
Method Summary
static ContentEditor getEditor(java.lang.String type, java.io.InputStream data)
          Get an editor for the given type, initialized with the given data.
static ContentViewer getViewer(java.lang.String type, java.io.InputStream data)
          Get a viewer for the given type, initialized with the given data.
static boolean hasEditor(java.lang.String type)
          Can the factory provide an editor for the given type?
static boolean hasViewer(java.lang.String type)
          Can the factory provide a viewer for the given type?
static void register(ContentViewer handler)
          Registers a viewer or editor with the factory.
static boolean viewerIsEditor(java.lang.String type)
          If a viewer would be provided for the given type, is that viewer also an editor?
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContentHandlerFactory

public ContentHandlerFactory()
Method Detail

register

public static void register(ContentViewer handler)
Registers a viewer or editor with the factory. Before the factory is used, all needed editors and viewers should be registered (in that order). Order is important here because all editors are considered viewers by default. If a separate viewer is registered after an editor that handles the same type, that viewer will be the one provided via getViewer. In general, the last viewers/editors passed in will have the most precendence.


hasViewer

public static boolean hasViewer(java.lang.String type)
Can the factory provide a viewer for the given type?


viewerIsEditor

public static boolean viewerIsEditor(java.lang.String type)
If a viewer would be provided for the given type, is that viewer also an editor?


hasEditor

public static boolean hasEditor(java.lang.String type)
Can the factory provide an editor for the given type?


getViewer

public static ContentViewer getViewer(java.lang.String type,
                                      java.io.InputStream data)
                               throws java.io.IOException
Get a viewer for the given type, initialized with the given data. This should only be called if the caller knows there is a viewer for the type.

Throws:
java.io.IOException

getEditor

public static ContentEditor getEditor(java.lang.String type,
                                      java.io.InputStream data)
                               throws java.io.IOException
Get an editor for the given type, initialized with the given data. This should only be called if the caller knows there is an editor for the type.

Throws:
java.io.IOException