本文整理汇总了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()]);
}
示例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();
}
示例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()]);
}
示例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();
}
示例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()]);
}
示例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);
}
}
});
}