use of com.intellij.execution.ui.layout.impl.JBRunnerTabs in project android by JetBrains.
the class AndroidToolWindowFixture method selectTab.
private void selectTab(@NotNull final String tabName) {
JBRunnerTabs tabs = myRobot.finder().findByType(getContentPanel(), JBRunnerTabs.class);
TabLabel tabLabel = myRobot.finder().find(tabs, new GenericTypeMatcher<TabLabel>(TabLabel.class) {
@Override
protected boolean isMatching(@NotNull TabLabel component) {
return tabName.equals(component.toString()) && component.getParent() == tabs;
}
});
myRobot.click(tabLabel);
}
use of com.intellij.execution.ui.layout.impl.JBRunnerTabs in project flutter-intellij by flutter.
the class ObservatoryActionGroup method addInspector.
private void addInspector(FlutterApp app, @Nullable InspectorService inspectorService, ToolWindow toolWindow) {
final ContentManager contentManager = toolWindow.getContentManager();
final SimpleToolWindowPanel toolWindowPanel = new SimpleToolWindowPanel(true);
final JBRunnerTabs runnerTabs = new JBRunnerTabs(myProject, ActionManager.getInstance(), null, this);
final List<FlutterDevice> existingDevices = new ArrayList<>();
for (FlutterApp otherApp : perAppViewState.keySet()) {
existingDevices.add(otherApp.device());
}
final JPanel tabContainer = new JPanel(new BorderLayout());
final Content content = contentManager.getFactory().createContent(null, app.device().getUniqueName(existingDevices), false);
tabContainer.add(runnerTabs.getComponent(), BorderLayout.CENTER);
content.setComponent(tabContainer);
content.putUserData(ToolWindow.SHOW_CONTENT_ICON, Boolean.TRUE);
content.setIcon(FlutterIcons.Phone);
contentManager.addContent(content);
final PerAppState state = getOrCreateStateForApp(app);
assert (state.content == null);
state.content = content;
final DefaultActionGroup toolbarGroup = createToolbar(toolWindow, app, runnerTabs);
toolWindowPanel.setToolbar(ActionManager.getInstance().createActionToolbar("FlutterViewToolbar", toolbarGroup, true).getComponent());
// If the inspector is available (non-profile mode), then show it.
if (inspectorService != null) {
addInspectorPanel("Widgets", runnerTabs, state, InspectorService.FlutterTreeType.widget, app, inspectorService, toolWindow, toolbarGroup, true);
addInspectorPanel("Render Tree", runnerTabs, state, InspectorService.FlutterTreeType.renderObject, app, inspectorService, toolWindow, toolbarGroup, false);
} else {
toolbarGroup.add(new OverflowAction(this, app));
final ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar("InspectorToolbar", toolbarGroup, true);
final JComponent toolbarComponent = toolbar.getComponent();
toolbarComponent.setBorder(IdeBorderFactory.createBorder(SideBorder.BOTTOM));
tabContainer.add(toolbarComponent, BorderLayout.NORTH);
// Add a message about the inspector not being available in profile mode.
final JBLabel label = new JBLabel("Widget info not available in profile mode", SwingConstants.CENTER);
label.setForeground(UIUtil.getLabelDisabledForeground());
tabContainer.add(label, BorderLayout.CENTER);
}
final boolean isVertical = !toolWindow.getAnchor().isHorizontal();
if (isVertical) {
final JPanel dashboardsPanel = new JPanel(new BorderLayout());
tabContainer.add(dashboardsPanel, BorderLayout.SOUTH);
if (FlutterSettings.getInstance().isShowHeapDisplay()) {
dashboardsPanel.add(FPSDisplay.createJPanelView(runnerTabs, app), BorderLayout.NORTH);
dashboardsPanel.add(HeapDisplay.createJPanelView(runnerTabs, app), BorderLayout.SOUTH);
}
}
}
Aggregations