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


Java IExtensionPoint類代碼示例

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


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

示例1: retrieveLocators

import org.eclipse.core.runtime.IExtensionPoint; //導入依賴的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.IExtensionPoint; //導入依賴的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.IExtensionPoint; //導入依賴的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.IExtensionPoint; //導入依賴的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: loadUIValidator

import org.eclipse.core.runtime.IExtensionPoint; //導入依賴的package包/類
private IFileModificationValidator loadUIValidator() {
      IExtensionPoint extension = Platform.getExtensionRegistry().getExtensionPoint(ID, DEFAULT_FILE_MODIFICATION_VALIDATOR_EXTENSION);
if (extension != null) {
	IExtension[] extensions =  extension.getExtensions();
	if (extensions.length > 0) {
		IConfigurationElement[] configElements = extensions[0].getConfigurationElements();
		if (configElements.length > 0) {
			try {
                      Object o = configElements[0].createExecutableExtension("class"); //$NON-NLS-1$
                      if (o instanceof IFileModificationValidator) {
                          return (IFileModificationValidator)o;
                      }
                  } catch (CoreException e) {
                      SVNProviderPlugin.log(e.getStatus().getSeverity(), e.getMessage(), e);
                  }
		}
	}
}
return null;
  }
 
開發者ID:subclipse,項目名稱:subclipse,代碼行數:21,代碼來源:SVNFileModificationValidator.java

示例6: testValidExtensionPoints

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

示例7: loadExtensions

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

示例8: getBookmarkTypes

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

示例9: getBookmarkProblemDescriptors

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

示例10: loadExtensions

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

示例11: getExtensions

import org.eclipse.core.runtime.IExtensionPoint; //導入依賴的package包/類
/**
 * Returns proxies for all registered extensions; does not cause the extension plug-ins to be loaded.
 * The proxies contain -- and can therefore be queried for -- all the XML attribute values that the
 * extensions provide in their <i>plugin.xml</i> file. Throws IllegalArgumentException
 * if extension point is unknown
 *
 * @return array of proxies
 */
public static ValidExtension[] getExtensions() {
  IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(PLUGIN_ID, EXTENSION_POINT_NAME);
  if (point == null) {
    throw new IllegalArgumentException(MessageFormat.format(UNKNOWN_EXTENSION_POINT, PLUGIN_ID, EXTENSION_POINT_NAME));
  }
  IExtension[] extensions = point.getExtensions();
  List<ValidExtension> found = new ArrayList<ValidExtension>();
  for (IExtension e : extensions) {
    ValidExtension obj = ValidExtension.parseExtension(e);
    if (obj != null) {
      found.add(obj);
    }
  }
  return found.toArray(new ValidExtension[found.size()]);
}
 
開發者ID:dsldevkit,項目名稱:dsl-devkit,代碼行數:24,代碼來源:ValidExtensionPointManager.java

示例12: createArchiver

import org.eclipse.core.runtime.IExtensionPoint; //導入依賴的package包/類
public ICloudFoundryArchiver createArchiver(CloudFoundryApplicationModule appModule, CloudFoundryServer cloudServer)
		throws CoreException {
	final String ARCHIVER_DELEGATE = "org.eclipse.cft.server.standalone.core.archiverDelegate"; //$NON-NLS-1$
	final String ARCHIVER_ELEMENT = "archiver"; //$NON-NLS-1$
	final String CLASS_ATTR = "class"; //$NON-NLS-1$

	// At present it just picks the first archiver extension

	IExtensionPoint archiverExtnPoint = Platform.getExtensionRegistry().getExtensionPoint(ARCHIVER_DELEGATE);
	if (archiverExtnPoint != null) {
		for (IExtension extension : archiverExtnPoint.getExtensions()) {
			for (IConfigurationElement config : extension.getConfigurationElements()) {
				if (ARCHIVER_ELEMENT.equals(config.getName())) {
					ICloudFoundryArchiver archiver = (ICloudFoundryArchiver) config
							.createExecutableExtension(CLASS_ATTR);
					return archiver;
				}
			}
		}
	}

	throw CloudErrorUtil.toCoreException("Could not locate archivers"); //$NON-NLS-1$
}
 
開發者ID:eclipse,項目名稱:cft,代碼行數:24,代碼來源:CloudFoundryArchiverRegistry.java

示例13: readBrandingUIDefinitions

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

示例14: readBrandingDefinitions

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

示例15: readBrandingDefinitions

import org.eclipse.core.runtime.IExtensionPoint; //導入依賴的package包/類
private 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) {
					brandingDefinitions.put(serverId, config);
					brandingServerTypeIds.add(serverId);
					/*IConfigurationElement[] urls = config.getChildren(ELEM_DEFAULT_URL);
					if (urls != null && urls.length > 0) {
						
					}*/
				}
			}
		}
	}

	read = true;
}
 
開發者ID:osswangxining,項目名稱:dockerfoundry,代碼行數:23,代碼來源:DockerFoundryBrandingExtensionPoint.java


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