Example usage for com.intellij.openapi.wm ToolWindowId DOCUMENTATION

List of usage examples for com.intellij.openapi.wm ToolWindowId DOCUMENTATION

Introduction

In this page you can find the example usage for com.intellij.openapi.wm ToolWindowId DOCUMENTATION.

Prototype

String DOCUMENTATION

To view the source code for com.intellij.openapi.wm ToolWindowId DOCUMENTATION.

Click Source Link

Usage

From source file:com.intellij.codeInsight.documentation.DocumentationManager.java

License:Apache License

@Override
protected String getToolwindowId() {
    return ToolWindowId.DOCUMENTATION;
}

From source file:org.intellij.grammar.BnfDocumentationProvider.java

License:Apache License

public static void updateDocPopup(final PsiElement element, final Getter<String> docGetter) {
    final Project project = element.getProject();
    ApplicationManager.getApplication().executeOnPooledThread(new Runnable() {
        @Override// w  w w  .java2  s  .  c  o m
        public void run() {
            final String documentation = docGetter.get();
            if (StringUtil.isEmpty(documentation))
                return;
            ApplicationManager.getApplication().invokeLater(new Runnable() {
                @Override
                public void run() {
                    DocumentationManager documentationManager = DocumentationManager.getInstance(project);
                    DocumentationComponent component;
                    JBPopup hint = documentationManager.getDocInfoHint();
                    if (hint != null) {
                        component = (DocumentationComponent) ((AbstractPopup) hint).getComponent();
                    } else if (documentationManager.hasActiveDockedDocWindow()) {
                        ToolWindow toolWindow = ToolWindowManager.getInstance(project)
                                .getToolWindow(ToolWindowId.DOCUMENTATION);
                        Content selectedContent = toolWindow == null ? null
                                : toolWindow.getContentManager().getSelectedContent();
                        component = selectedContent == null ? null
                                : (DocumentationComponent) selectedContent.getComponent();
                    } else {
                        component = null;
                    }
                    PsiElement docElement = component == null ? null
                            : ObjectUtils.chooseNotNull(component.getElement(), element);
                    if (docElement == element) {
                        component.setText(documentation, element, false);
                    }
                }
            });
        }
    });
}