本文整理匯總了Java中com.intellij.util.ui.UIUtil.getCssFontDeclaration方法的典型用法代碼示例。如果您正苦於以下問題:Java UIUtil.getCssFontDeclaration方法的具體用法?Java UIUtil.getCssFontDeclaration怎麽用?Java UIUtil.getCssFontDeclaration使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.intellij.util.ui.UIUtil
的用法示例。
在下文中一共展示了UIUtil.getCssFontDeclaration方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: showErrors
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
private void showErrors(@NotNull java.util.List<ValidationInfo> errors) {
java.util.List<String> errorHtmlDescriptions = ContainerUtil.map(errors, ValidationInfo::getErrorHtmlDescription);
String styleTag = UIUtil.getCssFontDeclaration(UIUtil.getLabelFont());
String html = "<html>" + styleTag + "<body><div style='padding-left:4px;'>" + StringUtil.join(errorHtmlDescriptions, "<div style='padding-top:2px;'/>") + "</div></body></html>";
for (ValidationInfo error : errors) {
String linkText = error.getLinkText();
final JTextComponent component = error.getTextComponent();
if (linkText != null && component != null) {
this.addLinkHandler(linkText, component::requestFocus);
}
}
this.showError(html, null, null);
}
示例2: getElementDescription
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
public static String getElementDescription(String prefix, PsiElement element, String suffix) {
SliceLanguageSupportProvider provider = LanguageSlicing.getProvider(element);
if(provider != null){
element = provider.getElementForDescription(element);
}
String desc = ElementDescriptionUtil.getElementDescription(element, RefactoringDescriptionLocation.WITHOUT_PARENT);
return "<html><head>" + UIUtil.getCssFontDeclaration(BaseLabel.getLabelFont()) + "</head><body>" +
(prefix == null ? "" : prefix) + StringUtil.first(desc, 100, true)+(suffix == null ? "" : suffix) +
"</body></html>";
}
示例3: createMessage
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
private static String createMessage(VcsRevisionDescription description, final VirtualFile vf) {
return "<html><head>" + UIUtil.getCssFontDeclaration(UIUtil.getLabelFont()) + "</head><body>" +
VcsBundle.message("current.version.text", description.getAuthor(),
DateFormatUtil.formatPrettyDateTime(description.getRevisionDate()), description.getCommitMessage(),
description.getRevisionNumber().asString(), vf.getName()) + "</body></html>";
}
示例4: formatTextIntoHtml
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
public static String formatTextIntoHtml(final Project project, final String c) {
return "<html><head>" + UIUtil.getCssFontDeclaration(UIUtil.getLabelFont()) + "</head><body>" +
formatTextWithLinks(project, c) + "</body></html>";
}