Search in sources :

Example 1 with OpenProjectFileChooserDescriptor

use of com.intellij.ide.actions.OpenProjectFileChooserDescriptor in project intellij-community by JetBrains.

the class OpenDirectoryProjectAction method actionPerformed.

public void actionPerformed(final AnActionEvent e) {
    final FileChooserDescriptor descriptor = new OpenProjectFileChooserDescriptor(false);
    final Project project = e.getData(CommonDataKeys.PROJECT);
    FileChooser.chooseFiles(descriptor, project, null, files -> PlatformProjectOpenProcessor.getInstance().doOpenProject(files.get(0), project, false));
}
Also used : Project(com.intellij.openapi.project.Project) OpenProjectFileChooserDescriptor(com.intellij.ide.actions.OpenProjectFileChooserDescriptor) OpenProjectFileChooserDescriptor(com.intellij.ide.actions.OpenProjectFileChooserDescriptor)

Example 2 with OpenProjectFileChooserDescriptor

use of com.intellij.ide.actions.OpenProjectFileChooserDescriptor in project android by JetBrains.

the class AndroidImportProjectAction method createFileChooserDescriptor.

@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;
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) FileChooserDescriptor(com.intellij.openapi.fileChooser.FileChooserDescriptor) OpenProjectFileChooserDescriptor(com.intellij.ide.actions.OpenProjectFileChooserDescriptor) OpenProjectFileChooserDescriptor(com.intellij.ide.actions.OpenProjectFileChooserDescriptor) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

OpenProjectFileChooserDescriptor (com.intellij.ide.actions.OpenProjectFileChooserDescriptor)2 FileChooserDescriptor (com.intellij.openapi.fileChooser.FileChooserDescriptor)1 Project (com.intellij.openapi.project.Project)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 NotNull (org.jetbrains.annotations.NotNull)1