From a7d889eb3bf625058c1049214d3372dbda4d847b Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Thu, 28 Mar 2013 12:46:31 +0100 Subject: [PATCH] javadoc --- .../codeInsight/preview/PreviewHintProvider.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/platform/lang-api/src/com/intellij/codeInsight/preview/PreviewHintProvider.java b/platform/lang-api/src/com/intellij/codeInsight/preview/PreviewHintProvider.java index 18caa7044965..9fbaf90926b0 100644 --- a/platform/lang-api/src/com/intellij/codeInsight/preview/PreviewHintProvider.java +++ b/platform/lang-api/src/com/intellij/codeInsight/preview/PreviewHintProvider.java @@ -25,13 +25,28 @@ import org.jetbrains.annotations.Nullable; import javax.swing.*; /** + * Provides the possibility to display a preview component when holding the Shift key and hovering over a PSI element in the text editor. + * These preview components are currently used primarily for displaying color values. + * * @author yole */ public interface PreviewHintProvider { ExtensionPointName EP_NAME = ExtensionPointName.create("com.intellij.previewHintProvider"); + /** + * Returns true if Shift-hover preview is supported for the given file. + * + * @param file the file to check for preview availability + * @return true if preview is supported, false otherwise. + */ boolean isSupportedFile(PsiFile file); + /** + * Returns the Swing component to be displayed in the Shift-preview popup for the specified element. + * + * @param element the element for which preview is requested + * @return the component or null if no preview is available for the specified element. + */ @Nullable JComponent getPreviewComponent(@NotNull PsiElement element); }