Class GEvent
- All Implemented Interfaces:
- IPostEventProcessing
- Direct Known Subclasses:
- BubbleEvent,- ResolveReferencesEvent,- SinkEvent
- Author:
- Christopher Mindus
- Nested Class SummaryNested ClassesModifier and TypeClassDescription- static enumOperations enumeration when sending the from the- GProp.onEventmethod.
- Field SummaryFieldsModifier and TypeFieldDescription- static final intEvent ID for property added event.- static final intEvent ID for property attribute changed event.- static final intEvent ID for property container added.- static final intEvent ID for container focus.- static final intEvent ID for a property container move to another container event.- static final intEvent ID for property name changed event of a container.- static final intEvent ID for Asset files changes in conjunction with AssetReference (only in the Designer).- static final intEvent ID for Java Class changes in conjunction with ClassReference (only in the Designer).- static final intEvent ID for Java Method renamed in conjunction with ClassReference (only in the Designer).- static final intEvent ID for KString event.- static final intEvent ID for property update for the Eclipse Common Navigator viewer (only in the Designer).- static final intEvent ID for VSReference resolving in conjunction with VSRelativeReference (only in the Designer).- static final intEvent ID for property disposed changed event.- static final intEvent ID for component focus.- static final intEvent ID for property moved from container event.- static final intEvent ID for property moved to container event.- static final intEvent ID for project renamed.- static final intEvent ID to query properties for references.- static final intEvent ID for a RefreshEvent.- static final intEvent ID for property removed event.- static final intEvent ID for property name changed event.- static final intEvent ID for property container reordered.- static final intEvent ID for resolve references.- static final intEvent ID for property value changed event.- static final intEvent ID for Remote Property Event.
- Constructor SummaryConstructorsConstructorDescriptionConstructs the generic event with specified originator without progress monitor.- GEvent- (GProp<?> source, int eventID, boolean isRemoteInduced, IPropProgressMonitor monitor) Constructs the generic event with specified originator.- GEvent- (GProp<?> source, int eventID, IPropProgressMonitor monitor) Constructs the generic event with specified originator that has a progress monitor and is not remote induced.
- Method SummaryModifier and TypeMethodDescription- void- addPostProcessor- (EventListener postProcessor) Adds a post-event processor that will be called when the event has completed its notification process.- final void- cancel()Cancel even propagation of this event.- final void- consume()Consumes this event.- protected EventListener- getAlternateDestination- (GProp<?> destination, GEvent.Operation operation, int operationIndex) Gets the alternate property destination for an event about to be sent.- final intGets the event ID.Gets the name string of the event.- static String- getEventName- (int eventID) Gets the name of an- eventID.- GProp- <?> Gets the event owner.Gets the current operation.- abstract GEvent.Operation[]Gets the Operations order describing what Operation the property that receives the event should process.- getPostProcessors- (GProp<?> dispatcher) Gets the post-processors.- final GProp- <?> Gets the current sender of the event.- final GProp- <?> Gets the source of the event.- IGProp- <?> Returns the trigger of this event, if any.- final booleanChecks if this event has been cancelled.- booleanReturns the state for a property container if this event is received in the- onEventSelfmethod as a helper for it would need to clear the property container cache.- final booleanChecks if this event has been consumed.- boolean- isEventProcessed- (GProp<?> property, GEvent.Operation operation, int operationIndex) Checks if this Operation at specified index should be processed or not by the specified property.- boolean- isPropertyChange- (IGProp<?> property) Checks if the event is a property value change.- boolean- isPropertyChange- (PropCnr pc, Atom name) Checks if the event is a modification change of any property in the specified container.- boolean- isPropertyChange- (PropCnr pc, String name) Checks if the event is a modification change of any property in the specified container.- booleanChecks if the event is a modification change of any property in the specified container.- booleanChecks if the event is a modification change of any property in the specified container or any of its children.- booleanReturns true if this is a refresh event.- final booleanFlag indicating this change is induced from a remote party.- booleanReturns if this event is a verify event for a container that processes verification.- protected StringBuilder- paramString- (StringBuilder buf) Returns the parameter string representing the state of this event.- final void- send- (GProp<?> sender, EventListener listener) Sends this event to the event listener in question, with "safe" processing, i.e.- final void- send- (GProp<?> sender, GProp<?> receiver, GEvent.Operation operation, int operationIndex) Sends this event to the property in question, with "safe" processing, i.e.- final void- sendSelf- (GProp<?> senderAndReceiver, GEvent.Operation operation, int operationIndex) Sends this event to the property itself in question, with "safe" processing, i.e.- void- setInitialProperty- (GProp<?> initialDispatcher) Assigns the initial sender property that should perform post processing of events.- void- setOperation- (GEvent.Operation operation) Sets the current operation.- void- setProgressMonitor- (IPropProgressMonitor monitor) Sets the progress monitor if not already done.- toString()Returns a string representation of this component and its values.
- Field Details- PROP_ATTR_CHANGEDpublic static final int PROP_ATTR_CHANGEDEvent ID for property attribute changed event.- It is a bubbling event. - Event class: - com.iizix.event.PropAttrEvent.- See Also:
 
- PROP_VALUE_CHANGEDpublic static final int PROP_VALUE_CHANGEDEvent ID for property value changed event.- It is a bubbling event. - Event class: - com.iizix.event.PropValueEvent.- See Also:
 
- PROP_ADDEDpublic static final int PROP_ADDEDEvent ID for property added event.- It is a bubbling event. - Event class: - com.iizix.event.PropCnrEvent.- See Also:
 
- PROP_REMOVEDpublic static final int PROP_REMOVEDEvent ID for property removed event.- It is a bubbling event. - Event class: - com.iizix.event.PropCnrEvent.- See Also:
 
- PROP_RENAMEDpublic static final int PROP_RENAMEDEvent ID for property name changed event.- It is a bubbling event. - Event class: - com.iizix.event.PropNameEvent.- See Also:
 
- PROP_DISPOSEDpublic static final int PROP_DISPOSEDEvent ID for property disposed changed event.- It is a bubbling event. - Event class: - com.iizix.event.PropDisposeEvent.- See Also:
 
- PROP_MOVED_FROMpublic static final int PROP_MOVED_FROMEvent ID for property moved from container event. This event is triggered when the property already has been moved from the original container, and to the destination. This event is sent from the moved container and send upwards in the property hierarchy.- It is a bubbling event. - Event class: - com.iizix.event.PropMoveEvent.- See Also:
 
- PROP_MOVED_TOpublic static final int PROP_MOVED_TOEvent ID for property moved to container event. This event is triggered when the property already has been moved from the original container, and to the destination. This event is sent from the moved property already located in the moved-to-container and send upwards in the property hierarchy. Thus a property listening for move events should process this Moved-To event and not the Moved-From event.- It is a bubbling event. - Event class: - com.iizix.event.PropMoveEvent.- See Also:
 
- PROP_REORDEREDpublic static final int PROP_REORDEREDEvent ID for property container reordered.- It is a bubbling event. - Event class: - com.iizix.event.PropReorderEvent.- See Also:
 
- PROP_CNR_ADDEDpublic static final int PROP_CNR_ADDEDEvent ID for property container added.- This is a sinking event. - Event class: - com.iizix.event.ParentCnrAddedEvent.- See Also:
 
- PROP_CNR_RENAMEDpublic static final int PROP_CNR_RENAMEDEvent ID for property name changed event of a container.- This is a sinking event. - Event class: - com.iizix.event.PropNameEvent.- See Also:
 
- PROP_CNR_MOVEDpublic static final int PROP_CNR_MOVEDEvent ID for a property container move to another container event. This event is triggered when the property container already has been moved from the original container, and to the destination.- This is a sinking event. - Event class: - com.iizix.event.ParentCnrMoveEvent.- See Also:
 
- PROP_FOCUSpublic static final int PROP_FOCUSEvent ID for component focus.- This is a bubbling event. - Event class: - com.iizix.event.PropFocusEvent.- See Also:
 
- PROP_CNR_FOCUSpublic static final int PROP_CNR_FOCUSEvent ID for container focus.- This is a sinking event. - Event class: - com.iizix.event.PropCnrFocusEvent.- See Also:
 
- PROP_RESOLVE_REFERENCES_DIRECTpublic static final int PROP_RESOLVE_REFERENCES_DIRECTEvent ID for resolve references.- This is a sinking event. - Event class: - com.iizix.event.ResolveReferencesEvent.- See Also:
 
- PROP_PROJECT_RENAMEDpublic static final int PROP_PROJECT_RENAMEDEvent ID for project renamed.- This is a sinking event. - Event class: - com.iizix.event.ProjectNameEvent.- See Also:
 
- PROP_QUERY_DESIGNER_PROPSpublic static final int PROP_QUERY_DESIGNER_PROPSEvent ID to query properties for references.- This is a sinking event. - Event class: - com.iizigo.event.QueryDesignerPropEvent.- See Also:
 
- PROP_DESIGNER_VIEWER_UPDATEpublic static final int PROP_DESIGNER_VIEWER_UPDATEEvent ID for property update for the Eclipse Common Navigator viewer (only in the Designer).- It is a bubbling event. - Event class: - com.iizigo.event.CommonDesignerEvent.- See Also:
 
- PROP_DESIGNER_VS_REFERENCEpublic static final int PROP_DESIGNER_VS_REFERENCEEvent ID for VSReference resolving in conjunction with VSRelativeReference (only in the Designer). The event is fired when a VSReference is resolved or broken, causing VSRelativeReference instances to re-check their state.- It is a sinking event. - Event class: - com.iizix.event.VSReferenceEvent.- See Also:
 
- PROP_DESIGNER_ASSET_CHANGEDpublic static final int PROP_DESIGNER_ASSET_CHANGEDEvent ID for Asset files changes in conjunction with AssetReference (only in the Designer). The event is fired when a file property container notices a change of the file or if it removed, to re-check their state.- It is a sinking event. - Event class: - com.iizix.event.AssetEvent.- See Also:
 
- PROP_DESIGNER_JAVA_CLASS_CHANGEDpublic static final int PROP_DESIGNER_JAVA_CLASS_CHANGEDEvent ID for Java Class changes in conjunction with ClassReference (only in the Designer). The event is fired when a Java source has been compiled and parsed, or if it has been reconciled. All annotations are up-to-date when the event is received.- It is a sinking event. - Event class: - com.iizigo.java.event.JavaClassEvent.- See Also:
 
- PROP_DESIGNER_JAVA_METHOD_RENAMEDpublic static final int PROP_DESIGNER_JAVA_METHOD_RENAMEDEvent ID for Java Method renamed in conjunction with ClassReference (only in the Designer). The event is fired when a Java source has been compiled and parsed, or if it has been reconciled. All annotations are up-to-date when the event is received.- It is a sinking event. - Event class: - com.iizigo.java.event.JavaMethodEvent.- See Also:
 
- PROP_DESIGNER_KSTRINGpublic static final int PROP_DESIGNER_KSTRINGEvent ID for KString event.- It is a sinking event. - Event class: - com.iizigo.java.event.KStringEvent.- See Also:
 
- PROP_REFRESHpublic static final int PROP_REFRESHEvent ID for a RefreshEvent.- It is a sinking event. - Event class: - com.iizix.event.RefreshEvent.- See Also:
 
- REMOTEpublic static final int REMOTEEvent ID for Remote Property Event.- It is a bubbling event. - Event class: - com.iizix.event.RemoteEvent.- See Also:
 
 
- Constructor Details- GEventConstructs the generic event with specified originator without progress monitor.- Parameters:
- source- The source object.
- eventID- The event ID, see- GEvent.PROP_*.
- isRemoteInduced- Flag indicating this change is induced from a remote party.
- Throws:
- NullPointerException- If source is- null.
 
- GEventConstructs the generic event with specified originator that has a progress monitor and is not remote induced.- Parameters:
- source- The source object.
- eventID- The event ID, see- GEvent.PROP_*.
- monitor- The progress monitor, null for none.
- Throws:
- NullPointerException- If source is- null.
 
- GEventConstructs the generic event with specified originator.- Parameters:
- source- The source object.
- eventID- The event ID, see- GEvent.PROP_*.
- isRemoteInduced- Flag indicating this change is induced from a remote party.
- monitor- The progress monitor, null for none.
- Throws:
- NullPointerException- If source is- null.
 
 
- Method Details- getEventNameGets the name of an- eventID.
- setProgressMonitorSets the progress monitor if not already done. This method has no effect if the monitor is already set.
- getEventIDpublic final int getEventID()Gets the event ID.
- getEventNameGets the name string of the event. Same as- GEvent.getEventName(event.getEventID()).- Returns:
- A string representation of the event ID.
 
- getSourceGets the source of the event.- Returns:
- The Generic Property for the event, the source, or originator.
 
- getEventTargetGets the event owner. The owner is the one the message relates to e.g. the property for value change or the property being added or removed for property container events.- Returns:
- The Generic Property for the event, the source, or originator.
 
- isRemoteInducedpublic final boolean isRemoteInduced()Flag indicating this change is induced from a remote party.
- getOperationGets the current operation.
- setOperationSets the current operation. This method should not be called, it is intended for- GProp.onEvent.- Throws:
- NullPointerException- If- operationis null.
 
- isConsumedpublic final boolean isConsumed()Checks if this event has been consumed.- Consumed events are still propagating, so this flag is more of informational purpose. - Returns:
- true indicates event is consumed, false indicates event is not yet consumed.
 
- consumepublic final void consume()Consumes this event.- Consumed events are still propagating, so this flag is more of informational purpose. 
- isCancelledpublic final boolean isCancelled()Checks if this event has been cancelled.- Returns:
- true indicates event is cancelled, false indicates event is not cancelled.
 
- cancelpublic final void cancel()Cancel even propagation of this event.
- getOperationsGets the Operations order describing what Operation the property that receives the event should process. This Operations order defines e.g. if the event is bubbling, sinking or just private.- Subclasses must implement this Operations order. They should NOT use both Sinking and Bubbling Operations, this will cause an infinite loop or stack overflow due to recursion. - Returns:
- The order of the Operations, per Event-implementing class dependent, normally a static final array.
 
- toStringReturns a string representation of this component and its values.
- paramStringReturns 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.- Parameters:
- buf- The StringBuilder to append the string to.
- Returns:
- The StringBuilder, i.e. the bufinput parameter.
 
- sendSends this event to the event listener in question, with "safe" processing, i.e. that potential exceptions are caught and logged.- This method is intended to be called from - GProp.onEvent(event). Do not call this method.- This event's operation, retrieved by - getOperation()is set to LISTENERS.- Parameters:
- sender- The sender property.
- listener- The event listener.
 
- sendpublic final void send- (GProp<?> sender, GProp<?> receiver, GEvent.Operation operation, int operationIndex) Sends this event to the property in question, with "safe" processing, i.e. that potential exceptions are caught and logged.- This method is intended to be called from - GProp.onEvent(event). Do not call this method.- Parameters:
- sender- The sender property.
- receiver- The receiving property.
- operation- The Operation.
- operationIndex- The current index in the Operation array provided by this event's- getOperations()method.
 
- sendSelfpublic final void sendSelf- (GProp<?> senderAndReceiver, GEvent.Operation operation, int operationIndex) Sends this event to the property itself in question, with "safe" processing, i.e. that potential exceptions are caught and logged. The method called for the property (that might be altered using getAlternateDestination) is- onEventSelfrather than- onEvent.- This method is intended to be called from - GProp.onEvent(event). Do not call this method.- Parameters:
- senderAndReceiver- The sender and received property.
- operation- The Operation.
- operationIndex- The current index in the Operation array provided by this event's- getOperations()method.
 
- getSenderGets the current sender of the event.
- getAlternateDestinationprotected EventListener getAlternateDestination- (GProp<?> destination, GEvent.Operation operation, int operationIndex) Gets the alternate property destination for an event about to be sent. The default is to return the same destination, but subclasses can choose to return another property that would be "more suitable" to receive the event, i.e. the property that would really do the processing. This enables performance enhancements to be done for a particular event.- This method also enables an event to skip sending the event to a property by returning - nullin this method.- Subclasses can override this method to provide fine-tuned behavior. - Parameters:
- destination- The destination property.
- operation- The Operation.
- operationIndex- The current index in the Operation array provided by this event's- getOperations()method.
- Returns:
- destinationby default. If- nullis returned, this event will not be sent.
 
- isEventProcessedChecks if this Operation at specified index should be processed or not by the specified property.- An event can fine-tune event distribution with this mechanism, thus improving performance. - This method is intended to be called from - GProp.onEvent(event). Do not call this method.- Parameters:
- property- The property processing the event in- GEvent.onEvent(event).
- operation- The Operation.
- operationIndex- The current index in the Operation array provided by this event's- getOperations()method.
- Returns:
- true by default. If false is returned, an event could cause e.g. the CHILDREN operation processing to be skipped for certain properties.
 
- isClearCacheEventpublic boolean isClearCacheEvent()Returns the state for a property container if this event is received in the- onEventSelfmethod as a helper for it would need to clear the property container cache.- Returns:
- true if the event would require the property container to clear its cache.
 
- isVerifyEventpublic boolean isVerifyEvent()Returns if this event is a verify event for a container that processes verification.- Returns:
- true if the event should trigger container verification, false otherwise.
 
- addPostProcessorAdds a post-event processor that will be called when the event has completed its notification process. This method can be called at any time during the event notification phase, but calls to this method when post-processing is executing is not going to change the post-processors, thus will the- postProcessornot be called.- Note: the post-processors are called no matter if the event has been canceled, so the processor may have to check the cancel state. - Calling this method with the same - postProcessormore than once does not add it again.- Specified by:
- addPostProcessorin interface- IPostEventProcessing
- Parameters:
- postProcessor- Processor to add.
- Throws:
- NullPointerException- If the- postProcessoris null.
 
- setInitialPropertyAssigns the initial sender property that should perform post processing of events. This method should only be called from the initial GProp that sends the event the first time. This is done from the GProp.onEvent method and should not be called elsewhere.- Specified by:
- setInitialPropertyin interface- IPostEventProcessing
- Parameters:
- initialDispatcher- The initial dispatcher.
 
- getPostProcessorsGets the post-processors.- Specified by:
- getPostProcessorsin interface- IPostEventProcessing
- Parameters:
- dispatcher- The property retrieving the post-processors, null for none.
- Returns:
- An array of the post-processors to call after all normal event notification, null for none.
 
- isPropertyChangeChecks if the event is a property value change.- Parameters:
- property- The property.
- Returns:
- true if the property just got changed in the container due to this event, false otherwise.
 
- isPropertyChangeChecks if the event is a modification change of any property in the specified container.- Parameters:
- pc- The property container.
- name- The property name to check for change.
- Returns:
- true if the property just got changed in the container due to this event, false otherwise.
 
- isPropertyChangeChecks if the event is a modification change of any property in the specified container.- Parameters:
- pc- The property container.
- name- The property name to check for change.
- Returns:
- true if the property just got changed in the container due to this event, false otherwise.
 
- isPropertyChangeInChecks if the event is a modification change of any property in the specified container.- Parameters:
- pc- The property container.
- Returns:
- true if a property just got changed in the container due to this event, false otherwise.
 
- getTriggerReturns the trigger of this event, if any.- Returns:
- Trigger property of this event, null for none.
 
- isPropertyChangeInTreeChecks if the event is a modification change of any property in the specified container or any of its children.- Parameters:
- pc- The property container.
- Returns:
- true if a property just got changed in the container tree due to this event, false otherwise.
 
- isRefreshEventpublic boolean isRefreshEvent()Returns true if this is a refresh event.- Returns:
- true if this is a RefreshEvent, false otherwise. Always false if not overridden, e.g. by RefreshEvent.