KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > core > runtime > preferences > IPreferenceNodeVisitor


1 /*******************************************************************************
2  * Copyright (c) 2004, 2005 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.core.runtime.preferences;
12
13 import org.osgi.service.prefs.BackingStoreException;
14
15 /**
16  * This interface is implemented by objects that visit preference nodes.
17  * <p>
18  * Usage:
19  * <pre>
20  * class Visitor implements IPreferenceNodeVisitor {
21  * public boolean visit(IEclipsePreferences node) {
22  * // your code here
23  * return true;
24  * }
25  * }
26  * IEclipsePreferences root = ...;
27  * root.accept(new Visitor());
28  * </pre>
29  * </p><p>
30  * Clients may implement this interface.
31  * </p>
32  *
33  * @see IEclipsePreferences#accept(IPreferenceNodeVisitor)
34  * @since 3.0
35  */

36 public interface IPreferenceNodeVisitor {
37
38     /**
39      * Visits the given preference node.
40      *
41      * @param node the node to visit
42      * @return <code>true</code> if the node's children should
43      * be visited; <code>false</code> if they should be skipped
44      * @throws BackingStoreException
45      */

46     public boolean visit(IEclipsePreferences node) throws BackingStoreException;
47 }
48
Popular Tags