Rational Developer for Power Systems Software
V7.6

com.ibm.etools.iseries.remotebuild.util
Class SelectionUtil

java.lang.Object
  extended by com.ibm.etools.iseries.remotebuild.util.SelectionUtil

public class SelectionUtil
extends Object

Utilities for examinining IStructuredSelections of AbstractISeriesResources.


Constructor Summary
SelectionUtil()
           
 
Method Summary
static List<AbstractISeriesProject> getProjects(List groups)
          Extract the list of projects from a list of groups as defined in groupByProject.
static List groupByProject(IStructuredSelection selection)
           
static IStructuredSelection makeSelection(List groups)
          Make a selection from a list of groups as defined in groupByProject.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SelectionUtil

public SelectionUtil()
Method Detail

groupByProject

public static List groupByProject(IStructuredSelection selection)
Parameters:
selection - the IStructuredSelection to be examined. The selection is assumed to be in tree order so that projects and their resources appear together in the selection and projects precede their owned resources in the selection.
Returns:
a List of Object[]. Each Object[] is an array of two elements. The first is the AbstractISeriesProject to which the list of resources belongs. The second (at index 1) is a List of AbstactISeriesResources in the selection that belong to that project. The project itself is a member of this list only if it is in the selection.

makeSelection

public static IStructuredSelection makeSelection(List groups)
Make a selection from a list of groups as defined in groupByProject. Each group is a pair (project, list-of-resources). The original selection can be reconstructed by concatenating the lists of resources.

Parameters:
groups - the list of resources grouped by project.
Returns:
a selection containing the resources from the groups.

getProjects

public static List<AbstractISeriesProject> getProjects(List groups)
Extract the list of projects from a list of groups as defined in groupByProject.

Parameters:
groups -
Returns:
a list of projects from the list of groups in the original order.

Rational Developer for Power Systems Software
V7.6

Copyright © 2011 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.