javax.swing.text.html.HTMLEditorKit.getInputAttributes()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(1.2k)|赞(0)|评价(0)|浏览(118)

本文整理了Java中javax.swing.text.html.HTMLEditorKit.getInputAttributes()方法的一些代码示例,展示了HTMLEditorKit.getInputAttributes()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HTMLEditorKit.getInputAttributes()方法的具体详情如下:
包路径:javax.swing.text.html.HTMLEditorKit
类名称:HTMLEditorKit
方法名:getInputAttributes

HTMLEditorKit.getInputAttributes介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

  1. AttributeSet attSet = ((HTMLEditorKit)jep.getEditorKit()).getInputAttributes();
  2. return StyleConstants.isBold(attSet);

代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-ui

  1. public void actionPerformed(ActionEvent e)
  2. {
  3. if(!(this.isEnabled()))
  4. {
  5. return;
  6. }
  7. JEditorPane editor = getEditor(e);
  8. if(editor != null)
  9. {
  10. String stylename = (String)(parent.getSelectedItem());
  11. if(stylename == null)
  12. {
  13. return;
  14. }
  15. else if(stylename.equals(Translatrix.getTranslationString("NoCSSStyle")))
  16. {
  17. return;
  18. }
  19. boolean replace = false;
  20. MutableAttributeSet attr = null;
  21. SimpleAttributeSet cls = new SimpleAttributeSet();
  22. cls.addAttribute(HTML.Attribute.CLASS, stylename);
  23. attr = new SimpleAttributeSet();
  24. attr.addAttribute(HTML.Tag.FONT, cls);
  25. MutableAttributeSet inattr = ((HTMLEditorKit)(editor.getEditorKitForContentType("text/html"))).getInputAttributes();
  26. inattr.addAttributes(attr);
  27. setCharacterAttributes(editor, attr, replace);
  28. }
  29. }
  30. }

相关文章