• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Separator类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.intellij.openapi.actionSystem.Separator的典型用法代码示例。如果您正苦于以下问题:Java Separator类的具体用法?Java Separator怎么用?Java Separator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Separator类属于com.intellij.openapi.actionSystem包,在下文中一共展示了Separator类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: createToolbarActions

import com.intellij.openapi.actionSystem.Separator; //导入依赖的package包/类
@NotNull
@Override
protected List<AnAction> createToolbarActions() {
  List<AnAction> group = new ArrayList<AnAction>();

  group.add(new MyIgnorePolicySettingAction());
  //group.add(new MyHighlightPolicySettingAction()); // TODO
  group.add(new MyToggleExpandByDefaultAction());
  group.add(new MyToggleAutoScrollAction());
  group.add(new MyEditorReadOnlyLockAction());
  group.add(myEditorSettingsAction);

  group.add(Separator.getInstance());
  group.add(new ShowLeftBasePartialDiffAction());
  group.add(new ShowBaseRightPartialDiffAction());
  group.add(new ShowLeftRightPartialDiffAction());

  group.add(Separator.getInstance());
  group.addAll(super.createToolbarActions());

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


示例2: createPopupActions

import com.intellij.openapi.actionSystem.Separator; //导入依赖的package包/类
@NotNull
@Override
protected List<AnAction> createPopupActions() {
  List<AnAction> group = new ArrayList<AnAction>();

  group.add(Separator.getInstance());
  group.add(new MyIgnorePolicySettingAction().getPopupGroup());
  //group.add(Separator.getInstance());
  //group.add(new MyHighlightPolicySettingAction().getPopupGroup());
  group.add(Separator.getInstance());
  group.add(new MyToggleAutoScrollAction());
  group.add(new MyToggleExpandByDefaultAction());

  group.add(Separator.getInstance());
  group.addAll(super.createPopupActions());

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


示例3: update

import com.intellij.openapi.actionSystem.Separator; //导入依赖的package包/类
@Override
public void update(AnActionEvent e) {
  removeAll();
  final List<ProjectGroup> groups = new ArrayList<ProjectGroup>(RecentProjectsManager.getInstance().getGroups());
  Collections.sort(groups, new Comparator<ProjectGroup>() {
    @Override
    public int compare(ProjectGroup o1, ProjectGroup o2) {
      return StringUtil.naturalCompare(o1.getName(), o2.getName());
    }
  });
  for (ProjectGroup group : groups) {
    add(new MoveProjectToGroupAction(group));
  }
  if (groups.size() > 0) {
    add(Separator.getInstance());
    add(new RemoveSelectedProjectsFromGroupsAction());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:MoveProjectToGroupActionGroup.java


示例4: getComponentAction

import com.intellij.openapi.actionSystem.Separator; //导入依赖的package包/类
@Nullable
public AnAction getComponentAction(){
  if (myComponent instanceof Separator){
    return Separator.getInstance();
  }
  if (myComponent instanceof String){
    return ActionManager.getInstance().getAction((String)myComponent);
  }
  if (myComponent instanceof Group){
    final String id = ((Group)myComponent).getId();
    if (id == null || id.length() == 0){
      return ((Group)myComponent).constructActionGroup(true);
    }
    return ActionManager.getInstance().getAction(id);
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:ActionUrl.java


示例5: readExternal

import com.intellij.openapi.actionSystem.Separator; //导入依赖的package包/类
@Override
public void readExternal(Element element) throws InvalidDataException {
  myGroupPath = new ArrayList<String>();
  for (Object o : element.getChildren(PATH)) {
    myGroupPath.add(((Element)o).getAttributeValue(VALUE));
  }
  final String attributeValue = element.getAttributeValue(VALUE);
  if (element.getAttributeValue(IS_ACTION) != null) {
    myComponent = attributeValue;
  }
  else if (element.getAttributeValue(SEPARATOR) != null) {
    myComponent = Separator.getInstance();
  }
  else if (element.getAttributeValue(IS_GROUP) != null) {
    final AnAction action = ActionManager.getInstance().getAction(attributeValue);
    myComponent = action instanceof ActionGroup
                  ? ActionsTreeUtil.createGroup((ActionGroup)action, true, null)
                  : new Group(attributeValue, attributeValue, null);
  }
  myActionType = Integer.parseInt(element.getAttributeValue(ACTION_TYPE));
  myAbsolutePosition = Integer.parseInt(element.getAttributeValue(POSITION));
  DefaultJDOMExternalizer.readExternal(this, element);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:ActionUrl.java


示例6: writeExternal

import com.intellij.openapi.actionSystem.Separator; //导入依赖的package包/类
@Override
public void writeExternal(Element element) throws WriteExternalException {
  for (String s : myGroupPath) {
    Element path = new Element(PATH);
    path.setAttribute(VALUE, s);
    element.addContent(path);
  }
  if (myComponent instanceof String) {
    element.setAttribute(VALUE, (String)myComponent);
    element.setAttribute(IS_ACTION, Boolean.TRUE.toString());
  }
  else if (myComponent instanceof Separator) {
    element.setAttribute(SEPARATOR, Boolean.TRUE.toString());
  }
  else if (myComponent instanceof Group) {
    final String groupId = ((Group)myComponent).getId() != null && ((Group)myComponent).getId().length() != 0
                           ? ((Group)myComponent).getId()
                           : ((Group)myComponent).getName();
    element.setAttribute(VALUE, groupId != null ? groupId : "");
    element.setAttribute(IS_GROUP, Boolean.TRUE.toString());
  }
  element.setAttribute(ACTION_TYPE, Integer.toString(myActionType));
  element.setAttribute(POSITION, Integer.toString(myAbsolutePosition));
  DefaultJDOMExternalizer.writeExternal(this, element);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:ActionUrl.java


示例7: enableSetIconButton

import com.intellij.openapi.actionSystem.Separator; //导入依赖的package包/类
protected void enableSetIconButton(ActionManager actionManager) {
  final TreePath selectionPath = myTree.getSelectionPath();
  Object userObject = null;
  if (selectionPath != null) {
    userObject = ((DefaultMutableTreeNode)selectionPath.getLastPathComponent()).getUserObject();
    if (userObject instanceof String) {
      final AnAction action = actionManager.getAction((String)userObject);
      if (action != null && action.getTemplatePresentation().getIcon() != null) {
        mySetIconButton.setEnabled(true);
        return;
      }
    }
  }
  mySetIconButton.setEnabled(myTextField.getText().length() != 0 &&
                             selectionPath != null &&
                             new DefaultMutableTreeNode(selectionPath).isLeaf() &&
                             !(userObject instanceof Separator));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:CustomizableActionsPanel.java


示例8: getVcsActions

import com.intellij.openapi.actionSystem.Separator; //导入依赖的package包/类
@Nullable
public List<AnAction> getVcsActions(@Nullable Project project, @Nullable AbstractVcs activeVcs,
                                    @Nullable DataContext dataContext) {

  if (activeVcs == null || !getVcsName().equals(activeVcs.getName())) {
    return null;
  }

  final ActionManager manager = ActionManager.getInstance();
  final List<AnAction> actions = new ArrayList<AnAction>();

  actions.add(new Separator(activeVcs.getDisplayName()));
  add("CheckinProject", manager, actions);
  add("CheckinFiles", manager, actions);
  add("ChangesView.Revert", manager, actions);

  addSeparator(actions);
  add("Vcs.ShowTabbedFileHistory", manager, actions);
  add("Annotate", manager, actions);
  add("Compare.SameVersion", manager, actions);

  addSeparator(actions);
  addVcsSpecificActions(manager, actions);
  return actions;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:DvcsQuickListContentProvider.java


示例9: getChildren

import com.intellij.openapi.actionSystem.Separator; //导入依赖的package包/类
@Override
@NotNull
public AnAction[] getChildren(@Nullable AnActionEvent e) {
  if (e == null) return AnAction.EMPTY_ARRAY;
  final Project project = e.getProject();
  if (project == null) {
    return AnAction.EMPTY_ARRAY;
  }
  final List<String> availableFavoritesLists = FavoritesManager.getInstance(project).getAvailableFavoritesListNames();
  availableFavoritesLists.remove(FavoritesTreeViewPanel.FAVORITES_LIST_NAME_DATA_KEY.getData(e.getDataContext()));
  if (availableFavoritesLists.isEmpty()) {
    return new AnAction[]{new AddToNewFavoritesListAction()};
  }

  AnAction[] actions = new AnAction[availableFavoritesLists.size() + 2];
  int idx = 0;
  for (String favoritesList : availableFavoritesLists) {
    actions[idx++] = new AddToFavoritesAction(favoritesList);
  }
  actions[idx++] = Separator.getInstance();
  actions[idx] = new AddToNewFavoritesListAction();
  return actions;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:AddToFavoritesActionGroup.java


示例10: getChildren

import com.intellij.openapi.actionSystem.Separator; //导入依赖的package包/类
@Override
@NotNull
public AnAction[] getChildren(@Nullable AnActionEvent e) {
  if (e == null) return AnAction.EMPTY_ARRAY;
  final Project project = e.getProject();
  if (project == null) {
    return AnAction.EMPTY_ARRAY;
  }
  final List<String> listNames = FavoritesManager.getInstance(project).getAvailableFavoritesListNames();
  final List<String> availableFavoritesLists = FavoritesManager.getInstance(project).getAvailableFavoritesListNames();
  availableFavoritesLists.remove(FavoritesTreeViewPanel.FAVORITES_LIST_NAME_DATA_KEY.getData(e.getDataContext()));
  if (availableFavoritesLists.isEmpty()) {
    return new AnAction[]{new AddAllOpenFilesToNewFavoritesListAction()};
  }

  AnAction[] actions = new AnAction[listNames.size() + 2];
  int idx = 0;
  for (String favoritesList : listNames) {
    actions[idx++] = new AddAllOpenFilesToFavorites(favoritesList);
  }
  actions[idx++] = Separator.getInstance();
  actions[idx] = new AddAllOpenFilesToNewFavoritesListAction();
  return actions;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:AddAllToFavoritesActionGroup.java


示例11: getToolbarActions

import com.intellij.openapi.actionSystem.Separator; //导入依赖的package包/类
@NotNull
public ActionGroup getToolbarActions(Project project, DeviceContext deviceContext) {
  DefaultActionGroup group = new DefaultActionGroup();

  group.add(new ScreenshotAction(project, deviceContext));
  group.add(new ScreenRecorderAction(project, deviceContext));
  group.add(DumpSysActions.create(project, deviceContext));
  //group.add(new MyFileExplorerAction());
  group.add(new Separator());

  group.add(new TerminateVMAction(deviceContext));
  //group.add(new MyAllocationTrackerAction());
  //group.add(new Separator());

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


示例12: addVcsSpecificActions

import com.intellij.openapi.actionSystem.Separator; //导入依赖的package包/类
@Override
protected void addVcsSpecificActions(@NotNull ActionManager manager, @NotNull List<AnAction> actions) {
  add("Git.Branches", manager, actions);
  add("Vcs.Push", manager, actions);
  add("Git.Stash", manager, actions);
  add("Git.Unstash", manager, actions);

  add("ChangesView.AddUnversioned", manager, actions);
  add("Git.ResolveConflicts", manager, actions);

  // Github
  addSeparator(actions);
  final AnAction githubRebase = manager.getAction("Github.Rebase");
  if (githubRebase != null) {
    actions.add(new Separator(GitBundle.message("vcs.popup.git.github.section")));
    actions.add(githubRebase);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:GitQuickListContentProvider.java


示例13: readExternal

import com.intellij.openapi.actionSystem.Separator; //导入依赖的package包/类
public void readExternal(Element element) throws InvalidDataException {
  myGroupPath = new ArrayList<String>();
  for (Object o : element.getChildren(PATH)) {
    myGroupPath.add(((Element)o).getAttributeValue(VALUE));
  }
  final String attributeValue = element.getAttributeValue(VALUE);
  if (element.getAttributeValue(IS_ACTION) != null) {
    myComponent = attributeValue;
  }
  else if (element.getAttributeValue(SEPARATOR) != null) {
    myComponent = Separator.getInstance();
  }
  else if (element.getAttributeValue(IS_GROUP) != null) {
    final AnAction action = ActionManager.getInstance().getAction(attributeValue);
    myComponent = action instanceof ActionGroup
                  ? ActionsTreeUtil.createGroup((ActionGroup)action, true, null)
                  : new Group(attributeValue, attributeValue, null);
  }
  myActionType = Integer.parseInt(element.getAttributeValue(ACTION_TYPE));
  myAbsolutePosition = Integer.parseInt(element.getAttributeValue(POSITION));
  DefaultJDOMExternalizer.readExternal(this, element);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:23,代码来源:ActionUrl.java


示例14: writeExternal

import com.intellij.openapi.actionSystem.Separator; //导入依赖的package包/类
public void writeExternal(Element element) throws WriteExternalException {
  for (String s : myGroupPath) {
    Element path = new Element(PATH);
    path.setAttribute(VALUE, s);
    element.addContent(path);
  }
  if (myComponent instanceof String) {
    element.setAttribute(VALUE, (String)myComponent);
    element.setAttribute(IS_ACTION, Boolean.TRUE.toString());
  }
  else if (myComponent instanceof Separator) {
    element.setAttribute(SEPARATOR, Boolean.TRUE.toString());
  }
  else if (myComponent instanceof Group) {
    final String groupId = ((Group)myComponent).getId() != null && ((Group)myComponent).getId().length() != 0
                           ? ((Group)myComponent).getId()
                           : ((Group)myComponent).getName();
    element.setAttribute(VALUE, groupId != null ? groupId : "");
    element.setAttribute(IS_GROUP, Boolean.TRUE.toString());
  }
  element.setAttribute(ACTION_TYPE, Integer.toString(myActionType));
  element.setAttribute(POSITION, Integer.toString(myAbsolutePosition));
  DefaultJDOMExternalizer.writeExternal(this, element);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:25,代码来源:ActionUrl.java


示例15: enableSetIconButton

import com.intellij.openapi.actionSystem.Separator; //导入依赖的package包/类
protected void enableSetIconButton(ActionManager actionManager) {
  final TreePath selectionPath = myTree.getSelectionPath();
  Object userObject = null;
  if (selectionPath != null) {
    userObject = ((DefaultMutableTreeNode)selectionPath.getLastPathComponent()).getUserObject();
    if (userObject instanceof String) {
      final AnAction action = actionManager.getAction((String)userObject);
      if (action != null &&
          action.getTemplatePresentation() != null &&
          action.getTemplatePresentation().getIcon() != null) {
        mySetIconButton.setEnabled(true);
        return;
      }
    }
  }
  mySetIconButton.setEnabled(myTextField.getText().length() != 0 &&
                             selectionPath != null &&
                             new DefaultMutableTreeNode(selectionPath).isLeaf() &&
                             !(userObject instanceof Separator));
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:21,代码来源:CustomizableActionsPanel.java


示例16: AnnotationPresentation

import com.intellij.openapi.actionSystem.Separator; //导入依赖的package包/类
AnnotationPresentation(@NotNull final HighlightAnnotationsActions highlighting, @Nullable final AnnotationSourceSwitcher switcher,
                              final EditorGutterComponentEx gutter,
                              final List<AnnotationFieldGutter> gutters,
                              final AnAction... actions) {
  myHighlighting = highlighting;
  mySwitcher = switcher;

  myActions = new ArrayList<AnAction>();
  myActions.add(Separator.getInstance());
  if (actions != null) {
    final List<AnAction> actionsList = Arrays.asList(actions);
    if (!actionsList.isEmpty()) {
      myActions.addAll(actionsList);
      myActions.add(new Separator());
    }
  }
  myActions.addAll(myHighlighting.getList());
  if (mySwitcher != null) {
    mySwitchAction = new SwitchAnnotationSourceAction(mySwitcher, gutter);
    myActions.add(mySwitchAction);
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:23,代码来源:AnnotationPresentation.java


示例17: getVcsActions

import com.intellij.openapi.actionSystem.Separator; //导入依赖的package包/类
public List<AnAction> getVcsActions(@Nullable Project project, @Nullable AbstractVcs activeVcs, @Nullable DataContext dataContext) {
  if (activeVcs == null || !HgVcs.VCS_NAME.equals(activeVcs.getName())) {
    return null;
  }
  final ActionManager manager = ActionManager.getInstance();
  final List<AnAction> actions = new ArrayList<AnAction>();

  actions.add(new Separator(activeVcs.getDisplayName()));
  actions.add(new Separator());
  add("hg4idea.branches", manager, actions);
  add("hg4idea.pull", manager, actions);
  add("hg4idea.push", manager, actions);
  add("hg4idea.updateTo", manager, actions);

  return actions;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:17,代码来源:HgQuickListProvider.java


示例18: getChildren

import com.intellij.openapi.actionSystem.Separator; //导入依赖的package包/类
@NotNull
@Override
public AnAction[] getChildren(final @Nullable AnActionEvent event) {
    return new AnAction[]{
            new IntegerGroupAction(),
            new DecimalGroupAction(),
            new StringGroupAction(),
            new WordGroupAction(),
            new Separator(),
            new ArraySettingsAction()
    };
}
 
开发者ID:FWDekker,项目名称:intellij-randomness,代码行数:13,代码来源:PopupAction.java


示例19: initComponent

import com.intellij.openapi.actionSystem.Separator; //导入依赖的package包/类
public void initComponent() {
        ActionManager am = ActionManager.getInstance();
        // for debugging
//        Notifications.Bus.notify(new Notification(notificationGroupId, "Loading " + InstantPatchRemotePluginRegistration.shortName, "Loading started...", NotificationType.INFORMATION, NotificationListener.URL_OPENING_LISTENER));

        try {
            final RemoteOperationRootGroup rootAction = new RemoteOperationRootGroup(pluginSettings);

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

            final AnAction ProjectViewPopupMenuAction = am.getAction("ProjectViewPopupMenu");
            if (!(ProjectViewPopupMenuAction instanceof DefaultActionGroup)) {
                System.err.print("ProjectViewPopupMenu is not instanceof DefaultActionGroup, but " + ProjectViewPopupMenuAction.getClass());
            }
            final DefaultActionGroup ProjectViewPopupMenuGroup = (DefaultActionGroup) ProjectViewPopupMenuAction;

            ProjectViewPopupMenuGroup.add(new Separator(), Constraints.FIRST);
            ProjectViewPopupMenuGroup.add(rootAction, Constraints.FIRST);

            // for debugging
//            Notifications.Bus.notify(new Notification(notificationGroupId, "Loading " + InstantPatchRemotePluginRegistration.shortName, "Loading finished...", NotificationType.INFORMATION, NotificationListener.URL_OPENING_LISTENER));
        } catch (Exception e) {
            System.err.println("Exception happened while registering root action group: " + e);
            Notifications.Bus.notify(new Notification(InstantPatchRemotePluginRegistration.notificationGroupId, "Loading " + InstantPatchRemotePluginRegistration.shortName,
                    "Loading error: " + e.toString(), NotificationType.ERROR, NotificationListener.URL_OPENING_LISTENER));
        }
    }
 
开发者ID:sanchouss,项目名称:InstantPatchIdeaPlugin,代码行数:29,代码来源:InstantPatchRemotePluginRegistration.java


示例20: createToolbarActions

import com.intellij.openapi.actionSystem.Separator; //导入依赖的package包/类
@NotNull
@Override
protected List<AnAction> createToolbarActions() {
  List<AnAction> group = new ArrayList<AnAction>();

  group.add(new MyIgnorePolicySettingAction());
  group.add(new MyHighlightPolicySettingAction());
  group.add(new MyReadOnlyLockAction());
  group.add(myEditorSettingsAction);

  group.add(Separator.getInstance());
  group.addAll(super.createToolbarActions());

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Handler类代码示例发布时间:2022-05-22
下一篇:
Java ControlFlowException类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap