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


Java InvalidRegistryObjectException类代码示例

本文整理汇总了Java中org.eclipse.core.runtime.InvalidRegistryObjectException的典型用法代码示例。如果您正苦于以下问题:Java InvalidRegistryObjectException类的具体用法?Java InvalidRegistryObjectException怎么用?Java InvalidRegistryObjectException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: ProposalSorterHandle

import org.eclipse.core.runtime.InvalidRegistryObjectException; //导入依赖的package包/类
/**
 * Creates a new descriptor.
 *
 * @param element the configuration element to read
 * @throws InvalidRegistryObjectException if the configuration element is not valid any longer
 * @throws org.eclipse.core.runtime.CoreException if the configuration does not contain mandatory
 *     attributes
 */
ProposalSorterHandle(IConfigurationElement element)
    throws InvalidRegistryObjectException, CoreException {
  Assert.isLegal(element != null);

  fElement = element;
  fId = element.getAttribute(ID);
  checkNotNull(fId, ID);

  String name = element.getAttribute(NAME);
  if (name == null) fName = fId;
  else fName = name;

  fClass = element.getAttribute(CLASS);
  checkNotNull(fClass, CLASS);
}
 
开发者ID:eclipse,项目名称:che,代码行数:24,代码来源:ProposalSorterHandle.java

示例2: ProposalSorterHandle

import org.eclipse.core.runtime.InvalidRegistryObjectException; //导入依赖的package包/类
/**
 * Creates a new descriptor.
 *
 * @param element the configuration element to read
 * @throws InvalidRegistryObjectException if the configuration element is not valid any longer
 * @throws CoreException if the configuration does not contain mandatory attributes
 */
ProposalSorterHandle(IConfigurationElement element) throws InvalidRegistryObjectException, CoreException {
	Assert.isLegal(element != null);

	fElement= element;
	fId= element.getAttribute(ID);
	checkNotNull(fId, ID);

	String name= element.getAttribute(NAME);
	if (name == null)
		fName= fId;
	else
		fName= name;

	fClass= element.getAttribute(CLASS);
	checkNotNull(fClass, CLASS);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:24,代码来源:ProposalSorterHandle.java

示例3: listeners

import org.eclipse.core.runtime.InvalidRegistryObjectException; //导入依赖的package包/类
private Collection<LifecycleListener> listeners() {
    final Collection<LifecycleListener> existingListeners = listeners.get();
    if (existingListeners != null) {
        return existingListeners;
    }
    final Collection<LifecycleListener> newLifecycleListeners = new ArrayList<>();
    for (final IConfigurationElement lifecycleListenerElement : Platform.getExtensionRegistry()
            .getConfigurationElementsFor(LIFECYCLE_LISTENER_EXTENSION_ID)) {
        final Bundle extensionBundle = Platform.getBundle(lifecycleListenerElement.getDeclaringExtension()
                .getNamespaceIdentifier());
        try {
            newLifecycleListeners.add((LifecycleListener) extensionBundle.loadClass(
                    lifecycleListenerElement.getAttribute(CLASS_ATTRIBUTE)).newInstance());
        } catch (ClassNotFoundException | InvalidRegistryObjectException | InstantiationException
                | IllegalAccessException e) {
            Activator.INSTANCE.log(e);
        }
    }
    if (listeners.compareAndSet(null, newLifecycleListeners)) {
        return newLifecycleListeners;
    }
    return listeners.get();
}
 
开发者ID:info-sharing-environment,项目名称:NIEM-Modeling-Tool,代码行数:24,代码来源:NIEMModelLifecycleRegistry.java

示例4: TriggerDescriptor

import org.eclipse.core.runtime.InvalidRegistryObjectException; //导入依赖的package包/类
TriggerDescriptor(IConfigurationElement conf)
{
	Bundle plugin = Platform.getBundle(conf.getContributor().getName());
	
	this.name = conf.getAttribute("name");
	this.description = conf.getAttribute("description");
	try
	{
		this.triggerClass = plugin.loadClass(conf.getAttribute("class"));
		this.editorClass = plugin.loadClass(conf.getAttribute("editorClass"));
	}
	catch (ClassNotFoundException | InvalidRegistryObjectException e1)
	{
		e1.printStackTrace();
	}
	
	String imagePath = conf.getAttribute("image");
	if (imagePath != null) try 
	{
		this.image = new Image(Display.getDefault(), FileLocator.resolve(plugin.getEntry(imagePath)).getPath());
	} 
	catch(Exception e) { e.printStackTrace(); }
}
 
开发者ID:TheWhiteShadow3,项目名称:cuina,代码行数:24,代码来源:TriggerDescriptor.java

示例5: convertCommand

import org.eclipse.core.runtime.InvalidRegistryObjectException; //导入依赖的package包/类
private static ParameterizedCommand convertCommand ( final IConfigurationElement commandElement ) throws NotDefinedException, InvalidRegistryObjectException
{
    final ICommandService commandService = (ICommandService)PlatformUI.getWorkbench ().getService ( ICommandService.class );
    final Command command = commandService.getCommand ( commandElement.getAttribute ( "id" ) ); //$NON-NLS-1$
    final List<Parameterization> parameters = new ArrayList<Parameterization> ();
    for ( final IConfigurationElement parameter : commandElement.getChildren ( "parameter" ) ) //$NON-NLS-1$
    {
        final IParameter name = command.getParameter ( parameter.getAttribute ( "name" ) ); //$NON-NLS-1$
        final String value = parameter.getAttribute ( "value" ); //$NON-NLS-1$
        parameters.add ( new Parameterization ( name, value ) );
    }
    return new ParameterizedCommand ( command, parameters.toArray ( new Parameterization[] {} ) );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:14,代码来源:ConfigurationHelper.java

示例6: create

import org.eclipse.core.runtime.InvalidRegistryObjectException; //导入依赖的package包/类
static Library create(IConfigurationElement configurationElement) throws LibraryFactoryException {
  try {
    if (ELEMENT_NAME_LIBRARY.equals(configurationElement.getName())) {
      Library library = new Library(configurationElement.getAttribute(ATTRIBUTE_NAME_ID));
      library.setName(configurationElement.getAttribute(ATTRIBUTE_NAME_NAME));
      library.setSiteUri(new URI(configurationElement.getAttribute(ATTRIBUTE_NAME_SITE_URI)));
      library.setGroup(configurationElement.getAttribute(ATTRIBUTE_NAME_GROUP));
      library.setToolTip(configurationElement.getAttribute(ATTRIBUTE_NAME_TOOLTIP));
      library.setLibraryDependencies(getLibraryDependencies(
          configurationElement.getChildren(ELEMENT_NAME_LIBRARY_DEPENDENCY)));
      library.setLibraryFiles(
          getLibraryFiles(configurationElement.getChildren(ELEMENT_NAME_LIBRARY_FILE)));
      String exportString = configurationElement.getAttribute(ATTRIBUTE_NAME_EXPORT);
      if (exportString != null) {
        library.setExport(Boolean.parseBoolean(exportString));
      }
      String dependencies = configurationElement.getAttribute("dependencies"); //$NON-NLS-1$
      if (!"include".equals(dependencies)) { //$NON-NLS-1$
        library.setResolved();
      }
      String versionString = configurationElement.getAttribute("javaVersion"); //$NON-NLS-1$
      if (versionString != null) {
        library.setJavaVersion(versionString);
      }
      return library;
    } else {
      throw new LibraryFactoryException(
          Messages.getString("UnexpectedConfigurationElement",
              configurationElement.getName(), ELEMENT_NAME_LIBRARY));
    }
  } catch (InvalidRegistryObjectException | URISyntaxException | IllegalArgumentException ex) {
    throw new LibraryFactoryException(Messages.getString("CreateLibraryError"), ex);
  }
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:35,代码来源:LibraryFactory.java

示例7: getLibraryFiles

import org.eclipse.core.runtime.InvalidRegistryObjectException; //导入依赖的package包/类
private static List<LibraryFile> getLibraryFiles(IConfigurationElement[] children)
    throws InvalidRegistryObjectException, URISyntaxException {
  List<LibraryFile> libraryFiles = new ArrayList<>();
  for (IConfigurationElement libraryFileElement : children) {
    if (ELEMENT_NAME_LIBRARY_FILE.equals(libraryFileElement.getName())) {
      MavenCoordinates mavenCoordinates = getMavenCoordinates(
          libraryFileElement.getChildren(ELEMENT_NAME_MAVEN_COORDINATES));
      LibraryFile libraryFile = loadSingleFile(libraryFileElement, mavenCoordinates);
      libraryFile.updateVersion();
      libraryFiles.add(libraryFile);
    }
  }
  return libraryFiles;
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:15,代码来源:LibraryFactory.java

示例8: checkNotNull

import org.eclipse.core.runtime.InvalidRegistryObjectException; //导入依赖的package包/类
/**
 * Checks that the given attribute value is not <code>null</code>.
 *
 * @param value the value to check if not null
 * @param attribute the attribute
 * @throws InvalidRegistryObjectException if the registry element is no longer valid
 * @throws org.eclipse.core.runtime.CoreException if <code>value</code> is <code>null</code>
 */
private void checkNotNull(Object value, String attribute)
    throws InvalidRegistryObjectException, CoreException {
  if (value == null) {
    Object[] args = {getId(), fElement.getContributor().getName(), attribute};
    String message =
        Messages.format(
            JavaTextMessages.CompletionProposalComputerDescriptor_illegal_attribute_message,
            args);
    IStatus status =
        new Status(IStatus.WARNING, JavaPlugin.getPluginId(), IStatus.OK, message, null);
    throw new CoreException(status);
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:22,代码来源:ProposalSorterHandle.java

示例9: createExceptionStatus

import org.eclipse.core.runtime.InvalidRegistryObjectException; //导入依赖的package包/类
Status createExceptionStatus(InvalidRegistryObjectException x) {
  // extension has become invalid - log & disable
  String disable = createBlameMessage();
  String reason = JavaTextMessages.CompletionProposalComputerDescriptor_reason_invalid;
  return new Status(
      IStatus.INFO,
      JavaPlugin.getPluginId(),
      IStatus.OK,
      disable + " " + reason,
      x); // $NON-NLS-1$
}
 
开发者ID:eclipse,项目名称:che,代码行数:12,代码来源:ProposalSorterHandle.java

示例10: readElement

import org.eclipse.core.runtime.InvalidRegistryObjectException; //导入依赖的package包/类
protected void readElement(IConfigurationElement element) {
	try {
		declaringExtensionId = element.getDeclaringExtension()
				.getNamespace();
	} catch (InvalidRegistryObjectException e) {
		Logger.logException(e);
	}

	if (TAG_CONTRIBUTION.equals(element.getName())) {
		IConfigurationElement[] mappingInfoElementList = element
				.getChildren(SchemaStoreCatalogConstants.TAG_SCHEMA);
		processMappingInfoElements(mappingInfoElementList);
	}

}
 
开发者ID:angelozerr,项目名称:eclipse-wtp-json,代码行数:16,代码来源:CatalogContributorRegistryReader.java

示例11: getHawkFactoryInstances

import org.eclipse.core.runtime.InvalidRegistryObjectException; //导入依赖的package包/类
public Map<String, IHawkFactory> getHawkFactoryInstances() {
	final Map<String, IHawkFactory> ids = new HashMap<>();
	for (IConfigurationElement elem : getHawkFactories()) {
		try {
			ids.put(elem.getAttribute(HAWKFACTORY_CLASS_ATTRIBUTE),
					(IHawkFactory) elem
							.createExecutableExtension(HAWKFACTORY_CLASS_ATTRIBUTE));
		} catch (InvalidRegistryObjectException | CoreException e) {
			// print error and skip this element
			e.printStackTrace();
		}
	}
	return ids;
}
 
开发者ID:mondo-project,项目名称:mondo-hawk,代码行数:15,代码来源:HManager.java

示例12: checkNotNull

import org.eclipse.core.runtime.InvalidRegistryObjectException; //导入依赖的package包/类
/**
 * Checks that the given attribute value is not <code>null</code>.
 *
 * @param value the object to check if not null
 * @param attribute the attribute
 * @throws InvalidRegistryObjectException if the registry element is no longer valid
 * @throws CoreException if <code>value</code> is <code>null</code>
 */
private void checkNotNull(Object value, String attribute) throws InvalidRegistryObjectException, CoreException {
	if (value == null) {
		Object[] args= { getId(), fElement.getContributor().getName(), attribute };
		String message= Messages.format(JavaTextMessages.CompletionProposalComputerDescriptor_illegal_attribute_message, args);
		IStatus status= new Status(IStatus.WARNING, JavaPlugin.getPluginId(), IStatus.OK, message, null);
		throw new CoreException(status);
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:17,代码来源:CompletionProposalComputerDescriptor.java

示例13: getContributor

import org.eclipse.core.runtime.InvalidRegistryObjectException; //导入依赖的package包/类
/**
* Returns the contributor of the described extension.
*
* @return the contributor of the described extension
*/
  IContributor getContributor()  {
      try {
       return fElement.getContributor();
      } catch (InvalidRegistryObjectException e) {
      	return null;
      }
  }
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:13,代码来源:CompletionProposalComputerDescriptor.java

示例14: checkNotNull

import org.eclipse.core.runtime.InvalidRegistryObjectException; //导入依赖的package包/类
/**
 * Checks that the given attribute value is not <code>null</code>.
 *
 * @param value the value to check if not null
 * @param attribute the attribute
 * @throws InvalidRegistryObjectException if the registry element is no longer valid
 * @throws CoreException if <code>value</code> is <code>null</code>
 */
private void checkNotNull(Object value, String attribute) throws InvalidRegistryObjectException, CoreException {
	if (value == null) {
		Object[] args= { getId(), fElement.getContributor().getName(), attribute };
		String message= Messages.format(JavaTextMessages.CompletionProposalComputerDescriptor_illegal_attribute_message, args);
		IStatus status= new Status(IStatus.WARNING, JavaPlugin.getPluginId(), IStatus.OK, message, null);
		throw new CoreException(status);
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:17,代码来源:ProposalSorterHandle.java

示例15: getContributor

import org.eclipse.core.runtime.InvalidRegistryObjectException; //导入依赖的package包/类
public IContributor getContributor( ) throws InvalidRegistryObjectException
{
       if( bundle == null )
       {
           IExtension declaringExtn = getDeclaringExtension();
           if( declaringExtn != null )
               return declaringExtn.getContributor();
           return null;
       }
       
	return bundle.getContributor( );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:13,代码来源:ConfigurationElement.java


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