API Reference 0.3.24dart_web_toolkit_roleButtonRoleImpl

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

ButtonRole

Constructors

new ButtonRoleImpl(String roleName) #

Creates a new Object instance.

Object instances have no meaningful state, and are only useful through their identity. An Object instance is equal to itself only.

docs inherited from Object
ButtonRoleImpl(String roleName) : super(roleName);

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);
}