本文整理汇总了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);
}
示例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);
}
示例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();
}
示例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(); }
}
示例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[] {} ) );
}
示例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);
}
}
示例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;
}
示例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);
}
}
示例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$
}
示例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);
}
}
示例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;
}
示例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);
}
}
示例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( );
}