Search in sources :

Example 1 with StatusToolbar

use of jetbrains.communicator.ide.StatusToolbar in project intellij-plugins by JetBrains.

the class JabberIdeaUI method initPerProject.

public void initPerProject(MutablePicoContainer projectLevelContainer) {
    StatusToolbar statusToolbar = ((StatusToolbar) projectLevelContainer.getComponentInstanceOfType(StatusToolbar.class));
    if (statusToolbar != null) {
        statusToolbar.addToolbarCommand(JabberConnectionCommand.class);
    }
    if (!ourInitialized && ApplicationManager.getApplication() != null && !Pico.isUnitTest()) {
        DefaultActionGroup group = ((DefaultActionGroup) ActionManager.getInstance().getAction("IDEtalk.OptionsGroup"));
        if (group != null) {
            group.add(new EditJabberSettingsAction(), new Constraints(Anchor.FIRST, ""));
        }
        ourInitialized = true;
    }
}
Also used : StatusToolbar(jetbrains.communicator.ide.StatusToolbar) Constraints(com.intellij.openapi.actionSystem.Constraints) DefaultActionGroup(com.intellij.openapi.actionSystem.DefaultActionGroup)

Example 2 with StatusToolbar

use of jetbrains.communicator.ide.StatusToolbar in project intellij-plugins by JetBrains.

the class IDEtalkToolWindow method createToolWindowComponent.

@Override
protected void createToolWindowComponent() {
    StartupManager.getInstance(myProject).registerPostStartupActivity(() -> initializeTransports(myProject.getName()));
    StatusToolbar statusToolbar = ((StatusToolbar) myContainer.getComponentInstanceOfType(StatusToolbar.class));
    DefaultActionGroup toolbarActions = new DefaultActionGroup();
    ActionGroup actions = (ActionGroup) myActionManager.getAction("IDEtalk");
    if (actions != null) {
        toolbarActions.addAll(actions);
    }
    toolbarActions.add(new ContextHelpAction("reference.toolWindows.idetalk"));
    ActionGroup treeActions = (ActionGroup) myActionManager.getAction("IDEtalk_Tree");
    JPanel toolbarPanel = new JPanel();
    toolbarPanel.setLayout(new BoxLayout(toolbarPanel, BoxLayout.X_AXIS));
    toolbarPanel.add(DropDownButton.wrap(new DropDownButton(new FindUsersAction(), IconUtil.getAddIcon())));
    toolbarPanel.add(createToolbar(toolbarActions).getComponent());
    toolbarPanel.add(Box.createHorizontalStrut(10));
    toolbarPanel.add(new SeparatorComponent(JBColor.LIGHT_GRAY, SeparatorOrientation.VERTICAL));
    toolbarPanel.add(Box.createHorizontalStrut(3));
    toolbarPanel.add(DropDownButton.wrap(new OptionsButton()));
    toolbarPanel.add(statusToolbar.createComponent());
    toolbarPanel.add(new JPanel() {

        @Override
        public Dimension getPreferredSize() {
            return new Dimension(Short.MAX_VALUE, 10);
        }
    });
    if (treeActions != null) {
        JComponent component = createToolbar(treeActions).getComponent();
        component.setMinimumSize(component.getPreferredSize());
        toolbarPanel.add(component);
    }
    toolbarPanel.setAlignmentX(0);
    myTopPanel.add(toolbarPanel);
    myPanel.add(myTopPanel, BorderLayout.NORTH);
    myPanel.add(ScrollPaneFactory.createScrollPane(myUserListComponent.getComponent()));
    ActionGroup group = (ActionGroup) myActionManager.getAction("IDEtalkPopup");
    if (group != null) {
        IDEAFacade.installPopupMenu(group, myUserListComponent.getTree(), myActionManager);
    }
}
Also used : DropDownButton(jetbrains.communicator.idea.actions.DropDownButton) DefaultActionGroup(com.intellij.openapi.actionSystem.DefaultActionGroup) ContextHelpAction(com.intellij.ide.actions.ContextHelpAction) StatusToolbar(jetbrains.communicator.ide.StatusToolbar) SeparatorComponent(com.intellij.ui.SeparatorComponent) ActionGroup(com.intellij.openapi.actionSystem.ActionGroup) DefaultActionGroup(com.intellij.openapi.actionSystem.DefaultActionGroup) OptionsButton(jetbrains.communicator.idea.actions.OptionsButton) FindUsersAction(jetbrains.communicator.idea.actions.FindUsersAction)

Aggregations

DefaultActionGroup (com.intellij.openapi.actionSystem.DefaultActionGroup)2 StatusToolbar (jetbrains.communicator.ide.StatusToolbar)2 ContextHelpAction (com.intellij.ide.actions.ContextHelpAction)1 ActionGroup (com.intellij.openapi.actionSystem.ActionGroup)1 Constraints (com.intellij.openapi.actionSystem.Constraints)1 SeparatorComponent (com.intellij.ui.SeparatorComponent)1 DropDownButton (jetbrains.communicator.idea.actions.DropDownButton)1 FindUsersAction (jetbrains.communicator.idea.actions.FindUsersAction)1 OptionsButton (jetbrains.communicator.idea.actions.OptionsButton)1