本文整理了Java中com.google.gwt.dom.client.Element.trimClassName()
方法的一些代码示例,展示了Element.trimClassName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.trimClassName()
方法的具体详情如下:
包路径:com.google.gwt.dom.client.Element
类名称:Element
方法名:trimClassName
暂无
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Checks if this element's class property contains specified class name.
*
* @param className the class name to be added
* @return <code>true</code> if this element has the specified class name
*/
public final boolean hasClassName(String className) {
className = trimClassName(className);
int idx = indexOfName(getClassName(), className);
return idx != -1;
}
代码示例来源:origin: com.google.gwt/gwt-servlet
className = trimClassName(className);
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Adds a name to this element's class property. If the name is already
* present, this method has no effect.
*
* @param className the class name to be added
* @return <code>true</code> if this element did not already have the specified class name
* @see #setClassName(String)
*/
public final boolean addClassName(String className) {
className = trimClassName(className);
// Get the current style string.
String oldClassName = getClassName();
int idx = indexOfName(oldClassName, className);
// Only add the style if it's not already present.
if (idx == -1) {
if (oldClassName.length() > 0) {
setClassName(oldClassName + " " + className);
} else {
setClassName(className);
}
return true;
}
return false;
}
代码示例来源:origin: net.wetheinter/gwt-user
/**
* Checks if this element's class property contains specified class name.
*
* @param className the class name to be added
* @return <code>true</code> if this element has the specified class name
*/
public final boolean hasClassName(String className) {
className = trimClassName(className);
int idx = indexOfName(getClassName(), className);
return idx != -1;
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
/**
* Checks if this element's class property contains specified class name.
*
* @param className the class name to be added
* @return <code>true</code> if this element has the specified class name
*/
public final boolean hasClassName(String className) {
className = trimClassName(className);
int idx = indexOfName(getClassName(), className);
return idx != -1;
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
className = trimClassName(className);
代码示例来源:origin: net.wetheinter/gwt-user
className = trimClassName(className);
代码示例来源:origin: net.wetheinter/gwt-user
/**
* Adds a name to this element's class property. If the name is already
* present, this method has no effect.
*
* @param className the class name to be added
* @return <code>true</code> if this element did not already have the specified class name
* @see #setClassName(String)
*/
public final boolean addClassName(String className) {
className = trimClassName(className);
// Get the current style string.
String oldClassName = getClassName();
int idx = indexOfName(oldClassName, className);
// Only add the style if it's not already present.
if (idx == -1) {
if (oldClassName.length() > 0) {
setClassName(oldClassName + " " + className);
} else {
setClassName(className);
}
return true;
}
return false;
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
/**
* Adds a name to this element's class property. If the name is already
* present, this method has no effect.
*
* @param className the class name to be added
* @return <code>true</code> if this element did not already have the specified class name
* @see #setClassName(String)
*/
public final boolean addClassName(String className) {
className = trimClassName(className);
// Get the current style string.
String oldClassName = getClassName();
int idx = indexOfName(oldClassName, className);
// Only add the style if it's not already present.
if (idx == -1) {
if (oldClassName.length() > 0) {
setClassName(oldClassName + " " + className);
} else {
setClassName(className);
}
return true;
}
return false;
}
内容来源于网络,如有侵权,请联系作者删除!