mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-15 11:53:49 +07:00
[ui] IJPL-148514 Alt+Click copy html tags from popup
(cherry picked from commit e134e1ba189884d280d1243bd3432189bf3fb9b6) IJ-CR-157859 GitOrigin-RevId: d229d811b756a16a005d537bd3d38e60f10aaf7b
This commit is contained in:
committed by
intellij-monorepo-bot
parent
f7f0e69ecc
commit
826155474b
@@ -562,12 +562,12 @@ public final class UIUtil {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Computes the minimum size the component must have to keep the given number of characters
|
* Computes the minimum size the component must have to keep the given number of characters
|
||||||
*
|
* <p>
|
||||||
* Same as {@code computeTextComponentMinimumSize(preferredSize, text, fontMetrics, 4)}.
|
* Same as {@code computeTextComponentMinimumSize(preferredSize, text, fontMetrics, 4)}.
|
||||||
*
|
*
|
||||||
* @param preferredSize the size of the component needed to keep everything, usually computed by {@link Component#getPreferredSize()}
|
* @param preferredSize the size of the component needed to keep everything, usually computed by {@link Component#getPreferredSize()}
|
||||||
* @param text the currently set text
|
* @param text the currently set text
|
||||||
* @param fontMetrics the current font metrics
|
* @param fontMetrics the current font metrics
|
||||||
* @return the minimum size the component has to have to keep the given number of characters
|
* @return the minimum size the component has to have to keep the given number of characters
|
||||||
*/
|
*/
|
||||||
public static int computeTextComponentMinimumSize(
|
public static int computeTextComponentMinimumSize(
|
||||||
@@ -581,18 +581,19 @@ public final class UIUtil {
|
|||||||
/**
|
/**
|
||||||
* Computes the minimum size the component must have to keep the given number of characters
|
* Computes the minimum size the component must have to keep the given number of characters
|
||||||
* <p>
|
* <p>
|
||||||
* Intended to be used for simple {@code JLabel}-like text components.
|
* Intended to be used for simple {@code JLabel}-like text components.
|
||||||
* Often they provide the preferred size, but not the minimum size.
|
* Often they provide the preferred size, but not the minimum size.
|
||||||
* This function can be used to roughly compute the minimum size based on the preferred one.
|
* This function can be used to roughly compute the minimum size based on the preferred one.
|
||||||
* The returned size will be reduced by the difference between the full text width and
|
* The returned size will be reduced by the difference between the full text width and
|
||||||
* the width of the text contracted to just the {@code nCharactersToKeep} first characters plus {@code "..."}
|
* the width of the text contracted to just the {@code nCharactersToKeep} first characters plus {@code "..."}
|
||||||
* that's usually added by such components when the text doesn't fit.
|
* that's usually added by such components when the text doesn't fit.
|
||||||
* </p>
|
* </p>
|
||||||
* <p>
|
* <p>
|
||||||
* Note that, due to various factors, the result may be off by a few pixels which is enough to gain or lose an extra character.
|
* Note that, due to various factors, the result may be off by a few pixels which is enough to gain or lose an extra character.
|
||||||
* Because of fractional font metrics, fractional scaling, complicated calculations, rounding errors and other such things
|
* Because of fractional font metrics, fractional scaling, complicated calculations, rounding errors and other such things
|
||||||
* it's hard to make strict guarantees here.
|
* it's hard to make strict guarantees here.
|
||||||
* </p>
|
* </p>
|
||||||
|
*
|
||||||
* @param preferredSize the size of the component needed to keep everything, usually computed by {@link Component#getPreferredSize()}
|
* @param preferredSize the size of the component needed to keep everything, usually computed by {@link Component#getPreferredSize()}
|
||||||
* @param text the currently set text
|
* @param text the currently set text
|
||||||
* @param fontMetrics the current font metrics
|
* @param fontMetrics the current font metrics
|
||||||
@@ -2610,7 +2611,7 @@ public final class UIUtil {
|
|||||||
if (!builder.isEmpty()) {
|
if (!builder.isEmpty()) {
|
||||||
builder.append(' ');
|
builder.append(' ');
|
||||||
}
|
}
|
||||||
builder.append(StringUtil.removeHtmlTags(candidate).trim());
|
builder.append(StringUtil.removeHtmlTags(candidate, true).trim());
|
||||||
}
|
}
|
||||||
if (component instanceof Container) {
|
if (component instanceof Container) {
|
||||||
Component[] components = ((Container)component).getComponents();
|
Component[] components = ((Container)component).getComponents();
|
||||||
|
|||||||
Reference in New Issue
Block a user