/** * {@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 ViewReference viewReference = (ViewReference) elt; final ViewReferencePropertiesEditionPart basePart = (ViewReferencePropertiesEditionPart) editingPart; // init values if (viewReference.getName() != null && isAccessible(ViewsViewsRepository.ViewReference.Properties.name)) basePart.setName( EEFConverterUtil.convertToString( EcorePackage.Literals.ESTRING, viewReference.getName())); if (isAccessible(ViewsViewsRepository.ViewReference.Properties.referencedView)) { // init part viewSettings = new EObjectFlatComboSettings( viewReference, ViewsPackage.eINSTANCE.getViewReference_View()); basePart.initReferencedView(viewSettings); // set the button mode basePart.setReferencedViewButtonMode(ButtonsModeEnum.BROWSE); } // init filters if (isAccessible(ViewsViewsRepository.ViewReference.Properties.referencedView)) { basePart.addFilterToReferencedView( 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 ViewElement); } }); // Start of user code for additional businessfilters for view // End of user code } // init values for referenced views // init filters for referenced views } setInitializing(false); }
/** * {@inheritDoc} * * @see * org.eclipse.emf.eef.runtime.impl.components.StandardPropertiesEditionComponent#updatePart(org.eclipse.emf.common.notify.Notification) */ public void updatePart(Notification msg) { if (editingPart.isVisible()) { ViewReferencePropertiesEditionPart basePart = (ViewReferencePropertiesEditionPart) editingPart; if (ViewsPackage.eINSTANCE.getViewElement_Name().equals(msg.getFeature()) && basePart != null && isAccessible(ViewsViewsRepository.ViewReference.Properties.name)) { if (msg.getNewValue() != null) { basePart.setName( EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, msg.getNewValue())); } else { basePart.setName(""); } } if (ViewsPackage.eINSTANCE.getViewReference_View().equals(msg.getFeature()) && basePart != null && isAccessible(ViewsViewsRepository.ViewReference.Properties.referencedView)) basePart.setReferencedView((EObject) msg.getNewValue()); } }