当前位置: 首页>>代码示例>>Java>>正文


Java ProjectLevelVcsManagerImpl.getBackgroundableActionHandler方法代码示例

本文整理汇总了Java中com.intellij.openapi.vcs.impl.ProjectLevelVcsManagerImpl.getBackgroundableActionHandler方法的典型用法代码示例。如果您正苦于以下问题:Java ProjectLevelVcsManagerImpl.getBackgroundableActionHandler方法的具体用法?Java ProjectLevelVcsManagerImpl.getBackgroundableActionHandler怎么用?Java ProjectLevelVcsManagerImpl.getBackgroundableActionHandler使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.openapi.vcs.impl.ProjectLevelVcsManagerImpl的用法示例。


在下文中一共展示了ProjectLevelVcsManagerImpl.getBackgroundableActionHandler方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: isEnabled

import com.intellij.openapi.vcs.impl.ProjectLevelVcsManagerImpl; //导入方法依赖的package包/类
protected boolean isEnabled(VcsContext context) {
  VirtualFile[] selectedFiles = context.getSelectedFiles();
  if (selectedFiles == null) return false;
  if (selectedFiles.length == 0) return false;
  VirtualFile file = selectedFiles[0];
  Project project = context.getProject();
  if (project == null) return false;
  final ProjectLevelVcsManagerImpl vcsManager = (ProjectLevelVcsManagerImpl) ProjectLevelVcsManager.getInstance(project);
  final BackgroundableActionEnabledHandler handler =
    vcsManager.getBackgroundableActionHandler(VcsBackgroundableActions.HISTORY_FOR_SELECTION);
  if (handler.isInProgress(VcsBackgroundableActions.keyFrom(file))) return false;
  AbstractVcs vcs = vcsManager.getVcsFor(file);
  if (vcs == null) return false;
  VcsHistoryProvider vcsHistoryProvider = vcs.getVcsBlockHistoryProvider();
  if (vcsHistoryProvider == null) return false;
  if (! AbstractVcs.fileInVcsByFileStatus(project, VcsUtil.getFilePath(file))) return false;

  VcsSelection selection = VcsSelectionUtil.getSelection(context);
  if (selection == null) {
    return false;
  }
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:SelectedBlockHistoryAction.java

示例2: isEnabled

import com.intellij.openapi.vcs.impl.ProjectLevelVcsManagerImpl; //导入方法依赖的package包/类
protected boolean isEnabled(VcsContext context) {
  VirtualFile[] selectedFiles = context.getSelectedFiles();
  if (selectedFiles == null) return false;
  if (selectedFiles.length == 0) return false;
  VirtualFile file = selectedFiles[0];
  Project project = context.getProject();
  if (project == null) return false;
  final ProjectLevelVcsManagerImpl vcsManager = (ProjectLevelVcsManagerImpl) ProjectLevelVcsManager.getInstance(project);
  final BackgroundableActionEnabledHandler handler =
    vcsManager.getBackgroundableActionHandler(VcsBackgroundableActions.HISTORY_FOR_SELECTION);
  if (handler.isInProgress(VcsBackgroundableActions.keyFrom(file))) return false;
  AbstractVcs vcs = vcsManager.getVcsFor(file);
  if (vcs == null) return false;
  VcsHistoryProvider vcsHistoryProvider = vcs.getVcsBlockHistoryProvider();
  if (vcsHistoryProvider == null) return false;
  if (! AbstractVcs.fileInVcsByFileStatus(project, new FilePathImpl(file))) return false;

  VcsSelection selection = VcsSelectionUtil.getSelection(context);
  if (selection == null) {
    return false;
  }
  return true;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:24,代码来源:SelectedBlockHistoryAction.java

示例3: isEnabled

import com.intellij.openapi.vcs.impl.ProjectLevelVcsManagerImpl; //导入方法依赖的package包/类
protected boolean isEnabled(VcsContext context) {
  Project project = context.getProject();
  if (project == null) return false;

  VcsSelection selection = VcsSelectionUtil.getSelection(context);
  if (selection == null) return false;

  VirtualFile file = FileDocumentManager.getInstance().getFile(selection.getDocument());
  if (file == null) return false;

  final ProjectLevelVcsManagerImpl vcsManager = (ProjectLevelVcsManagerImpl)ProjectLevelVcsManager.getInstance(project);
  final BackgroundableActionEnabledHandler handler = vcsManager.getBackgroundableActionHandler(VcsBackgroundableActions.HISTORY_FOR_SELECTION);
  if (handler.isInProgress(VcsBackgroundableActions.keyFrom(file))) return false;

  AbstractVcs activeVcs = ProjectLevelVcsManager.getInstance(project).getVcsFor(file);
  if (activeVcs == null) return false;

  VcsHistoryProvider provider = activeVcs.getVcsBlockHistoryProvider();
  if (provider == null) return false;

  if (!AbstractVcs.fileInVcsByFileStatus(project, VcsUtil.getFilePath(file))) return false;
  return true;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:24,代码来源:SelectedBlockHistoryAction.java

示例4: markRunningProgress

import com.intellij.openapi.vcs.impl.ProjectLevelVcsManagerImpl; //导入方法依赖的package包/类
private static void markRunningProgress(@NotNull DiffViewerBase viewer, @NotNull Side side, boolean running) {
  final ProjectLevelVcsManagerImpl plVcsManager = (ProjectLevelVcsManagerImpl)ProjectLevelVcsManager.getInstance(viewer.getProject());
  final BackgroundableActionEnabledHandler handler = plVcsManager.getBackgroundableActionHandler(VcsBackgroundableActions.ANNOTATE);
  if (running) {
    handler.register(key(viewer, side));
  }
  else {
    handler.completed(key(viewer, side));
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:AnnotateDiffViewerAction.java

示例5: DiffActionExecutor

import com.intellij.openapi.vcs.impl.ProjectLevelVcsManagerImpl; //导入方法依赖的package包/类
protected DiffActionExecutor(final DiffProvider diffProvider, final VirtualFile selectedFile, final Project project,
                             final VcsBackgroundableActions actionKey) {
  final ProjectLevelVcsManagerImpl vcsManager = (ProjectLevelVcsManagerImpl) ProjectLevelVcsManager.getInstance(project);
  myHandler = vcsManager.getBackgroundableActionHandler(actionKey);
  myDiffProvider = diffProvider;
  mySelectedFile = selectedFile;
  myProject = project;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:DiffActionExecutor.java

示例6: executeAppendableSession

import com.intellij.openapi.vcs.impl.ProjectLevelVcsManagerImpl; //导入方法依赖的package包/类
public void executeAppendableSession(final VcsKey vcsKey, final FilePath filePath, final VcsAppendableHistorySessionPartner partner,
                                     @Nullable VcsBackgroundableActions actionKey, boolean canUseCache, boolean canUseLastRevisionCheck) {
  if (myCachesHistory && canUseCache) {
    final VcsAbstractHistorySession session = getFullHistoryFromCache(vcsKey, filePath);
    if (session != null) {
      partner.reportCreatedEmptySession(session);
      partner.finished();
      partner.forceRefresh();
      return;
    }
  }

  final ProjectLevelVcsManagerImpl vcsManager = (ProjectLevelVcsManagerImpl) ProjectLevelVcsManager.getInstance(myProject);
  final VcsBackgroundableActions resultingActionKey = actionKey == null ? VcsBackgroundableActions.CREATE_HISTORY_SESSION : actionKey;

  final BackgroundableActionEnabledHandler handler;
  handler = vcsManager.getBackgroundableActionHandler(resultingActionKey);
  // fo not start same action twice
  if (handler.isInProgress(resultingActionKey)) return;

  handler.register(resultingActionKey);

  final VcsAppendableHistorySessionPartner cachedPartner;
  if (myCachesHistory) {
    cachedPartner = new HistoryPartnerProxy(partner, new Consumer<VcsAbstractHistorySession>() {
      @Override
      public void consume(VcsAbstractHistorySession session) {
        if (session == null) return;
        final FilePath correctedPath =
          ((VcsCacheableHistorySessionFactory<Serializable, VcsAbstractHistorySession>)myDelegate).getUsedFilePath(session);
        myVcsHistoryCache.put(filePath, correctedPath, vcsKey, (VcsAbstractHistorySession)session.copy(),
                              (VcsCacheableHistorySessionFactory<Serializable,VcsAbstractHistorySession>) myDelegate, true);
      }
    });
  } else {
    cachedPartner = partner;
  }
  reportHistory(filePath, vcsKey, resultingActionKey, handler, cachedPartner, canUseLastRevisionCheck);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:40,代码来源:VcsHistoryProviderBackgroundableProxy.java

示例7: doExecuteAppendableSession

import com.intellij.openapi.vcs.impl.ProjectLevelVcsManagerImpl; //导入方法依赖的package包/类
private void doExecuteAppendableSession(final VcsKey vcsKey, final FilePath filePath, @Nullable VcsRevisionNumber startRevisionNumber,
                                        final VcsAppendableHistorySessionPartner partner, @Nullable VcsBackgroundableActions actionKey,
                                        boolean canUseCache, boolean canUseLastRevisionCheck) {
  if (myCachesHistory && canUseCache) {
    final VcsAbstractHistorySession session = getFullHistoryFromCache(vcsKey, filePath);
    if (session != null) {
      partner.reportCreatedEmptySession(session);
      partner.finished();
      return;
    }
  }

  final ProjectLevelVcsManagerImpl vcsManager = (ProjectLevelVcsManagerImpl) ProjectLevelVcsManager.getInstance(myProject);
  final VcsBackgroundableActions resultingActionKey = actionKey == null ? VcsBackgroundableActions.CREATE_HISTORY_SESSION : actionKey;

  final BackgroundableActionEnabledHandler handler;
  handler = vcsManager.getBackgroundableActionHandler(resultingActionKey);
  // fo not start same action twice
  if (handler.isInProgress(resultingActionKey)) return;

  handler.register(resultingActionKey);

  final VcsAppendableHistorySessionPartner cachedPartner;
  if (myCachesHistory && startRevisionNumber == null) {
    cachedPartner = new HistoryPartnerProxy(partner, session -> {
      if (session == null) return;
      VcsCacheableHistorySessionFactory<Serializable, VcsAbstractHistorySession> delegate =
              (VcsCacheableHistorySessionFactory<Serializable, VcsAbstractHistorySession>)myDelegate;
      FilePath correctedPath = delegate.getUsedFilePath(session);
      myVcsHistoryCache.put(filePath, correctedPath, vcsKey, (VcsAbstractHistorySession)session.copy(), delegate, true);
    });
  } else {
    cachedPartner = partner;
  }
  reportHistory(filePath, startRevisionNumber, vcsKey, resultingActionKey, handler, cachedPartner, canUseLastRevisionCheck);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:37,代码来源:VcsHistoryProviderBackgroundableProxy.java

示例8: checkRunningProgress

import com.intellij.openapi.vcs.impl.ProjectLevelVcsManagerImpl; //导入方法依赖的package包/类
private static boolean checkRunningProgress(@NotNull DiffViewerBase viewer, @NotNull Side side) {
  final ProjectLevelVcsManagerImpl plVcsManager = (ProjectLevelVcsManagerImpl)ProjectLevelVcsManager.getInstance(viewer.getProject());
  final BackgroundableActionEnabledHandler handler = plVcsManager.getBackgroundableActionHandler(VcsBackgroundableActions.ANNOTATE);
  return handler.isInProgress(key(viewer, side));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:AnnotateDiffViewerAction.java


注:本文中的com.intellij.openapi.vcs.impl.ProjectLevelVcsManagerImpl.getBackgroundableActionHandler方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。