# 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.

Location Method
/trackers/EyeTracker.java setPythonScriptTobii()
/utils/AvailabilityChecker.java checkPythonEnvironment(String pythonInterpreter)
/utils/AvailabilityChecker.java checkEyeTracker(String pythonInterpreter)
/utils/AvailabilityChecker.java getEyeTrackerName(String pythonInterpreter)
/utils/AvailabilityChecker.java getFrequencies(String pythonInterpreter)

# 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 IDE Tracker and Eye Tracker.

# 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);

# 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)