com.google.gwt.user.client.ui.Widget.removeStyleName()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(6.8k)|赞(0)|评价(0)|浏览(149)

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

Widget.removeStyleName介绍

暂无

代码示例

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

public boolean remove(Widget child) {
 if (child.getParent() != layoutPanel) {
  return false;
 }
 // Find the layoutData associated with this widget and remove it.
 for (int i = 0; i < layoutData.size(); ++i) {
  LayoutData data = layoutData.get(i);
  if (data.widget == child) {
   layoutPanel.remove(data.header);
   layoutPanel.remove(data.widget);
   data.header.removeStyleName(HEADER_STYLE);
   data.widget.removeStyleName(CONTENT_STYLE);
   layoutData.remove(i);
   if (selectedIndex == i) {
    selectedIndex = -1;
    if (layoutData.size() > 0) {
     showWidget(layoutData.get(0).widget);
    }
   } else {
    if (i <= selectedIndex) {
     selectedIndex--;
    }
    animate(animationDuration);
   }
   return true;
  }
 }
 return false;
}

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

/**
 * Sets the content widget which can be opened and closed by this panel. If
 * there is a preexisting content widget, it will be detached.
 * 
 * @param content the widget to be used as the content panel
 */
public void setContent(Widget content) {
 final Widget currentContent = getContent();
 // Remove existing content widget.
 if (currentContent != null) {
  contentWrapper.setWidget(null);
  currentContent.removeStyleName(STYLENAME_CONTENT);
 }
 // Add new content widget if != null.
 if (content != null) {
  contentWrapper.setWidget(content);
  content.addStyleName(STYLENAME_CONTENT);
  setContentDisplay(false);
 }
}

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

private void setSelectionStyle(Widget item, boolean selected) {
  if (item != null) {
   if (selected) {
    item.addStyleName("gwt-TabBarItem-selected");
    setStyleName(DOM.getParent(item.getElement()),
      "gwt-TabBarItem-wrapper-selected", true);
   } else {
    item.removeStyleName("gwt-TabBarItem-selected");
    setStyleName(DOM.getParent(item.getElement()),
      "gwt-TabBarItem-wrapper-selected", false);
   }
  }
 }
}

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

public boolean remove(int index) {
 if ((index < 0) || (index >= getWidgetCount())) {
  return false;
 }
 Widget child = getWidget(index);
 tabBar.remove(index);
 deckPanel.removeProtected(child);
 child.removeStyleName(CONTENT_STYLE);
 Tab tab = tabs.remove(index);
 tab.getWidget().removeFromParent();
 if (index == selectedIndex) {
  // If the selected tab is being removed, select the first tab (if there
  // is one).
  selectedIndex = -1;
  if (getWidgetCount() > 0) {
   selectTab(0);
  }
 } else if (index < selectedIndex) {
  // If the selectedIndex is greater than the one being removed, it needs
  // to be adjusted.
  --selectedIndex;
 }
 return true;
}

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

protected void unselectAll() {
  for (Widget btn : switches) {
    btn.removeStyleName("selected");
  }
}

代码示例来源:origin: dennisjzh/GwtMobile-UI

protected void removeTransitionStyles() {
  _from.removeStyleName(_transitionStyleName);
  _from.removeStyleName(CSS.T.start());
  _from.removeStyleName(CSS.T.out());
  _from.removeStyleName(CSS.T.reverse());
  _to.removeStyleName(_transitionStyleName);
  _to.removeStyleName(CSS.T.in());
  _to.removeStyleName(CSS.T.start());
  _to.removeStyleName(CSS.T.reverse());
}

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

protected void applyActiveStyle(Widget widget, boolean active) {
  if (active) {
    widget.removeStyleName(CssName.INACTIVE);
    widget.addStyleName(CssName.ACTIVE);
  } else {
    widget.removeStyleName(CssName.ACTIVE);
    widget.addStyleName(CssName.INACTIVE);
  }
}

代码示例来源:origin: com.googlecode.gwtupload/gwtupload

public void onMouseOut(MouseOutEvent event) {
  button.removeStyleName(STYLE_CLICKABLE_WIDGET + "-" + STYLE_BUTTON_OVER_SUFFIX);
  container.removeStyleDependentName(STYLE_BUTTON_OVER_SUFFIX);
 }
});

代码示例来源:origin: com.allen-sauer.gwt.dnd/gwt-dnd

@Override
public void setBehaviorMultipleSelection(boolean multipleSelectionAllowed) {
 this.multipleSelectionAllowed = multipleSelectionAllowed;
 for (Iterator<Widget> iterator = context.selectedWidgets.iterator(); iterator.hasNext();) {
  Widget widget = iterator.next();
  widget.removeStyleName(DragClientBundle.INSTANCE.css().selected());
  iterator.remove();
 }
}

代码示例来源:origin: net.sf.javaprinciples.client/client-presentation

public void clearError()
{
  errorMessage.setVisible(false);
  getContainer().removeStyleName("propertySheetContainerError");
}

代码示例来源:origin: oVirt/ovirt-engine

protected void removeActiveStyles() {
    for (int i = 0; i < dropdownMenu.getWidgetCount(); i++) {
      dropdownMenu.getWidget(i).removeStyleName(Styles.ACTIVE);
    }
  }
}

代码示例来源:origin: com.googlecode.mgwt/mgwt

@Override
public void clear() {
 Iterator<Widget> iterator = container.iterator();
 while (iterator.hasNext()) {
  Widget w = iterator.next();
  if (w instanceof IsFlexible) {
   w.removeStyleName(appearance.css().flexible());
  }
 }
 container.clear();
}

代码示例来源:origin: org.uberfire/uberfire-workbench-client-views-patternfly

@Override
  public void onShow(TabShowEvent showEvent) {
    for (Widget w : activatableWidgets) {
      if (showEvent.getTab().asWidget() != w) {
        w.removeStyleName(Styles.ACTIVE);
      }
    }
    TabPanelWithDropdowns.this.fireEvent(showEvent);
  }
};

代码示例来源:origin: org.uberfire/uberfire-workbench-client-views-patternfly

@Override
public void enablePage(int index) {
  if (!isValid(index)) {
    return;
  }
  final Widget tab = getTabBar().getWidget(index);
  tab.removeStyleName("disabled");
  enableWidget(tab);
}

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

@Override
public void enablePage(int index) {
  if (!isValid(index)) {
    return;
  }
  final Widget tab = getTabBar().getWidget(index);
  tab.removeStyleName("disabled");
  enableWidget(tab);
}

代码示例来源:origin: com.googlecode.mgwt/mgwt

@Override
public boolean remove(int index) {
 Widget w = getWidget(index);
 if (w instanceof IsFlexible) {
  w.removeStyleName(appearance.css().flexible());
 }
 return container.remove(index);
}

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

public void clearActiveState() {
    getChildren().forEach(widget -> {
      if (widget instanceof ListItem) {
        ListItem item = (ListItem) widget;
        if (item.getWidgetCount() > 0 && item.getWidget(0) != null) {
          item.getWidget(0).removeStyleName(CssName.ACTIVE);
        }
      }
    });
  }
}

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

public void clearActiveState() {
    getChildren().forEach(widget -> {
      if (widget instanceof ListItem) {
        ListItem item = (ListItem) widget;
        if (item.getWidgetCount() > 0 && item.getWidget(0) != null) {
          item.getWidget(0).removeStyleName(CssName.ACTIVE);
        }
      }
    });
  }
}

代码示例来源:origin: org.uberfire/uberfire-workbench-client

@Test
public void testUnMaximize() {
  workbenchLayout.maximize(widget);
  workbenchLayout.unmaximize(widget);
  verify(widget).addStyleName(WorkbenchLayoutImpl.UF_MAXIMIZED_PANEL);
  verify(widget).removeStyleName(WorkbenchLayoutImpl.UF_MAXIMIZED_PANEL);
  verify(((RequiresResize) widget),
      never()).onResize();
}

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

@Test
public void testUnMaximize() {
  workbenchLayout.maximize(widget);
  workbenchLayout.unmaximize(widget);
  verify(widget).addStyleName(WorkbenchLayoutImpl.UF_MAXIMIZED_PANEL);
  verify(widget).removeStyleName(WorkbenchLayoutImpl.UF_MAXIMIZED_PANEL);
  verify(((RequiresResize) widget),
      never()).onResize();
}

相关文章