#
Developer Guide
#
Further Development
Please refer to IntelliJ Platform SDK for more details. We also provide the JavaDoc of the source code. Feel free to contact us if you need any help.
#
Accommodating New IDEs
See Build from Source.
#
Accommodating New Eye Trackers
If you want to integrate other eye-tracking devices except for Tobii eye-tracking devices, you need to reimplement all Python scripts in the source code to get the right eye-tracking device information and eye gaze data using your eye tracker API.
#
Real-time Data API
#
Overview
We provide a real-time data API for future JetBrains plugin developers and researchers to get real-time data from
IDE tracker and eye tracker separately. The API is based on the
Example Project
We provide an example project DataStreamReceiver that builds on top of the real-time data API. It is designed to receive the IDE and eye tracking data and directly visualize them in two separate windows. You could refer to its source code to learn how to use the API.
#
Configuration
Before using the API, you first need to build CodeGRITS from source
(See Build from Source). Then, find the folder ./build/idea-sandbox/plugins/CodeGRITS
in the CodeGRITS project, which is the dependency of the API. You need to add it to the intellij
section
in build.gradle.kts
file of your plugin project.
intellij {
// the dependency path is like ./build/idea-sandbox/plugins/CodeGRITS
plugins.set(file("path-to-CodeGRITS-dependency"))
}
You also need to add the following to ./src/main/resources/META-INF/plugin.xml
.
<depends>com.nd.codegrits</depends>
#
Quick Start
To use the API, simply call the getInstance()
method to get the instance of the IDE Tracker or Eye Tracker. Then, set
the isRealTimeDataTransmitting
to true
to enable real-time data transmitting. After that, set
the ideTrackerDataHandler
or eyeTrackerDataHandler
to handle the real-time data. Finally, call the startTracking()
method to start tracking.
IDETracker ideTracker = IDETracker.getInstance();
ideTracker.setIsRealTimeDataTransmitting(true);
ideTracker.setIdeTrackerDataHandler(element -> {
String formattedStr = "Event: " + element.getAttribute("id");
System.out.println(formattedStr);
});
ideTracker.startTracking(currentProject);
Element
object is an XML element that is imported from org.w3c.dom.Element
package.
#
IDE Tracker
IDETracker.getInstance()
setIsRealTimeDataTransmitting(boolean isRealTimeDataTransmitting)
setIdeTrackerDataHandler(Consumer<Element> ideTrackerDataHandler)
startTracking(Project project)
#
Eye Tracker
EyeTracker.getInstance()
setIsRealTimeDataTransmitting(boolean isRealTimeDataTransmitting)
setEyeTrackerDataHandler(Consumer<Element> eyeTrackerDataHandler)
startTracking(Project project)