KickJava   Java API By Example, From Geeks To Geeks.

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


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.jface.viewers.ISelection;
15 import org.eclipse.jface.viewers.ISelectionProvider;
16 import org.eclipse.swt.widgets.Composite;
17 import org.eclipse.swt.widgets.Control;
18 import org.eclipse.ui.forms.widgets.FormToolkit;
19
20 /**
21  * Classes that extend this class are responsible for rendering the
22  * hierarchy of tasks in the composite cheat sheet. They must support task
23  * selection via the selection provider, be able to accept focus, and create
24  * control when asked.
25  */

26
27 public abstract class TaskExplorer {
28     /**
29      * @return the id of this TaskExplorer which must match the id used in the
30      * extension point
31      */

32     public abstract String JavaDoc getId();
33
34     /**
35      * Create a control which will display the structure of the composite cheat
36      * sheet and allow tasks within the composite cheat sheet to be selected.
37      *
38      * @param parent
39      * @param toolkit
40      */

41     public abstract void createControl(Composite parent, FormToolkit toolkit);
42
43     /**
44      * Get the control created by a previous call to createControl
45      *
46      * @return the task explorer control
47      */

48     public abstract Control getControl();
49
50     /**
51      * Called when the explorer gains focus.
52      */

53     public abstract void setFocus();
54
55     /**
56      * Get the selection provider for this explorer. The selections returned by
57      * the selection provider should represent IGuideTasks.
58      *
59      * @return the selection provider for the task explorer
60      */

61     public abstract ISelectionProvider getSelectionProvider();
62
63     /**
64      * Sets the composite cheat sheet to be displayed. createControl will
65      * already have been called.
66      *
67      * @param compositeCheatSheet
68      */

69     public abstract void setCompositeCheatSheet(ICompositeCheatSheet compositeCheatSheet);
70
71     /**
72      * Called after this explorer is no longer in use. Any resources should be
73      * disposed of at this point.
74      */

75     public abstract void dispose();
76
77     /**
78      * Called when the state of a task changes and the representation of the
79      * task may need to be redrawn.
80      *
81      * @param task
82      */

83     public abstract void taskUpdated(ICompositeCheatSheetTask task);
84
85     /**
86      * Called to set the provided selection and optionally reveal it
87      * if the scroll bars are active and the selected tasks
88      * are partially or fully hidden.
89      *
90      * @param selection the new selection
91      * @param reveal if <code>true</code>, expose the task if hidden;
92      * otherwise, just select.
93      */

94     public abstract void setSelection(ISelection selection, boolean reveal);
95 }
96
Popular Tags