to.removeAttributes(to); if (from != null)
@Override protected void writeAttributes(AttributeSet attr) throws IOException { convAttr.removeAttributes(convAttr); convertToHTML(attr, convAttr); Enumeration names = convAttr.getAttributeNames(); while (names.hasMoreElements()) { Object name = names.nextElement(); if (name instanceof HTML.Tag || name instanceof StyleConstants || name == HTML.Attribute.ENDTAG) continue; write(" " + name + "=\"" + convAttr.getAttribute(name) + "\""); } } }
/** 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(); } }
@Override protected void writeAttributes(final AttributeSet attr) throws IOException { if (attr instanceof Element) { final Element elem = (Element) attr; if (elem.isLeaf() || elem.getName().equalsIgnoreCase("p-implied")) { super.writeAttributes(attr); return; } } convAttr.removeAttributes(convAttr); FixedHTMLWriter.convertToHTML(attr, convAttr); final Enumeration<?> names = convAttr.getAttributeNames(); while (names.hasMoreElements()) { final Object name = names.nextElement(); if (name instanceof HTML.Tag || name instanceof StyleConstants || name == HTML.Attribute.ENDTAG) { continue; } write(" " + name + "=\"" + convAttr.getAttribute(name) + "\""); } } }
k.getInputAttributes().removeAttributes(set);
to.removeAttributes(to); if (from != null) protected void writeAttributes(AttributeSet attr) throws IOException convAttr.removeAttributes(convAttr); convertToHTML(attr, convAttr); Enumeration names = convAttr.getAttributeNames();
/** * 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 ); }
Style style = getStyle(name); changes.addEdit(new AttributeUndoableEdit(run, style, true)); attr.removeAttributes(attr); attr.addAttributes(style);