/******************************************************************************* * Copyright (c) 2007, 2010 Association for Decentralized Information Management * in Industry THTH ry. * 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: * VTT Technical Research Centre of Finland - initial API and implementation *******************************************************************************/ package org.simantics.g2d.gallery; import org.eclipse.jface.viewers.IBaseLabelProvider; import org.eclipse.swt.SWT; import org.eclipse.swt.graphics.Color; import org.simantics.g2d.image.Image; public interface ILabelProvider extends IBaseLabelProvider { /** * Returns the image for the label of the given element. The image * is owned by the label provider and must not be disposed directly. * Instead, dispose the label provider when no longer needed. * * @param element the element for which to provide the label image * @return the image used to label the element, or null * if there is no image for the given object */ public Image getImage(Object element); /** * Returns the text for the label of the given element. * * @param element the element for which to provide the label text * @return the text string used to label the element, or null * if there is no text label for the given object */ public String getText(Object element); /** * Get the image displayed in the tool tip for object. * *

* If {@link #getToolTipText(Object)} and * {@link #getToolTipImage(Object)} both return null the * control is set back to standard behavior *

* * @param object * the element for which the tool tip is shown * @return {@link Image} or null if there is not image. */ public java.awt.Image getToolTipImage(Object object); /** * Get the text displayed in the tool tip for object. * *

* If {@link #getToolTipText(Object)} and * {@link #getToolTipImage(Object)} both return null the * control is set back to standard behavior *

* * @param element * the element for which the tool tip is shown * @return the {@link String} or null if there is not text to * display */ public String getToolTipText(Object element); /** * Return the background color used for the tool tip * * @param object * the {@link Object} for which the tool tip is shown * * @return the {@link Color} used or null if you want to use * the default color {@link SWT#COLOR_INFO_BACKGROUND} * @see SWT#COLOR_INFO_BACKGROUND */ public Color getToolTipBackgroundColor(Object object); /** * The foreground color used to display the the text in the tool tip * * @param object * the {@link Object} for which the tool tip is shown * @return the {@link Color} used or null if you want to use * the default color {@link SWT#COLOR_INFO_FOREGROUND} * @see SWT#COLOR_INFO_FOREGROUND */ public Color getToolTipForegroundColor(Object object); }