| package org.eclipse.ui; |
| |
| /* |
| * (c) Copyright IBM Corp. 2000, 2001. |
| * All Rights Reserved. |
| */ |
| import org.eclipse.core.runtime.IAdaptable; |
| |
| /** |
| * A factory for re-creating objects from a previously saved memento. |
| * <p> |
| * Clients should implement this interface and include the name of their class |
| * in an extension to the platform extension point named |
| * <code>"org.eclipse.ui.elementFactories"</code>. |
| * For example, the plug-in's XML markup might contain: |
| * <pre> |
| * <extension point="org.eclipse.ui.elementFactories"> |
| * <factory id="com.example.myplugin.MyFactory" class="com.example.myplugin.MyFactory" /> |
| * </extension> |
| * </pre> |
| * </p> |
| * |
| * @see IPersistableElement |
| * @see IMemento |
| */ |
| public interface IElementFactory { |
| /** |
| * Re-creates and returns an object from the state captured within the given |
| * memento. |
| * <p> |
| * Under normal circumstances, the resulting object can be expected to be |
| * persistable; that is, |
| * <pre> |
| * result.getAdapter(org.eclipse.ui.IPersistableElement.class) |
| * </pre> |
| * should not return <code>null</code>. |
| * </p> |
| * |
| * @param memento a memento containing the state for the object |
| * @return an object, or <code>null</code> if the element could not be created |
| */ |
| public IAdaptable createElement(IMemento memento); |
| } |