KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > intro > config > IStandbyContentPart


1 /*******************************************************************************
2  * Copyright (c) 2004, 2006 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.intro.config;
12
13 import org.eclipse.swt.widgets.Composite;
14 import org.eclipse.swt.widgets.Control;
15 import org.eclipse.ui.IMemento;
16 import org.eclipse.ui.PartInitException;
17 import org.eclipse.ui.forms.widgets.FormToolkit;
18 import org.eclipse.ui.intro.IIntroPart;
19
20 /**
21  * An Intro standby part. It is a UI component that represents some standby
22  * content. Standby parts can be contributed to the Eclipse intro using the
23  * following extension point:
24  * <p>
25  * <pre>
26  * &lt;extension point=&quot;org.eclipse.ui.intro.configExtension&quot;&gt;
27  * &lt;standbyPart
28  * pluginId=&quot;com.x.y.somePluginId&quot;
29  * class=&quot;com.x.y.someClass&quot;
30  * id=&quot;com.x.y.someContentPartId&quot;&gt;
31  * &lt;/standbyPart&gt;
32  * &lt;/extension&gt;
33  * </pre>
34  *
35  * </p>
36  * Standby content parts have a life cycle that starts with a call to init,
37  * shortly after part construction, followed by a call to createPartControl.
38  * During these two calls, the part is responsible for creating its content and
39  * using the memento to try to recreate its previous state. SetInput is the last
40  * method called when trying to create a standby part.
41  *
42  * @since 3.0
43  */

44 public interface IStandbyContentPart {
45
46     /**
47      * Creates the SWT controls for this standby part.
48      * <p>
49      * Clients should not call this method. The intro framework calls this
50      * method when it needs to.
51      *
52      * @param parent
53      * the parent control
54      * @param toolkit
55      * the form toolkit being used by the IIntroPart implementation
56      */

57     public void createPartControl(Composite parent, FormToolkit toolkit);
58
59     /**
60      * Returns the primary control associated with this standby part. The
61      * control is typically set during the createPartControl() call when this
62      * part is being created.
63      *
64      * @return the SWT control which displays this standby part's content, or
65      * <code>null</code> if this standby part's controls have not yet
66      * been created.
67      */

68     public Control getControl();
69
70     /**
71      * Initializes this intro standby content part with the given intro site. A
72      * memento is passed to the part which contains a snapshot of the part state
73      * from a previous session. Where possible, the part should try to recreate
74      * that state.
75      * <p>
76      * This method is automatically called by the workbench shortly after part
77      * construction. It marks the start of this parts' lifecycle. Clients must
78      * not call this method.
79      * </p>
80      *
81      * @param introPart
82      * the intro part hosting this stanndby content part.
83      * @param memento
84      * this part state or <code>null</code> if there is no previous
85      * saved state
86      * @exception PartInitException
87      * if this part was not initialized successfully.
88      */

89     public void init(IIntroPart introPart, IMemento memento)
90             throws PartInitException;
91
92     /**
93      * Sets the input to show in this standby part. Note that input can be null,
94      * such as when the part if created through an Intro URL that does not have
95      * an input specified, or when this standby part is being recreated from a
96      * previous workbench session. In this case, the standby part is responsible
97      * for handling a null input, and recreating itself from a cached IMemento.
98      *
99      * @param input
100      * the input object to be used by this standby part.
101      */

102     public void setInput(Object JavaDoc input);
103
104     /**
105      * Asks this standby part to take focus.
106      * <p>
107      * Clients should not call this method (the intro framework calls this
108      * method at appropriate times).
109      * </p>
110      */

111     public void setFocus();
112
113     /**
114      * Disposes of this standby part.
115      * <p>
116      * Clients should not call this method. The intro framework calls this
117      * method when the Customizable IntroPart is closed.
118      * </p>
119      */

120     public void dispose();
121
122     /**
123      * Saves the object state within a memento.
124      * <p>
125      * This method is automatically called by the workbench at appropriate
126      * times. Clients must not call this method directly.
127      * </p>
128      *
129      * @param memento
130      * a memento to receive the object state
131      */

132     public void saveState(IMemento memento);
133
134 }
135
Popular Tags