本文整理了Java中com.google.gwt.dom.client.Element.getClassName()
方法的一些代码示例,展示了Element.getClassName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.getClassName()
方法的具体详情如下:
包路径:com.google.gwt.dom.client.Element
类名称:Element
方法名:getClassName
[英]The class attribute of the element. This attribute has been renamed due to conflicts with the "class" keyword exposed by many languages.
[中]元素的class属性。由于与许多语言公开的“class”关键字冲突,此属性已重命名。
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* 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
*/
protected static String getStyleName(Element elem) {
return elem.getClassName();
}
代码示例来源: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
String oldStyle = getClassName();
int idx = indexOfName(oldStyle, 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: com.haulmont.cuba/cuba-web-toolkit
private static boolean elementIsRow(Element e) {
String className = e.getClassName() == null ? "" : e.getClassName();
if (className.contains("v-formlayout-row")) {
return true;
}
return false;
}
代码示例来源:origin: org.vaadin.addons/dragdroplayouts
private static boolean elementIsRow(Element e) {
String className = e.getClassName() == null ? "" : e.getClassName();
if (className.contains("v-formlayout-row")) {
return true;
}
return false;
}
代码示例来源:origin: gwtbootstrap/gwt-bootstrap
/**
* is the element search-query style?
* @param elem target element.
* @return true:has search-query css-class/false:has no search-query cass-class.
*/
public static boolean isSearchQuery(Element elem) {
return elem.getClassName().contains(Constants.SEARCH_QUERY);
}
代码示例来源:origin: com.extjs/gxt
/**
* Returns true if the group is expanded.
*
* @param group the group
* @return true if expanded
*/
public boolean isExpanded(Element group) {
return group.getClassName().indexOf("x-grid-group-collapsed") == -1;
}
代码示例来源:origin: org.vaadin.addons/dragdroplayouts
private boolean isElementNotDraggable(Element targetElement) {
// do not try to drag tabsheet close button it breaks close on touch devices
return targetElement.getClassName().contains("v-tabsheet-caption-close")
|| (targetElement.getClassName().contains("v-caption") &&
targetElement.getParentElement().getClassName().contains("v-tabsheet-tabitem"));
}
代码示例来源:origin: org.drools/drools-wb-guided-dtable-editor-client
@Override
public boolean isDisabled( final Element element ) {
final List<String> classNames = Arrays.asList( element.getClassName().split( "\\s" ) );
return classNames.contains( Styles.DISABLED );
}
代码示例来源:origin: com.extjs/gxt
protected boolean hasRows() {
if (mainBody == null) {
return false;
}
Element e = mainBody.dom.getFirstChildElement();
return e != null && !"x-grid-empty".equals(e.getClassName());
}
代码示例来源:origin: org.dashbuilder/dashbuilder-navigation-client
@Override
protected void setSelectedEnabled(boolean enabled) {
String cname = selectedItem.getClassName();
if (!cname.equals("uf-navtree-widget-non-clickable")) {
if (enabled) {
selectedItem.setClassName("uf-navtree-widget-clicked");
} else {
selectedItem.setClassName("uf-navtree-widget-non-clicked");
}
}
}
代码示例来源:origin: com.haulmont.cuba/cuba-web-toolkit
public void removeClassName(int optionIndex) {
Element option = getOptionElement(optionIndex);
String className = option.getClassName();
if (className != null && !className.isEmpty()) {
option.removeClassName(className);
}
}
代码示例来源:origin: com.haulmont.cuba/cuba-web-toolkit
@Override
protected void updateCellStyleNames(TableCellElement td, String primaryStyleName) {
Element container = td.getFirstChild().cast();
boolean isWidget = container.getClassName() != null
&& container.getClassName().contains(WIDGET_CELL_CLASSNAME);
super.updateCellStyleNames(td, primaryStyleName);
if (isWidget) {
container.addClassName(WIDGET_CELL_CLASSNAME);
}
}
代码示例来源:origin: com.haulmont.cuba/cuba-web-toolkit
@Override
protected void updateCellStyleNames(TableCellElement td, String primaryStyleName) {
Element container = td.getFirstChild().cast();
boolean isWidget = container.getClassName() != null
&& container.getClassName().contains(WIDGET_CELL_CLASSNAME);
super.updateCellStyleNames(td, primaryStyleName);
if (isWidget) {
container.addClassName(WIDGET_CELL_CLASSNAME);
}
}
代码示例来源: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: GwtMaterialDesign/gwt-material
protected void clearActiveClass(HasWidgets widget) {
for (Widget child : widget) {
Element element = child.getElement();
if (StyleHelper.containsStyle(element.getClassName(), CssName.ACTIVE)) {
element.removeClassName(CssName.ACTIVE);
}
if (child instanceof HasWidgets) {
clearActiveClass((HasWidgets) child);
}
}
}
代码示例来源:origin: com.github.gwtmaterialdesign/gwt-material
protected void clearActiveClass(HasWidgets widget) {
for (Widget child : widget) {
Element element = child.getElement();
if (StyleHelper.containsStyle(element.getClassName(), CssName.ACTIVE)) {
element.removeClassName(CssName.ACTIVE);
}
if (child instanceof HasWidgets) {
clearActiveClass((HasWidgets) child);
}
}
}
代码示例来源:origin: org.jboss.ballroom/widgets
private void scrollSelectedItemIntoView() {
NodeList<Node> items = getSuggestionMenu().getElement().getChild(1).getChild(0).getChildNodes();
for (int i = 0; i < items.getLength(); i++) {
Element element = (Element) items.getItem(i);
if (((Element) element.getChild(0)).getClassName().equals("item item-selected")) {
element.scrollIntoView();
break;
}
}
}
}
内容来源于网络,如有侵权,请联系作者删除!