All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cat.inspiracio.html.HTMLElement Maven / Gradle / Ivy

Go to download

HTML-parser provides a parser for HTML 5 that produces HTML 5 document object model. It aims to be a Java-implementation of http://www.w3.org/TR/html5/. It is for use in the server. It does not implement features that are relevant in the client, like event handling. It is for use from javascript, via Java's scripting library.

There is a newer version: 0.0.6
Show newest version
/*
Copyright 2015 Alexander Bunkenburg 

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package cat.inspiracio.html;

import java.io.Serializable;

import cat.inspiracio.dom.DOMStringMap;
import cat.inspiracio.dom.HTMLCollection;
import cat.inspiracio.script.ScriptMap;

/** 
 * Spec
 * 
 * An html element should also work with map notation:
 * 
 * 		element[key] = value;
 * 		value = element[key];
 * 
 * I write this aim in this interface by extending ScriptMap,
 * but whether and how it works depends in the details of the script
 * engine you use.
 * */
public interface HTMLElement extends org.w3c.dom.html.HTMLElement, ScriptMap, Serializable {

	// DOM tree manipulation -------------------------------------------
	
	@Override HTMLDocument getOwnerDocument();

	/** Convenience: get all children that are elements. */
	HTMLCollection getChildElements();

    /** Add an element as first child. */
    void prepend(HTMLElement element);
    
	// html element -----------------------------------------------
	
	@Override String getTitle();
	@Override void setTitle(String title);

	@Override String getLang();
	@Override void setLang(String lang);

	/** not implemented */
	boolean getTranslate();

	/** not implemented */
	void setTranslate(boolean t);

	@Override String getDir();
	@Override void setDir(String dir);

	DOMStringMap getDataset();
	
    String getStyle();
    void setStyle(String style);
    
    String getName();
    void setName(String n);

    // User interaction ------------------------------------------
	
	boolean getHidden();
	void setHidden(boolean h);

	/** not implemented */
	void click();
	
	int getTabIndex();
	void setTabIndex(int t);
	
	/** not implemented */
	void focus();
	
	/** not implemented */
	void blur();
	
	String getAccessKey();
	void setAccessKey(String key);
	String getAccessKeyLabel();
	
	/** not implemented */
	String getContentEditable();
	
	/** not implemented */
	void setContentEditable(String s);
	
	/** not implemented */
	boolean isContentEditable();
	
	/** not implemented */
	boolean getSpellcheck();
	
	/** not implemented */
	void setSpellcheck(boolean b);
	
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy