本文整理汇总了Java中org.eclipse.xtext.naming.QualifiedName.toString方法的典型用法代码示例。如果您正苦于以下问题:Java QualifiedName.toString方法的具体用法?Java QualifiedName.toString怎么用?Java QualifiedName.toString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.xtext.naming.QualifiedName
的用法示例。
在下文中一共展示了QualifiedName.toString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findArtifact
import org.eclipse.xtext.naming.QualifiedName; //导入方法依赖的package包/类
/**
* @see IN4JSSourceContainer#findArtifact(QualifiedName, Optional)
*/
public URI findArtifact(IN4JSSourceContainer sourceContainer, QualifiedName name, Optional<String> fileExtension) {
final String ext = fileExtension.or("").trim();
final String extWithDot = !ext.isEmpty() && !ext.startsWith(".") ? "." + ext : ext;
final String pathStr = name.toString("/") + extWithDot; // no need for IQualifiedNameConverter here!
if (sourceContainer.isLibrary()) {
return null; // TODO support for finding artifacts in libraries
} else {
URI artifactLocation = workspace.findArtifactInFolder(sourceContainer.getLocation(), pathStr);
if (null == artifactLocation) {
artifactLocation = externalLibraryWorkspace.findArtifactInFolder(sourceContainer.getLocation(),
pathStr);
}
return artifactLocation;
}
}
示例2: updateMainElementName
import org.eclipse.xtext.naming.QualifiedName; //导入方法依赖的package包/类
/**
* Update _entryPointModelElement with pretty name
*/
private void updateMainElementName(){
try {
Resource model = getModel();
EObject mainElement = null;
if(model != null){
mainElement = model.getEObject(_entryPointModelElementText.getText());
}
if(mainElement != null){
org.eclipse.xtext.naming.DefaultDeclarativeQualifiedNameProvider nameprovider = new DefaultDeclarativeQualifiedNameProvider();
QualifiedName qname = nameprovider.getFullyQualifiedName(mainElement);
String objectName = qname != null ? qname.toString(): mainElement.toString();
String prettyName = objectName+ " : "+mainElement.eClass().getName();
_entryPointModelElementLabel.setText(prettyName);
}
} catch (Exception e) { }
}
示例3: withoutPolyfillAsString
import org.eclipse.xtext.naming.QualifiedName; //导入方法依赖的package包/类
/**
* @param qualifiedName
* with {@code #POLY}-marker to be converted to a String without the polyfill-marker.
* @return string representation without polyfill marker
*/
public static String withoutPolyfillAsString(QualifiedName qualifiedName) {
// Assumption: 2nd-last segment is "!POLY"
String last = qualifiedName.getLastSegment();
String poly = qualifiedName.skipLast(1).getLastSegment();
assert(N4TSQualifiedNameProvider.POLYFILL_SEGMENT.equals(poly));
QualifiedName ret = qualifiedName.skipLast(2).append(last);
return ret.toString();
}