本文整理汇总了Java中org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain.isControlled方法的典型用法代码示例。如果您正苦于以下问题:Java AdapterFactoryEditingDomain.isControlled方法的具体用法?Java AdapterFactoryEditingDomain.isControlled怎么用?Java AdapterFactoryEditingDomain.isControlled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain
的用法示例。
在下文中一共展示了AdapterFactoryEditingDomain.isControlled方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getFragmentedPackageList
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain; //导入方法依赖的package包/类
/**
*
* 모델에 포함된 단편화 패키지 목록을 반환 한다.
*
* @param model
* @return TreeMap<String,Package>
*/
public static TreeMap<String, Package> getFragmentedPackageList(Package model) {
TreeMap<String, Package> packageList = new TreeMap<String, Package>();
SELECT statement = new SELECT(new FROM(model),
new WHERE(new EObjectTypeRelationCondition(UMLPackage.eINSTANCE.getPackage())));
IQueryResult result = statement.execute();
for (Iterator<?> ir = result.iterator(); ir.hasNext();) {
Package pkg = (Package) ir.next();
if (pkg == null || pkg.getQualifiedName() == null) {
continue;
}
if (AdapterFactoryEditingDomain.isControlled(pkg)) {
packageList.put(pkg.getQualifiedName(), pkg);
continue;
}
}
return packageList;
}
示例2: getFragmentPackages
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain; //导入方法依赖的package包/类
public static TreeMap<String, Package> getFragmentPackages(final Model model) {
TreeMap<String, Package> packageList = new TreeMap<String, Package>();
SELECT statement = new SELECT(new FROM(model),
new WHERE(new EObjectTypeRelationCondition(UMLPackage.eINSTANCE.getPackage())));
IQueryResult result = statement.execute();
for (Iterator<?> ir = result.iterator(); ir.hasNext();) {
Package pkg = (Package) ir.next();
if (pkg == null || pkg.getQualifiedName() == null) {
continue;
}
if (AdapterFactoryEditingDomain.isControlled(pkg)) {
packageList.put(String.format("%s_%s", pkg.getQualifiedName(), EcoreUtil.getURI(pkg).fragment()), pkg);
continue;
}
}
return packageList;
}
示例3: removeFragmentResource
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain; //导入方法依赖的package包/类
/**
*
*
*
* @param parentResource void
*/
public void removeFragmentResource(Resource parentResource) {
EList<EObject> contents = parentResource.getContents();
if (contents != null && contents.size() > 0) {
EObject eobject = contents.get(0);
if (!AdapterFactoryEditingDomain.isControlled(eobject)) {
EAnnotation eAnnotation = getFragmentAnnotation(eobject);
if (eAnnotation == null)
return;
EList<EObject> references = eAnnotation.getReferences();
for (EObject reference : references) {
if (reference != null && reference.eResource() != null) {
// removeResource(reference.eResource());
ResourceUnloader.getInstance().put(reference.eResource());
}
}
}
}
}
示例4: packageFragmentOfResource
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain; //导入方法依赖的package包/类
/**
*
* 리소스에 포함된 단편 개수 void
*/
public static TreeMap<String, Package> packageFragmentOfResource(Resource resource) {
Model model = (org.eclipse.uml2.uml.Model) EcoreUtil.getObjectByType(resource.getContents(),
UMLPackage.Literals.MODEL);
TreeMap<String, Package> packageList = new TreeMap<String, Package>();
if (model == null)
return packageList;
SELECT statement = new SELECT(new FROM(model),
new WHERE(new EObjectTypeRelationCondition(UMLPackage.eINSTANCE.getPackage())));
IQueryResult result = statement.execute();
for (Iterator<?> ir = result.iterator(); ir.hasNext();) {
Package pkg = (Package) ir.next();
if (pkg == null || pkg.getQualifiedName() == null) {
continue;
}
if (AdapterFactoryEditingDomain.isControlled(pkg)) {
packageList.put(String.format("%s_%s", pkg.getQualifiedName(), EcoreUtil.getURI(pkg).fragment()), pkg);
}
}
return packageList;
}
示例5: getFragmentedFileList
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain; //导入方法依赖的package包/类
/**
* file 하위에 존재하는 단편파일 리스트를 가져온다.
*
* @param resource
* void
*/
public static Set<Resource> getFragmentedFileList(Resource resource) {
// List<Resource> resourceList = new ArrayList<Resource>();
//
// org.eclipse.uml2.uml.Package pack = (org.eclipse.uml2.uml.Package) resource.getContents().get(0);
// EObjectCondition condition = new EObjectTypeRelationCondition(EcorePackage.eINSTANCE.getEAnnotation());
// SELECT statement = new SELECT(new FROM(pack), new WHERE(condition));
// IQueryResult result = statement.execute();
//
// EAnnotation annotation;
// for (Iterator<EObject> it = result.iterator(); it.hasNext();) {
// Object obj;
// obj = it.next();
//
// if (obj instanceof EAnnotation) {
// annotation = (EAnnotation) obj;
// if (!(ManagerConstant.UMLDOMAIN_CONSTANT__FRAGMENT_CONTAINER_ANNOTATION_NAME.equals(annotation.getSource()))
// || annotation.eResource() != resource) {
// if (!resourceList.contains(annotation.eResource())) {
// resourceList.add(annotation.eResource());
// }
// }
// }
// }
Set<Resource> resourceList = new HashSet<Resource>();
SELECT statement = new SELECT(new FROM(resource.getContents().get(0)),
new WHERE(new EObjectTypeRelationCondition(UMLPackage.eINSTANCE.getPackage())));
IQueryResult result = statement.execute();
for (Iterator<?> ir = result.iterator(); ir.hasNext();) {
Package pkg = (Package) ir.next();
if (pkg == null || pkg.getQualifiedName() == null) {
continue;
}
if (AdapterFactoryEditingDomain.isControlled(pkg)) {
resourceList.add(pkg.eResource());
continue;
}
}
return resourceList;
}
示例6: packageFragmentOfProject
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain; //导入方法依赖的package包/类
/**
*
* 프로젝트에 포함된 단편 개수 void
*/
public static TreeMap<String, Package> packageFragmentOfProject(IProject project) {
TreeMap<String, Package> packageList = new TreeMap<String, Package>();
try {
if (!UMLNature.hasUMLNature(project)) {
return packageList;
}
ResourceSet resourceSet = DomainRegistry.getEditingDomain().getResourceSet();
Map<URI, Resource> uriResourceMap = ((ResourceSetImpl) resourceSet).getURIResourceMap();
for (Iterator<URI> iterator = uriResourceMap.keySet().iterator(); iterator.hasNext();) {
URI uri = (URI) iterator.next();
if (!uri.toString().endsWith("umx")) {
continue;
}
Resource resource = uriResourceMap.get(uri);
IFile file = WorkspaceSynchronizer.getFile(resource);
if (file.getProject() != project) {
continue;
}
Model model = (org.eclipse.uml2.uml.Model) EcoreUtil.getObjectByType(resource.getContents(),
UMLPackage.Literals.MODEL);
if (model == null)
continue;
SELECT statement = new SELECT(new FROM(model),
new WHERE(new EObjectTypeRelationCondition(UMLPackage.eINSTANCE.getPackage())));
IQueryResult result = statement.execute();
for (Iterator<?> ir = result.iterator(); ir.hasNext();) {
Package pkg = (Package) ir.next();
if (pkg == null || pkg.getQualifiedName() == null) {
continue;
}
if (AdapterFactoryEditingDomain.isControlled(pkg)) {
packageList.put(String.format("%s_%s", pkg.getQualifiedName(), EcoreUtil.getURI(pkg).fragment()), pkg);
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
return packageList;
}