1 /*******************************************************************************
\r
2 * Copyright (c) 2007, 2010 Association for Decentralized Information Management
\r
3 * in Industry THTH ry.
\r
4 * All rights reserved. This program and the accompanying materials
\r
5 * are made available under the terms of the Eclipse Public License v1.0
\r
6 * which accompanies this distribution, and is available at
\r
7 * http://www.eclipse.org/legal/epl-v10.html
\r
10 * VTT Technical Research Centre of Finland - initial API and implementation
\r
11 *******************************************************************************/
\r
12 package org.simantics.g2d.gallery;
\r
14 import org.eclipse.jface.viewers.IBaseLabelProvider;
\r
15 import org.eclipse.swt.SWT;
\r
16 import org.eclipse.swt.graphics.Color;
\r
17 import org.simantics.g2d.image.Image;
\r
19 public interface ILabelProvider extends IBaseLabelProvider {
\r
21 * Returns the image for the label of the given element. The image
\r
22 * is owned by the label provider and must not be disposed directly.
\r
23 * Instead, dispose the label provider when no longer needed.
\r
25 * @param element the element for which to provide the label image
\r
26 * @return the image used to label the element, or <code>null</code>
\r
27 * if there is no image for the given object
\r
29 public Image getImage(Object element);
\r
32 * Returns the text for the label of the given element.
\r
34 * @param element the element for which to provide the label text
\r
35 * @return the text string used to label the element, or <code>null</code>
\r
36 * if there is no text label for the given object
\r
38 public String getText(Object element);
\r
41 * Get the image displayed in the tool tip for object.
\r
44 * <b>If {@link #getToolTipText(Object)} and
\r
45 * {@link #getToolTipImage(Object)} both return <code>null</code> the
\r
46 * control is set back to standard behavior</b>
\r
50 * the element for which the tool tip is shown
\r
51 * @return {@link Image} or <code>null</code> if there is not image.
\r
54 public java.awt.Image getToolTipImage(Object object);
\r
57 * Get the text displayed in the tool tip for object.
\r
60 * <b>If {@link #getToolTipText(Object)} and
\r
61 * {@link #getToolTipImage(Object)} both return <code>null</code> the
\r
62 * control is set back to standard behavior</b>
\r
66 * the element for which the tool tip is shown
\r
67 * @return the {@link String} or <code>null</code> if there is not text to
\r
70 public String getToolTipText(Object element);
\r
73 * Return the background color used for the tool tip
\r
76 * the {@link Object} for which the tool tip is shown
\r
78 * @return the {@link Color} used or <code>null</code> if you want to use
\r
79 * the default color {@link SWT#COLOR_INFO_BACKGROUND}
\r
80 * @see SWT#COLOR_INFO_BACKGROUND
\r
82 public Color getToolTipBackgroundColor(Object object);
\r
85 * The foreground color used to display the the text in the tool tip
\r
88 * the {@link Object} for which the tool tip is shown
\r
89 * @return the {@link Color} used or <code>null</code> if you want to use
\r
90 * the default color {@link SWT#COLOR_INFO_FOREGROUND}
\r
91 * @see SWT#COLOR_INFO_FOREGROUND
\r
93 public Color getToolTipForegroundColor(Object object);
\r