diff options
Diffstat (limited to 'plugins/org.eclipse.jem.beaninfo/beaninfo/org/eclipse/jem/internal/beaninfo/core/Init.java')
-rw-r--r-- | plugins/org.eclipse.jem.beaninfo/beaninfo/org/eclipse/jem/internal/beaninfo/core/Init.java | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/plugins/org.eclipse.jem.beaninfo/beaninfo/org/eclipse/jem/internal/beaninfo/core/Init.java b/plugins/org.eclipse.jem.beaninfo/beaninfo/org/eclipse/jem/internal/beaninfo/core/Init.java deleted file mode 100644 index ceefae9cc..000000000 --- a/plugins/org.eclipse.jem.beaninfo/beaninfo/org/eclipse/jem/internal/beaninfo/core/Init.java +++ /dev/null @@ -1,67 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jem.internal.beaninfo.core; -/* - - - */ -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.eclipse.emf.ecore.util.EcoreUtil; - -import org.eclipse.jem.internal.beaninfo.adapters.BeaninfoAdapterFactory; -import org.eclipse.jem.internal.java.beaninfo.IIntrospectionAdapter; -import org.eclipse.jem.internal.proxy.core.ProxyFactoryRegistry; - -/** - * Static initializer class to initialize the beaninfo stuff. - * It is disconnected from the desktop and so doesn't require it. - */ - -public class Init { - - // So it can't be instantiated. - private Init() { - }; - - /** - * Initialize the context with an IBeaninfoSupplier, used to set up the - * introspection process. - * - * The beaninfo supplier is responsible for setting up the bean info search path, - * including removing the sun beaninfos, if desired. - */ - public static void initialize(ResourceSet rset, final IBeaninfoSupplier supplier) { - rset.getAdapterFactories().add(new BeaninfoAdapterFactory(supplier)); - } - - /** - * Initialize the registry now that it is available. - */ - public static void initialize(ProxyFactoryRegistry registry) { - // Remove the "sun.beans.info" from the beaninfo search path because - // we completely override the sun bean infos. - Utilities.removeBeanInfoPath(registry, "sun.beans.infos"); //$NON-NLS-1$ - } - - /** - * Cleanup from the context because we are being removed. - * If clearResults is true, then the factory should clear the results of introspection - * from the everything because the context will still be around. - */ - public static void cleanup(ResourceSet rset, boolean clearResults) { - BeaninfoAdapterFactory factory = - (BeaninfoAdapterFactory) EcoreUtil.getAdapterFactory(rset.getAdapterFactories(), IIntrospectionAdapter.ADAPTER_KEY); - rset.getAdapterFactories().remove(factory); - if (factory != null) - factory.closeAll(clearResults); - } - -} |