Exemplo n.º 1
0
  protected AbstractPerspective(
      @NotNull String perspectiveId,
      @NotNull PerspectiveViewImpl view,
      @NotNull PartStackPresenterFactory stackPresenterFactory,
      @NotNull PartStackViewFactory partViewFactory,
      @NotNull WorkBenchControllerFactory controllerFactory,
      @NotNull EventBus eventBus) {
    this.view = view;
    this.perspectiveId = perspectiveId;
    this.partStacks = new HashMap<>();

    PartStackView navigationView = partViewFactory.create(LEFT, view.getLeftPanel());

    leftPartController =
        controllerFactory.createController(view.getSplitPanel(), view.getNavigationPanel());
    PartStack navigationPartStack =
        stackPresenterFactory.create(navigationView, leftPartController);
    partStacks.put(NAVIGATION, navigationPartStack);

    PartStackView informationView = partViewFactory.create(BELOW, view.getBottomPanel());

    belowPartController =
        controllerFactory.createController(view.getSplitPanel(), view.getInformationPanel());
    PartStack informationStack = stackPresenterFactory.create(informationView, belowPartController);
    partStacks.put(INFORMATION, informationStack);

    PartStackView toolingView = partViewFactory.create(RIGHT, view.getRightPanel());

    rightPartController =
        controllerFactory.createController(view.getSplitPanel(), view.getToolPanel());
    PartStack toolingPartStack = stackPresenterFactory.create(toolingView, rightPartController);
    partStacks.put(TOOLING, toolingPartStack);

    /* Makes splitters much better */
    view.tuneSplitters();

    eventBus.addHandler(ActivePartChangedEvent.TYPE, this);
  }
Exemplo n.º 2
0
  @Before
  public void setUp() {

    when(view.getLeftPanel()).thenReturn(panel);
    when(view.getRightPanel()).thenReturn(panel);
    when(view.getBottomPanel()).thenReturn(panel);

    when(view.getSplitPanel()).thenReturn(layoutPanel);

    when(view.getNavigationPanel()).thenReturn(simplePanel);
    when(view.getInformationPanel()).thenReturn(simpleLayoutPanel);
    when(view.getToolPanel()).thenReturn(simplePanel);

    when(controllerFactory.createController(
            Matchers.<SplitLayoutPanel>anyObject(), Matchers.<SimplePanel>anyObject()))
        .thenReturn(workBenchController);

    when(partViewFactory.create(
            Matchers.<PartStackView.TabPosition>anyObject(), Matchers.<FlowPanel>anyObject()))
        .thenReturn(partStackView);

    when(stackPresenterFactory.create(
            Matchers.<PartStackView>anyObject(), Matchers.<WorkBenchPartController>anyObject()))
        .thenReturn(partStackPresenter);

    perspective =
        new ProjectPerspective(
            view,
            editorMultiPartStackPresenter,
            stackPresenterFactory,
            partViewFactory,
            controllerFactory,
            eventBus,
            dynaProvider,
            notificationManager);
  }