use of com.intellij.vcs.log.ui.VcsLogUiImpl in project intellij-community by JetBrains.
the class VcsLogFeaturesCollector method getProjectUsages.
@NotNull
@Override
public Set<UsageDescriptor> getProjectUsages(@NotNull Project project) throws CollectUsagesException {
VcsProjectLog projectLog = VcsProjectLog.getInstance(project);
if (projectLog != null) {
VcsLogUiImpl ui = projectLog.getMainLogUi();
if (ui != null) {
MainVcsLogUiProperties properties = ui.getProperties();
Set<UsageDescriptor> usages = ContainerUtil.newHashSet();
usages.add(StatisticsUtilKt.getBooleanUsage("ui.details", properties.get(CommonUiProperties.SHOW_DETAILS)));
usages.add(StatisticsUtilKt.getBooleanUsage("ui.long.edges", properties.get(SHOW_LONG_EDGES)));
PermanentGraph.SortType sortType = properties.get(BEK_SORT_TYPE);
usages.add(StatisticsUtilKt.getBooleanUsage("ui.sort.linear.bek", sortType.equals(PermanentGraph.SortType.LinearBek)));
usages.add(StatisticsUtilKt.getBooleanUsage("ui.sort.bek", sortType.equals(PermanentGraph.SortType.Bek)));
usages.add(StatisticsUtilKt.getBooleanUsage("ui.sort.normal", sortType.equals(PermanentGraph.SortType.Normal)));
if (ui.isMultipleRoots()) {
usages.add(StatisticsUtilKt.getBooleanUsage("ui.roots", properties.get(SHOW_ROOT_NAMES)));
}
usages.add(StatisticsUtilKt.getBooleanUsage("ui.labels.compact", properties.get(COMPACT_REFERENCES_VIEW)));
usages.add(StatisticsUtilKt.getBooleanUsage("ui.labels.showTagNames", properties.get(SHOW_TAG_NAMES)));
usages.add(StatisticsUtilKt.getBooleanUsage("ui.textFilter.regex", properties.get(TEXT_FILTER_REGEX)));
usages.add(StatisticsUtilKt.getBooleanUsage("ui.textFilter.matchCase", properties.get(TEXT_FILTER_MATCH_CASE)));
for (VcsLogHighlighterFactory factory : Extensions.getExtensions(LOG_HIGHLIGHTER_FACTORY_EP, project)) {
if (factory.showMenuItem()) {
VcsLogHighlighterProperty property = VcsLogHighlighterProperty.get(factory.getId());
usages.add(StatisticsUtilKt.getBooleanUsage("ui.highlighter." + ConvertUsagesUtil.ensureProperKey(factory.getId()), properties.exists(property) && properties.get(property)));
}
}
return usages;
}
}
return Collections.emptySet();
}
use of com.intellij.vcs.log.ui.VcsLogUiImpl in project intellij-community by JetBrains.
the class FocusTextFilterAction method update.
@Override
public void update(@NotNull AnActionEvent e) {
Project project = e.getProject();
VcsLogUi ui = e.getData(VcsLogDataKeys.VCS_LOG_UI);
e.getPresentation().setEnabledAndVisible(project != null && ui != null && ui instanceof VcsLogUiImpl);
}
use of com.intellij.vcs.log.ui.VcsLogUiImpl in project intellij-community by JetBrains.
the class FocusTextFilterAction method actionPerformed.
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
VcsLogUtil.triggerUsage(e);
Project project = e.getRequiredData(CommonDataKeys.PROJECT);
MainFrame mainFrame = ((VcsLogUiImpl) e.getRequiredData(VcsLogDataKeys.VCS_LOG_UI)).getMainFrame();
if (mainFrame.getTextFilter().getTextEditor().hasFocus()) {
IdeFocusManager.getInstance(project).requestFocus(mainFrame.getGraphTable(), true);
} else {
IdeFocusManager.getInstance(project).requestFocus(mainFrame.getTextFilter(), true);
}
}
use of com.intellij.vcs.log.ui.VcsLogUiImpl in project intellij-community by JetBrains.
the class GitShowCommitInLogAction method actionPerformed.
@Override
public void actionPerformed(@NotNull AnActionEvent event) {
final Project project = event.getRequiredData(CommonDataKeys.PROJECT);
final VcsRevisionNumber revision = getRevisionNumber(event);
if (revision == null) {
return;
}
boolean logReady = findLog(project) != null;
final ToolWindow window = ToolWindowManager.getInstance(project).getToolWindow(ChangesViewContentManager.TOOLWINDOW_ID);
ContentManager cm = window.getContentManager();
Content[] contents = cm.getContents();
for (Content content : contents) {
if (VcsLogContentProvider.TAB_NAME.equals(content.getDisplayName())) {
cm.setSelectedContent(content);
break;
}
}
final VcsLog log = findLog(project);
if (log == null) {
showLogNotReadyMessage(project);
return;
}
Runnable selectAndOpenLog = new Runnable() {
@Override
public void run() {
Runnable selectCommit = new Runnable() {
@Override
public void run() {
jumpToRevisionUnderProgress(project, log, revision);
}
};
if (!window.isVisible()) {
window.activate(selectCommit, true);
} else {
selectCommit.run();
}
}
};
if (logReady) {
selectAndOpenLog.run();
return;
}
VcsProjectLog projectLog = VcsProjectLog.getInstance(project);
if (projectLog == null) {
showLogNotReadyMessage(project);
return;
}
VcsLogUiImpl logUi = projectLog.getMainLogUi();
if (logUi == null) {
showLogNotReadyMessage(project);
return;
}
logUi.invokeOnChange(selectAndOpenLog);
}
Aggregations