當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。