mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
UI internal test action (show message box)
This commit is contained in:
@@ -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"/>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user