KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*******************************************************************************
2  * Copyright (c) 2003, 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 package org.eclipse.ui.navigator;
12
13 import java.util.Set JavaDoc;
14
15 import org.eclipse.jface.viewers.IStructuredSelection;
16 import org.eclipse.ui.internal.navigator.extensions.OverridePolicy;
17
18 /**
19  *
20  * The descriptor provides a handle to a content extension. Information such as
21  * the Id, the name, the priority, and whether the descriptor provides one or
22  * more root elements is provided.
23  *
24  *
25  * <p>
26  * There is one {@link INavigatorContentExtension} for each content service.
27  * There is only one {@link INavigatorContentDescriptor} for each extension.
28  * </p>
29  *
30  * <p>
31  * This interface is not intended to be implemented by clients.
32  * </p>
33  *
34  * @since 3.2
35  *
36  */

37 public interface INavigatorContentDescriptor {
38
39     /**
40      * Returns the navgiator content extension id
41      *
42      * @return the navgiator content extension id
43      */

44     String JavaDoc getId();
45
46     /**
47      * Returns the name of this navigator extension
48      *
49      * @return the name of this navigator extension
50      */

51     String JavaDoc getName();
52
53     /**
54      * Returns the priority of the navigator content extension.
55      *
56      * @return the priority of the navigator content extension. Returns 0 (zero)
57      * if no priority was specified.
58      */

59     int getPriority();
60
61     /**
62      * The enabledByDefault attribute specifies whether an extension should be
63      * activated in the context of a viewer automatically. Users may override
64      * this setting through the "Types of Content" dialog.
65      *
66      * @return true if the extension is enabled by default.
67      */

68     boolean isActiveByDefault();
69
70     /**
71      * Determine if this content extension is enabled for the given element.
72      *
73      * @param anElement
74      * The element that should be used for the evaluation.
75      * @return True if and only if the extension is enabled for the element.
76      */

77     boolean isTriggerPoint(Object JavaDoc anElement);
78
79     /**
80      * Determine if this content extension could provide the given element as a
81      * child.
82      *
83      * <p>
84      * This method is used to determine what the parent of an element could be
85      * for Link with Editor support.
86      * </p>
87      *
88      * @param anElement
89      * The element that should be used for the evaluation.
90      * @return True if and only if the extension might provide an object of this
91      * type as a child.
92      */

93     boolean isPossibleChild(Object JavaDoc anElement);
94
95     /**
96      * A convenience method to check all elements in a selection.
97      *
98      * @param aSelection
99      * A non-null selection
100      * @return True if and only if every element in the selection is a possible
101      * child.
102      */

103     boolean arePossibleChildren(IStructuredSelection aSelection);
104
105     /**
106      * @return Returns the suppressedExtensionId or null if none specified.
107      */

108     String JavaDoc getSuppressedExtensionId();
109
110     /**
111      * @return Returns the overridePolicy or null if this extension does not
112      * override another extension.
113      */

114     OverridePolicy getOverridePolicy();
115
116     /**
117      * @return The descriptor of the <code>suppressedExtensionId</code> if
118      * non-null.
119      */

120     INavigatorContentDescriptor getOverriddenDescriptor();
121
122     /**
123      *
124      * Does not force the creation of the set of overriding extensions.
125      *
126      * @return True if this extension has overridding extensions.
127      */

128     boolean hasOverridingExtensions();
129
130     /**
131      * @return The set of overridding extensions (of type
132      * {@link INavigatorContentDescriptor}
133      */

134     Set JavaDoc getOverriddingExtensions();
135
136     /**
137      * @return true if the extension's content provider may adapt to a {@link SaveablesProvider}.
138      */

139     boolean hasSaveablesProvider();
140
141 }
142
Popular Tags