當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。