Package components

Class ConfigDialog

java.lang.Object
com.intellij.openapi.ui.DialogWrapper
components.ConfigDialog

public class ConfigDialog extends com.intellij.openapi.ui.DialogWrapper
This class is used to create the configuration dialog.
  • Nested Class Summary

    Nested classes/interfaces inherited from class com.intellij.openapi.ui.DialogWrapper

    com.intellij.openapi.ui.DialogWrapper.CancelAction, com.intellij.openapi.ui.DialogWrapper.DialogStyle, com.intellij.openapi.ui.DialogWrapper.DialogWrapperAction, com.intellij.openapi.ui.DialogWrapper.DialogWrapperExitAction, com.intellij.openapi.ui.DialogWrapper.DoNotAskOption, com.intellij.openapi.ui.DialogWrapper.HelpAction, com.intellij.openapi.ui.DialogWrapper.IdeModalityType, com.intellij.openapi.ui.DialogWrapper.OkAction
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private List<JCheckBox>
     
    private static final com.intellij.openapi.ui.TextFieldWithBrowseButton
     
    private final JComboBox<String>
     
    private boolean
     
    private final JComboBox<Double>
     
    private static List<JTextField>
     
    private final JPanel
     
    private boolean
     
    private static final com.intellij.openapi.ui.TextFieldWithBrowseButton
     
    static String
     
    static String
     

    Fields inherited from class com.intellij.openapi.ui.DialogWrapper

    CANCEL_EXIT_CODE, CLOSE_EXIT_CODE, DEFAULT_ACTION, DIALOG_CONTENT_PANEL_PROPERTY, ERROR_FOREGROUND_COLOR, FOCUSED_ACTION, IS_VISUAL_PADDING_COMPENSATED_ON_COMPONENT_LEVEL_KEY, myCancelAction, myCheckBoxDoNotShowDialog, myDisposable, myHelpAction, myOKAction, myPerformAction, myPreferredFocusedComponent, NEXT_USER_EXIT_CODE, OK_EXIT_CODE
  • Constructor Summary

    Constructors
    Constructor
    Description
    ConfigDialog(com.intellij.openapi.project.Project project)
    The constructor of the configuration dialog.
  • Method Summary

    Modifier and Type
    Method
    Description
    private void
    addLabelArea(boolean isEmpty)
    Add the label area to the configuration dialog.
    protected JComponent
    Create the center panel of the configuration dialog.
    protected void
    Save the configuration when the OK button is clicked.
    static List<String>
    Get the current labels in the configuration dialog.
    static String
    Get the data output path in the configuration dialog.
    static String
    Get the python interpreter path in the configuration dialog.
    Get the selected checkboxes in the configuration dialog.
    private void
    Load the configuration from the config.json file to the configuration dialog using the Config class.
    private void
    Save the configuration from the configuration dialog to the config.json file using the Config class.
    void
    Update the AddLabelAction group when the configuration is changed.

    Methods inherited from class com.intellij.openapi.ui.DialogWrapper

    addKeyListener, addMouseListener, addMouseListener, applyFields, beforeShowCallback, canRecordDialogId, centerRelativeToParent, cleanupRootPane, cleanupWindowListeners, clickDefaultButton, close, close, continuousValidation, createActions, createButtonsPanel, createCancelAction, createContentPane, createContentPaneBorder, createDefaultActions, createDefaultBorder, createDoNotAskCheckbox, createHelpButton, createJButtonForAction, createJButtonForAction, createLeftSideActions, createNorthPanel, createPeer, createPeer, createPeer, createPeer, createPeer, createRootLayout, createSouthAdditionalPanel, createSouthPanel, createTitlePane, dispose, disposeIfNeeded, doCancelAction, doCancelAction, doHelpAction, doValidate, doValidateAll, extractMnemonic, findInstance, findInstanceFromFocus, fitToScreen, getButton, getButtonMap, getCancelAction, getContentPane, getContentPanel, getDimensionKey, getDimensionServiceKey, getDisposable, getDoNotShowMessage, getErrorTextAlignment, getExitCode, getHelpAction, getHelpId, getHorizontalStretch, getInitialLocation, getInitialSize, getLocation, getOKAction, getOwner, getPeer, getPreferredFocusedComponent, getPreferredSize, getRootPane, getSize, getStyle, getTitle, getValidationThreadToUse, getVerticalStretch, getWindow, hasErrors, init, initResizeListener, initValidation, isAutoAdjustable, isDisposed, isModal, isModalProgress, isMoveHelpButtonLeft, isOK, isOKActionEnabled, isProgressDialog, isResizable, isShowing, isVisible, layoutButtonsPanel, pack, performOKAction, performValidateAll, postponeValidation, processDoNotAskOnOk, repaint, setAutoAdjustable, setButtonsAlignment, setCancelButtonText, setCrossClosesWindow, setDoNotAskOption, setDoNotAskOption, setErrorInfoAll, setErrorText, setErrorText, setHelpTooltip, setHorizontalStretch, setInitialLocationCallback, setLocation, setLocation, setModal, setOKActionEnabled, setOKButtonIcon, setOKButtonMnemonic, setOKButtonText, setOKButtonTooltip, setOnDeactivationAction, setResizable, setSize, setTitle, setUndecorated, setValidationDelay, setVerticalStretch, shouldAddErrorNearButtons, shouldCloseOnCross, show, showAndGet, showAndGetOk, startTrackingValidation, toBack, toBeShown, toFront, unregisterKeyboardActions, updateErrorInfo, validate

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • checkBoxes

      private List<JCheckBox> checkBoxes
    • panel

      private final JPanel panel
    • labelAreas

      private static List<JTextField> labelAreas
    • pythonInterpreterTextField

      private static final com.intellij.openapi.ui.TextFieldWithBrowseButton pythonInterpreterTextField
    • dataOutputTextField

      private static final com.intellij.openapi.ui.TextFieldWithBrowseButton dataOutputTextField
    • freqCombo

      private final JComboBox<Double> freqCombo
    • deviceCombo

      private final JComboBox<String> deviceCombo
    • pythonEnvironment

      private boolean pythonEnvironment
    • eyeTracker

      private boolean eyeTracker
    • selectDataOutputPlaceHolder

      public static String selectDataOutputPlaceHolder
    • selectPythonInterpreterPlaceHolder

      public static String selectPythonInterpreterPlaceHolder
  • Constructor Details

  • Method Details

    • loadConfig

      private void loadConfig()
      Load the configuration from the config.json file to the configuration dialog using the Config class.
    • saveConfig

      private void saveConfig()
      Save the configuration from the configuration dialog to the config.json file using the Config class.
    • doOKAction

      protected void doOKAction()
      Save the configuration when the OK button is clicked.
      Overrides:
      doOKAction in class com.intellij.openapi.ui.DialogWrapper
    • updateActionGroup

      public void updateActionGroup()
      Update the AddLabelAction group when the configuration is changed.
    • createCenterPanel

      protected JComponent createCenterPanel()
      Create the center panel of the configuration dialog.
      Specified by:
      createCenterPanel in class com.intellij.openapi.ui.DialogWrapper
      Returns:
      The center panel of the configuration dialog.
    • addLabelArea

      private void addLabelArea(boolean isEmpty)
      Add the label area to the configuration dialog. A label area contains a text field and a button to add or remove the label area.
      Parameters:
      isEmpty - Whether the label panel is empty. If true, the button will be an add button. If false, the button will be a remove button.
    • getCurrentLabels

      public static List<String> getCurrentLabels()
      Get the current labels in the configuration dialog.
      Returns:
      The current labels in the configuration dialog.
    • getSelectedCheckboxes

      public List<Boolean> getSelectedCheckboxes()
      Get the selected checkboxes in the configuration dialog.
      Returns:
      The selected checkboxes in the configuration dialog.
    • getPythonInterpreter

      public static String getPythonInterpreter()
      Get the python interpreter path in the configuration dialog. If the path is empty, the default "python" will be returned.
      Returns:
      The python interpreter path in the configuration dialog.
    • getDataOutputPath

      public static String getDataOutputPath()
      Get the data output path in the configuration dialog. If the path is equal to the placeholder, the default project root will be returned.
      Returns:
      The data output path in the configuration dialog.