use of org.eclipse.emf.eef.runtime.impl.parts.CompositePropertiesEditionPart in project InformationSystem by ObeoNetwork.
the class RiskPropertiesEditionComponent 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);
if (editingPart instanceof CompositePropertiesEditionPart) {
((CompositePropertiesEditionPart) editingPart).getSettings().add(benefitsSettings);
((CompositePropertiesEditionPart) editingPart).getSettings().add(drawbacksSettings);
((CompositePropertiesEditionPart) editingPart).getSettings().add(riskSettings);
}
final RiskPropertiesEditionPart riskPart = (RiskPropertiesEditionPart) editingPart;
// init values
if (benefitsSettings.getSignificantObject() != null && isAccessible(GraalextensionsViewsRepository.Risk.Properties.benefits)) {
riskPart.initBenefits(EEFUtils.choiceOfValues(benefitsSettings.getSignificantObject(), GraalExtensionsPackage.eINSTANCE.getRisk_Benefits()), (Enumerator) benefitsSettings.getValue());
}
if (drawbacksSettings.getSignificantObject() != null && isAccessible(GraalextensionsViewsRepository.Risk.Properties.drawbacks)) {
riskPart.initDrawbacks(EEFUtils.choiceOfValues(drawbacksSettings.getSignificantObject(), GraalExtensionsPackage.eINSTANCE.getRisk_Drawbacks()), (Enumerator) drawbacksSettings.getValue());
}
if (riskSettings.getSignificantObject() != null && isAccessible(GraalextensionsViewsRepository.Risk.Properties.risk_)) {
riskPart.initRisk(EEFUtils.choiceOfValues(riskSettings.getSignificantObject(), GraalExtensionsPackage.eINSTANCE.getRisk_Risk()), (Enumerator) riskSettings.getValue());
}
// init filters
// init values for referenced views
// init filters for referenced views
}
setInitializing(false);
}
use of org.eclipse.emf.eef.runtime.impl.parts.CompositePropertiesEditionPart in project InformationSystem by ObeoNetwork.
the class MetadataCptPropertiesEditionComponent 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);
if (editingPart instanceof CompositePropertiesEditionPart) {
((CompositePropertiesEditionPart) editingPart).getSettings().add(metadataSettings);
}
final ObeoDSMObject obeoDSMObject = (ObeoDSMObject) elt;
final MetadatasPropertiesEditionPart metadatasPart = (MetadatasPropertiesEditionPart) editingPart;
// init values
if (isAccessible(EnvironmentViewsRepository.Metadatas.Properties.metadata)) {
metadataSettings = new ReferencesTableSettings(obeoDSMObject, EnvironmentPackage.eINSTANCE.getObeoDSMObject_Metadatas(), EnvironmentPackage.eINSTANCE.getMetaDataContainer_Metadatas());
metadatasPart.initMetadata(metadataSettings);
}
// init filters
if (isAccessible(EnvironmentViewsRepository.Metadatas.Properties.metadata)) {
metadatasPart.addFilterToMetadata(new ViewerFilter() {
/**
* {@inheritDoc}
*
* @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
public boolean select(Viewer viewer, Object parentElement, Object element) {
if (element instanceof String)
// $NON-NLS-1$
return element.equals("");
if (element instanceof MetaData)
return true;
return element instanceof Resource;
}
});
// Start of user code for additional businessfilters for metadata
// End of user code
}
// init values for referenced views
// init filters for referenced views
}
setInitializing(false);
}
use of org.eclipse.emf.eef.runtime.impl.parts.CompositePropertiesEditionPart in project InformationSystem by ObeoNetwork.
the class ReferenceOppositePropertiesEditionComponent 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);
if (editingPart instanceof CompositePropertiesEditionPart) {
((CompositePropertiesEditionPart) editingPart).getSettings().add(oppositeNameSettings);
((CompositePropertiesEditionPart) editingPart).getSettings().add(oppositeReferencedTypeSettings);
((CompositePropertiesEditionPart) editingPart).getSettings().add(oppositeMultiplicitySettings);
((CompositePropertiesEditionPart) editingPart).getSettings().add(oppositeIsCompositeSettings);
((CompositePropertiesEditionPart) editingPart).getSettings().add(oppositeNavigableSettings);
((CompositePropertiesEditionPart) editingPart).getSettings().add(oppositeIdentifierSettings);
((CompositePropertiesEditionPart) editingPart).getSettings().add(oppositeDescriptionSettings);
}
final Reference reference = (Reference) elt;
final OppositePropertiesEditionPart oppositePart = (OppositePropertiesEditionPart) editingPart;
// init values
if (oppositeNameSettings.getValue() != null && isAccessible(EnvironmentViewsRepository.Opposite.Properties.name))
oppositePart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, oppositeNameSettings.getValue()));
// FIXME NO VALID CASE INTO template public updater(editionElement : PropertiesEditionElement, view : View, pec : PropertiesEditionComponent) in widgetControl.mtl module, with the values : oppositeReferencedType, Opposite, reference.
if (oppositeMultiplicitySettings.getSignificantObject() != null && isAccessible(EnvironmentViewsRepository.Opposite.Properties.multiplicity)) {
oppositePart.initMultiplicity(EEFUtils.choiceOfValues(oppositeMultiplicitySettings.getSignificantObject(), EnvironmentPackage.eINSTANCE.getProperty_Multiplicity()), (Enumerator) oppositeMultiplicitySettings.getValue());
}
if (isAccessible(EnvironmentViewsRepository.Opposite.Properties.isComposite)) {
oppositePart.setIsComposite((Boolean) oppositeIsCompositeSettings.getValue());
}
if (isAccessible(EnvironmentViewsRepository.Opposite.Properties.navigable)) {
oppositePart.setNavigable((Boolean) oppositeNavigableSettings.getValue());
}
if (isAccessible(EnvironmentViewsRepository.Opposite.Properties.identifier)) {
oppositePart.setIdentifier((Boolean) oppositeIdentifierSettings.getValue());
}
if (oppositeDescriptionSettings.getValue() != null && isAccessible(EnvironmentViewsRepository.Opposite.Properties.description))
oppositePart.setDescription(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, oppositeDescriptionSettings.getValue()));
// init filters
// FIXME NO VALID CASE INTO template public filterUpdater(editionElement : PropertiesEditionElement, view : View, pec : PropertiesEditionComponent) in widgetControl.mtl module, with the values : oppositeReferencedType, Opposite, reference.
// init values for referenced views
// init filters for referenced views
}
setInitializing(false);
}
use of org.eclipse.emf.eef.runtime.impl.parts.CompositePropertiesEditionPart in project InformationSystem by ObeoNetwork.
the class ReferenceOppositePropertiesEditionComponentSpec method initPart.
@Override
public void initPart(Object key, int kind, EObject elt, ResourceSet allResource) {
setInitializing(true);
if (editingPart != null && key == partKey) {
editingPart.setContext(elt, allResource);
if (editingPart instanceof CompositePropertiesEditionPart) {
((CompositePropertiesEditionPart) editingPart).getSettings().add(oppositeNameSettings);
((CompositePropertiesEditionPart) editingPart).getSettings().add(oppositeReferencedTypeSettings);
((CompositePropertiesEditionPart) editingPart).getSettings().add(oppositeMultiplicitySettings);
((CompositePropertiesEditionPart) editingPart).getSettings().add(oppositeIsCompositeSettings);
((CompositePropertiesEditionPart) editingPart).getSettings().add(oppositeNavigableSettings);
((CompositePropertiesEditionPart) editingPart).getSettings().add(oppositeIdentifierSettings);
((CompositePropertiesEditionPart) editingPart).getSettings().add(oppositeDescriptionSettings);
}
final OppositePropertiesEditionPart oppositePart = (OppositePropertiesEditionPart) editingPart;
if (elt != null && elt instanceof Reference) {
// init values
if (oppositeNameSettings.getValue() != null && isAccessible(EnvironmentViewsRepository.Opposite.Properties.name))
oppositePart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, oppositeNameSettings.getValue()));
if (oppositeMultiplicitySettings.getSignificantObject() != null && isAccessible(EnvironmentViewsRepository.Opposite.Properties.multiplicity)) {
oppositePart.initMultiplicity(EEFUtils.choiceOfValues(oppositeMultiplicitySettings.getSignificantObject(), EnvironmentPackage.eINSTANCE.getProperty_Multiplicity()), (Enumerator) oppositeMultiplicitySettings.getValue());
}
if (isAccessible(EnvironmentViewsRepository.Opposite.Properties.isComposite)) {
oppositePart.setIsComposite((Boolean) oppositeIsCompositeSettings.getValue());
}
if (isAccessible(EnvironmentViewsRepository.Opposite.Properties.navigable)) {
oppositePart.setNavigable((Boolean) oppositeNavigableSettings.getValue());
}
if (isAccessible(EnvironmentViewsRepository.Opposite.Properties.identifier)) {
oppositePart.setIdentifier((Boolean) oppositeIdentifierSettings.getValue());
}
if (oppositeDescriptionSettings.getValue() != null && isAccessible(EnvironmentViewsRepository.Opposite.Properties.description))
oppositePart.setDescription(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, oppositeDescriptionSettings.getValue()));
if (this.oppositeReferencedTypeSettings.getSignificantObject() != null && isAccessible(EnvironmentViewsRepository.Opposite.Properties.referencedType)) {
oppositePart.setReferencedType((EObject) this.oppositeReferencedTypeSettings.getValue());
}
} else {
// no value
}
}
setInitializing(false);
}
use of org.eclipse.emf.eef.runtime.impl.parts.CompositePropertiesEditionPart in project InformationSystem by ObeoNetwork.
the class TablePrimaryKeyPropertiesEditionComponent 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);
if (editingPart instanceof CompositePropertiesEditionPart) {
((CompositePropertiesEditionPart) editingPart).getSettings().add(pkNameSettings);
((CompositePropertiesEditionPart) editingPart).getSettings().add(pkColumnsSettings);
((CompositePropertiesEditionPart) editingPart).getSettings().add(pkCommentsSettings);
}
final Table table = (Table) elt;
final PrimaryKeyPropertiesEditionPart primaryKeyPart = (PrimaryKeyPropertiesEditionPart) editingPart;
// init values
if (pkNameSettings.getValue() != null && isAccessible(DatabaseViewsRepository.PrimaryKey.Properties.name))
primaryKeyPart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, pkNameSettings.getValue()));
if (isAccessible(DatabaseViewsRepository.PrimaryKey.Properties.columns)) {
pkColumnsSettings = new ReferencesTableSettings(table, DatabasePackage.eINSTANCE.getTable_PrimaryKey(), DatabasePackage.eINSTANCE.getPrimaryKey_Columns());
primaryKeyPart.initColumns(pkColumnsSettings);
}
if (pkCommentsSettings.getValue() != null && isAccessible(DatabaseViewsRepository.PrimaryKey.Properties.comments))
primaryKeyPart.setComments(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, pkCommentsSettings.getValue()));
if (isAccessible(DatabaseViewsRepository.PrimaryKey.Properties.columns)) {
primaryKeyPart.addFilterToColumns(new EObjectStrictFilter(DatabasePackage.Literals.COLUMN));
// Start of user code for additional businessfilters for pkColumns
// End of user code
}
// init values for referenced views
// init filters for referenced views
}
setInitializing(false);
}
Aggregations