本文整理汇总了Java中consulo.module.extension.ModuleExtension类的典型用法代码示例。如果您正苦于以下问题:Java ModuleExtension类的具体用法?Java ModuleExtension怎么用?Java ModuleExtension使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ModuleExtension类属于consulo.module.extension包,在下文中一共展示了ModuleExtension类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getUrls
import consulo.module.extension.ModuleExtension; //导入依赖的package包/类
@NotNull
@Override
public String[] getUrls(@NotNull OrderRootType rootType)
{
DotNetSimpleModuleExtension extension = myModuleRootLayer.getExtension(DotNetSimpleModuleExtension.class);
if(extension == null)
{
return ArrayUtil.EMPTY_STRING_ARRAY;
}
String[] urls = ArrayUtil.EMPTY_STRING_ARRAY;
for(ModuleExtension moduleExtension : myModuleRootLayer.getExtensions())
{
if(moduleExtension instanceof DotNetModuleExtensionWithLibraryProviding)
{
String[] systemLibraryUrls = ((DotNetModuleExtensionWithLibraryProviding) moduleExtension).getSystemLibraryUrls(getPresentableName()
, rootType);
urls = ArrayUtil.mergeArrays(urls, systemLibraryUrls);
}
}
return urls;
}
开发者ID:consulo,项目名称:consulo-dotnet,代码行数:23,代码来源:DotNetLibraryOrderEntryImpl.java
示例2: compute
import consulo.module.extension.ModuleExtension; //导入依赖的package包/类
@Nonnull
@Override
protected ModuleExtensionProviderEP[] compute() {
ModuleExtensionProviderEP[] extensions = EP_NAME.getExtensions();
for (ModuleExtensionProviderEP extension : extensions) {
Class<ModuleExtension> immutableClass = extension.getImmutableClass();
if (immutableClass != null) {
ModuleExtensionIndexCache.put(immutableClass, extension.getInternalIndex());
}
Class<MutableModuleExtension> mutableClass = extension.getMutableClass();
if (mutableClass != null) {
ModuleExtensionIndexCache.put(mutableClass, extension.getInternalIndex());
}
}
return extensions;
}
开发者ID:consulo,项目名称:consulo,代码行数:18,代码来源:ModuleExtensionProviders.java
示例3: put0
import consulo.module.extension.ModuleExtension; //导入依赖的package包/类
private static void put0(Class<?> clazz, int index) {
Class temp = clazz;
do {
if (temp == ModuleExtensionWithSdkImpl.class ||
temp == ModuleExtensionImpl.class ||
temp == ModuleExtension.class ||
temp == ModuleExtensionWithSdk.class) {
break;
}
putImpl(temp, index);
Class[] interfaces = temp.getInterfaces();
for (Class intef : interfaces) {
put0(intef, index);
}
}
while ((temp = temp.getSuperclass()) != null);
}
开发者ID:consulo,项目名称:consulo,代码行数:21,代码来源:ModuleExtensionIndexCache.java
示例4: putImpl
import consulo.module.extension.ModuleExtension; //导入依赖的package包/类
private static void putImpl(Class<?> temp, int index) {
if (temp == ModuleExtensionWithSdkImpl.class ||
temp == ModuleExtensionImpl.class ||
temp == ModuleExtension.class ||
temp == ModuleExtensionWithSdk.class) {
return;
}
int[] ints = ourClassCache.get(temp);
if (ints == null) {
ourClassCache.put(temp, new int[]{index});
}
else {
ourClassCache.put(temp, ArrayUtil.append(ints, index));
}
}
开发者ID:consulo,项目名称:consulo,代码行数:17,代码来源:ModuleExtensionIndexCache.java
示例5: isPackageSupported
import consulo.module.extension.ModuleExtension; //导入依赖的package包/类
@RequiredReadAction
public static boolean isPackageSupported(@Nonnull Project project) {
return CachedValuesManager.getManager(project).getCachedValue(project, () -> {
boolean result = false;
PsiPackageSupportProvider[] extensions = PsiPackageSupportProvider.EP_NAME.getExtensions();
ModuleManager moduleManager = ModuleManager.getInstance(project);
loop:
for (Module module : moduleManager.getModules()) {
ModuleRootManager rootManager = ModuleRootManager.getInstance(module);
for (ModuleExtension moduleExtension : rootManager.getExtensions()) {
for (PsiPackageSupportProvider extension : extensions) {
if (extension.isSupported(moduleExtension)) {
result = true;
break loop;
}
}
}
}
return CachedValueProvider.Result.create(result, ProjectRootManager.getInstance(project));
});
}
开发者ID:consulo,项目名称:consulo,代码行数:22,代码来源:PsiPackageSupportProviders.java
示例6: create
import consulo.module.extension.ModuleExtension; //导入依赖的package包/类
public static ModuleExtensionCondition create(String ids) {
String[] valuesOfVariableIfFound = ListOfElementsEP.getValuesOfVariableIfFound(ids);
if (valuesOfVariableIfFound.length == 0) {
return new ModuleExtensionCondition() {
@Override
public boolean value(ModuleExtension<?> rootModel) {
return true;
}
@Override
public boolean value(Project project) {
return true;
}
};
}
else {
return new ModuleExtensionConditionImpl(valuesOfVariableIfFound);
}
}
开发者ID:consulo,项目名称:consulo,代码行数:20,代码来源:ModuleExtensionConditionImpl.java
示例7: insertModuleItems
import consulo.module.extension.ModuleExtension; //导入依赖的package包/类
@RequiredReadAction
@SuppressWarnings("unchecked")
public <T extends MutableModuleExtension<?>> void insertModuleItems(@Nonnull T moduleExtension,
@Nonnull NullableFunction<T, MutableModuleInheritableNamedPointer<Sdk>> sdkPointerFunction) {
for (Module module : ModuleManager.getInstance(moduleExtension.getModule().getProject()).getModules()) {
// dont add self module
if (module == moduleExtension.getModule()) {
continue;
}
ModuleExtension extension = ModuleUtilCore.getExtension(module, moduleExtension.getId());
if (extension == null) {
continue;
}
MutableModuleInheritableNamedPointer<Sdk> sdkPointer = sdkPointerFunction.fun((T)extension);
if (sdkPointer != null) {
// recursive depend
if (sdkPointer.getModule() == moduleExtension.getModule()) {
continue;
}
addItem(new ModuleExtensionSdkComboBoxItem(extension, sdkPointer));
}
}
}
开发者ID:consulo,项目名称:consulo,代码行数:26,代码来源:SdkComboBox.java
示例8: findPackage
import consulo.module.extension.ModuleExtension; //导入依赖的package包/类
@RequiredReadAction
@Nullable
@Override
public PsiPackage findPackage(@Nonnull String qualifiedName, @Nonnull Class<? extends ModuleExtension> extensionClass) {
ConcurrentMap<String, Object> map = myPackageCache.get(extensionClass);
if (map != null) {
final Object value = map.get(qualifiedName);
// if we processed - but not found package
if (value == ObjectUtil.NULL) {
return null;
}
else if (value != null) {
return (PsiPackage)value;
}
}
PsiPackage newPackage = createPackage(qualifiedName, extensionClass);
Object valueForInsert = ObjectUtil.notNull(newPackage, ObjectUtil.NULL);
myPackageCache.computeIfAbsent(extensionClass, aClass -> ContainerUtil.newConcurrentMap()).putIfAbsent(qualifiedName, valueForInsert);
return newPackage;
}
开发者ID:consulo,项目名称:consulo,代码行数:25,代码来源:PsiPackageManagerImpl.java
示例9: createPackage
import consulo.module.extension.ModuleExtension; //导入依赖的package包/类
@Nullable
private PsiPackage createPackage(@Nonnull String qualifiedName, @Nonnull Class<? extends ModuleExtension> extensionClass) {
Query<VirtualFile> dirs = myDirectoryIndex.getDirectoriesByPackageName(qualifiedName, true);
if (dirs.findFirst() == null) {
return null;
}
for (VirtualFile directory : dirs) {
PsiPackage packageFromProviders = createPackageFromProviders(directory, extensionClass, qualifiedName);
if (packageFromProviders != null) {
return packageFromProviders;
}
PsiPackage packageFromLibrary = createPackageFromLibrary(directory, extensionClass, qualifiedName);
if (packageFromLibrary != null) {
return packageFromLibrary;
}
}
return null;
}
开发者ID:consulo,项目名称:consulo,代码行数:21,代码来源:PsiPackageManagerImpl.java
示例10: createPackageFromProviders
import consulo.module.extension.ModuleExtension; //导入依赖的package包/类
@Nullable
private PsiPackage createPackageFromProviders(@Nonnull VirtualFile virtualFile,
@Nonnull Class<? extends ModuleExtension> extensionClass,
@Nonnull String qualifiedName) {
final Module moduleForFile = ModuleUtil.findModuleForFile(virtualFile, myProject);
if (moduleForFile == null) {
return null;
}
ModuleRootManager moduleRootManager = ModuleRootManager.getInstance(moduleForFile);
final ModuleExtension extension = moduleRootManager.getExtension(extensionClass);
if (extension == null) {
return null;
}
PsiManager psiManager = PsiManager.getInstance(myProject);
for (PsiPackageSupportProvider p : PsiPackageSupportProvider.EP_NAME.getExtensions()) {
if (p.isSupported(extension) && p.acceptVirtualFile(moduleForFile, virtualFile)) {
return p.createPackage(psiManager, this, extensionClass, qualifiedName);
}
}
return null;
}
开发者ID:consulo,项目名称:consulo,代码行数:25,代码来源:PsiPackageManagerImpl.java
示例11: createPackageFromLibrary
import consulo.module.extension.ModuleExtension; //导入依赖的package包/类
private PsiPackage createPackageFromLibrary(@Nonnull VirtualFile virtualFile,
@Nonnull Class<? extends ModuleExtension> extensionClass,
@Nonnull String qualifiedName) {
ProjectFileIndex fileIndexFacade = ProjectFileIndex.getInstance(myProject);
PsiManager psiManager = PsiManager.getInstance(myProject);
if (fileIndexFacade.isInLibraryClasses(virtualFile)) {
List<OrderEntry> orderEntriesForFile = fileIndexFacade.getOrderEntriesForFile(virtualFile);
for (OrderEntry orderEntry : orderEntriesForFile) {
Module ownerModule = orderEntry.getOwnerModule();
ModuleExtension extension = ModuleUtilCore.getExtension(ownerModule, extensionClass);
if (extension != null) {
for (PsiPackageSupportProvider p : PsiPackageSupportProvider.EP_NAME.getExtensions()) {
if (p.isSupported(extension)) {
return p.createPackage(psiManager, this, extensionClass, qualifiedName);
}
}
}
}
}
return null;
}
开发者ID:consulo,项目名称:consulo,代码行数:22,代码来源:PsiPackageManagerImpl.java
示例12: createPackage
import consulo.module.extension.ModuleExtension; //导入依赖的package包/类
@Nonnull
@Override
public PsiPackage createPackage(@Nonnull PsiManager psiManager,
@Nonnull PsiPackageManager packageManager,
@Nonnull Class<? extends ModuleExtension> extensionClass,
@Nonnull String packageName) {
return new PsiPackageBase(psiManager, packageManager, extensionClass, packageName) {
@Override
protected ArrayFactory<? extends PsiPackage> getPackageArrayFactory() {
return PsiPackage.ARRAY_FACTORY;
}
@RequiredReadAction
@Nonnull
@Override
public Language getLanguage() {
return SandLanguage.INSTANCE;
}
};
}
开发者ID:consulo,项目名称:consulo,代码行数:21,代码来源:Sand2PackageProvider.java
示例13: SetupUnitySDKProvider
import consulo.module.extension.ModuleExtension; //导入依赖的package包/类
public SetupUnitySDKProvider(Project project, final EditorNotifications notifications)
{
myProject = project;
myProject.getMessageBus().connect().subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootAdapter()
{
@Override
public void rootsChanged(ModuleRootEvent event)
{
notifications.updateAllNotifications();
}
});
myProject.getMessageBus().connect().subscribe(ModuleExtension.CHANGE_TOPIC, (oldExtension, newExtension) -> notifications.updateAllNotifications());
}
开发者ID:consulo,项目名称:consulo-unity3d,代码行数:14,代码来源:SetupUnitySDKProvider.java
示例14: createPackage
import consulo.module.extension.ModuleExtension; //导入依赖的package包/类
@NotNull
@Override
public PsiPackage createPackage(@NotNull PsiManager psiManager, @NotNull PsiPackageManager psiPackageManager,
@NotNull Class<? extends ModuleExtension> aClass, @NotNull String s)
{
return new HaxePackageImpl(psiManager, psiPackageManager, aClass, s);
}
开发者ID:consulo,项目名称:consulo-haxe,代码行数:8,代码来源:HaxePsiPackageSupportProvider.java
示例15: getAllEjbs
import consulo.module.extension.ModuleExtension; //导入依赖的package包/类
@NotNull
public static List<EnterpriseBean> getAllEjbs(
@NotNull final Project project, @Nullable final Module module, @Nullable final ModuleExtension<?> facet)
{
/*return mapEjbClassRoles(new ArrayList<EnterpriseBean>(), project, module, facet, new NullableFunction<EjbClassRole, EnterpriseBean>() {
public EnterpriseBean fun(final EjbClassRole ejbClassRole) {
return ejbClassRole.getEnterpriseBean();
}
}); */
return Collections.emptyList();
}
开发者ID:consulo,项目名称:consulo-javaee,代码行数:13,代码来源:EjbCommonModelUtil.java
示例16: getEntryPointElements
import consulo.module.extension.ModuleExtension; //导入依赖的package包/类
@NotNull
@Override
@RequiredReadAction
public PsiElement[] getEntryPointElements()
{
List<PsiElement> list = new ArrayList<PsiElement>();
for(ModuleExtension moduleExtension : myModuleRootLayer.getExtensions())
{
if(moduleExtension instanceof DotNetModuleLangExtension)
{
Collections.addAll(list, ((DotNetModuleLangExtension) moduleExtension).getEntryPointElements());
}
}
return ContainerUtil.toArray(list, PsiElement.ARRAY_FACTORY);
}
开发者ID:consulo,项目名称:consulo-dotnet,代码行数:16,代码来源:BaseDotNetModuleExtension.java
示例17: createPackage
import consulo.module.extension.ModuleExtension; //导入依赖的package包/类
@NotNull
@Override
public PsiPackage createPackage(@NotNull PsiManager psiManager, @NotNull PsiPackageManager psiPackageManager, @NotNull Class<? extends
ModuleExtension> aClass, @NotNull String s)
{
return new DotNetPackage(psiManager, psiPackageManager, aClass, s);
}
开发者ID:consulo,项目名称:consulo-dotnet,代码行数:8,代码来源:DotNetPackageSupportProvider.java
示例18: getAvailableSystemLibraries
import consulo.module.extension.ModuleExtension; //导入依赖的package包/类
@NotNull
private Map<String, String> getAvailableSystemLibraries()
{
Map<String, String> map = new HashMap<String, String>();
ModifiableRootModel rootModel = myClasspathPanel.getRootModel();
for(ModuleExtension<?> moduleExtension : rootModel.getExtensions())
{
if(moduleExtension instanceof DotNetModuleExtensionWithLibraryProviding)
{
map.putAll(((DotNetModuleExtensionWithLibraryProviding<?>) moduleExtension).getAvailableSystemLibraries());
}
}
return map;
}
开发者ID:consulo,项目名称:consulo-dotnet,代码行数:15,代码来源:DotNetLibraryModuleDependencyTabContext.java
示例19: getFiles
import consulo.module.extension.ModuleExtension; //导入依赖的package包/类
@NotNull
@Override
public VirtualFile[] getFiles(@NotNull OrderRootType rootType)
{
DotNetSimpleModuleExtension extension = myModuleRootLayer.getExtension(DotNetSimpleModuleExtension.class);
if(extension == null)
{
return VirtualFile.EMPTY_ARRAY;
}
List<VirtualFile> virtualFiles = new SmartList<VirtualFile>();
for(ModuleExtension moduleExtension : myModuleRootLayer.getExtensions())
{
if(moduleExtension instanceof DotNetModuleExtensionWithLibraryProviding)
{
String[] systemLibraryUrls = ((DotNetModuleExtensionWithLibraryProviding) moduleExtension).getSystemLibraryUrls(getPresentableName()
, rootType);
for(String systemLibraryUrl : systemLibraryUrls)
{
VirtualFile fileByUrl = VirtualFileManager.getInstance().findFileByUrl(systemLibraryUrl);
if(fileByUrl != null)
{
virtualFiles.add(fileByUrl);
}
}
}
}
return VfsUtil.toVirtualFileArray(virtualFiles);
}
开发者ID:consulo,项目名称:consulo-dotnet,代码行数:30,代码来源:DotNetLibraryOrderEntryImpl.java
示例20: getModuleExtension
import consulo.module.extension.ModuleExtension; //导入依赖的package包/类
@Nullable
@Override
public ModuleExtensionWithSdk<?> getModuleExtension() {
ModuleExtension<?> extensionWithoutCheck = myModuleRootLayer.getExtensionWithoutCheck(myModuleExtensionId);
if (!(extensionWithoutCheck instanceof ModuleExtensionWithSdk)) {
return null;
}
return (ModuleExtensionWithSdk) extensionWithoutCheck;
}
开发者ID:consulo,项目名称:consulo,代码行数:10,代码来源:ModuleExtensionWithSdkOrderEntryImpl.java
注:本文中的consulo.module.extension.ModuleExtension类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论