当前位置: 首页>>代码示例>>Java>>正文


Java ModuleExtensionProviders类代码示例

本文整理汇总了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;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:17,代码来源:ModuleRootLayerImpl.java

示例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"));
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:35,代码来源:CSharpSdkPanel.java

示例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());
}
 
开发者ID:consulo,项目名称:consulo-dotnet,代码行数:14,代码来源:DotNetLibraryOrderEntryTypeEditor.java

示例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;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:12,代码来源:ModuleRootLayerImpl.java

示例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());
}
 
开发者ID:consulo,项目名称:consulo,代码行数:11,代码来源:ModuleRootLayerImpl.java

示例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;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:35,代码来源:ExtensionCheckedTreeNode.java

示例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;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:38,代码来源:ExtensionCheckedTreeNode.java

示例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);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:15,代码来源:ExtensionCheckedTreeNode.java

示例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);
    }
  });
}
 
开发者ID:consulo,项目名称:consulo,代码行数:38,代码来源:ExtensionListenerByLayerListenerInvoker.java

示例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);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:7,代码来源:ModuleExtensionProviderEP.java


注:本文中的consulo.module.extension.impl.ModuleExtensionProviders类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。