コード例 #1
0
 private void clearTabSelection(boolean setDefaultIcon) {
   Iterator<Component> iterator = navigatorContainer.iterator();
   if (setDefaultIcon) {
     while (iterator.hasNext()) {
       Component btn = iterator.next();
       if (btn.getStyleName().contains(TAB_SELECTED_STYLENAME)) {
         btn.removeStyleName(TAB_SELECTED_STYLENAME);
         setDefaulButtonIcon(btn, false);
       }
     }
   } else {
     while (iterator.hasNext()) {
       Component btn = iterator.next();
       if (btn.getStyleName().contains(TAB_SELECTED_STYLENAME)) {
         btn.removeStyleName(TAB_SELECTED_STYLENAME);
       }
     }
   }
 }
コード例 #2
0
 public void clearMenuSelection(HorizontalLayout menu) {
   for (Iterator<Component> it = menu.getComponentIterator(); it.hasNext(); ) {
     Component next = it.next();
     if (next instanceof NativeButton) {
       next.removeStyleName("selected");
     } else if (next instanceof DragAndDropWrapper) {
       // Wow, this is ugly (even uglier than the rest of the code)
       ((DragAndDropWrapper) next).iterator().next().removeStyleName("selected");
     }
   }
 }
コード例 #3
0
  private void toggleMaximized(final Component panel, final boolean maximized) {
    for (Iterator<Component> it = root.iterator(); it.hasNext(); ) {
      it.next().setVisible(!maximized);
    }
    dashboardPanels.setVisible(true);

    for (Iterator<Component> it = dashboardPanels.iterator(); it.hasNext(); ) {
      Component c = it.next();
      c.setVisible(!maximized);
    }

    if (maximized) {
      panel.setVisible(true);
      panel.addStyleName("max");
    } else {
      panel.removeStyleName("max");
    }
  }