本文整理了Java中com.google.gwt.dom.client.Element.removeClassName()
方法的一些代码示例,展示了Element.removeClassName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.removeClassName()
方法的具体详情如下:
包路径:com.google.gwt.dom.client.Element
类名称:Element
方法名:removeClassName
[英]Removes a name from this element's class property. If the name is not present, this method has no effect.
[中]从此元素的类属性中删除名称。如果名称不存在,则此方法无效。
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Replace one class name with another.
*
* @param oldClassName the class name to be replaced
* @param newClassName the class name to replace it
*/
public final void replaceClassName(String oldClassName, String newClassName) {
removeClassName(oldClassName);
addClassName(newClassName);
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Add the class name if it doesn't exist or removes it if does.
*
* @param className the class name to be toggled
*/
public final void toggleClassName(String className) {
boolean added = addClassName(className);
if (!added) {
removeClassName(className);
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* This convenience method adds or removes a style name for a given element.
* This method is typically used to add and remove secondary style names, but
* it can be used to remove primary stylenames as well, but that is not
* recommended. See {@link #setStyleName(String)} for a description of how
* primary and secondary style names are used.
*
* @param elem the element whose style is to be modified
* @param style the secondary style name to be added or removed
* @param add <code>true</code> to add the given style, <code>false</code> to
* remove it
*/
protected static void setStyleName(Element elem, String style, boolean add) {
if (elem == null) {
throw new RuntimeException(NULL_HANDLE_MSG);
}
style = style.trim();
if (style.length() == 0) {
throw new IllegalArgumentException(EMPTY_STYLENAME_MSG);
}
if (add) {
elem.addClassName(style);
} else {
elem.removeClassName(style);
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
public void onUnpush(Element parent) {
parent.getFirstChildElement().removeClassName(style.buttonCellBasePushing());
}
代码示例来源:origin: com.google.gwt/gwt-servlet
public void setDisabled(boolean isDisabled) {
if (this.disabled == isDisabled) {
return;
}
this.disabled = isDisabled;
if (disabled) {
setResource(resDisabled);
getElement().getParentElement().addClassName(styleDisabled);
} else {
setResource(resEnabled);
getElement().getParentElement().removeClassName(styleDisabled);
}
Roles.getButtonRole().setAriaDisabledState(getElement(), disabled);
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Enable or disable the fast forward button.
*
* @param disabled true to disable, false to enable
*/
private void setFastForwardDisabled(boolean disabled) {
if (fastForward == null) {
return;
}
if (disabled) {
fastForward.setResource(resources.simplePagerFastForwardDisabled());
fastForward.getElement().getParentElement().addClassName(
style.disabledButton());
} else {
fastForward.setResource(resources.simplePagerFastForward());
fastForward.getElement().getParentElement().removeClassName(
style.disabledButton());
}
}
代码示例来源:origin: com.sksamuel.jqm4gwt/jqm4gwt-library
protected void removeLiClassThumbIcon() {
if (noLiThumbOrIcon) {
List<JQMListItem> lis = getItems();
for (JQMListItem li : lis) {
if (li == null) continue;
Element elt = li.getElement();
elt.removeClassName(JQMListItem.STYLE_UI_LI_HAS_THUMB);
elt.removeClassName(JQMListItem.STYLE_UI_LI_HAS_ICON);
}
}
}
代码示例来源:origin: kiegroup/appformer
public static <E extends Enum<? extends Style.HasCssName>> void removeEnumStyleNames(final Element element,
final Class<E> enumClass) {
for (final Enum<? extends Style.HasCssName> constant : enumClass.getEnumConstants()) {
final String cssClass = ((Style.HasCssName) constant).getCssName();
if (cssClass != null && !cssClass.isEmpty()) {
element.removeClassName(cssClass);
}
}
}
代码示例来源:origin: jqm4gwt/jqm4gwt
protected void removeLiClassThumbIcon() {
if (noLiThumbOrIcon) {
List<JQMListItem> lis = getItems();
for (JQMListItem li : lis) {
if (li == null) continue;
Element elt = li.getElement();
elt.removeClassName(JQMListItem.STYLE_UI_LI_HAS_THUMB);
elt.removeClassName(JQMListItem.STYLE_UI_LI_HAS_ICON);
}
}
}
代码示例来源:origin: info.magnolia.ui/magnolia-ui-vaadin-common-widgets
@Override
protected void onComplete() {
element.removeClassName(ZoomAnimation.this.isZoomIn ? ZOOM_IN_CLASS_NAME : ZOOM_OUT_CLASS_NAME);
super.onComplete();
}
代码示例来源:origin: org.uberfire/uberfire-widgets-commons
public static <E extends Enum<? extends Style.HasCssName>> void removeEnumStyleNames(final Element element,
final Class<E> enumClass) {
for (final Enum<? extends Style.HasCssName> constant : enumClass.getEnumConstants()) {
final String cssClass = ((Style.HasCssName) constant).getCssName();
if (cssClass != null && !cssClass.isEmpty()) {
element.removeClassName(cssClass);
}
}
}
代码示例来源:origin: org.eclipse.che.core/che-core-ide-ui
/**
* Handling MouseOut event.
*
* @param row - element to be processed.
*/
private void setStyleNormal(Element row) {
if (row != null) {
row.removeClassName(POPUP_RESOURCES.popup().popupMenuItemOver());
}
}
代码示例来源:origin: org.uberfire/uberfire-widgets-commons
public static <E extends Style.HasCssName> void removeEnumStyleName(final Element element,
final E style) {
if (style != null && style.getCssName() != null && !style.getCssName().isEmpty()) {
element.removeClassName(style.getCssName());
}
}
}
代码示例来源:origin: com.sksamuel.jqm4gwt/jqm4gwt-library
private static void applyImgOnly(Widget w) {
if (w == null) return;
Element elt = w.getElement();
if (isImgOnly(elt)) elt.addClassName(IMG_ONLY);
else elt.removeClassName(IMG_ONLY);
}
代码示例来源:origin: jqm4gwt/jqm4gwt
public static void setMiniEx(Element elt, boolean mini) {
if (mini) {
elt.addClassName(STYLE_UI_MINI);
setAttribute(elt, DATA_MINI, "true");
} else {
elt.removeClassName(STYLE_UI_MINI);
removeAttribute(elt, DATA_MINI);
}
}
代码示例来源:origin: gwtbootstrap3/gwtbootstrap3
private void removeFromDataGrid(final TableType tableType) {
getTableHeadElement().getParentElement().removeClassName(tableType.getCssName());
getTableBodyElement().getParentElement().removeClassName(tableType.getCssName());
getTableFootElement().getParentElement().removeClassName(tableType.getCssName());
}
代码示例来源:origin: org.gwtbootstrap3/gwtbootstrap3
private void removeFromDataGrid(final TableType tableType) {
getTableHeadElement().getParentElement().removeClassName(tableType.getCssName());
getTableBodyElement().getParentElement().removeClassName(tableType.getCssName());
getTableFootElement().getParentElement().removeClassName(tableType.getCssName());
}
代码示例来源: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: info.magnolia.ui/magnolia-ui-vaadin-common-widgets
@Override
void setCaption(String newCaption, Element thumbnail) {
final Element caption = getCaption(thumbnail);
caption.setInnerHTML(newCaption);
caption.getStyle().setDisplay(Style.Display.BLOCK); // ?
final Element img = getImage(thumbnail);
img.getStyle().setDisplay(Style.Display.BLOCK); // ?
thumbnail.removeClassName(CLEARED_STYLE_NAME);
}
};
代码示例来源:origin: gwtbootstrap/gwt-bootstrap
private void applyTableStyle(boolean striped, TableType type) {
if(striped) {
getTableHeadElement().getParentElement().addClassName(type.get());
getTableBodyElement().getParentElement().addClassName(type.get());
getTableFootElement().getParentElement().addClassName(type.get());
} else {
getTableHeadElement().getParentElement().removeClassName(type.get());
getTableBodyElement().getParentElement().removeClassName(type.get());
getTableFootElement().getParentElement().removeClassName(type.get());
}
}
内容来源于网络,如有侵权,请联系作者删除!