Search in sources :

Example 21 with InputEvent

use of java.awt.event.InputEvent in project jmeter by apache.

the class TristateCheckBox method iterateState.

// Mostly delegates to model
private void iterateState() {
    //Maybe do nothing at all?
    if (!getModel().isEnabled()) {
        return;
    }
    grabFocus();
    // Iterate state
    getTristateModel().iterateState();
    // Fire ActionEvent
    int modifiers = 0;
    AWTEvent currentEvent = EventQueue.getCurrentEvent();
    if (currentEvent instanceof InputEvent) {
        modifiers = ((InputEvent) currentEvent).getModifiers();
    } else if (currentEvent instanceof ActionEvent) {
        modifiers = ((ActionEvent) currentEvent).getModifiers();
    }
    fireActionPerformed(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, getText(), System.currentTimeMillis(), modifiers));
}
Also used : ActionEvent(java.awt.event.ActionEvent) AWTEvent(java.awt.AWTEvent) InputEvent(java.awt.event.InputEvent)

Aggregations

InputEvent (java.awt.event.InputEvent)21 MouseEvent (java.awt.event.MouseEvent)7 Editor (com.intellij.openapi.editor.Editor)4 Project (com.intellij.openapi.project.Project)4 NotNull (org.jetbrains.annotations.NotNull)4 ListPopup (com.intellij.openapi.ui.popup.ListPopup)3 AWTEvent (java.awt.AWTEvent)3 ActionEvent (java.awt.event.ActionEvent)3 Presentation (com.intellij.openapi.actionSystem.Presentation)2 DumbAwareAction (com.intellij.openapi.project.DumbAwareAction)2 ActionCallback (com.intellij.openapi.util.ActionCallback)2 Pair (com.intellij.openapi.util.Pair)2 JBList (com.intellij.ui.components.JBList)2 Nullable (org.jetbrains.annotations.Nullable)2 ExecutionBundle (com.intellij.execution.ExecutionBundle)1 ExecutionManager (com.intellij.execution.ExecutionManager)1 Executor (com.intellij.execution.Executor)1 KillableProcess (com.intellij.execution.KillableProcess)1 Location (com.intellij.execution.Location)1 RunnerAndConfigurationSettings (com.intellij.execution.RunnerAndConfigurationSettings)1