Search in sources :

Example 1 with IntelliSortChooserPopupAction

use of com.intellij.vcs.log.ui.actions.IntelliSortChooserPopupAction in project intellij-community by JetBrains.

the class MainFrame method createActionsToolbar.

private JComponent createActionsToolbar() {
    DefaultActionGroup toolbarGroup = new DefaultActionGroup();
    toolbarGroup.add(ActionManager.getInstance().getAction(VcsLogActionPlaces.TOOLBAR_ACTION_GROUP));
    DefaultActionGroup mainGroup = new DefaultActionGroup();
    mainGroup.add(ActionManager.getInstance().getAction(VcsLogActionPlaces.VCS_LOG_TEXT_FILTER_SETTINGS_ACTION));
    mainGroup.add(new Separator());
    mainGroup.add(myFilterUi.createActionGroup());
    mainGroup.addSeparator();
    if (BekUtil.isBekEnabled()) {
        if (BekUtil.isLinearBekEnabled()) {
            mainGroup.add(new IntelliSortChooserPopupAction());
        // can not register both of the actions in xml file, choosing to register an action for the "outer world"
        // I can of course if linear bek is enabled replace the action on start but why bother
        } else {
            mainGroup.add(ActionManager.getInstance().getAction(VcsLogActionPlaces.VCS_LOG_INTELLI_SORT_ACTION));
        }
    }
    mainGroup.add(toolbarGroup);
    ActionToolbar toolbar = createActionsToolbar(mainGroup);
    Wrapper textFilter = new Wrapper(myTextFilter);
    textFilter.setVerticalSizeReferent(toolbar.getComponent());
    textFilter.setBorder(JBUI.Borders.emptyLeft(5));
    ActionToolbar settings = createActionsToolbar(new DefaultActionGroup(ActionManager.getInstance().getAction(VcsLogActionPlaces.VCS_LOG_QUICK_SETTINGS_ACTION)));
    settings.setReservePlaceAutoPopupIcon(false);
    settings.setLayoutPolicy(ActionToolbar.NOWRAP_LAYOUT_POLICY);
    JPanel panel = new JPanel(new MigLayout("ins 0, fill", "[left]0[left, fill]push[right]", "center"));
    panel.add(textFilter);
    panel.add(toolbar.getComponent());
    panel.add(settings.getComponent());
    return panel;
}
Also used : Wrapper(com.intellij.ui.components.panels.Wrapper) MigLayout(net.miginfocom.swing.MigLayout) IntelliSortChooserPopupAction(com.intellij.vcs.log.ui.actions.IntelliSortChooserPopupAction)

Aggregations

Wrapper (com.intellij.ui.components.panels.Wrapper)1 IntelliSortChooserPopupAction (com.intellij.vcs.log.ui.actions.IntelliSortChooserPopupAction)1 MigLayout (net.miginfocom.swing.MigLayout)1