本文整理汇总了Java中com.intellij.vcs.log.impl.VcsLogManager类的典型用法代码示例。如果您正苦于以下问题:Java VcsLogManager类的具体用法?Java VcsLogManager怎么用?Java VcsLogManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
VcsLogManager类属于com.intellij.vcs.log.impl包,在下文中一共展示了VcsLogManager类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getProjectUsages
import com.intellij.vcs.log.impl.VcsLogManager; //导入依赖的package包/类
@NotNull
@Override
public Set<UsageDescriptor> getProjectUsages(@NotNull Project project) throws CollectUsagesException {
VcsLogManager logManager = VcsLogContentProvider.findLogManager(project);
VisiblePack dataPack = getDataPack(logManager);
if (dataPack != null) {
PermanentGraph<Integer> permanentGraph = dataPack.getPermanentGraph();
MultiMap<VcsKey, VirtualFile> groupedRoots = groupRootsByVcs(dataPack.getLogProviders());
Set<UsageDescriptor> usages = ContainerUtil.newHashSet();
usages.add(new UsageDescriptor("vcs.log.commit.count", permanentGraph.getAllCommits().size()));
for (VcsKey vcs : groupedRoots.keySet()) {
//noinspection StringToUpperCaseOrToLowerCaseWithoutLocale
usages.add(new UsageDescriptor("vcs.log." + vcs.getName().toLowerCase() + ".root.count", groupedRoots.get(vcs).size()));
}
return usages;
}
return Collections.emptySet();
}
示例2: getDataPack
import com.intellij.vcs.log.impl.VcsLogManager; //导入依赖的package包/类
@Nullable
private static VisiblePack getDataPack(@Nullable VcsLogManager logManager) {
if (logManager != null) {
final VcsLogUiImpl ui = logManager.getLogUi();
if (ui != null) {
final Ref<VisiblePack> dataPack = Ref.create();
ApplicationManager.getApplication().invokeAndWait(new Runnable() {
@Override
public void run() {
dataPack.set(ui.getDataPack());
}
}, ModalityState.defaultModalityState());
return dataPack.get();
}
}
return null;
}
示例3: actionPerformed
import com.intellij.vcs.log.impl.VcsLogManager; //导入依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
VcsLogUtil.triggerUsage(e);
VcsLogManager logManager = e.getRequiredData(VcsLogInternalDataKeys.LOG_MANAGER);
// diagnostic for possible refresh problems
VcsLogUi ui = e.getRequiredData(VcsLogDataKeys.VCS_LOG_UI);
if (ui instanceof VcsLogUiImpl) {
VcsLogFilterer filterer = ((VcsLogUiImpl)ui).getFilterer();
if (!filterer.isValid()) {
String message = "Trying to refresh invalid log tab.";
if (!logManager.getDataManager().getProgress().isRunning()) {
LOG.error(message);
} else {
LOG.warn(message);
}
filterer.setValid(true);
}
}
logManager.getDataManager().refreshSoftly();
}
示例4: MyCommitsHighlighter
import com.intellij.vcs.log.impl.VcsLogManager; //导入依赖的package包/类
public MyCommitsHighlighter(@NotNull VcsLogDataHolder logDataHolder,
@NotNull VcsLogUiProperties uiProperties,
@NotNull VcsLogFilterUi filterUi) {
myDataHolder = logDataHolder;
myUiProperties = uiProperties;
myFilterUi = filterUi;
// migration to map storage
if (!myUiProperties.isHighlightMyCommits()) {
// by default, my commits highlighter was enabled
// if it was disabled we need to migrate that
myUiProperties.enableHighlighter(Factory.ID, false);
myUiProperties.setHighlightMyCommits(true);
}
// this is a tmp solution for performance problems of calculating areTheOnlyUsers every repaint (we simply do not want to do that)
// todo remove this when history2 branch is merged into master (history2 will allow a proper way to fix the problem)
ApplicationManager.getApplication().invokeLater(new Runnable() {
@Override
public void run() {
if (myDataHolder.getProject().isDisposed()) return;
VcsLogManager logManager = VcsLogContentProvider.findLogManager(myDataHolder.getProject());
if (logManager != null) {
VcsLogUiImpl logUi = logManager.getLogUi();
if (logUi != null) {
logUi.addLogListener(new VcsLogListener() {
@Override
public void onChange(@NotNull VcsLogDataPack dataPack, boolean refreshHappened) {
myAreTheOnlyUsers = areTheOnlyUsers();
}
});
}
}
}
});
}
示例5: findLog
import com.intellij.vcs.log.impl.VcsLogManager; //导入依赖的package包/类
@Nullable
private static VcsLog findLog(@NotNull Project project) {
VcsLogManager manager = VcsLogContentProvider.findLogManager(project);
if (manager != null) {
VcsLogUiImpl ui = manager.getLogUi();
if (ui != null) {
return ui.getVcsLog();
}
}
return null;
}
示例6: update
import com.intellij.vcs.log.impl.VcsLogManager; //导入依赖的package包/类
@Override
public void update(AnActionEvent e) {
Project project = e.getProject();
if (project == null || !Registry.is("vcs.log.open.another.log.visible", false)) {
e.getPresentation().setEnabledAndVisible(false);
return;
}
VcsProjectLog projectLog = VcsProjectLog.getInstance(project);
VcsLogManager logManager = e.getData(VcsLogInternalDataKeys.LOG_MANAGER);
e.getPresentation()
.setEnabledAndVisible(logManager != null && projectLog.getLogManager() == logManager); // only for main log (it is a question, how and where we want to open tabs for external logs)
}
示例7: actionPerformed
import com.intellij.vcs.log.impl.VcsLogManager; //导入依赖的package包/类
@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;
}
VcsLogManager logManager = VcsLogContentProvider.findLogManager(project);
if (logManager == null) {
showLogNotReadyMessage(project);
return;
}
VcsLogUiImpl logUi = logManager.getLogUi();
if (logUi == null) {
showLogNotReadyMessage(project);
return;
}
logUi.invokeOnChange(selectAndOpenLog);
}
示例8: update
import com.intellij.vcs.log.impl.VcsLogManager; //导入依赖的package包/类
@Override
public void update(AnActionEvent e) {
VcsLogManager logManager = e.getData(VcsLogInternalDataKeys.LOG_MANAGER);
e.getPresentation().setEnabledAndVisible(logManager != null && e.getData(VcsLogDataKeys.VCS_LOG_UI) != null);
}
示例9: VcsLogPanel
import com.intellij.vcs.log.impl.VcsLogManager; //导入依赖的package包/类
public VcsLogPanel(@Nonnull VcsLogManager manager, @Nonnull VcsLogUiImpl logUi) {
super(new BorderLayout());
myManager = manager;
add(logUi.getMainFrame().getMainComponent(), BorderLayout.CENTER);
}