本文整理汇总了Java中com.intellij.openapi.vcs.AbstractVcs.getDiffProvider方法的典型用法代码示例。如果您正苦于以下问题:Java AbstractVcs.getDiffProvider方法的具体用法?Java AbstractVcs.getDiffProvider怎么用?Java AbstractVcs.getDiffProvider使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.vcs.AbstractVcs
的用法示例。
在下文中一共展示了AbstractVcs.getDiffProvider方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: actionPerformed
import com.intellij.openapi.vcs.AbstractVcs; //导入方法依赖的package包/类
@Override
protected void actionPerformed(@NotNull VcsContext vcsContext) {
final VirtualFile file = vcsContext.getSelectedFiles()[0];
final Project project = vcsContext.getProject();
final AbstractVcs vcs = ProjectLevelVcsManager.getInstance(project).getVcsFor(file);
if (vcs == null) {
return;
}
RevisionSelector selector = vcs.getRevisionSelector();
final DiffProvider diffProvider = vcs.getDiffProvider();
if (selector != null) {
final VcsRevisionNumber vcsRevisionNumber = selector.selectNumber(file);
if (vcsRevisionNumber != null) {
DiffActionExecutor.showDiff(diffProvider, vcsRevisionNumber, file, project, VcsBackgroundableActions.COMPARE_WITH);
}
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:SelectAndCompareWithSelectedRevisionAction.java
示例2: fileRecentlyChanged
import com.intellij.openapi.vcs.AbstractVcs; //导入方法依赖的package包/类
@Nullable
@Override
public VcsRevisionNumber fileRecentlyChanged(VirtualFile vf) {
final ProjectLevelVcsManager vcsManager = ProjectLevelVcsManager.getInstance(myProject);
final AbstractVcs vcs = vcsManager.getVcsFor(vf);
if (vcs == null) return null;
if (vcs.getDiffProvider() instanceof DiffMixin) {
final VcsRevisionDescription description = ((DiffMixin)vcs.getDiffProvider()).getCurrentRevisionDescription(vf);
final Date date = description.getRevisionDate();
return isRecent(date) ? description.getRevisionNumber() : null;
}
return null;
}
示例3: isVisible
import com.intellij.openapi.vcs.AbstractVcs; //导入方法依赖的package包/类
protected static boolean isVisible(final VcsContext vcsContext) {
final Project project = vcsContext.getProject();
if (project == null) return false;
final AbstractVcs[] vcss = ProjectLevelVcsManager.getInstance(project).getAllActiveVcss();
for (AbstractVcs vcs : vcss) {
if (vcs.getDiffProvider() != null) {
return true;
}
}
return false;
}
示例4: isEnabled
import com.intellij.openapi.vcs.AbstractVcs; //导入方法依赖的package包/类
@Nullable
protected static AbstractVcs isEnabled(final VcsContext vcsContext, @Nullable final VcsBackgroundableActions actionKey) {
if (!(isVisible(vcsContext))) return null;
final Project project = vcsContext.getProject();
if (project == null) return null;
final ProjectLevelVcsManager vcsManager = ProjectLevelVcsManager.getInstance(project);
final VirtualFile[] selectedFilePaths = vcsContext.getSelectedFiles();
if (selectedFilePaths.length != 1) return null;
final VirtualFile selectedFile = selectedFilePaths[0];
if (selectedFile.isDirectory()) return null;
if (actionKey != null) {
final BackgroundableActionEnabledHandler handler = ((ProjectLevelVcsManagerImpl)vcsManager).getBackgroundableActionHandler(actionKey);
if (handler.isInProgress(VcsBackgroundableActions.keyFrom(selectedFile))) return null;
}
final AbstractVcs vcs = vcsManager.getVcsFor(selectedFile);
if (vcs == null) return null;
final DiffProvider diffProvider = vcs.getDiffProvider();
if (diffProvider == null) return null;
if (AbstractVcs.fileInVcsByFileStatus(project, VcsUtil.getFilePath(selectedFile))) {
return vcs;
}
return null;
}
示例5: actionPerformed
import com.intellij.openapi.vcs.AbstractVcs; //导入方法依赖的package包/类
@Override
protected void actionPerformed(@NotNull VcsContext vcsContext) {
final Project project = vcsContext.getProject();
if (project == null) return;
if (ChangeListManager.getInstance(project).isFreezedWithNotification("Can not " + vcsContext.getActionName() + " now")) return;
final VirtualFile selectedFile = vcsContext.getSelectedFiles()[0];
final ProjectLevelVcsManager vcsManager = ProjectLevelVcsManager.getInstance(project);
final AbstractVcs vcs = vcsManager.getVcsFor(selectedFile);
final DiffProvider diffProvider = vcs.getDiffProvider();
final DiffActionExecutor actionExecutor = getExecutor(diffProvider, selectedFile, project);
actionExecutor.showDiff();
}