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
Modifier and TypeFieldDescriptionprivate static final com.intellij.openapi.ui.TextFieldWithBrowseButton
private boolean
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
ConstructorDescriptionConfigDialog
(com.intellij.openapi.project.Project project) The constructor of the configuration dialog. -
Method Summary
Modifier and TypeMethodDescriptionprivate 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.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 theConfig
class.private void
Save the configuration from the configuration dialog to the config.json file using theConfig
class.void
Update theAddLabelAction
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
-
Field Details
-
checkBoxes
-
panel
-
labelAreas
-
pythonInterpreterTextField
private static final com.intellij.openapi.ui.TextFieldWithBrowseButton pythonInterpreterTextField -
dataOutputTextField
private static final com.intellij.openapi.ui.TextFieldWithBrowseButton dataOutputTextField -
freqCombo
-
deviceCombo
-
pythonEnvironment
private boolean pythonEnvironment -
eyeTracker
private boolean eyeTracker -
selectDataOutputPlaceHolder
-
selectPythonInterpreterPlaceHolder
-
-
Constructor Details
-
ConfigDialog
public ConfigDialog(com.intellij.openapi.project.Project project) throws IOException, InterruptedException The constructor of the configuration dialog.- Parameters:
project
- The project.- Throws:
IOException
InterruptedException
-
-
Method Details
-
loadConfig
private void loadConfig()Load the configuration from the config.json file to the configuration dialog using theConfig
class. -
saveConfig
private void saveConfig()Save the configuration from the configuration dialog to the config.json file using theConfig
class. -
doOKAction
protected void doOKAction()Save the configuration when the OK button is clicked.- Overrides:
doOKAction
in classcom.intellij.openapi.ui.DialogWrapper
-
updateActionGroup
public void updateActionGroup()Update theAddLabelAction
group when the configuration is changed. -
createCenterPanel
Create the center panel of the configuration dialog.- Specified by:
createCenterPanel
in classcom.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. Iftrue
, the button will be an add button. Iffalse
, the button will be a remove button.
-
getCurrentLabels
Get the current labels in the configuration dialog.- Returns:
- The current labels in the configuration dialog.
-
getSelectedCheckboxes
Get the selected checkboxes in the configuration dialog.- Returns:
- The selected checkboxes in the configuration dialog.
-
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
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.
-