use of org.obeonetwork.dsl.cinematic.view.parts.ViewContainerReferencePropertiesEditionPart in project InformationSystem by ObeoNetwork.
the class ViewContainerReferenceViewContainerReferencePropertiesEditionComponent 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 ViewContainerReference viewContainerReference = (ViewContainerReference) elt;
final ViewContainerReferencePropertiesEditionPart viewContainerReferencePart = (ViewContainerReferencePropertiesEditionPart) editingPart;
// init values
if (isAccessible(ViewViewsRepository.ViewContainerReference.Properties.description))
viewContainerReferencePart.setDescription(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, viewContainerReference.getDescription()));
if (isAccessible(ViewViewsRepository.ViewContainerReference.Properties.name))
viewContainerReferencePart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, viewContainerReference.getName()));
if (isAccessible(ViewViewsRepository.ViewContainerReference.Properties.widget)) {
// init part
widgetSettings = new EObjectFlatComboSettings(viewContainerReference, ViewPackage.eINSTANCE.getAbstractViewElement_Widget());
viewContainerReferencePart.initWidget(widgetSettings);
// set the button mode
viewContainerReferencePart.setWidgetButtonMode(ButtonsModeEnum.BROWSE);
}
if (isAccessible(ViewViewsRepository.ViewContainerReference.Properties.actions)) {
actionsSettings = new ReferencesTableSettings(viewContainerReference, ViewPackage.eINSTANCE.getAbstractViewElement_Actions());
viewContainerReferencePart.initActions(actionsSettings);
}
if (isAccessible(ViewViewsRepository.ViewContainerReference.Properties.events)) {
eventsSettings = new ReferencesTableSettings(viewContainerReference, ViewPackage.eINSTANCE.getAbstractViewElement_Events());
viewContainerReferencePart.initEvents(eventsSettings);
}
if (isAccessible(ViewViewsRepository.ViewContainerReference.Properties.label))
viewContainerReferencePart.setLabel(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, viewContainerReference.getLabel()));
if (isAccessible(ViewViewsRepository.ViewContainerReference.Properties.viewContainer)) {
// init part
viewContainerSettings = new EObjectFlatComboSettings(viewContainerReference, ViewPackage.eINSTANCE.getViewContainerReference_ViewContainer());
viewContainerReferencePart.initViewContainer(viewContainerSettings);
// set the button mode
viewContainerReferencePart.setViewContainerButtonMode(ButtonsModeEnum.BROWSE);
}
if (isAccessible(ViewViewsRepository.ViewContainerReference.Properties.widget)) {
viewContainerReferencePart.addFilterToWidget(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 Widget);
}
});
// Start of user code for additional businessfilters for widget
// End of user code
}
if (isAccessible(ViewViewsRepository.ViewContainerReference.Properties.actions)) {
viewContainerReferencePart.addFilterToActions(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 ViewAction);
}
});
// Start of user code for additional businessfilters for actions
// End of user code
}
if (isAccessible(ViewViewsRepository.ViewContainerReference.Properties.events)) {
viewContainerReferencePart.addFilterToEvents(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 ViewEvent);
}
});
// Start of user code for additional businessfilters for events
// End of user code
}
if (isAccessible(ViewViewsRepository.ViewContainerReference.Properties.viewContainer)) {
viewContainerReferencePart.addFilterToViewContainer(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) {
return (element instanceof ViewContainer);
}
});
// Start of user code for additional businessfilters for viewContainer
// End of user code
}
// init values for referenced views
// init filters for referenced views
}
setInitializing(false);
}
Aggregations