use of org.obeonetwork.dsl.entity.parts.EntityPropertiesEditionPart in project InformationSystem by ObeoNetwork.
the class EntityEntityPropertiesEditionComponent 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 Entity entity = (Entity) elt;
final EntityPropertiesEditionPart entityPart = (EntityPropertiesEditionPart) editingPart;
// init values
if (isAccessible(EntityViewsRepository.Entity_.Properties.name))
entityPart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, entity.getName()));
if (isAccessible(EntityViewsRepository.Entity_.Properties.superType)) {
// init part
superTypeSettings = new EObjectFlatComboSettings(entity, EnvironmentPackage.eINSTANCE.getStructuredType_Supertype());
entityPart.initSuperType(superTypeSettings);
// set the button mode
entityPart.setSuperTypeButtonMode(ButtonsModeEnum.BROWSE);
}
if (isAccessible(EntityViewsRepository.Entity_.Properties.description))
entityPart.setDescription(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, entity.getDescription()));
if (isAccessible(EntityViewsRepository.Entity_.Properties.associatedTypes)) {
associatedTypesSettings = new ReferencesTableSettings(entity, EnvironmentPackage.eINSTANCE.getStructuredType_AssociatedTypes());
entityPart.initAssociatedTypes(associatedTypesSettings);
}
if (isAccessible(EntityViewsRepository.Entity_.Properties.associatedTypes)) {
entityPart.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);
}
Aggregations