Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 1ce24bc56133324e4288328db49882072d935496 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/*******************************************************************************
 * Copyright (c) 2009, 2011 Wind River Systems and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Wind River Systems - initial API and implementation
 *******************************************************************************/
package org.eclipse.debug.internal.ui.viewers.model;

import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.IBaseLabelProvider;
import org.eclipse.jface.viewers.TreePath;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.RGB;

/**
 * {@link InternalTreeModelViewer} label provider interface.  In addition to
 * implementing this interface, the label provider for the TreeModelViewer
 * must also extend CellLabelProvider.
 *
 * @since 3.5
 */
public interface ITreeModelLabelProvider extends IBaseLabelProvider {

    /**
     * Requests an label update label of the given element.
     * @param elementPath Element to update.
     * @return true if element label provider is found and update will
     * be requested.
     */
    boolean update(TreePath elementPath);

    /**
     * Registers the specified listener for view label update notifications.
     * @param listener Listener to add
     */
    void addLabelUpdateListener(ILabelUpdateListener listener);

    /**
     * Removes the specified listener from view label update notifications.
     * @param listener Listener to remove
     */
    void removeLabelUpdateListener(ILabelUpdateListener listener);

    /**
     * Returns an image for the given image descriptor or <code>null</code>. Adds the image
     * to a cache of images if it does not already exist.
     *
     * @param descriptor image descriptor or <code>null</code>
     * @return image or <code>null</code>
     */
    Image getImage(ImageDescriptor descriptor);

    /**
     * Returns a font for the given font data or <code>null</code>. Adds the font to the font
     * cache if not yet created.
     *
     * @param fontData font data or <code>null</code>
     * @return font font or <code>null</code>
     */
    Font getFont(FontData fontData);

    /**
     * Returns a color for the given RGB or <code>null</code>. Adds the color to the color
     * cache if not yet created.
     *
     * @param rgb RGB or <code>null</code>
     * @return color or <code>null</code>
     */
    Color getColor(RGB rgb);
}

Back to the top