当前位置: 首页>>代码示例>>Java>>正文


Java TextFieldWithHistory类代码示例

本文整理汇总了Java中com.intellij.ui.TextFieldWithHistory的典型用法代码示例。如果您正苦于以下问题:Java TextFieldWithHistory类的具体用法?Java TextFieldWithHistory怎么用?Java TextFieldWithHistory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


TextFieldWithHistory类属于com.intellij.ui包,在下文中一共展示了TextFieldWithHistory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: validate

import com.intellij.ui.TextFieldWithHistory; //导入依赖的package包/类
private void validate() {
    Validator validator = new Validator();

    TextFieldWithHistory exeComponent = stylintExeField.getChildComponent();
    if (!ValidationUtils.validatePath(project, exeComponent.getText(), false)) {
        validator.add(exeComponent.getTextEditor(), StylintBundle.message("stylint.settings.validate.exe"), StylintBundle.message("stylint.settings.validate.fix"));
    }

    TextFieldWithHistory configComponent = stylintConfigFile.getChildComponent();
    if (!ValidationUtils.validatePath(project, configComponent.getText(), true)) {
        validator.add(configComponent.getTextEditor(), StylintBundle.message("stylint.settings.validate.config"), StylintBundle.message("stylint.settings.validate.fix"));
    }

    if (validator.hasErrors()) {
        versionLabel.setText("n.a.");
    } else {
        updateVersion();
    }

    packagesNotificationPanel.processErrors(validator);
}
 
开发者ID:sertae,项目名称:stylint-plugin,代码行数:22,代码来源:StylintSettingsPage.java

示例2: createLogFileChooser

import com.intellij.ui.TextFieldWithHistory; //导入依赖的package包/类
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, new Consumer<List<VirtualFile>>() {
        @Override
        public void consume(List<VirtualFile> files) {
          myLogFile.setText(FileUtil.toSystemDependentName(files.get(files.size() - 1).getPath()));
        }
      });
    }
  });
  myLogFileChooserPanel.setLayout(new BorderLayout());
  myLogFileChooserPanel.add(panel, BorderLayout.CENTER);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:UnscrambleDialog.java

示例3: createTextFieldWithHistoryWithBrowseButton

import com.intellij.ui.TextFieldWithHistory; //导入依赖的package包/类
@NotNull
public static TextFieldWithHistoryWithBrowseButton createTextFieldWithHistoryWithBrowseButton(@Nullable Project project,
                                                                                              @NotNull String browseDialogTitle,
                                                                                              @NotNull FileChooserDescriptor fileChooserDescriptor,
                                                                                              @Nullable NotNullProducer<List<String>> historyProvider) {
  TextFieldWithHistoryWithBrowseButton textFieldWithHistoryWithBrowseButton = new TextFieldWithHistoryWithBrowseButton();
  TextFieldWithHistory textFieldWithHistory = textFieldWithHistoryWithBrowseButton.getChildComponent();
  textFieldWithHistory.setHistorySize(-1);
  textFieldWithHistory.setMinimumAndPreferredWidth(0);
  if (historyProvider != null) {
    addHistoryOnExpansion(textFieldWithHistory, historyProvider);
  }
  installFileCompletionAndBrowseDialog(
    project,
    textFieldWithHistoryWithBrowseButton,
    browseDialogTitle,
    fileChooserDescriptor
  );
  return textFieldWithHistoryWithBrowseButton;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:SwingHelper.java

示例4: createUIComponents

import com.intellij.ui.TextFieldWithHistory; //导入依赖的package包/类
private void createUIComponents() {
  mavenHomeField = new TextFieldWithHistory();
  mavenHomeField.setHistorySize(-1);
  final ArrayList<String> foundMavenHomes = new ArrayList<String>();
  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<TextFieldWithHistory>(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, "");
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:MavenEnvironmentForm.java

示例5: UseExistingBazelWorkspaceOption

import com.intellij.ui.TextFieldWithHistory; //导入依赖的package包/类
public UseExistingBazelWorkspaceOption(BlazeNewProjectBuilder builder) {
  this.directoryField = new TextFieldWithHistory();
  this.directoryField.setName("workspace-directory-field");
  this.directoryField.setHistory(builder.getWorkspaceHistory(BuildSystem.Bazel));
  this.directoryField.setHistorySize(BlazeNewProjectBuilder.HISTORY_SIZE);
  this.directoryField.setText(builder.getLastImportedWorkspace(BuildSystem.Bazel));

  JButton button = new JButton("...");
  button.addActionListener(action -> this.chooseDirectory());
  int buttonSize = this.directoryField.getPreferredSize().height;
  button.setPreferredSize(new Dimension(buttonSize, buttonSize));

  JComponent box =
      UiUtil.createHorizontalBox(
          HORIZONTAL_LAYOUT_GAP,
          getIconComponent(),
          new JLabel("Workspace:"),
          this.directoryField,
          button);
  UiUtil.setPreferredWidth(box, PREFERRED_COMPONENT_WIDTH);
  this.component = box;
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:23,代码来源:UseExistingBazelWorkspaceOption.java

示例6: createLogFileChooser

import com.intellij.ui.TextFieldWithHistory; //导入依赖的package包/类
private void createLogFileChooser() {
  myLogFile = new TextFieldWithHistory();
  JPanel panel = GuiUtils.constructFieldWithBrowseButton(myLogFile, new ActionListener() {
    public void actionPerformed(ActionEvent e) {
      FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFileNoJarsDescriptor();
      FileChooser.chooseFiles(descriptor, myProject, null, new Consumer<List<VirtualFile>>() {
        @Override
        public void consume(List<VirtualFile> files) {
          myLogFile.setText(FileUtil.toSystemDependentName(files.get(files.size() - 1).getPath()));
        }
      });
    }
  });
  myLogFileChooserPanel.setLayout(new BorderLayout());
  myLogFileChooserPanel.add(panel, BorderLayout.CENTER);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:17,代码来源:UnscrambleDialog.java

示例7: configESLintBinField

import com.intellij.ui.TextFieldWithHistory; //导入依赖的package包/类
private void configESLintBinField() {
    TextFieldWithHistory textFieldWithHistory = stylintExeField.getChildComponent();
    textFieldWithHistory.setHistorySize(-1);
    textFieldWithHistory.setMinimumAndPreferredWidth(0);

    SwingHelper.addHistoryOnExpansion(textFieldWithHistory, () -> FileUtils.toAbsolutePath(StylintFinder.findAllStylintExe()));
    SwingHelper.installFileCompletionAndBrowseDialog(project, stylintExeField, "Select Stylint Exe", FileChooserDescriptorFactory.createSingleFileNoJarsDescriptor());
}
 
开发者ID:sertae,项目名称:stylint-plugin,代码行数:9,代码来源:StylintSettingsPage.java

示例8: configStylintConfigField

import com.intellij.ui.TextFieldWithHistory; //导入依赖的package包/类
private void configStylintConfigField() {
    TextFieldWithHistory textFieldWithHistory = stylintConfigFile.getChildComponent();
    textFieldWithHistory.setHistorySize(-1);
    textFieldWithHistory.setMinimumAndPreferredWidth(0);

    SwingHelper.addHistoryOnExpansion(textFieldWithHistory, () -> StylintFinder.searchForLintConfigFiles(new File(project.getBaseDir().getPath())));
    SwingHelper.installFileCompletionAndBrowseDialog(project, stylintConfigFile, "Select Stylint Config", FileChooserDescriptorFactory.createSingleFileNoJarsDescriptor());
}
 
开发者ID:sertae,项目名称:stylint-plugin,代码行数:9,代码来源:StylintSettingsPage.java

示例9: configConfigFileField

import com.intellij.ui.TextFieldWithHistory; //导入依赖的package包/类
private void configConfigFileField() {
    TextFieldWithHistory textFieldWithHistory = configWithDefaults(sassLintConfigFile);
    SwingHelper.addHistoryOnExpansion(textFieldWithHistory, new NotNullProducer<List<String>>() {
        @NotNull
        public List<String> produce() {
            return SassLintFinder.searchForConfigFiles(getProjectPath());
        }
    });
    SwingHelper.installFileCompletionAndBrowseDialog(project, sassLintConfigFile, "Select Sass Lint Config", FileChooserDescriptorFactory.createSingleFileNoJarsDescriptor());
}
 
开发者ID:idok,项目名称:sass-lint-plugin,代码行数:11,代码来源:SassLintSettingsPage.java

示例10: configNodeField

import com.intellij.ui.TextFieldWithHistory; //导入依赖的package包/类
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());
}
 
开发者ID:idok,项目名称:sass-lint-plugin,代码行数:12,代码来源:SassLintSettingsPage.java

示例11: setHistory

import com.intellij.ui.TextFieldWithHistory; //导入依赖的package包/类
public static void setHistory(@NotNull TextFieldWithHistory textFieldWithHistory,
                              @NotNull List<String> history,
                              boolean mergeWithPrevHistory) {
  Set<String> newHistorySet = ContainerUtil.newHashSet(history);
  List<String> prevHistory = textFieldWithHistory.getHistory();
  List<String> mergedHistory = ContainerUtil.newArrayListWithCapacity(history.size());
  if (mergeWithPrevHistory) {
    for (String item : prevHistory) {
      if (!newHistorySet.contains(item)) {
        mergedHistory.add(item);
      }
    }
  }
  mergedHistory.addAll(history);
  String oldText = StringUtil.notNullize(textFieldWithHistory.getText());
  String oldSelectedItem = ObjectUtils.tryCast(textFieldWithHistory.getSelectedItem(), String.class);
  if (!mergedHistory.contains(oldSelectedItem)) {
    oldSelectedItem = null;
  }
  textFieldWithHistory.setHistory(mergedHistory);
  setLongestAsPrototype(textFieldWithHistory, mergedHistory);
  if (oldSelectedItem != null) {
    textFieldWithHistory.setSelectedItem(oldSelectedItem);
  }
  if (!oldText.equals(oldSelectedItem)) {
    textFieldWithHistory.setText(oldText);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:29,代码来源:SwingHelper.java

示例12: configNodeField

import com.intellij.ui.TextFieldWithHistory; //导入依赖的package包/类
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());
}
 
开发者ID:henjue,项目名称:vue-for-idea,代码行数:12,代码来源:VueSettingsPage.java

示例13: configConfigFileField

import com.intellij.ui.TextFieldWithHistory; //导入依赖的package包/类
private void configConfigFileField() {
    TextFieldWithHistory textFieldWithHistory = configWithDefaults(eslintrcFile);
    SwingHelper.addHistoryOnExpansion(textFieldWithHistory, new NotNullProducer<List<String>>() {
        @NotNull
        public List<String> produce() {
            return CoffeeLintFinder.searchForConfigFiles(getProjectPath());
        }
    });
    SwingHelper.installFileCompletionAndBrowseDialog(project, eslintrcFile, "Select CoffeeLint config", FileChooserDescriptorFactory.createSingleFileNoJarsDescriptor());
}
 
开发者ID:idok,项目名称:coffee-lint-plugin,代码行数:11,代码来源:CoffeeLintSettingsPage.java

示例14: configJscsRcField

import com.intellij.ui.TextFieldWithHistory; //导入依赖的package包/类
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());
}
 
开发者ID:idok,项目名称:jscs-plugin,代码行数:11,代码来源:JscsSettingsPage.java

示例15: configESLintRulesField

import com.intellij.ui.TextFieldWithHistory; //导入依赖的package包/类
private void configESLintRulesField() {
    TextFieldWithHistory textFieldWithHistory = rulesPathField.getChildComponent();
    SwingHelper.addHistoryOnExpansion(textFieldWithHistory, new NotNullProducer<List<String>>() {
        @NotNull
        public List<String> produce() {
            return ESLintFinder.tryFindRulesAsString(getProjectPath());
        }
    });
    SwingHelper.installFileCompletionAndBrowseDialog(project, rulesPathField, "Select Built in rules", FileChooserDescriptorFactory.createSingleFileNoJarsDescriptor());
}
 
开发者ID:idok,项目名称:eslint-plugin,代码行数:11,代码来源:ESLintSettingsPage.java


注:本文中的com.intellij.ui.TextFieldWithHistory类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。