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; }
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; }
final MutableAttributeSet smileyAttr = (MutableAttributeSet) attr.copyAttributes();
final MutableAttributeSet urlAttr = (MutableAttributeSet) attr.copyAttributes();
AttributeSet as = element.getAttributes(); MutableAttributeSet asNew = new SimpleAttributeSet(as.copyAttributes()); StyleConstants.setBold(asNew, !StyleConstants.isBold(as)); doc.setCharacterAttributes(start, textPane.getSelectedText().length(), asNew, true);
AttributeSet as = element.getAttributes(); MutableAttributeSet asNew = new SimpleAttributeSet(as.copyAttributes()); StyleConstants.setBold(asNew, !StyleConstants.isBold(as)); doc.setCharacterAttributes(selectionStart,textPane.getSelectedText().length(), asNew, true);
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();
Style hlStyle = doc.getStyle("regularBlue-findtype"); // NOI18N pane.putClientProperty(PREV_HIGHLIGHT_ATTRIBUTES, as.copyAttributes()); doc.setCharacterAttributes(h.startOffset, h.endOffset - h.startOffset, hlStyle, true);