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


Java Key类代码示例

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


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


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