KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > navigator > INavigatorSaveablesService


1 /*******************************************************************************
2  * Copyright (c) 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.navigator;
13
14 import org.eclipse.jface.viewers.StructuredViewer;
15 import org.eclipse.ui.ISaveablesLifecycleListener;
16 import org.eclipse.ui.ISaveablesSource;
17 import org.eclipse.ui.Saveable;
18
19 /**
20  *
21  * This interface is not intended to be implemented by clients.
22  *
23  * @since 3.2
24  *
25  */

26 public interface INavigatorSaveablesService {
27
28     /**
29      * Initializes this service. Must be called on the UI thread, and may only
30      * be called once. The given viewer's control must not be disposed.
31      * <p>
32      * The given listener will be notified of changes to the result of
33      * {@link #getSaveables()} and to the dirty state of those saveables. The
34      * given source will be used as the event source for these event
35      * notifications.
36      * </p>
37      * <p>
38      * The given viewer's selection will be used by
39      * {@link #getActiveSaveables()} to determine the active saveables. The
40      * active saveables are determined by iterating over the current selection,
41      * and for each element, walking up its parent chain until an element
42      * representing a saveable is found, or a root element is reached.
43      * </p>
44      *
45      * @param source
46      * @param viewer
47      * @param listener
48      *
49      */

50     public void init(ISaveablesSource source, StructuredViewer viewer,
51             ISaveablesLifecycleListener listener);
52
53     /**
54      * Returns the Saveable objects for which elements are contained in the
55      * tree.
56      *
57      * @return the saveables
58      */

59     public Saveable[] getSaveables();
60
61     /**
62      * Returns the active saveables based on the current selection. This method
63      * must be called on the UI thread.
64      *
65      * @return the active saveables based on the current selection
66      */

67     public Saveable[] getActiveSaveables();
68
69 }
70
Popular Tags