本文整理匯總了Java中org.eclipse.emf.ecore.xmi.XMLResource.getID方法的典型用法代碼示例。如果您正苦於以下問題:Java XMLResource.getID方法的具體用法?Java XMLResource.getID怎麽用?Java XMLResource.getID使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.emf.ecore.xmi.XMLResource
的用法示例。
在下文中一共展示了XMLResource.getID方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getUUIDs
import org.eclipse.emf.ecore.xmi.XMLResource; //導入方法依賴的package包/類
/**
* Returns the ID of the specified edit part.
*
* @param editPart the edit part.
* @param resource the resource that has the specified edit part.
* @return the ID of the specified edit part.
*/
public static String getUUIDs(GraphicalEditPart editPart,
XMLResource resource) {
if (editPart == null || resource == null) {
return null;
}
EObject eObj = getElement(editPart);
return resource.getID(eObj);
}
示例2: createLinkInfo
import org.eclipse.emf.ecore.xmi.XMLResource; //導入方法依賴的package包/類
/**
* Returns a LinkInfo object that represents the specified BasicLink.
*
* @param basicLink a BasicLink object.
* @return a LinkInfo object.
*/
public static LinkInfo createLinkInfo(BasicLink basicLink) {
if (basicLink == null) {
return null;
}
XMLResource xmlResource = (XMLResource) basicLink.eResource();
String id = xmlResource.getID(basicLink);
String sourceId = xmlResource.getID(basicLink.getSource());
String targetId = xmlResource.getID(basicLink.getTarget());
LinkInfo linkInfo = new LinkInfo(LinkType.BASIC_LINK);
// sets the common attributes.
linkInfo.setAttribute(AttributeType.ID, id);
linkInfo.setAttribute(AttributeType.DESC, basicLink.getDesc());
linkInfo.setAttribute(AttributeType.ATTACHMENT, basicLink
.getAttachment());
linkInfo.setAttribute(AttributeType.SOURCE, sourceId);
linkInfo.setAttribute(AttributeType.TARGET, targetId);
linkInfo.setAttribute(AttributeType.NAME, basicLink.getName());
linkInfo.setAttribute(AttributeType.STATUS, basicLink.getStatus());
linkInfo.setAttribute(AttributeType.SIBLINGORDER, basicLink.getSiblingOrder());
linkInfo.setAttribute(AttributeType.MESSAGE, basicLink.getMessage());
linkInfo.setAttribute(AttributeType.USERDEF001, basicLink
.getUserdef001());
linkInfo.setAttribute(AttributeType.USERDEF002, basicLink
.getUserdef002());
linkInfo.setAttribute(AttributeType.USERDEF003, basicLink
.getUserdef003());
linkInfo.setAttribute(AttributeType.USERDEF004, basicLink
.getUserdef004());
linkInfo.setAttribute(AttributeType.USERDEF005, basicLink
.getUserdef005());
linkInfo.setAttribute(AttributeType.USERDEF006, basicLink
.getUserdef006());
linkInfo.setAttribute(AttributeType.USERDEF007, basicLink
.getUserdef007());
linkInfo.setAttribute(AttributeType.USERDEF008, basicLink
.getUserdef008());
linkInfo.setAttribute(AttributeType.USERDEF009, basicLink
.getUserdef009());
linkInfo.setAttribute(AttributeType.USERDEF010, basicLink
.getUserdef010());
linkInfo.setAttribute(AttributeType.USERDEF011, basicLink
.getUserdef011());
linkInfo.setAttribute(AttributeType.USERDEF012, basicLink
.getUserdef012());
linkInfo.setAttribute(AttributeType.USERDEF013, basicLink
.getUserdef013());
linkInfo.setAttribute(AttributeType.USERDEF014, basicLink
.getUserdef014());
linkInfo.setAttribute(AttributeType.USERDEF015, basicLink
.getUserdef015());
linkInfo.setAttribute(AttributeType.USERDEF016, basicLink
.getUserdef016());
return linkInfo;
}
示例3: getUUID
import org.eclipse.emf.ecore.xmi.XMLResource; //導入方法依賴的package包/類
/**
* Returns the UUID.
* @param node the element.
* @return the UUID.
*/
public static String getUUID(BasicNode node) {
XMLResource resource = (XMLResource)node.eResource();
return resource.getID(node);
}