use of com.intellij.ui.TextFieldWithHistory in project scss-lint-plugin by idok.
the class ScssLintSettingsPage method configESLintBinField.
private void configESLintBinField() {
TextFieldWithHistory textFieldWithHistory = scssLintExeField.getChildComponent();
textFieldWithHistory.setHistorySize(-1);
textFieldWithHistory.setMinimumAndPreferredWidth(0);
SwingHelper.addHistoryOnExpansion(textFieldWithHistory, new NotNullProducer<List<String>>() {
@NotNull
public List<String> produce() {
// File projectRoot = new File(project.getBaseDir().getPath());
//searchForESLintBin(projectRoot);
List<File> newFiles = ScssLintFinder.findAllScssLintExe();
return FileUtils.toAbsolutePath(newFiles);
}
});
SwingHelper.installFileCompletionAndBrowseDialog(project, scssLintExeField, "Select SCSS Lint Exe", FileChooserDescriptorFactory.createSingleFileNoJarsDescriptor());
}
use of com.intellij.ui.TextFieldWithHistory in project jscs-plugin by idok.
the class JscsSettingsPage method configJscsRcField.
private void configJscsRcField() {
TextFieldWithHistory textFieldWithHistory = configWithDefaults(jscsrcFile);
SwingHelper.addHistoryOnExpansion(textFieldWithHistory, new NotNullProducer<List<String>>() {
@NotNull
public List<String> produce() {
return JscsFinder.searchForJscsRCFiles(getProjectPath());
}
});
SwingHelper.installFileCompletionAndBrowseDialog(project, jscsrcFile, "Select JSCS config", FileChooserDescriptorFactory.createSingleFileNoJarsDescriptor());
}
use of com.intellij.ui.TextFieldWithHistory in project intellij-community by JetBrains.
the class UnscrambleDialog method createLogFileChooser.
private void createLogFileChooser() {
myLogFile = new TextFieldWithHistory();
JPanel panel = GuiUtils.constructFieldWithBrowseButton(myLogFile, new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFileNoJarsDescriptor();
FileChooser.chooseFiles(descriptor, myProject, null, files -> myLogFile.setText(FileUtil.toSystemDependentName(files.get(files.size() - 1).getPath())));
}
});
myLogFileChooserPanel.setLayout(new BorderLayout());
myLogFileChooserPanel.add(panel, BorderLayout.CENTER);
}
use of com.intellij.ui.TextFieldWithHistory in project intellij-plugins by JetBrains.
the class KarmaRunConfigurationEditor method createConfigurationFileTextField.
@NotNull
private static TextFieldWithHistoryWithBrowseButton createConfigurationFileTextField(@NotNull final Project project) {
TextFieldWithHistoryWithBrowseButton textFieldWithHistoryWithBrowseButton = new TextFieldWithHistoryWithBrowseButton();
final TextFieldWithHistory textFieldWithHistory = textFieldWithHistoryWithBrowseButton.getChildComponent();
textFieldWithHistory.setHistorySize(-1);
textFieldWithHistory.setMinimumAndPreferredWidth(0);
SwingHelper.addHistoryOnExpansion(textFieldWithHistory, () -> {
List<VirtualFile> newFiles = KarmaUtil.listPossibleConfigFilesInProject(project);
List<String> newFilePaths = ContainerUtil.map(newFiles, file -> FileUtil.toSystemDependentName(file.getPath()));
Collections.sort(newFilePaths);
return newFilePaths;
});
SwingHelper.installFileCompletionAndBrowseDialog(project, textFieldWithHistoryWithBrowseButton, KarmaBundle.message("runConfiguration.config_file.browse_dialog.title"), FileChooserDescriptorFactory.createSingleFileNoJarsDescriptor());
return textFieldWithHistoryWithBrowseButton;
}
use of com.intellij.ui.TextFieldWithHistory in project jscs-plugin by idok.
the class JscsSettingsPage method configNodeField.
private void configNodeField() {
TextFieldWithHistory textFieldWithHistory = configWithDefaults(nodeInterpreterField);
SwingHelper.addHistoryOnExpansion(textFieldWithHistory, new NotNullProducer<List<String>>() {
@NotNull
public List<String> produce() {
List<File> newFiles = NodeDetectionUtil.listAllPossibleNodeInterpreters();
return FileUtils.toAbsolutePath(newFiles);
}
});
SwingHelper.installFileCompletionAndBrowseDialog(project, nodeInterpreterField, "Select Node interpreter", FileChooserDescriptorFactory.createSingleFileNoJarsDescriptor());
}
Aggregations