/** * Returns an enumeration of all keys maped to attribute values values. * * @return an Enumeration over attribute keys */ public Enumeration getClientPropertyKeysEnumeration() { if (clientProperties == null) { return PUtil.NULL_ENUMERATION; } else { return clientProperties.getAttributeNames(); } }
public String getLocalName(int index) { Enumeration e = swingset.getAttributeNames(); int ix = 0; while (e.hasMoreElements()) { Object object = e.nextElement(); if (ix == index) { return object.toString(); } } return null; }
public int getIndex(String qName) { Enumeration e = swingset.getAttributeNames(); int ix = 0; while (e.hasMoreElements()) { String name = (String)e.nextElement(); if (name.equalsIgnoreCase(qName)) { return ix; } } return -1; }
public String getLocalName(int index) { Enumeration e = swingset.getAttributeNames(); int ix = 0; while (e.hasMoreElements()) { Object object = e.nextElement(); if (ix == index) { return object.toString(); } } return null; }
public int getIndex(String qName) { Enumeration e = swingset.getAttributeNames(); int ix = 0; while (e.hasMoreElements()) { String name = (String)e.nextElement(); if (name.equalsIgnoreCase(qName)) { return ix; } } return -1; }
class Page extends HTMLEditorKit.ParserCallback { public void handleStartTag(HTML.Tag t, MutableAttributeSet a, int pos) { if (t == HTML.Tag.A) { String link = null; Enumeration<?> attributeNames = a.getAttributeNames(); if (attributeNames.nextElement().equals(HTML.Attribute.HREF)) link = a.getAttribute(HTML.Attribute.HREF).toString(); //save link some where } } }
public String getValue(int index) { Enumeration e = swingset.getAttributeNames(); int ix = 0; while (e.hasMoreElements()) { Object object = e.nextElement(); if (ix == index) { return (String)swingset.getAttribute(object); } } return null; }
public String getValue(int index) { Enumeration e = swingset.getAttributeNames(); int ix = 0; while (e.hasMoreElements()) { Object object = e.nextElement(); if (ix == index) { return (String)swingset.getAttribute(object); } } return null; }
private void storeAttributes(MutableAttributeSet set) { attributes.push(new HashMap<java.lang.String,IValue>()); for (Enumeration<?> names = set.getAttributeNames(); names.hasMoreElements(); ) { Object label = names.nextElement(); Object value = set.getAttribute(label); attributes.peek().put(label.toString(), factory.string(value.toString())); } }
/** * Simple conversion method. * @param attributeSet * @return Sax CDATA Attributes from the Swing MutableAttributeSet */ private Attributes convertToSaxAttributes( MutableAttributeSet attributeSet) { Object attrName, attrValue; attributes.clear(); for(Enumeration en = attributeSet.getAttributeNames(); en.hasMoreElements(); ) { attrName = en.nextElement(); attrValue = attributeSet.getAttribute(attrName); attributes.addAttribute("", "", attrName.toString(), "CDATA", attrValue.toString()); } return attributes; }
/** * Simple conversion method. * @param attributeSet * @return Sax CDATA Attributes from the Swing MutableAttributeSet */ private Attributes convertToSaxAttributes( MutableAttributeSet attributeSet) { Object attrName, attrValue; attributes.clear(); for(Enumeration en = attributeSet.getAttributeNames(); en.hasMoreElements(); ) { attrName = en.nextElement(); attrValue = attributeSet.getAttribute(attrName); attributes.addAttribute("", "", attrName.toString(), "CDATA", attrValue.toString()); } return attributes; }
@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) + "\""); } } }
protected void handleTag(HTML.Tag t, MutableAttributeSet a, int pPos) { final String mName = "URLChecker.handleTag"; logger.finest(mName, "->", new Object[]{t, a, Integer.toString(pPos)}); String tagName = t.toString().toLowerCase(); for (Enumeration en = a.getAttributeNames(); en.hasMoreElements(); ) { Object attributeNameObj = en.nextElement(); String attributeName = attributeNameObj.toString().toLowerCase(); Object o = a.getAttribute(attributeNameObj); if (o instanceof String) { String attributeValue = (String) o; if (tagName.equals("a")) { if (attributeName.equals("href")) { addLink(tagName, attributeName, attributeValue, pPos, false); } else if (attributeName.equals("name")) { url.addAnchor(attributeValue); } } else if (tagName.equals("img")) { if (attributeName.equals("src")) { addLink(tagName, attributeName, attributeValue, pPos, true); } } } else if (o instanceof Boolean) { // Ignore this } else { handleWarning(url.url, pPos, "Unknown attribute type: " + (o == null ? "null" : o.getClass().getName())); } } logger.finest(mName, "<-"); } public void handleSimpleTag(HTML.Tag t, MutableAttributeSet a, int pPos) {
/** {@inheritDoc} */ protected void writeStartTag( Tag t, MutableAttributeSet att, boolean isSimpleTag ) { if ( this.tableCaptionXMLWriterStack.isEmpty() ) { super.writeStartTag ( t, att, isSimpleTag ); } else { String tag = ( getNameSpace() != null ? getNameSpace() + ":" : "" ) + t.toString(); this.tableCaptionXMLWriterStack.getLast().startElement( tag ); if ( att != null ) { Enumeration<?> names = att.getAttributeNames(); while ( names.hasMoreElements() ) { Object key = names.nextElement(); Object value = att.getAttribute( key ); this.tableCaptionXMLWriterStack.getLast().addAttribute( key.toString(), value.toString() ); } } if ( isSimpleTag ) { this.tableCaptionXMLWriterStack.getLast().endElement(); } } }
@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) + "\""); } } }
private void appendTagToResult(HTML.Tag tag, MutableAttributeSet attrs) { convertURLS(tag, attrs); Enumeration e = attrs.getAttributeNames(); addToResult("<").addToResult(tag); while (e.hasMoreElements()) { Object attr = e.nextElement(); String value = attrs.getAttribute(attr).toString(); addToResult(" ").addToResult(attr).addToResult("=\""). addToResult(value).addToResult("\""); } if (simpleTag) addToResult("/>"); else addToResult(">"); }
private void appendTagToResult(HTML.Tag tag, MutableAttributeSet attrs) { convertURLS(tag, attrs); Enumeration e = attrs.getAttributeNames(); addToResult("<").addToResult(tag); while (e.hasMoreElements()) { Object attr = e.nextElement(); String value = attrs.getAttribute(attr).toString(); addToResult(" ").addToResult(attr).addToResult("=\""). addToResult(value).addToResult("\""); } if (simpleTag) addToResult("/>"); else addToResult(">"); }
changes.addEdit(new AttributeUndoableEdit(e, sCopy, false)); MutableAttributeSet attr = (MutableAttributeSet) e.getAttributes(); Enumeration aNames = attr.getAttributeNames(); Object value; Object aName;