當前位置: 首頁>>代碼示例>>Java>>正文


Java FileChooserDescriptor.setShowFileSystemRoots方法代碼示例

本文整理匯總了Java中com.intellij.openapi.fileChooser.FileChooserDescriptor.setShowFileSystemRoots方法的典型用法代碼示例。如果您正苦於以下問題:Java FileChooserDescriptor.setShowFileSystemRoots方法的具體用法?Java FileChooserDescriptor.setShowFileSystemRoots怎麽用?Java FileChooserDescriptor.setShowFileSystemRoots使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.intellij.openapi.fileChooser.FileChooserDescriptor的用法示例。


在下文中一共展示了FileChooserDescriptor.setShowFileSystemRoots方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createDirectory

import com.intellij.openapi.fileChooser.FileChooserDescriptor; //導入方法依賴的package包/類
public static PsiDirectory createDirectory(Project project, String title, String description) {
    final FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
    descriptor.setTitle(title);
    descriptor.setShowFileSystemRoots(false);
    descriptor.setDescription(description);
    descriptor.setHideIgnored(true);
    descriptor.setRoots(project.getBaseDir());
    descriptor.setForcedToUseIdeaFileChooser(true);
    VirtualFile file = FileChooser.chooseFile(descriptor, project, project.getBaseDir());
    if(Objects.isNull(file)){
        Messages.showInfoMessage("Cancel " + title, "Error");
        return null;
    }

    PsiDirectory psiDirectory = PsiDirectoryFactory.getInstance(project).createDirectory(file);
    if(PsiDirectoryFactory.getInstance(project).isPackage(psiDirectory)){
        return psiDirectory;
    }else {
        Messages.showInfoMessage("請選擇正確的 package 路徑。", "Error");
        return createDirectory(project, title, description);
    }
}
 
開發者ID:hykes,項目名稱:CodeGen,代碼行數:23,代碼來源:PsiUtil.java

示例2: TemplateLanguagePanel

import com.intellij.openapi.fileChooser.FileChooserDescriptor; //導入方法依賴的package包/類
public TemplateLanguagePanel() {
  super(new BorderLayout());
  add(myMainPanel, BorderLayout.CENTER);
  myTemplatesFolderLabel.setLabelFor(myTemplatesFolder);
  FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
  descriptor.withTreeRootVisible(true);
  descriptor.setShowFileSystemRoots(true);
  List<String> templateConfigurations = TemplatesService.getAllTemplateLanguages();
  for (String configuration : templateConfigurations) {
    if (!configuration.equals(TemplatesService.WEB2PY)) {
      myTemplateLanguage.addItem(configuration);
    }
  }
  myTemplatesFolder.setText(DEFAULT_TEMPLATES_FOLDER);
  myTemplatesFolder.addKeyListener(new KeyAdapter() {
    @Override
    public void keyTyped(KeyEvent e) {
      final int dot = myTemplatesFolder.getCaret().getDot();
      final int index = myTemplatesFolder.getText().indexOf(File.separator);
      if (index >= dot) {
        myTemplateFolderModified = true;
      }
    }
  });
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:26,代碼來源:TemplateLanguagePanel.java

示例3: actionPerformed

import com.intellij.openapi.fileChooser.FileChooserDescriptor; //導入方法依賴的package包/類
@Override
public void actionPerformed(final AnActionEvent e) {
  Project project = e.getData(CommonDataKeys.PROJECT);
  if (project == null) {
    project = ProjectManager.getInstance().getDefaultProject();
  }
  FileChooserDescriptor fcd = FileChooserDescriptorFactory.createSingleFolderDescriptor();
  fcd.setShowFileSystemRoots(true);
  fcd.setTitle(GitBundle.getString("init.destination.directory.title"));
  fcd.setDescription(GitBundle.getString("init.destination.directory.description"));
  fcd.setHideIgnored(false);
  VirtualFile baseDir = e.getData(CommonDataKeys.VIRTUAL_FILE);
  if (baseDir == null) {
    baseDir = project.getBaseDir();
  }
  doInit(project, fcd, baseDir, baseDir);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:18,代碼來源:GitInit.java

示例4: selectFile

import com.intellij.openapi.fileChooser.FileChooserDescriptor; //導入方法依賴的package包/類
@Nullable
private File selectFile(String title, String description) {
  FileChooserDescriptor fcd = FileChooserDescriptorFactory.createSingleFolderDescriptor();
  fcd.setShowFileSystemRoots(true);
  fcd.setTitle(title);
  fcd.setDescription(description);
  fcd.setHideIgnored(false);
  VirtualFile file = FileChooser.chooseFile(fcd, myProject, null);
  if (file == null) {
    return null;
  }
  final String path = file.getPath();
  if (path.endsWith(":")) {   // workaround for VFS oddities with drive root (IDEADEV-20870)
    return new File(path + "/");
  }
  return new File(path);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:18,代碼來源:RepositoryBrowserDialog.java

示例5: chooseFolder

import com.intellij.openapi.fileChooser.FileChooserDescriptor; //導入方法依賴的package包/類
public static VirtualFile chooseFolder(@Nullable Project project, String title, String description, boolean showFileSystemRoots, boolean hideIgnored, @Nullable VirtualFile toSelect){
    final FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
    descriptor.setTitle(title);
    descriptor.setDescription(description);
    descriptor.setShowFileSystemRoots(showFileSystemRoots);
    descriptor.setHideIgnored(hideIgnored);
    return FileChooser.chooseFile(descriptor, project, toSelect);
}
 
開發者ID:hykes,項目名稱:CodeGen,代碼行數:9,代碼來源:PsiUtil.java

示例6: chooseFile

import com.intellij.openapi.fileChooser.FileChooserDescriptor; //導入方法依賴的package包/類
public static VirtualFile chooseFile(@Nullable Project project, String title, String description, boolean showFileSystemRoots, boolean hideIgnored, @Nullable VirtualFile toSelect){
    final FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFileDescriptor();
    descriptor.setTitle(title);
    descriptor.setDescription(description);
    descriptor.setShowFileSystemRoots(showFileSystemRoots);
    descriptor.setHideIgnored(hideIgnored);
    return FileChooser.chooseFile(descriptor, project, toSelect);
}
 
開發者ID:hykes,項目名稱:CodeGen,代碼行數:9,代碼來源:PsiUtil.java

示例7: selectFile

import com.intellij.openapi.fileChooser.FileChooserDescriptor; //導入方法依賴的package包/類
@Nullable
private File selectFile(String title, String description) {
  FileChooserDescriptor fcd = FileChooserDescriptorFactory.createSingleFileOrFolderDescriptor();
  fcd.setShowFileSystemRoots(true);
  fcd.setTitle(title);
  fcd.setDescription(description);
  fcd.setHideIgnored(false);
  VirtualFile file = FileChooser.chooseFile(fcd, myBrowser, myProject, null);
  if (file == null) {
    return null;
  }
  return new File(file.getPath());
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:14,代碼來源:DiffOptionsDialog.java

示例8: actionPerformed

import com.intellij.openapi.fileChooser.FileChooserDescriptor; //導入方法依賴的package包/類
public void actionPerformed(ActionEvent e) {
  // choose directory here/
  FileChooserDescriptor fcd = FileChooserDescriptorFactory.createSingleFolderDescriptor();
  fcd.setShowFileSystemRoots(true);
  fcd.setTitle("Checkout Directory");
  fcd.setDescription("Select directory to checkout from subversion");
  fcd.setHideIgnored(false);
  VirtualFile file = FileChooser.chooseFile(fcd, getContentPane(), myProject, null);
  if (file == null) {
    return;
  }
  myPathField.setText(file.getPath().replace('/', File.separatorChar));
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:14,代碼來源:ImportOptionsDialog.java

示例9: actionPerformed

import com.intellij.openapi.fileChooser.FileChooserDescriptor; //導入方法依賴的package包/類
public void actionPerformed(ActionEvent e) {
  // choose directory here/
  FileChooserDescriptor fcd = FileChooserDescriptorFactory.createSingleFolderDescriptor();
  fcd.setShowFileSystemRoots(true);
  fcd.setTitle("Export Directory");
  fcd.setDescription("Select directory to export from subversion");
  fcd.setHideIgnored(false);
  VirtualFile file = FileChooser.chooseFile(fcd, getContentPane(), myProject, null);
  if (file == null) {
    return;
  }
  myPathField.setText(file.getPath().replace('/', File.separatorChar));
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:14,代碼來源:ExportOptionsDialog.java


注:本文中的com.intellij.openapi.fileChooser.FileChooserDescriptor.setShowFileSystemRoots方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。