本文整理汇总了Java中com.intellij.openapi.fileChooser.FileChooserDescriptorFactory.createMultipleJavaPathDescriptor方法的典型用法代码示例。如果您正苦于以下问题:Java FileChooserDescriptorFactory.createMultipleJavaPathDescriptor方法的具体用法?Java FileChooserDescriptorFactory.createMultipleJavaPathDescriptor怎么用?Java FileChooserDescriptorFactory.createMultipleJavaPathDescriptor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.fileChooser.FileChooserDescriptorFactory
的用法示例。
在下文中一共展示了FileChooserDescriptorFactory.createMultipleJavaPathDescriptor方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: actionPerformed
import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory; //导入方法依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createMultipleJavaPathDescriptor();
descriptor.setTitle("Exclude from Library");
descriptor.setDescription("Select directories which should be excluded from the library content. Content of excluded directories won't be processed by IDE.");
Set<VirtualFile> roots = getNotExcludedRoots();
descriptor.setRoots(roots.toArray(new VirtualFile[roots.size()]));
if (roots.size() < 2) {
descriptor.withTreeRootVisible(true);
}
VirtualFile toSelect = null;
for (Object o : getSelectedElements()) {
Object itemElement = o instanceof ExcludedRootElement ? ((ExcludedRootElement)o).getParentDescriptor() : o;
if (itemElement instanceof ItemElement) {
toSelect = VirtualFileManager.getInstance().findFileByUrl(((ItemElement)itemElement).getUrl());
break;
}
}
final VirtualFile[] files = FileChooser.chooseFiles(descriptor, myPanel, myProject, toSelect);
if (files.length > 0) {
ApplicationManager.getApplication().runWriteAction(new Runnable() {
@Override
public void run() {
for (VirtualFile file : files) {
getLibraryEditor().addExcludedRoot(file.getUrl());
}
}
});
myLastChosen = files[0];
libraryChanged(true);
}
}
示例2: createAttachFilesChooserDescriptor
import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory; //导入方法依赖的package包/类
/**
* @return descriptor for the file chooser which will be shown when 'Attach Files' button is pressed
* @param libraryName
*/
@NotNull
public FileChooserDescriptor createAttachFilesChooserDescriptor(@Nullable String libraryName) {
final FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createMultipleJavaPathDescriptor();
descriptor.setTitle(StringUtil.isEmpty(libraryName) ? ProjectBundle.message("library.attach.files.action")
: ProjectBundle.message("library.attach.files.to.library.action", libraryName));
descriptor.setDescription(ProjectBundle.message("library.attach.files.description"));
return descriptor;
}
示例3: createPathEditor
import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory; //导入方法依赖的package包/类
@Override
public SdkPathEditor createPathEditor(Sdk sdk) {
return new JavadocPathsEditor(sdk, FileChooserDescriptorFactory.createMultipleJavaPathDescriptor());
}
示例4: createChooserDescriptor
import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory; //导入方法依赖的package包/类
public FileChooserDescriptor createChooserDescriptor() {
return FileChooserDescriptorFactory.createMultipleJavaPathDescriptor();
}