|
||||||||||
| 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<S>
public abstract class StatefulViewable<S extends Stateful>
ViewableFrame with Stateful content.
StatefulViewable extends its superclass by
requiring both its SFrameTarget.framed content and all members of its SelectingFrame.selection()
to be Stateful, enabling the provision of
StatefulViewable.Clipper connection to the system clipboard
and drag and drop implementation
| Nested Class Summary | |
|---|---|
static interface |
StatefulViewable.Clipper
Can copy and paste the content of a StatefulViewable. |
static interface |
StatefulViewable.ClipperSource
Can supply a StatefulViewable with a suitable StatefulViewable.Clipper. |
| 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 | |
|---|---|
protected StatefulViewable.Clipper |
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 | |
|---|---|
protected |
StatefulViewable(java.lang.String title,
S content,
StatefulViewable.ClipperSource clipperSource)
Unique constructor. |
| Method Summary | |
|---|---|
boolean |
actionIsLive(SViewer viewer,
ViewableAction action)
Re-implementation that understands ActionViewerTarget.Actions. |
protected void |
actionTriggered(SViewer viewer,
ViewableAction action)
Re-implementation that understands ActionViewerTarget.Actions. |
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 |
canPaste()
|
protected boolean |
checkStateChange(Stateful stateThen,
Stateful stateNow)
Check for difference between two states of a content member. |
protected void |
copyContentState()
|
void |
copyStatefulSelection()
|
void |
deleteSelection()
|
boolean |
editSelection()
|
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... stateful)
|
void |
iterateSelection(boolean forward)
|
protected Stateful[] |
matchSelectionEdits(Stateful[] selections,
Stateful[] edits)
Ensure that the list of edits matches that of the content passed. |
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 Stateful[] |
newPasteStatefuls()
|
protected S[] |
newPasteTextStatefuls(java.lang.String text)
Attempt to create content from a text representation. |
static Stateful[] |
newStatefulArray(java.lang.Object[] array)
|
java.lang.String |
newStatefulsText(S[] selected)
Create a textual representation of one or more Statefuls for use in
data transfer. |
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 void |
restoreState(Stateful content,
Stateful state)
|
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? |
void |
updateAfterEditAction()
|
| Methods inherited from class facets.core.superficial.app.ViewableFrame |
|---|
newViewerSelection, viewerActions, viewerSelectionChanged, viewerSelectionEdited |
| Methods inherited from class facets.core.superficial.app.SelectingFrame |
|---|
defineSelection, selection, selectionFrame, setSelection |
| Methods inherited from class facets.core.superficial.SFrameTarget |
|---|
newDebugChildren, notifiesTargeter, title |
| Methods inherited from class facets.core.superficial.TargetCore |
|---|
elements, findMonitorOfType, isLive, join, lazyElements, 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 |
| Field Detail |
|---|
protected final StatefulViewable.Clipper clipper
| Constructor Detail |
|---|
protected StatefulViewable(java.lang.String title,
S content,
StatefulViewable.ClipperSource clipperSource)
title - passed to superclasscontent - passed to superclassclipperSource - if non-null will be used for data transfer| Method Detail |
|---|
public final void copyStatefulSelection()
protected final boolean canPaste()
protected final Stateful[] newPasteStatefuls()
public java.lang.String newStatefulsText(S[] selected)
Statefuls for use in
data transfer.
May be called (indirectly) from copyStatefulSelection();
default returns a debug string.
selected - are the currently selected contentpublic boolean textSeemsPastable(java.lang.String text)
Used to determine the live state of the viewer 'Paste' target; default
return false.
text - is currently on the system clipboardprotected S[] newPasteTextStatefuls(java.lang.String text)
Called by newPasteStatefuls();
may return null (the default) to signal failure.
text - is currently on the system clipboardpublic void iterateSelection(boolean forward)
public void insertStatefuls(Stateful... stateful)
public void deleteSelection()
public boolean editSelection()
protected void copyContentState()
public boolean actionIsLive(SViewer viewer,
ViewableAction action)
ActionViewerTarget.Actions.
actionIsLive in class ViewableFrameviewer - the active vieweraction - to be exposed
protected void actionTriggered(SViewer viewer,
ViewableAction action)
ActionViewerTarget.Actions.
actionTriggered in class ViewableFrameviewer - the active vieweraction - specifies the action proposedpublic final void updateAfterEditAction()
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 SFrameTargetstateSpec - must define the new state of SFrameTarget.framedinterim - if true the edit forms part of a sequence
protected Stateful[] matchSelectionEdits(Stateful[] selections,
Stateful[] edits)
Called from setFramedState(Object, boolean);
default returns the edits passed.
selections - from the current selectionedits - were passed to setFramedState(Object, boolean)
protected boolean checkStateChange(Stateful stateThen,
Stateful stateNow)
Called from setFramedState(Object, boolean);
default returns false.
stateThen - a copy of the previous statestateNow - the current state
protected 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()
NotifyingNotifying to specify a default Notifying.Impact.
impact in interface NotifyingNotifying.Impact.DEFAULTpublic java.lang.Object identity()
IdentifiedThis will usually be a class instance counter.
identity in interface Identifiedpublic final Notifiable monitor()
Notifiable in the notification tree,
as set with setMonitor.
Complains if no parent has been set.
monitor in interface Notifyingpublic void notify(Notice notice)
NotifiableNotice passed.
When this method is called, the Notifiable should
respond based on
Notice passed.
notify in interface Notifiablepublic final void notifyMonitor(Notifying.Impact impact)
Notifyingnotify 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 Notifyingimpact - suggests the level of retargeting requiredprotected boolean blockNotification()
Checked by notify(Notice); default returns false.
public final void setMonitor(Notifiable monitor)
NotifyingNotifying 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 | |||||||||