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


Java Separator.getInstance方法代码示例

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


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

示例1: 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

示例2: 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

示例3: 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

示例4: 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

示例5: 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

示例6: getChildren

import com.intellij.openapi.actionSystem.Separator; //导入方法依赖的package包/类
@NotNull
@Override
public AnAction[] getChildren(@Nullable AnActionEvent e) {
  if (e == null) return EMPTY_ARRAY;
  final Project project = e.getProject();
  if (project == null) return EMPTY_ARRAY;
  final Collection<String> filePaths = TestHistoryConfiguration.getInstance(project).getFiles();
  final File testHistoryRoot = TestStateStorage.getTestHistoryRoot(project);
  final List<File> fileNames = ContainerUtil.map(filePaths, new Function<String, File>() {
    @Override
    public File fun(String fileName) {
      return new File(testHistoryRoot, fileName);
    }
  }); 
  Collections.sort(fileNames, new Comparator<File>() {
    @Override
    public int compare(File f1, File f2) {
      return f1.lastModified() > f2.lastModified() ? -1 : 1;
    }
  });
  final int historySize = fileNames.size();
  final AnAction[] actions = new AnAction[historySize + 2];
  for (int i = 0; i < historySize; i++) {
    actions[i] = new ImportTestsFromHistoryAction(myProperties, project, fileNames.get(i).getName());
  }
  actions[historySize] = Separator.getInstance();
  actions[historySize + 1] = new ImportTestsFromFileAction(myProperties); 
  return actions;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:ImportTestsGroup.java


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