void saveSplitterProportions(final PlaceInGrid placeInGrid) {
    if (getRootPane() == null) return;
    final Rectangle bounds = getBounds();
    if (bounds.width == 0 && bounds.height == 0) return;

    final GridCellImpl cell = myPlaceInGrid2Cell.get(placeInGrid);

    if (!cell.isValidForCalculateProportions()) return;

    final TabImpl tab = (TabImpl) getTab();

    if (tab != null) {
      switch (placeInGrid) {
        case left:
          tab.setLeftProportion(getLeftProportion());
          break;
        case right:
          tab.setRightProportion(getRightProportion());
          break;
        case bottom:
          tab.setBottomProportion(getBottomPropertion());
        case center:
          break;
      }
    }
  }
 void add(final Content content) {
   GridCellImpl cell = getCellFor(content);
   cell.add(content);
   myContents.add(content);
   myContent2Cell.put(content, cell);
   Collections.sort(myContents, myContentComparator);
 }
 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 ActionCallback restoreLastUiState() {
    final ActionCallback result = new ActionCallback(myPlaceInGrid2Cell.values().size());
    for (final GridCellImpl cell : myPlaceInGrid2Cell.values()) {
      cell.restoreLastUiState().notifyWhenDone(result);
    }

    return result;
  }
 public void rebuildTabPopup() {
   final List<Content> contents = getContents();
   for (Content each : contents) {
     GridCellImpl cell = findCell(each);
     if (cell != null) {
       cell.rebuildPopupGroup();
     }
   }
 }
  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 processAlert(final Content content, final boolean activate) {
   GridCellImpl cell = getCellFor(content);
   cell.processAlert(content, activate);
 }
Ejemplo n.º 10
0
 public void saveUiState() {
   for (final GridCellImpl cell : myPlaceInGrid2Cell.values()) {
     cell.saveUiState();
   }
 }
Ejemplo n.º 11
0
 public void setToolbarHorizontal(boolean horizontal) {
   for (final GridCellImpl cell : myPlaceInGrid2Cell.values()) {
     cell.setToolbarHorizontal(horizontal);
   }
 }
Ejemplo n.º 12
0
 private void updateSelection(boolean isShowing) {
   for (GridCellImpl each : myPlaceInGrid2Cell.values()) {
     each.updateSelection(isShowing);
   }
 }