org.dspace.app.xmlui.wing.element
Class Options

java.lang.Object
  extended by org.dspace.app.xmlui.wing.element.AbstractWingElement
      extended by org.dspace.app.xmlui.wing.element.Options
All Implemented Interfaces:
WingElement, WingMergeableElement

public class Options
extends AbstractWingElement
implements WingMergeableElement

A class representing a set of navigational options.

Author:
Scott Phillips

Field Summary
static String E_OPTIONS
          The name of the options element
 
Fields inherited from class org.dspace.app.xmlui.wing.element.AbstractWingElement
context
 
Constructor Summary
protected Options(WingContext context)
          Generate a new Options framework element.
 
Method Summary
 List addList(String name)
          Add a new sublist to this item.
 List addList(String name, String type, String rend)
          Add a new sublist to this item.
 void dispose()
          dispose
 Attributes merge(Attributes attributes)
          Inform the options element that it is being merged with an existing options element.
 WingMergeableElement mergeChild(String namespace, String localName, String qName, Attributes attributes)
          Find the sublist that this SAX event represents.
 boolean mergeEqual(String namespace, String localName, String qName, Attributes attributes)
          Return true if this SAX Event an options element?
 void toSAX(ContentHandler contentHandler, LexicalHandler lexicalHandler, NamespaceSupport namespaces)
          Translate this element and all contained elements into SAX events.
 
Methods inherited from class org.dspace.app.xmlui.wing.element.AbstractWingElement
endElement, endElement, getWingContext, greater, lesser, require, require, requireFalse, requireTrue, restrict, sendCharacters, setWingContext, startElement, startElement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

E_OPTIONS

public static final String E_OPTIONS
The name of the options element

See Also:
Constant Field Values
Constructor Detail

Options

protected Options(WingContext context)
           throws WingException
Generate a new Options framework element.

Parameters:
context - (Required) The context this element is contained in.
Throws:
WingException
Method Detail

addList

public List addList(String name,
                    String type,
                    String rend)
             throws WingException
Add a new sublist to this item. Note that an item may contain either characters (with formating & fields) or lists but not both.

Parameters:
name - (Required) a local identifier used to differentiate the element from its siblings.
type - (May be null) determines the list type. If this is blank the list type is infered from the context and use.
rend - (May be null) a rendering hint used to override the default display of the element.
Returns:
A new sub list.
Throws:
WingException

addList

public List addList(String name)
             throws WingException
Add a new sublist to this item. Note that an item may contain either characters (with formating & fields) or lists but not both.

Parameters:
name - (Required) a local identifier used to differentiate the element from its siblings.
Returns:
A new sub list.
Throws:
WingException

mergeEqual

public boolean mergeEqual(String namespace,
                          String localName,
                          String qName,
                          Attributes attributes)
Return true if this SAX Event an options element?

Specified by:
mergeEqual in interface WingMergeableElement
Parameters:
namespace - The element's name space
localName - The local, unqualified, name for this element
qName - The qualified name for this element
attributes - The element's attributes
Returns:
Return true if this SAX Event an options element?

mergeChild

public WingMergeableElement mergeChild(String namespace,
                                       String localName,
                                       String qName,
                                       Attributes attributes)
                                throws SAXException,
                                       WingException
Find the sublist that this SAX event represents.

Specified by:
mergeChild in interface WingMergeableElement
Parameters:
namespace - The element's name space
localName - The local, unqualified, name for this element *
qName - The qualified name for this element
attributes - The element's attributes
Returns:
Return the sublist
Throws:
SAXException
WingException

merge

public Attributes merge(Attributes attributes)
                 throws SAXException,
                        WingException
Inform the options element that it is being merged with an existing options element.

Specified by:
merge in interface WingMergeableElement
Returns:
The attributes for this merged element
Throws:
SAXException
WingException

toSAX

public void toSAX(ContentHandler contentHandler,
                  LexicalHandler lexicalHandler,
                  NamespaceSupport namespaces)
           throws SAXException
Translate this element and all contained elements into SAX events. The events should be routed to the contentHandler found in the WingContext.

Specified by:
toSAX in interface WingElement
Parameters:
contentHandler - (Required) The registered contentHandler where SAX events should be routed too.
lexicalHandler - (Required) The registered lexicalHandler where lexical events (such as CDATA, DTD, etc) should be routed too.
namespaces - (Required) SAX Helper class to keep track of namespaces able to determine the correct prefix for a given namespace URI.
Throws:
SAXException

dispose

public void dispose()
dispose

Specified by:
dispose in interface WingElement
Overrides:
dispose in class AbstractWingElement


Copyright © 2012 DuraSpace. All Rights Reserved.