use of org.obeonetwork.dsl.cinematic.Package in project InformationSystem by ObeoNetwork.
the class CinematicRootCinematicRootPropertiesEditionComponent 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) {
CinematicRoot cinematicRoot = (CinematicRoot) semanticObject;
if (CinematicViewsRepository.CinematicRoot.Properties.description == event.getAffectedEditor()) {
cinematicRoot.setDescription((java.lang.String) EEFConverterUtil.createFromString(EcorePackage.Literals.ESTRING, (String) event.getNewValue()));
}
if (CinematicViewsRepository.CinematicRoot.Properties.name == event.getAffectedEditor()) {
cinematicRoot.setName((java.lang.String) EEFConverterUtil.createFromString(EcorePackage.Literals.ESTRING, (String) event.getNewValue()));
}
if (CinematicViewsRepository.CinematicRoot.Properties.flows == event.getAffectedEditor()) {
if (event.getKind() == PropertiesEditionEvent.ADD) {
EReferencePropertiesEditionContext context = new EReferencePropertiesEditionContext(editingContext, this, flowsSettings, 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) {
flowsSettings.removeFromReference((EObject) event.getNewValue());
} else if (event.getKind() == PropertiesEditionEvent.MOVE) {
flowsSettings.move(event.getNewIndex(), (Flow) event.getNewValue());
}
}
if (CinematicViewsRepository.CinematicRoot.Properties.viewContainers == event.getAffectedEditor()) {
if (event.getKind() == PropertiesEditionEvent.ADD) {
EReferencePropertiesEditionContext context = new EReferencePropertiesEditionContext(editingContext, this, viewContainersSettings, 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) {
viewContainersSettings.removeFromReference((EObject) event.getNewValue());
} else if (event.getKind() == PropertiesEditionEvent.MOVE) {
viewContainersSettings.move(event.getNewIndex(), (ViewContainer) event.getNewValue());
}
}
if (CinematicViewsRepository.CinematicRoot.Properties.subPackages == event.getAffectedEditor()) {
if (event.getKind() == PropertiesEditionEvent.ADD) {
EReferencePropertiesEditionContext context = new EReferencePropertiesEditionContext(editingContext, this, subPackagesSettings, 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) {
subPackagesSettings.removeFromReference((EObject) event.getNewValue());
} else if (event.getKind() == PropertiesEditionEvent.MOVE) {
subPackagesSettings.move(event.getNewIndex(), (Package) event.getNewValue());
}
}
}
use of org.obeonetwork.dsl.cinematic.Package in project InformationSystem by ObeoNetwork.
the class PackagePackage_PropertiesEditionComponent 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 Package package_ = (Package) elt;
final Package_PropertiesEditionPart package_Part = (Package_PropertiesEditionPart) editingPart;
// init values
if (isAccessible(CinematicViewsRepository.Package_.Properties.description))
package_Part.setDescription(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, package_.getDescription()));
if (isAccessible(CinematicViewsRepository.Package_.Properties.name))
package_Part.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, package_.getName()));
if (isAccessible(CinematicViewsRepository.Package_.Properties.flows)) {
flowsSettings = new ReferencesTableSettings(package_, CinematicPackage.eINSTANCE.getAbstractPackage_Flows());
package_Part.initFlows(flowsSettings);
}
if (isAccessible(CinematicViewsRepository.Package_.Properties.viewContainers)) {
viewContainersSettings = new ReferencesTableSettings(package_, CinematicPackage.eINSTANCE.getAbstractPackage_ViewContainers());
package_Part.initViewContainers(viewContainersSettings);
}
if (isAccessible(CinematicViewsRepository.Package_.Properties.subPackages)) {
subPackagesSettings = new ReferencesTableSettings(package_, CinematicPackage.eINSTANCE.getAbstractPackage_SubPackages());
package_Part.initSubPackages(subPackagesSettings);
}
if (isAccessible(CinematicViewsRepository.Package_.Properties.flows)) {
package_Part.addFilterToFlows(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) {
// $NON-NLS-1$
return (element instanceof String && element.equals("")) || (element instanceof Flow);
}
});
// Start of user code for additional businessfilters for flows
// End of user code
}
if (isAccessible(CinematicViewsRepository.Package_.Properties.viewContainers)) {
package_Part.addFilterToViewContainers(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) {
// $NON-NLS-1$
return (element instanceof String && element.equals("")) || (element instanceof ViewContainer);
}
});
// Start of user code for additional businessfilters for viewContainers
// End of user code
}
if (isAccessible(CinematicViewsRepository.Package_.Properties.subPackages)) {
package_Part.addFilterToSubPackages(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) {
// $NON-NLS-1$
return (element instanceof String && element.equals("")) || (element instanceof Package);
}
});
// Start of user code for additional businessfilters for subPackages
// End of user code
}
// init values for referenced views
// init filters for referenced views
}
setInitializing(false);
}
use of org.obeonetwork.dsl.cinematic.Package in project InformationSystem by ObeoNetwork.
the class PackagePackage_PropertiesEditionComponent 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) {
Package package_ = (Package) semanticObject;
if (CinematicViewsRepository.Package_.Properties.description == event.getAffectedEditor()) {
package_.setDescription((java.lang.String) EEFConverterUtil.createFromString(EcorePackage.Literals.ESTRING, (String) event.getNewValue()));
}
if (CinematicViewsRepository.Package_.Properties.name == event.getAffectedEditor()) {
package_.setName((java.lang.String) EEFConverterUtil.createFromString(EcorePackage.Literals.ESTRING, (String) event.getNewValue()));
}
if (CinematicViewsRepository.Package_.Properties.flows == event.getAffectedEditor()) {
if (event.getKind() == PropertiesEditionEvent.ADD) {
EReferencePropertiesEditionContext context = new EReferencePropertiesEditionContext(editingContext, this, flowsSettings, 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) {
flowsSettings.removeFromReference((EObject) event.getNewValue());
} else if (event.getKind() == PropertiesEditionEvent.MOVE) {
flowsSettings.move(event.getNewIndex(), (Flow) event.getNewValue());
}
}
if (CinematicViewsRepository.Package_.Properties.viewContainers == event.getAffectedEditor()) {
if (event.getKind() == PropertiesEditionEvent.ADD) {
EReferencePropertiesEditionContext context = new EReferencePropertiesEditionContext(editingContext, this, viewContainersSettings, 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) {
viewContainersSettings.removeFromReference((EObject) event.getNewValue());
} else if (event.getKind() == PropertiesEditionEvent.MOVE) {
viewContainersSettings.move(event.getNewIndex(), (ViewContainer) event.getNewValue());
}
}
if (CinematicViewsRepository.Package_.Properties.subPackages == event.getAffectedEditor()) {
if (event.getKind() == PropertiesEditionEvent.ADD) {
EReferencePropertiesEditionContext context = new EReferencePropertiesEditionContext(editingContext, this, subPackagesSettings, 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) {
subPackagesSettings.removeFromReference((EObject) event.getNewValue());
} else if (event.getKind() == PropertiesEditionEvent.MOVE) {
subPackagesSettings.move(event.getNewIndex(), (Package) event.getNewValue());
}
}
}
use of org.obeonetwork.dsl.cinematic.Package in project InformationSystem by ObeoNetwork.
the class CinematicRootCinematicRootPropertiesEditionComponent 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 CinematicRoot cinematicRoot = (CinematicRoot) elt;
final CinematicRootPropertiesEditionPart cinematicRootPart = (CinematicRootPropertiesEditionPart) editingPart;
// init values
if (isAccessible(CinematicViewsRepository.CinematicRoot.Properties.description))
cinematicRootPart.setDescription(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, cinematicRoot.getDescription()));
if (isAccessible(CinematicViewsRepository.CinematicRoot.Properties.name))
cinematicRootPart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, cinematicRoot.getName()));
if (isAccessible(CinematicViewsRepository.CinematicRoot.Properties.flows)) {
flowsSettings = new ReferencesTableSettings(cinematicRoot, CinematicPackage.eINSTANCE.getAbstractPackage_Flows());
cinematicRootPart.initFlows(flowsSettings);
}
if (isAccessible(CinematicViewsRepository.CinematicRoot.Properties.viewContainers)) {
viewContainersSettings = new ReferencesTableSettings(cinematicRoot, CinematicPackage.eINSTANCE.getAbstractPackage_ViewContainers());
cinematicRootPart.initViewContainers(viewContainersSettings);
}
if (isAccessible(CinematicViewsRepository.CinematicRoot.Properties.subPackages)) {
subPackagesSettings = new ReferencesTableSettings(cinematicRoot, CinematicPackage.eINSTANCE.getAbstractPackage_SubPackages());
cinematicRootPart.initSubPackages(subPackagesSettings);
}
if (isAccessible(CinematicViewsRepository.CinematicRoot.Properties.flows)) {
cinematicRootPart.addFilterToFlows(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) {
// $NON-NLS-1$
return (element instanceof String && element.equals("")) || (element instanceof Flow);
}
});
// Start of user code for additional businessfilters for flows
// End of user code
}
if (isAccessible(CinematicViewsRepository.CinematicRoot.Properties.viewContainers)) {
cinematicRootPart.addFilterToViewContainers(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) {
// $NON-NLS-1$
return (element instanceof String && element.equals("")) || (element instanceof ViewContainer);
}
});
// Start of user code for additional businessfilters for viewContainers
// End of user code
}
if (isAccessible(CinematicViewsRepository.CinematicRoot.Properties.subPackages)) {
cinematicRootPart.addFilterToSubPackages(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) {
// $NON-NLS-1$
return (element instanceof String && element.equals("")) || (element instanceof Package);
}
});
// Start of user code for additional businessfilters for subPackages
// End of user code
}
// init values for referenced views
// init filters for referenced views
}
setInitializing(false);
}
Aggregations