当前位置: 首页>>代码示例>>Java>>正文


Java JBPopupFactory.createActionGroupPopup方法代码示例

本文整理汇总了Java中com.intellij.openapi.ui.popup.JBPopupFactory.createActionGroupPopup方法的典型用法代码示例。如果您正苦于以下问题:Java JBPopupFactory.createActionGroupPopup方法的具体用法?Java JBPopupFactory.createActionGroupPopup怎么用?Java JBPopupFactory.createActionGroupPopup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.openapi.ui.popup.JBPopupFactory的用法示例。


在下文中一共展示了JBPopupFactory.createActionGroupPopup方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: actionPerformed

import com.intellij.openapi.ui.popup.JBPopupFactory; //导入方法依赖的package包/类
protected void actionPerformed(final GuiEditor editor, final List<RadComponent> selection, final AnActionEvent e) {
  final DefaultActionGroup actionGroup = prepareActionGroup(selection);
  final JComponent selectedComponent = selection.get(0).getDelegee();
  final DataContext context = DataManager.getInstance().getDataContext(selectedComponent);
  final JBPopupFactory factory = JBPopupFactory.getInstance();
  final ListPopup popup = factory.createActionGroupPopup(UIDesignerBundle.message("create.listener.title"), actionGroup, context,
                                                         JBPopupFactory.ActionSelectionAid.NUMBERING, true);

  FormEditingUtil.showPopupUnderComponent(popup, selection.get(0));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:CreateListenerAction.java

示例2: showNavigatePopup

import com.intellij.openapi.ui.popup.JBPopupFactory; //导入方法依赖的package包/类
public static void showNavigatePopup(final RadComponent component, final boolean showIfEmpty) {
  final DefaultActionGroup actionGroup = prepareActionGroup(component);
  if (actionGroup != null && actionGroup.getChildrenCount() == 0 && showIfEmpty) {
    actionGroup.add(new MyNavigateAction(UIDesignerBundle.message("navigate.to.listener.empty"), null));
  }
  if (actionGroup != null && actionGroup.getChildrenCount() > 0) {
    final DataContext context = DataManager.getInstance().getDataContext(component.getDelegee());
    final JBPopupFactory factory = JBPopupFactory.getInstance();
    final ListPopup popup = factory.createActionGroupPopup(UIDesignerBundle.message("navigate.to.listener.title"), actionGroup, context,
                                                           JBPopupFactory.ActionSelectionAid.NUMBERING, true);
    FormEditingUtil.showPopupUnderComponent(popup, component);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:ListenerNavigateButton.java

示例3: doAddAction

import com.intellij.openapi.ui.popup.JBPopupFactory; //导入方法依赖的package包/类
void doAddAction(AnActionButton button) {
    if (isUnknown()) {
      return;
    }

    final JBPopupFactory popupFactory = JBPopupFactory.getInstance();
    final BeforeRunTaskProvider<BeforeRunTask>[] providers = Extensions.getExtensions(BeforeRunTaskProvider.EXTENSION_POINT_NAME,
                                                                                      myRunConfiguration.getProject());
  Set<Key> activeProviderKeys = getActiveProviderKeys();

  DefaultActionGroup actionGroup = new DefaultActionGroup(null, false);
    for (final BeforeRunTaskProvider<BeforeRunTask> provider : providers) {
      if (provider.createTask(myRunConfiguration) == null)
        continue;
      if (activeProviderKeys.contains(provider.getId()) && provider.isSingleton())
        continue;
      AnAction providerAction = new AnAction(provider.getName(), null, provider.getIcon()) {
        @Override
        public void actionPerformed(AnActionEvent e) {
          BeforeRunTask task = provider.createTask(myRunConfiguration);
          if (task != null) {
            provider.configureTask(myRunConfiguration, task);
            if (!provider.canExecuteTask(myRunConfiguration, task))
              return;
          } else {
            return;
          }
          task.setEnabled(true);

          Set<RunConfiguration> configurationSet = new HashSet<RunConfiguration>();
          getAllRunBeforeRuns(task, configurationSet);
          if (configurationSet.contains(myRunConfiguration)) {
            JOptionPane.showMessageDialog(BeforeRunStepsPanel.this,
                                          ExecutionBundle.message("before.launch.panel.cyclic_dependency_warning",
                                                                  myRunConfiguration.getName(),
                                                                  provider.getDescription(task)),
                                          ExecutionBundle.message("warning.common.title"),JOptionPane.WARNING_MESSAGE);
            return;
          }
          addTask(task);
          myListener.fireStepsBeforeRunChanged();
        }
      };
      actionGroup.add(providerAction);
    }
    final ListPopup popup =
      popupFactory.createActionGroupPopup(ExecutionBundle.message("add.new.run.configuration.acrtion.name"), actionGroup,
                                          SimpleDataContext.getProjectContext(myRunConfiguration.getProject()), false, false, false, null,
                                          -1, Conditions.<AnAction>alwaysTrue());
    popup.show(button.getPreferredPopupPoint());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:52,代码来源:BeforeRunStepsPanel.java


注:本文中的com.intellij.openapi.ui.popup.JBPopupFactory.createActionGroupPopup方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。