|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object facets.util.Tracer facets.core.superficial.TargetCore
public class TargetCore
Implements STarget
.
TargetCore
is the core implementation of STarget
,
extended both in this and other packages. It also serves as
a means of grouping other simple targets.
Nested Class Summary |
---|
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 | |
---|---|
static int |
targets
|
Fields inherited from interface facets.core.superficial.STarget |
---|
NONE |
Constructor Summary | |
---|---|
TargetCore(java.lang.String title)
Convenience constructor that sets no child elements. |
|
TargetCore(java.lang.String title,
STarget... elements)
Core constructor. |
Method Summary | ||
---|---|---|
protected boolean |
blockNotification()
Enables notification to be restricted to this member of the tree. |
|
STarget[] |
elements()
Implements interface method. |
|
static
|
findMonitorOfType(java.lang.Class<T> type,
STarget target)
Utility for finding a Notifiable ancestor in the notification tree. |
|
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 . |
|
boolean |
isLive()
Indicates whether the STarget should
be exposed by a surface facet as open to control eg 'enabled'. |
|
static STarget[] |
join(STarget[] head,
STarget[] tail)
|
|
protected STarget[] |
lazyElements()
Lazily creates element s for this target. |
|
Notifiable |
monitor()
The current Notifiable in the notification tree,
as set with setMonitor . |
|
protected TypedNode[] |
newDebugChildren()
Create a TypedNode[] representation of this Notifying
for debug purposes. |
|
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. |
|
STargeter |
newTargeter()
Create and return a targeter suitable for retargeting to this target. |
|
protected boolean |
notifiesTargeter()
Used to construct the notification tree. |
|
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 |
setElements(STarget[] elements)
Sets the STarget children of the TargetCore . |
|
void |
setLive(boolean live)
Sets the internal state used by isLive . |
|
void |
setMonitor(Notifiable monitor)
Attach the Notifying to a Notifiable parent
in the notification tree. |
|
java.lang.String |
title()
Return human-readable identifying text. |
|
java.lang.String |
toString()
|
|
boolean |
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 |
---|
public static int targets
Constructor Detail |
---|
public TargetCore(java.lang.String title)
public TargetCore(java.lang.String title, STarget... elements)
title
- should be suitable for return as the (immutable)
title
propertyelements
- may be null
(in which case
suitable elements may be created using lazyElements
); otherwise
passed to setElements(STarget[])
Method Detail |
---|
protected final void setElements(STarget[] elements)
STarget
children of the TargetCore
.
Intended for use in specialised subclass construction; elements set are thereafter immutable.
elements
- (which may not be null
nor contain null
members) will be returned as the elements
property.public final STarget[] elements()
If no elements have been set, attempts to create them with
lazyElements
.
Each call to this method also sets the TargetCore
as notification monitor of any element that is not a SFrameTarget
.
elements
in interface STarget
null
STarget
[]protected STarget[] lazyElements()
element
s for this target.
Called at most once from 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
[].
public STargeter newTargeter()
This is the key method used by Facets to implement dynamic
creation of a surface targeter tree. During initial retargeting
each TargeterCore
queries its target
for any child elements, and calls this method on each child
to obtain suitable STargeter
instances which
it then adds to its elements.
This method may be also called on subsequent retargetings
where the specific type of a target is subject
to change (for instance when it represents a selection).
Either the STargeter
returned can be matched
to an existing one to which facet have already been attached,
or such facet can be attached and the surface layout adjusted
accordingly.
public boolean isLive()
STarget
STarget
should
be exposed by a surface facet as open to control eg 'enabled'.
Returns true
only if both the following conditions are met:
STarget
itself is 'live' as constructed or
set by setLive
STarget
monitor also returns isLive
as
true
isLive
in interface STarget
public void setLive(boolean live)
STarget
isLive
.
setLive
in interface STarget
public java.lang.String title()
Titled
title
in interface Titled
null
, non-empty string with no structural whitespacepublic java.lang.String toString()
protected boolean notifiesTargeter()
NOTE This method must NOT be overridden in application code.
protected TypedNode[] newDebugChildren()
TypedNode[]
representation of this Notifying
for debug purposes.
public static final STarget[] join(STarget[] head, STarget[] tail)
public boolean wantsFocus()
wantsFocus
in interface STarget
public static final <T extends Notifiable> T findMonitorOfType(java.lang.Class<T> type, STarget target)
Notifiable
ancestor in the notification tree.
Searches up the tree from the current target of facet
.
target
- in tree exposed by calling facet
null
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 |