Package es.java.otro.view

Source Code of es.java.otro.view.RssTreeLabelProvider

package es.java.otro.view;

import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.ui.navigator.IDescriptionProvider;

import es.java.otro.model.Entry;
import es.java.otro.model.Feed;
import es.java.otro.model.Root;

public class RssTreeLabelProvider extends LabelProvider implements ILabelProvider, IDescriptionProvider{

  @Override
  public String getDescription(Object anElement) {
    return "hardcoded description";
  }

  @Override
  public String getText(Object element) {
    if (element instanceof Feed) {
      Feed feed = (Feed) element;
      return feed.getName();
    } else if (element instanceof Root) {
      return "Feeds";
    } else if (element instanceof Entry) {
      Entry entry = (Entry) element;
      return entry.getTitle();
    } else
      return element.toString();
  }
 
 

}
TOP

Related Classes of es.java.otro.view.RssTreeLabelProvider

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.