|
|||||||||
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.EclipseCutCopyPasteEvent
public class EclipseCutCopyPasteEvent
This event is generated by the CPC Sensor module, whenever the programmer
executes a cut, copy or paste operation.
Besides the type and position, the event provides information about the current
selection, the clipboard and the content of the editor.
Nested Class Summary | |
---|---|
static class |
EclipseCutCopyPasteEvent.Type
The possible types of EclipseCutCopyPasteEvent s. |
Field Summary | |
---|---|
protected java.lang.String |
clipboard
|
protected java.lang.String |
editorContent
|
protected int |
offset
|
protected java.lang.String |
selection
|
protected EclipseCutCopyPasteEvent.Type |
type
|
Fields inherited from class org.electrocodeogram.cpc.core.api.hub.event.EclipseEvent |
---|
fileLocatedInWorkspace, fileLocatedInWorkspaceCached, filePath, project, supportedFile, supportedFileCached, user |
Constructor Summary | |
---|---|
EclipseCutCopyPasteEvent(java.lang.String user,
java.lang.String project)
Creates a new EclipseCutCopyPasteEvent for the given
user and project. |
Method Summary | |
---|---|
java.lang.String |
getClipboard()
Retrieves the current clipboard content. |
java.lang.String |
getEditorContent()
Retrieves the current content of the file/editor which was affected by this operation. |
int |
getOffset()
Retrieves the offset in the document at which the operation occurred. |
java.lang.String |
getSelection()
Retrieves the current selection in the editor. |
EclipseCutCopyPasteEvent.Type |
getType()
Retrieves the EclipseCutCopyPasteEvent.Type of this event. |
boolean |
isValid()
Checks if this event has been fully initialised. |
void |
setClipboard(java.lang.String clipboard)
Sets the current clipboard content. |
void |
setEditorContent(java.lang.String editorContent)
Sets the current content of the file/editor which was affected by this operation. |
void |
setOffset(int offset)
Sets the offset within the document at which the operation occurred. |
void |
setSelection(java.lang.String selection)
Sets the current selection in the editor. |
void |
setType(EclipseCutCopyPasteEvent.Type type)
Sets the EclipseCutCopyPasteEvent.Type for this event. |
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 EclipseCutCopyPasteEvent.Type type
protected java.lang.String selection
protected java.lang.String clipboard
protected java.lang.String editorContent
protected int offset
Constructor Detail |
---|
public EclipseCutCopyPasteEvent(java.lang.String user, java.lang.String project)
EclipseCutCopyPasteEvent
for the given
user and project.
user
- the current user, never null.project
- the project for the file affected by this operation, never null.Method Detail |
---|
public EclipseCutCopyPasteEvent.Type getType()
EclipseCutCopyPasteEvent.Type
of this event.
public void setType(EclipseCutCopyPasteEvent.Type type)
EclipseCutCopyPasteEvent.Type
for this event.
EclipseCutCopyPasteEvent.Type.NULL
.
This is a required value.
type
- the type for this event, never null.public java.lang.String getSelection()
public void setSelection(java.lang.String selection)
This is a required value.
selection
- the current selection, never null.public java.lang.String getClipboard()
public void setClipboard(java.lang.String clipboard)
This is a required value.
clipboard
- the current clipboard content, never null.public java.lang.String getEditorContent()
public void setEditorContent(java.lang.String editorContent)
This is a required value.
editorContent
- current editor content, never null.public int getOffset()
public void setOffset(int offset)
This is a required value.
offset
- the offset of this event, always >=0.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 |