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);
}
}
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);
}
}
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());
}
}
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));
}
}
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);
}
Aggregations