javax.swing.text.StyledDocument.removeStyle()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(3.2k)|赞(0)|评价(0)|浏览(208)

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

StyledDocument.removeStyle介绍

暂无

代码示例

代码示例来源:origin: org.codehaus.jtstand/jtstand-desktop

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public void removeStyle(String nm) {
  5. ((StyledDocument) delegate).removeStyle(nm);
  6. }

代码示例来源:origin: tmyroadctfig/swingx

  1. /**
  2. * {@inheritDoc}
  3. */
  4. @Override
  5. public void removeStyle(String nm) {
  6. ((StyledDocument) delegate).removeStyle(nm);
  7. }

代码示例来源:origin: org.swinglabs.swingx/swingx-all

  1. /**
  2. * {@inheritDoc}
  3. */
  4. @Override
  5. public void removeStyle(String nm) {
  6. ((StyledDocument) delegate).removeStyle(nm);
  7. }

代码示例来源:origin: net.sf.jt400/jt400

  1. /**
  2. Removes a style from the logical style hierarchy.
  3. @param name The name of the style.
  4. **/
  5. public synchronized void removeStyle (String name)
  6. {
  7. document_.removeStyle (name);
  8. }

代码示例来源:origin: org.netbeans.api/org-openide-text

  1. public void removeStyle(String nm) {
  2. ((StyledDocument) original).removeStyle(nm);
  3. }

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

  1. public void removeStyle(String nm) {
  2. ((StyledDocument)original).removeStyle (nm);
  3. }

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

  1. public void removeStyle(String nm) {
  2. ((StyledDocument)original).removeStyle (nm);
  3. }

代码示例来源:origin: bbuck/DragonConsole

  1. /**
  2. * This method will remove any and all Styles in the StyledDocument that
  3. * contain it as a foreground or background.
  4. * @param documentToUpdate The document the color should be removed from.
  5. * @param remove The Color that need to be removed.
  6. * @param colors The list of Colors that have been added to the StyledDocument.
  7. * @return The StyledDocument after the colors have been removed.
  8. */
  9. public static StyledDocument removeColor(StyledDocument documentToUpdate,
  10. TextColor remove, ArrayList<TextColor> colors) {
  11. // Remove this here since this will be called after it's been removed from the list
  12. documentToUpdate.removeStyle("" + remove.getCharCode() + remove.getCharCode());
  13. for (int i = 0; i < colors.size(); i++) {
  14. TextColor temp = colors.get(i);
  15. String s1 = "" + temp.getCharCode() + remove.getCharCode();
  16. String s2 = "" + remove.getCharCode() + temp.getCharCode();
  17. documentToUpdate.removeStyle(s1);
  18. documentToUpdate.removeStyle(s2);
  19. }
  20. return documentToUpdate;
  21. }
  22. }

代码示例来源:origin: org.integratedmodelling/klab-common

  1. /**
  2. * This method will remove any and all Styles in the StyledDocument that
  3. * contain it as a foreground or background.
  4. * @param documentToUpdate The document the color should be removed from.
  5. * @param remove The Color that need to be removed.
  6. * @param colors The list of Colors that have been added to the StyledDocument.
  7. * @return The StyledDocument after the colors have been removed.
  8. */
  9. public static StyledDocument removeColor(StyledDocument documentToUpdate,
  10. TextColor remove, ArrayList<TextColor> colors) {
  11. // Remove this here since this will be called after it's been removed from the list
  12. documentToUpdate.removeStyle("" + remove.getCharCode() + remove.getCharCode());
  13. for (int i = 0; i < colors.size(); i++) {
  14. TextColor temp = colors.get(i);
  15. String s1 = "" + temp.getCharCode() + remove.getCharCode();
  16. String s2 = "" + remove.getCharCode() + temp.getCharCode();
  17. documentToUpdate.removeStyle(s1);
  18. documentToUpdate.removeStyle(s2);
  19. }
  20. return documentToUpdate;
  21. }
  22. }

相关文章