本文整理汇总了Java中com.intellij.ui.TextFieldWithHistory.setHistorySize方法的典型用法代码示例。如果您正苦于以下问题:Java TextFieldWithHistory.setHistorySize方法的具体用法?Java TextFieldWithHistory.setHistorySize怎么用?Java TextFieldWithHistory.setHistorySize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.ui.TextFieldWithHistory
的用法示例。
在下文中一共展示了TextFieldWithHistory.setHistorySize方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
示例2: 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 &home directory");
final JBLabel versionLabel = new JBLabel();
versionLabel.setOpaque(true);
versionLabel.setVerticalAlignment(SwingConstants.TOP);
versionLabel.setVerticalTextPosition(SwingConstants.TOP);
mavenVersionLabelComponent = LabeledComponent.create(versionLabel, "");
}
示例3: 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());
}
示例4: 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());
}
示例5: configWithDefaults
import com.intellij.ui.TextFieldWithHistory; //导入方法依赖的package包/类
private static TextFieldWithHistory configWithDefaults(TextFieldWithHistoryWithBrowseButton field) {
TextFieldWithHistory textFieldWithHistory = field.getChildComponent();
textFieldWithHistory.setHistorySize(-1);
textFieldWithHistory.setMinimumAndPreferredWidth(0);
return textFieldWithHistory;
}
示例6: AlternativeJREPanel
import com.intellij.ui.TextFieldWithHistory; //导入方法依赖的package包/类
public AlternativeJREPanel() {
myCbEnabled = new JBCheckBox(ExecutionBundle.message("run.configuration.use.alternate.jre.checkbox"));
myFieldWithHistory = new TextFieldWithHistory();
myFieldWithHistory.setHistorySize(-1);
final ArrayList<String> foundJDKs = new ArrayList<String>();
final Sdk[] allJDKs = ProjectJdkTable.getInstance().getAllJdks();
for (Sdk sdk : allJDKs) {
foundJDKs.add(sdk.getName());
}
for (JreProvider provider : JreProvider.EP_NAME.getExtensions()) {
String path = provider.getJrePath();
if (!StringUtil.isEmpty(path)) {
foundJDKs.add(path);
}
}
for (Sdk jdk : allJDKs) {
String homePath = jdk.getHomePath();
if (!SystemInfo.isMac) {
final File jre = new File(jdk.getHomePath(), "jre");
if (jre.isDirectory()) {
homePath = jre.getPath();
}
}
if (!foundJDKs.contains(homePath)) {
foundJDKs.add(homePath);
}
}
myFieldWithHistory.setHistory(foundJDKs);
myPathField = new ComponentWithBrowseButton<TextFieldWithHistory>(myFieldWithHistory, null);
myPathField.addBrowseFolderListener(ExecutionBundle.message("run.configuration.select.alternate.jre.label"),
ExecutionBundle.message("run.configuration.select.jre.dir.label"),
null, BrowseFilesListener.SINGLE_DIRECTORY_DESCRIPTOR,
TextComponentAccessor.TEXT_FIELD_WITH_HISTORY_WHOLE_TEXT);
setLayout(new MigLayout("ins 0, gap 10, fill, flowx"));
add(myCbEnabled, "shrinkx");
add(myPathField, "growx, pushx");
InsertPathAction.addTo(myFieldWithHistory.getTextEditor());
myCbEnabled.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
enabledChanged();
}
});
enabledChanged();
setAnchor(myCbEnabled);
updateUI();
}
示例7: AlternativeJREPanel
import com.intellij.ui.TextFieldWithHistory; //导入方法依赖的package包/类
public AlternativeJREPanel() {
myCbEnabled = new JBCheckBox(ExecutionBundle.message("run.configuration.use.alternate.jre.checkbox"));
myFieldWithHistory = new TextFieldWithHistory();
myFieldWithHistory.setHistorySize(-1);
final List<String> foundJDKs = new ArrayList<>();
final Sdk[] allJDKs = ProjectJdkTable.getInstance().getAllJdks();
String javaHomeOfCurrentProcess = System.getProperty("java.home");
if (javaHomeOfCurrentProcess != null && !javaHomeOfCurrentProcess.isEmpty()) {
foundJDKs.add(javaHomeOfCurrentProcess);
}
for (Sdk sdk : allJDKs) {
String name = sdk.getName();
if (!foundJDKs.contains(name)) {
foundJDKs.add(name);
}
}
for (Sdk jdk : allJDKs) {
String homePath = jdk.getHomePath();
if (!SystemInfo.isMac) {
final File jre = new File(jdk.getHomePath(), "jre");
if (jre.isDirectory()) {
homePath = jre.getPath();
}
}
if (!foundJDKs.contains(homePath)) {
foundJDKs.add(homePath);
}
}
myFieldWithHistory.setHistory(foundJDKs);
myPathField = new ComponentWithBrowseButton<>(myFieldWithHistory, null);
myPathField.addBrowseFolderListener(ExecutionBundle.message("run.configuration.select.alternate.jre.label"),
ExecutionBundle.message("run.configuration.select.jre.dir.label"),
null, BrowseFilesListener.SINGLE_DIRECTORY_DESCRIPTOR,
TextComponentAccessor.TEXT_FIELD_WITH_HISTORY_WHOLE_TEXT);
setLayout(new MigLayout("ins 0, gap 10, fill, flowx"));
add(myCbEnabled, "shrinkx");
add(myPathField, "growx, pushx");
InsertPathAction.addTo(myFieldWithHistory.getTextEditor());
myCbEnabled.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
enabledChanged();
}
});
enabledChanged();
setAnchor(myCbEnabled);
updateUI();
}