|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfacets.util.Tracer
facets.core.app.DialogSurface
public abstract class DialogSurface
Implements SSurface for modal dialogs.
DialogSurface can build different dialog styles
depending on the DialogSurface.Contenters passed to its constructor
and the methods overriden in the instance subclass.
DialogSurface.Contenter,
from which a content root is created and added as the single
page.
DialogSurface.Contenters,
from which the content roots are added as children of a single
page.
SAreaTarget
values are added as pages.
| Nested Class Summary | |
|---|---|
static interface |
DialogSurface.Contenter
SContenter for use in a DialogSurface. |
static class |
DialogSurface.ContentRoot
Heads a content area tree for use in a dialog page. |
static class |
DialogSurface.DialogActions
Defines top-level buttons for a DialogSurface. |
| Field Summary | |
|---|---|
ActionAppSurface |
app
|
static int |
AT_NOT_SET
|
static int |
MULTI_AREA_PAGES
|
static int |
MULTI_AREA_TREE
|
static int |
TRIMMINGS_TAB
|
static int |
TRIMMINGS_TREE
|
| Constructor Summary | |
|---|---|
DialogSurface(ActionAppSurface app,
DialogHost host,
java.lang.String title,
DialogSurface.DialogActions actions,
DialogSurface.Contenter[] contents)
Unique constructor. |
|
| Method Summary | |
|---|---|
protected abstract void |
attachPageFacet(SAreaTarget page)
Attach a suitable facet to this page area. |
protected abstract void |
attachSurfaceRootFacets(SAreaTarget surfaceRoot)
Attach suitable facets to the dialog area root and its children. |
void |
buildRetargeted()
Builds the dialog surface. |
DialogSurface.Contenter[] |
contents()
The contenters for the surface. |
static java.lang.Object |
contentsKey(DialogSurface.Contenter[] contents)
Creates a key representing the exact types of the SContenters
passed. |
protected boolean |
contentsMatch(DialogSurface.Contenter[] existing,
DialogSurface.Contenter[] proposed)
Do the types of the two arrays match? |
void |
dismissHostWindow()
Enables top-level buttons to dismiss the dialog host. |
static STarget |
findDialogTrigger(SContentRootTargeter rootTargeter,
java.lang.String title)
|
static SAreaTarget |
findRootArea(SContentRootTargeter rootTargeter)
Convenience method for accessing the surface area root. |
java.awt.Rectangle |
getLaunchBounds(SAreaTarget areaRoot)
Allows the host to calculate/retrieve its bounds before launch. |
SHost |
host()
|
void |
hostWindowDismissed(java.awt.Rectangle bounds)
Allows the surface tidy up upon dismissal of its host. |
protected boolean |
isMultiPage()
Required to ensure correct calculation of default host size. |
protected SAreaTarget[] |
newContentPages(DialogSurface.Contenter[] contents,
SAreaTarget[] contentRoots)
Create at least one dialog page. |
protected abstract SFacet |
newControlButtons(STargeter link)
Create facet managing the top-level dialog control buttons. |
protected SFacet |
newExtras(AreaTargeter targeter)
|
protected SView |
newPagesTreeView(TypedNode[] treeNodes)
Create a view for the page tree. |
protected static TypedNode |
newPageTreeNode(SAreaTarget page,
TypedNode... children)
Creates a node for a page selection tree. |
protected TypedNode[] |
newPageTreeNodes(SAreaTarget[] pages)
Creates the top-level children of a page selection tree. |
void |
notify(Notice notice)
Implements interface method. |
boolean |
persistBoundsState()
Should host bounds be persisted? |
void |
replaceContents(DialogSurface.Contenter[] contents)
Replaces all content in the surface. |
AreaTargeter |
surfaceRootTargeter()
|
java.lang.String |
title()
Return human-readable identifying text. |
| Methods inherited from class facets.util.Tracer |
|---|
trace, trace, trace, trace, trace, traceDebug, traceDebug, traceObjectText, traceOutput, traceOutputWithClass |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface facets.core.superficial.app.SSurface |
|---|
host, surfaceRootTargeter |
| Methods inherited from interface facets.util.Titled |
|---|
title |
| Field Detail |
|---|
public static final int TRIMMINGS_TAB
public static final int TRIMMINGS_TREE
public static final int AT_NOT_SET
public final ActionAppSurface app
public static final int MULTI_AREA_TREE
public static final int MULTI_AREA_PAGES
| Constructor Detail |
|---|
public DialogSurface(ActionAppSurface app,
DialogHost host,
java.lang.String title,
DialogSurface.DialogActions actions,
DialogSurface.Contenter[] contents)
app - exposed in this surface; stored as apphost - the DialogHost managing the dialog windowtitle - passed to the host dialog windowactions - the DialogSurface.DialogActions defining a set of control actions for the dialogcontents - the DialogSurface.Contenters defining the content to be exposed in the dialog| Method Detail |
|---|
public static final java.lang.Object contentsKey(DialogSurface.Contenter[] contents)
SContenters
passed.
Used to implement replaceContents(Contenter[]);
available for use by
any class requiring a definition of the composite type of a SContenter[]
contents - define the key returned by their typespublic final void buildRetargeted()
All surface variants are built by the same code, with execution path determined primarily by whether it builds a single or multiple page layout.
DialogSurface.Contenters passed to the constructor,
and passed to newContentPages(DialogSurface.Contenter[], SAreaTarget[]).attachPageFacet(SAreaTarget) to
any pages returned that are not content roots
(and thus already have facet attached). attachSurfaceRootFacets(SAreaTarget).newPageTreeNodes(SAreaTarget[])
which defines nodes for a page selection tree, and these
nodes passed to newPagesTreeView(TypedNode[]);
from this a viewer area is created which is one of two
children of the root area, the other being an area containing
the pages.
buildRetargeted in interface SSurfacepublic void replaceContents(DialogSurface.Contenter[] contents)
Existing content roots are replaced by roots created by
each member of contents, whose types must match
exactly those of the existing contents.
contents - replace existing contentspublic void notify(Notice notice)
notify in interface Notifiablepublic final java.awt.Rectangle getLaunchBounds(SAreaTarget areaRoot)
Default size may be retrieved from AppValues.nature(boolean) using
keys headed with Dialogs.KEYTOP_NATURE_SIZE; and
session bounds from AppValues.state(String...) using
Dialogs.KEYTOP_BOUNDS.
areaRoot - root of the SAreaTarget content treepublic final void hostWindowDismissed(java.awt.Rectangle bounds)
bounds - latest of host windowpublic boolean persistBoundsState()
true by defaultpublic final void dismissHostWindow()
protected boolean isMultiPage()
Default returns false.
protected final boolean contentsMatch(DialogSurface.Contenter[] existing,
DialogSurface.Contenter[] proposed)
Called by replaceContents(Contenter[]);
implemented with contentsKey(Contenter[]).
existing - set during initial build or last launchproposed - for this launchpublic final DialogSurface.Contenter[] contents()
replaceContents
public static STarget findDialogTrigger(SContentRootTargeter rootTargeter,
java.lang.String title)
public static final SAreaTarget findRootArea(SContentRootTargeter rootTargeter)
rootTargeter - within the area targeter treeprotected SFacet newExtras(AreaTargeter targeter)
protected SAreaTarget[] newContentPages(DialogSurface.Contenter[] contents,
SAreaTarget[] contentRoots)
Where the implementation returns a multi-member array,
newPagesTreeView(TypedNode[]) to define a tree/list viewer
to select between the pages;
for a full tree viewer newPageTreeNodes(SAreaTarget[]) will also
need to be re-implementedattachSurfaceRootFacets(SAreaTarget) will
contain the tree viewer area and an area containing the pagesThe default implementation defines a single-page dialog by returning a single-member array containing:
contentRoots is single-membered, that member
contentRoots
(whose root facet can be displayed as tab children of the facet
attached to the area), titled from {title()
contents - passed during construction or to
replaceContents(DialogSurface.Contenter[]);
may be queried for additional information such as page titlescontentRoots - were created from contents
SAreaTarget[] with at least one memberprotected TypedNode[] newPageTreeNodes(SAreaTarget[] pages)
Children created will be passed to newPagesTreeView(TypedNode[])
which should be reimplemented to define a viewer for the
tree.
The default implementation returns an array constructed from
panelAreas using newPageTreeNode(SAreaTarget,TypedNode[])
and suitable for a list viewer; this method can also be used to created
more complex trees.
pages - were returned from newContentPages(DialogSurface.Contenter[], SAreaTarget[])protected SView newPagesTreeView(TypedNode[] treeNodes)
The SView returned should define a suitable
viewer for the tree defined by treeNodes, which
were returned by newPageTreeNodes(SAreaTarget[]).
Default implementation is an invalid stub.
treeNodes - will have at least two membersprotected abstract void attachPageFacet(SAreaTarget page)
page - was returned by newContentPages(DialogSurface.Contenter[], SAreaTarget[]) and
will not itself be a content root.protected abstract void attachSurfaceRootFacets(SAreaTarget surfaceRoot)
surfaceRoot - contains either a single page area returned by
newContentPages(DialogSurface.Contenter[], SAreaTarget[]) or viewer and switching
areas managing multiple page areasprotected abstract SFacet newControlButtons(STargeter link)
link - will match the elements returned by lazyTriggerGroup()
SFacet[] with at least one memberpublic final AreaTargeter surfaceRootTargeter()
public final java.lang.String title()
Titled
title in interface Titlednull, non-empty string with no structural whitespace
protected static final TypedNode newPageTreeNode(SAreaTarget page,
TypedNode... children)
The node returned will
type TYPE_PAGE
title the title of panelRoot
panelRoot as its single value
children as its children
page - should be an area tree defining the layout
of a dialog pagechildren - to appear in a tree viewer
below the node created; themselves created using this methodpublic final SHost host()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||