use of com.intellij.openapi.actionSystem.ActionToolbar in project google-cloud-intellij by GoogleCloudPlatform.
the class GcsToolWindowPanel method createToolbar.
private JPanel createToolbar() {
DefaultActionGroup group = new DefaultActionGroup();
group.add(new RefreshAction());
ActionToolbar actionToolBar = ActionManager.getInstance().createActionToolbar(GCS_PANEL_TOOLBAR_ACTION, group, true);
return JBUI.Panels.simplePanel(actionToolBar.getComponent());
}
use of com.intellij.openapi.actionSystem.ActionToolbar in project google-cloud-intellij by GoogleCloudPlatform.
the class CloudDebugHistoricalSnapshotsTest method setUp.
@Before
public void setUp() {
MockApplication application = new MyMockApplicationEx(parent);
ActionManagerEx manager = Mockito.mock(ActionManagerEx.class);
ActionToolbar actionToolbar = Mockito.mock(ActionToolbar.class);
Mockito.when(actionToolbar.getComponent()).thenReturn(new JComponent() {
});
Mockito.when(manager.createActionToolbar(Mockito.anyString(), Mockito.any(ActionGroup.class), Mockito.anyBoolean())).thenReturn(actionToolbar);
Mockito.when(manager.createActionToolbar(Mockito.anyString(), Mockito.any(ActionGroup.class), Mockito.anyBoolean(), Mockito.anyBoolean())).thenReturn(actionToolbar);
application.addComponent(ActionManager.class, manager);
application.registerService(UISettings.class);
ApplicationManager.setApplication(application, parent);
XDebugSession session = Mockito.mock(XDebugSession.class);
Mockito.when(handler.getProcess()).thenReturn(mockProcess);
Mockito.when(mockProcess.getXDebugSession()).thenReturn(session);
}
use of com.intellij.openapi.actionSystem.ActionToolbar in project freeline by alibaba.
the class FreelineTerminal method createTerminalInContentPanel.
/**
* 创建Terminal panel
*
* @param terminalRunner
* @param toolWindow
* @return
*/
private Content createTerminalInContentPanel(@NotNull AbstractTerminalRunner terminalRunner, @NotNull final ToolWindow toolWindow) {
SimpleToolWindowPanel panel = new SimpleToolWindowPanel(false, true);
Content content = ContentFactory.SERVICE.getInstance().createContent(panel, "", false);
content.setCloseable(true);
myTerminalWidget = terminalRunner.createTerminalWidget(content);
panel.setContent(myTerminalWidget.getComponent());
panel.addFocusListener(this);
ActionToolbar toolbar = createToolbar(terminalRunner, myTerminalWidget, toolWindow);
toolbar.setTargetComponent(panel);
panel.setToolbar(toolbar.getComponent());
content.setPreferredFocusableComponent(myTerminalWidget.getComponent());
return content;
}
use of com.intellij.openapi.actionSystem.ActionToolbar in project android by JetBrains.
the class ProjectProfileSelectionDialog method createTreePanel.
@NotNull
static JPanel createTreePanel(@NotNull CheckboxTreeView tree) {
JPanel treePanel = new JPanel(new BorderLayout());
DefaultActionGroup group = new DefaultActionGroup();
CommonActionsManager actions = CommonActionsManager.getInstance();
group.addAll(actions.createExpandAllAction(tree, treePanel), actions.createCollapseAllAction(tree, treePanel));
ActionToolbar actionToolBar = ActionManager.getInstance().createActionToolbar("AndroidProjectProfileSelection", group, true);
JPanel buttonsPanel = new JPanel(new BorderLayout());
buttonsPanel.add(actionToolBar.getComponent(), BorderLayout.CENTER);
buttonsPanel.setBorder(new SideBorder(JBColor.border(), SideBorder.TOP | SideBorder.LEFT | SideBorder.RIGHT, 1));
treePanel.add(buttonsPanel, BorderLayout.NORTH);
treePanel.add(ScrollPaneFactory.createScrollPane(tree), BorderLayout.CENTER);
return treePanel;
}
use of com.intellij.openapi.actionSystem.ActionToolbar in project intellij-plugins by JetBrains.
the class IDEtalkMessagesWindowImpl method createToolWindowComponent.
@Override
protected void createToolWindowComponent() {
myContentFactory = ContentFactory.SERVICE.getInstance();
TabbedPaneContentUI contentUI = new TabbedPaneContentUI(SwingConstants.TOP);
myContentManager = myContentFactory.createContentManager(contentUI, true, myProject);
try {
myTabsWrapper = getWrapper(contentUI);
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
}
myContentManager.addContentManagerListener(new ContentManagerAdapter() {
@Override
public void selectionChanged(ContentManagerEvent event) {
super.selectionChanged(event);
// Process tab switching:
UIUtil.invokeLater(() -> processMessagesOfVisibleTab());
}
});
myPanel = new NonOpaquePanel(new BorderLayout());
UIUtil.runWhenShown(myPanel, () -> showAllTabsOfUsersWithMessages());
myPanel.add(myContentManager.getComponent());
AnAction toolbarGroup = myActionManager.getAction("IDEtalk.MessageWindowToolbar");
if (toolbarGroup != null) {
ActionToolbar toolbar = myActionManager.createActionToolbar(PLACE_TOOLBAR, (ActionGroup) toolbarGroup, false);
myPanel.add(toolbar.getComponent(), BorderLayout.WEST);
}
}
Aggregations