Package org.eclipse.test.internal.performance.results.model

Examples of org.eclipse.test.internal.performance.results.model.ResultsElement


/*
* (non-Javadoc)
* @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
*/
public void selectionChanged(SelectionChangedEvent event) {
  ResultsElement selectedElement = (ResultsElement) ((TreeSelection) event.getSelection()).getFirstElement();
  ComponentResultsElement componentElement = null;
  ScenarioResultsElement scenarioResultsElement = null;
  ConfigResultsElement configResultsElement = null;
  BuildResultsElement buildResultsElement = null;
  if (selectedElement instanceof ComponentResultsElement) {
    componentElement = (ComponentResultsElement) selectedElement;
  } else if (selectedElement instanceof ScenarioResultsElement) {
    scenarioResultsElement = (ScenarioResultsElement) selectedElement;
    componentElement = (ComponentResultsElement) scenarioResultsElement.getParent(null);
  } else if (selectedElement instanceof ConfigResultsElement) {
    configResultsElement = (ConfigResultsElement) selectedElement;
    scenarioResultsElement = (ScenarioResultsElement) configResultsElement.getParent(null);
    componentElement = (ComponentResultsElement) scenarioResultsElement.getParent(null);
  } else if (selectedElement instanceof BuildResultsElement) {
    buildResultsElement = (BuildResultsElement) selectedElement;
    configResultsElement = (ConfigResultsElement) buildResultsElement.getParent(null);
    scenarioResultsElement = (ScenarioResultsElement) configResultsElement.getParent(null);
    componentElement = (ComponentResultsElement) scenarioResultsElement.getParent(null);
  } else if (selectedElement instanceof DimResultsElement) {
    buildResultsElement = (BuildResultsElement) selectedElement.getParent(null);
    configResultsElement = (ConfigResultsElement) buildResultsElement.getParent(null);
    scenarioResultsElement = (ScenarioResultsElement) configResultsElement.getParent(null);
    componentElement = (ComponentResultsElement) scenarioResultsElement.getParent(null);
  }
  if (componentElement != this.componentResultsElement) {
View Full Code Here


    // Sort children using specific comparison (see the implementation
    // of the #compareTo(Object) in the ResultsElement hierarchy
    public int compare(Viewer view, Object e1, Object e2) {
      // Config and Build results are sorted in reverse order
      if (e1 instanceof BuildResultsElement) {
        ResultsElement element = (ResultsElement) e2;
        return element.compareTo(e1);
      }
      if (e1 instanceof ResultsElement) {
        ResultsElement element = (ResultsElement) e1;
        return element.compareTo(e2);
      }
      return super.compare(view, e1, e2);
    }
  };
  this.viewer.setSorter(nameSorter);
View Full Code Here

* (non-Javadoc)
* @see org.eclipse.test.internal.performance.results.ui.PerformancesView#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
*/
public void selectionChanged(SelectionChangedEvent event) {
  super.selectionChanged(event);
  ResultsElement eventResultsElement = (ResultsElement) ((StructuredSelection)event.getSelection()).getFirstElement();
  if (eventResultsElement != null) {
    ResultsElement eventComponentElement = eventResultsElement;
    if (!(eventComponentElement instanceof ComponentResultsElement)) {
      while (!(eventComponentElement instanceof ComponentResultsElement)) {
        eventComponentElement = (ResultsElement) eventComponentElement.getParent(null);
      }
      this.expandedComponents.add(eventComponentElement);
    }
  }
}
View Full Code Here

TOP

Related Classes of org.eclipse.test.internal.performance.results.model.ResultsElement

Copyright © 2018 www.massapicom. 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.