public ActionCallback restoreLastUiState() {
    final ActionCallback result = new ActionCallback(myPlaceInGrid2Cell.values().size());
    for (final GridCellImpl cell : myPlaceInGrid2Cell.values()) {
      cell.restoreLastUiState().notifyWhenDone(result);
    }

    return result;
  }
 public List<SwitchTarget> getTargets(boolean onlyVisible) {
   Collection<GridCellImpl> cells = myPlaceInGrid2Cell.values();
   ArrayList<SwitchTarget> result = new ArrayList<SwitchTarget>();
   for (GridCellImpl each : cells) {
     result.addAll(each.getTargets(onlyVisible));
   }
   return result;
 }
  public boolean updateGridUI() {
    for (final GridCellImpl cell : myPlaceInGrid2Cell.values()) {
      cell.setHideTabs(myContents.size() == 1);
    }

    final Content onlyContent = myContents.get(0);

    return onlyContent.getSearchComponent() != null;
  }
  public void processAddToUi(boolean restoreProportions) {
    if (restoreProportions) {
      for (final GridCellImpl cell : myPlaceInGrid2Cell.values()) {
        cell.restoreProportions();
      }
    }

    updateSelection(true);
  }
  @Nullable
  public SwitchTarget getCellFor(Component c) {
    Component eachParent = c;
    while (eachParent != null) {
      for (GridCellImpl eachCell : myContent2Cell.values()) {
        if (eachCell.contains(eachParent)) {
          return eachCell.getTargetForSelection();
        }
      }

      eachParent = eachParent.getParent();
    }

    return null;
  }
 public void saveUiState() {
   for (final GridCellImpl cell : myPlaceInGrid2Cell.values()) {
     cell.saveUiState();
   }
 }
 public void setToolbarHorizontal(boolean horizontal) {
   for (final GridCellImpl cell : myPlaceInGrid2Cell.values()) {
     cell.setToolbarHorizontal(horizontal);
   }
 }
 private void updateSelection(boolean isShowing) {
   for (GridCellImpl each : myPlaceInGrid2Cell.values()) {
     each.updateSelection(isShowing);
   }
 }