Package es.java.otro.view

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

/**
*
*/
package es.java.otro.view;

import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.IPropertyListener;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.navigator.CommonNavigator;

import es.java.otro.model.Root;

/**
* @author jaime
*
*/
public class RssTree extends CommonNavigator {

  public RssTree() {
    super();
    // TODO Auto-generated constructor stub
  }
 
 
 
  @Override
  public void createPartControl(Composite parent) {
        super.createPartControl(parent);
        getCommonViewer().setInput(getInitialInput());
         
        super.addPropertyListener(new IPropertyListener() {
     
      @Override
      public void propertyChanged(Object source, int propId) {
        Object feed = ((StructuredSelection)getCommonViewer().getSelection()).getFirstElement();
       
        FeedView feedView = (FeedView) PlatformUI.getWorkbench()
        .getActiveWorkbenchWindow().getActivePage().findView(
            FeedView.ID);
       
        feedView.setInput(feed);
      }
    });
  }
 
  protected Object getInitialInput() {
    Root root = Root.getInstance();
    root.setName("Feeds");
    return root;
  }

 

}
TOP

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

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.