本文整理汇总了Java中com.intellij.ide.util.BrowseFilesListener类的典型用法代码示例。如果您正苦于以下问题:Java BrowseFilesListener类的具体用法?Java BrowseFilesListener怎么用?Java BrowseFilesListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BrowseFilesListener类属于com.intellij.ide.util包,在下文中一共展示了BrowseFilesListener类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createUIComponents
import com.intellij.ide.util.BrowseFilesListener; //导入依赖的package包/类
private void createUIComponents() {
myLanguageLevelCombo = new LanguageLevelCombo(JavaCoreBundle.message("default.language.level.description")) {
@Override
protected LanguageLevel getDefaultLevel() {
Sdk sdk = myProjectJdkConfigurable.getSelectedProjectJdk();
if (sdk == null) return null;
JavaSdkVersion version = JavaSdk.getInstance().getVersion(sdk);
return version == null ? null : version.getMaxLanguageLevel();
}
};
final JTextField textField = new JTextField();
final FileChooserDescriptor outputPathsChooserDescriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
InsertPathAction.addTo(textField, outputPathsChooserDescriptor);
outputPathsChooserDescriptor.setHideIgnored(false);
BrowseFilesListener listener = new BrowseFilesListener(textField, "", ProjectBundle.message("project.compiler.output"), outputPathsChooserDescriptor);
myProjectCompilerOutput = new FieldPanel(textField, null, null, listener, EmptyRunnable.getInstance());
FileChooserFactory.getInstance().installFileCompletion(myProjectCompilerOutput.getTextField(), outputPathsChooserDescriptor, true, null);
}
示例2: getAdditionalSettings
import com.intellij.ide.util.BrowseFilesListener; //导入依赖的package包/类
public JComponent getAdditionalSettings(final WizardContext wizardContext) {
JTextField tfModuleFilePath = new JTextField();
final String productName = ApplicationNamesInfo.getInstance().getProductName();
final String message = IdeBundle.message("prompt.select.module.file.to.import", productName);
final BrowseFilesListener listener = new BrowseFilesListener(tfModuleFilePath, message, null, new ModuleFileChooserDescriptor()) {
@Override
protected VirtualFile getFileToSelect() {
final VirtualFile fileToSelect = super.getFileToSelect();
if (fileToSelect != null) {
return fileToSelect;
}
final Project project = wizardContext.getProject();
return project != null ? project.getBaseDir() : null;
}
};
myModulePathFieldPanel = new TextFieldWithBrowseButton(tfModuleFilePath, listener);
onChosen(false);
return myModulePathFieldPanel;
}
示例3: createComponent
import com.intellij.ide.util.BrowseFilesListener; //导入依赖的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;
}
示例4: createComponent
import com.intellij.ide.util.BrowseFilesListener; //导入依赖的package包/类
public JComponent createComponent() {
myPluginXML.addActionListener(new BrowseFilesListener(myPluginXML.getTextField(), DevKitBundle.message("deployment.directory.location", META_INF), DevKitBundle.message("saved.message.common", META_INF + File.separator + PLUGIN_XML), BrowseFilesListener.SINGLE_DIRECTORY_DESCRIPTOR));
myManifest.addActionListener(new BrowseFilesListener(myManifest.getTextField(), DevKitBundle.message("deployment.view.select", MANIFEST_MF), DevKitBundle.message("manifest.selection", MANIFEST_MF), BrowseFilesListener.SINGLE_FILE_DESCRIPTOR));
myManifest.setEnabled(myBuildProperties.isUseUserManifest());
myUseUserManifest.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
final boolean selected = myUseUserManifest.isSelected();
myManifest.setEnabled(selected);
}
});
final GridBagConstraints gc = new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST,
GridBagConstraints.HORIZONTAL, new Insets(2, 2, 2, 2), 0, 0);
myWholePanel.add(myPluginXMLLabel, gc);
myWholePanel.add(myPluginXML, gc);
JPanel manifestPanel = new JPanel(new GridBagLayout());
manifestPanel.setBorder(IdeBorderFactory.createTitledBorder(DevKitBundle.message("manifest.settings"), true));
gc.insets.left = 0;
manifestPanel.add(myUseUserManifest, gc);
gc.insets.left = 2;
gc.weighty = 1.0;
manifestPanel.add(myManifest, gc);
myWholePanel.add(manifestPanel, gc);
myWholePanel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
return myWholePanel;
}
示例5: JavaFxEditCertificatesDialog
import com.intellij.ide.util.BrowseFilesListener; //导入依赖的package包/类
protected JavaFxEditCertificatesDialog(JComponent parent, JavaFxArtifactProperties properties, Project project) {
super(parent, true);
setTitle("Choose Certificate");
init();
final ActionListener actionListener = new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
UIUtil.setEnabled(myPanel.myKeysPanel, !myPanel.mySelfSignedRadioButton.isSelected(), true);
}
};
myPanel.mySelfSignedRadioButton.addActionListener(actionListener);
myPanel.mySignedByKeyRadioButton.addActionListener(actionListener);
final boolean selfSigning = properties.isSelfSigning();
UIUtil.setEnabled(myPanel.myKeysPanel, !selfSigning, true);
myPanel.mySelfSignedRadioButton.setSelected(selfSigning);
myPanel.mySignedByKeyRadioButton.setSelected(!selfSigning);
myPanel.myAliasTF.setText(properties.getAlias());
myPanel.myKeystore.setText(properties.getKeystore());
final String keypass = properties.getKeypass();
myPanel.myKeypassTF.setText(keypass != null ? Base64Converter.decode(keypass) : "");
final String storepass = properties.getStorepass();
myPanel.myStorePassTF.setText(storepass != null ? Base64Converter.decode(storepass) : "");
myPanel.myKeystore.addBrowseFolderListener("Choose Keystore File", "Select file containing generated keys", project, BrowseFilesListener.SINGLE_FILE_DESCRIPTOR);
}
示例6: GroovyRunConfigurationEditor
import com.intellij.ide.util.BrowseFilesListener; //导入依赖的package包/类
public GroovyRunConfigurationEditor() {
scriptPathField = new JTextField();
final BrowseFilesListener scriptBrowseListener = new BrowseFilesListener(scriptPathField,
"Script Path",
"Specify path to script",
new FileChooserDescriptor(true, false, false, false, false, false) {
public boolean isFileSelectable(VirtualFile file) {
return file.getFileType() == GroovyFileType.GROOVY_FILE_TYPE;
}
});
final FieldPanel scriptFieldPanel = new FieldPanel(scriptPathField, null, null, scriptBrowseListener, null);
scriptPathPanel.setLayout(new BorderLayout());
scriptPathPanel.add(scriptFieldPanel, BorderLayout.CENTER);
workDirField = new JTextField();
final BrowseFilesListener workDirBrowseFilesListener = new BrowseFilesListener(workDirField,
"Working directory",
"Specify working directory",
BrowseFilesListener.SINGLE_DIRECTORY_DESCRIPTOR);
final FieldPanel workDirFieldPanel = new FieldPanel(workDirField, null, null, workDirBrowseFilesListener, null);
workDirPanel.setLayout(new BorderLayout());
workDirPanel.add(workDirFieldPanel, BorderLayout.CENTER);
setAnchor(myEnvVariables.getLabel());
}
示例7: createOutputPathPanel
import com.intellij.ide.util.BrowseFilesListener; //导入依赖的package包/类
private CommitableFieldPanel createOutputPathPanel(final String title, final CommitPathRunnable commitPathRunnable) {
final JTextField textField = new JTextField();
final FileChooserDescriptor outputPathsChooserDescriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
outputPathsChooserDescriptor.setHideIgnored(false);
InsertPathAction.addTo(textField, outputPathsChooserDescriptor);
FileChooserFactory.getInstance().installFileCompletion(textField, outputPathsChooserDescriptor, true, null);
CommitableFieldPanel commitableFieldPanel =
new CommitableFieldPanel(textField, null, null, new BrowseFilesListener(textField, title, "", outputPathsChooserDescriptor), null);
commitableFieldPanel.myCommitRunnable = new Runnable() {
@Override
public void run() {
if (!getModel().isWritable()) {
return;
}
String url = commitableFieldPanel.getUrl();
commitPathRunnable.saveUrl(url);
}
};
return commitableFieldPanel;
}
示例8: LuaCommonOptionsForm
import com.intellij.ide.util.BrowseFilesListener; //导入依赖的package包/类
public LuaCommonOptionsForm(LuaRunConfiguration luaRunConfiguration) {
luaInterpreterEdit.addBrowseFolderListener("Select Lua Interpreter", "", luaRunConfiguration.getProject(), BrowseFilesListener.SINGLE_FILE_DESCRIPTOR);
workingDirEdit.addBrowseFolderListener("Select Working Directory", "", luaRunConfiguration.getProject(), BrowseFilesListener.SINGLE_DIRECTORY_DESCRIPTOR);
useSDKCheckbox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
updateInterpreterOptionsWidgets();
}
});
}
示例9: GroovyRunConfigurationEditor
import com.intellij.ide.util.BrowseFilesListener; //导入依赖的package包/类
public GroovyRunConfigurationEditor() {
scriptPathField = new JTextField();
final BrowseFilesListener scriptBrowseListener = new BrowseFilesListener(scriptPathField,
"Script Path",
"Specify path to script",
new FileChooserDescriptor(true, false, false, false, false, false) {
@Override
public boolean isFileSelectable(VirtualFile file) {
return file.getFileType() == GroovyFileType.GROOVY_FILE_TYPE;
}
});
final FieldPanel scriptFieldPanel = new FieldPanel(scriptPathField, null, null, scriptBrowseListener, null);
scriptPathPanel.setLayout(new BorderLayout());
scriptPathPanel.add(scriptFieldPanel, BorderLayout.CENTER);
workDirField = new JTextField();
final BrowseFilesListener workDirBrowseFilesListener = new BrowseFilesListener(workDirField,
"Working directory",
"Specify working directory",
BrowseFilesListener.SINGLE_DIRECTORY_DESCRIPTOR);
final FieldPanel workDirFieldPanel = new FieldPanel(workDirField, null, null, workDirBrowseFilesListener, null);
workDirPanel.setLayout(new BorderLayout());
workDirPanel.add(workDirFieldPanel, BorderLayout.CENTER);
setAnchor(myEnvVariables.getLabel());
}
示例10: FileSelectorWithStoredHistory
import com.intellij.ide.util.BrowseFilesListener; //导入依赖的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);
}
示例11: AlternativeJREPanel
import com.intellij.ide.util.BrowseFilesListener; //导入依赖的package包/类
public AlternativeJREPanel() {
myCbEnabled = new JBCheckBox(ExecutionBundle.message("run.configuration.use.alternate.jre.checkbox"));
myFieldWithHistory = new TextFieldWithHistory();
final ArrayList<String> foundJDKs = new ArrayList<String>();
for (JreProvider provider : JreProvider.EP_NAME.getExtensions()) {
String path = provider.getJrePath();
if (!StringUtil.isEmpty(path)) {
foundJDKs.add(path);
}
}
final Sdk[] allJDKs = ProjectJdkTable.getInstance().getAllJdks();
for (Sdk jdk : allJDKs) {
foundJDKs.add(jdk.getHomePath());
}
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();
}
示例12: createUIComponents
import com.intellij.ide.util.BrowseFilesListener; //导入依赖的package包/类
private void createUIComponents() {
myLanguageLevelCombo = new LanguageLevelCombo();
final JTextField textField = new JTextField();
final FileChooserDescriptor outputPathsChooserDescriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
InsertPathAction.addTo(textField, outputPathsChooserDescriptor);
outputPathsChooserDescriptor.setHideIgnored(false);
BrowseFilesListener listener = new BrowseFilesListener(textField, "", ProjectBundle.message("project.compiler.output"), outputPathsChooserDescriptor);
myProjectCompilerOutput = new FieldPanel(textField, null, null, listener, EmptyRunnable.getInstance());
FileChooserFactory.getInstance().installFileCompletion(myProjectCompilerOutput.getTextField(), outputPathsChooserDescriptor, true, null);
}
示例13: addSourcePath
import com.intellij.ide.util.BrowseFilesListener; //导入依赖的package包/类
private void addSourcePath(SettingsStep settingsStep) {
Project project = settingsStep.getContext().getProject();
ComponentWithBrowseButton.BrowseFolderActionListener<JTextField> listener =
new ComponentWithBrowseButton.BrowseFolderActionListener<JTextField>(
IdeBundle.message("prompt.select.source.directory"), null, mySourcePath, project, BrowseFilesListener.SINGLE_DIRECTORY_DESCRIPTOR,
TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT)
{
@Override
protected void onFileChoosen(VirtualFile chosenFile) {
String contentEntryPath = myModuleBuilder.getContentEntryPath();
String path = chosenFile.getPath();
if (contentEntryPath != null) {
int i = StringUtil.commonPrefixLength(contentEntryPath, path);
mySourcePath.setText(path.substring(i));
}
else {
mySourcePath.setText(path);
}
}
};
mySourcePath.addBrowseFolderListener(project, listener);
myCreateSourceRoot.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
mySourcePath.setEnabled(myCreateSourceRoot.isSelected());
}
});
settingsStep.addExpertPanel(myPanel);
}
示例14: AlternativeJREPanel
import com.intellij.ide.util.BrowseFilesListener; //导入依赖的package包/类
public AlternativeJREPanel() {
myCbEnabled = new JBCheckBox(ExecutionBundle.message("run.configuration.use.alternate.jre.checkbox"));
myFieldWithHistory = new TextFieldWithHistory();
final ArrayList<String> foundJDKs = new ArrayList<String>();
final Sdk[] allJDKs = SdkTable.getInstance().getAllSdks();
for (Sdk jdk : allJDKs) {
foundJDKs.add(jdk.getHomePath());
}
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();
}
示例15: createUIComponents
import com.intellij.ide.util.BrowseFilesListener; //导入依赖的package包/类
private void createUIComponents() {
textField = new JTextField();
browseFilesListener = new BrowseFilesListener(textField, "Select Directory for Default Grav Installation", "", FileChooserDescriptorFactory.createSingleFileDescriptor());
fieldPanel = ModuleWizardStep.createFieldPanel(textField, "", browseFilesListener);
}