use of org.obeonetwork.graal.DomainClass in project InformationSystem by ObeoNetwork.
the class DomainClassDomainClassPropertiesEditionComponent method initPart.
/**
* {@inheritDoc}
*
* @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#initPart(java.lang.Object, int, org.eclipse.emf.ecore.EObject,
* org.eclipse.emf.ecore.resource.ResourceSet)
*/
public void initPart(Object key, int kind, EObject elt, ResourceSet allResource) {
setInitializing(true);
if (editingPart != null && key == partKey) {
editingPart.setContext(elt, allResource);
final DomainClass domainClass = (DomainClass) elt;
final DomainClassPropertiesEditionPart domainClassPart = (DomainClassPropertiesEditionPart) editingPart;
// init values
if (isAccessible(GraalViewsRepository.DomainClass.Properties.name))
domainClassPart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, domainClass.getName()));
if (isAccessible(GraalViewsRepository.DomainClass.Properties.superType)) {
// init part
superTypeSettings = new EObjectFlatComboSettings(domainClass, EnvironmentPackage.eINSTANCE.getStructuredType_Supertype());
domainClassPart.initSuperType(superTypeSettings);
// set the button mode
domainClassPart.setSuperTypeButtonMode(ButtonsModeEnum.BROWSE);
}
if (isAccessible(GraalViewsRepository.DomainClass.Properties.description))
domainClassPart.setDescription(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, domainClass.getDescription()));
if (isAccessible(GraalViewsRepository.DomainClass.Properties.associatedTypes)) {
associatedTypesSettings = new ReferencesTableSettings(domainClass, EnvironmentPackage.eINSTANCE.getStructuredType_AssociatedTypes());
domainClassPart.initAssociatedTypes(associatedTypesSettings);
}
if (isAccessible(GraalViewsRepository.DomainClass.Properties.associatedTypes)) {
domainClassPart.addFilterToAssociatedTypes(new EObjectFilter(EnvironmentPackage.Literals.STRUCTURED_TYPE));
// Start of user code for additional businessfilters for associatedTypes
// End of user code
}
// init values for referenced views
// init filters for referenced views
}
setInitializing(false);
}
use of org.obeonetwork.graal.DomainClass in project InformationSystem by ObeoNetwork.
the class DomainClassPersistencePropertiesEditionComponent method initPart.
/**
* {@inheritDoc}
*
* @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#initPart(java.lang.Object, int, org.eclipse.emf.ecore.EObject,
* org.eclipse.emf.ecore.resource.ResourceSet)
*/
public void initPart(Object key, int kind, EObject elt, ResourceSet allResource) {
setInitializing(true);
if (editingPart != null && key == partKey) {
editingPart.setContext(elt, allResource);
final DomainClass domainClass = (DomainClass) elt;
final PersistencePropertiesEditionPart persistencePart = (PersistencePropertiesEditionPart) editingPart;
// init values
if (isAccessible(GraalViewsRepository.Persistence.Properties.estimatedVolumetry)) {
persistencePart.setEstimatedVolumetry(EEFConverterUtil.convertToString(EcorePackage.Literals.EINT, domainClass.getEstimatedVolumetry()));
}
if (isAccessible(GraalViewsRepository.Persistence.Properties.historized)) {
persistencePart.setHistorized(domainClass.isHistorized());
}
// init filters
// init values for referenced views
// init filters for referenced views
}
setInitializing(false);
}
use of org.obeonetwork.graal.DomainClass in project InformationSystem by ObeoNetwork.
the class DomainClassServicesTest method testAnnotationWithNoMetadataContainer.
@Test
public void testAnnotationWithNoMetadataContainer() {
System system = loadRoot("AnnotationWithNoMetadataContainer.graal", System.class);
DomainClass domainClass = query(() -> {
return (DomainClass) system.getOwnedNamespaces().get(0).getTypes().get(0);
});
assertEquals("", getPhysicalSize(domainClass));
}
use of org.obeonetwork.graal.DomainClass in project InformationSystem by ObeoNetwork.
the class DomainClassServicesTest method testAnnotationNotPresent.
@Test
public void testAnnotationNotPresent() {
System system = loadRoot("AnnotationNotPresent.graal", System.class);
DomainClass domainClass = query(() -> {
return (DomainClass) system.getOwnedNamespaces().get(0).getTypes().get(0);
});
assertEquals("", getPhysicalSize(domainClass));
}
use of org.obeonetwork.graal.DomainClass in project InformationSystem by ObeoNetwork.
the class UseCaseServicesTest method verifyAllDomainClasses.
private void verifyAllDomainClasses(UseCase uc, String[] expectedClassesNames) {
UseCaseServices service = new UseCaseServices();
List<DomainClass> allDomainClasses = service.allDomainClasses(uc);
Stream<String> domainClassesNames = allDomainClasses.stream().map((domainClass) -> service.fullQualifiedName(domainClass));
assertArrayEquals("", expectedClassesNames, domainClassesNames.toArray());
}
Aggregations