Search in sources :

Example 1 with ThumbnailManager

use of org.intellij.images.thumbnail.ThumbnailManager in project intellij-community by JetBrains.

the class ShowThumbnailsAction method actionPerformed.

public void actionPerformed(AnActionEvent e) {
    Project project = e.getData(CommonDataKeys.PROJECT);
    VirtualFile file = e.getData(CommonDataKeys.VIRTUAL_FILE);
    if (project != null && file != null && file.isDirectory()) {
        ThumbnailManager thumbnailManager = ThumbnailManager.getManager(project);
        ThumbnailView thumbnailView = thumbnailManager.getThumbnailView();
        thumbnailView.setRoot(file);
        thumbnailView.setVisible(true);
        thumbnailView.activate();
    }
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) Project(com.intellij.openapi.project.Project) ThumbnailManager(org.intellij.images.thumbnail.ThumbnailManager) ThumbnailView(org.intellij.images.thumbnail.ThumbnailView)

Aggregations

Project (com.intellij.openapi.project.Project)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 ThumbnailManager (org.intellij.images.thumbnail.ThumbnailManager)1 ThumbnailView (org.intellij.images.thumbnail.ThumbnailView)1