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


Java IExtensionRegistry.getExtensionPoint方法代码示例

本文整理汇总了Java中org.eclipse.core.runtime.IExtensionRegistry.getExtensionPoint方法的典型用法代码示例。如果您正苦于以下问题:Java IExtensionRegistry.getExtensionPoint方法的具体用法?Java IExtensionRegistry.getExtensionPoint怎么用?Java IExtensionRegistry.getExtensionPoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.core.runtime.IExtensionRegistry的用法示例。


在下文中一共展示了IExtensionRegistry.getExtensionPoint方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: retrieveLocators

import org.eclipse.core.runtime.IExtensionRegistry; //导入方法依赖的package包/类
/**
 * Retrieve all the locators registered with the extension point, and additionally store them in a cache.
 * 
 * @return All locators registered with the extension point.
 */
public List<ILocator> retrieveLocators() {
	if (locators == null) {
		IExtensionRegistry reg = Platform.getExtensionRegistry();
		IExtensionPoint ep = reg.getExtensionPoint("org.eclipse.gemoc.dsl.debug.locator");
		IExtension[] extensions = ep.getExtensions();
		ArrayList<ILocator> contributors = new ArrayList<ILocator>();
		for (int i = 0; i < extensions.length; i++) {
			IExtension ext = extensions[i];
			IConfigurationElement[] ce = ext.getConfigurationElements();
			for (int j = 0; j < ce.length; j++) {
				ILocator locator;
				try {
					locator = (ILocator)ce[j].createExecutableExtension("class");
					contributors.add(locator);
				} catch (CoreException e) {
					e.printStackTrace();
				}
			}
		}
		locators = contributors;
	}
	return locators;
}
 
开发者ID:eclipse,项目名称:gemoc-studio-modeldebugging,代码行数:29,代码来源:Activator.java

示例2: getAvailableCodegenWizards

import org.eclipse.core.runtime.IExtensionRegistry; //导入方法依赖的package包/类
public ElementList getAvailableCodegenWizards() {
	ElementList wizards = new ElementList("CodegenWizards"); //$NON-NLS-1$
	IExtensionRegistry registry = Platform.getExtensionRegistry();
	IExtensionPoint point = registry.getExtensionPoint(org.eclipse.gemoc.commons.eclipse.pde.Activator.PLUGIN_ID, PLUGIN_POINT);
	if (point == null)
		return wizards;
	IExtension[] extensions = point.getExtensions();
	for (int i = 0; i < extensions.length; i++) {
		IConfigurationElement[] elements = extensions[i].getConfigurationElements();
		for (int j = 0; j < elements.length; j++) {
			if (elements[j].getName().equals(TAG_WIZARD)) {
				String targetPluginId = elements[j].getAttribute(WizardElement.ATT_TARGETPLUGINID);
				if( targetPluginId == null || targetPluginId.equals(getTargetPluginId())){
					WizardElement element = createWizardElement(elements[j]);
					if (element != null) {
						wizards.add(element);
					}
				}
			}
		}
	}
	return wizards;
}
 
开发者ID:eclipse,项目名称:gemoc-studio,代码行数:24,代码来源:AbstractNewProjectWizardWithTemplates.java

示例3: getConfigurationElementsForCheckinPolicy

import org.eclipse.core.runtime.IExtensionRegistry; //导入方法依赖的package包/类
/**
 * Gets the configuration elements for the plugins that extend our checkin
 * policy extension point.
 *
 * @return an array of configuration elements from plugins that support our
 *         extension point.
 */
private IConfigurationElement[] getConfigurationElementsForCheckinPolicy() {
    final IExtensionRegistry registry = Platform.getExtensionRegistry();

    final IExtensionPoint extensionPoint = registry.getExtensionPoint(CHECKIN_POLICY_EXTENSION_POINT_NAME);

    /*
     * These extension points should always be available even if there are
     * no contributions available (policy implementations), but it's good to
     * check anyway.
     */
    if (extensionPoint == null) {
        final String messageFormat = "Couldn't load extension point {0}"; //$NON-NLS-1$
        final String message = MessageFormat.format(messageFormat, CHECKIN_POLICY_EXTENSION_POINT_NAME);
        log.error(message);
        throw new PolicyLoaderException(message, null);
    }

    return extensionPoint.getConfigurationElements();
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:27,代码来源:ExtensionPointPolicyLoader.java

示例4: getListener

import org.eclipse.core.runtime.IExtensionRegistry; //导入方法依赖的package包/类
/**
 * Returns a {@link SingleListenerFacade} of the resource changing listeners
 * by loading extension points and creating new listeners on demand.
 * Subsequent calls will used cached listener data.
 *
 * @return A {@link SingleListenerFacade} of
 *         {@link ResourceChangingCommandListener}s.
 */
public static SingleListenerFacade getListener() {
    synchronized (lock) {
        if (listener == null) {
            final IExtensionRegistry registry = Platform.getExtensionRegistry();
            final IExtensionPoint extensionPoint = registry.getExtensionPoint(EXTENSION_POINT_ID);

            final IConfigurationElement[] elements = extensionPoint.getConfigurationElements();

            final ListenerList list = new StandardListenerList();

            for (int i = 0; i < elements.length; i++) {
                try {
                    list.addListener(elements[i].createExecutableExtension("class")); //$NON-NLS-1$
                } catch (final CoreException e) {
                    log.warn("Could not create " + EXTENSION_POINT_ID + " class", e); //$NON-NLS-1$ //$NON-NLS-2$
                }
            }

            listener = new SingleListenerFacade(ResourceChangingCommandListener.class, list);
        }

        return listener;
    }
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:33,代码来源:ResourceChangingCommandUtil.java

示例5: testValidExtensionPoints

import org.eclipse.core.runtime.IExtensionRegistry; //导入方法依赖的package包/类
@Test
public final void testValidExtensionPoints() {
  NodeList extensions = getDocument().getElementsByTagName("extension");
  Assert.assertTrue(
      "plugin.xml must contain at least one extension point", extensions.getLength() > 0);
      
  IExtensionRegistry registry = RegistryFactory.getRegistry();
  Assert.assertNotNull("Make sure you're running this as a plugin test", registry);
  for (int i = 0; i < extensions.getLength(); i++) {
    Element extension = (Element) extensions.item(i);
    String point = extension.getAttribute("point");
    Assert.assertNotNull("Could not load " + extension.getAttribute("id"), point);
    IExtensionPoint extensionPoint = registry.getExtensionPoint(point);
    Assert.assertNotNull("Could not load " + extension.getAttribute("id"), extensionPoint);
  }
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:17,代码来源:BasePluginXmlTest.java

示例6: loadExtensions

import org.eclipse.core.runtime.IExtensionRegistry; //导入方法依赖的package包/类
/**
 * plugin.xmlからタグを読み込む.
 * 
 * @throws CoreException
 * @throws CoreException
 */
public static List<ExtendPopupMenu> loadExtensions(final ERDiagramEditor editor) throws CoreException {
    final List<ExtendPopupMenu> extendPopupMenuList = new ArrayList<ExtendPopupMenu>();

    final IExtensionRegistry registry = Platform.getExtensionRegistry();
    final IExtensionPoint extensionPoint = registry.getExtensionPoint(EXTENSION_POINT_ID);

    if (extensionPoint != null) {
        for (final IExtension extension : extensionPoint.getExtensions()) {
            for (final IConfigurationElement configurationElement : extension.getConfigurationElements()) {

                final ExtendPopupMenu extendPopupMenu = ExtendPopupMenu.createExtendPopupMenu(configurationElement, editor);

                if (extendPopupMenu != null) {
                    extendPopupMenuList.add(extendPopupMenu);
                }
            }
        }
    }

    return extendPopupMenuList;
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:28,代码来源:ExtendPopupMenu.java

示例7: loadExtensions

import org.eclipse.core.runtime.IExtensionRegistry; //导入方法依赖的package包/类
/**
 * plugin.xmlからタグを読み込む.
 * 
 * @throws CoreException
 * 
 * @throws CoreException
 */
public static List<ExtendPopupMenu> loadExtensions(ERDiagramEditor editor)
		throws CoreException {
	List<ExtendPopupMenu> extendPopupMenuList = new ArrayList<ExtendPopupMenu>();

	IExtensionRegistry registry = Platform.getExtensionRegistry();
	IExtensionPoint extensionPoint = registry
			.getExtensionPoint(EXTENSION_POINT_ID);

	if (extensionPoint != null) {
		for (IExtension extension : extensionPoint.getExtensions()) {
			for (IConfigurationElement configurationElement : extension
					.getConfigurationElements()) {

				ExtendPopupMenu extendPopupMenu = ExtendPopupMenu
						.createExtendPopupMenu(configurationElement, editor);

				if (extendPopupMenu != null) {
					extendPopupMenuList.add(extendPopupMenu);
				}
			}
		}
	}

	return extendPopupMenuList;
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:33,代码来源:ExtendPopupMenu.java

示例8: testExtensionPoints

import org.eclipse.core.runtime.IExtensionRegistry; //导入方法依赖的package包/类
/**
 * @param jarfile
 */
private void testExtensionPoints(String jarfile) {

    try {
        System.out
                .println("dumping contents in jar using extension net.sf.fjep.fatjar.fatjarJarUtil");
        System.out.println("--- " + jarfile + " ---");
        IExtensionRegistry reg = Platform.getExtensionRegistry();
        IExtensionPoint exp = reg
                .getExtensionPoint("net.sf.fjep.fatjar.jarutil");
        IExtension[] extensions = exp.getExtensions();
        IConfigurationElement[] elements = extensions[0]
                .getConfigurationElements();
        IJarUtilFactory ju = (IJarUtilFactory) elements[0]
                .createExecutableExtension("class");
        IFileSystemSource fss = ju.createJARFileSystemSource(jarfile, "");
        while (fss.hasMoreElements()) {
            IFileSystemElement fse = fss.nextElement();
            System.out.println(fse.getFullName());
        }
        System.out.println("--- finished ---");
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
开发者ID:thahn0720,项目名称:agui_eclipse_plugin,代码行数:28,代码来源:BuildFatJar.java

示例9: getRAPPathFromExtensionRegistry

import org.eclipse.core.runtime.IExtensionRegistry; //导入方法依赖的package包/类
private String getRAPPathFromExtensionRegistry() {

		IExtensionRegistry reg = Platform.getExtensionRegistry();
		IExtensionPoint poi;

		String rapPath = null;

		if (reg != null) {
			poi = reg.getExtensionPoint("org.eclipse.rap.ui.entrypoint");
			if (poi != null) {
				IExtension[] exts = poi.getExtensions();

				for (IExtension ext : exts) {
					IConfigurationElement[] els = ext.getConfigurationElements();
					for (IConfigurationElement el : els) {
						String pathAttribute = el.getAttribute("path");
						if(pathAttribute != null){
							rapPath = pathAttribute;
							break;
						}
					}
				}
			}
		}
		return rapPath;
	}
 
开发者ID:mondo-project,项目名称:mondo-integration,代码行数:27,代码来源:OfflineCollaborationHandler.java

示例10: includeExtensionPartipants

import org.eclipse.core.runtime.IExtensionRegistry; //导入方法依赖的package包/类
private void includeExtensionPartipants() throws CoreException {
  IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
  IExtensionPoint extensionPoint = extensionRegistry
      .getExtensionPoint("com.gwtplugins.gdt.eclipse.suite.webAppCreatorParticipant");
  if (extensionPoint == null) {
    return;
  }
  IExtension[] extensions = extensionPoint.getExtensions();
  for (IExtension extension : extensions) {
    IConfigurationElement[] configurationElements = extension.getConfigurationElements();
    for (IConfigurationElement configurationElement : configurationElements) {
      Object createExecutableExtension = configurationElement.createExecutableExtension("class");
      Participant participant = (Participant) createExecutableExtension;
      participant.updateWebAppProjectCreator(this);
    }
  }
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:18,代码来源:WebAppProjectCreator.java

示例11: registerOverlays

import org.eclipse.core.runtime.IExtensionRegistry; //导入方法依赖的package包/类
public static void registerOverlays(final Map map) {

		final IExtensionRegistry registry = RegistryFactory.getRegistry();
		final IExtensionPoint point = registry.getExtensionPoint("net.tourbook.mapOverlay"); //$NON-NLS-1$
		final IExtension[] extensions = point.getExtensions();

		for (final IExtension extension : extensions) {
			final IConfigurationElement[] elements = extension.getConfigurationElements();

			final IConfigurationElement element = elements[elements.length - 1];

			Object o = null;
			try {
				o = element.createExecutableExtension("class"); //$NON-NLS-1$
			} catch (final CoreException e) {
				e.printStackTrace();
			}

			if (o != null && o instanceof MapPainter) {
				map.addOverlayPainter((MapPainter) o);
			}
		}
	}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:24,代码来源:GeoclipseExtensions.java

示例12: retrieveEclipseVersionString

import org.eclipse.core.runtime.IExtensionRegistry; //导入方法依赖的package包/类
private String retrieveEclipseVersionString() {
	String product = System.getProperty("eclipse.product");
	IExtensionRegistry registry = Platform.getExtensionRegistry();
	IExtensionPoint point = registry.getExtensionPoint("org.eclipse.core.runtime.products");
	if (point != null) {
		IExtension[] extensions = point.getExtensions();
		for (IExtension ext : extensions) {
			if (product.equals(ext.getUniqueIdentifier())) {
				IContributor contributor = ext.getContributor();
				if (contributor != null) {
					Bundle bundle = Platform.getBundle(contributor.getName());
					if (bundle != null) {
						Version version = bundle.getVersion();
						return version.getMajor() + "." + version.getMinor();
					}
				}
			}
		}
	}
	return null;
}
 
开发者ID:USESystemEngineeringBV,项目名称:cmake-eclipse-helper,代码行数:22,代码来源:CMakeLauncher.java

示例13: loadExtensions

import org.eclipse.core.runtime.IExtensionRegistry; //导入方法依赖的package包/类
public static List<ExtendPopupMenu> loadExtensions(MainDiagramEditor editor) throws CoreException {
    final List<ExtendPopupMenu> extendPopupMenuList = new ArrayList<>();

    final IExtensionRegistry registry = Platform.getExtensionRegistry();
    final IExtensionPoint extensionPoint = registry.getExtensionPoint(EXTENSION_POINT_ID);

    if (extensionPoint != null) {
        for (final IExtension extension : extensionPoint.getExtensions()) {
            for (final IConfigurationElement configurationElement : extension.getConfigurationElements()) {
                final ExtendPopupMenu extendPopupMenu = ExtendPopupMenu.createExtendPopupMenu(configurationElement, editor);
                if (extendPopupMenu != null) {
                    extendPopupMenuList.add(extendPopupMenu);
                }
            }
        }
    }
    return extendPopupMenuList;
}
 
开发者ID:dbflute-session,项目名称:erflute,代码行数:19,代码来源:ExtendPopupMenu.java

示例14: buildPlanGroupRegistry

import org.eclipse.core.runtime.IExtensionRegistry; //导入方法依赖的package包/类
private static List<PlanGroup> buildPlanGroupRegistry() {
	List<PlanGroup> l = new ArrayList<PlanGroup>();
	IExtensionRegistry registry = Platform.getExtensionRegistry();
       IExtensionPoint point = registry.getExtensionPoint(EXTENSION_POINT_ID);
       for (IExtension extension : point.getExtensions()) {
       	for (IConfigurationElement planGroup : extension.getConfigurationElements()) {
       		String name = planGroup.getAttribute("name");
       		String expandedName = planGroup.getAttribute("expandedName");
       		int sort = Integer.valueOf(planGroup.getAttribute("sortkey"));
       		PlanGroup type = new PlanGroup(name, expandedName, sort);
       		l.add(type);
           }
       }
       
       // Allow contributions
       //
       l.addAll(ClassRegistry.createInstances(PlanGroup.class));
       
       Collections.sort(l, new Comparator<PlanGroup>() {
		@Override
		public int compare(PlanGroup o1, PlanGroup o2) {
			return o1.sortKey - o2.sortKey;
		}
	});
	return Collections.unmodifiableList(l);
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:27,代码来源:PlanGroupRegistry.java

示例15: PerspectiveUtils

import org.eclipse.core.runtime.IExtensionRegistry; //导入方法依赖的package包/类
private PerspectiveUtils() {
	IExtensionRegistry registry = Platform.getExtensionRegistry();
	if (registry != null) {
		IExtensionPoint extensionPoint = registry.getExtensionPoint(PERSPECTIVE_CATEGORY_EXTENSION);
		if (extensionPoint != null) {
			IExtension[] extensions = extensionPoint.getExtensions();
			for (IExtension extension : extensions) {
				IConfigurationElement[] elements = extension.getConfigurationElements();
				for (IConfigurationElement element : elements) {
					String categoryId = element.getAttribute("categoryId");
					String perspectiveId = element.getAttribute("perspectiveId");
					categoryIdToPerspectiveIds.get(categoryId).add(perspectiveId);
				}
			}
		}
	}
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:18,代码来源:PerspectiveUtils.java


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