KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > ui > viewsupport > BindingLabels


1 /*******************************************************************************
2  * Copyright (c) 2000, 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
12 package org.eclipse.jdt.internal.ui.viewsupport;
13
14 import org.eclipse.jdt.core.IJavaElement;
15 import org.eclipse.jdt.core.dom.IBinding;
16
17 import org.eclipse.jdt.internal.corext.dom.Bindings;
18
19 import org.eclipse.jdt.ui.JavaElementLabels;
20
21 import org.eclipse.jdt.internal.ui.JavaPlugin;
22
23 public class BindingLabels {
24
25     /** deprecated Use BindingLabelProvider.getBindingLabel(binding, JavaElementLabels.ALL_FULLY_QUALIFIED) instead */
26     public static String JavaDoc getFullyQualified(IBinding binding) {
27         IJavaElement javaElement;
28         try {
29             javaElement= binding.getJavaElement();
30         } catch (IllegalArgumentException JavaDoc e) {
31             // TODO: see bug 78087
32
JavaPlugin.log(e);
33             javaElement= null;
34         }
35         if (javaElement != null)
36             return JavaElementLabels.getElementLabel(javaElement, JavaElementLabels.ALL_FULLY_QUALIFIED | JavaElementLabels.ALL_DEFAULT);
37         else
38             return Bindings.asString(binding); //fallback: better than nothing
39
}
40
41 }
42
Popular Tags