01: /*******************************************************************************
02: * Copyright (c) 2005, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.ui.internal.provisional.cheatsheets;
11:
12: import org.eclipse.swt.widgets.Composite;
13: import org.eclipse.swt.widgets.Control;
14: import org.eclipse.ui.IMemento;
15: import org.eclipse.ui.forms.widgets.FormToolkit;
16:
17: /**
18: * An editor which provides the UI for a task within a composite cheat sheet.
19: * A task editor is responsible for saving the state of the task whenever
20: * it changes.
21: *
22: */
23:
24: public abstract class TaskEditor {
25:
26: /**
27: * Creates the widget
28: * @param parent
29: * @param toolkit
30: */
31: public abstract void createControl(Composite parent,
32: FormToolkit toolkit);
33:
34: /**
35: * @return the Control created by a previous call to CreateControl()
36: */
37: public abstract Control getControl();
38:
39: /**
40: * Starts editing the provided task. The editor is responsible
41: * for saving its state. createControl() will always be called before setInput().
42: * @param task The task associated with this editor
43: * @param memento The state of this task saved from a previous invocation.
44: * The memento will be <b>null</b> if the task has not been previously started
45: * or if it is being restarted. If the editor is being restored from a previous
46: * session the memento will contain the last saved state.
47: */
48: public abstract void setInput(IEditableTask task, IMemento memento);
49:
50: /**
51: * Saves the object state within a memento.
52: *
53: * @param memento a memento to receive the object state
54: */
55: public abstract void saveState(IMemento memento);
56:
57: }
|