public void keyPressed(KeyEvent e) {
final JList list = UIUtil.findComponentOfType(FlatWelcomeFrame.this.getComponent(), JList.class);
if (e.getKeyCode() == KeyEvent.VK_ENTER) {
- action.actionPerformed(new AnActionEvent(e,
+ InputEvent event = e;
+ if (e.getComponent() instanceof JComponent) {
+ ActionLink link = UIUtil.findComponentOfType((JComponent)e.getComponent(), ActionLink.class);
+ if (link != null) {
+ event = new MouseEvent(link, MouseEvent.MOUSE_CLICKED, e.getWhen(), e.getModifiers(), 0, 0, 1, false, MouseEvent.BUTTON1);
+ }
+ }
+ action.actionPerformed(new AnActionEvent(event,
DataManager.getInstance().getDataContext(),
ActionPlaces.WELCOME_SCREEN,
action.getTemplatePresentation().clone(),
/*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
import com.intellij.openapi.ui.popup.JBPopupFactory;
import com.intellij.openapi.ui.popup.ListPopup;
import com.intellij.openapi.wm.ex.WindowManagerEx;
+import com.intellij.ui.popup.PopupFactoryImpl;
import javax.swing.*;
import java.awt.*;
protected void showPopup(DataContext context, ListPopup popup, JComponent contextComponent) {
Component focusedComponent = contextComponent != null ? contextComponent : PlatformDataKeys.CONTEXT_COMPONENT.getData(context);
if (focusedComponent != null) {
- popup.showUnderneathOf(focusedComponent);
+ if (popup instanceof PopupFactoryImpl.ActionGroupPopup && focusedComponent instanceof JLabel) {
+ ((PopupFactoryImpl.ActionGroupPopup)popup).showUnderneathOfLabel((JLabel)focusedComponent);
+ } else {
+ popup.showUnderneathOf(focusedComponent);
+ }
}
else {
Rectangle r;