use of com.intellij.openapi.fileChooser.FileChooserDescriptor in project android by JetBrains.
the class ImportSourceLocationStep method setupSourceLocationControls.
private void setupSourceLocationControls() {
FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFileOrFolderDescriptor();
descriptor.setTitle("Select Source Location");
descriptor.setDescription("Select existing ADT or Gradle project to import as a new subproject");
mySourceLocation.addBrowseFolderListener(new TextBrowseFolderListener(descriptor));
mySourceLocation.getTextField().getDocument().addDocumentListener(new DocumentAdapter() {
@Override
protected void textChanged(DocumentEvent e) {
invalidate();
}
});
applyBackgroundOperationResult(checkPath(mySourceLocation.getText()));
myErrorWarning.setIcon(null);
myErrorWarning.setText(null);
}
use of com.intellij.openapi.fileChooser.FileChooserDescriptor in project intellij-plugins by JetBrains.
the class FlexLibraryRootsComponentDescriptor method createAttachFilesChooserDescriptor.
@NotNull
@Override
public FileChooserDescriptor createAttachFilesChooserDescriptor(String libraryName) {
FileChooserDescriptor d = super.createAttachFilesChooserDescriptor(libraryName);
d.setTitle(UIBundle.message("file.chooser.default.title"));
d.setDescription(FlexBundle.message("choose.library.files.description", ApplicationNamesInfo.getInstance().getFullProductName()));
return d;
}
use of com.intellij.openapi.fileChooser.FileChooserDescriptor in project intellij-plugins by JetBrains.
the class FlexmojosSdkType method getHomeChooserDescriptor.
@NotNull
public FileChooserDescriptor getHomeChooserDescriptor() {
final FileChooserDescriptor descriptor = new FileChooserDescriptor(false, false, false, false, false, false) {
public boolean isFileVisible(final VirtualFile file, final boolean showHiddenFiles) {
return false;
}
};
descriptor.setTitle("SDK of this type can only be created automatically during Maven project import.");
return descriptor;
}
use of com.intellij.openapi.fileChooser.FileChooserDescriptor in project intellij-plugins by JetBrains.
the class SelectDirWithFlashBuilderProjectsStep method setupInitialPathComponent.
private void setupInitialPathComponent() {
myInitialPathComponent.getComponent().getTextField().getDocument().addDocumentListener(new DocumentAdapter() {
protected void textChanged(final DocumentEvent e) {
onInitialPathChanged();
}
});
final FileChooserDescriptor descriptor = new FileChooserDescriptor(true, true, true, true, false, false) {
public boolean isFileVisible(final VirtualFile file, final boolean showHiddenFiles) {
return (super.isFileVisible(file, showHiddenFiles) && (file.isDirectory() || FlashBuilderProjectFinder.isFlashBuilderProject(file)) || FlashBuilderProjectFinder.hasArchiveExtension(file.getPath()));
}
public Icon getIcon(final VirtualFile file) {
// do not use Flash Builder specific icon for zip
return !file.isDirectory() && (FlashBuilderProjectFinder.hasFxpExtension(file.getPath()) || FlashBuilderProjectFinder.isFlashBuilderProject(file)) ? dressIcon(file, getBuilder().getIcon()) : super.getIcon(file);
}
};
myInitialPathComponent.getComponent().addBrowseFolderListener(FlexBundle.message("select.flash.builder.workspace.or.project"), null, getWizardContext().getProject(), descriptor);
}
use of com.intellij.openapi.fileChooser.FileChooserDescriptor in project android by JetBrains.
the class FileChooserActionListener method actionPerformed.
@Override
public void actionPerformed(ActionEvent e) {
if (myFilePathProperty == null) {
return;
}
final FileChooserDescriptor descriptor = MockupFileHelper.getFileChooserDescriptor();
VirtualFile selectedFile = myFilePathProperty.getValue() != null ? VfsUtil.findFileByIoFile(new File(FileUtil.toSystemIndependentName(myFilePathProperty.getValue())), false) : ourLastOpenedFile;
FileChooser.chooseFile(descriptor, null, null, selectedFile, (virtualFile) -> {
ourLastOpenedFile = virtualFile;
if (myComponent != null && myComponent.isRoot()) {
openDeviceChoiceDialog(virtualFile, myFilePathProperty, myCropProperty);
} else {
saveMockupFile(virtualFile, myFilePathProperty, myCropProperty);
if (e == null) {
return;
}
final TextAccessor textAccessor = e.getSource() instanceof TextAccessor ? ((TextAccessor) e.getSource()) : null;
if (textAccessor != null) {
textAccessor.setText(virtualFile.getPath());
}
}
});
}
Aggregations