All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.eclipse.jface.viewers.LabelProvider Maven / Gradle / Ivy

There is a newer version: 3.29.0
Show newest version
/*******************************************************************************
 * Copyright (c) 2000, 2006 IBM Corporation 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:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.jface.viewers;

import org.eclipse.swt.graphics.Image;

/**
 * A label provider implementation which, by default, uses an element's
 * toString value for its text and null for its
 * image.
 * 

* This class may be used as is, or subclassed to provide richer labels. * Subclasses may override any of the following methods: *

    *
  • isLabelProperty
  • *
  • getImage
  • *
  • getText
  • *
  • dispose
  • *
*

*/ public class LabelProvider extends BaseLabelProvider implements ILabelProvider { /** * Creates a new label provider. */ public LabelProvider() { } /** * The LabelProvider implementation of this * ILabelProvider method returns null. * Subclasses may override. */ public Image getImage(Object element) { return null; } /** * The LabelProvider implementation of this * ILabelProvider method returns the element's * toString string. Subclasses may override. */ public String getText(Object element) { return element == null ? "" : element.toString();//$NON-NLS-1$ } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy