mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
get rid of moronic interface implementation
This commit is contained in:
+14
-14
@@ -82,8 +82,7 @@ import java.lang.ref.WeakReference;
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
|
||||
public class DocumentationManager extends DockablePopupManager<DocumentationComponent> implements DocumentationManagerProtocol {
|
||||
|
||||
public class DocumentationManager extends DockablePopupManager<DocumentationComponent> {
|
||||
@NonNls public static final String JAVADOC_LOCATION_AND_SIZE = "javadoc.popup";
|
||||
public static final DataKey<String> SELECTED_QUICK_DOC_TEXT = DataKey.create("QUICK_DOC.SELECTED_TEXT");
|
||||
|
||||
@@ -91,10 +90,10 @@ public class DocumentationManager extends DockablePopupManager<DocumentationComp
|
||||
private static final String SHOW_DOCUMENTATION_IN_TOOL_WINDOW = "ShowDocumentationInToolWindow";
|
||||
private static final String DOCUMENTATION_AUTO_UPDATE_ENABLED = "DocumentationAutoUpdateEnabled";
|
||||
|
||||
private Editor myEditor = null;
|
||||
private Editor myEditor;
|
||||
private final Alarm myUpdateDocAlarm;
|
||||
private WeakReference<JBPopup> myDocInfoHintRef;
|
||||
private Component myPreviouslyFocused = null;
|
||||
private Component myPreviouslyFocused;
|
||||
public static final Key<SmartPsiElementPointer> ORIGINAL_ELEMENT_KEY = Key.create("Original element");
|
||||
|
||||
private final ActionManagerEx myActionManagerEx;
|
||||
@@ -504,7 +503,7 @@ public class DocumentationManager extends DockablePopupManager<DocumentationComp
|
||||
if (myCloseOnSneeze) {
|
||||
closeDocHint();
|
||||
}
|
||||
if ((AbstractPopup.isCloseRequest(e) && getDocInfoHint() != null)) {
|
||||
if (AbstractPopup.isCloseRequest(e) && getDocInfoHint() != null) {
|
||||
closeDocHint();
|
||||
return true;
|
||||
}
|
||||
@@ -664,7 +663,9 @@ public class DocumentationManager extends DockablePopupManager<DocumentationComp
|
||||
doFetchDocInfo(component, getDefaultCollector(element, null), true, false);
|
||||
}
|
||||
|
||||
public ActionCallback queueFetchDocInfo(final DocumentationCollector provider, final DocumentationComponent component, final boolean clearHistory) {
|
||||
private ActionCallback queueFetchDocInfo(final DocumentationCollector provider,
|
||||
final DocumentationComponent component,
|
||||
final boolean clearHistory) {
|
||||
return doFetchDocInfo(component, provider, false, clearHistory);
|
||||
}
|
||||
|
||||
@@ -742,7 +743,7 @@ public class DocumentationManager extends DockablePopupManager<DocumentationComp
|
||||
if (documentationText == null) {
|
||||
component.setText(CodeInsightBundle.message("no.documentation.found"), element, true);
|
||||
}
|
||||
else if (documentationText.length() == 0) {
|
||||
else if (documentationText.isEmpty()) {
|
||||
component.setText(component.getText(), element, true, clearHistory);
|
||||
}
|
||||
else {
|
||||
@@ -754,9 +755,7 @@ public class DocumentationManager extends DockablePopupManager<DocumentationComp
|
||||
callback.setDone();
|
||||
return;
|
||||
}
|
||||
else {
|
||||
jbPopup.setDimensionServiceKey(JAVADOC_LOCATION_AND_SIZE);
|
||||
}
|
||||
jbPopup.setDimensionServiceKey(JAVADOC_LOCATION_AND_SIZE);
|
||||
jbPopup.setCaption(getTitle(element, false));
|
||||
callback.setDone();
|
||||
}
|
||||
@@ -852,8 +851,9 @@ public class DocumentationManager extends DockablePopupManager<DocumentationComp
|
||||
if (libraryEntry != null) {
|
||||
ProjectSettingsService.getInstance(myProject).openLibraryOrSdkSettings(libraryEntry);
|
||||
}
|
||||
} else if (url.startsWith(PSI_ELEMENT_PROTOCOL)) {
|
||||
final String refText = url.substring(PSI_ELEMENT_PROTOCOL.length());
|
||||
}
|
||||
else if (url.startsWith(DocumentationManagerProtocol.PSI_ELEMENT_PROTOCOL)) {
|
||||
final String refText = url.substring(DocumentationManagerProtocol.PSI_ELEMENT_PROTOCOL.length());
|
||||
DocumentationProvider provider = getProviderFromElement(psiElement);
|
||||
PsiElement targetElement = provider.getDocumentationElementForLink(manager, refText, psiElement);
|
||||
if (targetElement == null) {
|
||||
@@ -920,7 +920,7 @@ public class DocumentationManager extends DockablePopupManager<DocumentationComp
|
||||
(new DocumentationCollector() {
|
||||
@Override
|
||||
public String getDocumentation() throws Exception {
|
||||
if (url.startsWith(DOC_ELEMENT_PROTOCOL)) {
|
||||
if (url.startsWith(DocumentationManagerProtocol.DOC_ELEMENT_PROTOCOL)) {
|
||||
final List<String> urls = ApplicationManager.getApplication().runReadAction(
|
||||
new NullableComputable<List<String>>() {
|
||||
@Override
|
||||
@@ -1056,7 +1056,7 @@ public class DocumentationManager extends DockablePopupManager<DocumentationComp
|
||||
|
||||
private String myEffectiveUrl;
|
||||
|
||||
public DefaultDocumentationCollector(PsiElement element, PsiElement originalElement) {
|
||||
private DefaultDocumentationCollector(PsiElement element, PsiElement originalElement) {
|
||||
myElement = element;
|
||||
myOriginalElement = originalElement;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
package com.jetbrains.python.documentation;
|
||||
|
||||
import com.intellij.codeInsight.documentation.DocumentationManager;
|
||||
import com.intellij.codeInsight.documentation.DocumentationManagerProtocol;
|
||||
import com.intellij.xml.util.XmlStringUtil;
|
||||
import com.jetbrains.python.psi.PyExpression;
|
||||
import com.jetbrains.python.psi.PyUtil;
|
||||
@@ -27,7 +27,7 @@ import java.util.Arrays;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
public class DocumentationBuilderKit {
|
||||
class DocumentationBuilderKit {
|
||||
static final TagWrapper TagBold = new TagWrapper("b");
|
||||
static final TagWrapper TagItalic = new TagWrapper("i");
|
||||
static final TagWrapper TagSmall = new TagWrapper("small");
|
||||
@@ -105,7 +105,7 @@ public class DocumentationBuilderKit {
|
||||
|
||||
public Iterable<String> apply(Iterable<String> contents) {
|
||||
return new ChainIterable<String>()
|
||||
.addItem("<a href=\"").addItem(DocumentationManager.PSI_ELEMENT_PROTOCOL).addItem(myLink).addItem("\">")
|
||||
.addItem("<a href=\"").addItem(DocumentationManagerProtocol.PSI_ELEMENT_PROTOCOL).addItem(myLink).addItem("\">")
|
||||
.add(contents).addItem("</a>")
|
||||
;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user