use of org.eclipse.emf.eef.runtime.context.impl.EObjectPropertiesEditionContext in project InformationSystem by ObeoNetwork.
the class LoopLoopPropertiesEditionComponent method updateSemanticModel.
/**
* {@inheritDoc}
* @see org.eclipse.emf.eef.runtime.impl.components.StandardPropertiesEditionComponent#updateSemanticModel(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent)
*/
public void updateSemanticModel(final IPropertiesEditionEvent event) {
Loop loop = (Loop) semanticObject;
if (GraalViewsRepository.Loop.Properties.description == event.getAffectedEditor()) {
loop.setDescription((java.lang.String) EEFConverterUtil.createFromString(EcorePackage.Literals.ESTRING, (String) event.getNewValue()));
}
if (GraalViewsRepository.Loop.Properties.subActivities == event.getAffectedEditor()) {
if (event.getKind() == PropertiesEditionEvent.ADD) {
EReferencePropertiesEditionContext context = new EReferencePropertiesEditionContext(editingContext, this, subActivitiesSettings, editingContext.getAdapterFactory());
PropertiesEditingProvider provider = (PropertiesEditingProvider) editingContext.getAdapterFactory().adapt(semanticObject, PropertiesEditingProvider.class);
if (provider != null) {
PropertiesEditingPolicy policy = provider.getPolicy(context);
if (policy instanceof CreateEditingPolicy) {
policy.execute();
}
}
} else if (event.getKind() == PropertiesEditionEvent.EDIT) {
EObjectPropertiesEditionContext context = new EObjectPropertiesEditionContext(editingContext, this, (EObject) event.getNewValue(), editingContext.getAdapterFactory());
PropertiesEditingProvider provider = (PropertiesEditingProvider) editingContext.getAdapterFactory().adapt((EObject) event.getNewValue(), PropertiesEditingProvider.class);
if (provider != null) {
PropertiesEditingPolicy editionPolicy = provider.getPolicy(context);
if (editionPolicy != null) {
editionPolicy.execute();
}
}
} else if (event.getKind() == PropertiesEditionEvent.REMOVE) {
subActivitiesSettings.removeFromReference((EObject) event.getNewValue());
} else if (event.getKind() == PropertiesEditionEvent.MOVE) {
subActivitiesSettings.move(event.getNewIndex(), (Loop) event.getNewValue());
}
}
if (GraalViewsRepository.Loop.Properties.lowerBound == event.getAffectedEditor()) {
loop.setLowerBound((EEFConverterUtil.createIntFromString(EcorePackage.Literals.EINT, (String) event.getNewValue())));
}
if (GraalViewsRepository.Loop.Properties.upperBound == event.getAffectedEditor()) {
loop.setUpperBound((EEFConverterUtil.createIntFromString(EcorePackage.Literals.EINT, (String) event.getNewValue())));
}
}
use of org.eclipse.emf.eef.runtime.context.impl.EObjectPropertiesEditionContext in project InformationSystem by ObeoNetwork.
the class EntityPropertiesEditionPartImpl method editAssociatedTypes.
/**
*/
protected void editAssociatedTypes(EObject element) {
EObjectPropertiesEditionContext context = new EObjectPropertiesEditionContext(propertiesEditionComponent.getEditingContext(), propertiesEditionComponent, element, adapterFactory);
PropertiesEditingProvider provider = (PropertiesEditingProvider) adapterFactory.adapt(element, PropertiesEditingProvider.class);
if (provider != null) {
PropertiesEditingPolicy policy = provider.getPolicy(context);
if (policy != null) {
policy.execute();
associatedTypes.refresh();
}
}
}
use of org.eclipse.emf.eef.runtime.context.impl.EObjectPropertiesEditionContext in project InformationSystem by ObeoNetwork.
the class TransitionPropertiesEditionPartForm method editOn.
/**
*/
protected void editOn(EObject element) {
EObjectPropertiesEditionContext context = new EObjectPropertiesEditionContext(propertiesEditionComponent.getEditingContext(), propertiesEditionComponent, element, adapterFactory);
PropertiesEditingProvider provider = (PropertiesEditingProvider) adapterFactory.adapt(element, PropertiesEditingProvider.class);
if (provider != null) {
PropertiesEditingPolicy policy = provider.getPolicy(context);
if (policy != null) {
policy.execute();
on.refresh();
}
}
}
use of org.eclipse.emf.eef.runtime.context.impl.EObjectPropertiesEditionContext in project InformationSystem by ObeoNetwork.
the class FlowEventPropertiesEditionPartImpl method editBinds.
/**
*/
protected void editBinds(EObject element) {
EObjectPropertiesEditionContext context = new EObjectPropertiesEditionContext(propertiesEditionComponent.getEditingContext(), propertiesEditionComponent, element, adapterFactory);
PropertiesEditingProvider provider = (PropertiesEditingProvider) adapterFactory.adapt(element, PropertiesEditingProvider.class);
if (provider != null) {
PropertiesEditingPolicy policy = provider.getPolicy(context);
if (policy != null) {
policy.execute();
binds.refresh();
}
}
}
use of org.eclipse.emf.eef.runtime.context.impl.EObjectPropertiesEditionContext in project InformationSystem by ObeoNetwork.
the class ViewStatePropertiesEditionPartImpl method editViewContainers.
/**
*/
protected void editViewContainers(EObject element) {
EObjectPropertiesEditionContext context = new EObjectPropertiesEditionContext(propertiesEditionComponent.getEditingContext(), propertiesEditionComponent, element, adapterFactory);
PropertiesEditingProvider provider = (PropertiesEditingProvider) adapterFactory.adapt(element, PropertiesEditingProvider.class);
if (provider != null) {
PropertiesEditingPolicy policy = provider.getPolicy(context);
if (policy != null) {
policy.execute();
viewContainers.refresh();
}
}
}
Aggregations