Package com.intellij.ide.util

Examples of com.intellij.ide.util.TreeFileChooser


  }

  private void addActionListeners() {
    myMainClassFieldWithButton.getButton().addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        TreeFileChooser fileChooser = TreeFileChooserFactory.getInstance(myModule.getProject()).createFileChooser(
          HaxeBundle.message("choose.haxe.main.class"),
          null,
          HaxeFileType.HAXE_FILE_TYPE,
          new TreeFileChooser.PsiFileFilter() {
            public boolean accept(PsiFile file) {
              return true;
            }
          });

        fileChooser.showDialog();

        PsiFile selectedFile = fileChooser.getSelectedFile();
        if (selectedFile != null) {
          setChosenFile(selectedFile.getVirtualFile());
        }
      }
    });
View Full Code Here


      public void actionPerformed(ActionEvent e) {
        final String initialPath = FileUtil.toSystemIndependentName(textWithBrowse.getText().trim());
        final VirtualFile initialFile = initialPath.isEmpty() ? null : LocalFileSystem.getInstance().findFileByPath(initialPath);
        final PsiFile initialPsiFile = initialFile == null ? null : PsiManager.getInstance(project).findFile(initialFile);

        TreeFileChooser fileChooser = TreeFileChooserFactory.getInstance(project).createFileChooser(
          DartBundle.message("choose.dart.main.file"),
          initialPsiFile,
          DartFileType.INSTANCE,
          new TreeFileChooser.PsiFileFilter() {
            public boolean accept(PsiFile file) {
              return !DartWritingAccessProvider.isInDartSdkOrDartPackagesFolder(file);
            }
          }
        );

        fileChooser.showDialog();

        final PsiFile selectedFile = fileChooser.getSelectedFile();
        final VirtualFile virtualFile = selectedFile == null ? null : selectedFile.getVirtualFile();
        if (virtualFile != null) {
          final String path = FileUtil.toSystemDependentName(virtualFile.getPath());
          textWithBrowse.setText(path);
        }
View Full Code Here

    public GoApplicationConfigurationEditor(final Project project) {
        applicationName.getButton().addActionListener(
                new ActionListener() {
                    public void actionPerformed(ActionEvent e) {

                        TreeFileChooser fileChooser =
                                TreeFileChooserFactory.getInstance(project).createFileChooser(
                                        "Go Application Chooser", null,
                                        GoFileType.INSTANCE,
                                        new TreeFileChooser.PsiFileFilter() {
                                            public boolean accept(PsiFile file) {
                                                if (file instanceof GoFile) {
                                                    return ((GoFile) file).getMainFunction() != null;
                                                }

                                                return false;
                                            }
                                        }, true, false);

                        fileChooser.showDialog();

                        PsiFile selectedFile = fileChooser.getSelectedFile();
                        if (selectedFile != null) {
                            applicationName.setText(selectedFile.getVirtualFile().getPath());
                        }
                    }
                });
View Full Code Here

            }
        });
        testFile.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                TreeFileChooser fileChooser =
                        TreeFileChooserFactory.getInstance(project).createFileChooser(
                                "Go Application Chooser", null,
                                GoFileType.INSTANCE,
                                new TreeFileChooser.PsiFileFilter() {
                                    public boolean accept(PsiFile file) {

                                        if (!(file instanceof GoFile)) {
                                            return false;
                                        }

                                        return file.getName().contains("_test.go");
                                    }
                                }, true, false);

                fileChooser.showDialog();

                PsiFile selectedFile = fileChooser.getSelectedFile();
                if (selectedFile != null) {
                    testFile.setText(selectedFile.getVirtualFile().getPath());
                }
            }
        });
View Full Code Here

TOP

Related Classes of com.intellij.ide.util.TreeFileChooser

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.