org.nakedobjects.plugins.dnd.viewer.tree
Class OpenObjectNodeSpecification

java.lang.Object
  extended by org.nakedobjects.plugins.dnd.viewer.tree.CompositeNodeSpecification
      extended by org.nakedobjects.plugins.dnd.viewer.tree.OpenObjectNodeSpecification
All Implemented Interfaces:
CompositeViewSpecification, SubviewSpec, ViewSpecification

public class OpenObjectNodeSpecification
extends CompositeNodeSpecification

Specification for a tree node that will display an open object as a root node or within an object.

See Also:
for displaying a closed collection within an object.

Field Summary
static int CAN_OPEN
           
static int CANT_OPEN
           
static int UNKNOWN
           
 
Fields inherited from class org.nakedobjects.plugins.dnd.viewer.tree.CompositeNodeSpecification
builder
 
Constructor Summary
OpenObjectNodeSpecification()
           
 
Method Summary
 boolean canDisplay(Content content, ViewRequirement requirement)
          This is only used to control root nodes.
 int canOpen(Content content)
           
 View createView(Content content, ViewAxis axis)
          Create a new view to this specification for the specified context, and using the specified axis if specified (which can be null).
 java.lang.String getName()
           
 boolean isAligned()
          Return true if the generated views are to have their sizes adjusted so they are consistent with surrounding views.
 boolean isOpen()
          Indicates whether views to this specification are open - displaying the attributes of the content object - or are closed - display only the title of the content object.
 boolean isReplaceable()
          Indicates whether this view can be replaced with another view (for the same value or reference).
 boolean isResizeable()
          Indicates if this view can handled being resized.
 boolean isSubView()
           
 
Methods inherited from class org.nakedobjects.plugins.dnd.viewer.tree.CompositeNodeSpecification
createNodeView, createSubview, decorateSubview, getSubviewBuilder, setCollectionSubNodeSpecification, setObjectSubNodeSpecification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.nakedobjects.plugins.dnd.ViewSpecification
createView, isAligned, isReplaceable, isResizeable
 

Field Detail

CAN_OPEN

public static final int CAN_OPEN
See Also:
Constant Field Values

CANT_OPEN

public static final int CANT_OPEN
See Also:
Constant Field Values

UNKNOWN

public static final int UNKNOWN
See Also:
Constant Field Values
Constructor Detail

OpenObjectNodeSpecification

public OpenObjectNodeSpecification()
Method Detail

canDisplay

public boolean canDisplay(Content content,
                          ViewRequirement requirement)
This is only used to control root nodes. Therefore a object tree can only be displayed for an object with fields that are collections.


canOpen

public int canOpen(Content content)

isOpen

public boolean isOpen()
Description copied from interface: ViewSpecification
Indicates whether views to this specification are open - displaying the attributes of the content object - or are closed - display only the title of the content object.

Specified by:
isOpen in interface ViewSpecification

isSubView

public boolean isSubView()
Specified by:
isSubView in interface ViewSpecification

getName

public java.lang.String getName()

createView

public final View createView(Content content,
                             ViewAxis axis)
Description copied from interface: ViewSpecification
Create a new view to this specification for the specified context, and using the specified axis if specified (which can be null).

Specified by:
createView in interface ViewSpecification

isAligned

public boolean isAligned()
Description copied from interface: ViewSpecification
Return true if the generated views are to have their sizes adjusted so they are consistent with surrounding views.

Specified by:
isAligned in interface ViewSpecification

isReplaceable

public boolean isReplaceable()
Description copied from interface: ViewSpecification
Indicates whether this view can be replaced with another view (for the same value or reference).

Specified by:
isReplaceable in interface ViewSpecification
Returns:
true if it can be replaced by another view; false if it can't be replaces

isResizeable

public boolean isResizeable()
Description copied from interface: ViewSpecification
Indicates if this view can handled being resized. If it can't then the viewer can put it in a scroll border.

Specified by:
isResizeable in interface ViewSpecification


Copyright © 2001-2009 Naked Objects Group Ltd.. All Rights Reserved.