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

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

java 2次浏览

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

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

示例1: actionPerformedCanceledFromDialog

点赞 3

import com.intellij.vcsUtil.VcsImplUtil; //导入依赖的package包/类
@Test
public void actionPerformedCanceledFromDialog (
        @Mocked final AnActionEvent event,
        @Mocked final NotificationUtil notificationUtil,
        @Mocked final Project project,
        @Mocked final GitRepositoryManager manager,
        @Mocked final GitRepository gitRepository,
        @Mocked final ProjectSettingsHandler settingsHandler,
        @Mocked final VcsImplUtil vcsImplUtil,
        @Mocked final SelectModuleDialog dialog
) throws Exception {
    GitExtenderUpdateAll updater = new GitExtenderUpdateAll();

    new Expectations() {{
        event.getProject(); result = project;
        manager.getRepositories(); result = Arrays.asList(gitRepository, gitRepository);
        VcsImplUtil.getShortVcsRootName(project, (VirtualFile) any); result = "test";
        dialog.showAndGet(); result = false;
    }};

    updater.actionPerformed(event);

    new Verifications() {{
        NotificationUtil.showInfoNotification("Update Canceled", anyString);
    }};
}
 

开发者ID:JChrist,
项目名称:gitextender,
代码行数:27,
代码来源:GitExtenderUpdateAllTest.java

示例2: actionPerformedNothingSelectedFromDialog

点赞 3

import com.intellij.vcsUtil.VcsImplUtil; //导入依赖的package包/类
@Test
public void actionPerformedNothingSelectedFromDialog (
        @Mocked final AnActionEvent event,
        @Mocked final NotificationUtil notificationUtil,
        @Mocked final Project project,
        @Mocked final GitRepositoryManager manager,
        @Mocked final GitRepository gitRepository,
        @Mocked final ProjectSettingsHandler settingsHandler,
        @Mocked final VcsImplUtil vcsImplUtil,
        @Mocked final SelectModuleDialog dialog
) throws Exception {
    GitExtenderUpdateAll updater = new GitExtenderUpdateAll();

    new Expectations() {{
        event.getProject(); result = project;
        manager.getRepositories(); result = Arrays.asList(gitRepository, gitRepository);
        VcsImplUtil.getShortVcsRootName(project, (VirtualFile) any); result = "test";
        dialog.showAndGet(); result = true;
    }};

    updater.actionPerformed(event);

    new Verifications() {{
        NotificationUtil.showInfoNotification("Update Canceled", anyString);
    }};
}
 

开发者ID:JChrist,
项目名称:gitextender,
代码行数:27,
代码来源:GitExtenderUpdateAllTest.java

示例3: makeAdditionalInfoByRoot

点赞 3

import com.intellij.vcsUtil.VcsImplUtil; //导入依赖的package包/类
@SuppressFBWarnings({"NP_NULL_ON_SOME_PATH"}) //TODO: extract first if to better separate FB suppression
@NotNull
private String makeAdditionalInfoByRoot(@NotNull Map<VirtualFile, String> additionalInfo) {
  if (additionalInfo.isEmpty()) {
    return "";
  }
  StringBand info = new StringBand();
  if (repositoryManager.moreThanOneRoot()) {
    for (Map.Entry<VirtualFile, String> entry : additionalInfo.entrySet()) {
      info.append(entry.getValue()).append(" in ").append(VcsImplUtil.getShortVcsRootName(project, entry.getKey()))
          .append(Html.BR);
    }
  } else {
    info.append(additionalInfo.values().iterator().next());
  }
  return info.toString();
}
 

开发者ID:zielu,
项目名称:GitToolBox,
代码行数:18,
代码来源:GtFetcher.java

示例4: showError

点赞 3

import com.intellij.vcsUtil.VcsImplUtil; //导入依赖的package包/类
private void showError(Exception e) {
  final HgVcs vcs = HgVcs.getInstance(myProject);
  if (vcs == null) { return; }

  StringBuilder message = new StringBuilder();
  message.append(HgVcsMessages.message("hg4idea.command.executable.error",
    vcs.getGlobalSettings().getHgExecutable()))
    .append("\n")
    .append("Original Error:\n")
    .append(e.getMessage());

  VcsImplUtil.showErrorMessage(
    myProject,
    message.toString(),
    HgVcsMessages.message("hg4idea.error")
  );
}
 

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

示例5: showError

点赞 2

import com.intellij.vcsUtil.VcsImplUtil; //导入依赖的package包/类
protected void showError(Exception e) {
  final HgVcs vcs = HgVcs.getInstance(myProject);
  if (vcs == null) return;
  String message = HgVcsMessages.message("hg4idea.command.executable.error", vcs.getGlobalSettings().getHgExecutable()) +
                   "\nOriginal Error:\n" +
                   e.getMessage();
  VcsImplUtil.showErrorMessage(myProject, message, HgVcsMessages.message("hg4idea.error"));
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:9,
代码来源:HgCommandExecutor.java

示例6: updateRepositories

点赞 2

import com.intellij.vcsUtil.VcsImplUtil; //导入依赖的package包/类
private void updateRepositories(@NotNull Project project, @NotNull List<GitRepository> repositories) {
    //get an access token for changing the repositories
    final AccessToken accessToken = DvcsUtil.workingTreeChangeStarted(project);

    final AtomicInteger countDown = new AtomicInteger(repositories.size());

    //get the settings to find out the selected options
    GitExtenderSettingsHandler settingsHandler = new GitExtenderSettingsHandler();
    final GitExtenderSettings settings = settingsHandler.loadSettings();
    repositories.forEach(repo ->
            new BackgroundableRepoUpdateTask(repo,
                    VcsImplUtil.getShortVcsRootName(repo.getProject(), repo.getRoot()),
                    settings, countDown, accessToken)
                    .queue());
}
 

开发者ID:JChrist,
项目名称:gitextender,
代码行数:16,
代码来源:GitExtenderUpdateAll.java

示例7: VcsRefDescriptor

点赞 2

import com.intellij.vcsUtil.VcsImplUtil; //导入依赖的package包/类
private VcsRefDescriptor(@Nonnull Project project,
                         @Nonnull VcsLogColorManager manager,
                         @Nonnull Comparator<VcsRef> comparator,
                         @Nonnull Collection<VirtualFile> roots) {
  myProject = project;
  myColorManager = manager;
  myReferenceComparator = comparator;

  for (VirtualFile root : roots) {
    String text = VcsImplUtil.getShortVcsRootName(myProject, root);
    myCachedRootNames.put(root, text);
  }
}
 

开发者ID:consulo,
项目名称:consulo,
代码行数:14,
代码来源:GoToHashOrRefPopup.java

示例8: getTypeText

点赞 2

import com.intellij.vcsUtil.VcsImplUtil; //导入依赖的package包/类
@Nullable
@Override
protected String getTypeText(@Nonnull VcsRef item) {
  if (!myColorManager.isMultipleRoots()) return null;
  String text = myCachedRootNames.get(item.getRoot());
  if (text == null) {
    return VcsImplUtil.getShortVcsRootName(myProject, item.getRoot());
  }
  return text;
}
 

开发者ID:consulo,
项目名称:consulo,
代码行数:11,
代码来源:GoToHashOrRefPopup.java

示例9: getRepoName

点赞 2

import com.intellij.vcsUtil.VcsImplUtil; //导入依赖的package包/类
protected static String getRepoName(GitRepository repo) {
    return VcsImplUtil.getShortVcsRootName(repo.getProject(), repo.getRoot());
}
 

开发者ID:JChrist,
项目名称:gitextender,
代码行数:4,
代码来源:GitExtenderUpdateAll.java

示例10: actionPerformedSingleRepoNoDialog

点赞 2

import com.intellij.vcsUtil.VcsImplUtil; //导入依赖的package包/类
@Test
public void actionPerformedSingleRepoNoDialog (
        final @Mocked GitRepositoryManager gitRepositoryManager,
        final @Mocked GitRepository gitRepository,
        final @Mocked VirtualFile root,
        final @Mocked BackgroundableRepoUpdateTask task,
        final @Mocked VcsImplUtil vcsImplUtil,
        final @Mocked SelectModuleDialog selectModuleDialog,
        final @Mocked ProjectSettingsHandler projectSettingsHandler,
        final @Mocked GitExtenderSettingsHandler gitExtenderSettingsHandler
) throws Exception {
    assertThat(base.getProject())
            .as("null project returned from base")
            .isNotNull();

    final String repoName = base.getProject().getName();

    final GitExtenderUpdateAll updater = new GitExtenderUpdateAll();
    final AnActionEvent event = AnActionEvent.createFromAnAction(updater, null, "somewhere",
            new TestDataProvider(base.getProject()));
    final GitExtenderSettings settings = new GitExtenderSettings();
    new Expectations() {{
        gitRepositoryManager.getRepositories(); result = Collections.singletonList(gitRepository);
        gitRepositoryManager.updateAllRepositories();
        gitRepository.getProject(); result = base.getProject();
        gitRepository.getRoot(); result = root;
        VcsImplUtil.getShortVcsRootName(base.getProject(), root); result = repoName;

        projectSettingsHandler.loadSelectedModules(); result = new ArrayList<>();
        gitExtenderSettingsHandler.loadSettings(); result = settings;

        new BackgroundableRepoUpdateTask(gitRepository, repoName, settings, (AtomicInteger)any, (AccessToken)any);
        result = task;
    }};

    updater.actionPerformed(event);

    new Verifications() {{
        selectModuleDialog.showAndGet(); times = 0;
        task.queue(); times = 1;
    }};
}
 

开发者ID:JChrist,
项目名称:gitextender,
代码行数:43,
代码来源:GitExtenderUpdateAllTest.java

示例11: actionPerformedMultipleReposAllSelected

点赞 2

import com.intellij.vcsUtil.VcsImplUtil; //导入依赖的package包/类
@Test
public void actionPerformedMultipleReposAllSelected (
        final @Mocked GitRepositoryManager gitRepositoryManager,
        final @Mocked GitRepository gitRepository1,
        final @Mocked GitRepository gitRepository2,
        final @Mocked GitRepository gitRepository3,
        final @Mocked VirtualFile root1,
        final @Mocked VirtualFile root2,
        final @Mocked VirtualFile root3,
        final @Mocked BackgroundableRepoUpdateTask task,
        final @Mocked VcsImplUtil vcsImplUtil,
        final @Mocked SelectModuleDialog selectModuleDialog,
        final @Mocked ProjectSettingsHandler projectSettingsHandler,
        final @Mocked GitExtenderSettingsHandler gitExtenderSettingsHandler
) throws Exception {
    assertThat(base.getProject())
            .as("null project returned from base")
            .isNotNull();

    final String baseRepoName = base.getProject().getName();
    final String repoName1 = baseRepoName + "_1";
    final String repoName2 = baseRepoName + "_2";
    final String repoName3 = baseRepoName + "_3";

    final GitExtenderUpdateAll updater = new GitExtenderUpdateAll();
    final AnActionEvent event = AnActionEvent.createFromAnAction(updater, null, "somewhere",
            new TestDataProvider(base.getProject()));
    final GitExtenderSettings settings = new GitExtenderSettings();
    new Expectations() {{
        gitRepositoryManager.getRepositories();
        result = Arrays.asList(gitRepository1, gitRepository2, gitRepository3);
        gitRepositoryManager.updateAllRepositories();
        gitRepository1.getProject(); result = base.getProject();
        gitRepository2.getProject(); result = base.getProject();
        gitRepository3.getProject(); result = base.getProject();
        gitRepository1.getRoot(); result = root1;
        gitRepository2.getRoot(); result = root2;
        gitRepository3.getRoot(); result = root3;
        VcsImplUtil.getShortVcsRootName(base.getProject(), root1); result = repoName1;
        VcsImplUtil.getShortVcsRootName(base.getProject(), root2); result = repoName2;
        VcsImplUtil.getShortVcsRootName(base.getProject(), root3); result = repoName3;

        selectModuleDialog.showAndGet(); result = true;
        projectSettingsHandler.loadSelectedModules();
        result = new ArrayList<>(Arrays.asList(repoName1, repoName2, repoName3));

        gitExtenderSettingsHandler.loadSettings(); result = settings;

        new BackgroundableRepoUpdateTask(gitRepository1, repoName1, settings, (AtomicInteger)any, (AccessToken)any);
        result = task;
        new BackgroundableRepoUpdateTask(gitRepository2, repoName2, settings, (AtomicInteger)any, (AccessToken)any);
        result = task;
        new BackgroundableRepoUpdateTask(gitRepository3, repoName3, settings, (AtomicInteger)any, (AccessToken)any);
        result = task;
    }};

    updater.actionPerformed(event);

    new Verifications() {{
        task.queue(); times = 3;
    }};
}
 

开发者ID:JChrist,
项目名称:gitextender,
代码行数:63,
代码来源:GitExtenderUpdateAllTest.java

示例12: actionPerformedMultipleReposPartSelected

点赞 2

import com.intellij.vcsUtil.VcsImplUtil; //导入依赖的package包/类
@Test
public void actionPerformedMultipleReposPartSelected (
        final @Mocked GitRepositoryManager gitRepositoryManager,
        final @Mocked GitRepository gitRepository1,
        final @Mocked GitRepository gitRepository2,
        final @Mocked GitRepository gitRepository3,
        final @Mocked VirtualFile root1,
        final @Mocked VirtualFile root2,
        final @Mocked VirtualFile root3,
        final @Mocked BackgroundableRepoUpdateTask task1,
        final @Mocked BackgroundableRepoUpdateTask task2,
        final @Mocked VcsImplUtil vcsImplUtil,
        final @Mocked SelectModuleDialog selectModuleDialog,
        final @Mocked ProjectSettingsHandler projectSettingsHandler,
        final @Mocked GitExtenderSettingsHandler gitExtenderSettingsHandler
) throws Exception {
    assertThat(base.getProject())
            .as("null project returned from base")
            .isNotNull();

    final String baseRepoName = base.getProject().getName();
    final String repoName1 = baseRepoName + "_1";
    final String repoName2 = baseRepoName + "_2";
    final String repoName3 = baseRepoName + "_3";

    final GitExtenderUpdateAll updater = new GitExtenderUpdateAll();
    final AnActionEvent event = AnActionEvent.createFromAnAction(updater, null, "somewhere",
            new TestDataProvider(base.getProject()));
    final GitExtenderSettings settings = new GitExtenderSettings();
    new Expectations() {{
        gitRepositoryManager.getRepositories();
        result = Arrays.asList(gitRepository1, gitRepository2, gitRepository3);
        gitRepositoryManager.updateAllRepositories();
        gitRepository1.getProject(); result = base.getProject();
        gitRepository2.getProject(); result = base.getProject();
        gitRepository3.getProject(); result = base.getProject();
        gitRepository1.getRoot(); result = root1;
        gitRepository2.getRoot(); result = root2;
        gitRepository3.getRoot(); result = root3;
        VcsImplUtil.getShortVcsRootName(base.getProject(), root1); result = repoName1;
        VcsImplUtil.getShortVcsRootName(base.getProject(), root2); result = repoName2;
        VcsImplUtil.getShortVcsRootName(base.getProject(), root3); result = repoName3;

        selectModuleDialog.showAndGet(); result = true;
        projectSettingsHandler.loadSelectedModules();
        result = new ArrayList<>(Arrays.asList(repoName1, repoName2));

        gitExtenderSettingsHandler.loadSettings(); result = settings;

        new BackgroundableRepoUpdateTask(gitRepository1, repoName1, settings, (AtomicInteger)any, (AccessToken)any);
        result = task1;
        new BackgroundableRepoUpdateTask(gitRepository2, repoName2, settings, (AtomicInteger)any, (AccessToken)any);
        result = task2;
        new BackgroundableRepoUpdateTask(gitRepository3, repoName3, settings, (AtomicInteger)any, (AccessToken)any);
        times = 0;
    }};

    updater.actionPerformed(event);

    new Verifications() {{
        task1.queue();
        task2.queue();
    }};
}
 

开发者ID:JChrist,
项目名称:gitextender,
代码行数:65,
代码来源:GitExtenderUpdateAllTest.java

示例13: getShortRepositoryName

点赞 2

import com.intellij.vcsUtil.VcsImplUtil; //导入依赖的package包/类
/**
 * @deprecated use {@link VcsImplUtil#getShortVcsRootName}
 */
@Nonnull
@Deprecated
public static String getShortRepositoryName(@Nonnull Project project, @Nonnull VirtualFile root) {
  return VcsImplUtil.getShortVcsRootName(project, root);
}
 

开发者ID:consulo,
项目名称:consulo,
代码行数:9,
代码来源:DvcsUtil.java


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