facets.facet.app.tree
Class TreeAppSpecifier

java.lang.Object
  extended by facets.util.Tracer
      extended by facets.util.app.AppValues
          extended by facets.core.app.AppSpecifier
              extended by facets.facet.app.FacetAppSpecifier
                  extended by facets.facet.app.tree.TreeAppSpecifier
Direct Known Subclasses:
XmlView

public abstract class TreeAppSpecifier
extends FacetAppSpecifier

FacetAppSpecifier for simple applications with DataNode content.

TreeAppSpecifier exemplifies practical use of the superclass with a ViewerContenter (here TreeAppContenter) that provides the detail functionality. It also demonstrates with newContentRootTargets() and newTreeMenuItems(FacetFactory, STargeter[], STargeter[]) the key Superficial mechanism for binding data abstracted as STargets to widgets abstracted as SFacets via an automatically-generated STargeter tree.

Concrete applications can be readily created by extending TreeAppSpecifier and types such as:

See Also:
XmlView

Field Summary
 
Fields inherited from class facets.facet.app.FacetAppSpecifier
ARG_NO_CREATE, ARG_NO_FILES, DRAG_WAIT_MIN, KEY_DEBUG_STATUS, KEY_DRAG_NOTIFY, KEY_DRAG_PAUSE, KEY_DRAG_WAIT, KEY_GRAPH_BUILD, KEY_GRAPH_FIND, KEY_GRAPH_OFFSETS, KEY_GRAPH_SPLIT, KEY_GRAPH_WHERE, KEY_SPLASH, KEY_TEXT_ALIASING
 
Fields inherited from class facets.util.app.AppValues
appName, KEY_TIMEOUT, KEY_TIMEOUT_SYSTEM, NATURE_DEBUG, NATURE_NO_SYSTEM_ACCESS, NATURE_RECORD_RUNS, NATURE_WRITABLE, PATH_APP, PATH_CORE, PATH_CORE_APP, PATH_CORE_DEBUG, PATH_DEBUG, PATH_RUNS, stateDebug, TYPE_NATURE, TYPE_STATE
 
Constructor Summary
TreeAppSpecifier(java.lang.Class appClass)
          Unique constructor.
 
Method Summary
protected  java.lang.Object getInternalContentSource()
          Fulfils FacetAppSurface.getInternalContentSource() in the return of newApp(FacetFactory).
protected  AppActions newActions(ActionAppSurface app)
          Locks superclass implementation.
protected  FacetAppSurface newApp(FacetFactory ff)
          Final implementation.
protected  STarget[] newContentRootTargets()
          Enables definition of additional STargets to be exposed in the TreeTargets.TITLE_MENU menu.
protected  SView[] newContentViews(NodeViewable viewable)
          Enables redefinition of SViews supplying viewer policy.
protected  SFacet[] newTreeMenuItems(FacetFactory ff, STargeter[] treeLinks, STargeter[] contentLinks)
          Defines SFacet items for the TreeTargets.TITLE_MENU menu.
protected  XmlPolicy xmlPolicy()
          Defines an XmlPolicy for the application content.
 
Methods inherited from class facets.facet.app.FacetAppSpecifier
addNatureDefaults, addStateDefaults, adjustClassValues, buildAndLaunchApp, canCreateContent, canSaveContent, contentStyle, decorationValues, isFileApp, joinValues, newFacetFactory, newPreferences, toolkitType
 
Methods inherited from class facets.core.app.AppSpecifier
app, canEditContent, canOverwriteContent, offersHelp
 
Methods inherited from class facets.util.app.AppValues
hasSystemAccess, nature, readValues, state, traceOutput, tryWriteValues
 
Methods inherited from class facets.util.Tracer
trace, trace, trace, trace, trace, traceDebug, traceDebug, traceObjectText, traceOutputWithClass
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeAppSpecifier

public TreeAppSpecifier(java.lang.Class appClass)
Unique constructor.

Parameters:
appClass - passed to superclass
Method Detail

newActions

protected final AppActions newActions(ActionAppSurface app)
Locks superclass implementation.

Overrides:
newActions in class FacetAppSpecifier
Parameters:
app - TODO
Returns:
by default either a FacetAppActions or a FileAppActions depending on FacetAppSpecifier.isFileApp()

newApp

protected final FacetAppSurface newApp(FacetFactory ff)
Final implementation.

The FacetAppSurface returned calls out to getInternalContentSource() and to XmlPolicy.fileSpecifiers() via xmlPolicy(); it creates TreeAppContenters.

Specified by:
newApp in class FacetAppSpecifier
Parameters:
ff - created in FacetAppSpecifier.newFacetFactory()
Returns:
a FacetAppSurface that will create content and the surface to expose it

xmlPolicy

protected XmlPolicy xmlPolicy()
Defines an XmlPolicy for the application content.

Called by the return of newApp(FacetFactory) and by TreeAppContenter.saveToSink(Object).

Returns:
by default a plain XmlPolicy

getInternalContentSource

protected java.lang.Object getInternalContentSource()
Fulfils FacetAppSurface.getInternalContentSource() in the return of newApp(FacetFactory).

Returns:
by default Nodes.newTestTree(String, int, double) with broad=5 which may be changed by passing ARG_TREE_SIZE=broad

newContentViews

protected SView[] newContentViews(NodeViewable viewable)
Enables redefinition of SViews supplying viewer policy.

Called from TreeAppContenter.newContentViewers(ViewableFrame).

Parameters:
viewable - has the content as its SFrameTarget.framed
Returns:
by default a single TreeView

newContentRootTargets

protected STarget[] newContentRootTargets()
Enables definition of additional STargets to be exposed in the TreeTargets.TITLE_MENU menu.

Called from TreeAppContenter.lazyContentRootElements(SAreaTarget).

Returns:
targets whose STargeters will be passed to newTreeMenuItems(FacetFactory, STargeter[], STargeter[]); by default an empty STarget[]

newTreeMenuItems

protected SFacet[] newTreeMenuItems(FacetFactory ff,
                                    STargeter[] treeLinks,
                                    STargeter[] contentLinks)
Defines SFacet items for the TreeTargets.TITLE_MENU menu.

Called from TreeAppFacets.adjustMenuRoots(MenuFacets[])

Parameters:
ff - the calling TreeAppFacets
treeLinks - exposing TreeTargets.appTargets()
contentLinks - targeting returns (if any) of newContentRootTargets()
Returns:
by default treeAppFacets indexed with TreeTargets.TARGET_SEARCH, TreeTargets.TARGET_ENCODE,TreeTargets.TARGET_TYPE,