当前位置: 首页>>代码示例>>Java>>正文


Java FileChooserDescriptorFactory.createMultipleJavaPathDescriptor方法代码示例

本文整理汇总了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);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:33,代码来源:LibraryRootsComponent.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:LibraryRootsComponentDescriptor.java

示例3: createPathEditor

import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory; //导入方法依赖的package包/类
@Override
public SdkPathEditor createPathEditor(Sdk sdk) {
  return new JavadocPathsEditor(sdk, FileChooserDescriptorFactory.createMultipleJavaPathDescriptor());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:JavadocOrderRootTypeUIFactory.java

示例4: createChooserDescriptor

import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory; //导入方法依赖的package包/类
public FileChooserDescriptor createChooserDescriptor() {
  return FileChooserDescriptorFactory.createMultipleJavaPathDescriptor();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:ChooserBasedAttachRootButtonDescriptor.java


注:本文中的com.intellij.openapi.fileChooser.FileChooserDescriptorFactory.createMultipleJavaPathDescriptor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。