01: /*
02: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
03: *
04: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
05: *
06: * The contents of this file are subject to the terms of either the GNU
07: * General Public License Version 2 only ("GPL") or the Common
08: * Development and Distribution License("CDDL") (collectively, the
09: * "License"). You may not use this file except in compliance with the
10: * License. You can obtain a copy of the License at
11: * http://www.netbeans.org/cddl-gplv2.html
12: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
13: * specific language governing permissions and limitations under the
14: * License. When distributing the software, include this License Header
15: * Notice in each file and include the License file at
16: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
17: * particular file as subject to the "Classpath" exception as provided
18: * by Sun in the GPL Version 2 section of the License file that
19: * accompanied this code. If applicable, add the following below the
20: * License Header, with the fields enclosed by brackets [] replaced by
21: * your own identifying information:
22: * "Portions Copyrighted [year] [name of copyright owner]"
23: *
24: * Contributor(s):
25: *
26: * Portions Copyrighted 2007 Sun Microsystems, Inc.
27: */
28: package org.netbeans.modules.cnd.gotodeclaration.element.spi;
29:
30: import javax.swing.Icon;
31:
32: /**
33: * Describes one element in the search list of "Go to Funcion or Variable" dialog
34: * @author Vladimir Kvashi
35: */
36: public interface ElementDescriptor {
37:
38: /**
39: * Gets the name of the element as such
40: * @return element name
41: */
42: String getDisplayName();
43:
44: /**
45: * Gets an additional context for the element name.
46: * This would typically be the fully qualified name, minus the name part.
47: * Return null if there is no applicable context.
48: *
49: * @return the name of the context of the type,
50: * such as the fully qualified name minus the name part
51: */
52: String getContextName();
53:
54: /**
55: * Gets an icon that should be shown for this element.
56: * The icon should give a visual indication of the type of element
57: * (e.g. function or variable or macro)
58: * @return An Icon to be shown on the left hand side
59: */
60: Icon getIcon();
61:
62: /**
63: * Gets the name of the project that contains the given element.
64: * @return the name of the project that contains the given element.
65: */
66: String getProjectName();
67:
68: /**
69: * Gets the icon that represents the project that contains the given element.
70: * @return project icon or null if there are no project associated with element
71: */
72: Icon getProjectIcon();
73:
74: /**
75: * Gets the absolute path to the file that contains the element.
76: * @return the absolute path to the file that contains the element.
77: */
78: String getAbsoluteFileName();
79:
80: /**
81: * Opens the element in editor
82: */
83: void open();
84: }
|