mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
NPE
This commit is contained in:
@@ -268,7 +268,10 @@ final class ThumbnailViewUI extends JPanel implements DataProvider, Disposable {
|
||||
setFileName(file.getName());
|
||||
String toolTipText = IfsUtil.getReferencePath(thumbnailView.getProject(), file);
|
||||
if (!isFileSizeVisible()) {
|
||||
toolTipText += " [" + getImageComponent().getDescription() + "]";
|
||||
String description = getImageComponent().getDescription();
|
||||
if (description != null) {
|
||||
toolTipText += " [" + description + "]";
|
||||
}
|
||||
}
|
||||
setToolTipText(toolTipText);
|
||||
setDirectory(file.isDirectory());
|
||||
|
||||
@@ -24,6 +24,7 @@ import org.intellij.images.editor.ImageDocument;
|
||||
import org.intellij.images.options.GridOptions;
|
||||
import org.intellij.images.options.TransparencyChessboardOptions;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.event.ChangeEvent;
|
||||
@@ -200,9 +201,13 @@ public class ImageComponent extends JComponent {
|
||||
return grid.isVisible();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public String getDescription() {
|
||||
BufferedImage image = getDocument().getValue();
|
||||
return ImagesBundle.message("icon.dimensions", image.getWidth(), image.getHeight(), image.getColorModel().getPixelSize());
|
||||
if (image != null) {
|
||||
return ImagesBundle.message("icon.dimensions", image.getWidth(), image.getHeight(), image.getColorModel().getPixelSize());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void setCanvasSize(int width, int height) {
|
||||
|
||||
Reference in New Issue
Block a user