本文整理汇总了Java中consulo.util.pointers.NamedPointer类的典型用法代码示例。如果您正苦于以下问题:Java NamedPointer类的具体用法?Java NamedPointer怎么用?Java NamedPointer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NamedPointer类属于consulo.util.pointers包,在下文中一共展示了NamedPointer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: testCreateByModule
import consulo.util.pointers.NamedPointer; //导入依赖的package包/类
public void testCreateByModule() throws Exception {
final Module module = addModule("x");
final NamedPointer<Module> pointer = ModuleUtilCore.createPointer(module);
assertSame(pointer, ModuleUtilCore.createPointer(module));
assertSame(pointer, ModuleUtilCore.createPointer(getProject(), "x"));
assertSame(module, pointer.get());
assertEquals("x", pointer.getName());
ModifiableModuleModel model = getModuleManager().getModifiableModel();
model.disposeModule(module);
commitModel(model);
assertNull(pointer.get());
assertEquals("x", pointer.getName());
final Module newModule = addModule("x");
assertSame(pointer, ModuleUtilCore.createPointer(newModule));
}
开发者ID:consulo,项目名称:consulo,代码行数:19,代码来源:ModulePointerTest.java
示例2: testDisposePointerFromUncommitedModifiableModel
import consulo.util.pointers.NamedPointer; //导入依赖的package包/类
public void testDisposePointerFromUncommitedModifiableModel() throws Exception {
final NamedPointer<Module> pointer = ModuleUtilCore.createPointer(getProject(), "xxx");
final ModifiableModuleModel modifiableModel = getModuleManager().getModifiableModel();
final Module module = modifiableModel.newModule("xxx", myProject.getBaseDir().getPath());
assertSame(pointer, ModuleUtilCore.createPointer(module));
assertSame(pointer, ModuleUtilCore.createPointer(getProject(), "xxx"));
assertSame(module, pointer.get());
assertEquals("xxx", pointer.getName());
modifiableModel.dispose();
assertNull(pointer.get());
assertEquals("xxx", pointer.getName());
}
开发者ID:consulo,项目名称:consulo,代码行数:17,代码来源:ModulePointerTest.java
示例3: getSdkPointer
import consulo.util.pointers.NamedPointer; //导入依赖的package包/类
@Nonnull
@Override
public NamedPointer<Sdk> getSdkPointer(String sdkName) {
return new NamedPointer<Sdk>() {
@Nullable
@Override
public Sdk get() {
return ProjectStructureConfigurable.getInstance(myProject).getSdkConfigurable().getSdksTreeModel().findSdk(sdkName);
}
@Nonnull
@Override
public String getName() {
return sdkName;
}
};
}
开发者ID:consulo,项目名称:consulo,代码行数:18,代码来源:UIRootConfigurationAccessor.java
示例4: getModulePointer
import consulo.util.pointers.NamedPointer; //导入依赖的package包/类
@RequiredReadAction
@Nonnull
@Override
public NamedPointer<Module> getModulePointer(Project project, String name) {
return new NamedPointer<Module>() {
@Nullable
@Override
public Module get() {
return ModuleStructureConfigurable.getInstance(myProject).getModule(name);
}
@Nonnull
@Override
public String getName() {
return name;
}
};
}
开发者ID:consulo,项目名称:consulo,代码行数:19,代码来源:UIRootConfigurationAccessor.java
示例5: ModuleOrderEntryImpl
import consulo.util.pointers.NamedPointer; //导入依赖的package包/类
private ModuleOrderEntryImpl(ModuleOrderEntryImpl that, ModuleRootLayerImpl rootLayer) {
super(ModuleOrderEntryType.getInstance(), rootLayer);
final NamedPointer<Module> thatModule = that.myModulePointer;
myModulePointer = ModuleUtilCore.createPointer(rootLayer.getProject(), thatModule.getName());
myExported = that.myExported;
myProductionOnTestDependency = that.myProductionOnTestDependency;
myScope = that.myScope;
}
开发者ID:consulo,项目名称:consulo,代码行数:9,代码来源:ModuleOrderEntryImpl.java
示例6: testCreateByName
import consulo.util.pointers.NamedPointer; //导入依赖的package包/类
public void testCreateByName() throws Exception {
final NamedPointer<Module> pointer = ModuleUtilCore.createPointer(getProject(), "m");
assertSame(pointer, ModuleUtilCore.createPointer(getProject(), "m"));
assertNull(pointer.get());
assertEquals("m", pointer.getName());
final Module module = addModule("m");
assertSame(module, pointer.get());
assertEquals("m", pointer.getName());
}
开发者ID:consulo,项目名称:consulo,代码行数:12,代码来源:ModulePointerTest.java
示例7: testRenameModule
import consulo.util.pointers.NamedPointer; //导入依赖的package包/类
public void testRenameModule() throws Exception {
final NamedPointer<Module> pointer = ModuleUtilCore.createPointer(getProject(), "abc");
final Module module = addModule("abc");
ModifiableModuleModel model = getModuleManager().getModifiableModel();
model.renameModule(module, "xyz");
commitModel(model);
assertSame(module, pointer.get());
assertEquals("xyz", pointer.getName());
}
开发者ID:consulo,项目名称:consulo,代码行数:10,代码来源:ModulePointerTest.java
示例8: ModuleOutputPackagingElementImpl
import consulo.util.pointers.NamedPointer; //导入依赖的package包/类
public ModuleOutputPackagingElementImpl(PackagingElementType type,
Project project,
NamedPointer<Module> modulePointer,
ContentFolderTypeProvider contentFolderType) {
super(type);
myProject = project;
myModulePointer = modulePointer;
myContentFolderType = contentFolderType;
}
开发者ID:consulo,项目名称:consulo,代码行数:10,代码来源:ModuleOutputPackagingElementImpl.java
示例9: ModuleElementPresentation
import consulo.util.pointers.NamedPointer; //导入依赖的package包/类
public ModuleElementPresentation(@Nullable NamedPointer<Module> modulePointer,
@Nonnull ArtifactEditorContext context,
final ContentFolderTypeProvider contentFolderType) {
myModulePointer = modulePointer;
myContext = context;
myContentFolderType = contentFolderType;
}
开发者ID:consulo,项目名称:consulo,代码行数:8,代码来源:ModuleElementPresentation.java
示例10: createPointer
import consulo.util.pointers.NamedPointer; //导入依赖的package包/类
@Nonnull
public static NamedPointer<Language> createPointer(@Nonnull String name) {
NamedPointer<Language> languageNamedPointer = ourPointersCache.get(name);
if(languageNamedPointer != null) {
return languageNamedPointer;
}
languageNamedPointer = new LanguagePointerImpl(name);
ourPointersCache.put(name, languageNamedPointer);
return languageNamedPointer;
}
开发者ID:consulo,项目名称:consulo,代码行数:11,代码来源:LanguagePointerUtil.java
示例11: createPresentation
import consulo.util.pointers.NamedPointer; //导入依赖的package包/类
@Override
public SourceItemPresentation createPresentation(@Nonnull ArtifactEditorContext context) {
final NamedPointer<Module> modulePointer = ModuleUtilCore.createPointer(myModule);
return new DelegatedSourceItemPresentation(new ModuleElementPresentation(modulePointer, context, myModuleOutputType.getContentFolderType())) {
@Override
public int getWeight() {
return SourceItemWeights.MODULE_OUTPUT_WEIGHT;
}
};
}
开发者ID:consulo,项目名称:consulo,代码行数:11,代码来源:ModuleOutputSourceItem.java
示例12: createElements
import consulo.util.pointers.NamedPointer; //导入依赖的package包/类
@Override
@Nonnull
public List<? extends PackagingElement<?>> createElements(@Nonnull ArtifactEditorContext context) {
final NamedPointer<Module> modulePointer = ModuleUtilCore.createPointer(myModule);
return Collections.singletonList(myModuleOutputType.createElement(context.getProject(), modulePointer));
}
开发者ID:consulo,项目名称:consulo,代码行数:8,代码来源:ModuleOutputSourceItem.java
示例13: ClientJavaScriptModuleExtension
import consulo.util.pointers.NamedPointer; //导入依赖的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);
}
开发者ID:consulo,项目名称:consulo-javascript,代码行数:41,代码来源:ClientJavaScriptModuleExtension.java
示例14: getPointer
import consulo.util.pointers.NamedPointer; //导入依赖的package包/类
@NotNull
@Override
public NamedPointer<Sdk> getPointer(@NotNull ModuleRootLayer layer, @NotNull String name)
{
return SdkUtil.createPointer(name);
}
开发者ID:consulo,项目名称:consulo-csharp,代码行数:7,代码来源:CSharpCustomCompilerSdkPointer.java
示例15: getPointer
import consulo.util.pointers.NamedPointer; //导入依赖的package包/类
@NotNull
@Override
public NamedPointer<CSharpLanguageVersion> getPointer(@NotNull ModuleRootLayer layer, @NotNull String name)
{
return CSharpLanguageVersion.valueOf(name);
}
开发者ID:consulo,项目名称:consulo-csharp,代码行数:7,代码来源:CSharpLanguageVersionPointer.java
示例16: doCreateArtifactTemplate
import consulo.util.pointers.NamedPointer; //导入依赖的package包/类
@NotNull
@RequiredReadAction
public static NewArtifactConfiguration doCreateArtifactTemplate(Module module, PackagingElementResolvingContext packagingElementResolvingContext)
{
ModulesProvider modulesProvider = packagingElementResolvingContext.getModulesProvider();
Project project = module.getProject();
CompositePackagingElement<?> root = ExplodedWarArtifactType.getInstance().createRootElement(module.getName());
DirectoryPackagingElement webInfDir = DirectoryElementType.getInstance().createEmpty(project);
webInfDir.setDirectoryName(JavaWebConstants.WEB_INF);
root.addFirstChild(webInfDir);
DirectoryPackagingElement libDir = DirectoryElementType.getInstance().createEmpty(project);
libDir.setDirectoryName("lib");
webInfDir.addFirstChild(libDir);
Set<Library> libraries = new ArrayListSet<>();
Set<Module> modules = new ArrayListSet<>();
collectInfo(modules, libraries, modulesProvider, module);
for(Module toAddModule : modules)
{
NamedPointer<Module> pointer = ModuleUtilCore.createPointer(toAddModule);
ModuleRootModel rootModel = modulesProvider.getRootModel(toAddModule);
ZipArchivePackagingElement zipArchivePackagingElement = ZipArchiveElementType.getInstance().createEmpty(project);
zipArchivePackagingElement.setArchiveFileName(toAddModule.getName() + ".jar");
if(rootModel.getContentFolders(ContentFolderScopes.of(ProductionContentFolderTypeProvider.getInstance())).length > 0)
{
zipArchivePackagingElement.addFirstChild(ProductionModuleOutputElementType.getInstance().createElement(project, pointer));
}
if(rootModel.getContentFolders(ContentFolderScopes.of(ProductionResourceContentFolderTypeProvider.getInstance())).length > 0)
{
zipArchivePackagingElement.addFirstChild(ProductionResourceModuleOutputElementType.getInstance().createElement(project, pointer));
}
libDir.addFirstChild(zipArchivePackagingElement);
if(rootModel.getContentFolders(ContentFolderScopes.of(WebResourcesFolderTypeProvider.getInstance())).length > 0)
{
root.addFirstChild(WebResourceModuleOutputElementType.getInstance().createElement(project, pointer));
}
}
for(Library library : libraries)
{
LibraryPackagingElement libraryPackagingElement = LibraryElementType.getInstance().createEmpty(project);
libraryPackagingElement.setLibraryName(library.getName());
LibraryTable table = library.getTable();
String tableLevel = table == null ? null : table.getTableLevel();
libraryPackagingElement.setLevel(tableLevel);
if(LibraryTableImplUtil.MODULE_LEVEL.equals(tableLevel))
{
libraryPackagingElement.setModuleName(((ModuleLibraryTable) table).getModule().getName());
}
libDir.addFirstChild(libraryPackagingElement);
}
return new NewArtifactConfiguration(root, ExplodedWarArtifactType.getInstance().getPresentableName() + ": " + module.getName(), ExplodedWarArtifactType.getInstance());
}
开发者ID:consulo,项目名称:consulo-javaee,代码行数:69,代码来源:ExplodedWarArtifactTemplate.java
示例17: WebResourceModuleOutputPackagingElement
import consulo.util.pointers.NamedPointer; //导入依赖的package包/类
public WebResourceModuleOutputPackagingElement(PackagingElementType type, Project project, NamedPointer<Module> modulePointer, ContentFolderTypeProvider contentFolderType)
{
super(type, project, modulePointer, contentFolderType);
}
开发者ID:consulo,项目名称:consulo-javaee,代码行数:5,代码来源:WebResourceModuleOutputPackagingElement.java
示例18: createElement
import consulo.util.pointers.NamedPointer; //导入依赖的package包/类
public ModuleOutputPackagingElementImpl createElement(@NotNull com.intellij.openapi.project.Project project, @NotNull NamedPointer<Module> pointer)
{
return new WebResourceModuleOutputPackagingElement(this, project, pointer, myContentFolderTypeProvider);
}
开发者ID:consulo,项目名称:consulo-javaee,代码行数:5,代码来源:WebResourceModuleOutputElementType.java
示例19: getPointer
import consulo.util.pointers.NamedPointer; //导入依赖的package包/类
@NotNull
public NamedPointer<Sdk> getPointer(@NotNull Project project, @NotNull String name)
{
return SdkUtil.createPointer(name);
}
开发者ID:consulo,项目名称:consulo-dotnet,代码行数:6,代码来源:DotNetModuleSdkPointer.java
示例20: getPointer
import consulo.util.pointers.NamedPointer; //导入依赖的package包/类
@Nonnull
@Override
public NamedPointer<Sdk> getPointer(@Nonnull ModuleRootLayer layer, @Nonnull String name) {
return ((ModuleRootLayerImpl)layer).getRootModel().getConfigurationAccessor().getSdkPointer(name);
}
开发者ID:consulo,项目名称:consulo,代码行数:6,代码来源:SdkModuleInheritableNamedPointerImpl.java
注:本文中的consulo.util.pointers.NamedPointer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论