mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-05 01:50:56 +07:00
revert: "[ui][IDEA-334229] quick doc popup redesign"
496c8d97 GitOrigin-RevId: d32086158d641347b96d61e7cec3de70f0a4e94b
This commit is contained in:
committed by
intellij-monorepo-bot
parent
0b846f9e75
commit
2a752d605e
@@ -26,4 +26,4 @@
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div><div class="separator-container"><div class="separator"/></div><icon src="AllIcons.Nodes.PpLibFolder"/> myLib<div class="bottom"><a href="placeholder">`genericMethod(Class<?>)` on localhost<icon src='AllIcons.Ide.External_link_arrow'></a></div>
|
||||
</div><div class="bottom"><icon src="AllIcons.Nodes.PpLibFolder"/> myLib</div><div class="bottom"><a href="placeholder">`genericMethod(Class<?>)` on localhost<icon src='AllIcons.Ide.External_link_arrow'></a></div>
|
||||
@@ -19,4 +19,4 @@
|
||||
<div class="block"><a href="psi_element://com.jetbrains.LinkBetweenMethods#m2()"><code>m2()</code></a></div>
|
||||
</li>
|
||||
</ul>
|
||||
</div><div class="separator-container"><div class="separator"/></div><icon src="AllIcons.Nodes.PpLibFolder"/> myLib<div class="bottom"><a href="placeholder">`m1()` on localhost<icon src='AllIcons.Ide.External_link_arrow'></a></div>
|
||||
</div><div class="bottom"><icon src="AllIcons.Nodes.PpLibFolder"/> myLib</div><div class="bottom"><a href="placeholder">`m1()` on localhost<icon src='AllIcons.Ide.External_link_arrow'></a></div>
|
||||
@@ -24,4 +24,4 @@
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div><div class="separator-container"><div class="separator"/></div><icon src="AllIcons.Nodes.PpLibFolder"/> myLib<div class="bottom"><a href="placeholder">`SimpleInterface` on localhost<icon src='AllIcons.Ide.External_link_arrow'></a></div>
|
||||
</div><div class="bottom"><icon src="AllIcons.Nodes.PpLibFolder"/> myLib</div><div class="bottom"><a href="placeholder">`SimpleInterface` on localhost<icon src='AllIcons.Ide.External_link_arrow'></a></div>
|
||||
@@ -32,4 +32,4 @@ extends java.lang.Object</pre>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div><div class="separator-container"><div class="separator"/></div><icon src="AllIcons.Nodes.PpLibFolder"/> myLib<div class="bottom"><a href="placeholder">`ClassWithRefLink` on localhost<icon src='AllIcons.Ide.External_link_arrow'></a></div>
|
||||
</div><div class="bottom"><icon src="AllIcons.Nodes.PpLibFolder"/> myLib</div><div class="bottom"><a href="placeholder">`ClassWithRefLink` on localhost<icon src='AllIcons.Ide.External_link_arrow'></a></div>
|
||||
@@ -26,4 +26,4 @@
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div><div class="separator-container"><div class="separator"/></div><icon src="AllIcons.Nodes.PpLibFolder"/> myLib<div class="bottom"><a href="placeholder">`param()` on localhost<icon src='AllIcons.Ide.External_link_arrow'></a></div>
|
||||
</div><div class="bottom"><icon src="AllIcons.Nodes.PpLibFolder"/> myLib</div><div class="bottom"><a href="placeholder">`param()` on localhost<icon src='AllIcons.Ide.External_link_arrow'></a></div>
|
||||
@@ -5,4 +5,4 @@
|
||||
at least one element <tt>e</tt> such that
|
||||
<tt>(o==null ? e==null : o.equals(e))</tt>.
|
||||
|
||||
</div><table class='sections'><tr><td valign='top' class='section'><p>Overrides:</td><td valign='top'><p><a href="psi_element://java.util.Collection#contains(java.lang.Object)"><code><span style="color:#000000;">contains</span></code></a> in interface <a href="psi_element://java.util.Collection"><code><span style="color:#000000;">Collection</span></code></a></td><tr><td valign='top' class='section'><p>Params:</td><td valign='top'><code><span style="color:#000000;">o</span></code> – element whose presence in this list is to be tested </td><tr><td valign='top' class='section'><p>Returns:</td><td valign='top'><p><tt>true</tt> if this list contains the specified element </td><tr><td valign='top' class='section'><p>Throws:</td><td valign='top'><p><a href="psi_element://java.lang.ClassCastException"><code><span style="color:#0000ff;">ClassCastException</span></code></a> – if the type of the specified element is incompatible with this list (<a href="psi_element://java.util.Collection###optional-restrictions">optional</a>) <p><a href="psi_element://java.lang.NullPointerException"><code><span style="color:#0000ff;">NullPointerException</span></code></a> – if the specified element is null and this list does not permit null elements (<a href="psi_element://java.util.Collection###optional-restrictions">optional</a>)</td></table><div class="separator-container"><div class="separator"/></div><icon src="AllIcons.Nodes.PpLibFolder"/> < java 1.7 >
|
||||
</div><table class='sections'><tr><td valign='top' class='section'><p>Overrides:</td><td valign='top'><p><a href="psi_element://java.util.Collection#contains(java.lang.Object)"><code><span style="color:#000000;">contains</span></code></a> in interface <a href="psi_element://java.util.Collection"><code><span style="color:#000000;">Collection</span></code></a></td><tr><td valign='top' class='section'><p>Params:</td><td valign='top'><code><span style="color:#000000;">o</span></code> – element whose presence in this list is to be tested </td><tr><td valign='top' class='section'><p>Returns:</td><td valign='top'><p><tt>true</tt> if this list contains the specified element </td><tr><td valign='top' class='section'><p>Throws:</td><td valign='top'><p><a href="psi_element://java.lang.ClassCastException"><code><span style="color:#0000ff;">ClassCastException</span></code></a> – if the type of the specified element is incompatible with this list (<a href="psi_element://java.util.Collection###optional-restrictions">optional</a>) <p><a href="psi_element://java.lang.NullPointerException"><code><span style="color:#0000ff;">NullPointerException</span></code></a> – if the specified element is null and this list does not permit null elements (<a href="psi_element://java.util.Collection###optional-restrictions">optional</a>)</td></table><div class="bottom"><icon src="AllIcons.Nodes.PpLibFolder"/> < java 1.7 ></div>
|
||||
@@ -2,4 +2,4 @@
|
||||
<span style="color:#808000;">@</span><span style="color:#808000;">NotNull</span><a href="external.annotations"><icon src="AllIcons.Ide.External_link_arrow"></a>
|
||||
<span style="color:#808000;">@</span><span style="color:#808000;">Contract</span><span style="">(</span><span style="">pure</span><span style=""> = </span><span style="color:#000080;font-weight:bold;">true</span><span style="">)</span><a href="external.annotations"><icon src="AllIcons.Ide.External_link_arrow"></a>
|
||||
<span style="color:#000080;font-weight:bold;">public</span> <a href="psi_element://java.lang.reflect.Constructor"><code><span style="color:#000000;">java.lang.reflect.Constructor</span></code></a><span style=""><</span><span style="">?</span><span style="">></span><span style="">[]</span> <span style="color:#000000;">getDeclaredConstructors</span><span style="">(</span><span style="">)</span>
|
||||
<span style="color:#000080;font-weight:bold;">throws</span> <a href="psi_element://java.lang.SecurityException"><code><span style="color:#000000;">SecurityException</span></code></a></pre></div><table class='sections'><p><tr><td valign='top' class='section'><p>Throws:</td><td valign='top'><p><a href="psi_element://java.lang.SecurityException"><code><span style="color:#0000ff;">SecurityException</span></code></a></td></table><div class="separator-container"><div class="separator"/></div><icon src="AllIcons.Nodes.PpLibFolder"/> < java 10 >
|
||||
<span style="color:#000080;font-weight:bold;">throws</span> <a href="psi_element://java.lang.SecurityException"><code><span style="color:#000000;">SecurityException</span></code></a></pre></div><table class='sections'><p><tr><td valign='top' class='section'><p>Throws:</td><td valign='top'><p><a href="psi_element://java.lang.SecurityException"><code><span style="color:#0000ff;">SecurityException</span></code></a></td></table><div class="bottom-no-content"><icon src="AllIcons.Nodes.PpLibFolder"/> < java 10 ></div>
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.java.codeInsight
|
||||
|
||||
import com.intellij.codeInsight.documentation.DocumentationManager
|
||||
@@ -326,7 +326,7 @@ class JavaDocumentationTest : LightJavaCodeInsightFixtureTestCase() {
|
||||
|
||||
// Here we check that the covering module (SDK in this case) is rendered in decorated info
|
||||
assertTrue(
|
||||
component.decoratedText.contains("<div class=\"separator-container\"><div class=\"separator\"/></div><icon src=\"AllIcons.Nodes.PpLibFolder\"/> < java 1.7 >"))
|
||||
component.decoratedText.contains("<div class=\"bottom\"><icon src=\"AllIcons.Nodes.PpLibFolder\"/> < java 1.7 ></div>"))
|
||||
return@getDocumentationText null
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,11 +68,8 @@ public final class DocumentationHtmlUtil {
|
||||
" border-bottom: thin solid " + borderColor + "; }",
|
||||
".bottom { padding: 3px 16px 0 " + leftPadding + "px; }",
|
||||
".download-documentation { padding: 0px 0px 18px; }",
|
||||
".separator-container { padding: 18px " + leftPadding + "px 0px; }",
|
||||
".separator-container .separator { border-top: thin solid " + borderColor + "; }",
|
||||
".bottom-no-content { padding: 5px 16px 0 " + leftPadding + "px; }",
|
||||
".grayed { color: #909090; display: inline;}",
|
||||
".location .spacer { padding-top: 8px }",
|
||||
|
||||
// sections table
|
||||
".sections { padding: 0 16px 0 " + leftPadding + "px; border-spacing: 0; }",
|
||||
|
||||
@@ -1904,7 +1904,8 @@ public class DocumentationManager extends DockablePopupManager<DocumentationComp
|
||||
text = StringUtil.replaceIgnoreCase(text, "</body>", "");
|
||||
text = replaceIgnoreQuotesType(text, SECTIONS_START + SECTIONS_END, "");
|
||||
text = replaceIgnoreQuotesType(text, SECTIONS_START + "<p>" + SECTIONS_END, ""); //NON-NLS
|
||||
if (!containsIgnoreQuotesType(text, CONTENT_START)) {
|
||||
boolean hasContent = containsIgnoreQuotesType(text, CONTENT_START);
|
||||
if (!hasContent) {
|
||||
if (!containsIgnoreQuotesType(text, DEFINITION_START)) {
|
||||
int bodyStart = findContentStart(text);
|
||||
if (bodyStart > 0) {
|
||||
@@ -1916,6 +1917,7 @@ public class DocumentationManager extends DockablePopupManager<DocumentationComp
|
||||
else {
|
||||
text = CONTENT_START + text + CONTENT_END;
|
||||
}
|
||||
hasContent = true;
|
||||
}
|
||||
else if (!containsIgnoreQuotesType(text, SECTIONS_START)) {
|
||||
text = replaceIgnoreQuotesType(text, DEFINITION_START, "<div class='definition-only'><pre>");
|
||||
@@ -1924,21 +1926,17 @@ public class DocumentationManager extends DockablePopupManager<DocumentationComp
|
||||
if (!containsIgnoreQuotesType(text, DEFINITION_START)) {
|
||||
text = replaceIgnoreQuotesType(text, "class='content'", "class='content-only'");
|
||||
}
|
||||
if (downloadDocumentationActionLink != null || location != null) {
|
||||
text += HtmlChunk.div().setClass("separator-container")
|
||||
.child(HtmlChunk.div().setClass("separator"));
|
||||
if (downloadDocumentationActionLink != null) {
|
||||
text += HtmlChunk.div()
|
||||
.children(
|
||||
HtmlChunk.icon("AllIcons.Plugins.Downloads", AllIcons.Plugins.Downloads),
|
||||
HtmlChunk.nbsp(),
|
||||
HtmlChunk.link(downloadDocumentationActionLink, CodeInsightBundle.message("documentation.download.button.label"))
|
||||
)
|
||||
.setClass("download-documentation");
|
||||
}
|
||||
if (location != null) {
|
||||
text += location;
|
||||
}
|
||||
if (downloadDocumentationActionLink != null) {
|
||||
text += HtmlChunk.div()
|
||||
.children(
|
||||
HtmlChunk.icon("AllIcons.Plugins.Downloads", AllIcons.Plugins.Downloads),
|
||||
HtmlChunk.nbsp(),
|
||||
HtmlChunk.link(downloadDocumentationActionLink, CodeInsightBundle.message("documentation.download.button.label"))
|
||||
)
|
||||
.setClass("download-documentation");
|
||||
}
|
||||
if (location != null) {
|
||||
text += getBottom(hasContent).child(location);
|
||||
}
|
||||
if (links != null) {
|
||||
text += getBottom(location != null).child(links);
|
||||
|
||||
@@ -24,7 +24,6 @@ import com.intellij.openapi.actionSystem.DataProvider
|
||||
import com.intellij.openapi.application.EDT
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.openapi.util.Disposer
|
||||
import com.intellij.openapi.util.NlsSafe
|
||||
import com.intellij.openapi.util.text.HtmlChunk
|
||||
import com.intellij.openapi.vfs.VirtualFileManager
|
||||
import com.intellij.platform.backend.documentation.impl.DocumentationRequest
|
||||
@@ -214,44 +213,15 @@ internal class DocumentationUI(
|
||||
return presentation.locationText?.let { locationText ->
|
||||
presentation.locationIcon?.let { locationIcon ->
|
||||
val iconKey = registerIcon(locationIcon)
|
||||
getLocationChunk(locationText, iconKey)
|
||||
HtmlChunk.fragment(
|
||||
HtmlChunk.tag("icon").attr("src", iconKey),
|
||||
HtmlChunk.nbsp(),
|
||||
HtmlChunk.text(locationText)
|
||||
)
|
||||
} ?: HtmlChunk.text(locationText)
|
||||
}
|
||||
}
|
||||
|
||||
private fun getLocationChunk(text: String, icon: String): HtmlChunk {
|
||||
val separatorIndex = text.indexOfFirst { it == ':' } + 1
|
||||
return if (separatorIndex > 0) {
|
||||
return getLocationChunkWithProviderInfo(
|
||||
text.substring(0, separatorIndex),
|
||||
text.substring(separatorIndex),
|
||||
icon
|
||||
)
|
||||
}
|
||||
else {
|
||||
getLocationChunkWithoutProviderInfo(text, icon)
|
||||
}
|
||||
}
|
||||
|
||||
private fun getLocationChunkWithProviderInfo(provider: @NlsSafe String, @NlsSafe location: String, icon: String) = HtmlChunk.div()
|
||||
.setClass("location")
|
||||
.children(
|
||||
HtmlChunk.tag("icon").attr("src", icon),
|
||||
HtmlChunk.nbsp(),
|
||||
HtmlChunk.text(provider),
|
||||
HtmlChunk.div().setClass("spacer"),
|
||||
HtmlChunk.text(location)
|
||||
)
|
||||
|
||||
private fun getLocationChunkWithoutProviderInfo(text: @NlsSafe String, icon: String) = HtmlChunk
|
||||
.div()
|
||||
.setClass("location")
|
||||
.children(
|
||||
HtmlChunk.tag("icon").attr("src", icon),
|
||||
HtmlChunk.nbsp(),
|
||||
HtmlChunk.text(text)
|
||||
)
|
||||
|
||||
private fun registerIcon(icon: Icon): String {
|
||||
val key = icons.size.toString()
|
||||
icons[key] = icon
|
||||
|
||||
Reference in New Issue
Block a user