本文整理汇总了Java中com.intellij.ui.TextFieldWithHistoryWithBrowseButton类的典型用法代码示例。如果您正苦于以下问题:Java TextFieldWithHistoryWithBrowseButton类的具体用法?Java TextFieldWithHistoryWithBrowseButton怎么用?Java TextFieldWithHistoryWithBrowseButton使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TextFieldWithHistoryWithBrowseButton类属于com.intellij.ui包,在下文中一共展示了TextFieldWithHistoryWithBrowseButton类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createTextFieldWithHistoryWithBrowseButton
import com.intellij.ui.TextFieldWithHistoryWithBrowseButton; //导入依赖的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
示例2: resizeDialogToFitTextFor
import com.intellij.ui.TextFieldWithHistoryWithBrowseButton; //导入依赖的package包/类
public static void resizeDialogToFitTextFor(@NotNull final JComponent... components) {
if (components.length == 0) return;
doWithDialogWrapper(components[0], new Consumer<DialogWrapper>() {
@Override
public void consume(final DialogWrapper dialogWrapper) {
if (dialogWrapper instanceof SettingsDialog || dialogWrapper instanceof SingleConfigurableEditor) {
for (Component component : components) {
if (component instanceof TextFieldWithHistoryWithBrowseButton) {
setPreferredWidthToFitText((TextFieldWithHistoryWithBrowseButton)component);
}
else if (component instanceof TextFieldWithBrowseButton) {
setPreferredWidthToFitText((TextFieldWithBrowseButton)component);
}
else if (component instanceof JTextField) {
setPreferredWidthToFitText((JTextField)component);
}
}
ApplicationManager.getApplication().invokeLater(new Runnable() {
@Override
public void run() {
adjustDialogSizeToFitPreferredSize(dialogWrapper);
}
}, ModalityState.any());
}
}
});
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:28,代码来源:SwingHelper.java
示例3: installFileCompletionAndBrowseDialog
import com.intellij.ui.TextFieldWithHistoryWithBrowseButton; //导入依赖的package包/类
public static void installFileCompletionAndBrowseDialog(@Nullable Project project,
@NotNull TextFieldWithHistoryWithBrowseButton textFieldWithHistoryWithBrowseButton,
@NotNull @Nls(capitalization = Nls.Capitalization.Title) String browseDialogTitle,
@NotNull FileChooserDescriptor fileChooserDescriptor) {
doInstall(project,
textFieldWithHistoryWithBrowseButton,
textFieldWithHistoryWithBrowseButton.getChildComponent().getTextEditor(),
browseDialogTitle,
fileChooserDescriptor,
TextComponentAccessor.TEXT_FIELD_WITH_HISTORY_WHOLE_TEXT);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:SwingHelper.java
示例4: createNorthPanel
import com.intellij.ui.TextFieldWithHistoryWithBrowseButton; //导入依赖的package包/类
@Override
protected JComponent createNorthPanel() {
myNameLabel = JBLabelDecorator.createJBLabelDecorator().setBold(true);
myTargetDirectoryField = new TextFieldWithHistoryWithBrowseButton();
final List<String> recentEntries = RecentsManager.getInstance(myProject).getRecentEntries(RECENT_KEYS);
if (recentEntries != null) {
myTargetDirectoryField.getChildComponent().setHistory(recentEntries);
}
final FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
myTargetDirectoryField.addBrowseFolderListener(RefactoringBundle.message("select.target.directory"),
RefactoringBundle.message("the.file.will.be.moved.to.this.directory"),
myProject,
descriptor,
TextComponentAccessor.TEXT_FIELD_WITH_HISTORY_WHOLE_TEXT);
final JTextField textField = myTargetDirectoryField.getChildComponent().getTextEditor();
FileChooserFactory.getInstance().installFileCompletion(textField, descriptor, true, getDisposable());
textField.getDocument().addDocumentListener(new DocumentAdapter() {
@Override
protected void textChanged(DocumentEvent e) {
validateOKButton();
}
});
myTargetDirectoryField.setTextFieldPreferredWidth(CopyFilesOrDirectoriesDialog.MAX_PATH_LENGTH);
Disposer.register(getDisposable(), myTargetDirectoryField);
String shortcutText = KeymapUtil.getFirstKeyboardShortcutText(ActionManager.getInstance().getAction(IdeActions.ACTION_CODE_COMPLETION));
myCbSearchForReferences = new NonFocusableCheckBox(RefactoringBundle.message("search.for.references"));
myCbSearchForReferences.setSelected(RefactoringSettings.getInstance().MOVE_SEARCH_FOR_REFERENCES_FOR_FILE);
return FormBuilder.createFormBuilder().addComponent(myNameLabel)
.addLabeledComponent(RefactoringBundle.message("move.files.to.directory.label"), myTargetDirectoryField, UIUtil.LARGE_VGAP)
.addTooltip(RefactoringBundle.message("path.completion.shortcut", shortcutText))
.addComponentToRightColumn(myCbSearchForReferences, UIUtil.LARGE_VGAP).getPanel();
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:37,代码来源:MoveFilesOrDirectoriesDialog.java
示例5: validateField
import com.intellij.ui.TextFieldWithHistoryWithBrowseButton; //导入依赖的package包/类
private void validateField(Validator validator, TextFieldWithHistoryWithBrowseButton field, boolean allowEmpty, String message) {
if (!ValidationUtils.validatePath(project, field.getChildComponent().getText(), allowEmpty)) {
validator.add(field.getChildComponent().getTextEditor(), message, FIX_IT);
}
}
开发者ID:idok,项目名称:sass-lint-plugin,代码行数:6,代码来源:SassLintSettingsPage.java
示例6: configWithDefaults
import com.intellij.ui.TextFieldWithHistoryWithBrowseButton; //导入依赖的package包/类
private static TextFieldWithHistory configWithDefaults(TextFieldWithHistoryWithBrowseButton field) {
TextFieldWithHistory textFieldWithHistory = field.getChildComponent();
textFieldWithHistory.setHistorySize(-1);
textFieldWithHistory.setMinimumAndPreferredWidth(0);
return textFieldWithHistory;
}
开发者ID:idok,项目名称:sass-lint-plugin,代码行数:7,代码来源:SassLintSettingsPage.java
示例7: areEqual
import com.intellij.ui.TextFieldWithHistoryWithBrowseButton; //导入依赖的package包/类
private static boolean areEqual(TextFieldWithHistoryWithBrowseButton field, String value) {
return field.getChildComponent().getText().equals(value);
}
开发者ID:idok,项目名称:sass-lint-plugin,代码行数:4,代码来源:SassLintSettingsPage.java
示例8: setPreferredWidthToFitText
import com.intellij.ui.TextFieldWithHistoryWithBrowseButton; //导入依赖的package包/类
public static void setPreferredWidthToFitText(@NotNull TextFieldWithHistoryWithBrowseButton component) {
int childWidth = calcWidthToFitText(component.getChildComponent().getTextEditor(), JBUI.scale(32));
setPreferredWidthForComponentWithBrowseButton(component, childWidth);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:SwingHelper.java
示例9: createNorthPanel
import com.intellij.ui.TextFieldWithHistoryWithBrowseButton; //导入依赖的package包/类
@Override
protected JComponent createNorthPanel() {
myNameLabel = JBLabelDecorator.createJBLabelDecorator().setBold(true);
myTargetDirectoryField = new TextFieldWithHistoryWithBrowseButton();
final List<String> recentEntries = RecentsManager.getInstance(myProject).getRecentEntries(RECENT_KEYS);
if (recentEntries != null) {
myTargetDirectoryField.getChildComponent().setHistory(recentEntries);
}
final FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
myTargetDirectoryField.addBrowseFolderListener(RefactoringBundle.message("select.target.directory"),
RefactoringBundle.message("the.file.will.be.moved.to.this.directory"),
myProject,
descriptor,
TextComponentAccessor.TEXT_FIELD_WITH_HISTORY_WHOLE_TEXT);
final JTextField textField = myTargetDirectoryField.getChildComponent().getTextEditor();
FileChooserFactory.getInstance().installFileCompletion(textField, descriptor, true, getDisposable());
textField.getDocument().addDocumentListener(new DocumentAdapter() {
@Override
protected void textChanged(DocumentEvent e) {
validateOKButton();
}
});
myTargetDirectoryField.setTextFieldPreferredWidth(CopyFilesOrDirectoriesDialog.MAX_PATH_LENGTH);
Disposer.register(getDisposable(), myTargetDirectoryField);
String shortcutText = KeymapUtil.getFirstKeyboardShortcutText(ActionManager.getInstance().getAction(IdeActions.ACTION_CODE_COMPLETION));
myCbSearchForReferences = new NonFocusableCheckBox(RefactoringBundle.message("search.for.references"));
myCbSearchForReferences.setSelected(RefactoringSettings.getInstance().MOVE_SEARCH_FOR_REFERENCES_FOR_FILE);
myOpenInEditorCb = new NonFocusableCheckBox("Open moved files in editor");
myOpenInEditorCb.setSelected(isOpenInEditor());
return FormBuilder.createFormBuilder().addComponent(myNameLabel)
.addLabeledComponent(RefactoringBundle.message("move.files.to.directory.label"), myTargetDirectoryField, UIUtil.LARGE_VGAP)
.addTooltip(RefactoringBundle.message("path.completion.shortcut", shortcutText))
.addComponentToRightColumn(myCbSearchForReferences, UIUtil.LARGE_VGAP)
.addComponentToRightColumn(myOpenInEditorCb, UIUtil.LARGE_VGAP)
.getPanel();
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:42,代码来源:MoveFilesOrDirectoriesDialog.java
示例10: createNorthPanel
import com.intellij.ui.TextFieldWithHistoryWithBrowseButton; //导入依赖的package包/类
@Override
protected JComponent createNorthPanel() {
myInformationLabel = JBLabelDecorator.createJBLabelDecorator().setBold(true);
final FormBuilder formBuilder = FormBuilder.createFormBuilder().addComponent(myInformationLabel).addVerticalGap(
UIUtil.LARGE_VGAP - UIUtil.DEFAULT_VGAP);
DocumentListener documentListener = new DocumentAdapter() {
@Override
public void textChanged(DocumentEvent event) {
validateOKButton();
}
};
if (myShowNewNameField) {
myNewNameField = new JBTextField();
myNewNameField.getDocument().addDocumentListener(documentListener);
formBuilder.addLabeledComponent(RefactoringBundle.message("copy.files.new.name.label"), myNewNameField);
}
if (myShowDirectoryField) {
myTargetDirectoryField = new TextFieldWithHistoryWithBrowseButton();
myTargetDirectoryField.setTextFieldPreferredWidth(MAX_PATH_LENGTH);
final List<String> recentEntries = RecentsManager.getInstance(myProject).getRecentEntries(RECENT_KEYS);
if (recentEntries != null) {
myTargetDirectoryField.getChildComponent().setHistory(recentEntries);
}
final FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
myTargetDirectoryField.addBrowseFolderListener(RefactoringBundle.message("select.target.directory"),
RefactoringBundle.message("the.file.will.be.copied.to.this.directory"),
myProject, descriptor,
TextComponentAccessor.TEXT_FIELD_WITH_HISTORY_WHOLE_TEXT);
myTargetDirectoryField.getChildComponent().addDocumentListener(new DocumentAdapter() {
@Override
protected void textChanged(DocumentEvent e) {
validateOKButton();
}
});
formBuilder.addLabeledComponent(RefactoringBundle.message("copy.files.to.directory.label"), myTargetDirectoryField);
String shortcutText =
KeymapUtil.getFirstKeyboardShortcutText(ActionManager.getInstance().getAction(IdeActions.ACTION_CODE_COMPLETION));
formBuilder.addTooltip(RefactoringBundle.message("path.completion.shortcut", shortcutText));
}
final JPanel wrapper = new JPanel(new BorderLayout());
wrapper.add(myOpenFilesInEditor, BorderLayout.EAST);
formBuilder.addComponent(wrapper);
return formBuilder.getPanel();
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:49,代码来源:CopyFilesOrDirectoriesDialog.java
示例11: validateField
import com.intellij.ui.TextFieldWithHistoryWithBrowseButton; //导入依赖的package包/类
private void validateField(Validator validator, TextFieldWithHistoryWithBrowseButton field, boolean allowEmpty, String message) {
if (!ValidationUtils.validatePath(project, field.getChildComponent().getText(), allowEmpty)) {
ValidationInfo error = new ValidationInfo(field.getChildComponent().getTextEditor(), message, FIX_IT);
validator.errors.add(error);
}
}
开发者ID:idok,项目名称:react-templates-plugin,代码行数:7,代码来源:RTSettingsPage.java
示例12: validateField
import com.intellij.ui.TextFieldWithHistoryWithBrowseButton; //导入依赖的package包/类
private void validateField(List<ValidationInfo> errors, TextFieldWithHistoryWithBrowseButton field, boolean allowEmpty, String message) {
if (!ValidationUtils.validatePath(project, field.getChildComponent().getText(), allowEmpty)) {
ValidationInfo error = new ValidationInfo(field.getChildComponent().getTextEditor(), message, FIX_IT);
errors.add(error);
}
}
开发者ID:henjue,项目名称:vue-for-idea,代码行数:7,代码来源:VueSettingsPage.java
示例13: validateField
import com.intellij.ui.TextFieldWithHistoryWithBrowseButton; //导入依赖的package包/类
private void validateField(List<ValidationInfo> errors, TextFieldWithHistoryWithBrowseButton field, boolean allowEmpty, String message) {
if (!validatePath(field.getChildComponent().getText(), allowEmpty)) {
ValidationInfo error = new ValidationInfo(field.getChildComponent().getTextEditor(), message, FIX_IT);
errors.add(error);
}
}
开发者ID:idok,项目名称:coffee-lint-plugin,代码行数:7,代码来源:CoffeeLintSettingsPage.java
示例14: addDocumentListenerToComp
import com.intellij.ui.TextFieldWithHistoryWithBrowseButton; //导入依赖的package包/类
private void addDocumentListenerToComp(TextFieldWithHistoryWithBrowseButton field, DocumentAdapter docAdp) {
field.getChildComponent().getTextEditor().getDocument().addDocumentListener(docAdp);
}
开发者ID:idok,项目名称:jscs-plugin,代码行数:4,代码来源:JscsSettingsPage.java
示例15: validateField
import com.intellij.ui.TextFieldWithHistoryWithBrowseButton; //导入依赖的package包/类
private void validateField(Validator validator, TextFieldWithHistoryWithBrowseButton field, boolean allowEmpty, String message) {
if (!validatePath(field.getChildComponent().getText(), allowEmpty)) {
validator.add(field.getChildComponent().getTextEditor(), message, FIX_IT);
// addError(validator, field.getChildComponent().getTextEditor(), message, FIX_IT);
}
}
开发者ID:idok,项目名称:eslint-plugin,代码行数:7,代码来源:ESLintSettingsPage.java
示例16: getControllerNameBox
import com.intellij.ui.TextFieldWithHistoryWithBrowseButton; //导入依赖的package包/类
public TextFieldWithHistoryWithBrowseButton getControllerNameBox() {
return controllerNameBox;
}
开发者ID:magnetsystems,项目名称:r2m-plugin-android,代码行数:4,代码来源:AddControllerForm.java
示例17: createNorthPanel
import com.intellij.ui.TextFieldWithHistoryWithBrowseButton; //导入依赖的package包/类
@Override
protected JComponent createNorthPanel() {
myInformationLabel = JBLabelDecorator.createJBLabelDecorator().setBold(true);
final FormBuilder formBuilder = FormBuilder.createFormBuilder().addComponent(myInformationLabel).addVerticalGap(
UIUtil.LARGE_VGAP - UIUtil.DEFAULT_VGAP);
DocumentListener documentListener = new DocumentAdapter() {
@Override
public void textChanged(DocumentEvent event) {
validateOKButton();
}
};
if (myShowNewNameField) {
myNewNameField = new JTextField();
myNewNameField.getDocument().addDocumentListener(documentListener);
formBuilder.addLabeledComponent(RefactoringBundle.message("copy.files.new.name.label"), myNewNameField);
}
if (myShowDirectoryField) {
myTargetDirectoryField = new TextFieldWithHistoryWithBrowseButton();
myTargetDirectoryField.setTextFieldPreferredWidth(MAX_PATH_LENGTH);
final List<String> recentEntries = RecentsManager.getInstance(myProject).getRecentEntries(RECENT_KEYS);
if (recentEntries != null) {
myTargetDirectoryField.getChildComponent().setHistory(recentEntries);
}
final FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
myTargetDirectoryField.addBrowseFolderListener(RefactoringBundle.message("select.target.directory"),
RefactoringBundle.message("the.file.will.be.copied.to.this.directory"),
myProject, descriptor,
TextComponentAccessor.TEXT_FIELD_WITH_HISTORY_WHOLE_TEXT);
myTargetDirectoryField.getChildComponent().addDocumentListener(new DocumentAdapter() {
@Override
protected void textChanged(DocumentEvent e) {
validateOKButton();
}
});
formBuilder.addLabeledComponent(RefactoringBundle.message("copy.files.to.directory.label"), myTargetDirectoryField);
String shortcutText =
KeymapUtil.getFirstKeyboardShortcutText(ActionManager.getInstance().getAction(IdeActions.ACTION_CODE_COMPLETION));
formBuilder.addTooltip(RefactoringBundle.message("path.completion.shortcut", shortcutText));
}
final JPanel wrapper = new JPanel(new BorderLayout());
wrapper.add(myOpenFilesInEditor, BorderLayout.EAST);
formBuilder.addComponent(wrapper);
return formBuilder.getPanel();
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:49,代码来源:CopyFilesOrDirectoriesDialog.java
示例18: createNorthPanel
import com.intellij.ui.TextFieldWithHistoryWithBrowseButton; //导入依赖的package包/类
@Override
protected JComponent createNorthPanel() {
myNameLabel = JBLabelDecorator.createJBLabelDecorator().setBold(true);
myTargetDirectoryField = new TextFieldWithHistoryWithBrowseButton();
final List<String> recentEntries = RecentsManager.getInstance(myProject).getRecentEntries(RECENT_KEYS);
if (recentEntries != null) {
myTargetDirectoryField.getChildComponent().setHistory(recentEntries);
}
final FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
myTargetDirectoryField.addBrowseFolderListener(RefactoringBundle.message("select.target.directory"),
RefactoringBundle.message("the.file.will.be.moved.to.this.directory"),
myProject,
descriptor,
TextComponentAccessor.TEXT_FIELD_WITH_HISTORY_WHOLE_TEXT);
final JTextField textField = myTargetDirectoryField.getChildComponent().getTextEditor();
FileChooserFactory.getInstance().installFileCompletion(textField, descriptor, true, getDisposable());
textField.getDocument().addDocumentListener(new DocumentAdapter() {
@Override
protected void textChanged(DocumentEvent e) {
validateOKButton();
}
});
myTargetDirectoryField.setTextFieldPreferredWidth(CopyFilesOrDirectoriesDialog.MAX_PATH_LENGTH);
Disposer.register(getDisposable(), myTargetDirectoryField);
String shortcutText = KeymapUtil.getFirstKeyboardShortcutText(ActionManager.getInstance().getAction(IdeActions.ACTION_CODE_COMPLETION));
myCbSearchForReferences = new NonFocusableCheckBox(RefactoringBundle.message("search.for.references"));
myCbSearchForReferences.setSelected(RefactoringSettings.getInstance().MOVE_SEARCH_FOR_REFERENCES_FOR_FILE);
myOpenInEditorCb = new NonFocusableCheckBox("Open moved files in editor");
myOpenInEditorCb.setSelected(isOpenInEditor());
return FormBuilder.createFormBuilder().addComponent(myNameLabel)
.addLabeledComponent(RefactoringBundle.message("move.files.to.directory.label"), myTargetDirectoryField, UIUtil.LARGE_VGAP)
.addTooltip(RefactoringBundle.message("path.completion.shortcut", shortcutText))
.addComponentToRightColumn(myCbSearchForReferences, UIUtil.LARGE_VGAP)
.addComponentToRightColumn(myOpenInEditorCb, UIUtil.LARGE_VGAP)
.getPanel();
}
开发者ID:consulo,项目名称:consulo,代码行数:42,代码来源:MoveFilesOrDirectoriesDialog.java
注:本文中的com.intellij.ui.TextFieldWithHistoryWithBrowseButton类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论