Search in sources :

Example 6 with TextFieldWithHistory

use of com.intellij.ui.TextFieldWithHistory in project jscs-plugin by idok.

the class JscsSettingsPage method configWithDefaults.

private static TextFieldWithHistory configWithDefaults(TextFieldWithHistoryWithBrowseButton field) {
    TextFieldWithHistory textFieldWithHistory = field.getChildComponent();
    textFieldWithHistory.setHistorySize(-1);
    textFieldWithHistory.setMinimumAndPreferredWidth(0);
    return textFieldWithHistory;
}
Also used : TextFieldWithHistory(com.intellij.ui.TextFieldWithHistory)

Example 7 with TextFieldWithHistory

use of com.intellij.ui.TextFieldWithHistory in project scss-lint-plugin by idok.

the class ScssLintSettingsPage method configScssLintConfigField.

private void configScssLintConfigField() {
    TextFieldWithHistory textFieldWithHistory = scssLintConfigFile.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());
            return ScssLintFinder.searchForLintConfigFiles(projectRoot);
        }
    });
    SwingHelper.installFileCompletionAndBrowseDialog(project, scssLintConfigFile, "Select SCSS Lint Config", FileChooserDescriptorFactory.createSingleFileNoJarsDescriptor());
}
Also used : TextFieldWithHistory(com.intellij.ui.TextFieldWithHistory) List(java.util.List) NotNull(org.jetbrains.annotations.NotNull) File(java.io.File)

Example 8 with TextFieldWithHistory

use of com.intellij.ui.TextFieldWithHistory in project intellij-community by JetBrains.

the class MavenEnvironmentForm method createUIComponents.

private void createUIComponents() {
    mavenHomeField = new TextFieldWithHistory();
    mavenHomeField.setHistorySize(-1);
    final ArrayList<String> foundMavenHomes = new ArrayList<>();
    foundMavenHomes.add(MavenServerManager.BUNDLED_MAVEN_2);
    foundMavenHomes.add(MavenServerManager.BUNDLED_MAVEN_3);
    final File mavenHomeDirectory = MavenUtil.resolveMavenHomeDirectory(null);
    if (mavenHomeDirectory != null) {
        foundMavenHomes.add(FileUtil.toSystemIndependentName(mavenHomeDirectory.getPath()));
    }
    mavenHomeField.setHistory(foundMavenHomes);
    mavenHomeComponent = LabeledComponent.create(new ComponentWithBrowseButton<>(mavenHomeField, null), "Maven &amp;home directory");
    final JBLabel versionLabel = new JBLabel();
    versionLabel.setOpaque(true);
    versionLabel.setVerticalAlignment(SwingConstants.TOP);
    versionLabel.setVerticalTextPosition(SwingConstants.TOP);
    mavenVersionLabelComponent = LabeledComponent.create(versionLabel, "");
}
Also used : JBLabel(com.intellij.ui.components.JBLabel) TextFieldWithHistory(com.intellij.ui.TextFieldWithHistory) ComponentWithBrowseButton(com.intellij.openapi.ui.ComponentWithBrowseButton) ArrayList(java.util.ArrayList) File(java.io.File)

Aggregations

TextFieldWithHistory (com.intellij.ui.TextFieldWithHistory)8 NotNull (org.jetbrains.annotations.NotNull)6 List (java.util.List)5 ArrayList (java.util.ArrayList)4 File (java.io.File)2 RunContentDescriptor (com.intellij.execution.ui.RunContentDescriptor)1 AllIcons (com.intellij.icons.AllIcons)1 IdeBundle (com.intellij.ide.IdeBundle)1 PropertiesComponent (com.intellij.ide.util.PropertiesComponent)1 FileChooser (com.intellij.openapi.fileChooser.FileChooser)1 FileChooserDescriptor (com.intellij.openapi.fileChooser.FileChooserDescriptor)1 FileChooserDescriptorFactory (com.intellij.openapi.fileChooser.FileChooserDescriptorFactory)1 HelpManager (com.intellij.openapi.help.HelpManager)1 ConfigurationException (com.intellij.openapi.options.ConfigurationException)1 DumbService (com.intellij.openapi.project.DumbService)1 Project (com.intellij.openapi.project.Project)1 ComponentWithBrowseButton (com.intellij.openapi.ui.ComponentWithBrowseButton)1 DialogWrapper (com.intellij.openapi.ui.DialogWrapper)1 Comparing (com.intellij.openapi.util.Comparing)1 Condition (com.intellij.openapi.util.Condition)1