com.google.gwt.dom.client.Element.removeAttribute()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(123)

本文整理了Java中com.google.gwt.dom.client.Element.removeAttribute()方法的一些代码示例,展示了Element.removeAttribute()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.removeAttribute()方法的具体详情如下:
包路径:com.google.gwt.dom.client.Element
类名称:Element
方法名:removeAttribute

Element.removeAttribute介绍

[英]Removes an attribute by name.
[中]按名称删除属性。

代码示例

代码示例来源:origin: com.google.gwt/gwt-servlet

/**
 * Removes the state from the given element.
 *
 * @param elem the element which has the specified state
 * @param stateName the name of the state to remove
 */
public static void removeState(Element elem, String stateName)  {
 elem.removeAttribute(stateName);
}
/**

代码示例来源:origin: com.google.gwt/gwt-servlet

@Override
public void remove(Element element) {
 assert element != null : "Element cannot be null.";
 element.removeAttribute(ATTR_NAME_ROLE);
}

代码示例来源:origin: com.google.gwt/gwt-servlet

/**
 * Removes the state/property attribute for element {@code element}.
 *
 * @param element HTM element
 */
public void remove(Element element) {
 assert element != null : "Element cannot be null.";
 element.removeAttribute(name);
}

代码示例来源:origin: com.google.gwt/gwt-servlet

/**
 * Removes the named attribute from the given element.
 * 
 * @param elem the element whose attribute is to be removed
 * @param attr the name of the element to remove
 * @deprecated Use {@link Element#removeAttribute(String)} instead.
 */
@Deprecated
public static void removeElementAttribute(Element elem, String attr) {
 elem.removeAttribute(attr);
}

代码示例来源:origin: com.google.gwt/gwt-servlet

@Override
public void setTitle(String title) {
 Element containerElement = getContainerElement();
 if (title == null || title.length() == 0) {
  containerElement.removeAttribute("title");
 } else {
  containerElement.setAttribute("title", title);
 }
}

代码示例来源:origin: com.google.gwt/gwt-servlet

/**
 * Returns the dom element.
 *
 * @return the dom element
 * @throws RuntimeException if the element cannot be found
 */
 public T get() {
  if (element == null) {
   element = Document.get().getElementById(domId).<T>cast();
   if (element == null) {
    throw new RuntimeException("Cannot find element with id \"" + domId
      + "\". Perhaps it is not attached to the document body.");
   }
   element.removeAttribute("id");
  }
  return element;
 }
}

代码示例来源:origin: com.google.gwt/gwt-servlet

/**
 * Make an element focusable or not.
 * 
 * @param elem the element
 * @param focusable true to make focusable, false to make unfocusable
 */
protected void setFocusable(Element elem, boolean focusable) {
 if (focusable) {
  FocusImpl focusImpl = FocusImpl.getFocusImplForWidget();
  focusImpl.setTabIndex(elem, getTabIndex());
  if (accessKey != 0) {
   focusImpl.setAccessKey(elem, accessKey);
  }
 } else {
  // Chrome: Elements remain focusable after removing the tabIndex, so set
  // it to -1 first.
  elem.setTabIndex(-1);
  elem.removeAttribute("tabIndex");
  elem.removeAttribute("accessKey");
 }
}

代码示例来源:origin: net.wetheinter/gwt-user

@Override
public void remove(Element element) {
 assert element != null : "Element cannot be null.";
 element.removeAttribute(ATTR_NAME_ROLE);
}

代码示例来源:origin: net.wetheinter/gwt-user

/**
 * Removes the state/property attribute for element {@code element}.
 *
 * @param element HTM element
 */
public void remove(Element element) {
 assert element != null : "Element cannot be null.";
 element.removeAttribute(name);
}

代码示例来源:origin: net.wetheinter/gwt-user

/**
 * Removes the state from the given element.
 *
 * @param elem the element which has the specified state
 * @param stateName the name of the state to remove
 */
public static void removeState(Element elem, String stateName)  {
 elem.removeAttribute(stateName);
}
/**

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

@Override
public void remove(Element element) {
 assert element != null : "Element cannot be null.";
 element.removeAttribute(ATTR_NAME_ROLE);
}

代码示例来源:origin: com.google.gwt/gwt-servlet

cellParent.removeAttribute("tabIndex");
 cellParent.removeAttribute("accessKey");
} else {
 FocusImpl focusImpl = FocusImpl.getFocusImplForWidget();

代码示例来源:origin: net.wetheinter/gwt-user

/**
 * Removes the named attribute from the given element.
 * 
 * @param elem the element whose attribute is to be removed
 * @param attr the name of the element to remove
 * @deprecated Use {@link Element#removeAttribute(String)} instead.
 */
@Deprecated
public static void removeElementAttribute(Element elem, String attr) {
 elem.removeAttribute(attr);
}

代码示例来源:origin: com.sksamuel.jqm4gwt/jqm4gwt-library

/**
 * @param attrs - comma separated attribute names.
 */
public static void removeAttributes(Element elt, String attrs) {
  if (elt == null || attrs == null || attrs.isEmpty()) return;
  String[] arr = attrs.split(",");
  for (String i : arr) {
    String s = i.trim();
    if (s.isEmpty()) continue;
    elt.removeAttribute(s);
  }
}

代码示例来源:origin: com.sksamuel.jqm4gwt/jqm4gwt-standalone

/**
 * @param attrs - comma separated attribute names.
 */
public static void removeAttributes(Element elt, String attrs) {
  if (elt == null || attrs == null || attrs.isEmpty()) return;
  String[] arr = attrs.split(",");
  for (String i : arr) {
    String s = i.trim();
    if (s.isEmpty()) continue;
    elt.removeAttribute(s);
  }
}

代码示例来源:origin: org.eclipse.che.core/che-core-ide-ui

public void selectItem(Element item) {
  if (selectedItem != null) {
   selectedItem.removeAttribute(SELECTED_ATTRIBUTE);
  }
  selectedItem = item;
  selectedItem.setAttribute(SELECTED_ATTRIBUTE, SELECTED_ATTRIBUTE);
 }
}

代码示例来源:origin: net.wetheinter/gwt-user

@Override
public void setTitle(String title) {
 Element containerElement = getContainerElement();
 if (title == null || title.length() == 0) {
  containerElement.removeAttribute("title");
 } else {
  containerElement.setAttribute("title", title);
 }
}

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

@Override
public void setTitle(String title) {
 Element containerElement = getContainerElement();
 if (title == null || title.length() == 0) {
  containerElement.removeAttribute("title");
 } else {
  containerElement.setAttribute("title", title);
 }
}

代码示例来源:origin: com.haulmont.cuba/cuba-web-toolkit

public void setAccept(String accept) {
  if (accept != null) {
    getFileInputElement().setAttribute("accept", accept);
  } else {
    getFileInputElement().removeAttribute("accept");
  }
}

代码示例来源:origin: info.magnolia.ui/magnolia-ui-vaadin-common-widgets

@Override
public void clear(Element thumbnail) {
  Element icon = getIcon(thumbnail);
  icon.setClassName(ICON_STYLE_NAME);
  icon.getStyle().setDisplay(Style.Display.NONE);
  Element image = getImage(thumbnail);
  image.removeAttribute("src");
  image.getStyle().setDisplay(Style.Display.NONE);
  thumbnail.addClassName(CLEARED_STYLE_NAME);
}

相关文章

微信公众号

最新文章

更多

Element类方法