Package com.iizix.event
Class PropFocusEvent
- java.lang.Object
- com.iizix.event.GEvent
- com.iizix.event.BubbleEvent
- com.iizix.event.PropFocusEvent
- All Implemented Interfaces:
IPostEventProcessing
public class PropFocusEvent extends BubbleEvent
The focus event send to the property receiving losing and focus, its listeners and the parents respectively.Focus processing is done in the following order:
- Focus is changed in the focus engine without notification, i.e. the call to
IFocusEngine.getCurrentFocus()
will reflect the new focus component,
- If the receiving focus component is non-null: focus veto processing using the focus listeners registered in the
IFocusEngine
using theIFocusVetoListener
interface. If theFocusVetoException
is thrown, the original focus is restored in the focus engine without notification.
- Focus lost sent to the component losing focus using method
IFocusComp.onFocusLost(IFocusComp, IGProp, boolean)
in the eventFocusEvent
.
- Focus lost is notified in a bubbling event
PropFocusEvent
to the component losing focus and its parents. withisFocusLost()
true
.
- Focus lost is notified in a sinking event
PropCnrFocusEvent
to the component losing focus and its descendants withPropCnrFocusEvent.isFocusLost()
true
.
- Focus change sent to the focus listeners registered in the
IFocusEngine
usingIFocusListener.onFocusChanged(FocusEvent)
.
- Focus gained sent to the component gaining focus using method
IFocusComp.onFocusGained(IFocusComp, IGProp, boolean)
in the eventFocusEvent
.
- Focus gained is notified in a bubbling event
PropFocusEvent
to the component gaining focus and its parents. withisFocusGained()
true
.
- Focus gained is notified in a sinking event
PropCnrFocusEvent
to the component gaining focus and its descendants withPropCnrFocusEvent.isFocusGained()
true
.
- Author:
- Christopher Mindus
Nested Class Summary
Nested classes/interfaces inherited from class com.iizix.event.GEvent
GEvent.Operation
Field Summary
Fields inherited from class com.iizix.event.GEvent
PROP_ADDED, PROP_ATTR_CHANGED, PROP_CNR_ADDED, PROP_CNR_FOCUS, PROP_CNR_MOVED, PROP_CNR_RENAMED, PROP_DESIGNER_ASSET_CHANGED, PROP_DESIGNER_JAVA_CLASS_CHANGED, PROP_DESIGNER_JAVA_METHOD_RENAMED, PROP_DESIGNER_KSTRING, PROP_DESIGNER_VIEWER_UPDATE, PROP_DESIGNER_VS_REFERENCE, PROP_DISPOSED, PROP_FOCUS, PROP_MOVED_FROM, PROP_MOVED_TO, PROP_PROJECT_RENAMED, PROP_QUERY_DESIGNER_PROPS, PROP_REFRESH, PROP_REMOVED, PROP_RENAMED, PROP_REORDERED, PROP_RESOLVE_REFERENCES_DIRECT, PROP_VALUE_CHANGED, REMOTE
Constructor Summary
Constructors Constructor Description PropFocusEvent(IFocusComp comp, boolean isGained, IFocusComp focusGainedComponent, IFocusComp focusLostComponent, IGProp<?> trigger, boolean isRemoteInduced)
Constructs a new focus event.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IFocusComp
getFocusGainedComponent()
Retrieves the component that receives focus,null
for none.IFocusComp
getFocusLostComponent()
Retrieves the opposite component that previously had focus,null
for none.GProp<?>
getTrigger()
Gets the trigger property.boolean
isClearCacheEvent()
Returns the state for a property container if this event is received in theonEventSelf
method as a helper for it would need to clear the property container cache.boolean
isFocusGained()
Returns if this is a Focus Gained Event.boolean
isFocusLost()
Returns if this is a Focus Lost Event.boolean
isHistoryEntryRequested()
Returns the flag for history entry requested.protected java.lang.StringBuilder
paramString(java.lang.StringBuilder buf)
Returns the parameter string representing the state of this event.void
requestHistoryEntry()
Requests a history event from the focus engine.Methods inherited from class com.iizix.event.BubbleEvent
getOperations
Methods inherited from class com.iizix.event.GEvent
addPostProcessor, cancel, consume, getAlternateDestination, getEventID, getEventName, getEventName, getEventTarget, getOperation, getPostProcessors, getSender, getSource, isCancelled, isConsumed, isEventProcessed, isPropertyChange, isPropertyChange, isPropertyChange, isPropertyChangeIn, isPropertyChangeInTree, isRefreshEvent, isRemoteInduced, isVerifyEvent, send, send, sendSelf, setInitialProperty, setOperation, setProgressMonitor, toString
Constructor Detail
PropFocusEvent
public PropFocusEvent(IFocusComp comp, boolean isGained, IFocusComp focusGainedComponent, IFocusComp focusLostComponent, IGProp<?> trigger, boolean isRemoteInduced)
Constructs a new focus event.- Parameters:
comp
- The component instance involved in the focus change (losing or gaining focus).isGained
- Focus gained event.focusGainedComponent
- The component gaining focus, null for none.focusLostComponent
- The component losing focus, null for none.trigger
- The trigger property, null for none.isRemoteInduced
- Flag indicating this change is induced from a remote party.
Method Detail
getFocusLostComponent
public IFocusComp getFocusLostComponent()
Retrieves the opposite component that previously had focus,null
for none. In general, this value is onlynull
during application start, but could benull
for a while if e.g. a component that had focus is destroyed and no focus can currently be set elsewhere, e.g. because the client session is disconnected.
getFocusGainedComponent
public IFocusComp getFocusGainedComponent()
Retrieves the component that receives focus,null
for none. The focus receiver is set tonull
if a component that had focus is destroyed and no other focus receiver is found.
getTrigger
public GProp<?> getTrigger()
Gets the trigger property.- Overrides:
getTrigger
in classGEvent
- Returns:
- The trigger property, or null for none.
isFocusLost
public boolean isFocusLost()
Returns if this is a Focus Lost Event.- Returns:
- true if it is a focus lost event, false for focus gained.
isFocusGained
public boolean isFocusGained()
Returns if this is a Focus Gained Event.- Returns:
- true if it is a focus gained event, false for focus lost.
requestHistoryEntry
public void requestHistoryEntry()
Requests a history event from the focus engine. This will force the focus engines to add a history event when appropriate.
isHistoryEntryRequested
public boolean isHistoryEntryRequested()
Returns the flag for history entry requested.- Returns:
- true if somebody has requested a history entry during the event's lifetime.
paramString
protected java.lang.StringBuilder paramString(java.lang.StringBuilder buf)
Returns the parameter string representing the state of this event. This string is useful for debugging. Super classes adds extra information to the string by preceding it with a comma followed by the extra information.- Overrides:
paramString
in classGEvent
- Parameters:
buf
- The StringBuilder to append the string to.- Returns:
- The StringBuilder, i.e. the
buf
input parameter.
isClearCacheEvent
public boolean isClearCacheEvent()
Returns the state for a property container if this event is received in theonEventSelf
method as a helper for it would need to clear the property container cache.- Overrides:
isClearCacheEvent
in classGEvent
- Returns:
- false, always for this event.