use of org.obeonetwork.graal.parts.TaskReferencePropertiesEditionPart in project InformationSystem by ObeoNetwork.
the class TaskReferenceTaskReferencePropertiesEditionComponent 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 TaskReference taskReference = (TaskReference) elt;
final TaskReferencePropertiesEditionPart taskReferencePart = (TaskReferencePropertiesEditionPart) editingPart;
// init values
if (isAccessible(GraalViewsRepository.TaskReference.Properties.description))
taskReferencePart.setDescription(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, taskReference.getDescription()));
if (isAccessible(GraalViewsRepository.TaskReference.Properties.outgoingTransitions)) {
outgoingTransitionsSettings = new ReferencesTableSettings(taskReference, GraalPackage.eINSTANCE.getNode_OutgoingTransitions());
taskReferencePart.initOutgoingTransitions(outgoingTransitionsSettings);
}
if (isAccessible(GraalViewsRepository.TaskReference.Properties.incomingTransitions)) {
incomingTransitionsSettings = new ReferencesTableSettings(taskReference, GraalPackage.eINSTANCE.getNode_IncomingTransitions());
taskReferencePart.initIncomingTransitions(incomingTransitionsSettings);
}
if (isAccessible(GraalViewsRepository.TaskReference.Properties.task)) {
// init part
taskSettings = new EObjectFlatComboSettings(taskReference, GraalPackage.eINSTANCE.getTaskReference_Task());
taskReferencePart.initTask(taskSettings);
// set the button mode
taskReferencePart.setTaskButtonMode(ButtonsModeEnum.BROWSE);
}
if (isAccessible(GraalViewsRepository.TaskReference.Properties.outgoingTransitions)) {
taskReferencePart.addFilterToOutgoingTransitions(new EObjectFilter(GraalPackage.Literals.TRANSITION));
// Start of user code for additional businessfilters for outgoingTransitions
// End of user code
}
if (isAccessible(GraalViewsRepository.TaskReference.Properties.incomingTransitions)) {
taskReferencePart.addFilterToIncomingTransitions(new EObjectFilter(GraalPackage.Literals.TRANSITION));
// Start of user code for additional businessfilters for incomingTransitions
// End of user code
}
if (isAccessible(GraalViewsRepository.TaskReference.Properties.task)) {
taskReferencePart.addFilterToTask(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 Task);
}
});
// Start of user code for additional businessfilters for task
// End of user code
}
// init values for referenced views
// init filters for referenced views
}
setInitializing(false);
}
Aggregations