KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > provisional > cheatsheets > TaskEditor


1 /*******************************************************************************
2  * Copyright (c) 2005, 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
12 package org.eclipse.ui.internal.provisional.cheatsheets;
13
14 import org.eclipse.swt.widgets.Composite;
15 import org.eclipse.swt.widgets.Control;
16 import org.eclipse.ui.IMemento;
17 import org.eclipse.ui.forms.widgets.FormToolkit;
18
19 /**
20  * An editor which provides the UI for a task within a composite cheat sheet.
21  * A task editor is responsible for saving the state of the task whenever
22  * it changes.
23  *
24  */

25
26 public abstract class TaskEditor {
27
28     /**
29      * Creates the widget
30      * @param parent
31      * @param toolkit
32      */

33     public abstract void createControl(Composite parent, FormToolkit toolkit);
34
35     /**
36      * @return the Control created by a previous call to CreateControl()
37      */

38     public abstract Control getControl();
39
40     /**
41      * Starts editing the provided task. The editor is responsible
42      * for saving its state. createControl() will always be called before setInput().
43      * @param task The task associated with this editor
44      * @param memento The state of this task saved from a previous invocation.
45      * The memento will be <b>null</b> if the task has not been previously started
46      * or if it is being restarted. If the editor is being restored from a previous
47      * session the memento will contain the last saved state.
48      */

49     public abstract void setInput(IEditableTask task, IMemento memento);
50
51     /**
52      * Saves the object state within a memento.
53      *
54      * @param memento a memento to receive the object state
55      */

56     public abstract void saveState(IMemento memento);
57
58 }
59
Popular Tags