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

Java Key类代码示例

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

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



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

示例1: createNodes

import com.intellij.openapi.externalSystem.model.Key; //导入依赖的package包/类
@Override
@NotNull
public List<ExternalSystemNode<?>> createNodes(final ExternalProjectsView externalProjectsView,
                                               final MultiMap<Key<?>, DataNode<?>> dataNodes) {
  final List<ExternalSystemNode<?>> result = new SmartList<ExternalSystemNode<?>>();

  addModuleNodes(externalProjectsView, dataNodes, result);
  // add tasks
  TasksNode tasksNode = new TasksNode(externalProjectsView, dataNodes.get(ProjectKeys.TASK));
  if(externalProjectsView.useTasksNode()) {
    result.add(tasksNode);
  } else {
    ContainerUtil.addAll(result, tasksNode.getChildren());
  }

  addDependenciesNode(externalProjectsView, dataNodes, result);

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


示例2: addModuleNodes

import com.intellij.openapi.externalSystem.model.Key; //导入依赖的package包/类
private static void addModuleNodes(@NotNull ExternalProjectsView externalProjectsView,
                                   @NotNull MultiMap<Key<?>, DataNode<?>> dataNodes,
                                   @NotNull List<ExternalSystemNode<?>> result) {
  final Collection<DataNode<?>> moduleDataNodes = dataNodes.get(ProjectKeys.MODULE);
  if (!moduleDataNodes.isEmpty()) {
    final AbstractExternalSystemSettings systemSettings =
      ExternalSystemApiUtil.getSettings(externalProjectsView.getProject(), externalProjectsView.getSystemId());

    for (DataNode<?> dataNode : moduleDataNodes) {
      final ModuleData data = (ModuleData)dataNode.getData();

      final ExternalProjectSettings projectSettings = systemSettings.getLinkedProjectSettings(data.getLinkedExternalProjectPath());
      final boolean isRoot =
        projectSettings != null && data.getLinkedExternalProjectPath().equals(projectSettings.getExternalProjectPath());
      //noinspection unchecked
      final ModuleNode moduleNode = new ModuleNode(externalProjectsView, (DataNode<ModuleData>)dataNode, isRoot);
      result.add(moduleNode);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:ExternalSystemViewDefaultContributor.java


示例3: importData

import com.intellij.openapi.externalSystem.model.Key; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public <T> void importData(@NotNull Key<T> key, @NotNull Collection<DataNode<T>> nodes, @NotNull Project project, boolean synchronous) {
  ensureTheDataIsReadyToUse(nodes);
  List<ProjectDataService<?, ?>> services = myServices.getValue().get(key);
  if (services == null) {
    LOG.warn(String.format(
      "Can't import data nodes '%s'. Reason: no service is registered for key %s. Available services for %s",
      nodes, key, myServices.getValue().keySet()
    ));
  }
  else {
    for (ProjectDataService<?, ?> service : services) {
      ((ProjectDataService<T, ?>)service).importData(nodes, project, synchronous);
    }
  }

  Collection<DataNode<?>> children = ContainerUtilRt.newArrayList();
  for (DataNode<T> node : nodes) {
    children.addAll(node.getChildren());
  }
  importData(children, project, synchronous);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:23,代码来源:ProjectDataManager.java


示例4: ensureTheDataIsReadyToUse

import com.intellij.openapi.externalSystem.model.Key; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private <T> void ensureTheDataIsReadyToUse(@NotNull Collection<DataNode<T>> nodes) {
  Map<Key<?>, List<ProjectDataService<?, ?>>> servicesByKey = myServices.getValue();
  Stack<DataNode<T>> toProcess = ContainerUtil.newStack(nodes);
  while (!toProcess.isEmpty()) {
    DataNode<T> node = toProcess.pop();
    List<ProjectDataService<?, ?>> services = servicesByKey.get(node.getKey());
    if (services != null) {
      for (ProjectDataService<?, ?> service : services) {
        node.prepareData(service.getClass().getClassLoader());
      }
    }

    for (DataNode<?> dataNode : node.getChildren()) {
      toProcess.push((DataNode<T>)dataNode);
    }
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:19,代码来源:ProjectDataManager.java


示例5: importData

import com.intellij.openapi.externalSystem.model.Key; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public <T> void importData(@Nonnull Key<T> key, @Nonnull Collection<DataNode<T>> nodes, @Nonnull Project project, boolean synchronous) {
  ensureTheDataIsReadyToUse(nodes);
  List<ProjectDataService<?, ?>> services = myServices.getValue().get(key);
  if (services == null) {
    LOG.warn(String.format(
      "Can't import data nodes '%s'. Reason: no service is registered for key %s. Available services for %s",
      nodes, key, myServices.getValue().keySet()
    ));
  }
  else {
    for (ProjectDataService<?, ?> service : services) {
      ((ProjectDataService<T, ?>)service).importData(nodes, project, synchronous);
    }
  }

  Collection<DataNode<?>> children = ContainerUtilRt.newArrayList();
  for (DataNode<T> node : nodes) {
    children.addAll(node.getChildren());
  }
  importData(children, project, synchronous);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:23,代码来源:ProjectDataManager.java


示例6: ensureTheDataIsReadyToUse

import com.intellij.openapi.externalSystem.model.Key; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private <T> void ensureTheDataIsReadyToUse(@Nonnull Collection<DataNode<T>> nodes) {
  Map<Key<?>, List<ProjectDataService<?, ?>>> servicesByKey = myServices.getValue();
  Stack<DataNode<T>> toProcess = ContainerUtil.newStack(nodes);
  while (!toProcess.isEmpty()) {
    DataNode<T> node = toProcess.pop();
    List<ProjectDataService<?, ?>> services = servicesByKey.get(node.getKey());
    if (services != null) {
      for (ProjectDataService<?, ?> service : services) {
        node.prepareData(service.getClass().getClassLoader());
      }
    }

    for (DataNode<?> dataNode : node.getChildren()) {
      toProcess.push((DataNode<T>)dataNode);
    }
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:19,代码来源:ProjectDataManager.java


示例7: recursiveGroup

import com.intellij.openapi.externalSystem.model.Key; //导入依赖的package包/类
public static MultiMap<Key<?>, DataNode<?>> recursiveGroup(@NotNull Collection<DataNode<?>> nodes) {
  MultiMap<Key<?>, DataNode<?>> result = new KeyOrderedMultiMap<Key<?>, DataNode<?>>();
  Queue<Collection<DataNode<?>>> queue = ContainerUtil.newLinkedList();
  queue.add(nodes);
  while (!queue.isEmpty()) {
    Collection<DataNode<?>> _nodes = queue.remove();
    result.putAllValues(group(_nodes));
    for (DataNode<?> _node : _nodes) {
      queue.add(_node.getChildren());
    }
  }
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:ExternalSystemApiUtil.java


示例8: groupBy

import com.intellij.openapi.externalSystem.model.Key; //导入依赖的package包/类
@NotNull
public static <K, V> MultiMap<DataNode<K>, DataNode<V>> groupBy(@NotNull Collection<DataNode<V>> nodes, @NotNull final Key<K> key) {
  return groupBy(nodes, new NullableFunction<DataNode<V>, DataNode<K>>() {
    @Nullable
    @Override
    public DataNode<K> fun(DataNode<V> node) {
      return node.getDataNode(key);
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:ExternalSystemApiUtil.java


示例9: getChildren

import com.intellij.openapi.externalSystem.model.Key; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@NotNull
public static <T> Collection<DataNode<T>> getChildren(@NotNull DataNode<?> node, @NotNull Key<T> key) {
  Collection<DataNode<T>> result = null;
  for (DataNode<?> child : node.getChildren()) {
    if (!key.equals(child.getKey())) {
      continue;
    }
    if (result == null) {
      result = ContainerUtilRt.newArrayList();
    }
    result.add((DataNode<T>)child);
  }
  return result == null ? Collections.<DataNode<T>>emptyList() : result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:ExternalSystemApiUtil.java


示例10: find

import com.intellij.openapi.externalSystem.model.Key; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Nullable
public static <T> DataNode<T> find(@NotNull DataNode<?> node, @NotNull Key<T> key) {
  for (DataNode<?> child : node.getChildren()) {
    if (key.equals(child.getKey())) {
      return (DataNode<T>)child;
    }
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:ExternalSystemApiUtil.java


示例11: findParent

import com.intellij.openapi.externalSystem.model.Key; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Nullable
public static <T> DataNode<T> findParent(@NotNull DataNode<?> node,
                                         @NotNull Key<T> key,
                                         @Nullable BooleanFunction<DataNode<T>> predicate) {
  DataNode<?> parent = node.getParent();
  if (parent == null) return null;
  return key.equals(parent.getKey()) && (predicate == null || predicate.fun((DataNode<T>)parent))
         ? (DataNode<T>)parent : findParent(parent, key, predicate);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:ExternalSystemApiUtil.java


示例12: findAll

import com.intellij.openapi.externalSystem.model.Key; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@NotNull
public static <T> Collection<DataNode<T>> findAll(@NotNull DataNode<?> parent, @NotNull Key<T> key) {
  Collection<DataNode<T>> result = null;
  for (DataNode<?> child : parent.getChildren()) {
    if (!key.equals(child.getKey())) {
      continue;
    }
    if (result == null) {
      result = ContainerUtilRt.newArrayList();
    }
    result.add((DataNode<T>)child);
  }
  return result == null ? Collections.<DataNode<T>>emptyList() : result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:ExternalSystemApiUtil.java


示例13: getPublicKeys

import com.intellij.openapi.externalSystem.model.Key; //导入依赖的package包/类
@NotNull
private static Set<Key<?>> getPublicKeys() {
  Set<Key<?>> result = ContainerUtil.newHashSet(DATA_KEYS);
  for (ExternalProjectStructureCustomizer customizer : ExternalProjectStructureCustomizer.EP_NAME.getExtensions()) {
    result.addAll(customizer.getPublicDataKeys());
  }
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:ExternalProjectDataSelectorDialog.java


示例14: getIgnorableKeys

import com.intellij.openapi.externalSystem.model.Key; //导入依赖的package包/类
@NotNull
private static Set<Key<?>> getIgnorableKeys() {
  Set<Key<?>> result = ContainerUtil.newHashSet(DATA_KEYS);
  for (ExternalProjectStructureCustomizer customizer : ExternalProjectStructureCustomizer.EP_NAME.getExtensions()) {
    result.addAll(customizer.getIgnorableDataKeys());
  }
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:ExternalProjectDataSelectorDialog.java


示例15: isSameNode

import com.intellij.openapi.externalSystem.model.Key; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public boolean isSameNode(@NotNull DataNode<?> node1, @NotNull DataNode<?> node2, @NotNull Project project) {
  Key<?> key = node1.getKey();
  if (!key.equals(node2.getKey())) {
    return false;
  }
  EqualityStrategy strategy = myStrategies.get(key);
  if (strategy == null) {
    return node1.getData().equals(node2.getData());
  }
  return strategy.isSameData(node1.getData(), node2.getData(), project);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:SyncEntityDataComparisonStrategy.java


示例16: testImportData

import com.intellij.openapi.externalSystem.model.Key; //导入依赖的package包/类
public void testImportData() {
  String jdkPath = Jdks.getJdkHomePath(LanguageLevel.JDK_1_6);

  if (jdkPath != null) {
    VfsRootAccess.allowRootAccess(jdkPath);
  }
  List<DataNode<IdeaAndroidProject>> nodes = Lists.newArrayList();
  Key<IdeaAndroidProject> key = AndroidProjectKeys.IDE_ANDROID_PROJECT;
  nodes.add(new DataNode<IdeaAndroidProject>(key, myIdeaAndroidProject, null));

  assertEquals(key, service.getTargetDataKey());

  final IdeModifiableModelsProviderImpl modelsProvider = new IdeModifiableModelsProviderImpl(myProject);
  // ModuleCustomizers should be called.
  //noinspection ConstantConditions
  myCustomizer1.customizeModule(eq(myProject), eq(myModule), eq(modelsProvider), eq(myIdeaAndroidProject));
  expectLastCall();

  //noinspection ConstantConditions
  myCustomizer2.customizeModule(eq(myProject), eq(myModule), eq(modelsProvider), eq(myIdeaAndroidProject));
  expectLastCall();

  replay(myCustomizer1, myCustomizer2);

  service.importData(nodes, null, myProject, modelsProvider);
  modelsProvider.commit();

  verify(myCustomizer1, myCustomizer2);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:AndroidProjectDataServiceTest.java


示例17: findChildren

import com.intellij.openapi.externalSystem.model.Key; //导入依赖的package包/类
@NotNull
public static <T> List<T> findChildren(@NotNull DataNode<?> dataNode, @NotNull Key<T> key) {
  return ContainerUtil.mapNotNull(
    ExternalSystemApiUtil.findAll(dataNode, key),
    new Function<DataNode<T>, T>() {
      @Override
      public T fun(DataNode<T> node) {
        return node.getData();
      }
    }
  );
}
 
开发者ID:pantsbuild,项目名称:intellij-pants-plugin,代码行数:13,代码来源:PantsUtil.java


示例18: groupBy

import com.intellij.openapi.externalSystem.model.Key; //导入依赖的package包/类
@NotNull
public static <K, V> Map<DataNode<K>, List<DataNode<V>>> groupBy(@NotNull Collection<DataNode<V>> nodes, @NotNull final Key<K> key) {
  return groupBy(nodes, new NullableFunction<DataNode<V>, DataNode<K>>() {
    @Nullable
    @Override
    public DataNode<K> fun(DataNode<V> node) {
      return node.getDataNode(key);
    }
  });
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:11,代码来源:ExternalSystemApiUtil.java


示例19: removeData

import com.intellij.openapi.externalSystem.model.Key; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public <T> void removeData(@NotNull Key<?> key, @NotNull Collection<T> toRemove, @NotNull Project project, boolean synchronous) {
  List<ProjectDataService<?, ?>> services = myServices.getValue().get(key);
  for (ProjectDataService<?, ?> service : services) {
    ((ProjectDataService<?, T>)service).removeData(toRemove, project, synchronous);
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:8,代码来源:ProjectDataManager.java


示例20: groupBy

import com.intellij.openapi.externalSystem.model.Key; //导入依赖的package包/类
@Nonnull
public static <K, V> Map<DataNode<K>, List<DataNode<V>>> groupBy(@Nonnull Collection<DataNode<V>> nodes, @Nonnull final Key<K> key) {
  return groupBy(nodes, new NullableFunction<DataNode<V>, DataNode<K>>() {
    @Nullable
    @Override
    public DataNode<K> fun(DataNode<V> node) {
      return node.getDataNode(key);
    }
  });
}
 
开发者ID:consulo,项目名称:consulo,代码行数:11,代码来源:ExternalSystemApiUtil.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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