• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java VcsListener类的典型用法和代码示例

java 2次浏览

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

VcsListener类属于com.intellij.openapi.vcs包,在下文中一共展示了VcsListener类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: projectOpened

点赞 2

import com.intellij.openapi.vcs.VcsListener; //导入依赖的package包/类
public void projectOpened() {
    VirtualFileManager.getInstance().addVirtualFileListener(this);
    boolean initialized = project.isInitialized();

    final MessageBus messageBus = project.getMessageBus();

    messageBus.connect().subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootAdapter() {
        public void rootsChanged(ModuleRootEvent event) {
            if (project.isDisposed()) return;
            reparseMarkdown();
        }
    });

    messageBus.connect().subscribe(ProjectLevelVcsManager.VCS_CONFIGURATION_CHANGED, new VcsListener() {
        @Override
        public void directoryMappingChanged() {
            gitHubRepos = null;
        }
    });

    messageBus.connect().subscribe(ProjectLevelVcsManager.VCS_CONFIGURATION_CHANGED_IN_PLUGIN, new VcsListener() {
        @Override
        public void directoryMappingChanged() {
            gitHubRepos = null;
        }
    });
}
 

开发者ID:vsch,
项目名称:idea-multimarkdown,
代码行数:28,
代码来源:MultiMarkdownProjectComponent.java

示例2: GitProjectLogManager

点赞 2

import com.intellij.openapi.vcs.VcsListener; //导入依赖的package包/类
public GitProjectLogManager(final Project project, final ProjectLevelVcsManager vcsManager, final LogFactoryService logFactoryService) {
  myProject = project;
  myVcsManager = vcsManager;
  myLogFactoryService = logFactoryService;
  myCurrentContent = new AtomicReference<Content>();
  myLogRef = new AtomicReference<GitLog>();

  myListener = new VcsListener() {
    public void directoryMappingChanged() {
      invokeLaterRecalculateWindows();
    }
  };
  myCurrentBranchListener = new CurrentBranchListener() {
    public void consume(VirtualFile file) {
      /*final VirtualFile baseDir = myProject.getBaseDir();
      if (baseDir == null) return;
      final Map<VirtualFile, Content> currentState = myComponentsMap.get();
      for (VirtualFile virtualFile : currentState.keySet()) {
        if (Comparing.equal(virtualFile, file)) {
          final String title = getCaption(baseDir, virtualFile);
          final Content content = currentState.get(virtualFile);
          if (! Comparing.equal(title, content.getDisplayName())) {
            new AbstractCalledLater(myProject, ModalityState.NON_MODAL) {
              public void run() {
                content.setDisplayName(title);
              }
            }.callMe();
          }
          return;
        }
      }*/
    }
  };
}
 

开发者ID:lshain-android-source,
项目名称:tools-idea,
代码行数:35,
代码来源:GitProjectLogManager.java

示例3: enable

点赞 2

import com.intellij.openapi.vcs.VcsListener; //导入依赖的package包/类
/** Enable manager. */
private void enable() {
    if (working) {
        return;
    }

    refreshTrackedIgnoredFeature.run();
    virtualFileManager.addVirtualFileListener(virtualFileListener);
    settings.addListener(settingsListener);

    messageBus = myProject.getMessageBus().connect();

    messageBus.subscribe(TRACKED_IGNORED_REFRESH, new RefreshTrackedIgnoredListener() {
        @Override
        public void refresh() {
            debouncedRefreshTrackedIgnores.run(true);
        }
    });

    messageBus.subscribe(ProjectLevelVcsManager.VCS_CONFIGURATION_CHANGED, new VcsListener() {
        @Override
        public void directoryMappingChanged() {
            ExternalIndexableSetContributor.invalidateCache(myProject);
            vcsRoots.clear();
            vcsRoots.addAll(ContainerUtil.newArrayList(projectLevelVcsManager.getAllVcsRoots()));
        }
    });

    messageBus.subscribe(DumbService.DUMB_MODE, new DumbService.DumbModeListener() {
        @Override
        public void enteredDumbMode() {
        }

        @Override
        public void exitDumbMode() {
            debouncedExitDumbMode.run();
        }
    });

    messageBus.subscribe(ProjectTopics.PROJECT_ROOTS, commonRunnableListeners);
    messageBus.subscribe(RefreshStatusesListener.REFRESH_STATUSES, commonRunnableListeners);
    messageBus.subscribe(ProjectTopics.MODULES, commonRunnableListeners);

    working = true;
}
 

开发者ID:hsz,
项目名称:idea-gitignore,
代码行数:46,
代码来源:IgnoreManager.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)