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

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

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

Element.getPropertyString介绍

[英]Gets a property from this element.
[中]从该元素获取属性。

代码示例

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

public String getHTML() {
 return elem.getPropertyString("value");
}

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

public String getText() {
 return elem.getPropertyString("value");
}

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

/**
 * Gets any named property from an element, as a string.
 *
 * @param elem the element whose property is to be retrieved
 * @param attr the name of the property
 * @return the property's value
 * @deprecated Use the more appropriately named
 *             {@link Element#getPropertyString(String)} instead.
 */
@Deprecated
public static String getAttribute(Element elem, String attr) {
 return elem.getPropertyString(attr);
}

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

/**
 * Gets any named property from an element, as a string.
 * 
 * @param elem the element whose property is to be retrieved
 * @param prop the name of the property
 * @return the property's value
 * @deprecated Use {@link Element#getProperty(String)} instead.
 */
@Deprecated
public static String getElementProperty(Element elem, String prop) {
 return elem.getPropertyString(prop);
}

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

/**
 * Gets the directionality of an element.
 *
 * @param  elem  the element on which to check the directionality property 
 * @return <code>RTL</code> if the directionality is right-to-left,
 *         <code>LTR</code> if the directionality is left-to-right, or
 *         <code>DEFAULT</code> if the directionality is not explicitly set
 */
public static HasDirection.Direction getDirectionOnElement(Element elem) {
 String dirPropertyValue = elem.getPropertyString(DIR_PROPERTY_NAME);
 if (DIR_PROPERTY_VALUE_RTL.equalsIgnoreCase(dirPropertyValue)) {
  return HasDirection.Direction.RTL;
 } else if (DIR_PROPERTY_VALUE_LTR.equalsIgnoreCase(dirPropertyValue)) {
  return HasDirection.Direction.LTR;
 }
 return HasDirection.Direction.DEFAULT;
}

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

private int findDividerIndex(Element elem) {
 while (elem != null && elem != getElement()) {
  String expando = elem.getPropertyString("__index");
  if (expando != null) {
   // Make sure it belongs to me!
   int ownerHash = elem.getPropertyInt("__owner");
   if (ownerHash == hashCode()) {
    // Yes, it's mine.
    return Integer.parseInt(expando);
   } else {
    // It must belong to some nested StackPanel.
    return -1;
   }
  }
  elem = DOM.getParent(elem);
 }
 return -1;
}

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

/**
 * Determines the TD associated with the specified event.
 * 
 * @param event the event to be queried
 * @return the TD associated with the event, or <code>null</code> if none is
 *         found.
 */
protected com.google.gwt.user.client.Element getEventTargetCell(Event event) {
 Element td = DOM.eventGetTarget(event);
 for (; td != null; td = DOM.getParent(td)) {
  // If it's a TD, it might be the one we're looking for.
  if (td.getPropertyString("tagName").equalsIgnoreCase("td")) {
   // Make sure it's directly a part of this table before returning
   // it.
   Element tr = DOM.getParent(td);
   Element body = DOM.getParent(tr);
   if (body == bodyElem) {
    return DOM.asOld(td);
   }
  }
  // If we run into this table's body, we're out of options.
  if (td == bodyElem) {
   return null;
  }
 }
 return null;
}

代码示例来源:origin: com.googlecode.gwt-test-utils/gwt-test-utils

/**
 * Gets all of the element's style names, as a space-separated list.
 *
 * @param elem the element whose style is to be retrieved
 * @return the objects's space-separated style names
 */
public static String getStyleName(Element element) {
  return element.getPropertyString("className");
}

代码示例来源:origin: gwt-test-utils/gwt-test-utils

/**
 * Gets all of the element's style names, as a space-separated list.
 *
 * @param elem the element whose style is to be retrieved
 * @return the objects's space-separated style names
 */
public static String getStyleName(Element element) {
  return element.getPropertyString("className");
}

代码示例来源:origin: ltearno/hexa.tools

public String getValueAsString()
  {
    return input.getPropertyString( "value" );
  }
}

代码示例来源:origin: fr.lteconsulting/hexa.core

public String getValueAsString()
  {
    return input.getPropertyString( "value" );
  }
}

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

public String getHTML() {
 return elem.getPropertyString("value");
}

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

/**
 * Gets any named property from an element, as a string.
 * 
 * @param elem the element whose property is to be retrieved
 * @param prop the name of the property
 * @return the property's value
 * @deprecated Use {@link Element#getProperty(String)} instead.
 */
@Deprecated
public static String getElementProperty(Element elem, String prop) {
 return elem.getPropertyString(prop);
}

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

/**
 * Gets any named property from an element, as a string.
 * 
 * @param elem the element whose property is to be retrieved
 * @param prop the name of the property
 * @return the property's value
 * @deprecated Use {@link Element#getProperty(String)} instead.
 */
@Deprecated
public static String getElementProperty(Element elem, String prop) {
 return elem.getPropertyString(prop);
}

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

public static boolean hasStyle(Element elt, String style) {
  if (elt == null) return false;
  String styles = elt.getPropertyString("className");
  return styles != null && (indexOfName(styles, style) >= 0);
}

代码示例来源:origin: jqm4gwt/jqm4gwt

public static boolean hasStyle(Element elt, String style) {
  if (elt == null) return false;
  String styles = elt.getPropertyString("className");
  return styles != null && (indexOfName(styles, style) >= 0);
}

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

public String getText() {
  return getTextArea().getPropertyString("value");
}

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

public static boolean hasStyle(Element elt, String style) {
  if (elt == null) return false;
  String styles = elt.getPropertyString("className");
  return styles != null && (indexOfName(styles, style) >= 0);
}

代码示例来源:origin: org.drools/drools-wb-guided-rule-editor-client

public String getFormId() {
  return this.getExternalFrameElement( "cf_id" ).getPropertyString( "value" );
}

代码示例来源:origin: jqm4gwt/jqm4gwt

public static void removeStylesStartsWith(Element elt, String startsWith) {
  if (elt == null || startsWith == null || startsWith.isEmpty()) return;
  String oldStyles = elt.getPropertyString("className");
  String newStyles = removeStylesStartsWith(oldStyles, startsWith);
  if (!StrUtils.equals(oldStyles, newStyles)) {
    elt.setPropertyString("className", newStyles);
  }
}

相关文章

微信公众号

最新文章

更多

Element类方法