@Override
 public void setSelection(final ISelection selection) {
   assert (selection != null && !selection.isEmpty());
   final Object firstElement = ((IStructuredSelection) selection).getFirstElement();
   /*
    * breadcrumbViewer.setInput is called every time an item is selected.
    * Because of this, it does not make sense for the content provider
    * associated with the breadcrumbViewer to register a listener on the model
    */
   breadcrumbViewer.setInput(firstElement);
   breadcrumbViewer.setSelection(selection, true);
   contentPanel.setSelection(firstElement);
   contentPanel.setFocus();
 }
  public BreadcrumbNavigationView(Composite parent, int style) {
    super(parent, style);

    addDisposeListener(
        new DisposeListener() {
          public void widgetDisposed(DisposeEvent e) {
            setInput(null);
          }
        });

    GridLayout layout = new GridLayout();
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    layout.horizontalSpacing = 0;
    layout.verticalSpacing = 0;
    setLayout(layout);
    setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    breadcrumbViewer =
        new BreadcrumbViewer(this, SWT.HORIZONTAL) {
          @Override
          protected void configureDropDownViewer(TreeViewer viewer, Object input) {
            viewer.setContentProvider(new BreadcrumbContentProvider());
            viewer.setLabelProvider(new ModelLabelProvider());
            viewer.setComparator(new ModelNodeViewerComparator());
          }
        };

    breadcrumbViewer.addOpenListener(
        new IOpenListener() {
          public void open(OpenEvent event) {
            setSelection(event.getSelection());
          }
        });
    breadcrumbViewer.addSelectionChangedListener(
        new ISelectionChangedListener() {
          public void selectionChanged(SelectionChangedEvent event) {
            fireSelectionChangedEvent(event);
          }
        });

    breadcrumbViewer.setLabelProvider(new ModelLabelProvider());
    breadcrumbViewer.setContentProvider(new BreadcrumbContentProvider());
    contentPanel = new ContentPanel(this, SWT.NONE);
  }
 @Override
 public ISelection getSelection() {
   return breadcrumbViewer.getSelection();
 }