本文整理汇总了Java中com.intellij.openapi.roots.impl.ModuleOrderEntryImpl类的典型用法代码示例。如果您正苦于以下问题:Java ModuleOrderEntryImpl类的具体用法?Java ModuleOrderEntryImpl怎么用?Java ModuleOrderEntryImpl使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ModuleOrderEntryImpl类属于com.intellij.openapi.roots.impl包,在下文中一共展示了ModuleOrderEntryImpl类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testChangingDependencyTypeToTestJar
import com.intellij.openapi.roots.impl.ModuleOrderEntryImpl; //导入依赖的package包/类
public void testChangingDependencyTypeToTestJar() throws Exception {
configConfirmationForYesAnswer();
VirtualFile m1 = createModulePom("m1", createPomXmlWithModuleDependency("jar"));
VirtualFile m2 = createModulePom("m2", "<groupId>test</groupId>" +
"<artifactId>m2</artifactId>" +
"<version>1</version>");
importProjects(m1, m2);
assertModules("m1", "m2");
ModuleOrderEntry dep = OrderEntryUtil.findModuleOrderEntry(ModuleRootManager.getInstance(getModule("m1")), getModule("m2"));
assertNotNull(dep);
assertFalse(((ModuleOrderEntryImpl)dep).isProductionOnTestDependency());
createModulePom("m1", createPomXmlWithModuleDependency("test-jar"));
importProjects(m1, m2);
ModuleOrderEntry dep2 = OrderEntryUtil.findModuleOrderEntry(ModuleRootManager.getInstance(getModule("m1")), getModule("m2"));
assertNotNull(dep2);
assertTrue(((ModuleOrderEntryImpl)dep2).isProductionOnTestDependency());
}
示例2: addModuleDependency
import com.intellij.openapi.roots.impl.ModuleOrderEntryImpl; //导入依赖的package包/类
public void addModuleDependency(@NotNull String moduleName,
@NotNull DependencyScope scope,
boolean testJar) {
Module m = findModuleByName(moduleName);
ModuleOrderEntry e;
if (m != null) {
e = myRootModel.addModuleOrderEntry(m);
}
else {
AccessToken accessToken = ReadAction.start();
try {
e = myRootModel.addInvalidModuleEntry(moduleName);
}
finally {
accessToken.finish();
}
}
e.setScope(scope);
if (testJar) {
((ModuleOrderEntryImpl)e).setProductionOnTestDependency(true);
}
if (myOrderEntriesBeforeJdk.contains(moduleName)) {
moveLastOrderEntryBeforeJdk();
}
}
示例3: loadOrderEntry
import com.intellij.openapi.roots.impl.ModuleOrderEntryImpl; //导入依赖的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);
}
示例4: storeOrderEntry
import com.intellij.openapi.roots.impl.ModuleOrderEntryImpl; //导入依赖的package包/类
@Override
public void storeOrderEntry(@Nonnull Element element, @Nonnull ModuleOrderEntryImpl orderEntry) {
element.setAttribute(MODULE_NAME_ATTR, orderEntry.getModuleName());
if (orderEntry.isExported()) {
element.setAttribute(EXPORTED_ATTR, "");
}
orderEntry.getScope().writeExternal(element);
if (orderEntry.isProductionOnTestDependency()) {
element.setAttribute(PRODUCTION_ON_TEST_ATTRIBUTE, "");
}
}
示例5: getCellAppearance
import com.intellij.openapi.roots.impl.ModuleOrderEntryImpl; //导入依赖的package包/类
@Nonnull
@Override
public CellAppearanceEx getCellAppearance(@Nonnull ModuleOrderEntryImpl orderEntry) {
return SimpleTextCellAppearance.regular(orderEntry.getPresentableName(), AllIcons.Nodes.Module);
}