Search in sources :

Example 1 with FinalNodePropertiesEditionPart

use of org.obeonetwork.graal.parts.FinalNodePropertiesEditionPart in project InformationSystem by ObeoNetwork.

the class FinalNodeFinalNodePropertiesEditionComponent 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 FinalNode finalNode = (FinalNode) elt;
        final FinalNodePropertiesEditionPart finalNodePart = (FinalNodePropertiesEditionPart) editingPart;
        // init values
        if (isAccessible(GraalViewsRepository.FinalNode.Properties.description))
            finalNodePart.setDescription(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, finalNode.getDescription()));
        if (isAccessible(GraalViewsRepository.FinalNode.Properties.outgoingTransitions)) {
            outgoingTransitionsSettings = new ReferencesTableSettings(finalNode, GraalPackage.eINSTANCE.getNode_OutgoingTransitions());
            finalNodePart.initOutgoingTransitions(outgoingTransitionsSettings);
        }
        if (isAccessible(GraalViewsRepository.FinalNode.Properties.incomingTransitions)) {
            incomingTransitionsSettings = new ReferencesTableSettings(finalNode, GraalPackage.eINSTANCE.getNode_IncomingTransitions());
            finalNodePart.initIncomingTransitions(incomingTransitionsSettings);
        }
        if (isAccessible(GraalViewsRepository.FinalNode.Properties.outgoingTransitions)) {
            finalNodePart.addFilterToOutgoingTransitions(new EObjectFilter(GraalPackage.Literals.TRANSITION));
        // Start of user code for additional businessfilters for outgoingTransitions
        // End of user code
        }
        if (isAccessible(GraalViewsRepository.FinalNode.Properties.incomingTransitions)) {
            finalNodePart.addFilterToIncomingTransitions(new EObjectFilter(GraalPackage.Literals.TRANSITION));
        // Start of user code for additional businessfilters for incomingTransitions
        // End of user code
        }
    // init values for referenced views
    // init filters for referenced views
    }
    setInitializing(false);
}
Also used : EObjectFilter(org.eclipse.emf.eef.runtime.impl.filters.EObjectFilter) ReferencesTableSettings(org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings) FinalNode(org.obeonetwork.graal.FinalNode) FinalNodePropertiesEditionPart(org.obeonetwork.graal.parts.FinalNodePropertiesEditionPart)

Aggregations

EObjectFilter (org.eclipse.emf.eef.runtime.impl.filters.EObjectFilter)1 ReferencesTableSettings (org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings)1 FinalNode (org.obeonetwork.graal.FinalNode)1 FinalNodePropertiesEditionPart (org.obeonetwork.graal.parts.FinalNodePropertiesEditionPart)1