예제 #1
0
  @Override
  public void add(
      final WorkbenchPanelView newPanel,
      final WorkbenchPanelView targetPanel,
      final Integer preferredSize,
      final Integer preferredMinSize) {

    final Widget parent = targetPanel.asWidget().getParent();

    if (parent instanceof SimplePanel) {

      final SimplePanel sp = (SimplePanel) parent;
      final HorizontalSplitterPanel hsp =
          factory.newHorizontalSplitterPanel(
              newPanel, targetPanel, Position.EAST, preferredSize, preferredMinSize);

      sp.clear();
      sp.setWidget(hsp);

      // Adding an additional embedded ScrollPanel can cause scroll-bars to disappear
      // so ensure we set the sizes of the new Panel and it's children after the
      // browser has added the new DIVs to the HTML tree. This does occasionally
      // add slight flicker when adding a new Panel.
      scheduleResize(hsp);
    }
  }
 @Override
 public boolean selectPart(final PartDefinition part) {
   if (!contains(part)) {
     return false;
   }
   view.selectPart(part);
   return true;
 }
예제 #3
0
  @Override
  public void remove(final WorkbenchPanelView panel) {
    final HorizontalSplitterPanel vsp =
        (HorizontalSplitterPanel) panel.asWidget().getParent().getParent().getParent();
    final Widget parent = vsp.getParent();
    final Widget westWidget = vsp.getWidget(Position.WEST);

    vsp.clear();

    // Set parent's content to the WEST widget
    if (parent instanceof SimplePanel) {
      ((SimplePanel) parent).setWidget(westWidget);
    }

    if (westWidget instanceof RequiresResize) {
      scheduleResize((RequiresResize) westWidget);
    }
  }
 @Override
 public void setDefinition(final PanelDefinition definition) {
   this.definition = definition;
   view.setElementId(definition.getElementId());
 }
 @Override
 public void unmaximize() {
   view.unmaximize();
 }
 @Override
 public void maximize() {
   view.maximize();
 }
 @Override
 public void setFocus(final boolean hasFocus) {
   view.setFocus(hasFocus);
 }
 @Override
 public boolean removePart(final PartDefinition part) {
   view.removePart(part);
   return definition.removePart(part);
 }