Package com.intellij.openapi.fileChooser

Examples of com.intellij.openapi.fileChooser.FileChooserDescriptor


        sdkModificator.commitChanges();
    }

    @Override
    public FileChooserDescriptor getHomeChooserDescriptor() {
        FileChooserDescriptor descriptor = new FileChooserDescriptor(true, true, false, false, false, false) {
            public void validateSelectedFiles(VirtualFile[] files) throws Exception {
                if (files.length != 0) {
                    final String selectedPath = files[0].getPath();
                    boolean valid = isValidSdkHome(selectedPath);
                    if (!valid) {
                        valid = isValidSdkHome(adjustSelectedSdkHome(selectedPath));
                        if (!valid) {
                            String message = files[0].isDirectory()
                                    ? ProjectBundle.message("sdk.configure.home.invalid.error", getPresentableName())
                                    : ProjectBundle.message("sdk.configure.home.file.invalid.error", getPresentableName());
                            throw new Exception(message);
                        }
                    }
                }
            }
        };

        try {
            descriptor.setTitle(GoBundle.message("go.sdk.appengine.configure.title", getPresentableName()));
        } catch (NoSuchMethodError ignored) {

        }
        return descriptor;
    }
View Full Code Here


        return GoSdkUtil.resolvePotentialGoogleGoHomePath();
    }

    @Override
    public FileChooserDescriptor getHomeChooserDescriptor() {
        final FileChooserDescriptor descriptor = new FileChooserDescriptor(true, true, false, false, false, false) {
          public void validateSelectedFiles(VirtualFile[] files) throws Exception {
            if (files.length != 0){
              final String selectedPath = files[0].getPath();
              boolean valid = isValidSdkHome(selectedPath);
              if (!valid){
                valid = isValidSdkHome(adjustSelectedSdkHome(selectedPath));
                if (!valid) {
                  String message = files[0].isDirectory()
                                   ? ProjectBundle.message("sdk.configure.home.invalid.error", getPresentableName())
                                   : ProjectBundle.message("sdk.configure.home.file.invalid.error", getPresentableName());
                  throw new Exception(message);
                }
              }
            }
          }
        };

        try {
            descriptor.setTitle(GoBundle.message("go.sdk.configure.title", getPresentableName()));
        } catch (NoSuchMethodError ignored) {

        }
        return descriptor;
    }
View Full Code Here

                        }
                    }
                });

        applicationPackage.addBrowseFolderListener("Application package directory", "Application package directory",
                project, new FileChooserDescriptor(false, true, false, false, false, false));

        buildDirectoryPathBrowser.addBrowseFolderListener("Go executable build path", "Go executable build path",
                project, new FileChooserDescriptor(false, true, false, false, false, false));

        workingDirectoryBrowser.addBrowseFolderListener("Application working directory", "Application working directory",
                project, new FileChooserDescriptor(false, true, false, false, false, false));

        buildBeforeRunCheckBox.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                buildDirectoryPathBrowser.setEnabled(buildBeforeRunCheckBox.isSelected());
                enableDebuggingCheckBox.setEnabled(buildBeforeRunCheckBox.isSelected());
            }
        });

        goFileRadioButton.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                applicationName.setEnabled(goFileRadioButton.isSelected());
                applicationPackage.setEnabled(!goFileRadioButton.isSelected());
            }
        });

        goPackageRadioButton.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                applicationName.setEnabled(!goPackageRadioButton.isSelected());
                applicationPackage.setEnabled(goPackageRadioButton.isSelected());
            }
        });

        m_gdbPath.addBrowseFolderListener("GDB executable path", "GDB executable path",
                project, new FileChooserDescriptor(true, false, false, false, false, false));

        debugPanel.setEnabled(enableDebuggingCheckBox.isSelected());
    }
View Full Code Here

    private JRadioButton goimportsOnSave;
    private TextFieldWithBrowseButton goimportsPath;

    public GoConfigurableForm() {
        goimportsPath.addBrowseFolderListener("goimports directory", "Select the goimports directory",
                null, new FileChooserDescriptor(false, true, false, false, false, false));

        doNothingOnSave.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                goimportsPath.setEnabled(goimportsOnSave.isSelected());
View Full Code Here

    private final GoGlobalSettings goGlobalSettings = GoGlobalSettings.getInstance();
    private final GoSettings goSettings = GoSettings.getInstance();

    GoGlobalConfigurableForm() {
        goRoot.addBrowseFolderListener("GOROOT directory", "Select the GOROOT directory of your GO setup",
                null, new FileChooserDescriptor(false, true, false, false, false, false));
        goAppEngineRoot.addBrowseFolderListener("GOAPPENGINEROOT directory", "Select the GOAPPENGINEROOT directory of your GO setup",
                null, new FileChooserDescriptor(false, true, false, false, false, false));
        goPath.addBrowseFolderListener("GOPATH directory", "Select the GOPATH directory of your GO setup",
                null, new FileChooserDescriptor(false, true, false, false, false, false));

        importSysGo.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                goRoot.setText(GoSdkUtil.getSysGoRootPath());
View Full Code Here

        }
    }

    public GaeRunConfigurationEditorForm(final Project project) {
        workingDirectoryBrowser.addBrowseFolderListener("Application working directory", "Application working directory",
                project, new FileChooserDescriptor(false, true, false, false, false, false));

        workingDirectoryBrowser.setText(project.getBasePath());
        hostname.setText("localhost");
        port.setText("8080");
        adminPort.setText("8000");
View Full Code Here

import java.io.IOException;

public class SelectFolder {

    public static void build(String owner, String workspace, final RunLater<String> runLater) {
        FileChooserDescriptor descriptor = new FileChooserDescriptor(false, true, false, false, false, false);
        descriptor.setTitle("Select Folder For Workspace");
        descriptor.setDescription("NOTE: Floobits will NOT make a new, root directory inside the folder you choose. If you have cloned the project already, select that folder.");
        FloorcJson floorcJson;
        try {
            floorcJson =  Settings.get();
        } catch (Exception e) {
            Flog.errorMessage("Your floorc.json has invalid json.", null);
View Full Code Here

  }

  public static JPanel constructDirectoryBrowserField(final JTextField aTextField, final String aSearchedObjectName) {
    return constructFieldWithBrowseButton(aTextField, new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        FileChooserDescriptor descriptor = FileChooserDescriptorFactory.getDirectoryChooserDescriptor(aSearchedObjectName);
        VirtualFile[] files = FileChooser.chooseFiles(aTextField, descriptor);
        if (files.length != 0) {
          aTextField.setText(FileUtil.toSystemDependentName(files[0].getPath()));
          aTextField.postActionEvent();
        }
View Full Code Here

  public static JPanel constructFileURLBrowserField(final TextFieldWithHistory aFieldWithHistory,
                                                    final String aSearchedObjectName) {
    return constructFieldWithBrowseButton(aFieldWithHistory, new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        FileChooserDescriptor descriptor = FileChooserDescriptorFactory.getFileChooserDescriptor(aSearchedObjectName);
        VirtualFile[] files = FileChooser.chooseFiles(aFieldWithHistory, descriptor);
        if (files.length != 0) {
          try {
            aFieldWithHistory.setText(VfsUtil.virtualToIoFile(files[0]).toURL().toString());
          }
View Full Code Here

                Collection<VirtualFile> virtualFiles = FileBasedIndex.getInstance().getContainingFiles(FileTypeIndex.NAME, SimpleFileType.INSTANCE,
                        GlobalSearchScope.allScope(project));
                if (virtualFiles.size() == 1) {
                    createProperty(project, virtualFiles.iterator().next());
                } else {
                    final FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFileDescriptor(SimpleFileType.INSTANCE);
                    descriptor.setRoots(project.getBaseDir());
                    final VirtualFile file = FileChooser.chooseFile(descriptor, project, null);
                    if (file != null) {
                        createProperty(project, file);
                    }
                }
View Full Code Here

TOP

Related Classes of com.intellij.openapi.fileChooser.FileChooserDescriptor

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.