• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Profile类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.eclipse.uml2.uml.Profile的典型用法代码示例。如果您正苦于以下问题:Java Profile类的具体用法?Java Profile怎么用?Java Profile使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Profile类属于org.eclipse.uml2.uml包,在下文中一共展示了Profile类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: isAllowed

import org.eclipse.uml2.uml.Profile; //导入依赖的package包/类
/**
 *
 * @see org.eclipse.papyrus.infra.nattable.tester.ITableTester#isAllowed(java.lang.Object)
 *
 * @param context
 * @return
 */
@Override
public IStatus isAllowed(Object context) {	
	if (context instanceof Element) {
		Element el = (Element) context;
		ISpecializationType type = (ISpecializationType) ElementTypeRegistry.getInstance().getType("org.eclipse.papyrus.training.library.profile.extlibrary.Book");
		IElementMatcher matcher = type.getMatcher();
		if (context instanceof Package || matcher.matches(el)) {
			Profile profile = UMLUtil.getProfile(LibraryPackage.eINSTANCE, el);
			if (profile != null){
				final String packageQN = profile.getQualifiedName();
				if (el.getNearestPackage().getAppliedProfile(packageQN, true) != null) {
					return new Status(IStatus.OK, Activator.PLUGIN_ID, "The context allowed to create a Book Table"); //$NON-NLS-1$
				} else {
					return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "The profile "+packageQN+" is not applied on the model"); //$NON-NLS-1$ //$NON-NLS-2$
				}					
			}

		}
	}
	return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "The context is not an UML Element"); //$NON-NLS-1$
}
 
开发者ID:bmaggi,项目名称:library-training,代码行数:29,代码来源:BookTableTester.java


示例2: getValidLifelineTypes

import org.eclipse.uml2.uml.Profile; //导入依赖的package包/类
/**
     * Class/Component/Interface 등 라이프라인의 타입이 될 수 있는 데이터의 리스트를 반환한다.
     * @param ruleSet
     * @param profile
     * @return
     */
    public static List<SourceStructureTransformationData> getValidLifelineTypes(RuleSet ruleSet, Profile profile) {
        
        List<SourceStructureTransformationData> elementList = new ArrayList<SourceStructureTransformationData>();
        String stereotypeName = null;
        for (SourceStructureTransformationData data : ruleSet.getStructureRules()) {
            stereotypeName = data.getSourceType().getSourceName();
            Stereotype stereotype = (Stereotype) profile.getPackagedElement(stereotypeName);
            String[] baseNames = MDADesignerTransformationUtil.getApplicableElementName(stereotype).split(MDDCoreConstant.COMMA);
//            String[] baseNames = StringUtil.split(MDADesignerTransformationUtil.getApplicableElementName(stereotype), 
//                MDDCoreConstant.COMMA);
            for (String base : baseNames) {
                if( MDDCoreConstant.UML_CLASS_LITERAL.equals(base) || MDDCoreConstant.UML_INTERFACE_LITERAL.equals(base) 
                    || MDDCoreConstant.UML_COMPONENT_LITERAL.equals(base)) {
                    elementList.add(data);
                }
            }
        }
        return elementList;
    }
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:26,代码来源:MDADesignerTransformationUtil.java


示例3: getApplicableStereotypes

import org.eclipse.uml2.uml.Profile; //导入依赖的package包/类
/**
 * find applicable stereotypes for meta class
 * 
 * @param profile
 * @param metaClassName
 * @return
 */

public static List<Stereotype> getApplicableStereotypes(Profile profile, String metaClassName) {

    if (profile == null || metaClassName == null)
        return null;

    List<Stereotype> applicableStereotypes = new ArrayList<Stereotype>();

    for (Iterator<Stereotype> iter = profile.getOwnedStereotypes().iterator(); iter.hasNext();) {
        Stereotype stereotype = (Stereotype) iter.next();
        EList<Class> extendedMetaClasses = stereotype.getExtendedMetaclasses();
        for (int clazzCount = 0; clazzCount < extendedMetaClasses.size(); clazzCount++) {
            Class clazz = extendedMetaClasses.get(clazzCount);
            if (clazz.getName().equals(metaClassName))
                applicableStereotypes.add(stereotype);
        }

    }

    return applicableStereotypes;

}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:30,代码来源:SemanticModelHandlerUtil.java


示例4: getRMProfile

import org.eclipse.uml2.uml.Profile; //导入依赖的package包/类
/**
 * RM 프로파일 반환
 * 
 * @return Profile
 */
public static Profile getRMProfile() {
    Resource resource = null;
    URI profileURI = null;
    Profile profile = null;

    // RM 프로파일 로딩
    profileURI = URI.createURI(ManagerConstant.NEXCORE_UML_PROFILES_PATHMAP + ManagerConstant.RM_PROFILE_NAME
        + ManagerConstant.DOT + UMLResource.PROFILE_FILE_EXTENSION);
    if (domainModelHandler != null) {
        resource = domainModelHandler.getResourceSet().getResource(profileURI, true);
    } else {
        resource = getHandlerInstance().getResourceSet().getResource(profileURI, true);
    }

    if (!resource.isLoaded()) {
        try {
            resource.load(getLoadOptions());
        } catch (IOException e) {}
    }

    profile = getUMLProfileRoot(resource);

    return profile;
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:30,代码来源:DomainModelHandlerUtil.java


示例5: getStyledText

import org.eclipse.uml2.uml.Profile; //导入依赖的package包/类
/**
 * @see org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider#getStyledText(java.lang.Object)
 */
public StyledString getStyledText(Object element) {
    if (element instanceof ClosedTreeNode) {
        return new StyledString(getText(element), StyledString.createColorRegistryStyler("QUALIFIER_COLOR", null));// gray color
    } else if (element instanceof ITreeNode) {
        EObject eobject = ((ITreeNode) element).getEObject();
        if (eobject instanceof ProfileApplication) {
            ProfileApplication profileApplication = (ProfileApplication) eobject;

            Profile profile = profileApplication.getAppliedProfile();
            if (profile.eIsProxy()) {
                String text = String.format("'%s' does not exist.", getText(element));
                return new StyledString(text, StyledString.createColorRegistryStyler("ERROR_COLOR", null));// red color
            }
        }
    }

    return new StyledString(getText(element));
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:22,代码来源:UMLLabelProvider.java


示例6: setModel

import org.eclipse.uml2.uml.Profile; //导入依赖的package包/类
/**
 * @param model
 *            the model to set
 */
public void setModel(Model model) {
    this.model = model;

    if (model.getAllProfileApplications().size() > 0) {
        this.applyingProfileList = new ArrayList<Profile>();

        for (ProfileApplication profileApplication : model.getProfileApplications()) {
            if (profileApplication.getAppliedProfile() != null) {
                this.applyingProfileList.add(profileApplication.getAppliedProfile());
            }
        }
    } else {
        this.applyingProfileList = new ArrayList<Profile>();
    }
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:20,代码来源:ProfileComposite.java


示例7: isProfile

import org.eclipse.uml2.uml.Profile; //导入依赖的package包/类
public boolean isProfile(EPackage pkg) {
	// Papyrus custom metamodels have versioning annotations
	final boolean isPapyrusProfile = pkg.getEAnnotation("PapyrusVersion") != null;
	if (isPapyrusProfile) {
		return true;
	}

	// The standard profile is a regular Ecore generated EPackage
	final boolean isStandardProfile = pkg instanceof StandardPackage;
	if (isStandardProfile) {
		return true;
	}

	// UML and Ecore profiles are .profile.uml files with annotations, but not the Papyrus ones
	for (EObject parent = pkg.eContainer(); parent != null; parent = parent.eContainer()) {
		if (parent instanceof Profile) {
			return true;
		}
	}

	return false;
}
 
开发者ID:mondo-project,项目名称:mondo-hawk,代码行数:23,代码来源:UMLWrapperFactory.java


示例8: setUpUMLFile

import org.eclipse.uml2.uml.Profile; //导入依赖的package包/类
/**
 * Copies the content of the sourceUMLPath to the umlFile
 * The referenced Profile files will be also copied
 * @param sourceUMLPath - The path of the source .uml File
 */
private void setUpUMLFile(String sourceUMLPath){
		copyFile(sourceUMLPath, umlFile);
		
		Model m = getUmlModel();
		EList<Profile> profiles = m.getAllAppliedProfiles();
		for(Profile profile : profiles){
					String filestring = ((BasicEObjectImpl) profile).eProxyURI().toPlatformString(false);
					Path profileFilepath = new Path(filestring);
					
					String oldFolder = new Path(new Path(sourceUMLPath).toFile().getParent().toString()).toString();
					String oldFileName = oldFolder+Path.SEPARATOR+profileFilepath.toFile().getName();
					
					int index = umlFilePath.lastIndexOf(Path.SEPARATOR);
					String newFileName = umlFilePath.substring(0, index)+Path.SEPARATOR+profileFilepath.toFile().getName();
					IFile newFile = fileFromPath(newFileName);
					
					copyFile(oldFileName, newFile);
		}
}
 
开发者ID:ELTE-Soft,项目名称:txtUML,代码行数:25,代码来源:PapyrusModelCreator.java


示例9: loadProfiles

import org.eclipse.uml2.uml.Profile; //导入依赖的package包/类
private HashMap<String, Profile> loadProfiles(ATLModel atlModel, GlobalNamespace mm) {
	ResourceSet rs = new ResourceSetImpl();
	List<String> profileTags = ATLUtils.findCommaTags(atlModel.getModule(), "profile");		
	HashMap<String, Profile> profiles = new HashMap<String, Profile>();
	for (String tagValue : profileTags) {	
		String[] elems  = tagValue.split("=");
		if ( elems.length == 0 || elems.length > 2)
			continue;
		
		Profile p = null;
		String name = elems[0].trim();				
		MetamodelNamespace ns = mm.getNamespace(name);
		if ( elems.length == 1 ) {
			p = loadInMemoryProfile(rs, ns);
		} else if ( elems.length == 2 ) {
			p = loadFileProfile(rs, elems[1].trim());
		}				
		profiles.put(name, p);
	}

	return profiles;
}
 
开发者ID:anatlyzer,项目名称:anatlyzer,代码行数:23,代码来源:ProfileUsageExtension.java


示例10: addTopLevelPackage

import org.eclipse.uml2.uml.Profile; //导入依赖的package包/类
@Override
public void addTopLevelPackage(Package newPackage, String packageName, URI packageURI) {
       if (packageURI == null)
           packageURI = computePackageURI(packageName);
	Resource resource = resourceSet.createResource(packageURI);
       addPackage(resource, newPackage);
       MDDUtil.markGenerated(newPackage);
       newPackage.setName(packageName);
       newPackage.setURI(getBaseURI().lastSegment() + '/' + packageName);
       if (Boolean.parseBoolean(getProperties().getProperty(ENABLE_EXTENSIONS,
               System.getProperty(ENABLE_EXTENSIONS, Boolean.FALSE.toString())))) {
           Profile extensions = (Profile) findPackage(EXTENSIONS_NAMESPACE, Literals.PROFILE);
           if (extensions != null && extensions.isDefined())
               StereotypeUtils.safeApplyProfile(newPackage, extensions);
       }
       if (getWeaver() != null)
           getWeaver().packageCreated(this, newPackage);
}
 
开发者ID:abstratt,项目名称:textuml,代码行数:19,代码来源:Repository.java


示例11: applyProfiles

import org.eclipse.uml2.uml.Profile; //导入依赖的package包/类
private void applyProfiles() {
    for (NameReference profileName : this.profilesApplied)
        new ReferenceSetter<Profile>(profileName, getParentProduct(), getContext(),
                IReferenceTracker.Step.PROFILE_APPLICATIONS) {
            @Override
            protected void link(Profile profile) {
                if (!profile.isDefined())
                    getContext().getProblemTracker().add(
                            new InternalProblem("Profile '" + profile.getName() + "' not defined"));
                else {
                    if (!getProduct().getAppliedProfiles().contains(profile))
                        getProduct().applyProfile(profile);
                    if (!getProduct().getImportedPackages().contains(profile))
                        getProduct().createPackageImport(profile, VisibilityKind.PRIVATE_LITERAL);
                }
            }
        };
}
 
开发者ID:abstratt,项目名称:textuml,代码行数:19,代码来源:PackageBuilder.java


示例12: getNIEMGraProfiles

import org.eclipse.uml2.uml.Profile; //导入依赖的package包/类
@Operation(contextual = true, kind = Operation.Kind.QUERY)
public static List<Profile> getNIEMGraProfiles(final Model self) {
	List<Profile> existingProfiles=new Vector<Profile>();
	TreeIterator<EObject> tree=self.eAllContents();//eResource().getAllContents();
	boolean foundNiem=false;
	while(tree.hasNext()){
		EObject test=tree.next();
		if(test instanceof ProfileApplication){
			ProfileApplication profileApplication=(ProfileApplication)test;
			Profile profile=profileApplication.getAppliedProfile();
			existingProfiles.add(profile);
			if("NIEM_PIM_Profile".equals(profile.getName()))foundNiem=true;
		}
	}
	if(foundNiem)return existingProfiles;
    return new ArrayList<>(EcoreUtil.<Profile> getObjectsByType(
            ((Package) getNiemUmlProfile(self.eResource().getResourceSet()).getContents().get(0)).getNestedPackages(),
            UMLPackage.Literals.PROFILE));
}
 
开发者ID:GRA-UML,项目名称:tool,代码行数:20,代码来源:GraQvtLibrary.java


示例13: initializeModel

import org.eclipse.uml2.uml.Profile; //导入依赖的package包/类
/**
 * A standard Library model should have :
 *  - the Library profile applied
 *  
 * @see org.eclipse.papyrus.infra.core.extension.commands.ModelCreationCommandBase#initializeModel(org.eclipse.emf.ecore.EObject)
 *
 * @param owner
 */

@Override
protected void initializeModel(EObject owner) {
	super.initializeModel(owner);
	Package packageOwner = (Package) owner;
	// Retrieve Library profile and apply it
	Profile trainingLibraryProfile = (Profile) PackageUtil.loadPackage(URI.createURI(TrainingLibraryResources.PROFILE_PATH), owner.eResource().getResourceSet());
	if (trainingLibraryProfile != null) {
		PackageUtil.applyProfile(packageOwner, trainingLibraryProfile, true);
	}
}
 
开发者ID:bmaggi,项目名称:library-training,代码行数:20,代码来源:TrainingLibraryModelCreationCommand.java


示例14: getUMLProfileRoot

import org.eclipse.uml2.uml.Profile; //导入依赖的package包/类
/**
 * 인자로 넘어온 리소스의 UML 프로파일 최상위 객체 반환
 * 
 * @param resource
 * @return Profile
 */
public static Profile getUMLProfileRoot(Resource resource) {
    Profile profile = (org.eclipse.uml2.uml.Profile) EcoreUtil.getObjectByType(resource.getContents(),
        UMLPackage.Literals.PROFILE);

    return profile;
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:13,代码来源:DomainModelHandlerUtil.java


示例15: loadUMLCoreProfile

import org.eclipse.uml2.uml.Profile; //导入依赖的package包/类
/**
 * UML Core 프로파일 적재하는 메소드 void
 */
private void loadUMLCoreProfile() {
    Resource resource = null;
    URI profileURI = null;
    Profile profile = null;

    if (umlCoreProfileList == null) {
        umlCoreProfileList = new ArrayList<Object>();
    } else {
        umlCoreProfileList.clear();
    }

    // UML 프로파일 로딩
    for (int profileNameIdx = 0; profileNameIdx < ManagerConstant.UML_PROFILES_NAMES.length; profileNameIdx++) {
        profileURI = URI.createURI(ManagerConstant.NEXCORE_UML_PROFILES_PATHMAP
            + ManagerConstant.UML_PROFILES_NAMES[profileNameIdx] + ManagerConstant.DOT
            + UMLResource.PROFILE_FILE_EXTENSION);

        resource = DomainRegistry.getEditingDomain().getResourceSet().getResource(profileURI, true);

        if (!resource.isLoaded()) {
            try {
                resource.load(DomainUtil.getLoadOptions());
            } catch (IOException e) {}
        }

        profile = DomainUtil.getUMLProfileRoot(resource);

        umlCoreProfileList.add(profile);
    }

}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:35,代码来源:UMLUiCorePrecedingInitializer.java


示例16: ApplyProfileWizardPage

import org.eclipse.uml2.uml.Profile; //导入依赖的package包/类
/**
 * ApplyProfileWizardPage
 * @param pageName
 */
protected ApplyProfileWizardPage(String pageName) {
    super(pageName);
    this.uri = uri;
    setTitle(UMLMessage.LABEL_APPLY_PROFILE);
    applyingProfileList = new ArrayList<Profile>();
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:11,代码来源:ApplyProfileWizardPage.java


示例17: createDeleteProfileButton

import org.eclipse.uml2.uml.Profile; //导入依赖的package包/类
/**
 * 프로파일 삭제버튼 컨트롤 생성
 * 
 * @param buttonComposite
 *            void
 */
private void createDeleteProfileButton(Composite buttonComposite) {
    deleteProfileButton = new Button(buttonComposite, SWT.PUSH);
    deleteProfileButton.setText(UMLMessage.LABEL_REMOVE);
    deleteProfileButton.setEnabled(false);
    GridData gridData = new GridData(GridData.FILL, GridData.BEGINNING, true, true);
    gridData.widthHint = 60;
    deleteProfileButton.setLayoutData(gridData);
    
    deleteProfileButton.addSelectionListener(new SelectionAdapter() {
        /**
         * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
         */
        public void widgetSelected(SelectionEvent event) {
            if (event != null) {

                for (Iterator<Profile> iterator = ((IStructuredSelection) profileTableViewer.getSelection()).iterator(); iterator.hasNext();) {
                    Profile selectedProfile = (Profile) iterator.next();

                    applyingProfileList.remove(selectedProfile);
                }
                profileTableViewer.setInput(applyingProfileList.toArray());
                profileTableViewer.refresh();
            }
        }
    });
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:33,代码来源:ApplyProfileWizardPage.java


示例18: createDeleteProfileButton

import org.eclipse.uml2.uml.Profile; //导入依赖的package包/类
/**
 * 프로파일 삭제버튼 컨트롤 생성
 * 
 * @param buttonComposite
 *            void
 */
private void createDeleteProfileButton(Composite buttonComposite) {
    deleteProfileButton = new Button(buttonComposite, SWT.PUSH);
    deleteProfileButton.setText(UMLMessage.LABEL_REMOVE);
    deleteProfileButton.setEnabled(false);
    GridData gridData = new GridData(SWT.FILL, SWT.TOP, true, true);
    gridData.widthHint = 60;
    deleteProfileButton.setLayoutData(gridData);
    
    deleteProfileButton.addSelectionListener(new SelectionAdapter() {
        /**
         * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
         */
        public void widgetSelected(SelectionEvent event) {
            if (event != null) {

                for (Iterator<Profile> iterator = ((IStructuredSelection) profileTableViewer.getSelection()).iterator(); iterator.hasNext();) {
                    Profile selectedProfile = (Profile) iterator.next();

                    applyingProfileList.remove(selectedProfile);
                }
                profileTableViewer.setInput(applyingProfileList.toArray());
                profileTableViewer.refresh();
                
                apply();
                
                callerSection.isDirty();
            }
        }
    });
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:37,代码来源:ProfileComposite.java


示例19: getColumnText

import org.eclipse.uml2.uml.Profile; //导入依赖的package包/类
/**
 * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object,
 *      int)
 */
public String getColumnText(Object element, int columnIndex) {
    Profile appliedProfile = (Profile) element;

    if (PrecedingInitializerRegistry.getInstance()
        .isProjectExist(ManagerConstant.NEXCORE_TOOL_MDA_CORE_PRECEDING_INITIALIZER_ID)) {
        switch (columnIndex) {
            case 0:
                if (appliedProfile.eIsProxy()) {
                    return "unknown";
                } else {
                    return appliedProfile.getName();
                }
            case 1:
                if (appliedProfile.eIsProxy()) {
                    String uriString = EcoreUtil.getURI(appliedProfile).toString();
                    String[] split = uriString.split("#");
                    return split != null && split.length == 2 ? split[0] : uriString;
                } else {
                    return appliedProfile.eResource() != null ? appliedProfile.eResource().getURI().toString()
                    : UICoreConstant.PROJECT_CONSTANTS__EMPTY_STRING;
                }

            default:
                return UICoreConstant.PROJECT_CONSTANTS__EMPTY_STRING;
        }
    } else {
        switch (columnIndex) {
            default:
                return UICoreConstant.PROJECT_CONSTANTS__EMPTY_STRING;
        }
    }
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:37,代码来源:ProfileTableViewerLabelProvider.java


示例20: HandleProfileCommand

import org.eclipse.uml2.uml.Profile; //导入依赖的package包/类
/**
 * 생성자
 * 
 * @param domain
 * @param packageElement
 * @param profile
 * @param applyProfile
 */
public HandleProfileCommand(TransactionalEditingDomain domain, Package packageElement, Profile profile, boolean applyProfile) {
    super(domain);

    this.packageElement = packageElement;
    this.profile = profile;

    this.applyProfile = applyProfile;
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:17,代码来源:HandleProfileCommand.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Word类代码示例发布时间:2022-05-22
下一篇:
Java SignatureType类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap