當前位置: 首頁>>代碼示例>>Java>>正文


Java Messages.setTestDialog方法代碼示例

本文整理匯總了Java中com.intellij.openapi.ui.Messages.setTestDialog方法的典型用法代碼示例。如果您正苦於以下問題:Java Messages.setTestDialog方法的具體用法?Java Messages.setTestDialog怎麽用?Java Messages.setTestDialog使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.intellij.openapi.ui.Messages的用法示例。


在下文中一共展示了Messages.setTestDialog方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: tearDown

import com.intellij.openapi.ui.Messages; //導入方法依賴的package包/類
@Override
public void tearDown() throws Exception {
  if (myJdkHome == null) {
    //super.setUp() wasn't called
    return;
  }

  try {
    new WriteAction() {
      @Override
      protected void run(@NotNull Result result) throws Throwable {
        Sdk old = ProjectJdkTable.getInstance().findJdk(GRADLE_JDK_NAME);
        if (old != null) {
          SdkConfigurationUtil.removeSdk(old);
        }
      }
    }.execute();
    Messages.setTestDialog(TestDialog.DEFAULT);
    FileUtil.delete(BuildManager.getInstance().getBuildSystemDirectory());
  }
  finally {
    super.tearDown();
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:25,代碼來源:GradleImportingTestCase.java

示例2: testGithubAlreadyExists

import com.intellij.openapi.ui.Messages; //導入方法依賴的package包/類
public void testGithubAlreadyExists() throws Throwable {
  final boolean[] dialogShown = new boolean[1];
  TestDialog oldTestDialog = Messages.setTestDialog(new TestDialog() {
    @Override
    public int show(String message) {
      dialogShown[0] = message.contains("Successfully connected to") && message.contains("Do you want to proceed anyway?");
      return 1;
    }
  });

  try {
    registerDefaultShareDialogHandler();
    registerDefaultUntrackedFilesDialogHandler();

    createProjectFiles();
    GithubShareAction.shareProjectOnGithub(myProject, myProjectRoot);
    assertFalse(dialogShown[0]);

    GithubShareAction.shareProjectOnGithub(myProject, myProjectRoot);
    assertTrue(dialogShown[0]);
  }
  finally {
    Messages.setTestDialog(oldTestDialog);
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:26,代碼來源:GithubShareProjectTest.java

示例3: configConfirmationForYesAnswer

import com.intellij.openapi.ui.Messages; //導入方法依賴的package包/類
protected static AtomicInteger configConfirmationForYesAnswer() {
  final AtomicInteger counter = new AtomicInteger();
  Messages.setTestDialog(new TestDialog() {
    @Override
    public int show(String message) {
      counter.set(counter.get() + 1);
      return 0;
    }
  });
  return counter;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:12,代碼來源:ExternalSystemImportingTestCase.java

示例4: configConfirmationForNoAnswer

import com.intellij.openapi.ui.Messages; //導入方法依賴的package包/類
protected static AtomicInteger configConfirmationForNoAnswer() {
  final AtomicInteger counter = new AtomicInteger();
  Messages.setTestDialog(new TestDialog() {
    @Override
    public int show(String message) {
      counter.set(counter.get() + 1);
      return 1;
    }
  });
  return counter;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:12,代碼來源:ExternalSystemImportingTestCase.java

示例5: tearDown

import com.intellij.openapi.ui.Messages; //導入方法依賴的package包/類
@Override
protected void tearDown() throws Exception {
  try {
    if (myGlobalSettingsFile != null) {
      VfsRootAccess.disallowRootAccess(myGlobalSettingsFile.getAbsolutePath());
    }
    VfsRootAccess.disallowRootAccess(PathManager.getConfigPath());
    Messages.setTestDialog(TestDialog.DEFAULT);
    removeFromLocalRepository("test");
    FileUtil.delete(BuildManager.getInstance().getBuildSystemDirectory());
  }
  finally {
    super.tearDown();
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:16,代碼來源:MavenImportingTestCase.java


注:本文中的com.intellij.openapi.ui.Messages.setTestDialog方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。