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


Java ExternalSystemTasksTreeModel类代码示例

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


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

示例1: importData

import com.intellij.openapi.externalSystem.service.task.ui.ExternalSystemTasksTreeModel; //导入依赖的package包/类
@Override
public void importData(@NotNull final Collection<DataNode<T>> toImport, @NotNull final Project project, boolean synchronous) {
  if (toImport.isEmpty()) {
    return;
  }
  ExternalSystemApiUtil.executeOnEdt(false, new Runnable() {
    @Override
    public void run() {
      ExternalSystemTasksTreeModel model = ExternalSystemUtil.getToolWindowElement(ExternalSystemTasksTreeModel.class,
                                                                                   project,
                                                                                   ExternalSystemDataKeys.ALL_TASKS_MODEL,
                                                                                   toImport.iterator().next().getData().getOwner());
      processData(toImport, project, model);
    }
  });
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:17,代码来源:AbstractToolWindowService.java

示例2: importData

import com.intellij.openapi.externalSystem.service.task.ui.ExternalSystemTasksTreeModel; //导入依赖的package包/类
@Override
public void importData(@Nonnull final Collection<DataNode<T>> toImport, @Nonnull final Project project, boolean synchronous) {
  if (toImport.isEmpty()) {
    return;
  }
  ExternalSystemApiUtil.executeOnEdt(false, new Runnable() {
    @Override
    public void run() {
      ExternalSystemTasksTreeModel model = ExternalSystemUtil.getToolWindowElement(ExternalSystemTasksTreeModel.class,
                                                                                   project,
                                                                                   ExternalSystemDataKeys.ALL_TASKS_MODEL,
                                                                                   toImport.iterator().next().getData().getOwner());
      processData(toImport, project, model);
    }
  });
}
 
开发者ID:consulo,项目名称:consulo,代码行数:17,代码来源:AbstractToolWindowService.java

示例3: processData

import com.intellij.openapi.externalSystem.service.task.ui.ExternalSystemTasksTreeModel; //导入依赖的package包/类
@Override
protected void processData(@NotNull Collection<DataNode<TaskData>> nodes,
                           @NotNull Project project,
                           @Nullable final ExternalSystemTasksTreeModel model)
{
  if (nodes.isEmpty()) {
    return;
  }
  ProjectSystemId externalSystemId = nodes.iterator().next().getData().getOwner();
  ExternalSystemManager<?, ?, ?, ?, ?> manager = ExternalSystemApiUtil.getManager(externalSystemId);
  assert manager != null;

  Map<ExternalConfigPathAware, List<DataNode<TaskData>>> grouped = ExternalSystemApiUtil.groupBy(nodes, TASK_HOLDER_RETRIEVAL_STRATEGY);
  Map<String, Collection<ExternalTaskPojo>> data = ContainerUtilRt.newHashMap();
  for (Map.Entry<ExternalConfigPathAware, List<DataNode<TaskData>>> entry : grouped.entrySet()) {
    data.put(entry.getKey().getLinkedExternalProjectPath(), ContainerUtilRt.map2List(entry.getValue(), MAPPER));
  }

  AbstractExternalSystemLocalSettings settings = manager.getLocalSettingsProvider().fun(project);
  Map<String, Collection<ExternalTaskPojo>> availableTasks = ContainerUtilRt.newHashMap(settings.getAvailableTasks());
  availableTasks.putAll(data);
  settings.setAvailableTasks(availableTasks);

  if (model != null) {
    ExternalSystemUiUtil.apply(settings, model);
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:28,代码来源:ToolWindowTaskService.java

示例4: processData

import com.intellij.openapi.externalSystem.service.task.ui.ExternalSystemTasksTreeModel; //导入依赖的package包/类
@Override
protected void processData(@NotNull final Collection<DataNode<ModuleData>> nodes,
                           @NotNull Project project,
                           @Nullable final ExternalSystemTasksTreeModel model)
{
  if (nodes.isEmpty()) {
    return;
  }
  ProjectSystemId externalSystemId = nodes.iterator().next().getData().getOwner();
  ExternalSystemManager<?, ?, ?, ?, ?> manager = ExternalSystemApiUtil.getManager(externalSystemId);
  assert manager != null;

  final Map<DataNode<ProjectData>, List<DataNode<ModuleData>>> grouped = ExternalSystemApiUtil.groupBy(nodes, ProjectKeys.PROJECT);
  Map<ExternalProjectPojo, Collection<ExternalProjectPojo>> data = ContainerUtilRt.newHashMap();
  for (Map.Entry<DataNode<ProjectData>, List<DataNode<ModuleData>>> entry : grouped.entrySet()) {
    data.put(ExternalProjectPojo.from(entry.getKey().getData()), ContainerUtilRt.map2List(entry.getValue(), MAPPER));
  }

  AbstractExternalSystemLocalSettings settings = manager.getLocalSettingsProvider().fun(project);
  Set<String> pathsToForget = detectRenamedProjects(data, settings.getAvailableProjects());
  if (!pathsToForget.isEmpty()) {
    settings.forgetExternalProjects(pathsToForget);
  }
  Map<ExternalProjectPojo,Collection<ExternalProjectPojo>> projects = ContainerUtilRt.newHashMap(settings.getAvailableProjects());
  projects.putAll(data);
  settings.setAvailableProjects(projects);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:28,代码来源:ToolWindowModuleService.java

示例5: processData

import com.intellij.openapi.externalSystem.service.task.ui.ExternalSystemTasksTreeModel; //导入依赖的package包/类
@Override
protected void processData(@Nonnull Collection<DataNode<TaskData>> nodes,
                           @Nonnull Project project,
                           @javax.annotation.Nullable final ExternalSystemTasksTreeModel model)
{
  if (nodes.isEmpty()) {
    return;
  }
  ProjectSystemId externalSystemId = nodes.iterator().next().getData().getOwner();
  ExternalSystemManager<?, ?, ?, ?, ?> manager = ExternalSystemApiUtil.getManager(externalSystemId);
  assert manager != null;

  Map<ExternalConfigPathAware, List<DataNode<TaskData>>> grouped = ExternalSystemApiUtil.groupBy(nodes, TASK_HOLDER_RETRIEVAL_STRATEGY);
  Map<String, Collection<ExternalTaskPojo>> data = ContainerUtilRt.newHashMap();
  for (Map.Entry<ExternalConfigPathAware, List<DataNode<TaskData>>> entry : grouped.entrySet()) {
    data.put(entry.getKey().getLinkedExternalProjectPath(), ContainerUtilRt.map2List(entry.getValue(), MAPPER));
  }

  AbstractExternalSystemLocalSettings settings = manager.getLocalSettingsProvider().fun(project);
  Map<String, Collection<ExternalTaskPojo>> availableTasks = ContainerUtilRt.newHashMap(settings.getAvailableTasks());
  availableTasks.putAll(data);
  settings.setAvailableTasks(availableTasks);

  if (model != null) {
    ExternalSystemUiUtil.apply(settings, model);
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:28,代码来源:ToolWindowTaskService.java

示例6: processData

import com.intellij.openapi.externalSystem.service.task.ui.ExternalSystemTasksTreeModel; //导入依赖的package包/类
@Override
protected void processData(@Nonnull final Collection<DataNode<ModuleData>> nodes,
                           @Nonnull Project project,
                           @Nullable final ExternalSystemTasksTreeModel model)
{
  if (nodes.isEmpty()) {
    return;
  }
  ProjectSystemId externalSystemId = nodes.iterator().next().getData().getOwner();
  ExternalSystemManager<?, ?, ?, ?, ?> manager = ExternalSystemApiUtil.getManager(externalSystemId);
  assert manager != null;

  final Map<DataNode<ProjectData>, List<DataNode<ModuleData>>> grouped = ExternalSystemApiUtil.groupBy(nodes, ProjectKeys.PROJECT);
  Map<ExternalProjectPojo, Collection<ExternalProjectPojo>> data = ContainerUtilRt.newHashMap();
  for (Map.Entry<DataNode<ProjectData>, List<DataNode<ModuleData>>> entry : grouped.entrySet()) {
    data.put(ExternalProjectPojo.from(entry.getKey().getData()), ContainerUtilRt.map2List(entry.getValue(), MAPPER));
  }

  AbstractExternalSystemLocalSettings settings = manager.getLocalSettingsProvider().fun(project);
  Set<String> pathsToForget = detectRenamedProjects(data, settings.getAvailableProjects());
  if (!pathsToForget.isEmpty()) {
    settings.forgetExternalProjects(pathsToForget);
  }
  Map<ExternalProjectPojo,Collection<ExternalProjectPojo>> projects = ContainerUtilRt.newHashMap(settings.getAvailableProjects());
  projects.putAll(data);
  settings.setAvailableProjects(projects);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:28,代码来源:ToolWindowModuleService.java

示例7: processData

import com.intellij.openapi.externalSystem.service.task.ui.ExternalSystemTasksTreeModel; //导入依赖的package包/类
protected abstract void processData(@NotNull Collection<DataNode<T>> nodes,
@NotNull Project project,
@Nullable ExternalSystemTasksTreeModel model);
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:4,代码来源:AbstractToolWindowService.java

示例8: actionPerformed

import com.intellij.openapi.externalSystem.service.task.ui.ExternalSystemTasksTreeModel; //导入依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
  MyInfo info = getProcessingInfo(e.getDataContext());
  if (info.settings == null || info.localSettings == null || info.externalProject == null || info.ideProject == null
      || info.externalSystemId == null)
  {
    return;
  }
  
  e.getPresentation().setText(
    ExternalSystemBundle.message("action.detach.external.project.text",info.externalSystemId.getReadableName())
  );

  ExternalSystemTasksTreeModel allTasksModel = ExternalSystemDataKeys.ALL_TASKS_MODEL.getData(e.getDataContext());
  if (allTasksModel != null) {
    allTasksModel.pruneNodes(info.externalProject);
  }

  ExternalSystemRecentTasksList recentTasksList = ExternalSystemDataKeys.RECENT_TASKS_LIST.getData(e.getDataContext());
  if (recentTasksList != null) {
    recentTasksList.getModel().forgetTasksFrom(info.externalProject.getPath());
  }
  
  info.localSettings.forgetExternalProjects(Collections.singleton(info.externalProject.getPath()));
  info.settings.unlinkExternalProject(info.externalProject.getPath());

  // Process orphan modules.
  PlatformFacade platformFacade = ServiceManager.getService(PlatformFacade.class);
  String externalSystemIdAsString = info.externalSystemId.toString();
  List<Module> orphanModules = ContainerUtilRt.newArrayList();
  for (Module module : platformFacade.getModules(info.ideProject)) {
    String systemId = module.getOptionValue(ExternalSystemConstants.EXTERNAL_SYSTEM_ID_KEY);
    if (!externalSystemIdAsString.equals(systemId)) {
      continue;
    }
    String path = module.getOptionValue(ExternalSystemConstants.LINKED_PROJECT_PATH_KEY);
    if (info.externalProject.getPath().equals(path)) {
      orphanModules.add(module);
    }
  }

  if (!orphanModules.isEmpty()) {
    ExternalSystemUtil.ruleOrphanModules(orphanModules, info.ideProject, info.externalSystemId);
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:46,代码来源:DetachExternalProjectAction.java

示例9: processData

import com.intellij.openapi.externalSystem.service.task.ui.ExternalSystemTasksTreeModel; //导入依赖的package包/类
protected abstract void processData(@Nonnull Collection<DataNode<T>> nodes,
@Nonnull Project project,
@javax.annotation.Nullable ExternalSystemTasksTreeModel model);
 
开发者ID:consulo,项目名称:consulo,代码行数:4,代码来源:AbstractToolWindowService.java

示例10: actionPerformed

import com.intellij.openapi.externalSystem.service.task.ui.ExternalSystemTasksTreeModel; //导入依赖的package包/类
@RequiredDispatchThread
@Override
public void actionPerformed(@Nonnull AnActionEvent e) {
  ExternalActionUtil.MyInfo info = ExternalActionUtil.getProcessingInfo(e.getDataContext());
  if (info.settings == null || info.localSettings == null || info.externalProject == null || info.ideProject == null
      || info.externalSystemId == null)
  {
    return;
  }
  
  e.getPresentation().setText(
    ExternalSystemBundle.message("action.detach.external.project.text",info.externalSystemId.getReadableName())
  );

  ExternalSystemTasksTreeModel allTasksModel = e.getDataContext().getData(ExternalSystemDataKeys.ALL_TASKS_MODEL);
  if (allTasksModel != null) {
    allTasksModel.pruneNodes(info.externalProject);
  }

  ExternalSystemRecentTasksList recentTasksList = e.getDataContext().getData(ExternalSystemDataKeys.RECENT_TASKS_LIST);
  if (recentTasksList != null) {
    recentTasksList.getModel().forgetTasksFrom(info.externalProject.getPath());
  }
  
  info.localSettings.forgetExternalProjects(Collections.singleton(info.externalProject.getPath()));
  info.settings.unlinkExternalProject(info.externalProject.getPath());

  // Process orphan modules.
  String externalSystemIdAsString = info.externalSystemId.toString();
  List<Module> orphanModules = ContainerUtilRt.newArrayList();
  for (Module module : ModuleManager.getInstance(info.ideProject).getModules()) {
    String systemId = ExternalSystemApiUtil.getExtensionSystemOption(module, ExternalSystemConstants.EXTERNAL_SYSTEM_ID_KEY);
    if (!externalSystemIdAsString.equals(systemId)) {
      continue;
    }
    String path = ExternalSystemApiUtil.getExtensionSystemOption(module, ExternalSystemConstants.LINKED_PROJECT_PATH_KEY);
    if (info.externalProject.getPath().equals(path)) {
      orphanModules.add(module);
    }
  }

  if (!orphanModules.isEmpty()) {
    ExternalSystemUtil.ruleOrphanModules(orphanModules, info.ideProject, info.externalSystemId);
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:46,代码来源:DetachExternalProjectAction.java


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