コード例 #1
0
 @Override
 public GridCellImpl getCellFor(final Content content) {
   // check if the content is already in some cell
   GridCellImpl current = myContent2Cell.get(content);
   if (current != null) return current;
   // view may be shared between several contents with the same ID in different cells
   // (temporary contents like "Dump Stack" or "Console Result")
   View view = getStateFor(content);
   final GridCellImpl cell = myPlaceInGrid2Cell.get(view.getPlaceInGrid());
   assert cell != null : "Unknown place in grid: " + view.getPlaceInGrid().name();
   return cell;
 }
コード例 #2
0
  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;
      }
    }
  }
コード例 #3
0
 @Nullable
 public GridCellImpl findCell(final Content content) {
   return myContent2Cell.get(content);
 }