本文整理了Java中com.google.gwt.user.client.Element.hasAttribute()
方法的一些代码示例,展示了Element.hasAttribute()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.hasAttribute()
方法的具体详情如下:
包路径:com.google.gwt.user.client.Element
类名称:Element
方法名:hasAttribute
暂无
代码示例来源:origin: gwtbootstrap3/gwtbootstrap3
@Override
public boolean isEnabled() {
return !uiObject.getElement().hasAttribute(DISABLED);
}
}
代码示例来源:origin: GwtMaterialDesign/gwt-material
/**
* Gets the value of switch component.
*/
@Override
public Boolean getValue() {
return input.getElement().hasAttribute("checked");
}
代码示例来源:origin: org.gwtbootstrap3/gwtbootstrap3
@Override
public boolean isEnabled() {
return !uiObject.getElement().hasAttribute(DISABLED);
}
}
代码示例来源:origin: org.gwtbootstrap3/gwtbootstrap3
/**
* Checks whether or not the UiObject has the element
*
* @param attributeName attribute name
* @return true if has the attribute, false otherwise
*/
public boolean hasAttribute(final String attributeName) {
return uiObject.getElement().hasAttribute(attributeName);
}
}
代码示例来源:origin: com.github.gwtmaterialdesign/gwt-material
@Override
public boolean isEnabled() {
return !uiObject.getElement().hasAttribute("disabled");
}
代码示例来源:origin: gwtbootstrap3/gwtbootstrap3
/**
* Checks whether or not the UiObject has the element
*
* @param attributeName attribute name
* @return true if has the attribute, false otherwise
*/
public boolean hasAttribute(final String attributeName) {
return uiObject.getElement().hasAttribute(attributeName);
}
}
代码示例来源:origin: com.github.gwtmaterialdesign/gwt-material
/**
* Gets the value of switch component.
*/
@Override
public Boolean getValue() {
return input.getElement().hasAttribute("checked");
}
代码示例来源:origin: com.github.gwtmaterialdesign/gwt-material-addins
/**
* Check whether the multiple option is enabled
*/
public boolean isMultiple() {
if (listbox != null) {
return listbox.getElement().hasAttribute("multiple");
}
return false;
}
代码示例来源:origin: com.sksamuel.jqm4gwt/jqm4gwt-library
public boolean isIconPosNone() {
if (!select.getElement().hasAttribute(JQMCommon.DATA_ICONPOS)) return false;
String v = JQMCommon.getAttribute(select, JQMCommon.DATA_ICONPOS);
return "".equals(v);
}
代码示例来源:origin: org.eclipse.che.core/che-core-ide-app
@Override
public void onClick(ClickEvent clickEvent) {
if (!wrapTextButton.getElement().hasAttribute("disabled") && delegate != null) {
delegate.wrapTextButtonClicked();
}
}
},
代码示例来源:origin: org.eclipse.che.core/che-core-ide-app
@Override
public void onClick(ClickEvent event) {
if (!clearOutputsButton.getElement().hasAttribute("disabled") && delegate != null) {
delegate.clearOutputsButtonClicked();
}
}
},
代码示例来源:origin: org.eclipse.che.core/che-core-ide-app
@Override
public void onClick(ClickEvent event) {
if (!scrollToBottomButton.getElement().hasAttribute("disabled") && delegate != null) {
delegate.scrollToBottomButtonClicked();
}
}
},
代码示例来源:origin: org.eclipse.che.core/che-core-ide-app
@Override
public void onClick(ClickEvent event) {
if (!reRunProcessButton.getElement().hasAttribute("disabled") && delegate != null) {
delegate.reRunProcessButtonClicked();
}
}
},
代码示例来源:origin: GwtMaterialDesign/gwt-material
@Override
protected <H extends UIObject & HasEnabled> void checkEnabled(HasEnabled widget, H target) {
super.checkEnabled(widget, target);
widget.setEnabled(false);
assertTrue(target.getElement().hasAttribute("onclick"));
assertEquals("return false", target.getElement().getAttribute("onclick"));
widget.setEnabled(true);
assertFalse(target.getElement().hasAttribute("onclick"));
}
}
代码示例来源:origin: com.github.gwtmaterialdesign/gwt-material-addins
protected void checkSVGWithHeight(MaterialAvatar avatar) {
final String WIDTH = "50";
final String HEIGHT = "50";
avatar.setWidth(WIDTH);
avatar.setHeight(HEIGHT);
assertTrue(avatar.getElement().hasAttribute("width"));
assertEquals(WIDTH, avatar.getElement().getAttribute("width"));
assertTrue(avatar.getElement().hasAttribute("height"));
assertEquals(HEIGHT, avatar.getElement().getAttribute("height"));
}
}
代码示例来源:origin: com.github.gwtmaterialdesign/gwt-material-addins
protected void checkStructure(MaterialPopupMenu popupMenu, boolean checkElement) {
if (checkElement) {
assertTrue(popupMenu.getElement().hasAttribute("tabindex"));
assertEquals("0", popupMenu.getElement().getAttribute("tabindex"));
}
assertEquals(5, popupMenu.getWidgetCount());
for (Widget w : popupMenu) {
assertNotNull(w);
}
}
代码示例来源:origin: GwtMaterialDesign/gwt-material
public void testCaption() {
// given
MaterialImage image = getWidget();
// when / then
final String CAPTION = "Caption";
image.setCaption(CAPTION);
assertEquals(CAPTION, image.getCaption());
assertTrue(image.getElement().hasAttribute("data-caption"));
assertEquals(CAPTION, image.getElement().getAttribute("data-caption"));
}
代码示例来源:origin: com.github.gwtmaterialdesign/gwt-material-addins
protected void checkValue(MaterialAvatar avatar) {
// when / then
final String NAME = "test1";
final String HASH_CODE = JsAvatar.md5(NAME);
avatar.setValue(NAME);
assertEquals(NAME, avatar.getValue());
assertTrue(avatar.getElement().hasAttribute("data-jdenticon-hash"));
assertEquals(HASH_CODE, avatar.getElement().getAttribute("data-jdenticon-hash"));
}
代码示例来源:origin: GwtMaterialDesign/gwt-material
public void testActivates() {
// given
MaterialNavBar navBar = getWidget();
// when / then
final String ACTIVATOR = "activator";
navBar.setActivates(ACTIVATOR);
assertNotNull(navBar.getActivates());
assertTrue(navBar.getNavMenu().getElement().hasAttribute("data-activates"));
assertEquals(ACTIVATOR, navBar.getNavMenu().getElement().getAttribute("data-activates"));
}
代码示例来源:origin: com.github.gwtmaterialdesign/gwt-material
public void testActivates() {
// given
MaterialNavBar navBar = getWidget();
// when / then
final String ACTIVATOR = "activator";
navBar.setActivates(ACTIVATOR);
assertNotNull(navBar.getActivates());
assertTrue(navBar.getNavMenu().getElement().hasAttribute("data-activates"));
assertEquals(ACTIVATOR, navBar.getNavMenu().getElement().getAttribute("data-activates"));
}
内容来源于网络,如有侵权,请联系作者删除!