Esempio n. 1
0
 public void run(IAction action) {
   if (navigator == null) {
     return;
   }
   Grouping grouping = getGrouping(action.getId());
   if (grouping == null) {
     return;
   }
   BugContentProvider provider =
       BugContentProvider.getProvider(navigator.getNavigatorContentService());
   provider.setGrouping(grouping);
   CommonViewer viewer = navigator.getCommonViewer();
   Object[] expandedElements = viewer.getExpandedElements();
   provider.reSetInput();
   viewer.setExpandedElements(expandedElements);
 }
Esempio n. 2
0
  public void run(IAction action) {
    if (navigator != null) {
      CommonViewer viewer = navigator.getCommonViewer();
      BugContentProvider provider =
          BugContentProvider.getProvider(navigator.getNavigatorContentService());
      // provider.setRefreshRequested(true);

      Object[] expandedElements = viewer.getExpandedElements();
      Object input = viewer.getInput();
      if (provider.getChildren(input).length == 0) {
        viewer.setInput(null);
        if (input instanceof IWorkingSet || input instanceof IWorkspaceRoot) {
          viewer.setInput(input);
        } else {
          viewer.setInput(ResourcesPlugin.getWorkspace().getRoot());
        }
        viewer.refresh(true);
      } else {
        provider.reSetInput();
      }
      viewer.setExpandedElements(expandedElements);
    }
  }