mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
add fake input event, and report to AnActionListener.TOPIC
GitOrigin-RevId: 0641f213d333230bdf72ce387b2f49d76a0fb186
This commit is contained in:
committed by
intellij-monorepo-bot
parent
e83fd7e93e
commit
2d25843b93
@@ -12,6 +12,8 @@ import org.jetbrains.annotations.NotNull;
|
||||
import javax.swing.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.awt.event.InputEvent;
|
||||
import java.awt.event.KeyEvent;
|
||||
|
||||
/**
|
||||
* @author max
|
||||
@@ -77,7 +79,9 @@ public abstract class CheckboxAction extends ToggleAction implements CustomCompo
|
||||
ActionToolbar actionToolbar = UIUtil.getParentOfType(ActionToolbar.class, checkBox);
|
||||
DataContext dataContext =
|
||||
actionToolbar != null ? actionToolbar.getToolbarDataContext() : DataManager.getInstance().getDataContext(checkBox);
|
||||
action.actionPerformed(AnActionEvent.createFromAnAction(action, null, place, dataContext));
|
||||
InputEvent inputEvent = new KeyEvent(checkBox, KeyEvent.KEY_PRESSED, System.currentTimeMillis(), 0, KeyEvent.VK_SPACE, ' ');
|
||||
AnActionEvent event = AnActionEvent.createFromAnAction(action, inputEvent, place, dataContext);
|
||||
ActionUtil.performActionDumbAwareWithCallbacks(action, event, dataContext);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user