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


Java DefaultActionGroup.addSeparator方法代码示例

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


在下文中一共展示了DefaultActionGroup.addSeparator方法的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: 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

示例4: createActions

import com.intellij.openapi.actionSystem.DefaultActionGroup; //导入方法依赖的package包/类
@NotNull
private ActionGroup createActions() {
  DefaultActionGroup popupGroup = new DefaultActionGroup(null, false);
  AbstractRepositoryManager<Repo> repositoryManager = myRepositoryManager;
  if (repositoryManager.moreThanOneRoot()) {
    if (userWantsSyncControl()) {
      fillWithCommonRepositoryActions(popupGroup, repositoryManager);
    }
    else {
      fillPopupWithCurrentRepositoryActions(popupGroup, createRepositoriesActions());
    }
  }
  else {
    fillPopupWithCurrentRepositoryActions(popupGroup, null);
  }
  popupGroup.addSeparator();
  return popupGroup;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:DvcsBranchPopup.java

示例5: createPopupActionGroup

import com.intellij.openapi.actionSystem.DefaultActionGroup; //导入方法依赖的package包/类
@NotNull
@Override
protected DefaultActionGroup createPopupActionGroup(JComponent button) {
  DefaultActionGroup group = new DefaultActionGroup();

  group.add(new ShareWithTeamCheckBoxAction());
  group.addSeparator();

  group.add(new CopyAction());
  group.add(new RenameAction());
  group.add(new DeleteAction());
  group.add(new EditDescriptionAction(myBuilder.hasDescription()));
  group.add(new ExportAction());
  group.addSeparator();

  group.add(new ImportAction());

  return group;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:ManageButton.java

示例6: setUpToolWindow

import com.intellij.openapi.actionSystem.DefaultActionGroup; //导入方法依赖的package包/类
private Content setUpToolWindow() {
  //Create runner UI layout
  final RunnerLayoutUi.Factory factory = RunnerLayoutUi.Factory.getInstance(myProject);
  final RunnerLayoutUi layoutUi = factory.create("", "", "session", myProject);

  // Adding actions
  DefaultActionGroup group = new DefaultActionGroup();
  group.add(myKillAction);
  group.addSeparator();

  layoutUi.getOptions().setLeftToolbar(group, ActionPlaces.UNKNOWN);

  final Content console = layoutUi.createContent(CONSOLE_ID, myConsole.getComponent(), "", null, null);
  layoutUi.addContent(console, 0, PlaceInGrid.right, false);

  final JComponent uiComponent = layoutUi.getComponent();
  myPanel.add(uiComponent, BorderLayout.CENTER);

  final ContentManager manager = myToolWindow.getContentManager();
  final ContentFactory contentFactory = ContentFactory.SERVICE.getInstance();
  final Content content = contentFactory.createContent(uiComponent, null, true);
  manager.addContent(content);
  return content;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:MvcConsole.java

示例7: createPopup

import com.intellij.openapi.actionSystem.DefaultActionGroup; //导入方法依赖的package包/类
protected JPopupMenu createPopup(boolean toolWindow) {
  DefaultActionGroup group = new DefaultActionGroup();
  DefaultActionGroup newGroup = new DefaultActionGroup("_New", true);
  final RepositoryBrowserComponent browser = getRepositoryBrowser();
  newGroup.add(new AddLocationAction(browser));
  newGroup.add(new MkDirAction(browser));
  group.add(newGroup);
  group.addSeparator();
  group.add(new RefreshAction(browser));
  group.add(new DiscardLocationAction(browser));
  ActionPopupMenu menu = ActionManager.getInstance().createActionPopupMenu("", group);
  return menu.getComponent();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:SelectCreateExternalTargetDialog.java

示例8: createAddArtifactAction

import com.intellij.openapi.actionSystem.DefaultActionGroup; //导入方法依赖的package包/类
private AnAction createAddArtifactAction(@NotNull final ArtifactType type) {
  final List<? extends ArtifactTemplate> templates = type.getNewArtifactTemplates(myPackagingEditorContext);
  final ArtifactTemplate emptyTemplate = new ArtifactTemplate() {
    @Override
    public String getPresentableName() {
      return "Empty";
    }

    @Override
    public NewArtifactConfiguration createArtifact() {
      final String name = "unnamed";
      return new NewArtifactConfiguration(type.createRootElement(name), name, type);
    }
  };

  if (templates.isEmpty()) {
    return new AddArtifactAction(type, emptyTemplate, type.getPresentableName(), type.getIcon());
  }
  final DefaultActionGroup group = new DefaultActionGroup(type.getPresentableName(), true);
  group.getTemplatePresentation().setIcon(type.getIcon());
  group.add(new AddArtifactAction(type, emptyTemplate, emptyTemplate.getPresentableName(), null));
  group.addSeparator();
  for (ArtifactTemplate template : templates) {
    group.add(new AddArtifactAction(type, template, template.getPresentableName(), null));
  }
  return group;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:28,代码来源:ArtifactsStructureConfigurable.java

示例9: addActionBlock

import com.intellij.openapi.actionSystem.DefaultActionGroup; //导入方法依赖的package包/类
public static void addActionBlock(@NotNull DefaultActionGroup group, AnAction... actions) {
  if (actions.length == 0) return;
  if (group.getChildrenCount() != 0) group.addSeparator();

  for (AnAction action : actions) {
    if (action != null) group.add(action);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:DiffUtil.java

示例10: handlePopup

import com.intellij.openapi.actionSystem.DefaultActionGroup; //导入方法依赖的package包/类
private void handlePopup(final MouseEvent e) {
  if (e.getClickCount() != 1 || !e.isPopupTrigger()) return;

  if (e.getX() < 0 || e.getX() >= e.getComponent().getWidth() || e.getY() < 0 || e.getY() >= e.getComponent().getHeight()) return;

  String place = myTabs.getPopupPlace();
  place = place != null ? place : ActionPlaces.UNKNOWN;
  myTabs.myPopupInfo = myInfo;

  final DefaultActionGroup toShow = new DefaultActionGroup();
  if (myTabs.getPopupGroup() != null) {
    toShow.addAll(myTabs.getPopupGroup());
    toShow.addSeparator();
  }

  JBTabsImpl tabs =
    JBTabsImpl.NAVIGATION_ACTIONS_KEY.getData(DataManager.getInstance().getDataContext(e.getComponent(), e.getX(), e.getY()));
  if (tabs == myTabs && myTabs.myAddNavigationGroup) {
    toShow.addAll(myTabs.myNavigationActions);
  }

  if (toShow.getChildrenCount() == 0) return;

  myTabs.myActivePopup = myTabs.myActionManager.createActionPopupMenu(place, toShow).getComponent();
  myTabs.myActivePopup.addPopupMenuListener(myTabs.myPopupListener);

  myTabs.myActivePopup.addPopupMenuListener(myTabs);
  myTabs.myActivePopup.show(e.getComponent(), e.getX(), e.getY());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:TabLabel.java

示例11: createShortPopupForRepositoryDialog

import com.intellij.openapi.actionSystem.DefaultActionGroup; //导入方法依赖的package包/类
public static ActionPopupMenu createShortPopupForRepositoryDialog(RepositoryBrowserComponent browserComponent) {
  DefaultActionGroup group = new DefaultActionGroup();
  DefaultActionGroup newGroup = new DefaultActionGroup("_New", true);
  newGroup.add(new AddLocationAction(browserComponent));
  newGroup.add(new MkDirAction(browserComponent));
  group.add(newGroup);
  group.addSeparator();
  group.add(new RefreshAction(browserComponent));
  group.add(new DiscardLocationAction(browserComponent));
  group.add(new DeleteAction(browserComponent));
  return ActionManager.getInstance().createActionPopupMenu("", group);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:ShareDialog.java

示例12: createPopupActionGroup

import com.intellij.openapi.actionSystem.DefaultActionGroup; //导入方法依赖的package包/类
@NotNull
@Override
public DefaultActionGroup createPopupActionGroup(final JComponent component) {
  final DefaultActionGroup group = new DefaultActionGroup();

  final List<NamedScope> predefinedScopes = new ArrayList<NamedScope>();
  final List<NamedScope> customScopes = new ArrayList<NamedScope>();
  for (final NamedScopesHolder holder : NamedScopesHolder.getAllNamedScopeHolders(myProject)) {
    Collections.addAll(customScopes, holder.getEditableScopes());
    predefinedScopes.addAll(holder.getPredefinedScopes());
  }
  predefinedScopes.remove(CustomScopesProviderEx.getAllScope());
  for (NamedScope predefinedScope : predefinedScopes) {
    if (predefinedScope instanceof NonProjectFilesScope) {
      predefinedScopes.remove(predefinedScope);
      break;
    }
  }

  fillActionGroup(group, predefinedScopes, myDefaultDescriptors, myInspectionProfile, myExcludedScopeNames);
  group.addSeparator();
  fillActionGroup(group, customScopes, myDefaultDescriptors, myInspectionProfile, myExcludedScopeNames);

  group.addSeparator();
  group.add(new DumbAwareAction("Edit Scopes Order...") {
    @Override
    public void actionPerformed(final AnActionEvent e) {
      final ScopesOrderDialog dlg = new ScopesOrderDialog(component, myInspectionProfile, myProject);
      if (dlg.showAndGet()) {
        onScopesOrderChanged();
      }
    }
  });

  return group;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:37,代码来源:ScopesChooser.java

示例13: addPopupActions

import com.intellij.openapi.actionSystem.DefaultActionGroup; //导入方法依赖的package包/类
@Override
public boolean addPopupActions(@NotNull AndroidDesignerEditorPanel designer,
                               @NotNull DefaultActionGroup beforeGroup,
                               @NotNull DefaultActionGroup afterGroup,
                               @Nullable JComponent shortcuts,
                               @NotNull List<RadComponent> selection) {
  super.addPopupActions(designer, beforeGroup, afterGroup, shortcuts, selection);
  beforeGroup.add(new AssignFragmentLayoutAction(designer));
  beforeGroup.addSeparator();
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:RadFragment.java

示例14: createActions

import com.intellij.openapi.actionSystem.DefaultActionGroup; //导入方法依赖的package包/类
public static DefaultActionGroup createActions(RenderContext configurationHolder) {
  DefaultActionGroup group = new DefaultActionGroup();
  ConfigurationMenuAction configAction = new ConfigurationMenuAction(configurationHolder);
  group.add(configAction);
  group.addSeparator();

  DeviceMenuAction deviceAction = new DeviceMenuAction(configurationHolder);
  group.add(deviceAction);
  group.addSeparator();

  OrientationMenuAction orientationAction = new OrientationMenuAction(configurationHolder);
  group.add(orientationAction);
  group.addSeparator();

  ThemeMenuAction themeAction = new ThemeMenuAction(configurationHolder);
  group.add(themeAction);
  group.addSeparator();

  ActivityMenuAction activityAction = new ActivityMenuAction(configurationHolder);
  group.add(activityAction);
  group.addSeparator();

  LocaleMenuAction localeAction = new LocaleMenuAction(configurationHolder);
  group.add(localeAction);
  group.addSeparator();

  TargetMenuAction targetMenuAction = new TargetMenuAction(configurationHolder);
  group.add(targetMenuAction);
  return group;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:31,代码来源:ConfigurationToolBar.java

示例15: createActions

import com.intellij.openapi.actionSystem.DefaultActionGroup; //导入方法依赖的package包/类
ActionGroup createActions(@Nullable DefaultActionGroup toInsert) {
  DefaultActionGroup popupGroup = new DefaultActionGroup(null, false);
  popupGroup.addAction(new HgNewBranchAction(myProject, Collections.singletonList(myRepository), myRepository));
  popupGroup.addAction(new HgNewBookmarkAction(Collections.singletonList(myRepository), myRepository));
  popupGroup.addAction(new HgBranchPopupActions.HgCloseBranchAction(Collections.singletonList(myRepository), myRepository));
  popupGroup.addAction(new HgShowUnnamedHeadsForCurrentBranchAction(myRepository));
  if (toInsert != null) {
    popupGroup.addAll(toInsert);
  }

  popupGroup.addSeparator("Bookmarks");
  List<String> bookmarkNames = getSortedNamesWithoutHashes(myRepository.getBookmarks());
  String currentBookmark = myRepository.getCurrentBookmark();
  for (String bookmark : bookmarkNames) {
    AnAction bookmarkAction = new BookmarkActions(myProject, Collections.singletonList(myRepository), bookmark);
    if (bookmark.equals(currentBookmark)) {
      bookmarkAction.getTemplatePresentation().setIcon(PlatformIcons.CHECK_ICON);
    }
    popupGroup.add(bookmarkAction);
  }

  popupGroup.addSeparator("Branches");
  List<String> branchNamesList = new ArrayList<String>(myRepository.getOpenedBranches());//only opened branches have to be shown
  Collections.sort(branchNamesList);
  for (String branch : branchNamesList) {
    if (!branch.equals(myRepository.getCurrentBranch())) { // don't show current branch in the list
      popupGroup.add(new HgCommonBranchActions(myProject, Collections.singletonList(myRepository), branch));
    }
  }
  return popupGroup;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:32,代码来源:HgBranchPopupActions.java


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