From 28465ad64666acd605f9db8ebdedd88bf9cdaa17 Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Thu, 8 Jul 2010 14:07:21 +0400 Subject: [PATCH] UI internal test action (show message box) --- .../diagnostic/TestMessageBoxAction.java | 41 +++++++++++++++++++ .../src/idea/PlatformActions.xml | 2 +- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 platform/platform-impl/src/com/intellij/diagnostic/TestMessageBoxAction.java diff --git a/platform/platform-impl/src/com/intellij/diagnostic/TestMessageBoxAction.java b/platform/platform-impl/src/com/intellij/diagnostic/TestMessageBoxAction.java new file mode 100644 index 000000000000..1ce1caf68d7f --- /dev/null +++ b/platform/platform-impl/src/com/intellij/diagnostic/TestMessageBoxAction.java @@ -0,0 +1,41 @@ +/* + * Copyright 2000-2010 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.intellij.diagnostic; + +import com.intellij.openapi.actionSystem.AnAction; +import com.intellij.openapi.actionSystem.AnActionEvent; +import com.intellij.openapi.ui.Messages; + + +public class TestMessageBoxAction extends AnAction { + 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"); + } + else if (l % 5 == 0) { + Messages.showWarningDialog("Test warning message.", "Test"); + } + else { + Messages.showInfoMessage("Test info message.", "Test"); + } + } +} diff --git a/platform/platform-resources/src/idea/PlatformActions.xml b/platform/platform-resources/src/idea/PlatformActions.xml index b9b94ee9e6da..aa0719c09fb5 100644 --- a/platform/platform-resources/src/idea/PlatformActions.xml +++ b/platform/platform-resources/src/idea/PlatformActions.xml @@ -428,7 +428,7 @@ - +