public class ResourceUIUtil extends Object
Constructor and Description |
---|
ResourceUIUtil() |
Modifier and Type | Method and Description |
---|---|
static IMergeViewerItem |
addNewContainerForNotLoadedFragmentMatches(Collection<IMergeViewerItem> items,
IMergeViewer.MergeViewerSide side,
Comparison comparison,
AdapterFactory adapterFactory)
Adds a new parent container to the given list of IMergeViewerItems if needed and returns it.
|
static boolean |
containsNotLoadedFragmentNodes(Collection<TreeNode> nodes)
Check if the given list of TreeNodes contains at least two nodes that have NotLoadedFragmentMatch for
data.
|
static IMergeViewerItem |
createItemForNotLoadedFragmentMatch(Match match,
IMergeViewer.MergeViewerSide side,
Comparison comparison,
AdapterFactory adapterFactory)
Constructs a
NotLoadedFragmentMatch from the given
Match and then return the
IMergeViewerItem corresponding to this
NotLoadedFragmentMatch. |
static Collection<Match> |
getChildrenMatchWithNotLoadedParent(Comparison comparison,
Match match,
IMergeViewer.MergeViewerSide side)
Filters, from the root matches of the given comparison, those who will children matches of the given
match if all fragments of the whole models involved in comparison had been loaded, for the given side
of the comparison.
|
static ResourceSet |
getDataResourceSet(Match match)
Get the Resource's ResourceSet of the data associated to the given Match.
|
static ResourceSet |
getDataResourceSet(Match match,
IMergeViewer.MergeViewerSide side)
Get the Resource's ResourceSet of the data associated to the given Match, and for the given side of the
comparison.
|
static URI |
getDataURI(Match match)
Get the Resource's URI of the data associated to the given Match
|
static URI |
getDataURI(Match match,
IMergeViewer.MergeViewerSide side)
Get the Resource's URI of the data associated to the given Match, and for the given side of the
comparison. .
|
static Collection<URI> |
getDataURIs(Collection<Match> matches,
IMergeViewer.MergeViewerSide side)
Get the Resource's URIs of the data associated to the given list of Matches.
|
static EObject |
getEObjectParent(ResourceSet rs,
URI uri)
Get the first loaded EObject parent of the given resource (represented by its URI) contained in the
given ResourceSet.
|
static Collection<Match> |
getNotLoadedFragmentMatches(Collection<IMergeViewerItem> items)
Get from the given list of
IMergeViewerItem s, the NotLoadedFragmentMatchs. |
static Resource |
getParent(ResourceSet rs,
URI uri)
Get the parent of the given resource (represented by its URI) contained in the given ResourceSet.
|
static URI |
getParentResourceURI(ResourceSet rs,
URI uri)
Get the first loaded parent resource URI of the given resource (represented by its URI) contained in
the given ResourceSet.
|
static String |
getResourceName(NotLoadedFragmentMatch match)
Get the resource's name associated with the data of the given NotLoadedFragmentMatch.
|
static ReadOnlyGraph<URI> |
getResourcesURIGraph()
Get the graph of resources' URI for the models involved in the current comparison.
|
static URI |
getRootResourceURI(URI uri)
Get the root resource of the whole model that contains the given fragment (represented by its uri).
|
static TreeNode |
getTreeNode(Collection<TreeNode> nodes,
Match match)
Search from the given list of TreeNodes (and recursively on its children), the one that is associated
to the given Match.
|
static TreeNode |
getTreeNodeFromURI(Collection<TreeNode> nodes,
URI uri)
Get from the given list of TreeNodes, the one that has its data's resource's URI (TreeNode -> Match ->
EObject -> Resource -> URI) corresponding to the given URI.
|
static boolean |
isChildOf(URI uri,
Collection<URI> uris)
Check if the given URI is a child (directly or not) of one of the given list of URIs.
|
static boolean |
isFirstLevelFragment(URI uri)
Check if the given URI corresponds to a fragment of model that is at the first level of the model, in
other words a fragment that is directly under a root resource.
|
static boolean |
isFragment(Match rootMatch,
IMergeViewer.MergeViewerSide side)
Check if the given match is a root match of its comparison model and is a fragment.
|
static boolean |
isFragment(URI uri)
Check if the given URI correspond to a fragment of model.
|
static boolean |
isRootResource(URI uri)
Check if the given URI correspond to the root resource of a model.
|
public static ReadOnlyGraph<URI> getResourcesURIGraph()
null
otherwise.public static boolean isRootResource(URI uri)
uri
- the given URI.true
if the given URI is root resource of a model, false
otherwise.public static boolean isFragment(URI uri)
uri
- the given URI.true
if the given URI is a fragment of a model, false
otherwise.public static boolean isFragment(Match rootMatch, IMergeViewer.MergeViewerSide side)
rootMatch
- the given match.side
- the side for which we want to know if it is a fragment or not.true
if the given match is a root match of its comparison model and is a fragment,
false
otherwise.public static boolean isFirstLevelFragment(URI uri)
If the given fragment (represented by the given URI) has several parents, this method will return
false
.
uri
- the given URI.true
if the given URI is a fragment of a model, false
otherwise.public static URI getRootResourceURI(URI uri)
If at some point of the process a fragment has several parents, this method will return
null
.
uri
- the given URI.null
otherwise.public static URI getParentResourceURI(ResourceSet rs, URI uri)
If at some point of the process the current resource (represented by its URI) has several parents, this
method will return null
.
rs
- the ResourceSet in which the first loaded parent must be found.uri
- the URI of the resource for which we want to get its first loaded parent.null
otherwise.public static Resource getParent(ResourceSet rs, URI uri)
If the given resource (represented by its URI) has several parents, this method will return
null
.
rs
- the ResourceSet in which the parent must be found.uri
- the URI of the resource for which we want to get its parent.null
otherwise.public static EObject getEObjectParent(ResourceSet rs, URI uri)
If at some point of the process the current resource (represented by its URI) has several parents, this
method will return null
.
rs
- the ResourceSet in which the first loaded parent must be found.uri
- the URI of the resource for which we want to get its first loaded parent.null
otherwise.public static TreeNode getTreeNode(Collection<TreeNode> nodes, Match match)
nodes
- the given list of TreeNodes.match
- the given Match.public static TreeNode getTreeNodeFromURI(Collection<TreeNode> nodes, URI uri)
nodes
- the given list of TreeNodes.uri
- the given URI.public static URI getDataURI(Match match)
match
- the given Match.public static Collection<URI> getDataURIs(Collection<Match> matches, IMergeViewer.MergeViewerSide side)
matches
- the given list of Matches.side
- the given side of the comparison.public static URI getDataURI(Match match, IMergeViewer.MergeViewerSide side)
match
- the given Match.side
- the given side of the comparison.public static ResourceSet getDataResourceSet(Match match)
match
- the given Match.public static ResourceSet getDataResourceSet(Match match, IMergeViewer.MergeViewerSide side)
match
- the given Match.side
- the given side of the comparison.public static boolean containsNotLoadedFragmentNodes(Collection<TreeNode> nodes)
nodes
- the given list of TreeNodes.true
if the given list of TreeNodes contains at least two nodes that have
NotLoadedFragmentMatch for data, false otherwise.public static Collection<Match> getNotLoadedFragmentMatches(Collection<IMergeViewerItem> items)
IMergeViewerItem
s, the NotLoadedFragmentMatchs.items
- the given list of IMergeViewerItems.public static String getResourceName(NotLoadedFragmentMatch match)
match
- the given NotLoadedFragmentMatch.public static Collection<Match> getChildrenMatchWithNotLoadedParent(Comparison comparison, Match match, IMergeViewer.MergeViewerSide side)
comparison
- the given comparison.match
- the given match.side
- the given side of the comparison.public static boolean isChildOf(URI uri, Collection<URI> uris)
uri
- the given URI.uris
- the given list of URIs.public static IMergeViewerItem createItemForNotLoadedFragmentMatch(Match match, IMergeViewer.MergeViewerSide side, Comparison comparison, AdapterFactory adapterFactory)
NotLoadedFragmentMatch
from the given
Match
and then return the
IMergeViewerItem
corresponding to this
NotLoadedFragmentMatch.match
- the given Match.side
- the side of the Match.comparison
- the comparison object that contains the Match.adapterFactory
- the adapter factory used to create the merge viewer item.public static IMergeViewerItem addNewContainerForNotLoadedFragmentMatches(Collection<IMergeViewerItem> items, IMergeViewer.MergeViewerSide side, Comparison comparison, AdapterFactory adapterFactory)
items
- the given IMergeViewerItems.side
- the side of the Match.comparison
- the comparison object that contains the Match.adapterFactory
- the adapter factory used to create the merge viewer item.
Copyright (c) 2006, 2015 Obeo and others. All rights reserved.