MutableAttributeSet inputAttr = textPane.getInputAttributes(); inputAttr.addAttributes(red);
void createInputAttributes(Element element, MutableAttributeSet set) { set.addAttributes(attrs(false, false, false, false)); }
/** OK */ public final void bulkApplyStyleToMarkableHandle(int characterPosition, AttributeSet s, boolean replace) { Element run = null; MutableAttributeSet attr = null; run = getCharacterElement(characterPosition); attr = (MutableAttributeSet) run.getAttributes(); if (replace) attr.removeAttributes(attr); attr.addAttributes(s); }
/** OK */ public final void bulkApplyStyleToDiscourseElement(int discourseElementStartPosition, AttributeSet s, boolean replace) { try { Element run = null; MutableAttributeSet attr = null; run = getCharacterElement(discourseElementStartPosition); try { attr = (MutableAttributeSet) run.getAttributes(); if (replace) attr.removeAttributes(attr); attr.addAttributes(s); } catch (java.lang.Error ex) { ex.printStackTrace(); } }// try catch (java.lang.Exception ex) { ex.printStackTrace(); } }
textPane2.getCaret().setDot(textPane2.getText().length()); MutableAttributeSet inputAttributes = textPane2.getInputAttributes(); inputAttributes.addAttributes(set);
for ( int i = muxList.size() - 1; i >= 0; i-- ) { final AttributeSet o = muxList.get( i ); retval.addAttributes( o );
cellAtts.addAttributes( config.getAttributeSet( "table.body.cell.grid" ) );
/** {@inheritDoc} */ public void figureGraphics( String src, SinkEventAttributes attributes ) { MutableAttributeSet atts = config.getAttributeSet( "figure.graphics" ); atts.addAttribute( Attribute.SRC.toString(), src ); // http://xmlgraphics.apache.org/fop/graphics.html#resolution final String[] valids = new String[] {"content-height", "content-width", "height", "width"}; final MutableAttributeSet filtered = SinkUtils.filterAttributes( attributes, valids ); if ( filtered != null ) { atts.addAttributes( filtered ); } writeln( "<fo:external-graphic" + SinkUtils.getAttributeString( atts ) + "/>" ); }
public void actionPerformed(ActionEvent e) { if(!(this.isEnabled())) { return; } JEditorPane editor = getEditor(e); if(editor != null) { String stylename = (String)(parent.getSelectedItem()); if(stylename == null) { return; } else if(stylename.equals(Translatrix.getTranslationString("NoCSSStyle"))) { return; } boolean replace = false; MutableAttributeSet attr = null; SimpleAttributeSet cls = new SimpleAttributeSet(); cls.addAttribute(HTML.Attribute.CLASS, stylename); attr = new SimpleAttributeSet(); attr.addAttribute(HTML.Tag.FONT, cls); MutableAttributeSet inattr = ((HTMLEditorKit)(editor.getEditorKitForContentType("text/html"))).getInputAttributes(); inattr.addAttributes(attr); setCharacterAttributes(editor, attr, replace); } } }
attr.addAttributes(a); changes.end(); fireChangedUpdate(changes);
/** * The default align is <code>center</code>. * * {@inheritDoc} * @see javax.swing.text.html.HTML.Tag#TABLE */ public void tableRows( int[] justification, boolean grid ) { // similar to super.tableRows( justification, grid ) but without class. this.tableRows = true; setCellJustif( justification ); if ( this.tableAttributes == null ) { this.tableAttributes = new SinkEventAttributeSet( 0 ); } MutableAttributeSet att = new SinkEventAttributeSet(); if ( !tableAttributes.isDefined( Attribute.BORDER.toString() ) ) { att.addAttribute( Attribute.BORDER, ( grid ? "1" : "0" ) ); } att.addAttributes( tableAttributes ); tableAttributes.removeAttributes( tableAttributes ); writeStartTag( TABLE, att ); }
atts.addAttributes( attributes );
changes.addEdit(new AttributeUndoableEdit(run, style, true)); attr.removeAttributes(attr); attr.addAttributes(style);