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

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

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

Element.getClassName介绍

暂无

代码示例

代码示例来源:origin: com.extjs/gxt

/**
 * Returns the element's style name.
 * 
 * @return the style name
 */
public String getStyleName() {
 return dom.getClassName();
}

代码示例来源:origin: com.extjs/gxt

/**
 * Checks if the specified CSS style name exists on this element's DOM node.
 * 
 * @param style the style name
 * @return true if the style name exists, else false
 */
public boolean hasStyleName(String style) {
 String cls = dom.getClassName();
 return (" " + cls + " ").indexOf(" " + style + " ") != -1 ? true : false;
}

代码示例来源:origin: com.extjs/gxt

private String getColorFromElement(Element elem) {
 String className = elem.getClassName();
 if (className.indexOf("color-") != -1) {
  return className.substring(className.indexOf("color-") + 6, className.indexOf("color-") + 12);
 }
 return null;
}

代码示例来源:origin: org.vaadin.addons/dragdroplayouts

/**
 * Resolve if widget is a Vaadin Caption
 * 
 * @param w
 *            Widget to check
 * @return True if the widget is a caption widget, false otherwise
 */
public static boolean isCaption(Widget w) {
  return w instanceof VCaption || w instanceof VFormLayout.Caption
      || w instanceof TabCaption
      || w.getElement().getClassName().contains("v-panel-caption");
}

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

/**
 * Resolve if widget is a Vaadin Caption
 * 
 * @param w
 *            Widget to check
 * @return True if the widget is a caption widget, false otherwise
 */
public static boolean isCaption(Widget w) {
  return w instanceof VCaption || w instanceof VFormLayout.Caption
      || w instanceof TabCaption
      || w.getElement().getClassName().contains("v-panel-caption");
}

代码示例来源:origin: com.extjs/gxt

@Override
protected void handleMouseClick(GridEvent<M> e) {
 if (e.getTarget().getClassName().equals("x-grid3-row-checker")) {
  return;
 }
 super.handleMouseClick(e);
}

代码示例来源:origin: fr.putnami.pwt/pwt

protected AbstractComposite(AbstractComposite source) {
  this.handlerManager = new HandlerManager(source.handlerManager, this);
  this.handlerManager.resetSinkEvents();
  this.styleToClone = source.getElement().getClassName();
}

代码示例来源:origin: com.extjs/gxt

protected void onMouseDown(GridEvent<?> e) {
 if (e.getTarget().getClassName().equals("x-grid3-row-expander")) {
  e.stopEvent();
  El row = e.getTarget(".x-grid3-row", 15);
  toggleRow(row);
 }
}

代码示例来源:origin: Putnami/putnami-web-toolkit

protected AbstractComposite(AbstractComposite source) {
  this.handlerManager = new HandlerManager(source.handlerManager, this);
  this.handlerManager.resetSinkEvents();
  this.styleToClone = source.getElement().getClassName();
}

代码示例来源:origin: fr.putnami.pwt/pwt

public static void cloneStyle(Widget target, Widget source) {
  target.getElement().setClassName(source.getElement().getClassName());
}

代码示例来源:origin: Putnami/putnami-web-toolkit

public static void cloneStyle(Widget target, Widget source) {
  target.getElement().setClassName(source.getElement().getClassName());
}

代码示例来源:origin: GwtMaterialDesign/gwt-material

protected void applyCollapsibleProgress(boolean isShow) {
    MaterialCollapsibleItem item = (MaterialCollapsibleItem) uiObject;
    MaterialCollapsibleBody body = (MaterialCollapsibleBody) item.getWidget(1);
    if (uiObject.getElement().getClassName().contains(CssName.ACTIVE)) {
      if (isShow) {
        body.setDisplay(Display.NONE);
        item.add(progress);
      } else {
        body.setDisplay(Display.BLOCK);
        progress.removeFromParent();
      }
    }
  }
}

代码示例来源:origin: com.github.gwtmaterialdesign/gwt-material

protected void applyCollapsibleProgress(boolean isShow) {
    MaterialCollapsibleItem item = (MaterialCollapsibleItem) uiObject;
    MaterialCollapsibleBody body = (MaterialCollapsibleBody) item.getWidget(1);
    if (uiObject.getElement().getClassName().contains(CssName.ACTIVE)) {
      if (isShow) {
        body.setDisplay(Display.NONE);
        item.add(progress);
      } else {
        body.setDisplay(Display.BLOCK);
        progress.removeFromParent();
      }
    }
  }
}

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

public void update() {
  text.setInnerText(data.getLabel());
  if (data.getIconFontId() != null) {
    icon.setClassName("v-icon");
    if (data.getIconFontId() != null && !data.getIconFontId().isEmpty()) {
      icon.addClassName(data.getIconFontId());
    }
  } else if (iconImage != null) {
    iconImage.setUri(data.getResourceUrl());
  }
  if (isEnabled() && root.getClassName().contains(ApplicationConnection.DISABLED_CLASSNAME)) {
    root.removeClassName(ApplicationConnection.DISABLED_CLASSNAME);
  } else if (!isEnabled() && !root.getClassName().contains(ApplicationConnection.DISABLED_CLASSNAME)) {
    root.addClassName(ApplicationConnection.DISABLED_CLASSNAME);
  }
}

代码示例来源:origin: kiegroup/appformer

public void setUiPart(final UIPart uiPart) {
    if (uiPart != null) {
      this.uiPart = uiPart;
      this.widget = uiPart.getWidget().asWidget();
      this.widget.getElement().getStyle().setFloat(Style.Float.LEFT);
      this.widget.getElement().getStyle().setOverflow(Style.Overflow.HIDDEN);
      this.style = this.widget.getElement().getClassName();

      container.clear();
      container.add(widget);
    } else {
      this.uiPart = null;
      this.widget = null;
      this.style = null;
      container.clear();
    }
  }
}

代码示例来源:origin: com.extjs/gxt

@Override
protected void handleMouseDown(GridEvent<M> e) {
 if (e.getEvent().getButton() == Event.BUTTON_LEFT && e.getTarget().getClassName().equals("x-grid3-row-checker")) {
  M m = listStore.getAt(e.getRowIndex());
  if (m != null) {
   if (isSelected(m)) {
    deselect(m);
   } else {
    select(m, true);
   }
  }
 } else {
  super.handleMouseDown(e);
 }
}

代码示例来源:origin: com.github.gwtmaterialdesign/gwt-material

public void testTypes() {
  // given
  MaterialTab tab = getWidget();
  // when / then
  tab.setType(TabType.DEFAULT);
  assertEquals(TabType.DEFAULT, tab.getType());
  assertTrue(tab.getElement().getClassName().contains(TabType.DEFAULT.getCssName()));
  tab.setType(TabType.ICON);
  assertEquals(TabType.ICON, tab.getType());
  assertTrue(tab.getElement().hasClassName(TabType.ICON.getCssName()));
}

代码示例来源:origin: GwtMaterialDesign/gwt-material

public void testTypes() {
  // given
  MaterialTab tab = getWidget();
  // when / then
  tab.setType(TabType.DEFAULT);
  assertEquals(TabType.DEFAULT, tab.getType());
  assertTrue(tab.getElement().getClassName().contains(TabType.DEFAULT.getCssName()));
  tab.setType(TabType.ICON);
  assertEquals(TabType.ICON, tab.getType());
  assertTrue(tab.getElement().hasClassName(TabType.ICON.getCssName()));
}

代码示例来源:origin: GwtMaterialDesign/gwt-material

public void testProgressBar() {
  // given
  MaterialNavBar navBar = getWidget();
  // when / then
  navBar.showProgress(ProgressType.INDETERMINATE);
  assertTrue(navBar.getNavWrapper().getWidget(2) instanceof MaterialProgress);
  assertEquals(navBar.getNavWrapper().getWidget(2).getElement().getClassName(), CssName.PROGRESS);
  MaterialProgress progress = (MaterialProgress) navBar.getNavWrapper().getWidget(2);
  assertEquals(ProgressType.INDETERMINATE, progress.getType());
  navBar.hideProgress();
  assertFalse(progress.isAttached());
}

代码示例来源:origin: com.github.gwtmaterialdesign/gwt-material

public void testProgressBar() {
  // given
  MaterialNavBar navBar = getWidget();
  // when / then
  navBar.showProgress(ProgressType.INDETERMINATE);
  assertTrue(navBar.getNavWrapper().getWidget(2) instanceof MaterialProgress);
  assertEquals(navBar.getNavWrapper().getWidget(2).getElement().getClassName(), CssName.PROGRESS);
  MaterialProgress progress = (MaterialProgress) navBar.getNavWrapper().getWidget(2);
  assertEquals(ProgressType.INDETERMINATE, progress.getType());
  navBar.hideProgress();
  assertFalse(progress.isAttached());
}

相关文章

微信公众号

最新文章

更多

Element类方法