This commit is contained in:
Dmitry Jemerov
2013-03-28 12:48:02 +01:00
parent 156cf660fd
commit a7d889eb3b
@@ -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<PreviewHintProvider> 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);
}