本文整理了Java中javax.swing.text.AttributeSet.copyAttributes()
方法的一些代码示例,展示了AttributeSet.copyAttributes()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AttributeSet.copyAttributes()
方法的具体详情如下:
包路径:javax.swing.text.AttributeSet
类名称:AttributeSet
方法名:copyAttributes
暂无
代码示例来源:origin: org.gosu-lang.gosu/gosu-editor
private Collection<? extends ElementSpec> _getElementsForString( String str, AttributeSet a )
{
a = a.copyAttributes();
char[] chars = str.toCharArray();
List<ElementSpec> ret = new ArrayList<ElementSpec>();
ret.add( new ElementSpec( a, ElementSpec.ContentType, chars, 0, str.length() ) );
return ret;
}
代码示例来源:origin: org.gosu-lang.gosu/gosu-lab
private Collection<? extends ElementSpec> _getElementsForString( String str, AttributeSet a )
{
a = a.copyAttributes();
char[] chars = str.toCharArray();
List<ElementSpec> ret = new ArrayList<>();
if( !handleStackTraceLink( str, ret, a ) &&
!handleTestResults( str, ret, a ) )
{
ret.add( new ElementSpec( a, ElementSpec.ContentType, chars, 0, str.length() ) );
}
return ret;
}
代码示例来源:origin: blurpy/kouchat
final MutableAttributeSet smileyAttr = (MutableAttributeSet) attr.copyAttributes();
代码示例来源:origin: blurpy/kouchat
final MutableAttributeSet urlAttr = (MutableAttributeSet) attr.copyAttributes();
代码示例来源:origin: stackoverflow.com
AttributeSet as = element.getAttributes();
MutableAttributeSet asNew = new SimpleAttributeSet(as.copyAttributes());
StyleConstants.setBold(asNew, !StyleConstants.isBold(as));
doc.setCharacterAttributes(start, textPane.getSelectedText().length(), asNew, true);
代码示例来源:origin: stackoverflow.com
AttributeSet as = element.getAttributes();
MutableAttributeSet asNew = new SimpleAttributeSet(as.copyAttributes());
StyleConstants.setBold(asNew, !StyleConstants.isBold(as));
doc.setCharacterAttributes(selectionStart,textPane.getSelectedText().length(), asNew, true);
代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-ui
DefaultDocumentEvent changes = new DefaultDocumentEvent(start, e.getEndOffset() - start,
DocumentEvent.EventType.CHANGE);
AttributeSet sCopy = a.copyAttributes();
changes.addEdit(new AttributeUndoableEdit(e, sCopy, false));
MutableAttributeSet attr = (MutableAttributeSet) e.getAttributes();
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-team-commons
Style hlStyle = doc.getStyle("regularBlue-findtype"); // NOI18N
pane.putClientProperty(PREV_HIGHLIGHT_ATTRIBUTES, as.copyAttributes());
doc.setCharacterAttributes(h.startOffset, h.endOffset - h.startOffset, hlStyle, true);
内容来源于网络,如有侵权,请联系作者删除!