2 * Copyright (C) 2008 The Android Open Source Project
4 * Licensed under the Eclipse Public License, Version 1.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.eclipse.org/org/documents/epl-v10.php
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package com.android.ide.eclipse.adt.internal.editors.descriptors;
19 import com.android.ide.eclipse.adt.internal.editors.IconFactory;
20 import com.android.ide.eclipse.adt.internal.editors.uimodel.UiAbstractTextAttributeNode;
22 import org.eclipse.jface.viewers.ILabelProvider;
23 import org.eclipse.jface.viewers.ILabelProviderListener;
24 import org.eclipse.swt.graphics.Image;
27 * Label provider for {@link UiAbstractTextAttributeNode}.
29 public class AttributeDescriptorLabelProvider implements ILabelProvider {
31 private final static AttributeDescriptorLabelProvider sThis =
32 new AttributeDescriptorLabelProvider();
34 public static ILabelProvider getProvider() {
38 public Image getImage(Object element) {
39 if (element instanceof UiAbstractTextAttributeNode) {
40 UiAbstractTextAttributeNode node = (UiAbstractTextAttributeNode) element;
41 if (node.getDescriptor().isDeprecated()) {
42 String v = node.getCurrentValue();
43 if (v != null && v.length() > 0) {
44 IconFactory factory = IconFactory.getInstance();
45 return factory.getIcon("warning"); //$NON-NLS-1$
53 public String getText(Object element) {
54 if (element instanceof UiAbstractTextAttributeNode) {
55 return ((UiAbstractTextAttributeNode)element).getCurrentValue();
61 public void addListener(ILabelProviderListener listener) {
62 // TODO Auto-generated method stub
66 public void dispose() {
67 // TODO Auto-generated method stub
71 public boolean isLabelProperty(Object element, String property) {
72 // TODO Auto-generated method stub
76 public void removeListener(ILabelProviderListener listener) {
77 // TODO Auto-generated method stub