/**
* @param selections
* @return
*/
public static String getQualifiedName(final ITreeSelection selections) {
final TreePath[] paths = selections.getPaths();
// Consider only not empty and single selection
if (selections.isEmpty() || selections.size() > 1) {
return null;
}
final TreePath path = paths[0];
IElementComparer comparer = null;
if (selections instanceof TreeSelection) {
comparer = ((TreeSelection) selections).getElementComparer();
}
System.out.println(path.hashCode(comparer));
for (int i = 1; i < path.getSegmentCount(); i++) {
if (path.getSegment(i) instanceof ResourceFactoryImpl) {
final EcoreResourceFactoryImpl eResourceFactory =
(EcoreResourceFactoryImpl) path.getSegment(i);
System.out
.println(eResourceFactory.getClass().getName() + ": " + eResourceFactory.toString());
} else if (path.getSegment(i) instanceof ENamedElement) {
final ENamedElement namedElement = (ENamedElement) path.getSegment(i);
System.out.println(namedElement.getClass().getName() + ": " + namedElement.getName());
} else {
System.out.println("?");
}
}
return null;
}
MarkerFactory.java 文件源码
java
阅读 31
收藏 0
点赞 0
评论 0
项目:Tarski
作者:
评论列表
文章目录