Search in sources :

Example 1 with VcsLogUiProperties

use of com.intellij.vcs.log.impl.VcsLogUiProperties in project intellij-community by JetBrains.

the class IntelliSortChooserPopupAction method actionPerformed.

@Override
public void actionPerformed(AnActionEvent e) {
    VcsLogUi logUI = e.getRequiredData(VcsLogDataKeys.VCS_LOG_UI);
    VcsLogUiProperties properties = e.getRequiredData(VcsLogInternalDataKeys.LOG_UI_PROPERTIES);
    ActionGroup settingsGroup = new DefaultActionGroup(ContainerUtil.map(PermanentGraph.SortType.values(), (Function<PermanentGraph.SortType, AnAction>) sortType -> new SelectIntelliSortTypeAction(logUI, properties, sortType)));
    ListPopup popup = JBPopupFactory.getInstance().createActionGroupPopup(null, settingsGroup, e.getDataContext(), JBPopupFactory.ActionSelectionAid.MNEMONICS, true, ToolWindowContentUi.POPUP_PLACE);
    Component component = e.getInputEvent().getComponent();
    if (component instanceof ActionButtonComponent) {
        popup.showUnderneathOf(component);
    } else {
        popup.showInCenterOf(component);
    }
}
Also used : Function(com.intellij.util.Function) MainVcsLogUiProperties(com.intellij.vcs.log.impl.MainVcsLogUiProperties) VcsLogUiProperties(com.intellij.vcs.log.impl.VcsLogUiProperties) ListPopup(com.intellij.openapi.ui.popup.ListPopup) VcsLogUi(com.intellij.vcs.log.VcsLogUi) PermanentGraph(com.intellij.vcs.log.graph.PermanentGraph)

Example 2 with VcsLogUiProperties

use of com.intellij.vcs.log.impl.VcsLogUiProperties in project intellij-community by JetBrains.

the class IntelliSortChooserToggleAction method update.

@Override
public void update(@NotNull AnActionEvent e) {
    super.update(e);
    VcsLogUi logUI = e.getData(VcsLogDataKeys.VCS_LOG_UI);
    VcsLogUiProperties properties = e.getData(VcsLogInternalDataKeys.LOG_UI_PROPERTIES);
    e.getPresentation().setVisible(BekUtil.isBekEnabled());
    e.getPresentation().setEnabled(BekUtil.isBekEnabled() && logUI != null);
    if (properties != null && properties.exists(MainVcsLogUiProperties.BEK_SORT_TYPE)) {
        boolean off = properties.get(MainVcsLogUiProperties.BEK_SORT_TYPE) == PermanentGraph.SortType.Normal;
        String description = "Turn IntelliSort " + (off ? "on" : "off") + ": " + (off ? PermanentGraph.SortType.Bek.getDescription().toLowerCase() : PermanentGraph.SortType.Normal.getDescription().toLowerCase()) + ".";
        e.getPresentation().setDescription(description);
        e.getPresentation().setText(description);
    } else {
        e.getPresentation().setText(DEFAULT_TEXT);
        e.getPresentation().setDescription(DEFAULT_DESCRIPTION);
    }
}
Also used : VcsLogUiProperties(com.intellij.vcs.log.impl.VcsLogUiProperties) MainVcsLogUiProperties(com.intellij.vcs.log.impl.MainVcsLogUiProperties) VcsLogUi(com.intellij.vcs.log.VcsLogUi)

Example 3 with VcsLogUiProperties

use of com.intellij.vcs.log.impl.VcsLogUiProperties in project intellij-community by JetBrains.

the class CollapseOrExpandGraphAction method update.

@Override
public void update(@NotNull AnActionEvent e) {
    VcsLogUi ui = e.getData(VcsLogDataKeys.VCS_LOG_UI);
    VcsLogUiProperties properties = e.getData(VcsLogInternalDataKeys.LOG_UI_PROPERTIES);
    if (ui != null && ui.areGraphActionsEnabled() && properties != null && properties.exists(MainVcsLogUiProperties.BEK_SORT_TYPE)) {
        e.getPresentation().setEnabled(true);
        if (!ui.getFilterUi().getFilters().getDetailsFilters().isEmpty()) {
            e.getPresentation().setEnabled(false);
        }
        if (properties.get(MainVcsLogUiProperties.BEK_SORT_TYPE) == PermanentGraph.SortType.LinearBek) {
            e.getPresentation().setText(getPrefix() + MERGES);
            e.getPresentation().setDescription(getPrefix() + MERGES_DESCRIPTION);
        } else {
            e.getPresentation().setText(getPrefix() + LINEAR_BRANCHES);
            e.getPresentation().setDescription(getPrefix() + LINEAR_BRANCHES_DESCRIPTION);
        }
    } else {
        e.getPresentation().setEnabled(false);
    }
    e.getPresentation().setText(getPrefix() + LINEAR_BRANCHES);
    e.getPresentation().setDescription(getPrefix() + LINEAR_BRANCHES_DESCRIPTION);
    if (isIconHidden(e)) {
        e.getPresentation().setIcon(null);
    } else {
        e.getPresentation().setIcon(properties != null && properties.exists(MainVcsLogUiProperties.BEK_SORT_TYPE) && properties.get(MainVcsLogUiProperties.BEK_SORT_TYPE) == PermanentGraph.SortType.LinearBek ? getMergesIcon() : getBranchesIcon());
    }
}
Also used : MainVcsLogUiProperties(com.intellij.vcs.log.impl.MainVcsLogUiProperties) VcsLogUiProperties(com.intellij.vcs.log.impl.VcsLogUiProperties) VcsLogUi(com.intellij.vcs.log.VcsLogUi)

Example 4 with VcsLogUiProperties

use of com.intellij.vcs.log.impl.VcsLogUiProperties in project intellij-community by JetBrains.

the class GraphTableController method performRootColumnAction.

private void performRootColumnAction() {
    VcsLogUiProperties properties = myUi.getProperties();
    if (myUi.isMultipleRoots() && properties.exists(MainVcsLogUiProperties.SHOW_ROOT_NAMES)) {
        VcsLogUtil.triggerUsage("RootColumnClick");
        properties.set(MainVcsLogUiProperties.SHOW_ROOT_NAMES, !properties.get(MainVcsLogUiProperties.SHOW_ROOT_NAMES));
    }
}
Also used : MainVcsLogUiProperties(com.intellij.vcs.log.impl.MainVcsLogUiProperties) VcsLogUiProperties(com.intellij.vcs.log.impl.VcsLogUiProperties)

Example 5 with VcsLogUiProperties

use of com.intellij.vcs.log.impl.VcsLogUiProperties in project intellij-community by JetBrains.

the class BooleanPropertyToggleAction method update.

@Override
public void update(@NotNull AnActionEvent e) {
    VcsLogUiProperties properties = e.getData(VcsLogInternalDataKeys.LOG_UI_PROPERTIES);
    e.getPresentation().setEnabledAndVisible(properties != null && properties.exists(getProperty()));
    super.update(e);
}
Also used : VcsLogUiProperties(com.intellij.vcs.log.impl.VcsLogUiProperties)

Aggregations

VcsLogUiProperties (com.intellij.vcs.log.impl.VcsLogUiProperties)8 MainVcsLogUiProperties (com.intellij.vcs.log.impl.MainVcsLogUiProperties)7 VcsLogUi (com.intellij.vcs.log.VcsLogUi)4 PermanentGraph (com.intellij.vcs.log.graph.PermanentGraph)2 AnActionEvent (com.intellij.openapi.actionSystem.AnActionEvent)1 ListPopup (com.intellij.openapi.ui.popup.ListPopup)1 StringUtil (com.intellij.openapi.util.text.StringUtil)1 Function (com.intellij.util.Function)1 ContainerUtil (com.intellij.util.containers.ContainerUtil)1 VcsLogDataKeys (com.intellij.vcs.log.VcsLogDataKeys)1 VcsLogProperties (com.intellij.vcs.log.VcsLogProperties)1 VcsLogProvider (com.intellij.vcs.log.VcsLogProvider)1 VcsLogInternalDataKeys (com.intellij.vcs.log.ui.VcsLogInternalDataKeys)1 Collection (java.util.Collection)1 List (java.util.List)1 NotNull (org.jetbrains.annotations.NotNull)1