本文整理汇总了Java中consulo.roots.ModuleRootLayer类的典型用法代码示例。如果您正苦于以下问题:Java ModuleRootLayer类的具体用法?Java ModuleRootLayer怎么用?Java ModuleRootLayer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ModuleRootLayer类属于consulo.roots包,在下文中一共展示了ModuleRootLayer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadOrderEntry
import consulo.roots.ModuleRootLayer; //导入依赖的package包/类
@Nullable
public static OrderEntry loadOrderEntry(@Nonnull Element element, @Nonnull ModuleRootLayer moduleRootLayer) {
String type = element.getAttributeValue(ORDER_ENTRY_TYPE_ATTR);
if(type == null) {
return null;
}
OrderEntryType orderEntryType = getProvidersAsMap().get(type);
if(orderEntryType == null) {
return new UnknownOrderEntryImpl(new UnknownOrderEntryType(type, element), (ModuleRootLayerImpl)moduleRootLayer);
}
try {
return orderEntryType.loadOrderEntry(element, moduleRootLayer);
}
catch (InvalidDataException e) {
return new UnknownOrderEntryImpl(new UnknownOrderEntryType(type, element), (ModuleRootLayerImpl)moduleRootLayer);
}
}
示例2: getLayers
import consulo.roots.ModuleRootLayer; //导入依赖的package包/类
@Nullable
private ListWithSelection<String> getLayers() {
VirtualFile file = getSelectedFile();
Project project = getProject();
Module moduleForFile = file == null || project == null ? null : ModuleUtilCore.findModuleForFile(file, project);
if (moduleForFile == null) {
return null;
}
ModuleRootManager moduleRootManager = ModuleRootManager.getInstance(moduleForFile);
Map<String, ModuleRootLayer> layers = moduleRootManager.getLayers();
if (layers.size() == 1) {
return null;
}
String currentLayerName = moduleRootManager.getCurrentLayerName();
return new ListWithSelection<String>(layers.keySet(), currentLayerName);
}
示例3: getExcludeRootsForModule
import consulo.roots.ModuleRootLayer; //导入依赖的package包/类
@Nonnull
@Override
public VirtualFilePointer[] getExcludeRootsForModule(@Nonnull final ModuleRootLayer moduleRootLayer) {
ModuleCompilerPathsManager manager = ModuleCompilerPathsManager.getInstance(moduleRootLayer.getModule());
List<VirtualFilePointer> result = new ArrayList<VirtualFilePointer>(3);
if (manager.isInheritedCompilerOutput()) {
final VirtualFilePointer compilerOutputPointer = CompilerConfiguration.getInstance(myProject).getCompilerOutputPointer();
for (ContentEntry contentEntry : moduleRootLayer.getContentEntries()) {
if (compilerOutputPointer.getUrl().contains(contentEntry.getUrl())) {
result.add(compilerOutputPointer);
}
}
}
else {
if (!manager.isExcludeOutput()) {
return VirtualFilePointer.EMPTY_ARRAY;
}
for (ContentFolderTypeProvider contentFolderType : ContentFolderTypeProvider.filter(ContentFolderScopes.productionAndTest())) {
result.add(manager.getCompilerOutputPointer(contentFolderType));
}
}
return result.isEmpty() ? VirtualFilePointer.EMPTY_ARRAY : result.toArray(new VirtualFilePointer[result.size()]);
}
示例4: InnerMonoModuleExtension
import consulo.roots.ModuleRootLayer; //导入依赖的package包/类
public InnerMonoModuleExtension(@NotNull String id, @NotNull ModuleRootLayer rootModel)
{
super(id, rootModel);
myPointer = new DummyModuleInheritableNamedPointer<Sdk>()
{
@Override
public Sdk get()
{
return InnerMonoModuleExtension.this.get();
}
};
}
示例5: loadOrderEntry
import consulo.roots.ModuleRootLayer; //导入依赖的package包/类
@NotNull
@Override
public DotNetLibraryOrderEntryImpl loadOrderEntry(@NotNull Element element, @NotNull ModuleRootLayer moduleRootLayer) throws InvalidDataException
{
String name = element.getAttributeValue("name");
if(name.endsWith(".dll"))
{
int lastIndex = name.lastIndexOf(".dll");
name = name.substring(0, lastIndex);
}
return new DotNetLibraryOrderEntryImpl((ModuleRootLayerImpl) moduleRootLayer, name);
}
示例6: resolveFor
import consulo.roots.ModuleRootLayer; //导入依赖的package包/类
@Nullable
private <E> Pair<Class<E>, Constructor<E>> resolveFor(String className) {
Class<E> value = findClassNoExceptions(className);
if (value == null) {
return null;
}
try {
return Pair.create(value, value.getConstructor(String.class, ModuleRootLayer.class));
}
catch (NoSuchMethodException e) {
ModuleExtensionProviderEP.LOGGER.error(e);
}
return null;
}
示例7: createImmutable
import consulo.roots.ModuleRootLayer; //导入依赖的package包/类
@Nullable
public ModuleExtension<?> createImmutable(@Nonnull ModuleRootLayer modifiableRootModel) {
try {
Pair<Class<ModuleExtension>, Constructor<ModuleExtension>> value = myImmutableValue.getValue();
if (value != null) {
return ReflectionUtil.createInstance(value.getSecond(), key, modifiableRootModel);
}
}
catch (Error e) {
ModuleExtensionProviderEP.LOGGER.error("Problem with module extension: " + key, e);
}
return null;
}
示例8: createMutable
import consulo.roots.ModuleRootLayer; //导入依赖的package包/类
@Nullable
public MutableModuleExtension<?> createMutable(@Nonnull ModuleRootLayer modifiableRootModel) {
try {
Pair<Class<MutableModuleExtension>, Constructor<MutableModuleExtension>> value = myMutableValue.getValue();
if (value != null) {
return ReflectionUtil.createInstance(value.getSecond(), key, modifiableRootModel);
}
}
catch (Error e) {
ModuleExtensionProviderEP.LOGGER.error("Problem with module extension: " + key, e);
}
return null;
}
示例9: loadOrderEntry
import consulo.roots.ModuleRootLayer; //导入依赖的package包/类
@Nonnull
@Override
public ModuleExtensionWithSdkOrderEntryImpl loadOrderEntry(@Nonnull Element element, @Nonnull ModuleRootLayer moduleRootLayer) throws InvalidDataException {
String moduleExtensionId = element.getAttributeValue(EXTENSION_ID_ATTRIBUTE);
if (moduleExtensionId == null) {
throw new InvalidDataException();
}
return new ModuleExtensionWithSdkOrderEntryImpl(moduleExtensionId, (ModuleRootLayerImpl)moduleRootLayer, false);
}
示例10: loadOrderEntry
import consulo.roots.ModuleRootLayer; //导入依赖的package包/类
@Nonnull
@Override
public LibraryOrderEntryImpl loadOrderEntry(@Nonnull Element element, @Nonnull ModuleRootLayer moduleRootLayer) throws InvalidDataException {
String name = element.getAttributeValue(NAME_ATTR);
if (name == null) {
throw new InvalidDataException();
}
String level = element.getAttributeValue(LEVEL_ATTR, LibraryTablesRegistrar.PROJECT_LEVEL);
DependencyScope dependencyScope = DependencyScope.readExternal(element);
boolean exported = element.getAttributeValue(EXPORTED_ATTR) != null;
return new LibraryOrderEntryImpl(name, level, (ModuleRootLayerImpl)moduleRootLayer, dependencyScope, exported, false);
}
示例11: loadOrderEntry
import consulo.roots.ModuleRootLayer; //导入依赖的package包/类
@Nonnull
@Override
public ModuleOrderEntryImpl loadOrderEntry(@Nonnull Element element, @Nonnull ModuleRootLayer moduleRootLayer) throws InvalidDataException {
String moduleName = element.getAttributeValue(MODULE_NAME_ATTR);
if (moduleName == null) {
throw new InvalidDataException();
}
DependencyScope dependencyScope = DependencyScope.readExternal(element);
boolean exported = element.getAttributeValue(EXPORTED_ATTR) != null;
boolean productionOnTestDependency = element.getAttributeValue(PRODUCTION_ON_TEST_ATTRIBUTE) != null;
return new ModuleOrderEntryImpl(moduleName, (ModuleRootLayerImpl)moduleRootLayer, dependencyScope, exported, productionOnTestDependency);
}
示例12: loadOrderEntry
import consulo.roots.ModuleRootLayer; //导入依赖的package包/类
@Nonnull
@Override
public ModuleLibraryOrderEntryImpl loadOrderEntry(@Nonnull Element element, @Nonnull ModuleRootLayer moduleRootLayer) throws InvalidDataException {
boolean exported = element.getAttributeValue(EXPORTED_ATTR) != null;
DependencyScope scope = DependencyScope.readExternal(element);
Library library = LibraryTableImplUtil.loadLibrary(element, (ModuleRootLayerImpl)moduleRootLayer);
return new ModuleLibraryOrderEntryImpl(library, (ModuleRootLayerImpl)moduleRootLayer, exported, scope, false);
}
示例13: ClientJavaScriptModuleExtension
import consulo.roots.ModuleRootLayer; //导入依赖的package包/类
public ClientJavaScriptModuleExtension(@NotNull String id, @NotNull ModuleRootLayer rootLayer)
{
super(id, rootLayer);
myPointer = new ModuleInheritableNamedPointerImpl<Sdk>(rootLayer, id)
{
@Nullable
@Override
public String getItemNameFromModule(@NotNull Module module)
{
ClientJavaScriptModuleExtension extension = ModuleUtilCore.getExtension(module, ClientJavaScriptModuleExtension.class);
if(extension == null)
{
return null;
}
return extension.getSdkName();
}
@Nullable
@Override
public Sdk getItemFromModule(@NotNull Module module)
{
ClientJavaScriptModuleExtension extension = ModuleUtilCore.getExtension(module, ClientJavaScriptModuleExtension.class);
if(extension == null)
{
return null;
}
return extension.getSdk();
}
@NotNull
@Override
public NamedPointer<Sdk> getPointer(@NotNull ModuleRootLayer moduleRootLayer, @NotNull String name)
{
return ((ModuleRootLayerImpl)moduleRootLayer).getRootModel().getConfigurationAccessor().getSdkPointer(name);
}
};
Sdk sdkByType = SdkTable.getInstance().findPredefinedSdkByType(ClientJavaScriptSdkType.getInstance());
myPointer.set(null, sdkByType);
}
示例14: JavaModuleExtensionImpl
import consulo.roots.ModuleRootLayer; //导入依赖的package包/类
public JavaModuleExtensionImpl(@NotNull String id, @NotNull ModuleRootLayer moduleRootLayer)
{
super(id, moduleRootLayer);
myLanguageLevel = new LanguageLevelModuleInheritableNamedPointerImpl(moduleRootLayer, id);
myLanguageLevelValue = new LazyValueBySdk<>(this, LanguageLevel.HIGHEST, sdk -> {
JavaSdkVersion sdkVersion = JavaSdk.getInstance().getVersion(sdk);
return sdkVersion == null ? LanguageLevel.HIGHEST : sdkVersion.getMaxLanguageLevel();
});
}
示例15: Unity3dNUnitMutableModuleExtension
import consulo.roots.ModuleRootLayer; //导入依赖的package包/类
public Unity3dNUnitMutableModuleExtension(@NotNull String id, @NotNull ModuleRootLayer moduleRootLayer)
{
super(id, moduleRootLayer);
}