本文整理匯總了Java中com.intellij.openapi.fileChooser.FileChooserDescriptorFactory.createMultipleJavaPathDescriptor方法的典型用法代碼示例。如果您正苦於以下問題:Java FileChooserDescriptorFactory.createMultipleJavaPathDescriptor方法的具體用法?Java FileChooserDescriptorFactory.createMultipleJavaPathDescriptor怎麽用?Java FileChooserDescriptorFactory.createMultipleJavaPathDescriptor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.intellij.openapi.fileChooser.FileChooserDescriptorFactory
的用法示例。
在下文中一共展示了FileChooserDescriptorFactory.createMultipleJavaPathDescriptor方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: actionPerformed
import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory; //導入方法依賴的package包/類
@Override
public void actionPerformed(AnActionEvent e) {
FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createMultipleJavaPathDescriptor();
descriptor.setTitle("Exclude from Library");
descriptor.setDescription("Select directories which should be excluded from the library content. Content of excluded directories won't be processed by IDE.");
Set<VirtualFile> roots = getNotExcludedRoots();
descriptor.setRoots(roots.toArray(new VirtualFile[roots.size()]));
if (roots.size() < 2) {
descriptor.withTreeRootVisible(true);
}
VirtualFile toSelect = null;
for (Object o : getSelectedElements()) {
Object itemElement = o instanceof ExcludedRootElement ? ((ExcludedRootElement)o).getParentDescriptor() : o;
if (itemElement instanceof ItemElement) {
toSelect = VirtualFileManager.getInstance().findFileByUrl(((ItemElement)itemElement).getUrl());
break;
}
}
final VirtualFile[] files = FileChooser.chooseFiles(descriptor, myPanel, myProject, toSelect);
if (files.length > 0) {
ApplicationManager.getApplication().runWriteAction(new Runnable() {
@Override
public void run() {
for (VirtualFile file : files) {
getLibraryEditor().addExcludedRoot(file.getUrl());
}
}
});
myLastChosen = files[0];
libraryChanged(true);
}
}
示例2: createAttachFilesChooserDescriptor
import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory; //導入方法依賴的package包/類
/**
* @return descriptor for the file chooser which will be shown when 'Attach Files' button is pressed
* @param libraryName
*/
@NotNull
public FileChooserDescriptor createAttachFilesChooserDescriptor(@Nullable String libraryName) {
final FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createMultipleJavaPathDescriptor();
descriptor.setTitle(StringUtil.isEmpty(libraryName) ? ProjectBundle.message("library.attach.files.action")
: ProjectBundle.message("library.attach.files.to.library.action", libraryName));
descriptor.setDescription(ProjectBundle.message("library.attach.files.description"));
return descriptor;
}
示例3: createPathEditor
import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory; //導入方法依賴的package包/類
@Override
public SdkPathEditor createPathEditor(Sdk sdk) {
return new JavadocPathsEditor(sdk, FileChooserDescriptorFactory.createMultipleJavaPathDescriptor());
}
示例4: createChooserDescriptor
import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory; //導入方法依賴的package包/類
public FileChooserDescriptor createChooserDescriptor() {
return FileChooserDescriptorFactory.createMultipleJavaPathDescriptor();
}