KickJava   Java API By Example, From Geeks To Geeks.

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


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 java.util.Map JavaDoc;
15
16 import org.eclipse.jface.viewers.ViewerSorter;
17
18 /**
19  *
20  * Provides an interface to extensions declared in
21  * <b>org.eclipse.ui.navigator.navigatorContent/commonSorter</b>.
22  *
23  * <p>
24  * Like other extensions to the Common Navigator framework, sorters defined by
25  * the above extension point must be bound to the associated
26  * {@link INavigatorContentService} through a
27  * <b>org.eclipse.ui.navigator.viewer/viewerContentBinding</b> extension.
28  * </p>
29  *
30  * <p>
31  * This interface is not intended to be implemented by clients.
32  * </p>
33  *
34  * @see INavigatorContentService#getSorterService()
35  * @see ViewerSorter
36  * @since 3.2
37  */

38 public interface INavigatorSorterService {
39
40     /**
41      * Return a {@link ViewerSorter} from an extension which is visible to the
42      * associated {@link INavigatorContentService} and whose <b>parentExpression</b>
43      * matches the given parent.
44      *
45      * @param aParent
46      * An element from the tree
47      * @return An applicable ViewerSorter or simple {@link ViewerSorter} if no
48      * sorter is found.
49      */

50     ViewerSorter findSorterForParent(Object JavaDoc aParent);
51
52     /**
53      * Return a {@link ViewerSorter} from an extension which is visible to the
54      * associated {@link INavigatorContentService} and whose <b>parentExpression</b>
55      * matches the given parent.
56      *
57      * @param source
58      * The source of the element.
59      * @param parent
60      * An element from the tree
61      * @param lvalue
62      * An element from the tree
63      * @param rvalue
64      * An element from the tree
65      * @return An applicable ViewerSorter or simple {@link ViewerSorter} if no
66      * sorter is found.
67      */

68     ViewerSorter findSorter(INavigatorContentDescriptor source, Object JavaDoc parent,
69             Object JavaDoc lvalue, Object JavaDoc rvalue);
70
71     /**
72      * Find and return all viewer sorters associated with the given descriptor.
73      *
74      * <p>
75      * The <i>commonSorter</i> element is not required to have an id, so in
76      * some cases, an auto-generated id, using the content extension id as a
77      * base, is generated to ensure the map is properly filled with all
78      * available sorters. No guarantees are given as to the order or consistency
79      * of these generated ids between invocations.
80      * </p>
81      *
82      * @param theSource
83      * A descriptor that identifies a particular content extension
84      * @return A Map[String sorterDescriptorId, ViewerSorter instance] where the
85      * key is the id defined in the extension and the value is the
86      * instantiated sorter.
87      *
88      * @see INavigatorContentService#getContentDescriptorById(String)
89      * @see INavigatorContentService#getContentExtensionById(String)
90      * @see INavigatorContentExtension#getDescriptor()
91      * @since 3.3
92      */

93     public Map JavaDoc findAvailableSorters(INavigatorContentDescriptor theSource);
94
95 }
96
Popular Tags