Example #1
0
  /** Sets the url for the help files. */
  public void selectionChanged(IWorkbenchPart part, ISelection selection) {
    Object element = SelectionUtils.checkAndPickFirst(selection, Object.class);
    if (element != null) {
      if (element instanceof EObject) {
        EObject eObject = (EObject) element;
        while (eObject != null) {
          if (show(eObject.eClass().getName())) {
            return;
          }
          eObject = eObject.eContainer();
        }
      }
      if (element instanceof TransientItemProvider) {
        TransientItemProvider provider = (TransientItemProvider) element;
        if (show(provider.getReference().getEReferenceType().getName())) {
          return;
        }
      }
      if (element instanceof Resource || element instanceof IResource) {
        show("loadingmodels");
        return;
      }
    }

    show("index");
  }