|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfacets.util.Tracer
facets.core.superficial.TargetCore
facets.core.superficial.SFrameTarget
facets.core.superficial.app.SelectingFrame
facets.core.superficial.app.ViewableFrame
facets.core.app.StatefulViewable<TypedNode>
facets.core.app.NodeViewable
public class NodeViewable
StatefulViewable
for tree-type content.
NodeViewable
extends its superclass by
SFrameTarget.framed
content to be a TypedNode
TypedNode
of all superclass methods, enabling its direct use by application code
Nested Class Summary |
---|
Nested classes/interfaces inherited from class facets.core.app.StatefulViewable |
---|
StatefulViewable.Clipper, StatefulViewable.ClipperSource |
Nested classes/interfaces inherited from interface facets.core.superficial.STarget |
---|
STarget.Targeted |
Nested classes/interfaces inherited from interface facets.core.superficial.Notifying |
---|
Notifying.Impact |
Field Summary |
---|
Fields inherited from class facets.core.app.StatefulViewable |
---|
clipper |
Fields inherited from class facets.core.superficial.SFrameTarget |
---|
framed |
Fields inherited from class facets.core.superficial.TargetCore |
---|
targets |
Fields inherited from interface facets.core.superficial.STarget |
---|
NONE |
Constructor Summary | |
---|---|
NodeViewable(TypedNode node)
|
|
NodeViewable(TypedNode root,
StatefulViewable.ClipperSource clipperSource)
|
Method Summary | |
---|---|
boolean |
actionIsLive(SViewer viewer,
ViewableAction action)
Re-implementation that understands ActionViewerTarget.Action s. |
protected void |
actionTriggered(SViewer viewer,
ViewableAction action)
Re-implementation that understands ActionViewerTarget.Action s. |
protected boolean |
blockNotification()
Enables notification to be restricted to this member of the tree. |
protected boolean |
canMergeEdits(Stateful[] earlier,
Stateful[] later)
Can one edit state subsume the other? |
protected boolean |
checkStateChange(Stateful stateThen,
Stateful stateNow)
Check for difference between two states of a content member. |
protected void |
copyContentState()
|
void |
defineSelection(java.lang.Object definition)
Re-implements abstract method. |
void |
deleteSelection()
|
java.lang.Object |
identity()
Return an object that is as far as possible unique for the implementation. |
Notifying.Impact |
impact()
Allows this Notifying to specify a default Notifying.Impact . |
void |
insertStatefuls(Stateful... statefuls)
|
void |
iterateSelection(boolean forward)
|
protected STarget[] |
lazyElements()
Lazily creates element s for this target. |
protected Stateful[] |
matchSelectionEdits(Stateful[] targets,
Stateful[] edits)
Re-implementation. |
Notifiable |
monitor()
The current Notifiable in the notification tree,
as set with setMonitor . |
protected static TypedNode |
newDebugContentNode(java.lang.String title,
java.lang.Object source)
|
protected static TypedNode |
newDebugContentNode(java.lang.String title,
java.lang.Object[] source)
|
protected static TypedNode |
newDebugMonitorNode(Notifiable monitor)
|
TypedNode |
newGraphNode()
Returns a descriptive node for use in debug object graph. |
protected PathSelection |
newNodeChangeSelection(TypedNode root,
TypedNode[] nodes,
boolean removing)
|
protected TypedNode[] |
newPasteTextStatefuls(java.lang.String text)
Attempt to create content from a text representation. |
static Stateful[] |
newStatefulArray(java.lang.Object[] array)
|
void |
notify(Notice notice)
Respond to the Notice passed. |
void |
notifyMonitor(Notifying.Impact impact)
Call notify on the parent monitor in the notification tree,
typically with itself as parameter to the Notice passed. |
protected PathSelection |
pathsFromRoot(PathSelection selection)
Converts viewer selections to full paths. |
protected void |
restoreState(Stateful content,
Stateful state)
|
protected TypedNode |
rootState()
|
SFrameTarget |
selectionFrame()
Default implementation for TypedNode tree. |
void |
setFramedState(java.lang.Object stateSpec,
boolean interim)
Overrides method from ViewableFrame . |
void |
setMonitor(Notifiable monitor)
Attach the Notifying to a Notifiable parent
in the notification tree. |
boolean |
textSeemsPastable(java.lang.String text)
Does the text passed seem to represent suitable content? |
protected void |
viewerSelectionChanged(SViewer viewer,
SSelection selection)
Respond to change in selection. |
Methods inherited from class facets.core.app.StatefulViewable |
---|
canPaste, copyStatefulSelection, editSelection, newPasteStatefuls, newStatefulsText, updateAfterEditAction |
Methods inherited from class facets.core.superficial.app.ViewableFrame |
---|
newViewerSelection, viewerActions, viewerSelectionEdited |
Methods inherited from class facets.core.superficial.app.SelectingFrame |
---|
selection, setSelection |
Methods inherited from class facets.core.superficial.SFrameTarget |
---|
newDebugChildren, notifiesTargeter, title |
Methods inherited from class facets.core.superficial.TargetCore |
---|
elements, findMonitorOfType, isLive, join, newTargeter, setElements, setLive, toString, wantsFocus |
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, wait, wait, wait |
Methods inherited from interface facets.core.superficial.Notifying |
---|
impact, monitor, notifyMonitor, setMonitor |
Methods inherited from interface facets.core.superficial.Notifiable |
---|
notify |
Constructor Detail |
---|
public NodeViewable(TypedNode node)
public NodeViewable(TypedNode root, StatefulViewable.ClipperSource clipperSource)
Method Detail |
---|
protected final void copyContentState()
copyContentState
in class StatefulViewable<TypedNode>
public SFrameTarget selectionFrame()
TypedNode
tree.
selectionFrame
in class SelectingFrame
protected STarget[] lazyElements()
TargetCore
element
s for this target.
Called at most once from TargetCore.elements()
.
Though defined in TargetCore
this method is primarily for use by
SFrameTarget
s, which always create their elements dynamically
by reimplementing this method.
Default implementation returns an empty STarget
[].
lazyElements
in class TargetCore
public void defineSelection(java.lang.Object definition)
defineSelection
in class SelectingFrame
definition
- is cast to a TypedNode
, a path to the content
root constructed and from this a PathSelection
which
is passed to SelectingFrame.setSelection(SSelection)
PLUS...protected void viewerSelectionChanged(SViewer viewer, SSelection selection)
ViewableFrame
Called from ViewerTargetCore.selectionChanged(SSelection)
, must
interpret a new viewer selection in terms of the complete content.
Default implementation calls SelectingFrame.setSelection(SSelection)
with
selection
.
viewerSelectionChanged
in class ViewableFrame
viewer
- in which the change took placeselection
- the new selection in the viewerprotected final PathSelection pathsFromRoot(PathSelection selection)
Traces the path from the indexed
of each path in
selection
to the content root.
selection
- to be convertedpublic boolean actionIsLive(SViewer viewer, ViewableAction action)
StatefulViewable
ActionViewerTarget.Action
s.
actionIsLive
in class StatefulViewable<TypedNode>
viewer
- the active vieweraction
- to be exposedprotected void actionTriggered(SViewer viewer, ViewableAction action)
StatefulViewable
ActionViewerTarget.Action
s.
actionTriggered
in class StatefulViewable<TypedNode>
viewer
- the active vieweraction
- specifies the action proposedpublic void insertStatefuls(Stateful... statefuls)
insertStatefuls
in class StatefulViewable<TypedNode>
public void iterateSelection(boolean forward)
iterateSelection
in class StatefulViewable<TypedNode>
public void deleteSelection()
deleteSelection
in class StatefulViewable<TypedNode>
protected final PathSelection newNodeChangeSelection(TypedNode root, TypedNode[] nodes, boolean removing)
public boolean textSeemsPastable(java.lang.String text)
StatefulViewable
Used to determine the live state of the viewer 'Paste' target; default
return false
.
textSeemsPastable
in class StatefulViewable<TypedNode>
text
- is currently on the system clipboardprotected TypedNode[] newPasteTextStatefuls(java.lang.String text)
StatefulViewable
Called by StatefulViewable.newPasteStatefuls()
;
may return null
(the default) to signal failure.
newPasteTextStatefuls
in class StatefulViewable<TypedNode>
text
- is currently on the system clipboardprotected Stateful[] matchSelectionEdits(Stateful[] targets, Stateful[] edits)
Matches based on TypedNode.type()
and StatefulCore.title()
.
targets
- from the current selectionedits
- were passed to setFramedState(Object, boolean)
protected final TypedNode rootState()
public void setFramedState(java.lang.Object stateSpec, boolean interim)
ViewableFrame
.
Having converted both stateSpec
and
the PathSelection.selections()
of SelectingFrame.selection()
to Stateful
[],
matchSelectionEdits(Stateful[], Stateful[])
checkStateChange(Stateful, Stateful)
Stateful.setState(Object)
in each path target with
the appropriate edit
setFramedState
in class SFrameTarget
stateSpec
- must define the new state of SFrameTarget.framed
interim
- if true
the edit forms part of a sequenceprotected boolean checkStateChange(Stateful stateThen, Stateful stateNow)
Called from setFramedState(Object, boolean)
;
default returns false
.
stateThen
- a copy of the previous statestateNow
- the current stateprotected boolean canMergeEdits(Stateful[] earlier, Stateful[] later)
Called (indirectly) from setFramedState(Object, boolean)
; default is false
earlier
- the previous editlater
- the new edit which may subsume earlier
protected void restoreState(Stateful content, Stateful state)
public static final Stateful[] newStatefulArray(java.lang.Object[] array)
protected static final TypedNode newDebugContentNode(java.lang.String title, java.lang.Object source)
protected static final TypedNode newDebugContentNode(java.lang.String title, java.lang.Object[] source)
protected static final TypedNode newDebugMonitorNode(Notifiable monitor)
public final TypedNode newGraphNode()
public Notifying.Impact impact()
Notifying
Notifying
to specify a default Notifying.Impact
.
impact
in interface Notifying
Notifying.Impact.DEFAULT
public java.lang.Object identity()
Identified
This will usually be a class instance counter.
identity
in interface Identified
public final Notifiable monitor()
Notifiable
in the notification tree,
as set with setMonitor
.
Complains if no parent has been set.
monitor
in interface Notifying
public void notify(Notice notice)
Notifiable
Notice
passed.
When this method is called, the Notifiable
should
respond based on
Notice
passed.
notify
in interface Notifiable
public final void notifyMonitor(Notifying.Impact impact)
Notifying
notify
on the parent monitor in the notification tree,
typically with itself as parameter to the Notice
passed.
Has no effect if no monitor has been set.
This is the usual means to trigger a surface retargeting, being called
by an exposing SFacet
on its target.
notifyMonitor
in interface Notifying
impact
- suggests the level of retargeting requiredprotected boolean blockNotification()
Checked by notify(Notice)
; default returns false
.
public final void setMonitor(Notifiable monitor)
Notifying
Notifying
to a Notifiable
parent
in the notification tree.
setMonitor
in interface Notifying
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |