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


Java ProjectLibrariesConfigurable类代码示例

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


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

示例1: createActionOrGroup

import com.intellij.openapi.roots.ui.configuration.projectRoot.ProjectLibrariesConfigurable; //导入依赖的package包/类
public static AnAction[] createActionOrGroup(@NotNull String text, @NotNull BaseLibrariesConfigurable librariesConfigurable, final @NotNull Project project) {
  final LibraryType<?>[] extensions = LibraryType.EP_NAME.getExtensions();
  List<LibraryType<?>> suitableTypes = new ArrayList<LibraryType<?>>();
  if (librariesConfigurable instanceof ProjectLibrariesConfigurable || !project.isDefault()) {
    final ModuleStructureConfigurable configurable = ModuleStructureConfigurable.getInstance(project);
    for (LibraryType<?> extension : extensions) {
      if (!LibraryEditingUtil.getSuitableModules(configurable, extension.getKind(), null).isEmpty()) {
        suitableTypes.add(extension);
      }
    }
  }
  else {
    Collections.addAll(suitableTypes, extensions);
  }

  if (suitableTypes.isEmpty()) {
    return new AnAction[]{new CreateNewLibraryAction(text, PlatformIcons.LIBRARY_ICON, null, librariesConfigurable, project)};
  }
  List<AnAction> actions = new ArrayList<AnAction>();
  actions.add(new CreateNewLibraryAction(IdeBundle.message("create.default.library.type.action.name"), PlatformIcons.LIBRARY_ICON, null, librariesConfigurable, project));
  for (LibraryType<?> type : suitableTypes) {
    final String actionName = type.getCreateActionName();
    if (actionName != null) {
      actions.add(new CreateNewLibraryAction(actionName, type.getIcon(null), type, librariesConfigurable, project));
    }
  }
  return actions.toArray(new AnAction[actions.size()]);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:29,代码来源:CreateNewLibraryAction.java

示例2: IdeUIModifiableModelsProvider

import com.intellij.openapi.roots.ui.configuration.projectRoot.ProjectLibrariesConfigurable; //导入依赖的package包/类
public IdeUIModifiableModelsProvider(Project project,
                                     ModifiableModuleModel model,
                                     ModulesConfigurator modulesConfigurator,
                                     ModifiableArtifactModel modifiableArtifactModel) {
  super(project);
  myModel = model;
  myModulesConfigurator = modulesConfigurator;
  myModifiableArtifactModel = modifiableArtifactModel;

  ProjectLibrariesConfigurable configurable = ProjectLibrariesConfigurable.getInstance(project);
  myLibrariesModel = configurable.getModelProvider().getModifiableModel();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:IdeUIModifiableModelsProvider.java

示例3: createActionOrGroup

import com.intellij.openapi.roots.ui.configuration.projectRoot.ProjectLibrariesConfigurable; //导入依赖的package包/类
public static AnAction[] createActionOrGroup(@NotNull String text, @NotNull BaseLibrariesConfigurable librariesConfigurable, final @NotNull Project project) {
  final LibraryType<?>[] extensions = LibraryType.EP_NAME.getExtensions();
  List<LibraryType<?>> suitableTypes = new ArrayList<LibraryType<?>>();
  if (librariesConfigurable instanceof ProjectLibrariesConfigurable) {
    final ModuleStructureConfigurable configurable = ModuleStructureConfigurable.getInstance(project);
    for (LibraryType<?> extension : extensions) {
      if (!LibraryEditingUtil.getSuitableModules(configurable, extension.getKind(), null).isEmpty()) {
        suitableTypes.add(extension);
      }
    }
  }
  else {
    Collections.addAll(suitableTypes, extensions);
  }

  if (suitableTypes.isEmpty()) {
    return new AnAction[]{new CreateNewLibraryAction(text, PlatformIcons.LIBRARY_ICON, null, librariesConfigurable, project)};
  }
  List<AnAction> actions = new ArrayList<AnAction>();
  actions.add(new CreateNewLibraryAction(IdeBundle.message("create.default.library.type.action.name"), PlatformIcons.LIBRARY_ICON, null, librariesConfigurable, project));
  for (LibraryType<?> type : suitableTypes) {
    final String actionName = type.getCreateActionName();
    if (actionName != null) {
      actions.add(new CreateNewLibraryAction(actionName, type.getIcon(), type, librariesConfigurable, project));
    }
  }
  return actions.toArray(new AnAction[actions.size()]);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:29,代码来源:CreateNewLibraryAction.java

示例4: MavenUIModifiableModelsProvider

import com.intellij.openapi.roots.ui.configuration.projectRoot.ProjectLibrariesConfigurable; //导入依赖的package包/类
public MavenUIModifiableModelsProvider(Project project,
                                       ModifiableModuleModel model,
                                       ModulesConfigurator modulesConfigurator,
                                       ModifiableArtifactModel modifiableArtifactModel) {
  super(project);
  myModel = model;
  myModulesConfigurator = modulesConfigurator;
  myModifiableArtifactModel = modifiableArtifactModel;

  ProjectLibrariesConfigurable configurable = ProjectLibrariesConfigurable.getInstance(project);
  myLibrariesModel = configurable.getModelProvider().getModifiableModel();
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:13,代码来源:MavenUIModifiableModelsProvider.java

示例5: createActionOrGroup

import com.intellij.openapi.roots.ui.configuration.projectRoot.ProjectLibrariesConfigurable; //导入依赖的package包/类
public static AnAction[] createActionOrGroup(@Nonnull String text,
                                             @Nonnull BaseLibrariesConfigurable librariesConfigurable,
                                             final @Nonnull Project project) {
  final LibraryType<?>[] extensions = LibraryType.EP_NAME.getExtensions();
  List<LibraryType<?>> suitableTypes = new ArrayList<LibraryType<?>>();
  if (librariesConfigurable instanceof ProjectLibrariesConfigurable) {
    final ModuleStructureConfigurable configurable = ModuleStructureConfigurable.getInstance(project);
    for (LibraryType<?> extension : extensions) {
      if (!LibraryEditingUtil.getSuitableModules(configurable, extension.getKind(), null).isEmpty()) {
        suitableTypes.add(extension);
      }
    }
  }
  else {
    Collections.addAll(suitableTypes, extensions);
  }

  if (suitableTypes.isEmpty()) {
    return new AnAction[]{new CreateNewLibraryAction(text, AllIcons.Nodes.PpLib, null, librariesConfigurable, project)};
  }
  List<AnAction> actions = new ArrayList<AnAction>();
  actions.add(new CreateNewLibraryAction(IdeBundle.message("create.default.library.type.action.name"), AllIcons.Nodes.PpLib, null,
                                         librariesConfigurable, project));
  for (LibraryType<?> type : suitableTypes) {
    final String actionName = type.getCreateActionName();
    if (actionName != null) {
      actions.add(new CreateNewLibraryAction(actionName, type.getIcon(), type, librariesConfigurable, project));
    }
  }
  return actions.toArray(new AnAction[actions.size()]);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:32,代码来源:CreateNewLibraryAction.java

示例6: init

import com.intellij.openapi.roots.ui.configuration.projectRoot.ProjectLibrariesConfigurable; //导入依赖的package包/类
public void init(StructureConfigurableContext context, ModuleStructureConfigurable moduleStructureConfigurable,
                 ProjectLibrariesConfigurable projectLibrariesConfig) {
  super.init(context);
  myPackagingEditorContext = new ArtifactsStructureConfigurableContextImpl(myContext, myProject, myDefaultSettings, new ArtifactAdapter() {
    @Override
    public void artifactAdded(@Nonnull Artifact artifact) {
      final MyNode node = addArtifactNode(artifact);
      selectNodeInTree(node);
      myContext.getDaemonAnalyzer().queueUpdate(myPackagingEditorContext.getOrCreateArtifactElement(artifact));
    }
  });

  context.getModulesConfigurator().addAllModuleChangeListener(new ModuleEditor.ChangeListener() {
    @Override
    public void moduleStateChanged(ModifiableRootModel moduleRootModel) {
      for (ProjectStructureElement element : getProjectStructureElements()) {
        myContext.getDaemonAnalyzer().queueUpdate(element);
      }
    }
  });

  final ItemsChangeListener listener = new ItemsChangeListener() {
    @Override
    public void itemChanged(@Nullable Object deletedItem) {
      if (deletedItem instanceof Library || deletedItem instanceof Module) {
        onElementDeleted();
      }
    }

    @Override
    public void itemsExternallyChanged() {
    }
  };
  moduleStructureConfigurable.addItemsChangeListener(listener);
  projectLibrariesConfig.addItemsChangeListener(listener);

  context.addLibraryEditorListener(new LibraryEditorListener() {
    @Override
    public void libraryRenamed(@Nonnull Library library, String oldName, String newName) {
      final Artifact[] artifacts = myPackagingEditorContext.getArtifactModel().getArtifacts();
      for (Artifact artifact : artifacts) {
        updateLibraryElements(artifact, library, oldName, newName);
      }
    }

  });
}
 
开发者ID:consulo,项目名称:consulo,代码行数:48,代码来源:ArtifactsStructureConfigurable.java


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