/** * get the property with the given name * @param propertyName - the name of the property to get */ public Object get( String propertyName ) { if (propertyName.equals( "nodeName" )) { return _element.getTagName(); } else if (propertyName.equals( "tagName" )) { return _element.getTagName(); } else if (propertyName.equalsIgnoreCase( "title" )) { return _element.getTitle(); } else if (_element.isSupportedAttribute( propertyName )) { return _element.getAttribute( propertyName ); } else { return super.get( propertyName ); } }
public ScriptingHandler createHandler( HTMLElement elementBase ) { return (ScriptingHandler) elementBase.getNode(); }
public ScriptingHandler createHandler( HTMLElement elementBase ) { ScriptableDelegate delegate = elementBase.newScriptable(); delegate.setScriptEngine( elementBase.getParentDelegate().getScriptEngine( delegate ) ); return delegate; }
protected ScriptableDelegate[] getDelegates( final HTMLElement[] elements ) { ScriptableDelegate[] result = new ScriptableDelegate[ elements.length ]; for (int i = 0; i < elements.length; i++) { result[i] = (ScriptableDelegate) elements[i].getScriptingHandler(); } return result; } }
/** * get the content of the given attribute * @param attributeName * @return the attribute as a string */ public String getAttribute(String attributeName) { return _element.getAttribute(attributeName); }
public ScriptingHandler createHandler( HTMLElement elementBase ) { ScriptableDelegate delegate = elementBase.newScriptable(); delegate.setScriptEngine( elementBase.getParentDelegate().getScriptEngine( delegate ) ); return delegate; }
protected ScriptableDelegate[] getDelegates( final HTMLElement[] elements ) { ScriptableDelegate[] result = new ScriptableDelegate[ elements.length ]; for (int i = 0; i < elements.length; i++) { result[i] = (ScriptableDelegate) elements[i].getScriptingHandler(); } return result; } }
/** * get the content of the given attribute * @param attributeName * @return the attribute as a string */ public String getAttribute(String attributeName) { return _element.getAttribute(attributeName); }
/** * get the property with the given name * @param propertyName - the name of the property to get */ public Object get( String propertyName ) { if (propertyName.equals( "nodeName" )) { return _element.getTagName(); } else if (propertyName.equals( "tagName" )) { return _element.getTagName(); } else if (propertyName.equalsIgnoreCase( "title" )) { return _element.getTitle(); } else if (_element.isSupportedAttribute( propertyName )) { return _element.getAttribute( propertyName ); } else { return super.get( propertyName ); } }
public ScriptingHandler createHandler( HTMLElement elementBase ) { ScriptableDelegate delegate = elementBase.newScriptable(); delegate.setScriptEngine( elementBase.getParentDelegate().getScriptEngine( delegate ) ); return delegate; }
protected ScriptableDelegate[] getDelegates( final HTMLElement[] elements ) { ScriptableDelegate[] result = new ScriptableDelegate[ elements.length ]; for (int i = 0; i < elements.length; i++) { result[i] = (ScriptableDelegate) elements[i].getScriptingHandler(); } return result; } }
/** * get the content of the given attribute * @param attributeName * @return the attribute as a string */ public String getAttribute(String attributeName) { return _element.getAttribute(attributeName); }
public ScriptingHandler createHandler( HTMLElement elementBase ) { return (ScriptingHandler) elementBase.getNode(); }
/** * get the property with the given name * @param propertyName - the name of the property to get */ public Object get( String propertyName ) { if (propertyName.equals( "nodeName" )) { return _element.getTagName(); } else if (propertyName.equals( "tagName" )) { return _element.getTagName(); } else if (propertyName.equalsIgnoreCase( "title" )) { return _element.getTitle(); } else if (_element.isSupportedAttribute( propertyName )) { return _element.getAttribute( propertyName ); } else { return super.get( propertyName ); } }
public ScriptableDelegate getElementWithID( String id ) { final HTMLElement elementWithID = HTMLPage.this.getElementWithID( id ); return elementWithID == null ? null : (ScriptableDelegate) elementWithID.getScriptingHandler(); }
/** * Returns the HTML elements with an attribute with the specified name and value. * @param name - the name of the attribute to check * @param value - the value of the attribute to check */ public HTMLElement[] getElementsWithAttribute( String name, String value ) { loadElements(); ArrayList elements = new ArrayList(); for (Iterator i = _registry.iterator(); i.hasNext();) { HTMLElement element = (HTMLElement) i.next(); String aValue=element.getAttribute( name ); if (value.equals(aValue )) { //System.err.println(element.getTagName()+"("+name+")="+aValue); elements.add( element ); } } return (HTMLElement[]) elements.toArray( new HTMLElement[ elements.size() ] ); }
public ScriptingHandler createHandler( HTMLElement elementBase ) { return (ScriptingHandler) elementBase.getNode(); }