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
FieldsModifier and TypeFieldDescription(package private) Element(package private) Element(package private) com.intellij.openapi.editor.event.CaretListenerThis 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.DocumentListenerThis variable is the document listener for the IDE tracker.(package private) com.intellij.openapi.editor.event.EditorEventMulticasterThis variable is the editor event multicaster for the IDE tracker.(package private) com.intellij.openapi.editor.event.EditorMouseListenerThis variable is the mouse listener for the IDE tracker.(package private) com.intellij.openapi.editor.event.EditorMouseMotionListenerThis variable is the mouse motion listener for the IDE tracker.(package private) Element(package private) ElementThis variable is the handler for the IDE tracker data.(package private) DocumentThis variable is the XML document for storing the tracking data.private static booleanThis 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.SelectionListenerThis variable is the selection listener for the IDE tracker.(package private) Element(package private) TimerThis variable is the timer for tracking the document changes.(package private) TimerTaskThis variable is the timer task for tracking the document changes.(package private) Element(package private) com.intellij.openapi.editor.event.VisibleAreaListenerThis variable is the visible area listener for the IDE tracker.(package private) Element -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidarchiveFile(String path, String timestamp, String remark, String text) This method archives the file.voiddispose()static IDETrackerThis method returns the IDE tracker instance.getMouseElement(com.intellij.openapi.editor.event.EditorMouseEvent e, String id) This method returns the mouse XML element.private voidhandleElement(Element element) This method handles the XML element for real-time data transmission.booleanThis method returns whether the IDE tracker is tracking.voidThis method pauses tracking.voidThis method resumes tracking.voidsetDataOutputPath(String dataOutputPath) This method sets the data output path.voidsetIdeTrackerDataHandler(Consumer<Element> ideTrackerDataHandler) This method sets the handler for the IDE tracker data for real-time data transmission.voidsetIsRealTimeDataTransmitting(boolean isRealTimeDataTransmitting) This method sets theisRealTimeDataTransmittingvariable.voidsetProjectPath(String projectPath) voidstartTracking(com.intellij.openapi.project.Project project) This method starts tracking.voidThis 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 theEditorKindisCONSOLE, the console output is archived. Otherwise, thechangedFilepathandchangedFileTextare 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 thechangedFilepathis 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. TheisTrackingis set to false. -
resumeTracking
public void resumeTracking()This method resumes tracking. TheisTrackingis set to true. -
setIsRealTimeDataTransmitting
public void setIsRealTimeDataTransmitting(boolean isRealTimeDataTransmitting) This method sets theisRealTimeDataTransmittingvariable.- Parameters:
isRealTimeDataTransmitting- Indicates whether the data is transmitted in real time.
-
dispose
public void dispose()- Specified by:
disposein 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.
-