diff --git a/platform/platform-impl/src/com/intellij/diagnostic/TestMessageBoxAction.java b/platform/platform-impl/src/com/intellij/diagnostic/TestMessageBoxAction.java index 1ce1caf68d7f..c184c116b396 100644 --- a/platform/platform-impl/src/com/intellij/diagnostic/TestMessageBoxAction.java +++ b/platform/platform-impl/src/com/intellij/diagnostic/TestMessageBoxAction.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2010 JetBrains s.r.o. + * Copyright 2000-2013 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,24 +18,35 @@ package com.intellij.diagnostic; import com.intellij.openapi.actionSystem.AnAction; import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.ui.Messages; +import com.intellij.openapi.util.text.StringUtil; +import java.util.Random; public class TestMessageBoxAction extends AnAction { + private final Random myRandom = new Random(); + public TestMessageBoxAction() { super("Test message box"); } @Override public void actionPerformed(final AnActionEvent e) { - final long l = System.currentTimeMillis(); - if (l % 3 == 0) { - Messages.showErrorDialog("Test error message.", "Test"); + int r = myRandom.nextInt(10); + if (r < 3) { + String message = wrap("Test error message.", r); + Messages.showErrorDialog(message, "Test"); } - else if (l % 5 == 0) { - Messages.showWarningDialog("Test warning message.", "Test"); + else if (r < 6) { + String message = wrap("Test warning message.", r); + Messages.showWarningDialog(message, "Test"); } else { - Messages.showInfoMessage("Test info message.", "Test"); + String message = wrap("Test info message.", r); + Messages.showInfoMessage(message, "Test"); } } + + private static String wrap(String s, int r) { + return r % 2 == 0 ? s : "" + StringUtil.repeat(s + "
", 10) + "
"; + } }