本文整理汇总了Java中com.intellij.openapi.ui.TextComponentAccessor类的典型用法代码示例。如果您正苦于以下问题:Java TextComponentAccessor类的具体用法?Java TextComponentAccessor怎么用?Java TextComponentAccessor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TextComponentAccessor类属于com.intellij.openapi.ui包,在下文中一共展示了TextComponentAccessor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: BuildoutConfigPanel
import com.intellij.openapi.ui.TextComponentAccessor; //导入依赖的package包/类
public BuildoutConfigPanel(Module module, BuildoutFacetConfiguration config) {
myModule = module;
myConfiguration = config;
setLayout(new BorderLayout());
add(myPanel);
FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFileNoJarsDescriptor();
//descriptor.setRoot(myConfiguration.getRoot());
myScript.addBrowseFolderListener(
"Choose a buildout script", "Select the target script that will invoke your code",
null, descriptor, TextComponentAccessor.STRING_COMBOBOX_WHOLE_TEXT, false
);
myScript.getComboBox().setEditable(true);
initErrorValidation();
}
示例2: createComponent
import com.intellij.openapi.ui.TextComponentAccessor; //导入依赖的package包/类
public JComponent createComponent() {
// all listeners will be removed when dialog is closed
mavenHomeComponent.getComponent().addBrowseFolderListener(ProjectBundle.message("maven.select.maven.home.directory"),
"",
null, BrowseFilesListener.SINGLE_DIRECTORY_DESCRIPTOR,
TextComponentAccessor.TEXT_FIELD_WITH_HISTORY_WHOLE_TEXT);
mavenHomeField.addDocumentListener(new DocumentAdapter() {
protected void textChanged(DocumentEvent e) {
updateMavenVersionLabel();
}
});
settingsFileComponent.getComponent().addBrowseFolderListener(ProjectBundle.message("maven.select.maven.settings.file"), "", null,
FileChooserDescriptorFactory.createSingleFileNoJarsDescriptor());
localRepositoryComponent.getComponent().addBrowseFolderListener(ProjectBundle.message("maven.select.local.repository"), "", null,
FileChooserDescriptorFactory.createSingleFolderDescriptor());
return panel;
}
示例3: createPanel
import com.intellij.openapi.ui.TextComponentAccessor; //导入依赖的package包/类
public JComponent createPanel(@NotNull TerminalOptionsProvider provider) {
myOptionsProvider = provider;
FileChooserDescriptor fileChooserDescriptor = new FileChooserDescriptor(true, false, false, false, false, false);
myShellPathField.addBrowseFolderListener(
"",
"Shell Executable Path",
null,
fileChooserDescriptor,
TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT,
false
);
return myWholePanel;
}
示例4: setupScriptPathField
import com.intellij.openapi.ui.TextComponentAccessor; //导入依赖的package包/类
private void setupScriptPathField(@NotNull final Project project) {
final ComponentWithBrowseButton.BrowseFolderActionListener<JTextField> listener =
new ComponentWithBrowseButton.BrowseFolderActionListener<JTextField>(
"Select Script",
"",
myScriptPathField,
project,
FileChooserDescriptorFactory.createSingleFileDescriptor(TheRFileType.INSTANCE),
TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT
) {
@Override
protected void onFileChosen(@NotNull final VirtualFile chosenFile) {
super.onFileChosen(chosenFile);
TheRRunConfigurationUtils.setSuggestedWorkingDirectoryPathIfNotSpecified(TheRRunConfigurationForm.this);
}
};
myScriptPathField.addActionListener(listener);
}
示例5: ToolPath
import com.intellij.openapi.ui.TextComponentAccessor; //导入依赖的package包/类
public ToolPath(JCheckBox checkBox, TextFieldWithBrowseButton textField, @Nullable JTextField parameters,
StringProperty pathProperty, BooleanProperty enabledProperty, @Nullable StringProperty parametersProperty) {
myCheckBox = checkBox;
myTextField = textField;
myPathProperty = pathProperty;
myEnabledProperty = enabledProperty;
myParameters = parameters;
myParametersProperty = parametersProperty;
final ButtonModel model = myCheckBox.getModel();
model.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
updateEnabledEffect();
}
});
myTextField.addBrowseFolderListener(DiffBundle.message("select.external.diff.program.dialog.title"), null, null,
FileChooserDescriptorFactory.createSingleFileNoJarsDescriptor(),
TextComponentAccessor.TEXT_FIELD_SELECTED_TEXT);
}
示例6: getTextComponentAccessor
import com.intellij.openapi.ui.TextComponentAccessor; //导入依赖的package包/类
private static TextComponentAccessor<EditorTextField> getTextComponentAccessor() {
return new TextComponentAccessor<EditorTextField>() {
@Override
public String getText(EditorTextField component) {
String text = component.getText();
final VirtualFile file = VirtualFileManager.getInstance()
.findFileByUrl(VfsUtil.pathToUrl(text.replace(File.separatorChar, '/')));
if (file != null && !file.isDirectory()) {
final VirtualFile parent = file.getParent();
assert parent != null;
return parent.getPresentableUrl();
}
return text;
}
@Override
public void setText(EditorTextField component, String text) {
component.setText(text);
}
};
}
示例7: ToolPath
import com.intellij.openapi.ui.TextComponentAccessor; //导入依赖的package包/类
public ToolPath(JCheckBox checkBox, TextFieldWithBrowseButton textField, @Nullable JTextField parameters,
StringProperty pathProperty, BooleanProperty enabledProperty, @Nullable StringProperty parametersProperty) {
myCheckBox = checkBox;
myTextField = textField;
myPathProperty = pathProperty;
myEnabledProperty = enabledProperty;
myParameters = parameters;
myParametersProperty = parametersProperty;
final ButtonModel model = myCheckBox.getModel();
model.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
updateEnabledEffect();
}
});
myTextField.addBrowseFolderListener(DiffBundle.message("select.external.diff.program.dialog.title"), null, null,
FileChooserDescriptorFactory.createSingleFileNoJarsDescriptor(),
TextComponentAccessor.TEXT_FIELD_SELECTED_TEXT);
}
示例8: MySourceCodeChooserActionListener
import com.intellij.openapi.ui.TextComponentAccessor; //导入依赖的package包/类
MySourceCodeChooserActionListener(final FileChooserDescriptor fileChooserDescriptor) {
super(
HybrisI18NBundleUtils.message("hybris.import.label.select.hybris.src.file"),
"",
HybrisWorkspaceRootStep.this.sourceCodeFilesInChooser,
(Project) null,
fileChooserDescriptor,
TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT
);
}
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:11,代码来源:HybrisWorkspaceRootStep.java
示例9: addBrowseFolderListener
import com.intellij.openapi.ui.TextComponentAccessor; //导入依赖的package包/类
@Override
public void addBrowseFolderListener(@Nullable String title,
@Nullable String description,
@Nullable Project project,
FileChooserDescriptor fileChooserDescriptor,
TextComponentAccessor<TextFieldWithHistory> accessor) {
super.addBrowseFolderListener(title, description, project, fileChooserDescriptor, accessor);
FileChooserFactory.getInstance().installFileCompletion(getChildComponent().getTextEditor(), fileChooserDescriptor, false, project);
}
示例10: createCenterPanel
import com.intellij.openapi.ui.TextComponentAccessor; //导入依赖的package包/类
@Override
protected JComponent createCenterPanel() {
myFilePattern.addBrowseFolderListener(UIBundle.message("file.chooser.default.title"), null, null, FileChooserDescriptorFactory.createSingleFileOrFolderDescriptor(), TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT);
myFilePattern.getTextField().getDocument().addDocumentListener(new DocumentAdapter() {
@Override
protected void textChanged(DocumentEvent e) {
setOKActionEnabled(myFilePattern.getText() != null && myFilePattern.getText().length() > 0);
}
});
return myWholePanel;
}
示例11: PythonRunConfigurationForm
import com.intellij.openapi.ui.TextComponentAccessor; //导入依赖的package包/类
public PythonRunConfigurationForm(PythonRunConfiguration configuration) {
myCommonOptionsForm = PyCommonOptionsFormFactory.getInstance().createForm(configuration.getCommonOptionsFormData());
myCommonOptionsPlaceholder.add(myCommonOptionsForm.getMainPanel(), BorderLayout.CENTER);
myProject = configuration.getProject();
FileChooserDescriptor chooserDescriptor = new FileChooserDescriptor(true, false, false, false, false, false) {
@Override
public boolean isFileVisible(VirtualFile file, boolean showHiddenFiles) {
return file.isDirectory() || file.getExtension() == null || Comparing.equal(file.getExtension(), "py");
}
};
//chooserDescriptor.setRoot(s.getProject().getBaseDir());
ComponentWithBrowseButton.BrowseFolderActionListener<JTextField> listener =
new ComponentWithBrowseButton.BrowseFolderActionListener<JTextField>("Select Script", "", myScriptTextField, myProject,
chooserDescriptor, TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT) {
@Override
protected void onFileChosen(@NotNull VirtualFile chosenFile) {
super.onFileChosen(chosenFile);
myCommonOptionsForm.setWorkingDirectory(chosenFile.getParent().getPath());
}
};
myScriptTextField.addActionListener(listener);
setAnchor(myCommonOptionsForm.getAnchor());
}
示例12: AppEngineSdkEditor
import com.intellij.openapi.ui.TextComponentAccessor; //导入依赖的package包/类
public AppEngineSdkEditor(final @Nullable Project project) {
myPathEditor = new ComboboxWithBrowseButton(new ComboBox(100));
myPathEditor.addBrowseFolderListener(project, new ComponentWithBrowseButton.BrowseFolderActionListener<JComboBox>("Google App Engine SDK",
"Specify Google App Engine Java SDK home",
myPathEditor, project,
FileChooserDescriptorFactory.createSingleFolderDescriptor(),
TextComponentAccessor.STRING_COMBOBOX_WHOLE_TEXT));
final JComboBox comboBox = myPathEditor.getComboBox();
comboBox.setEditable(true);
comboBox.removeAllItems();
for (AppEngineSdk sdk : AppEngineSdkManager.getInstance().getValidSdks()) {
comboBox.addItem(FileUtil.toSystemDependentName(sdk.getSdkHomePath()));
}
}
示例13: FileSelectorWithStoredHistory
import com.intellij.openapi.ui.TextComponentAccessor; //导入依赖的package包/类
private FileSelectorWithStoredHistory(TextFieldWithStoredHistory textField, String title) {
super(textField, null);
addBrowseFolderListener(
title,
"",
null,
BrowseFilesListener.SINGLE_FILE_DESCRIPTOR,
TextComponentAccessor.TEXT_FIELD_WITH_STORED_HISTORY_WHOLE_TEXT);
}
示例14: LocalAndServerPathsForm
import com.intellij.openapi.ui.TextComponentAccessor; //导入依赖的package包/类
public LocalAndServerPathsForm() {
Disposer.register(this, myServerPathForm);
myServerPathForm.addListener(new TfsTreeForm.SelectionListener() {
@Override
public void selectionChanged() {
myEventDispatcher.getMulticaster().stateChanged(new ChangeEvent(this));
}
});
myLocalPathLabel.setLabelFor(myLocalPathField.getChildComponent());
myLocalPathField.getChildComponent().getDocument().addDocumentListener(new DocumentAdapter() {
protected void textChanged(final DocumentEvent e) {
myEventDispatcher.getMulticaster().stateChanged(new ChangeEvent(this));
}
});
FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
ComponentWithBrowseButton.BrowseFolderActionListener<JTextField> listener =
new ComponentWithBrowseButton.BrowseFolderActionListener<JTextField>(TFSBundle.message("choose.local.path.title"),
TFSBundle.message("choose.local.path.description"),
myLocalPathField, null, descriptor,
TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT);
myServerPathLabel.setLabelFor(myServerPathForm.getPreferredFocusedComponent());
myLocalPathField.addActionListener(listener);
myMessageLabel.setIcon(UIUtil.getBalloonWarningIcon());
}
示例15: createComponent
import com.intellij.openapi.ui.TextComponentAccessor; //导入依赖的package包/类
@Nullable
@Override
public JComponent createComponent() {
FileChooserDescriptor fcd = FileChooserDescriptorFactory.createSingleFileOrExecutableAppDescriptor();
fcd.setShowFileSystemRoots(true);
fcd.setTitle(DLangBundle.message("dub.config.selectexecutable.title"));
fcd.setDescription(DLangBundle.message("dub.config.selectexecutable.description"));
fcd.setHideIgnored(false);
pathDubExecutable.addBrowseFolderListener(null,
new TextFieldWithBrowseButton.BrowseFolderActionListener<JTextField>(fcd.getTitle(), fcd.getDescription(),
pathDubExecutable, null, fcd, TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT) );
return panel;
}