/**
*
*/
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;
}
}