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


Java FileChooserDescriptor.setHideIgnored方法代碼示例

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


在下文中一共展示了FileChooserDescriptor.setHideIgnored方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: createUIComponents

import com.intellij.openapi.fileChooser.FileChooserDescriptor; //導入方法依賴的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);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:19,代碼來源:ProjectConfigurable.java

示例3: createFileChooserDescriptor

import com.intellij.openapi.fileChooser.FileChooserDescriptor; //導入方法依賴的package包/類
@NotNull
protected FileChooserDescriptor createFileChooserDescriptor() {
  FileChooserDescriptor descriptor = new FileChooserDescriptor(true, true, true, true, false, false) {
    FileChooserDescriptor myDelegate = new OpenProjectFileChooserDescriptor(true);

    @Override
    public Icon getIcon(VirtualFile file) {
      Icon icon = myDelegate.getIcon(file);
      return icon == null ? super.getIcon(file) : icon;
    }
  };
  descriptor.setHideIgnored(false);
  descriptor.setTitle(WIZARD_TITLE);
  descriptor.setDescription(WIZARD_DESCRIPTION);
  return descriptor;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:17,代碼來源:AndroidImportProjectAction.java

示例4: 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

示例5: HgInitDialog

import com.intellij.openapi.fileChooser.FileChooserDescriptor; //導入方法依賴的package包/類
public HgInitDialog(@Nullable Project project) {
  super(project);
  myProject = project;
  // a file chooser instead of dialog will be shown immediately if there is no current project or if current project is already an hg root
  myShowDialog = (myProject != null && (! myProject.isDefault()) && !HgUtil.isHgRoot(myProject.getBaseDir()));

  myFileDescriptor = new FileChooserDescriptor(false, true, false, false, false, false) {
    public void validateSelectedFiles(VirtualFile[] files) throws Exception {
      if (HgUtil.isHgRoot(files[0])) {
        throw new ConfigurationException(HgVcsMessages.message("hg4idea.init.this.is.hg.root", files[0].getPresentableUrl()));
      }
      updateEverything();
    }
  };
  myFileDescriptor.setHideIgnored(false);
  
  init();
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:19,代碼來源:HgInitDialog.java

示例6: 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

示例7: 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

示例8: 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

示例9: selectFileAndCreateWizard

import com.intellij.openapi.fileChooser.FileChooserDescriptor; //導入方法依賴的package包/類
@Nullable
public static AddModuleWizard selectFileAndCreateWizard(@Nullable Project project, @Nullable Component dialogParent) {
  FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleLocalFileDescriptor();
  descriptor.setHideIgnored(false);
  descriptor.setTitle("Select File or Directory to Import");
  List<ProjectImportProvider> providers = getProviders(project);
  String description = getFileChooserDescription(providers);
  descriptor.setDescription(description);
  return selectFileAndCreateWizard(project, dialogParent, descriptor, toObjectArray(providers, ProjectImportProvider.class));
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:11,代碼來源:ImportModuleAction.java

示例10: chooseSettingsFile

import com.intellij.openapi.fileChooser.FileChooserDescriptor; //導入方法依賴的package包/類
@NotNull
public static AsyncResult<String> chooseSettingsFile(String oldPath, Component parent, final String title, final String description) {
  FileChooserDescriptor chooserDescriptor = FileChooserDescriptorFactory.createSingleLocalFileDescriptor();
  chooserDescriptor.setDescription(description);
  chooserDescriptor.setHideIgnored(false);
  chooserDescriptor.setTitle(title);

  VirtualFile initialDir;
  if (oldPath != null) {
    final File oldFile = new File(oldPath);
    initialDir = LocalFileSystem.getInstance().findFileByIoFile(oldFile);
    if (initialDir == null && oldFile.getParentFile() != null) {
      initialDir = LocalFileSystem.getInstance().findFileByIoFile(oldFile.getParentFile());
    }
  }
  else {
    initialDir = null;
  }
  final AsyncResult<String> result = new AsyncResult<String>();
  FileChooser.chooseFiles(chooserDescriptor, null, parent, initialDir, new FileChooser.FileChooserConsumer() {
    @Override
    public void consume(List<VirtualFile> files) {
      VirtualFile file = files.get(0);
      if (file.isDirectory()) {
        result.setDone(file.getPath() + '/' + new File(DEFAULT_PATH).getName());
      }
      else {
        result.setDone(file.getPath());
      }
    }

    @Override
    public void cancelled() {
      result.setRejected();
    }
  });
  return result;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:39,代碼來源:ChooseComponentsToExportDialog.java

示例11: 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

示例12: 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

示例13: 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

示例14: NamePathComponent

import com.intellij.openapi.fileChooser.FileChooserDescriptor; //導入方法依賴的package包/類
public NamePathComponent(String nameLabelText,
                         String pathLabelText,
                         final String pathChooserTitle,
                         final String pathChooserDescription,
                         boolean hideIgnored,
                         boolean bold) {
  super(new GridBagLayout());

  myTfName = new JTextField();
  myTfName.setDocument(new NameFieldDocument());
  myTfName.setPreferredSize(new Dimension(200, myTfName.getPreferredSize().height));

  myTfPath = new JTextField();
  myTfPath.setDocument(new PathFieldDocument());
  myTfPath.setPreferredSize(new Dimension(200, myTfPath.getPreferredSize().height));

  myNameLabel = new JLabel(nameLabelText);
  if (bold) myNameLabel.setFont(UIUtil.getLabelFont().deriveFont(Font.BOLD));
  myNameLabel.setLabelFor(myTfName);
  Insets insets = new Insets(0, 0, 5, 4);
  this.add(myNameLabel, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE,
                                               insets, 0, 0));

  insets = new Insets(0, 0, 5, 0);
  this.add(myTfName, new GridBagConstraints(1, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL,
                                            insets, 0, 0));
  // todo: review texts
  final FileChooserDescriptor chooserDescriptor = (FileChooserDescriptor)BrowseFilesListener.SINGLE_DIRECTORY_DESCRIPTOR.clone();
  chooserDescriptor.setHideIgnored(hideIgnored);
  final BrowseFilesListener browseButtonActionListener = new BrowseFilesListener(myTfPath, pathChooserTitle, pathChooserDescription, chooserDescriptor) {
    public void actionPerformed(ActionEvent e) {
      super.actionPerformed(e);
      myIsPathChangedByUser = true;
    }
  };
  myPathPanel = new FieldPanel(myTfPath, null, null, browseButtonActionListener, null);
  myPathLabel = new JLabel(pathLabelText);
  myPathLabel.setLabelFor(myTfPath);
  if (bold) myPathLabel.setFont(UIUtil.getLabelFont().deriveFont(Font.BOLD));
  insets = new Insets(0, 0, 5, 4);
  this.add(myPathLabel, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE,
                                                 insets, 0, 0));
  insets = new Insets(0, 0, 5, 0);
  this.add(myPathPanel, new GridBagConstraints(1, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL,
                                               insets, 0, 0));
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:47,代碼來源:NamePathComponent.java


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