Search in sources :

Example 16 with ActionToolbar

use of com.intellij.openapi.actionSystem.ActionToolbar in project intellij-community by JetBrains.

the class RemoteFilePanel method initToolbar.

private void initToolbar(Project project) {
    DefaultActionGroup group = new DefaultActionGroup();
    group.add(new RefreshRemoteFileAction(myVirtualFile));
    for (RemoteFileEditorActionProvider actionProvider : RemoteFileEditorActionProvider.EP_NAME.getExtensions()) {
        group.addAll(actionProvider.createToolbarActions(project, myVirtualFile));
    }
    final ActionToolbar actionToolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN, group, true);
    myToolbarPanel.add(actionToolbar.getComponent(), BorderLayout.CENTER);
}
Also used : ActionToolbar(com.intellij.openapi.actionSystem.ActionToolbar) DefaultActionGroup(com.intellij.openapi.actionSystem.DefaultActionGroup)

Example 17 with ActionToolbar

use of com.intellij.openapi.actionSystem.ActionToolbar in project intellij-community by JetBrains.

the class ConsoleManager method createConsole.

private void createConsole(@NotNull final NetService netService) {
    TextConsoleBuilder consoleBuilder = TextConsoleBuilderFactory.getInstance().createBuilder(netService.getProject());
    netService.configureConsole(consoleBuilder);
    console = consoleBuilder.getConsole();
    ApplicationManager.getApplication().invokeLater(() -> {
        ActionGroup actionGroup = netService.getConsoleToolWindowActions();
        ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN, actionGroup, false);
        SimpleToolWindowPanel toolWindowPanel = new SimpleToolWindowPanel(false, true);
        toolWindowPanel.setContent(console.getComponent());
        toolWindowPanel.setToolbar(toolbar.getComponent());
        ToolWindow toolWindow = ToolWindowManager.getInstance(netService.getProject()).registerToolWindow(netService.getConsoleToolWindowId(), false, ToolWindowAnchor.BOTTOM, netService.getProject(), true);
        toolWindow.setIcon(netService.getConsoleToolWindowIcon());
        Content content = ContentFactory.SERVICE.getInstance().createContent(toolWindowPanel, "", false);
        Disposer.register(content, console);
        toolWindow.getContentManager().addContent(content);
    }, netService.getProject().getDisposed());
}
Also used : ToolWindow(com.intellij.openapi.wm.ToolWindow) TextConsoleBuilder(com.intellij.execution.filters.TextConsoleBuilder) ActionGroup(com.intellij.openapi.actionSystem.ActionGroup) Content(com.intellij.ui.content.Content) ActionToolbar(com.intellij.openapi.actionSystem.ActionToolbar) SimpleToolWindowPanel(com.intellij.openapi.ui.SimpleToolWindowPanel)

Example 18 with ActionToolbar

use of com.intellij.openapi.actionSystem.ActionToolbar in project psiviewer by cmf.

the class PsiViewerProjectComponent method initToolWindow.

public void initToolWindow() {
    _viewerPanel = new PsiViewerPanel(this);
    _viewerPanel.addPropertyChangeListener("ancestor", new PropertyChangeListener() {

        public void propertyChange(PropertyChangeEvent evt) {
            handleCurrentState();
        }
    });
    ActionManager actionManager = ActionManager.getInstance();
    DefaultActionGroup actionGroup = new DefaultActionGroup(ID_ACTION_GROUP, false);
    actionGroup.add(new PropertyToggleAction("Filter Whitespace", "Remove whitespace elements", Helpers.getIcon(ICON_FILTER_WHITESPACE), this, "filterWhitespace"));
    actionGroup.add(new PropertyToggleAction("Highlight", "Highlight selected PSI element", Helpers.getIcon(ICON_TOGGLE_HIGHLIGHT), this, "highlighted"));
    actionGroup.add(new PropertyToggleAction("Properties", "Show PSI element properties", AllIcons.General.Settings, this, "showProperties"));
    actionGroup.add(new PropertyToggleAction("Autoscroll to Source", "Autoscroll to Source", AllIcons.General.AutoscrollToSource, this, "autoScrollToSource"));
    actionGroup.add(new PropertyToggleAction("Autoscroll from Source", "Autoscroll from Source111", AllIcons.General.AutoscrollFromSource, this, "autoScrollFromSource"));
    ActionToolbar toolBar = actionManager.createActionToolbar(ID_ACTION_TOOLBAR, actionGroup, true);
    JPanel panel = new JPanel(new HorizontalLayout(0));
    panel.add(toolBar.getComponent());
    myLanguagesComboBox = new ComboBox();
    panel.add(myLanguagesComboBox);
    updateLanguagesList(Collections.<Language>emptyList());
    _viewerPanel.add(panel, BorderLayout.NORTH);
    ToolWindow toolWindow = getToolWindow();
    toolWindow.setIcon(Helpers.getIcon(ICON_TOOL_WINDOW));
    _viewerPanel.setToolWindow(toolWindow);
    _editorListener = new EditorListener(_viewerPanel, _project);
}
Also used : ActionManager(com.intellij.openapi.actionSystem.ActionManager) ToolWindow(com.intellij.openapi.wm.ToolWindow) PropertyChangeEvent(java.beans.PropertyChangeEvent) PropertyChangeListener(java.beans.PropertyChangeListener) PsiViewerPanel(idea.plugin.psiviewer.view.PsiViewerPanel) ComboBox(com.intellij.openapi.ui.ComboBox) PropertyToggleAction(idea.plugin.psiviewer.controller.actions.PropertyToggleAction) ActionToolbar(com.intellij.openapi.actionSystem.ActionToolbar) DefaultActionGroup(com.intellij.openapi.actionSystem.DefaultActionGroup) HorizontalLayout(com.intellij.ui.components.panels.HorizontalLayout)

Example 19 with ActionToolbar

use of com.intellij.openapi.actionSystem.ActionToolbar in project intellij-plugins by StepicOrg.

the class StudyToolWindow method createToolbarPanel.

private JPanel createToolbarPanel(ActionGroup group) {
    final ActionToolbar actionToolBar = ActionManager.getInstance().createActionToolbar("Study", group, true);
    BorderLayoutPanel toolBar = JBUI.Panels.simplePanel(actionToolBar.getComponent());
    toolBar.addToRight(rightPanel);
    return toolBar;
}
Also used : ActionToolbar(com.intellij.openapi.actionSystem.ActionToolbar) BorderLayoutPanel(com.intellij.util.ui.components.BorderLayoutPanel)

Aggregations

ActionToolbar (com.intellij.openapi.actionSystem.ActionToolbar)19 DefaultActionGroup (com.intellij.openapi.actionSystem.DefaultActionGroup)10 ActionGroup (com.intellij.openapi.actionSystem.ActionGroup)5 ActionManager (com.intellij.openapi.actionSystem.ActionManager)4 Content (com.intellij.ui.content.Content)4 ToolWindow (com.intellij.openapi.wm.ToolWindow)3 SimpleToolWindowPanel (com.intellij.openapi.ui.SimpleToolWindowPanel)2 NotNull (org.jetbrains.annotations.NotNull)2 TextConsoleBuilder (com.intellij.execution.filters.TextConsoleBuilder)1 ConsoleViewContentType (com.intellij.execution.ui.ConsoleViewContentType)1 CommonActionsManager (com.intellij.ide.CommonActionsManager)1 NextOccurenceToolbarAction (com.intellij.ide.actions.NextOccurenceToolbarAction)1 PreviousOccurenceToolbarAction (com.intellij.ide.actions.PreviousOccurenceToolbarAction)1 MockApplication (com.intellij.mock.MockApplication)1 AnAction (com.intellij.openapi.actionSystem.AnAction)1 ActionManagerEx (com.intellij.openapi.actionSystem.ex.ActionManagerEx)1 ComboBox (com.intellij.openapi.ui.ComboBox)1 CommittedChangeList (com.intellij.openapi.vcs.versionBrowser.CommittedChangeList)1 ToolWindowManager (com.intellij.openapi.wm.ToolWindowManager)1 HorizontalLayout (com.intellij.ui.components.panels.HorizontalLayout)1