|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.electrocodeogram.cpc.core.api.hub.event.CPCEvent org.electrocodeogram.cpc.core.api.hub.event.CloneEvent org.electrocodeogram.cpc.core.api.hub.event.CloneModificationEvent
public class CloneModificationEvent
Modification event object for clone data modifications. Send whenever the clone data for a file is changed for some reason.
NOTE:
CloneEvent.getCloneFile()
is NULL, isFullModification()
is true
and all clone lists are NULL.IStoreProvider.LockMode
value during
the acquisition of an exclusive IStoreProvider
lock before you create any events of this
type yourself.
IStoreProvider
,
IStoreProvider.LockMode
,
IStoreProvider.UpdateMode
,
IStoreProvider.acquireWriteLock(org.electrocodeogram.cpc.core.api.provider.store.IStoreProvider.LockMode)
,
IStoreProvider.releaseWriteLock()
Field Summary | |
---|---|
protected java.util.List<IClone> |
addedClones
|
protected boolean |
fullModification
|
protected java.util.List<IClone> |
modifiedClones
|
protected java.util.List<IClone> |
movedClones
|
protected java.util.List<IClone> |
removedClones
|
Constructor Summary | |
---|---|
CloneModificationEvent(ICloneFile cloneFile)
Creates a new CloneModificationEvent instance for dispatching via the event hub registry. |
Method Summary | |
---|---|
java.util.List<IClone> |
getAddedClones()
A list of clones which were added during this event. |
java.util.List<IClone> |
getModifiedClones()
A list of clones which had their contents changed during this event. |
java.util.List<IClone> |
getMovedClones()
A list of clones which were moved during this event. |
java.util.List<IClone> |
getRemovedClones()
A list of clones which were removed during this event. |
boolean |
isFullModification()
Indicates whether the entire clone data for the file was modified. |
boolean |
isValid()
Checks if this event has been fully initialised. |
void |
setAddedClones(java.util.List<IClone> addedClones)
Must only be called ONCE. |
void |
setFullModification(boolean fullModification)
This may only be set to true if all clone lists of this event are null. |
void |
setModifiedClones(java.util.List<IClone> modifiedClones)
Must only be called ONCE. |
void |
setMovedClones(java.util.List<IClone> movedClones)
Must only be called ONCE. |
void |
setRemovedClones(java.util.List<IClone> removedClones)
Must only be called ONCE. |
java.lang.String |
toString()
Every event should implement a sensible toString method for use in debugging log messages. |
Methods inherited from class org.electrocodeogram.cpc.core.api.hub.event.CloneEvent |
---|
getCloneFile, subToString |
Methods inherited from class org.electrocodeogram.cpc.core.api.hub.event.CPCEvent |
---|
checkSeal, clone, compareTo, getCreationTime, seal |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected boolean fullModification
protected java.util.List<IClone> addedClones
protected java.util.List<IClone> modifiedClones
protected java.util.List<IClone> movedClones
protected java.util.List<IClone> removedClones
Constructor Detail |
---|
public CloneModificationEvent(ICloneFile cloneFile)
CloneModificationEvent
instance for dispatching via the event hub registry.
CPCCorePlugin.getEventHubRegistry().dispatch(newEvent);
The cloneFile parameter may be NULL, in the special case that this event is meant to
indicate to all interested parties that all clone data has been potentially removed/updated.
In this case fullModification has to be true and all lists must be null.
cloneFile
- the file for this event, if the event is specific to one file, may be NULL.IEventHubRegistry.dispatch(CPCEvent)
,
CPCCorePlugin.getEventHubRegistry()
Method Detail |
---|
public boolean isFullModification()
This typically happens when:
public void setFullModification(boolean fullModification)
fullModification
- true if this event represents a full modification of the clone dataisFullModification()
public java.util.List<IClone> getAddedClones()
public void setAddedClones(java.util.List<IClone> addedClones)
addedClones
- corresponding clone list, never nullgetAddedClones()
public java.util.List<IClone> getModifiedClones()
Modified clones usually carry an ICloneModificationHistoryExtension
object which
contains CloneDiff
data for all modifications since the last time the
clone was part of an CloneModificationEvent
.
However, there are some special circumstances under which no modification history data
is available for a clone which might have been modified. I.e. if a file is reverted or if a file
was externally modified and it is not possible to generate an exact CloneDiff
description
of the change.
ICloneModificationHistoryExtension
,
CloneDiff
public void setModifiedClones(java.util.List<IClone> modifiedClones)
modifiedClones
- corresponding clone list, never nullgetModifiedClones()
public java.util.List<IClone> getMovedClones()
public void setMovedClones(java.util.List<IClone> movedClones)
movedClones
- corresponding clone list, never nullgetMovedClones()
public java.util.List<IClone> getRemovedClones()
public void setRemovedClones(java.util.List<IClone> removedClones)
removedClones
- corresponding clone list, never nullgetRemovedClones()
public boolean isValid()
CPCEvent
Subclasses should override this method but should never return true. Instead they should delegate to the super class implementation once all validity checks on their level have passed.
The CPCEvent.isValid()
implementation always returns true.
isValid
in class CPCEvent
IEventHubRegistry.dispatch(CPCEvent)
public java.lang.String toString()
CPCEvent
toString
in class CPCEvent
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |