當前位置: 首頁>>代碼示例>>Java>>正文


Java IExtension.getConfigurationElements方法代碼示例

本文整理匯總了Java中org.eclipse.core.runtime.IExtension.getConfigurationElements方法的典型用法代碼示例。如果您正苦於以下問題:Java IExtension.getConfigurationElements方法的具體用法?Java IExtension.getConfigurationElements怎麽用?Java IExtension.getConfigurationElements使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.core.runtime.IExtension的用法示例。


在下文中一共展示了IExtension.getConfigurationElements方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: retrieveLocators

import org.eclipse.core.runtime.IExtension; //導入方法依賴的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: removed

import org.eclipse.core.runtime.IExtension; //導入方法依賴的package包/類
@Override
public void removed(IExtension[] extensions) {
    for (IExtension extension : extensions) {
        if (SERVICE_REGISTERY_EXTENSION_POINT.equals(extension.getExtensionPointUniqueIdentifier())) {
            for (IConfigurationElement element : extension.getConfigurationElements()) {
                if (TOKEN_ELEMENT_NAME.equals(element.getName())) {
                    final String tokenName = element.getAttribute(SERVICE_TOKEN_ATTR_NAME);
                    final String bundleName = extension.getContributor().getName();
                    final List<String> services = new ArrayList<String>();
                    for (IConfigurationElement child : element.getChildren()) {
                        final String className = child.getAttribute(SERVICE_CLASS_ATTR_NAME);
                        services.add(className);
                    }
                    ServiceRegistry.INSTANCE.remove(tokenName, bundleName, services);
                }
            }
        }
    }
}
 
開發者ID:ObeoNetwork,項目名稱:M2Doc,代碼行數:20,代碼來源:DeclaredServicesListener.java

示例3: loadExtensions

import org.eclipse.core.runtime.IExtension; //導入方法依賴的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

示例4: getBookmarkTypes

import org.eclipse.core.runtime.IExtension; //導入方法依賴的package包/類
public synchronized List<PluginBookmarkType> getBookmarkTypes() {
	if (bookmarkTypes != null) {
		return bookmarkTypes;
	}
	bookmarkTypes = new ArrayList<>();
	IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(EXTENSION_POINT);
	if (extensionPoint == null) {
		StatusHelper.logError(MessageFormat.format("no {0} extension point", EXTENSION_POINT), null);
		return bookmarkTypes;
	}
	IExtension[] extensions = extensionPoint.getExtensions();
	for (IExtension extension : extensions) {
		IConfigurationElement[] elements = extension.getConfigurationElements();
		for (IConfigurationElement element : elements) {
			if ("bookmarkType".equals(element.getName())) {
				PluginBookmarkType bookmarkType = new PluginBookmarkType(element);
				bookmarkTypes.add(bookmarkType);
			}
		}
	}
	return bookmarkTypes;
}
 
開發者ID:cchabanois,項目名稱:mesfavoris,代碼行數:23,代碼來源:PluginBookmarkTypes.java

示例5: getBookmarkProblemDescriptors

import org.eclipse.core.runtime.IExtension; //導入方法依賴的package包/類
private synchronized Map<String, IBookmarkProblemDescriptor> getBookmarkProblemDescriptors() {
	if (bookmarkProblemDescriptors != null) {
		return bookmarkProblemDescriptors;
	}
	bookmarkProblemDescriptors = new HashMap<>();
	IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(EXTENSION_POINT);
	if (extensionPoint == null) {
		StatusHelper.logError(MessageFormat.format("no {0} extension point", EXTENSION_POINT), null);
		return bookmarkProblemDescriptors;
	}
	IExtension[] extensions = extensionPoint.getExtensions();
	for (IExtension extension : extensions) {
		IConfigurationElement[] elements = extension.getConfigurationElements();
		for (IConfigurationElement element : elements) {
			IBookmarkProblemDescriptor bookmarkProblemDescriptor = getBookmarkProblemDescriptor(element);
			if (bookmarkProblemDescriptor != null) {
				bookmarkProblemDescriptors.put(bookmarkProblemDescriptor.getProblemType(),
						bookmarkProblemDescriptor);
			}
		}
	}
	return bookmarkProblemDescriptors;
}
 
開發者ID:cchabanois,項目名稱:mesfavoris,代碼行數:24,代碼來源:BookmarkProblemDescriptors.java

示例6: loadExtensions

import org.eclipse.core.runtime.IExtension; //導入方法依賴的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

示例7: readBrandingUIDefinitions

import org.eclipse.core.runtime.IExtension; //導入方法依賴的package包/類
private static void readBrandingUIDefinitions() {
	IExtensionPoint brandingUIExtPoint = Platform.getExtensionRegistry().getExtensionPoint(POINT_ID);
	if (brandingUIExtPoint != null) {
		
		// Ensure core branding is initialized first
		CloudFoundryBrandingExtensionPoint.readBrandingDefinitions();
		
		brandingUIServerTypeIds.clear();
		for (IExtension extension : brandingUIExtPoint.getExtensions()) {
			for (IConfigurationElement config : extension.getConfigurationElements()) {
				String serverId = config.getAttribute(ATTR_SERVER_TYPE_ID);
				String name = config.getAttribute(ATTR_NAME);
				if (serverId != null && serverId.trim().length() > 0 && name != null && name.trim().length() > 0) {
					brandingUIDefinitions.put(serverId, config);
					brandingUIServerTypeIds.add(serverId);
				}
			}
		}
		read = true;
	}
}
 
開發者ID:eclipse,項目名稱:cft,代碼行數:22,代碼來源:CloudFoundryBrandingUIExtensionPoint.java

示例8: registerOverlays

import org.eclipse.core.runtime.IExtension; //導入方法依賴的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

示例9: readBrandingDefinitions

import org.eclipse.core.runtime.IExtension; //導入方法依賴的package包/類
protected static void readBrandingDefinitions() {
	IExtensionPoint brandingExtPoint = Platform.getExtensionRegistry().getExtensionPoint(POINT_ID);
	if (brandingExtPoint != null) {
		brandingServerTypeIds.clear();
		for (IExtension extension : brandingExtPoint.getExtensions()) {
			for (IConfigurationElement config : extension.getConfigurationElements()) {
				String serverId = config.getAttribute(ATTR_SERVER_TYPE_ID);
				String name = config.getAttribute(ATTR_NAME);
				if (serverId != null && serverId.trim().length() > 0 && name != null && name.trim().length() > 0) {
					// For the vendor neutral branding extension, the default / cloud urls / url provider class
					// is not needed anymore.
					brandingDefinitions.put(serverId, config);
					brandingServerTypeIds.add(serverId);
				}
			}
		}
	}
	read = true;
}
 
開發者ID:eclipse,項目名稱:cft,代碼行數:20,代碼來源:CloudFoundryBrandingExtensionPoint.java

示例10: getRAPPathFromExtensionRegistry

import org.eclipse.core.runtime.IExtension; //導入方法依賴的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

示例11: parseConnectorProviderExtension

import org.eclipse.core.runtime.IExtension; //導入方法依賴的package包/類
/**
 * Parses a single {@link IConnector} extension contribution.
 * 
 * @param extension
 *            Parses the given extension and adds its contribution to the registry
 */
private void parseConnectorProviderExtension(IExtension extension) {
	final IConfigurationElement[] configElements = extension.getConfigurationElements();
	for (IConfigurationElement elem : configElements) {
		if (CONNECTOR_TAG_EXTENSION.equals(elem.getName())) {
			try {
				final IConnector connector = (IConnector)elem.createExecutableExtension(
						CONNECTOR_ATTRIBUTE_CLASS);
				MappingUtils.getConnectorRegistry().register(connector);
			} catch (CoreException e) {
				Activator.getDefault().getLog().log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, e
						.getMessage(), e));
			}
		}
	}
}
 
開發者ID:ModelWriter,項目名稱:Source,代碼行數:22,代碼來源:IdeMappingRegistryListener.java

示例12: parseMarkerToLocationExtension

import org.eclipse.core.runtime.IExtension; //導入方法依賴的package包/類
/**
 * Parses a single {@link IMarkerToLocationDescriptor} extension contribution.
 * 
 * @param extension
 *            Parses the given extension and adds its contribution to the registry
 */
private void parseMarkerToLocationExtension(IExtension extension) {
	final IConfigurationElement[] configElements = extension.getConfigurationElements();
	for (IConfigurationElement elem : configElements) {
		if (MARKER_TO_LOCATION_TAG_EXTENSION.equals(elem.getName())) {
			try {
				final String marterType = elem.getAttribute(MARKER_TO_LOCATION_ATTRIBUTE_MARKER_TYPE);
				final IMarkerToLocationDescriptor adapter = (IMarkerToLocationDescriptor)elem
						.createExecutableExtension(MARKER_TO_LOCATION_ATTRIBUTE_CLASS);
				MarkerToLocationDescriptorAdapterFactory.register(adapter, marterType);
			} catch (CoreException e) {
				Activator.getDefault().getLog().log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, e
						.getMessage(), e));
			}
		}
	}
}
 
開發者ID:ModelWriter,項目名稱:Source,代碼行數:23,代碼來源:IdeMappingRegistryListener.java

示例13: loadExtensions

import org.eclipse.core.runtime.IExtension; //導入方法依賴的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: parseSemanticProviderExtension

import org.eclipse.core.runtime.IExtension; //導入方法依賴的package包/類
/**
 * Parses a single {@link ISemanticProvider} extension contribution.
 * 
 * @param extension
 *            Parses the given extension and adds its contribution to the registry.
 */
private void parseSemanticProviderExtension(IExtension extension) {
	final IConfigurationElement[] configElements = extension.getConfigurationElements();
	for (IConfigurationElement elem : configElements) {
		if (SEMANTIC_PROVIDER_TAG_EXTENSION.equals(elem.getName())) {
			try {
				final ISemanticProvider provider = (ISemanticProvider)elem.createExecutableExtension(
						SEMANTIC_PROVIDER_ATTRIBUTE_CLASS);
				SemanticUtils.getSemanticProviderRegistry().register(provider);
			} catch (CoreException e) {
				Activator.getDefault().getLog().log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, e
						.getMessage(), e));
			}
		}
	}
}
 
開發者ID:ModelWriter,項目名稱:Source,代碼行數:22,代碼來源:IdeSemanticRegistryListener.java

示例15: registerOverlays

import org.eclipse.core.runtime.IExtension; //導入方法依賴的package包/類
public static void registerOverlays(final Map map) {

		final IExtensionRegistry registry = RegistryFactory.getRegistry();
		final IExtensionPoint point = registry.getExtensionPoint("de.byteholder.geoclipse.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


注:本文中的org.eclipse.core.runtime.IExtension.getConfigurationElements方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。