|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.cdt.internal.ui.util.SelectionUtil
public class SelectionUtil
Provides utilities for checking the validity of selections.
This class provides static methods only; it is not intended to be instantiated or subclassed.
Method Summary | |
---|---|
static boolean |
allResourcesAreOfType(org.eclipse.jface.viewers.IStructuredSelection selection,
int resourceMask)
Returns whether the types of the resources in the given selection are among the specified resource types. |
static java.lang.Object |
getFirstElement(org.eclipse.jface.viewers.ISelection selection)
Returns the first element of the given selection. |
static java.lang.Object |
getSingleElement(org.eclipse.jface.viewers.ISelection s)
|
static boolean |
resourceIsType(org.eclipse.core.resources.IResource resource,
int resourceMask)
Returns whether the type of the given resource is among the specified resource types. |
static java.lang.Object[] |
toArray(org.eclipse.jface.viewers.ISelection selection)
Returns the elements of the given selection. |
static java.util.List |
toList(org.eclipse.jface.viewers.ISelection selection)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static java.lang.Object getFirstElement(org.eclipse.jface.viewers.ISelection selection)
IStructuredSelection
.
selection
- the selection
public static java.lang.Object getSingleElement(org.eclipse.jface.viewers.ISelection s)
public static java.lang.Object[] toArray(org.eclipse.jface.viewers.ISelection selection)
IStructuredSelection
.
selection
- the selection
public static java.util.List toList(org.eclipse.jface.viewers.ISelection selection)
public static boolean allResourcesAreOfType(org.eclipse.jface.viewers.IStructuredSelection selection, int resourceMask)
selection
- the selectionresourceMask
- resource mask formed by bitwise OR of resource type
constants (defined on IResource
)
true
if all selected elements are resources of the right
type, and false
if at least one element is either a resource
of some other type or a non-resourceIResource.getType()
public static boolean resourceIsType(org.eclipse.core.resources.IResource resource, int resourceMask)
resource
- the resourceresourceMask
- resource mask formed by bitwise OR of resource type
constants (defined on IResource
)
true
if the resources has a matching type, and
false
otherwiseIResource.getType()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |