|
|||||||||
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.EclipseEvent org.electrocodeogram.cpc.core.api.hub.event.EclipseFileAccessEvent
public class EclipseFileAccessEvent
This event is generated by the CPC Sensor module, whenever a text file is opened or closed. It does not matter whether the file was opened in an editor (i.e. user opening the file) or in the background (i.e. refactoring or source reformat on the entire project).
Nested Class Summary | |
---|---|
static class |
EclipseFileAccessEvent.Type
The type of an EclipseFileAccessEvent . |
Field Summary | |
---|---|
protected boolean |
dirty
|
protected org.eclipse.jface.text.IDocument |
document
|
protected EclipseFileAccessEvent.Type |
type
|
Fields inherited from class org.electrocodeogram.cpc.core.api.hub.event.EclipseEvent |
---|
fileLocatedInWorkspace, fileLocatedInWorkspaceCached, filePath, project, supportedFile, supportedFileCached, user |
Constructor Summary | |
---|---|
EclipseFileAccessEvent(java.lang.String user,
java.lang.String project)
Creates a new EclipseFileAccessEvent for the given
user and project. |
Method Summary | |
---|---|
org.eclipse.jface.text.IDocument |
getDocument()
Retrieves the IDocument instance which was created for this file. |
EclipseFileAccessEvent.Type |
getType()
Retrieves the type of access (opened/closed). |
boolean |
isDirty()
Checks whether the underlying buffer was still dirty when the file was closed. |
boolean |
isValid()
Checks if this event has been fully initialised. |
void |
setDirty(boolean dirty)
Specifies whether the underlying buffer was still dirty when the file was closed. |
void |
setDocument(org.eclipse.jface.text.IDocument document)
Sets the IDocument instance which was created for this file. |
void |
setType(EclipseFileAccessEvent.Type type)
Sets the type of access (opened/closed). |
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.EclipseEvent |
---|
getFilePath, getProject, getUser, isFileLocatedInWorkspace, isSupportedFile, setFilePath, 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 EclipseFileAccessEvent.Type type
protected boolean dirty
protected org.eclipse.jface.text.IDocument document
Constructor Detail |
---|
public EclipseFileAccessEvent(java.lang.String user, java.lang.String project)
EclipseFileAccessEvent
for the given
user and project.
user
- the current user, never null.project
- the project for the file affected by this event, never null.Method Detail |
---|
public EclipseFileAccessEvent.Type getType()
public void setType(EclipseFileAccessEvent.Type type)
This is a required value.
type
- the type of access, never null.public boolean isDirty()
This value has no meaning for events which are not of type EclipseFileAccessEvent.Type.CLOSED
.
public void setDirty(boolean dirty)
This value has no meaning for events which are not of type EclipseFileAccessEvent.Type.CLOSED
.
This is an optional value, the default value is false.
dirty
- true if buffer was dirty, false otherwise.public org.eclipse.jface.text.IDocument getDocument()
IDocument
instance which was created for this file.
public void setDocument(org.eclipse.jface.text.IDocument document)
IDocument
instance which was created for this file.
This is a required value.
document
- the document corresponding to the file, never null.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 EclipseEvent
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 |