本文整理汇总了Java中com.intellij.ui.popup.PopupFactoryImpl.ActionGroupPopup方法的典型用法代码示例。如果您正苦于以下问题:Java PopupFactoryImpl.ActionGroupPopup方法的具体用法?Java PopupFactoryImpl.ActionGroupPopup怎么用?Java PopupFactoryImpl.ActionGroupPopup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.ui.popup.PopupFactoryImpl
的用法示例。
在下文中一共展示了PopupFactoryImpl.ActionGroupPopup方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: showPopup
import com.intellij.ui.popup.PopupFactoryImpl; //导入方法依赖的package包/类
protected void showPopup(DataContext context, ListPopup popup, JComponent contextComponent) {
Component focusedComponent = contextComponent != null ? contextComponent : PlatformDataKeys.CONTEXT_COMPONENT.getData(context);
if (focusedComponent != null) {
if (popup instanceof PopupFactoryImpl.ActionGroupPopup && focusedComponent instanceof JLabel) {
((PopupFactoryImpl.ActionGroupPopup)popup).showUnderneathOfLabel((JLabel)focusedComponent);
} else {
popup.showUnderneathOf(focusedComponent);
}
}
else {
Rectangle r;
int x;
int y;
focusedComponent = WindowManagerEx.getInstanceEx().getFocusedComponent((Project)null);
r = WindowManagerEx.getInstanceEx().getScreenBounds();
x = r.x + r.width / 2;
y = r.y + r.height / 2;
Point point = new Point(x, y);
SwingUtilities.convertPointToScreen(point, focusedComponent.getParent());
popup.showInScreenCoordinates(focusedComponent.getParent(), point);
}
}
示例2: createActionLink
import com.intellij.ui.popup.PopupFactoryImpl; //导入方法依赖的package包/类
private JComponent createActionLink(final String text, final String groupId, Icon icon, boolean focusListOnLeft) {
final Ref<ActionLink> ref = new Ref<ActionLink>(null);
AnAction action = new AnAction() {
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
ActionGroup configureGroup = (ActionGroup)ActionManager.getInstance().getAction(groupId);
final PopupFactoryImpl.ActionGroupPopup popup = (PopupFactoryImpl.ActionGroupPopup)JBPopupFactory.getInstance()
.createActionGroupPopup(null, new IconsFreeActionGroup(configureGroup), e.getDataContext(), JBPopupFactory.ActionSelectionAid.SPEEDSEARCH, false,
ActionPlaces.WELCOME_SCREEN);
popup.showUnderneathOfLabel(ref.get());
UsageTrigger.trigger("welcome.screen." + groupId);
}
};
ref.set(new ActionLink(text, icon, action));
ref.get().setPaintUnderline(false);
ref.get().setNormalColor(getLinkNormalColor());
NonOpaquePanel panel = new NonOpaquePanel(new BorderLayout());
panel.setBorder(JBUI.Borders.empty(4, 6, 4, 6));
panel.add(ref.get());
panel.add(createArrow(ref.get()), BorderLayout.EAST);
installFocusable(panel, action, KeyEvent.VK_UP, KeyEvent.VK_DOWN, focusListOnLeft);
return panel;
}
示例3: showPopup
import com.intellij.ui.popup.PopupFactoryImpl; //导入方法依赖的package包/类
protected void showPopup(DataContext context, ListPopup popup, JComponent contextComponent) {
Component focusedComponent = contextComponent != null ? contextComponent : context.getData(PlatformDataKeys.CONTEXT_COMPONENT);
if (focusedComponent != null) {
if (popup instanceof PopupFactoryImpl.ActionGroupPopup && focusedComponent instanceof JLabel) {
((PopupFactoryImpl.ActionGroupPopup)popup).showUnderneathOfLabel((JLabel)focusedComponent);
} else {
popup.showUnderneathOf(focusedComponent);
}
}
else {
Rectangle r;
int x;
int y;
focusedComponent = WindowManagerEx.getInstanceEx().getFocusedComponent((Project)null);
r = WindowManagerEx.getInstanceEx().getScreenBounds();
x = r.x + r.width / 2;
y = r.y + r.height / 2;
Point point = new Point(x, y);
SwingUtilities.convertPointToScreen(point, focusedComponent.getParent());
popup.showInScreenCoordinates(focusedComponent.getParent(), point);
}
}
示例4: createActionLink
import com.intellij.ui.popup.PopupFactoryImpl; //导入方法依赖的package包/类
private JComponent createActionLink(final String text, final String groupId, Icon icon, boolean focusListOnLeft) {
final Ref<ActionLink> ref = new Ref<>(null);
AnAction action = new AnAction() {
@RequiredDispatchThread
@Override
public void actionPerformed(@Nonnull AnActionEvent e) {
ActionGroup configureGroup = (ActionGroup)ActionManager.getInstance().getAction(groupId);
final PopupFactoryImpl.ActionGroupPopup popup = (PopupFactoryImpl.ActionGroupPopup)JBPopupFactory.getInstance()
.createActionGroupPopup(null, new IconsFreeActionGroup(configureGroup), e.getDataContext(), JBPopupFactory.ActionSelectionAid.SPEEDSEARCH, false, ActionPlaces.WELCOME_SCREEN);
popup.showUnderneathOfLabel(ref.get());
UsageTrigger.trigger("welcome.screen." + groupId);
}
};
JComponent panel = createActionLink(text, icon, ref, action);
installFocusable(panel, action, KeyEvent.VK_UP, KeyEvent.VK_DOWN, focusListOnLeft);
return panel;
}
示例5: getPopupStep
import com.intellij.ui.popup.PopupFactoryImpl; //导入方法依赖的package包/类
@Nullable
@Override
public ListPopup getPopupStep() {
ActionGroup popupGroup = getActions();
return new PopupFactoryImpl.ActionGroupPopup("Symfony Profiler", popupGroup, SimpleDataContext.getProjectContext(getProject()), false, false, false, true, null, -1, null, null);
}