當前位置: 首頁>>代碼示例>>Java>>正文


Java DefaultActionGroup.add方法代碼示例

本文整理匯總了Java中com.intellij.openapi.actionSystem.DefaultActionGroup.add方法的典型用法代碼示例。如果您正苦於以下問題:Java DefaultActionGroup.add方法的具體用法?Java DefaultActionGroup.add怎麽用?Java DefaultActionGroup.add使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.intellij.openapi.actionSystem.DefaultActionGroup的用法示例。


在下文中一共展示了DefaultActionGroup.add方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: initBPMNModelMenu

import com.intellij.openapi.actionSystem.DefaultActionGroup; //導入方法依賴的package包/類
public void initBPMNModelMenu() {
    DefaultActionGroup modelMenu = (DefaultActionGroup) ActionManager.getInstance().getAction("yaoqiang.actions.BPMNModelMenu");
    AppMenu model = new ModelMenu();
    for (int i = 0; i < model.getItemCount(); i++) {
        JMenuItem item = model.getItem(i);
        if (item == null) {
            modelMenu.addSeparator();
        } else {
            AnAction action = new AnAction(item.getText()) {
                @Override
                public void actionPerformed(AnActionEvent e) {
                    item.getAction().actionPerformed(new ActionEvent(e, 0, ""));
                }
            };
            modelMenu.add(action);
        }
    }
}
 
開發者ID:Blenta,項目名稱:intellij-bpmn-editor,代碼行數:19,代碼來源:BPMNEditor.java

示例2: createList

import com.intellij.openapi.actionSystem.DefaultActionGroup; //導入方法依賴的package包/類
/**
 * create ListPop
 *
 * @param title
 * @param data
 * @param listener
 */
public void createList(String title, String[] data, OnItemClickListener listener) {
    DefaultActionGroup group = new DefaultActionGroup();
    if (data != null && data.length > 0) {
        for (int i = 0; i < data.length; i++) {
            if (!Utils.isEmpty(data[i])) {
                if (data[i].contains("-")) {
                    group.add(new ListItemAction(i, data[i], listener));
                } else {
                    group.addSeparator(data[i]);
                }
            }
        }
    }
    listPopup = JBPopupFactory.getInstance().createActionGroupPopup(title, group,
            anActionEvent.getDataContext(), aid, true, null, -1, null, "unknown");
    show();
}
 
開發者ID:pengwei1024,項目名稱:AndroidSourceViewer,代碼行數:25,代碼來源:PopListView.java

示例3: getTaskDescriptionActionGroup

import com.intellij.openapi.actionSystem.DefaultActionGroup; //導入方法依賴的package包/類
@NotNull
default DefaultActionGroup getTaskDescriptionActionGroup() {
  final DefaultActionGroup group = new DefaultActionGroup();
  String[] ids = new String[]{
    StudyCheckAction.ACTION_ID,
    StudyPreviousTaskAction.ACTION_ID,
    StudyNextTaskAction.ACTION_ID,
    StudyRefreshTaskFileAction.ACTION_ID,
    StudyShowHintAction.ACTION_ID
  };
  ActionManager actionManager = ActionManager.getInstance();
  Arrays.stream(ids)
    .map(actionManager::getAction)
    .filter(Objects::nonNull)
    .forEach(group::add);

  group.add(new StudyEditInputAction());
  return group;
}
 
開發者ID:medvector,項目名稱:educational-plugin,代碼行數:20,代碼來源:EduPluginConfigurator.java

示例4: initComponent

import com.intellij.openapi.actionSystem.DefaultActionGroup; //導入方法依賴的package包/類
@Override
public void initComponent() {
    PluginSettings settings = PluginSettings.getInstance();
    ActionManager am = ActionManager.getInstance();

    // Gets an instance of the WindowMenu action group.
    DefaultActionGroup menuManager = (DefaultActionGroup) am.getAction(COMPONENT_GROUP); //(IdeActions.GROUP_EDITOR_POPUP); //"EditorPopupMenu");
    //menuManager.addSeparator();

    for (PluginSettings.SearchEngine engine : settings.searchEngines) {
        LaunchSearchAction action = new LaunchSearchAction(engine);

        // Passes an instance of your custom TextBoxes class to the registerAction method of the ActionManager class.
        am.registerAction(getActionId(action), action);

        // Adds a separator and a new menu command to the WindowMenu group on the main menu.
        menuManager.add(action);  //, Constraints.LAST);
    }

    menuManager.addSeparator();
}
 
開發者ID:maddouri,項目名稱:IntelliJ-OnlineSearch,代碼行數:22,代碼來源:LaunchSearchActionRegistration.java

示例5: createToolWindowContent

import com.intellij.openapi.actionSystem.DefaultActionGroup; //導入方法依賴的package包/類
public void createToolWindowContent(@NotNull ToolWindow toolWindow) {
  //Create runner UI layout
  RunnerLayoutUi.Factory factory = RunnerLayoutUi.Factory.getInstance(myProject);
  RunnerLayoutUi layoutUi = factory.create("", "", "session", myProject);

  // Adding actions
  DefaultActionGroup group = new DefaultActionGroup();
  layoutUi.getOptions().setLeftToolbar(group, ActionPlaces.UNKNOWN);

  Content console = layoutUi.createContent(GradleConsoleToolWindowFactory.ID, myConsoleView.getComponent(), "", null, null);
  AnAction[] consoleActions = myConsoleView.createConsoleActions();
  for (AnAction action : consoleActions) {
    if (!shouldIgnoreAction(action)) {
      group.add(action);
    }
  }
  layoutUi.addContent(console, 0, PlaceInGrid.right, false);

  JComponent layoutComponent = layoutUi.getComponent();
  myConsolePanel.add(layoutComponent, BorderLayout.CENTER);

  //noinspection ConstantConditions
  Content content = ContentFactory.SERVICE.getInstance().createContent(layoutComponent, null, true);
  toolWindow.getContentManager().addContent(content);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:26,代碼來源:GradleConsoleView.java

示例6: createActionGroupPopup

import com.intellij.openapi.actionSystem.DefaultActionGroup; //導入方法依賴的package包/類
@Nullable
protected JBPopup createActionGroupPopup(PsiFile file, Project project, Editor editor) {
  final DefaultActionGroup group = new DefaultActionGroup();
  for (final IntentionAction action : IntentionManager.getInstance().getAvailableIntentionActions()) {
    if (shouldShowInGutterPopup(action) && action.isAvailable(project, editor, file)) {
      group.add(new ApplyIntentionAction(action, action.getText(), editor, file));
    }
  }

  if (group.getChildrenCount() > 0) {
    final DataContext context = SimpleDataContext.getProjectContext(null);
    return JBPopupFactory.getInstance()
      .createActionGroupPopup(null, group, context, JBPopupFactory.ActionSelectionAid.SPEEDSEARCH, true);
  }

  return null;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:18,代碼來源:ExternalAnnotationsLineMarkerProvider.java

示例7: getToolbarActions

import com.intellij.openapi.actionSystem.DefaultActionGroup; //導入方法依賴的package包/類
@NotNull
public ActionGroup getToolbarActions() {
  DefaultActionGroup group = new DefaultActionGroup();

  if (Boolean.getBoolean(ENABLE_EXPERIMENTAL_ACTIONS)) {
    group.add(new RecordingAction(myMemorySampler));
  }
  group.add(new GcAction(myDeviceContext));
  group.add(new DumpHprofAction(myProject, myDeviceContext, myEvents));
  group.add(new ToggleAllocationTrackingAction(myDeviceContext, myEvents));

  if (Boolean.getBoolean("studio.profiling.debug")) {
    group.addSeparator();
    group.add(new ToggleDebugRender(myTimelineComponent));
  }

  return group;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:19,代碼來源:MemoryMonitorView.java

示例8: createLanguagePopup

import com.intellij.openapi.actionSystem.DefaultActionGroup; //導入方法依賴的package包/類
private ListPopup createLanguagePopup() {
  DefaultActionGroup actions = new DefaultActionGroup();
  for (final Language language : getEditorsProvider().getSupportedLanguages(myProject, mySourcePosition)) {
    //noinspection ConstantConditions
    actions.add(new AnAction(language.getDisplayName(), null, language.getAssociatedFileType().getIcon()) {
      @Override
      public void actionPerformed(@NotNull AnActionEvent e) {
        XExpression currentExpression = getExpression();
        setExpression(new XExpressionImpl(currentExpression.getExpression(), language, currentExpression.getCustomInfo()));
        requestFocusInEditor();
      }
    });
  }

  DataContext dataContext = DataManager.getInstance().getDataContext(getComponent());
  return JBPopupFactory.getInstance().createActionGroupPopup("Choose language", actions, dataContext,
                                                             JBPopupFactory.ActionSelectionAid.SPEEDSEARCH,
                                                             false);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:20,代碼來源:XDebuggerEditorBase.java

示例9: createToolbarWithActions

import com.intellij.openapi.actionSystem.DefaultActionGroup; //導入方法依賴的package包/類
/**
 * Create some actions
 *
 * @param horizontal     is horizontal displayed
 * @return
 */
public static ActionToolbar createToolbarWithActions(boolean horizontal,
                                                     AnAction... actions) {
    DefaultActionGroup group = new DefaultActionGroup();

    if (actions != null) {
        for (AnAction anAction : actions) {
            group.add(anAction);
        }
    }
    //group.addSeparator();
    return ActionManager.getInstance().createActionToolbar("unknown", group, horizontal);// horizontal
}
 
開發者ID:beansoftapp,項目名稱:react-native-console,代碼行數:19,代碼來源:ActionUtil.java

示例10: createActionToolbar

import com.intellij.openapi.actionSystem.DefaultActionGroup; //導入方法依賴的package包/類
@NotNull
private ActionGroup createActionToolbar(JComponent consolePanel, ConsoleView consoleView, @NotNull final RunnerLayoutUi myUi, RunContentDescriptor contentDescriptor, Executor runExecutorInstance) {
    final DefaultActionGroup actionGroup = new DefaultActionGroup();
    actionGroup.add(new FilterAction());
    actionGroup.add(new RerunAction(consolePanel, consoleView));
    actionGroup.add(new StopAction());
    actionGroup.add(new FormatAction());
    actionGroup.add(new MyCloseAction(runExecutorInstance, contentDescriptor, myProject));
    return actionGroup;
}
 
開發者ID:kookob,項目名稱:mybatis-log-plugin,代碼行數:11,代碼來源:TailContentExecutor.java

示例11: createToolbar

import com.intellij.openapi.actionSystem.DefaultActionGroup; //導入方法依賴的package包/類
public ActionToolbar createToolbar() {
    DefaultActionGroup group = new DefaultActionGroup();
    group.add(new ScrollToTheEndToolbarAction(this.getEditor()));
    group.add(new ClearLogAction(this));
    group.add(new StartAction(this, getProject()));

    ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar("left", group, false);
    toolbar.setTargetComponent(this.getComponent());

    return toolbar;
}
 
開發者ID:reasonml-editor,項目名稱:reasonml-idea-plugin,代碼行數:12,代碼來源:BsConsole.java

示例12: getTaskDescriptionActionGroup

import com.intellij.openapi.actionSystem.DefaultActionGroup; //導入方法依賴的package包/類
@NotNull
@Override
public DefaultActionGroup getTaskDescriptionActionGroup() {
  DefaultActionGroup taskDescriptionActionGroup = super.getTaskDescriptionActionGroup();
  taskDescriptionActionGroup.remove(ActionManager.getInstance().getAction(StudyShowHintAction.ACTION_ID));
  StudyFillPlaceholdersAction fillPlaceholdersAction = new StudyFillPlaceholdersAction();
  fillPlaceholdersAction.getTemplatePresentation().setIcon(EduKotlinIcons.FILL_PLACEHOLDERS_ICON);
  fillPlaceholdersAction.getTemplatePresentation().setText("Fill Answer Placeholders");
  taskDescriptionActionGroup.add(fillPlaceholdersAction);
  return taskDescriptionActionGroup;
}
 
開發者ID:medvector,項目名稱:educational-plugin,代碼行數:12,代碼來源:EduKotlinPluginConfigurator.java

示例13: createUI

import com.intellij.openapi.actionSystem.DefaultActionGroup; //導入方法依賴的package包/類
private void createUI() {
  myMainPanel = new JPanel(new BorderLayout());
  myBrowser = new RepositoryBrowserComponent(SvnVcs.getInstance(myProject));

  final DefaultActionGroup group = new DefaultActionGroup();
  group.add(new RepositoryBrowserDialog.MkDirAction(myBrowser) {
    @Override
    public void update(AnActionEvent e) {
      super.update(e);
      e.getPresentation().setText("New Remote Folder...");
    }
  });
  group.add(new RepositoryBrowserDialog.DeleteAction(myBrowser));
  group.add(new RepositoryBrowserDialog.RefreshAction(myBrowser));
  final ActionPopupMenu popupMenu = ActionManager.getInstance().createActionPopupMenu("", group);
  final JPopupMenu component = popupMenu.getComponent();
  myBrowser.getRepositoryTree().addMouseListener(new PopupHandler() {
    @Override
    public void invokePopup(Component comp, int x, int y) {
      component.show(comp, x, y);
    }
  });

  final Splitter splitter = new Splitter(true);
  splitter.setProportion(0.7f);
  final JPanel wrapper = createBrowserPartWrapper();
  splitter.setFirstComponent(wrapper);
  final JPanel commitMessageWrapper = createCommitMessageWrapper();
  splitter.setSecondComponent(commitMessageWrapper);

  myMainPanel.add(splitter, BorderLayout.CENTER);
  final JPanel recentMessagesWrapper = new JPanel(new BorderLayout());
  recentMessagesWrapper.add(new JLabel("Recent Messages:"), BorderLayout.NORTH);
  myMessagesBox = new JComboBox();
  recentMessagesWrapper.add(myMessagesBox, BorderLayout.SOUTH);
  recentMessagesWrapper.setBorder(BorderFactory.createEmptyBorder(4,0,0,0));
  myMainPanel.add(recentMessagesWrapper, BorderLayout.SOUTH);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:39,代碼來源:CopyOptionsDialog.java

示例14: addFillActions

import com.intellij.openapi.actionSystem.DefaultActionGroup; //導入方法依賴的package包/類
static void addFillActions(DesignerEditorPanel designer,
                                   DefaultActionGroup actionGroup,
                                   List<? extends RadViewComponent> selection) {
  actionGroup.add(new ToggleSizeAction(designer, selection, "Toggle Width", ATTR_LAYOUT_WIDTH, AndroidDesignerIcons.FillWidth,
                                        AndroidDesignerIcons.WrapWidth));
  actionGroup.add(new ToggleSizeAction(designer, selection, "Toggle Height", ATTR_LAYOUT_HEIGHT, AndroidDesignerIcons.FillHeight,
                                        AndroidDesignerIcons.WrapHeight));
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:9,代碼來源:RadViewLayout.java

示例15: createActions

import com.intellij.openapi.actionSystem.DefaultActionGroup; //導入方法依賴的package包/類
/**
 * Create a list of idea actions that the user can choose, to change their pairs.
 *
 * @param pairController Pair logic controller for list of members.
 * @return list of actions.
 */
private static ActionGroup createActions(@NotNull PairController pairController, @NotNull TeamMemberAction.TeamMemberActionPerformer teamMemberActionPerformer) {
    DefaultActionGroup defaultActionGroup = new DefaultActionGroup(null, false);
    PairConfig pairConfig = pairController.getPairConfig();

    for (TeamMember teamMember : pairConfig.getTeamMembers()) {
        defaultActionGroup.add(new TeamMemberAction(teamMember, teamMemberActionPerformer));
    }

    return defaultActionGroup;
}
 
開發者ID:RoboPlugins,項目名稱:git-pair.idea,代碼行數:17,代碼來源:PairsPopupList.java


注:本文中的com.intellij.openapi.actionSystem.DefaultActionGroup.add方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。