mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-26 19:06:24 +07:00
get font from base label
#IDEA-88300 fixed
This commit is contained in:
@@ -27,10 +27,12 @@ import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.wm.ToolWindow;
|
||||
import com.intellij.openapi.wm.ToolWindowAnchor;
|
||||
import com.intellij.openapi.wm.ToolWindowManager;
|
||||
import com.intellij.openapi.wm.impl.content.BaseLabel;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.refactoring.util.RefactoringDescriptionLocation;
|
||||
import com.intellij.ui.content.Content;
|
||||
import com.intellij.ui.content.ContentManager;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
@@ -118,7 +120,7 @@ public class SliceManager implements PersistentStateComponent<SliceManager.Store
|
||||
public void slice(@NotNull PsiElement element, boolean dataFlowToThis, SliceHandler handler) {
|
||||
String dialogTitle = getElementDescription((dataFlowToThis ? BACK_TOOLWINDOW_ID : FORTH_TOOLWINDOW_ID) + " ", element, null);
|
||||
|
||||
dialogTitle = Pattern.compile("<[^<>]*>").matcher(dialogTitle).replaceAll("");
|
||||
dialogTitle = Pattern.compile("(<style>.*</style>)|<[^<>]*>").matcher(dialogTitle).replaceAll("");
|
||||
SliceAnalysisParams params = handler.askForParams(element, dataFlowToThis, myStoredSettings, dialogTitle);
|
||||
if (params == null) return;
|
||||
|
||||
@@ -172,7 +174,9 @@ public class SliceManager implements PersistentStateComponent<SliceManager.Store
|
||||
if (element instanceof PsiReferenceExpression) elementToSlice = ((PsiReferenceExpression)element).resolve();
|
||||
if (elementToSlice == null) elementToSlice = element;
|
||||
String desc = ElementDescriptionUtil.getElementDescription(elementToSlice, RefactoringDescriptionLocation.WITHOUT_PARENT);
|
||||
return "<html>"+ (prefix == null ? "" : prefix) + StringUtil.first(desc, 100, true)+(suffix == null ? "" : suffix) + "</html>";
|
||||
return "<html><head>" + UIUtil.getCssFontDeclaration(BaseLabel.getLabelFont()) + "</head><body>" +
|
||||
(prefix == null ? "" : prefix) + StringUtil.first(desc, 100, true)+(suffix == null ? "" : suffix) +
|
||||
"</body></html>";
|
||||
}
|
||||
|
||||
public static SliceUsage createRootUsage(@NotNull PsiElement element, @NotNull SliceAnalysisParams params) {
|
||||
|
||||
Reference in New Issue
Block a user