本文整理匯總了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();
}
}
示例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);
}
}
示例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;
}
示例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;
}
示例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();
}
}