KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > part > components > services > IWorkbenchPartFactory


1 /*******************************************************************************
2  * Copyright (c) 2004, 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.ui.internal.part.components.services;
12
13 import org.eclipse.swt.widgets.Composite;
14 import org.eclipse.ui.IEditorInput;
15 import org.eclipse.ui.IMemento;
16 import org.eclipse.ui.internal.components.framework.ComponentException;
17 import org.eclipse.ui.internal.components.framework.ServiceFactory;
18 import org.eclipse.ui.internal.part.Part;
19
20 /**
21  * Used to create instances of editors and views. Not intended to be implemented by clients.
22  *
23  * <p>EXPERIMENTAL: The components framework is currently under active development. All
24  * aspects of this class including its existence, name, and public interface are likely
25  * to change during the development of Eclipse 3.1</p>
26  *
27  * @since 3.1
28  */

29 public interface IWorkbenchPartFactory {
30     /**
31      * Creates an instance of a view. Returns an <code>ISite</code> for the newly created view.
32      * When the caller is done with the part it should dispose the part's main control. This can
33      * be accomplished by calling <code>ISite.getControl().dispose()</code>, or by disposing the
34      * parent composite.
35      * @param viewId ID of the view, as registered with the org.eclipse.ui.views extension point
36      * @param parentComposite parent composite for the view. If the view is successfully created, it
37      * will create exactly one new child control in this composite.
38      * @param savedState previously saved state of the part, or null if none
39      * @param context local context for the view. This object can override any or all of the view's dependencies.
40      * If the view has a dependency that isn't found in the local context, a default implementation will
41      * be supplied by the org.eclipse.core.component.types extension point.
42      *
43      * @return an ISite for the newly created view
44      * @throws ComponentException if unable to create the part
45      */

46     public Part createView(String JavaDoc viewId, Composite parentComposite, IMemento savedState, ServiceFactory context) throws ComponentException;
47     
48     /**
49      * Creates an instance of an editor. Returns an <code>ISite</code> for the newly created editor.
50      * When the caller is done with the part it should dispose the part's main control. This can
51      * be accomplished by calling <code>ISite.getControl().dispose()</code>, or by disposing the
52      * parent composite.
53      * @param editorId ID of the editor, as registered with the org.eclipse.ui.editors extension point
54      * @param parentComposite parent composite for the editor. If the editor is successfully created,
55      * it will create exactly one new child control in this composite.
56      * @param input IEditorInput for this editor
57      * @param savedState previously saved state for the part, or null if none
58      * @param context local context for the editor. This object can override any or all of the part's dependencies.
59      * If the part has a dependency that isn't found in the local context, a default implementation will
60      * be supplied by the org.eclipse.core.component.types extension point.
61      *
62      * @return an ISite for the newly created editor
63      * @throws ComponentException if unable to create the part
64      */

65     public Part createEditor(String JavaDoc editorId, Composite parentComposite, IEditorInput input, IMemento savedState, ServiceFactory context) throws ComponentException;
66 }
67
Popular Tags