public class GlobalAttributes extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
GlobalAttributes.Direction |
| Constructor and Description |
|---|
GlobalAttributes() |
| Modifier and Type | Method and Description |
|---|---|
static Attribute |
accessKey(char keyboardShortcut)
The accesskey global attribute
provides a hint for generating a keyboard shortcut for the current element.
|
static List<Attribute> |
attrs(Attribute... props) |
static Attribute |
className(String className)
Is a space-separated list of the classes of the element.
|
static Attribute |
contentEditable(boolean editable)
The contenteditable global attribute
is an enumerated attribute indicating if the element should be editable by the user.
|
static Attribute |
contextMenu(String id)
The contextmenu global attribute is the
id of
a
The HTML <menu> element represents a group of commands that a user can perform or activate.
|
static Attribute |
data(String name,
String value)
Forms a class of attributes, called custom data attributes, that
allow proprietary information to be exchanged between the HTML
and its DOM representation that may be used by scripts.
|
static Attribute |
dir(GlobalAttributes.Direction dir)
The dir global attribute is an enumerated attribute indicates the directionality of the element's text.
|
static Attribute |
hidden(boolean hidden)
The hidden
global attribute is a
Boolean attribute indicating that the element is not yet, or is no longer, relevant.
|
static Attribute |
id(String id)
Defines a unique identifier (ID) which must be unique in the whole document.
|
static Attribute |
lang(String lang)
The lang
global attribute participates
in defining the language of the element, the language that is non-editable elements are written in or the
language that the editable elements should be written in.
|
static Attribute |
style(String style)
The style global attribute
contains CSS styling declarations to be applied to the element.
|
static Attribute |
tabIndex(int tabindex)
The tabindex global attribute is an integer indicating if the element can take input focus (is focusable), if it should participate to sequential keyboard navigation, and if so, at what position.
|
static Attribute |
title(String title)
The title global attribute contains a
text representing advisory information related to the element it belongs to.
|
public static Attribute accessKey(char keyboardShortcut)
The operation to activate the accesskey depends on browser and its platform.
keyboardShortcut - valuepublic static Attribute className(String className)
className - valuepublic static Attribute contentEditable(boolean editable)
editable - valuepublic static Attribute contextMenu(String id)
A context menu is a menu that appears upon user interaction, such as a right-click. HTML5 now allows us to customize this menu. Here are some implementation examples, including nested menus.
id - valuepublic static Attribute data(String name, String value)
name - valuevalue - valuepublic static Attribute dir(GlobalAttributes.Direction dir)
The dir global attribute is an enumerated attribute indicates the directionality of the element's text. It can have the following values:
dir - valuepublic static Attribute hidden(boolean hidden)
The hidden attribute must not be used to hide content that could legitimately be shown in another presentation. For example, it is incorrect to use hidden to hide panels in a tabbed dialog, because the tabbed interface is merely a kind of overflow presentation — one could equally well just show all the form controls in one big page with a scrollbar. It is similarly incorrect to use this attribute to hide content just from one presentation — if something is marked hidden, it is hidden from all presentations, including, for instance, screen readers.
Hidden elements shouldn't be linked from non-hidden elements and elements that are descendants of a hidden element are still active, which means that script elements can still execute and form elements can still submit.
hidden - valuepublic static Attribute id(String id)
id - valuepublic static Attribute lang(String lang)
The lang global attribute participates in defining the language of the element, the language that is non-editable elements are written in or the language that the editable elements should be written in. The tag contains one single entry value in the format defined in the Tags for Identifying Languages (BCP47) IETF document. If the tag content is the empty string the language is set to unknown; if the tag content is not valid, regarding BCP47, it is set to invalid.
Even if the lang attribute is set, it may not be taken into account, as the xml:lang attribute has priority.
For the CSS pseudo-class :lang, The :lang CSS pseudo-class matches elements based on the language the element is determined to be in. In HTML, the language is determined by a combination of the lang attribute, the <meta> element, and possibly by information from the protocol (such as HTTP headers). For other document types there may be other document methods for determining the language. two invalid language names are different if their names are different.
lang - valuepublic static Attribute style(String style)
The style global attribute contains CSS styling declarations to be applied to the element. Note that it is recommended for styles to be defined in a separate file or files. This attribute and the <style> The HTML <style> element contains style information for a document, or part of a document. By default, the style instructions written inside that element are expected to be CSS. element have mainly the purpose of allowing for quick styling, for example for testing purposes.
style - valuepublic static Attribute tabIndex(int tabindex)
The tabindex global attribute is an integer indicating if the element can take input focus (is focusable), if it should participate to sequential keyboard navigation, and if so, at what position. It can take several values:
An element with a 0 value, an invalid value, or no tabindex value should be placed after elements with a positive tabindex in the sequential keyboard navigation order.
tabindex - valuepublic static Attribute title(String title)
title - valueCopyright © 2016. All rights reserved.