当前位置: 首页>>代码示例>>Java>>正文


Java AdapterFactoryEditingDomain.isControlled方法代码示例

本文整理汇总了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;
 }
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:30,代码来源:ProjectUtil.java

示例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;
    }
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:23,代码来源:ModelInformationUtil.java

示例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());
                    }
                }
            }
        }
    }
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:26,代码来源:ResourceManager.java

示例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;
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:32,代码来源:ModelInformationUtil.java

示例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;
    }
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:51,代码来源:ProjectUtil.java

示例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;
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:61,代码来源:ModelInformationUtil.java


注:本文中的org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain.isControlled方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。