@Override public void handleStartTag(Tag t, MutableAttributeSet a, int pos) { if (Tag.DIV.equals(t)) { String id = (String) a.getAttribute(HTML.Attribute.ID); String clazz = (String) a.getAttribute(HTML.Attribute.CLASS); ...
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 } } }
@Override public void handleStartTag(HTML.Tag tag, MutableAttributeSet mutableAttributeSet, int pos) { // parses the HTML document until a <a> or <area> tag is found if (tag == HTML.Tag.A || tag == HTML.Tag.AREA) { // reading the href attribute of the tag String address = (String) mutableAttributeSet .getAttribute(Attribute.HREF); /* ... */
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; }
/** * @see javax.swing.text.html.HTMLEditorKit.ParserCallback#handleStartTag(javax.swing.text.html.HTML.Tag, * javax.swing.text.MutableAttributeSet, int) */ @Override public void handleStartTag(Tag tag, MutableAttributeSet attrSet, int pos) { if (tag == HTML.Tag.A) { String name = (String) attrSet.getAttribute(HTML.Attribute.HREF); addComponents(name); } } }
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; }
@Override public void handleStartTag(HTML.Tag tag, MutableAttributeSet attribute, int pos) { if (tag == HTML.Tag.IMG) { String address = (String) attribute.getAttribute(HTML.Attribute.SRC); list.add(address); } }
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())); } }
@Override public void handleSimpleTag(HTML.Tag t, MutableAttributeSet a, final int pos) { if (t == HTML.Tag.IMG) { String address = (String) a.getAttribute(HTML.Attribute.SRC); list.add(address); } }
/** * Handles meta tags. * * @param attributes * the attributes for the tag. */ void handleMetaTag(MutableAttributeSet attributes) { Object name = attributes.getAttribute(HTML.Attribute.NAME); Object content = attributes.getAttribute(HTML.Attribute.CONTENT); if (name != null && content != null) { HTMLPane.this.handleMetaTag(name.toString(), content.toString()); } }
/** * Handle Anchor <A HREF="~"> tags */ public void handleAnchor(MutableAttributeSet attribs) { String href = new String(); href = (String) attribs.getAttribute(HTML.Attribute.HREF); if (href == null) return; links.add(href); state = HREF; } /**
public void handleStartTag(HTML.Tag t, MutableAttributeSet a, int pos) { if (t == HTML.Tag.A) { Object link = a.getAttribute(HTML.Attribute.HREF); if (link != null) { result.add(String.valueOf(link)); } } } }, true);
@Override public void handleStartTag(Tag tag, MutableAttributeSet attributes, int pos) { if (Tag.A.equals(tag)) { String href = (String) attributes.getAttribute(HTML.Attribute.HREF); hrefList.add(href); tagPositions.add(pos); } }; }
@Override public void handleStartTag(Tag tag, MutableAttributeSet attributes, int pos) { if (Tag.A.equals(tag)) { String href = (String) attributes.getAttribute(HTML.Attribute.HREF); hrefList.add(href); tagPositions.add(pos); } }; }
@Override public void start(final HTML.Tag t, final MutableAttributeSet a) { final String type = (String) a.getAttribute("type"); //$NON-NLS-1$ if (type.equalsIgnoreCase("file")) { //$NON-NLS-1$ final String uri = (String) a.getAttribute("uri"); //$NON-NLS-1$ startFile(uri); } }
public String getValue(String qName) { Attribute att = HTML.getAttributeKey(qName.toLowerCase()); return (String)swingset.getAttribute(att); }
public String getValue(String qName) { Attribute att = HTML.getAttributeKey(qName.toLowerCase()); return (String)swingset.getAttribute(att); }
private void addBy(MutableAttributeSet attributes, String byName) { java.util.List<String> old = (java.util.List)attributes.getAttribute(Attribute.ACTION_BY); java.util.List<String> changed; if (old != null) { changed = new ArrayList<>(old); } else { changed = new ArrayList<>(); } // If already present, append to end changed.remove(byName); changed.add(byName); attributes.addAttribute(Attribute.ACTION_BY, changed); }
private void addNumericSetting(Setting key, int defaultValue, int min, int max) { MutableAttributeSet loadFrom = styleServer.getStyle("settings"); Object obj = loadFrom.getAttribute(key); int result = defaultValue; if (obj != null && obj instanceof Number) { result = ((Number)obj).intValue(); } if (result > max) { result = max; } if (result < min) { result = min; } numericSettings.put(key, result); }
@Override public void handleStartTag(final HTML.Tag t, final MutableAttributeSet a, final int pos) { if (t.toString().equalsIgnoreCase("afirma")) { //$NON-NLS-1$ final String type = (String) a.getAttribute(HTML.Attribute.TYPE); if (type != null && type.equals("file")) { //$NON-NLS-1$ final String uri = (String) a.getAttribute(HTML.Attribute.HREF); startFile(uri); } } else { super.handleStartTag(t, a, pos); } }