本文整理汇总了Java中com.intellij.openapi.ui.ComponentWithBrowseButton类的典型用法代码示例。如果您正苦于以下问题:Java ComponentWithBrowseButton类的具体用法?Java ComponentWithBrowseButton怎么用?Java ComponentWithBrowseButton使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ComponentWithBrowseButton类属于com.intellij.openapi.ui包,在下文中一共展示了ComponentWithBrowseButton类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createUIComponents
import com.intellij.openapi.ui.ComponentWithBrowseButton; //导入依赖的package包/类
private void createUIComponents() {
final EditorTextField editorTextField = new LanguageTextField(PlainTextLanguage.INSTANCE, myProject, "") {
@Override
protected EditorEx createEditor() {
final EditorEx editor = super.createEditor();
final PsiFile file = PsiDocumentManager.getInstance(myProject).getPsiFile(editor.getDocument());
if (file != null) {
DaemonCodeAnalyzer.getInstance(myProject).setHighlightingEnabled(file, false);
}
editor.putUserData(ACTIVITY_CLASS_TEXT_FIELD_KEY, ApplicationRunParameters.this);
return editor;
}
};
myActivityField = new ComponentWithBrowseButton<EditorTextField>(editorTextField, null);
}
示例2: createUIComponents
import com.intellij.openapi.ui.ComponentWithBrowseButton; //导入依赖的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: MyEditor
import com.intellij.openapi.ui.ComponentWithBrowseButton; //导入依赖的package包/类
public MyEditor(final Project project) {
myProject = project;
myEditorTextField = new EditorTextField("", project, StdFileTypes.JAVA) {
protected boolean shouldHaveBorder() {
return false;
}
};
myActionListener = new MyActionListener();
myTfWithButton = new ComponentWithBrowseButton<EditorTextField>(myEditorTextField, myActionListener);
myEditorTextField.setBorder(null);
new MyCancelEditingAction().registerCustomShortcutSet(CommonShortcuts.ESCAPE, myTfWithButton);
/*
myEditorTextField.addActionListener(
new ActionListener() {
public void actionPerformed(final ActionEvent e) {
fireValueCommitted();
}
}
);
*/
}
示例4: createUIComponents
import com.intellij.openapi.ui.ComponentWithBrowseButton; //导入依赖的package包/类
private void createUIComponents(Project project) {
final EditorTextField editorTextField =
new LanguageTextField(PlainTextLanguage.INSTANCE, project, "") {
@Override
protected EditorEx createEditor() {
final EditorEx editor = super.createEditor();
final PsiFile file =
PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument());
if (file != null) {
DaemonCodeAnalyzer.getInstance(project).setHighlightingEnabled(file, false);
}
editor.putUserData(
ACTIVITY_CLASS_TEXT_FIELD_KEY, BlazeAndroidBinaryRunConfigurationStateEditor.this);
return editor;
}
};
activityField = new ComponentWithBrowseButton<EditorTextField>(editorTextField, null);
}
示例5: fixButton
import com.intellij.openapi.ui.ComponentWithBrowseButton; //导入依赖的package包/类
private void fixButton(final TextFieldWithStoredHistory historyField, ComponentWithBrowseButton<TextFieldWithStoredHistory> control) {
FixedSizeButton button = control.getButton();
control.remove(button);
BorderLayout borderLayout = new BorderLayout();
JPanel buttonPanel = new JPanel(borderLayout);
buttonPanel.setBorder(IdeBorderFactory.createEmptyBorder(4, 0, 4, 0));
buttonPanel.add(button, BorderLayout.CENTER);
control.add(buttonPanel, BorderLayout.EAST);
button.setAttachedComponent(new JComponent() {
public Dimension getPreferredSize() {
Dimension size = historyField.getTextEditor().getPreferredSize();
return new Dimension(-1, size.height + 6);
}
});
}
示例6: setupScriptPathField
import com.intellij.openapi.ui.ComponentWithBrowseButton; //导入依赖的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);
}
示例7: MyEditor
import com.intellij.openapi.ui.ComponentWithBrowseButton; //导入依赖的package包/类
public MyEditor(final Project project) {
myProject = project;
myEditorTextField = new EditorTextField("", project, JavaFileType.INSTANCE) {
protected boolean shouldHaveBorder() {
return false;
}
};
myActionListener = new MyActionListener();
myTfWithButton = new ComponentWithBrowseButton<EditorTextField>(myEditorTextField, myActionListener);
myEditorTextField.setBorder(null);
new MyCancelEditingAction().registerCustomShortcutSet(CommonShortcuts.ESCAPE, myTfWithButton);
/*
myEditorTextField.addActionListener(
new ActionListener() {
public void actionPerformed(final ActionEvent e) {
fireValueCommitted();
}
}
);
*/
}
示例8: createPackageNameField
import com.intellij.openapi.ui.ComponentWithBrowseButton; //导入依赖的package包/类
protected ComponentWithBrowseButton<EditorComboBox> createPackageNameField() {
String name = "";
PsiFile file = mySourceClass.getContainingFile();
if (file instanceof PsiJavaFile) {
name = ((PsiJavaFile)file).getPackageName();
}
return new PackageNameReferenceEditorCombo(name, myProject, DESTINATION_PACKAGE_RECENT_KEY,
RefactoringBundle.message("choose.destination.package"));
}
示例9: createUIComponents
import com.intellij.openapi.ui.ComponentWithBrowseButton; //导入依赖的package包/类
private void createUIComponents() {
regexp = createRegexComponent();
regexprForExprType = createRegexComponent();
formalArgType = createRegexComponent();
customScriptCode = new ComponentWithBrowseButton<EditorTextField>(createScriptComponent(), null);
myRegExHelpLabel = RegExHelpPopup.createRegExLink(SSRBundle.message("regular.expression.help.label"), regexp, LOG);
myRegExHelpLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 5));
}
示例10: PythonRunConfigurationForm
import com.intellij.openapi.ui.ComponentWithBrowseButton; //导入依赖的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());
}
示例11: AppEngineSdkEditor
import com.intellij.openapi.ui.ComponentWithBrowseButton; //导入依赖的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()));
}
}
示例12: propagateToolTip
import com.intellij.openapi.ui.ComponentWithBrowseButton; //导入依赖的package包/类
private void propagateToolTip(JComponent source, JComponent ... targets) {
String toolTip = source.getToolTipText();
for(JComponent target: targets) {
if(target instanceof ComponentWithBrowseButton) {
((ComponentWithBrowseButton) target).getChildComponent().setToolTipText(toolTip);
} else {
target.setToolTipText(toolTip);
}
}
}
示例13: LocalAndServerPathsForm
import com.intellij.openapi.ui.ComponentWithBrowseButton; //导入依赖的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());
}
示例14: initComponents
import com.intellij.openapi.ui.ComponentWithBrowseButton; //导入依赖的package包/类
private void initComponents() {
FileChooserDescriptor fcd = FileChooserDescriptorFactory.createSingleFolderDescriptor();
fcd.setShowFileSystemRoots(true);
fcd.setTitle(GctBundle.message("clonefromgcp.destination.directory.title"));
fcd.setDescription(GctBundle.message("clonefromgcp.destination.directory.description"));
fcd.setHideIgnored(false);
parentDirectory.addActionListener(
new ComponentWithBrowseButton.BrowseFolderActionListener<JTextField>(
fcd.getTitle(),
fcd.getDescription(),
parentDirectory,
project,
fcd,
TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT) {
@Override
protected VirtualFile getInitialFile() {
String text = getComponentText();
if (text.length() == 0) {
VirtualFile file = project.getBaseDir();
if (file != null) {
return file;
}
}
return super.getInitialFile();
}
});
final DocumentListener updateOkButtonListener =
new DocumentAdapter() {
@Override
protected void textChanged(DocumentEvent event) {
updateButtons();
}
};
parentDirectory.getChildComponent().getDocument().addDocumentListener(updateOkButtonListener);
parentDirectory.setText(ProjectUtil.getBaseDir());
directoryName.getDocument().addDocumentListener(updateOkButtonListener);
setOKActionEnabled(false);
}
示例15: ImageFileBrowserFolderActionListener
import com.intellij.openapi.ui.ComponentWithBrowseButton; //导入依赖的package包/类
public ImageFileBrowserFolderActionListener(String title,
Project project,
ComponentWithBrowseButton<JTextField> componentWithBrowseButton,
FileChooserDescriptor fileChooserDescriptor) {
super(title, null, componentWithBrowseButton, project, fileChooserDescriptor, TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT);
this.title = title;
this.project = project;
}