예제 #1
0
 private void closeTreeComponent() {
   myActionGroup.unregisterCustomShortcutSet(myComponent);
   myGoToNeighbourRootActions.previous().unregisterCustomShortcutSet(myComponent);
   myGoToNeighbourRootActions.next().unregisterCustomShortcutSet(myComponent);
   myPanel.setFirstComponent(null);
   myComponent.remove(myToolbar.getComponent());
 }
예제 #2
0
  @Nullable
  @Override
  protected JComponent createCenterPanel() {
    myPanel.setSplitterProportionKey(getClass().getName() + "ModelTreeSplitter");
    myTree = new ModelDifferenceDialog.ModelDifferenceTree();
    myPanel.setFirstComponent(ScrollPaneFactory.createScrollPane(myTree));
    myPanel.setSecondComponent(myNoRootPanel);

    myGoToNeighbourRootActions = new ModelDifferenceDialog.MyGoToNeighbourRootActions();
    myGoToNeighbourRootActions
        .previous()
        .registerCustomShortcutSet(GoToNeighbourRootActions.PREV_ROOT_SHORTCUT, myComponent);
    myGoToNeighbourRootActions
        .next()
        .registerCustomShortcutSet(GoToNeighbourRootActions.NEXT_ROOT_SHORTCUT, myComponent);

    myToolbar =
        ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN, myActionGroup, true);
    myToolbar.updateActionsImmediately();

    myComponent.add(myToolbar.getComponent(), BorderLayout.NORTH);
    myComponent.add(myPanel, BorderLayout.CENTER);
    myComponent.add(myStatusBar, BorderLayout.SOUTH);

    Dimension size = DimensionService.getInstance().getSize(getDimensionServiceKey());
    if (size == null) {
      myComponent.setPreferredSize(new Dimension(500, 700));
    }

    return myComponent;
  }