public class DocumentationManager extends DockablePopupManager<DocumentationComponent>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
JAVADOC_LOCATION_AND_SIZE |
static java.lang.String |
NEW_JAVADOC_LOCATION_AND_SIZE |
static Key<SmartPsiElementPointer<?>> |
ORIGINAL_ELEMENT_KEY |
static DataKey<java.lang.String> |
SELECTED_QUICK_DOC_TEXT |
myProject, myToolWindow
Constructor and Description |
---|
DocumentationManager(Project project) |
DocumentationManager(Project project,
ActionManager manager,
TargetElementUtil targetElementUtil)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
protected DocumentationComponent |
createComponent() |
static void |
createHyperlink(java.lang.StringBuilder buffer,
java.lang.String refText,
java.lang.String label,
boolean plainLink) |
protected AnAction |
createRestorePopupAction() |
void |
createToolWindow(PsiElement element,
PsiElement originalElement) |
protected void |
doUpdateComponent(Editor editor,
PsiFile psiFile) |
protected void |
doUpdateComponent(Editor editor,
PsiFile psiFile,
boolean requestFocus) |
protected void |
doUpdateComponent(PsiElement element) |
protected void |
doUpdateComponent(PsiElement element,
PsiElement originalElement,
DocumentationComponent component) |
void |
fetchDocInfo(PsiElement element,
DocumentationComponent component) |
PsiElement |
findTargetElement(Editor editor,
int offset,
PsiFile file,
PsiElement contextElement) |
PsiElement |
findTargetElement(Editor editor,
PsiFile file) |
PsiElement |
findTargetElement(Editor editor,
PsiFile file,
PsiElement contextElement) |
java.lang.String |
generateDocumentation(PsiElement element,
PsiElement originalElement,
boolean onHover) |
protected boolean |
getAutoUpdateDefault() |
protected java.lang.String |
getAutoUpdateDescription() |
java.lang.String |
getAutoUpdateEnabledProperty() |
protected java.lang.String |
getAutoUpdateTitle() |
JBPopup |
getDocInfoHint() |
PsiElement |
getElementFromLookup(Editor editor,
PsiFile file) |
static DocumentationManager |
getInstance(Project project) |
ActionCallback |
getLastAction() |
static PsiElement |
getOriginalElement(PsiElement element) |
Project |
getProject(PsiElement element) |
static DocumentationProvider |
getProviderFromElement(PsiElement element) |
static DocumentationProvider |
getProviderFromElement(PsiElement element,
PsiElement originalElement) |
protected java.lang.String |
getRestorePopupDescription() |
java.lang.String |
getShowInToolWindowProperty() |
protected java.lang.String |
getTitle(PsiElement element) |
protected java.lang.String |
getToolwindowId() |
protected void |
installComponentActions(ToolWindow toolWindow,
DocumentationComponent component) |
void |
navigateByLink(DocumentationComponent component,
java.lang.String url) |
ActionCallback |
queueFetchDocInfo(PsiElement element,
DocumentationComponent component) |
void |
restorePopupBehavior() |
void |
setAllowContentUpdateFromContext(boolean allow) |
void |
setDocumentationComponent(DocumentationComponent documentationComponent) |
protected void |
setToolwindowDefaultState() |
void |
showJavaDocInfo(Editor editor,
PsiElement element,
PsiElement original,
java.lang.Runnable closeCallback,
java.lang.String documentation,
boolean closeOnSneeze,
boolean useStoredPopupSize)
Asks to show quick doc for the target element.
|
void |
showJavaDocInfo(Editor editor,
PsiFile file,
boolean requestFocus) |
void |
showJavaDocInfo(Editor editor,
PsiFile file,
boolean requestFocus,
java.lang.Runnable closeCallback) |
void |
showJavaDocInfo(PsiElement element,
PsiElement original) |
void |
showJavaDocInfo(PsiElement element,
PsiElement original,
boolean requestFocus,
java.lang.Runnable closeCallback) |
void |
showJavaDocInfo(PsiElement element,
PsiElement original,
boolean requestFocus,
java.lang.Runnable closeCallback,
java.lang.String documentation,
boolean useStoredPopupSize) |
void |
showJavaDocInfo(PsiElement element,
PsiElement original,
java.lang.Runnable closeCallback) |
void |
showJavaDocInfoAtToolWindow(PsiElement element,
PsiElement original) |
static void |
storeOriginalElement(Project project,
PsiElement originalElement,
PsiElement element) |
void |
updateToolwindowContext() |
createActions, hasActiveDockedDocWindow, recreateToolWindow, resetAutoUpdateState, updateComponent, updateComponent
public static final java.lang.String JAVADOC_LOCATION_AND_SIZE
public static final java.lang.String NEW_JAVADOC_LOCATION_AND_SIZE
public static final DataKey<java.lang.String> SELECTED_QUICK_DOC_TEXT
public static final Key<SmartPsiElementPointer<?>> ORIGINAL_ELEMENT_KEY
@Deprecated public DocumentationManager(Project project, ActionManager manager, TargetElementUtil targetElementUtil)
DocumentationManager(Project)
public DocumentationManager(Project project)
protected java.lang.String getToolwindowId()
getToolwindowId
in class DockablePopupManager<DocumentationComponent>
protected DocumentationComponent createComponent()
createComponent
in class DockablePopupManager<DocumentationComponent>
protected java.lang.String getRestorePopupDescription()
getRestorePopupDescription
in class DockablePopupManager<DocumentationComponent>
protected java.lang.String getAutoUpdateDescription()
getAutoUpdateDescription
in class DockablePopupManager<DocumentationComponent>
protected java.lang.String getAutoUpdateTitle()
getAutoUpdateTitle
in class DockablePopupManager<DocumentationComponent>
protected boolean getAutoUpdateDefault()
getAutoUpdateDefault
in class DockablePopupManager<DocumentationComponent>
protected AnAction createRestorePopupAction()
createRestorePopupAction
in class DockablePopupManager<DocumentationComponent>
public void restorePopupBehavior()
restorePopupBehavior
in class DockablePopupManager<DocumentationComponent>
public void createToolWindow(PsiElement element, PsiElement originalElement)
createToolWindow
in class DockablePopupManager<DocumentationComponent>
protected void installComponentActions(ToolWindow toolWindow, DocumentationComponent component)
installComponentActions
in class DockablePopupManager<DocumentationComponent>
protected void setToolwindowDefaultState()
setToolwindowDefaultState
in class DockablePopupManager<DocumentationComponent>
public static DocumentationManager getInstance(Project project)
public void setAllowContentUpdateFromContext(boolean allow)
public void updateToolwindowContext()
public void showJavaDocInfoAtToolWindow(PsiElement element, PsiElement original)
public void showJavaDocInfo(PsiElement element, PsiElement original)
public void showJavaDocInfo(Editor editor, PsiElement element, PsiElement original, java.lang.Runnable closeCallback, java.lang.String documentation, boolean closeOnSneeze, boolean useStoredPopupSize)
editor
- editor with an element for which quick do should be shownelement
- target element which documentation should be shownoriginal
- element that was used as a quick doc anchor. Example: consider a code like Runnable task;
.
A user wants to see javadoc for the Runnable
, so, original element is a class name from the variable
declaration but 'element'
argument is a Runnable
descriptorcloseCallback
- callback to be notified on target hint close (if any)documentation
- precalculated documentationcloseOnSneeze
- flag that defines whether quick doc control should be as non-obtrusive as possible. E.g. there are at least
two possible situations - the quick doc is shown automatically on mouse over element; the quick doc is shown
on explicit action call (Ctrl+Q). We want to close the doc on, say, editor viewport position change
at the first situation but don't want to do that at the seconduseStoredPopupSize
- whether popup size previously set by user (via mouse-dragging) should be used, or default one should be usedpublic void showJavaDocInfo(PsiElement element, PsiElement original, java.lang.Runnable closeCallback)
public void showJavaDocInfo(PsiElement element, PsiElement original, boolean requestFocus, java.lang.Runnable closeCallback)
public void showJavaDocInfo(PsiElement element, PsiElement original, boolean requestFocus, java.lang.Runnable closeCallback, java.lang.String documentation, boolean useStoredPopupSize)
public void showJavaDocInfo(Editor editor, PsiFile file, boolean requestFocus, java.lang.Runnable closeCallback)
public PsiElement findTargetElement(Editor editor, PsiFile file)
public static void storeOriginalElement(Project project, PsiElement originalElement, PsiElement element)
public PsiElement findTargetElement(Editor editor, PsiFile file, PsiElement contextElement)
public PsiElement findTargetElement(Editor editor, int offset, PsiFile file, PsiElement contextElement)
public PsiElement getElementFromLookup(Editor editor, PsiFile file)
public java.lang.String generateDocumentation(PsiElement element, PsiElement originalElement, boolean onHover)
public JBPopup getDocInfoHint()
public void fetchDocInfo(PsiElement element, DocumentationComponent component)
public ActionCallback queueFetchDocInfo(PsiElement element, DocumentationComponent component)
public static DocumentationProvider getProviderFromElement(PsiElement element)
public static DocumentationProvider getProviderFromElement(PsiElement element, PsiElement originalElement)
public static PsiElement getOriginalElement(PsiElement element)
public void navigateByLink(DocumentationComponent component, java.lang.String url)
public Project getProject(PsiElement element)
public static void createHyperlink(java.lang.StringBuilder buffer, java.lang.String refText, java.lang.String label, boolean plainLink)
public java.lang.String getShowInToolWindowProperty()
getShowInToolWindowProperty
in class DockablePopupManager<DocumentationComponent>
public java.lang.String getAutoUpdateEnabledProperty()
getAutoUpdateEnabledProperty
in class DockablePopupManager<DocumentationComponent>
protected void doUpdateComponent(PsiElement element, PsiElement originalElement, DocumentationComponent component)
doUpdateComponent
in class DockablePopupManager<DocumentationComponent>
protected void doUpdateComponent(Editor editor, PsiFile psiFile, boolean requestFocus)
doUpdateComponent
in class DockablePopupManager<DocumentationComponent>
protected void doUpdateComponent(Editor editor, PsiFile psiFile)
doUpdateComponent
in class DockablePopupManager<DocumentationComponent>
protected void doUpdateComponent(PsiElement element)
doUpdateComponent
in class DockablePopupManager<DocumentationComponent>
protected java.lang.String getTitle(PsiElement element)
getTitle
in class DockablePopupManager<DocumentationComponent>
public ActionCallback getLastAction()
public void setDocumentationComponent(DocumentationComponent documentationComponent)