@Override @NotNull public JComponent getPreferredFocusedComponent() { return myProjectRootComponent.getTextField(); }
private void listenForPathUpdate() { JTextField textField = mySdkPathField.getTextField(); Ref<String> prevPathRef = Ref.create(StringUtil.notNullize(textField.getText())); textField.getDocument().addDocumentListener(new DocumentAdapter() { @Override protected void textChanged(DocumentEvent e) { String sdkPath = StringUtil.notNullize(textField.getText()); String prevPath = prevPathRef.get(); if (!prevPath.equals(sdkPath)) { asyncUpdateSdkVersion(sdkPath); prevPathRef.set(sdkPath); } } }); } }
private void listenForPathUpdate() { JTextField textField = mySdkPathField.getTextField(); Ref<String> prevPathRef = Ref.create(StringUtil.notNullize(textField.getText())); textField.getDocument().addDocumentListener(new DocumentAdapter() { @Override protected void textChanged(DocumentEvent e) { String sdkPath = StringUtil.notNullize(textField.getText()); String prevPath = prevPathRef.get(); if (!prevPath.equals(sdkPath)) { asyncUpdateSdkVersion(sdkPath); prevPathRef.set(sdkPath); } } }); } }
@Nullable @Override protected ValidationInfo doValidate() { String filePath = documentToImportTextField.getTextField().getText(); if (StringUtils.isBlank(filePath)) { return new ValidationInfo("Data file to import should be set", rootPanel); } File file; file = new File(filePath); if (!file.exists()) { return new ValidationInfo("Data file does not exist", rootPanel); } return super.doValidate(); }
public TwigNamespaceDialog(Project project, TableView<TwigPath> tableView, TwigPath twigPath) { this(project, tableView); this.name.setText(twigPath.getNamespace()); this.namespacePath.getTextField().setText(twigPath.getPath()); this.namespaceType.getModel().setSelectedItem(twigPath.getNamespaceType().toString()); this.twigPath = twigPath; this.setOkState(); }
public JComponent createComponent() { pathToTranslationRootTextField.getButton().addMouseListener(createPathButtonMouseListener(pathToTranslationRootTextField.getTextField(), FileChooserDescriptorFactory.createSingleFolderDescriptor())); pathToTranslationRootTextFieldReset.addMouseListener(createResetPathButtonMouseListener(pathToTranslationRootTextField.getTextField(), Settings.DEFAULT_TRANSLATION_PATH)); directoryToApp.getButton().addMouseListener(createPathButtonMouseListener(directoryToApp.getTextField(), FileChooserDescriptorFactory.createSingleFolderDescriptor())); directoryToAppReset.addMouseListener(createResetPathButtonMouseListener(directoryToApp.getTextField(), Settings.DEFAULT_APP_DIRECTORY)); directoryToWeb.getButton().addMouseListener(createPathButtonMouseListener(directoryToWeb.getTextField(), FileChooserDescriptorFactory.createSingleFolderDescriptor())); directoryToWebReset.addMouseListener(createResetPathButtonMouseListener(directoryToWeb.getTextField(), Settings.DEFAULT_WEB_DIRECTORY)); enableSchedulerCheckBox.setEnabled(WebDeploymentUtil.isEnabled(project)); buttonReindex.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { IndexUtil.forceReindex(); super.mouseClicked(e); } }); return panel1; }
public TwigNamespaceDialog(Project project, TableView<TwigPath> tableView) { this.tableView = tableView; this.project = project; setContentPane(contentPane); setModal(true); getRootPane().setDefaultButton(buttonOK); this.setOkState(); this.namespacePath.getTextField().getDocument().addDocumentListener(new ChangeDocumentListener()); this.name.getDocument().addDocumentListener(new ChangeDocumentListener()); buttonOK.addActionListener(e -> onOK()); buttonCancel.addActionListener(e -> onCancel()); namespacePath.getButton().addMouseListener(createPathButtonMouseListener(namespacePath.getTextField(), FileChooserDescriptorFactory.createSingleFolderDescriptor())); setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { onCancel(); } }); contentPane.registerKeyboardAction(e -> onCancel(), KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); }
privateKeyPathField.getTextField().setName("sshPrivateKeyPathField");
private JTextField getSelectedText() { if (directoryRadioButton.isSelected()) { return directoryTextField.getTextField(); } else if (fileRadioButton.isSelected()) { return fileTextField.getTextField(); } else { return globTextField; } }
@Nullable private String getSelectedLocation() { return fileLocation.getTextField().getText(); }
@Override public void run() { warningMessage.setText(message); warningMessage.setVisible(true); warningIcon.setVisible(true); cloudSdkDirectoryField.getTextField().setForeground(JBColor.red); } });
@VisibleForTesting protected void hideWarning() { invokePanelValidationUpdate( () -> { cloudSdkDirectoryField.getTextField().setForeground(JBColor.black); warningIcon.setVisible(false); warningMessage.setVisible(false); }); }
public AddEditExclusionDialog(Project project) { super(project, false); this.project = project; setTitle("Add SonarLint File Exclusion"); init(); FileChooserDescriptor fileChooser = new FileChooserDescriptor(true, false, false, true, false, false); fileChooser.setRoots(project.getBaseDir()); fileTextField.addBrowseFolderListener("Select File to Exclude", "Select the file which will be excluded from SonarLint analysis", project, fileChooser); FileChooserDescriptor directoryChooser = FileChooserDescriptorFactory.createSingleFolderDescriptor(); directoryChooser.setRoots(project.getBaseDir()); directoryTextField.addBrowseFolderListener("Select Directory to Exclude", "Select the directory which will be excluded from SonarLint analysis", project, directoryChooser); DocumentListener docListener = new DocumentAdapter() { protected void textChanged(final DocumentEvent e) { updateOk(); } }; fileTextField.getTextField().getDocument().addDocumentListener(docListener); directoryTextField.getTextField().getDocument().addDocumentListener(docListener); globTextField.getDocument().addDocumentListener(docListener); ActionListener listener = e -> updateControls(); directoryRadioButton.addActionListener(listener); globRadioButton.addActionListener(listener); fileRadioButton.addActionListener(listener); updateControls(); }
private FilePartUI(FileConfigPart part) { super(part); setupUI(); VirtualFile path = part.getConfigFile(); fileLocation.getTextField().setText(path == null ? null : path.getPath()); fileLocation.addBrowseFolderListener( P4Bundle.message("configuration.connection-choice.picker.p4config"), P4Bundle.message("configuration.p4config.chooser"), null, new FileChooserDescriptor(true, false, false, false, false, false) ); }
.getTextField() .getDocument() .addDocumentListener(
.getTextField() .getDocument() .addDocumentListener( .getTextField() .getDocument() .addDocumentListener(
myScriptField.getTextField().getDocument().addDocumentListener(new DocumentAdapter() { @Override protected void textChanged(@NotNull DocumentEvent documentEvent) {
new FileTypeDescriptor(title, "xsd", "dtd") ); mySchemaLocation.getTextField().setEditable(false); mySchemaLocation.addActionListener(new ActionListener() {
.getTextField() .getDocument() .addDocumentListener(