Package trackers
Class IDETracker
java.lang.Object
trackers.IDETracker
- All Implemented Interfaces:
com.intellij.openapi.Disposable
This class is the IDE tracker.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.intellij.openapi.Disposable
com.intellij.openapi.Disposable.Default, com.intellij.openapi.Disposable.Parent
-
Field Summary
Modifier and TypeFieldDescription(package private) Element
(package private) Element
(package private) com.intellij.openapi.editor.event.CaretListener
This variable is the caret listener for the IDE tracker.(package private) Element
(package private) String
(package private) String
(package private) String
(package private) com.intellij.openapi.editor.event.DocumentListener
This variable is the document listener for the IDE tracker.(package private) com.intellij.openapi.editor.event.EditorEventMulticaster
This variable is the editor event multicaster for the IDE tracker.(package private) com.intellij.openapi.editor.event.EditorMouseListener
This variable is the mouse listener for the IDE tracker.(package private) com.intellij.openapi.editor.event.EditorMouseMotionListener
This variable is the mouse motion listener for the IDE tracker.(package private) Element
(package private) Element
This variable is the handler for the IDE tracker data.(package private) Document
This variable is the XML document for storing the tracking data.private static boolean
This variable indicates whether the data is transmitted in real time.(package private) boolean
(package private) String
(package private) Element
(package private) String
(package private) Element
(package private) com.intellij.openapi.editor.event.SelectionListener
This variable is the selection listener for the IDE tracker.(package private) Element
(package private) Timer
This variable is the timer for tracking the document changes.(package private) TimerTask
This variable is the timer task for tracking the document changes.(package private) Element
(package private) com.intellij.openapi.editor.event.VisibleAreaListener
This variable is the visible area listener for the IDE tracker.(package private) Element
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
archiveFile
(String path, String timestamp, String remark, String text) This method archives the file.void
dispose()
static IDETracker
This method returns the IDE tracker instance.getMouseElement
(com.intellij.openapi.editor.event.EditorMouseEvent e, String id) This method returns the mouse XML element.private void
handleElement
(Element element) This method handles the XML element for real-time data transmission.boolean
This method returns whether the IDE tracker is tracking.void
This method pauses tracking.void
This method resumes tracking.void
setDataOutputPath
(String dataOutputPath) This method sets the data output path.void
setIdeTrackerDataHandler
(Consumer<Element> ideTrackerDataHandler) This method sets the handler for the IDE tracker data for real-time data transmission.void
setIsRealTimeDataTransmitting
(boolean isRealTimeDataTransmitting) This method sets theisRealTimeDataTransmitting
variable.void
setProjectPath
(String projectPath) void
startTracking
(com.intellij.openapi.project.Project project) This method starts tracking.void
This method stops tracking.
-
Field Details
-
isTracking
boolean isTracking -
iDETracking
Document iDETrackingThis variable is the XML document for storing the tracking data. -
root
Element root -
environment
Element environment -
actions
Element actions -
archives
Element archives -
typings
Element typings -
files
Element files -
mouses
Element mouses -
carets
Element carets -
selections
Element selections -
visibleAreas
Element visibleAreas -
projectPath
String projectPath -
dataOutputPath
String dataOutputPath -
lastSelectionInfo
String lastSelectionInfo -
isRealTimeDataTransmitting
private static boolean isRealTimeDataTransmittingThis variable indicates whether the data is transmitted in real time. -
ideTrackerDataHandler
This variable is the handler for the IDE tracker data. -
documentListener
com.intellij.openapi.editor.event.DocumentListener documentListenerThis variable is the document listener for the IDE tracker. When the document is changed, if theEditorKind
isCONSOLE
, the console output is archived. Otherwise, thechangedFilepath
andchangedFileText
are updated. -
editorMouseListener
com.intellij.openapi.editor.event.EditorMouseListener editorMouseListenerThis variable is the mouse listener for the IDE tracker. When the mouse is pressed, clicked, or released, the mouse event is tracked. -
editorMouseMotionListener
com.intellij.openapi.editor.event.EditorMouseMotionListener editorMouseMotionListenerThis variable is the mouse motion listener for the IDE tracker. When the mouse is moved or dragged, the mouse event is tracked. -
caretListener
com.intellij.openapi.editor.event.CaretListener caretListenerThis variable is the caret listener for the IDE tracker. When the caret position is changed, the caret event is tracked. -
selectionListener
com.intellij.openapi.editor.event.SelectionListener selectionListenerThis variable is the selection listener for the IDE tracker. When the selection is changed, the selection event is tracked. -
visibleAreaListener
com.intellij.openapi.editor.event.VisibleAreaListener visibleAreaListenerThis variable is the visible area listener for the IDE tracker. When the visible area is changed, the visible area event is tracked. -
editorEventMulticaster
com.intellij.openapi.editor.event.EditorEventMulticaster editorEventMulticasterThis variable is the editor event multicaster for the IDE tracker. It is used to add and remove all the listeners. -
timer
Timer timerThis variable is the timer for tracking the document changes. -
changedFilepath
String changedFilepath -
changedFileText
String changedFileText -
timerTask
TimerTask timerTaskThis variable is the timer task for tracking the document changes. If thechangedFilepath
is not empty, the file is archived.
-
-
Constructor Details
-
IDETracker
IDETracker() throws ParserConfigurationExceptionThis constructor initializes the IDE tracker.- Throws:
ParserConfigurationException
-
-
Method Details
-
getInstance
This method returns the IDE tracker instance.- Returns:
- The IDE tracker instance.
- Throws:
ParserConfigurationException
-
startTracking
public void startTracking(com.intellij.openapi.project.Project project) This method starts tracking. All the listeners are added.- Parameters:
project
- The project.
-
setIdeTrackerDataHandler
This method sets the handler for the IDE tracker data for real-time data transmission.- Parameters:
ideTrackerDataHandler
- The handler for the IDE tracker data.
-
stopTracking
This method stops tracking. All the listeners are removed. The tracking data is written to the XML file.- Throws:
TransformerException
-
pauseTracking
public void pauseTracking()This method pauses tracking. TheisTracking
is set to false. -
resumeTracking
public void resumeTracking()This method resumes tracking. TheisTracking
is set to true. -
setIsRealTimeDataTransmitting
public void setIsRealTimeDataTransmitting(boolean isRealTimeDataTransmitting) This method sets theisRealTimeDataTransmitting
variable.- Parameters:
isRealTimeDataTransmitting
- Indicates whether the data is transmitted in real time.
-
dispose
public void dispose()- Specified by:
dispose
in interfacecom.intellij.openapi.Disposable
-
setProjectPath
-
archiveFile
This method archives the file. If the file is a code file, the file is copied to the archive folder.- Parameters:
path
- The path of the file.timestamp
- The timestamp of the file.remark
- The remark of the file.text
- The text of the file.
-
getMouseElement
This method returns the mouse XML element.- Parameters:
e
- The editor mouse event.id
- The id of the mouse event.- Returns:
- The mouse element.
-
setDataOutputPath
This method sets the data output path.- Parameters:
dataOutputPath
- The data output path.
-
handleElement
This method handles the XML element for real-time data transmission.- Parameters:
element
- The XML element.
-
isTracking
public boolean isTracking()This method returns whether the IDE tracker is tracking.- Returns:
- Whether the IDE tracker is tracking.
-