Examples of TreeFileChooser


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

Examples of com.intellij.ide.util.TreeFileChooser

      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

Examples of com.intellij.ide.util.TreeFileChooser

    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

Examples of com.intellij.ide.util.TreeFileChooser

            }
        });
        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

Examples of com.tulskiy.musique.gui.dialogs.TreeFileChooser

     
      final JButton btnBrowse = new JButton("Browse...");
      btnBrowse.setToolTipText("Choose custom folder via File Chooser dialog.");
      btnBrowse.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
              TreeFileChooser fc = new TreeFileChooser(btnBrowse, "Open folder", false);
              File[] files = fc.showOpenDialog();
              if (files != null) {
                try {
            txtCustomFolder.setText(files[0].getCanonicalPath());
          } catch (Exception e) {
            // TODO Auto-generated catch block
View Full Code Here

Examples of com.tulskiy.musique.gui.dialogs.TreeFileChooser

        });
    }

    private void addItems(int selectionMode) {
        boolean allowFiles = selectionMode != JFileChooser.DIRECTORIES_ONLY;
        TreeFileChooser fc = new TreeFileChooser(this,
                allowFiles ? "Open file" : "Open folder",
                allowFiles);
        File[] files = fc.showOpenDialog();

        if (files != null) {
            final PlaylistTable table = tabs.getSelectedTable();
            if (table == null)
                return;
View Full Code Here

Examples of com.tulskiy.musique.gui.dialogs.TreeFileChooser

        } else {
            item = tableMenu.add("Add Files");
            item.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    TreeFileChooser fc = new TreeFileChooser(PlaylistTable.this, "Add Files", true);
                    File[] files = fc.showOpenDialog();

                    if (files != null) {
                        ProgressDialog dialog = new ProgressDialog(PlaylistTable.this, "Adding Files");
                        dialog.show(new Task.FileAddingTask(getPlaylist(), files, getPlaylist().size()));
                    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.