UI internal test action (show message box)

This commit is contained in:
Roman Shevchenko
2010-07-14 11:32:43 +04:00
parent ac7d4f9bed
commit 28465ad646
2 changed files with 42 additions and 1 deletions
@@ -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");
}
}
}
@@ -428,7 +428,7 @@
<separator/>
<action id="NotificationTestAction" internal="true" class="com.intellij.notification.impl.actions.NotificationTestAction"
text="Add Test Notification"/>
<action id="TestMessageBoxAction" internal="true" class="com.intellij.diagnostic.TestMessageBoxAction" text="Show Test Dialog"/>
<separator/>
<reference ref="MaintenanceGroup"/>