本文整理汇总了Java中consulo.module.extension.impl.ModuleExtensionProviders类的典型用法代码示例。如果您正苦于以下问题:Java ModuleExtensionProviders类的具体用法?Java ModuleExtensionProviders怎么用?Java ModuleExtensionProviders使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ModuleExtensionProviders类属于consulo.module.extension.impl包,在下文中一共展示了ModuleExtensionProviders类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: areExtensionsChanged
import consulo.module.extension.impl.ModuleExtensionProviders; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public boolean areExtensionsChanged(@Nonnull ModuleRootLayerImpl original) {
for (int i = 0; i < ModuleExtensionProviders.getProviders().length; i++) {
MutableModuleExtension selfExtension = getExtension0(i);
ModuleExtension originalExtension = original.getExtension0(i);
if (selfExtension == null || originalExtension == null) {
continue;
}
if (selfExtension.isModified(originalExtension)) {
return true;
}
}
return false;
}
示例2: CSharpSdkPanel
import consulo.module.extension.impl.ModuleExtensionProviders; //导入依赖的package包/类
public CSharpSdkPanel()
{
super(new VerticalFlowLayout());
myTargetComboBox = new ComboBox<>(DotNetTarget.values());
myTargetComboBox.setRenderer(new ColoredListCellRenderer<DotNetTarget>()
{
@Override
protected void customizeCellRenderer(@NotNull JList<? extends DotNetTarget> jList, DotNetTarget target, int i, boolean b, boolean b1)
{
append(target.getDescription());
}
});
add(myTargetComponent = LabeledComponent.left(myTargetComboBox, "Target"));
List<String> validSdkTypes = new SmartList<>();
for(Map.Entry<String, String[]> entry : CSharpNewModuleBuilder.ourExtensionMapping.entrySet())
{
// need check C# extension
ModuleExtensionProviderEP providerEP = ModuleExtensionProviders.findProvider(entry.getValue()[1]);
if(providerEP == null)
{
continue;
}
validSdkTypes.add(entry.getKey());
}
ProjectSdksModel model = new ProjectSdksModel();
model.reset();
myComboBox = new SdkComboBox(model, sdkTypeId -> validSdkTypes.contains(sdkTypeId.getName()), false);
add(LabeledComponent.left(myComboBox, ".NET SDK"));
}
示例3: getCellAppearance
import consulo.module.extension.impl.ModuleExtensionProviders; //导入依赖的package包/类
@NotNull
@Override
public CellAppearanceEx getCellAppearance(@NotNull DotNetLibraryOrderEntryImpl dotNetLibraryOrderEntry)
{
ModuleRootLayerImpl moduleRootLayer = dotNetLibraryOrderEntry.getModuleRootLayer();
DotNetSimpleModuleExtension extension = moduleRootLayer.getExtension(DotNetSimpleModuleExtension.class);
ModuleExtensionProviderEP providerEP = extension == null ? null : ModuleExtensionProviders.findProvider(extension.getId());
return SimpleTextCellAppearance.synthetic(dotNetLibraryOrderEntry.getPresentableName(), providerEP == null ? AllIcons.Toolbar.Unknown :
providerEP.getIcon());
}
示例4: getExtension
import consulo.module.extension.impl.ModuleExtensionProviders; //导入依赖的package包/类
@Override
@Nullable
@SuppressWarnings("unchecked")
public <T extends ModuleExtension> T getExtension(@Nonnull String key) {
ModuleExtensionProviderEP ep = ModuleExtensionProviders.findProvider(key);
if (ep == null) {
return null;
}
ModuleExtension extension = getExtension0(ep.getInternalIndex());
return extension != null && extension.isEnabled() ? (T)extension : null;
}
示例5: getExtensionWithoutCheck
import consulo.module.extension.impl.ModuleExtensionProviders; //导入依赖的package包/类
@Override
@Nullable
@SuppressWarnings("unchecked")
public <T extends ModuleExtension> T getExtensionWithoutCheck(@Nonnull String key) {
ModuleExtensionProviderEP ep = ModuleExtensionProviders.findProvider(key);
if (ep == null) {
return null;
}
return getExtension0(ep.getInternalIndex());
}
示例6: ExtensionCheckedTreeNode
import consulo.module.extension.impl.ModuleExtensionProviders; //导入依赖的package包/类
public ExtensionCheckedTreeNode(@Nullable ModuleExtensionProviderEP providerEP,
@Nonnull ModuleConfigurationState state,
ExtensionEditor extensionEditor) {
super(null);
myProviderEP = providerEP;
myState = state;
myExtensionEditor = extensionEditor;
String parentKey = null;
if (providerEP != null) {
parentKey = providerEP.key;
final ModifiableRootModel model = state.getRootModel();
if (model != null) {
myExtension = model.getExtensionWithoutCheck(providerEP.getKey());
}
}
setAllowsChildren(true);
Vector<TreeNode> child = new Vector<>();
for (ModuleExtensionProviderEP ep : ModuleExtensionProviders.getProviders()) {
if (Comparing.equal(ep.parentKey, parentKey)) {
final ExtensionCheckedTreeNode e = new ExtensionCheckedTreeNode(ep, state, myExtensionEditor);
e.setParent(this);
child.add(e);
}
}
Collections.sort(child, ExtensionProviderEPComparator.INSTANCE);
setUserObject(myExtension);
// at java 9 children is Vector<TreeNode>()
//noinspection Convert2Diamond
children = child.isEmpty() ? null : child;
}
示例7: isEnabled
import consulo.module.extension.impl.ModuleExtensionProviders; //导入依赖的package包/类
@Override
public boolean isEnabled() {
// if extension not found dont allow manage it
if(myExtension == null) {
return false;
}
if (myProviderEP != null && myProviderEP.allowMixin) {
return true;
}
if(myProviderEP != null && myProviderEP.systemOnly) {
return false;
}
final ModifiableRootModel rootModel = myState.getRootModel();
if (rootModel == null) {
return false;
}
final ModuleExtensionProviderEP absoluteParent = findParentWithoutParent(myExtension.getId());
final ModuleExtension extension = rootModel.getExtension(absoluteParent.getKey());
if (extension != null) {
return true;
}
// if no nodes checked - it enabled
for (ModuleExtensionProviderEP ep : ModuleExtensionProviders.getProviders()) {
if (ep.parentKey != null) {
continue;
}
final ModuleExtension tempExtension = rootModel.getExtension(ep.getKey());
if (tempExtension != null) {
return false;
}
} return true;
}
示例8: findParentWithoutParent
import consulo.module.extension.impl.ModuleExtensionProviders; //导入依赖的package包/类
@Nonnull
private static ModuleExtensionProviderEP findParentWithoutParent(String id) {
for (ModuleExtensionProviderEP ep : ModuleExtensionProviders.getProviders()) {
if (ep.key.equals(id)) {
if (ep.parentKey == null) {
return ep;
}
else {
return findParentWithoutParent(ep.parentKey);
}
}
}
throw new IllegalArgumentException("Cant find for id: " + id);
}
示例9: ExtensionListenerByLayerListenerInvoker
import consulo.module.extension.impl.ModuleExtensionProviders; //导入依赖的package包/类
public ExtensionListenerByLayerListenerInvoker(@Nonnull Project project, @Nonnull final MessageBus bus) {
super(project);
bus.connect().subscribe(ProjectTopics.MODULE_LAYERS, new ModuleRootLayerListener.Adapter() {
@Override
public void currentLayerChanged(@Nonnull final Module module,
@Nonnull final String oldName,
@Nonnull final ModuleRootLayer oldLayer,
@Nonnull final String newName,
@Nonnull final ModuleRootLayer newLayer) {
final List<Couple<ModuleExtension>> list = new ArrayList<Couple<ModuleExtension>>();
for (ModuleExtensionProviderEP providerEP : ModuleExtensionProviders.getProviders()) {
MutableModuleExtension oldExtension = oldLayer.getExtensionWithoutCheck(providerEP.getKey());
MutableModuleExtension newExtension = newLayer.getExtensionWithoutCheck(providerEP.getKey());
if(oldExtension == null || newExtension == null) {
continue;
}
if(oldExtension.isModified(newExtension)) {
list.add(Couple.<ModuleExtension>of(oldExtension, newExtension));
}
}
ApplicationManager.getApplication().invokeLater(new Runnable() {
@Override
public void run() {
ModuleExtensionChangeListener moduleExtensionChangeListener = bus.syncPublisher(ModuleExtension.CHANGE_TOPIC);
for (Couple<ModuleExtension> couple : list) {
moduleExtensionChangeListener.beforeExtensionChanged(couple.getFirst(), couple.getSecond());
}
}
}, ModalityState.NON_MODAL);
}
});
}
示例10: findProviderEP
import consulo.module.extension.impl.ModuleExtensionProviders; //导入依赖的package包/类
@Nullable
@Deprecated
@DeprecationInfo(value = "Use ModuleExtensionProviders#findProvider(String)", until = "2.0")
public static ModuleExtensionProviderEP findProviderEP(@Nonnull String id) {
return ModuleExtensionProviders.findProvider(id);
}