ButtonRoleImpl class
Implements {@link ButtonRole}.
class ButtonRoleImpl extends Role implements ButtonRole {
ButtonRoleImpl(String roleName) : super(roleName);
//*****************************
// Implementation of ButtonRole
//*****************************
void setAriaPressedState(dart_html.Element element, PressedValue value) {
State.PRESSED.set(element, value);
}
String getAriaPressedState(dart_html.Element element) {
return State.PRESSED.get(element);
}
void removeAriaPressedState(dart_html.Element element) {
State.PRESSED.remove(element);
}
}
Extends
Role > ButtonRoleImpl
Implements
Constructors
Methods
String get(Element element) #
inherited from Role
Gets the role for the element {@code element}. If none is set, "" is returned.
@param element HTML element @return The role attribute value
String get(dart_html.Element element) {
assert (element != null); // : "Element cannot be null.";
return element.attributes[ATTR_NAME_ROLE];
}
String getAriaPressedState(Element element) #
String getAriaPressedState(dart_html.Element element) {
return State.PRESSED.get(element);
}
String getName() #
inherited from Role
Gets the role name
@return The role name
String getName() {
return _roleName;
}
void remove(Element element) #
inherited from Role
Removes the role for element {@code element}
@param element HTML element
void remove(dart_html.Element element) {
assert (element != null); // : "Element cannot be null.";
element.attributes.remove(ATTR_NAME_ROLE);
}
void removeAriaPressedState(Element element) #
void removeAriaPressedState(dart_html.Element element) {
State.PRESSED.remove(element);
}
void set(Element element) #
inherited from Role
Sets the role to element {@code element}
@param element HTML element
void set(dart_html.Element element) {
assert (element != null); // : "Element cannot be null.";
element.attributes[ATTR_NAME_ROLE] = _roleName;
}
void setAriaPressedState(Element element, PressedValue value) #
void setAriaPressedState(dart_html.Element element, PressedValue value) {
State.PRESSED.set(element, value);
}