public void createToolWindowContent(@NotNull ToolWindow toolWindow) {
    // Create runner UI layout
    RunnerLayoutUi.Factory factory = RunnerLayoutUi.Factory.getInstance(myProject);
    RunnerLayoutUi layoutUi = factory.create("", "", "session", myProject);

    // Adding actions
    DefaultActionGroup group = new DefaultActionGroup();
    layoutUi.getOptions().setLeftToolbar(group, ActionPlaces.UNKNOWN);

    Content console =
        layoutUi.createContent(
            GradleConsoleToolWindowFactory.ID, myConsoleView.getComponent(), "", null, null);
    AnAction[] consoleActions = myConsoleView.createConsoleActions();
    for (AnAction action : consoleActions) {
      if (!shouldIgnoreAction(action)) {
        group.add(action);
      }
    }
    layoutUi.addContent(console, 0, PlaceInGrid.right, false);

    JComponent layoutComponent = layoutUi.getComponent();
    myConsolePanel.add(layoutComponent, BorderLayout.CENTER);

    //noinspection ConstantConditions
    Content content =
        ContentFactory.SERVICE.getInstance().createContent(layoutComponent, null, true);
    toolWindow.getContentManager().addContent(content);
  }
Beispiel #2
0
 public RunnerLayoutUi getLayoutUi(Project project) {
   if (runnerLayoutUi == null) {
     runnerLayoutUi =
         RunnerLayoutUi.Factory.getInstance(project).create("buck", "buck", "buck", project);
   }
   return runnerLayoutUi;
 }
 public CompositeDiffPanel(
     Project project,
     final DiscloseMultiRequest request,
     final Window window,
     final Disposable parentDisposable) {
   myRequest = request;
   myWindow = window;
   myParentDisposable = parentDisposable;
   myUi =
       RunnerLayoutUi.Factory.getInstance(project)
           .create("Diff", "Diff", "Diff", parentDisposable);
   myUi.getComponent().setBorder(null);
   myUi.getOptions().setMinimizeActionEnabled(false);
   // myUi.getOptions().setTopToolbar()
   myMap = new HashMap<String, DiffViewer>();
 }