Search in sources :

Example 1 with InteractionUsePropertiesEditionPart

use of org.obeonetwork.dsl.interaction.parts.InteractionUsePropertiesEditionPart in project InformationSystem by ObeoNetwork.

the class InteractionUseInteractionUsePropertiesEditionComponent 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 InteractionUse interactionUse = (InteractionUse) elt;
        final InteractionUsePropertiesEditionPart interactionUsePart = (InteractionUsePropertiesEditionPart) editingPart;
        // init values
        if (isAccessible(InteractionViewsRepository.InteractionUse.Properties.name))
            interactionUsePart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, interactionUse.getName()));
        if (isAccessible(InteractionViewsRepository.InteractionUse.Properties.type))
            interactionUsePart.setType(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, interactionUse.getType()));
        if (isAccessible(InteractionViewsRepository.InteractionUse.Properties.interaction_)) {
            // init part
            interactionSettings = new EObjectFlatComboSettings(interactionUse, InteractionPackage.eINSTANCE.getInteractionUse_Interaction());
            interactionUsePart.initInteraction(interactionSettings);
            // set the button mode
            interactionUsePart.setInteractionButtonMode(ButtonsModeEnum.BROWSE);
        }
        if (isAccessible(InteractionViewsRepository.InteractionUse.Properties.description))
            interactionUsePart.setDescription(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, interactionUse.getDescription()));
        if (isAccessible(InteractionViewsRepository.InteractionUse.Properties.interaction_)) {
            interactionUsePart.addFilterToInteraction(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 Interaction);
                }
            });
        // Start of user code for additional businessfilters for interaction
        // End of user code
        }
    // init values for referenced views
    // init filters for referenced views
    }
    setInitializing(false);
}
Also used : ViewerFilter(org.eclipse.jface.viewers.ViewerFilter) Interaction(org.obeonetwork.dsl.interaction.Interaction) Viewer(org.eclipse.jface.viewers.Viewer) EObject(org.eclipse.emf.ecore.EObject) EObjectFlatComboSettings(org.eclipse.emf.eef.runtime.ui.widgets.eobjflatcombo.EObjectFlatComboSettings) InteractionUsePropertiesEditionPart(org.obeonetwork.dsl.interaction.parts.InteractionUsePropertiesEditionPart) InteractionUse(org.obeonetwork.dsl.interaction.InteractionUse)

Aggregations

EObject (org.eclipse.emf.ecore.EObject)1 EObjectFlatComboSettings (org.eclipse.emf.eef.runtime.ui.widgets.eobjflatcombo.EObjectFlatComboSettings)1 Viewer (org.eclipse.jface.viewers.Viewer)1 ViewerFilter (org.eclipse.jface.viewers.ViewerFilter)1 Interaction (org.obeonetwork.dsl.interaction.Interaction)1 InteractionUse (org.obeonetwork.dsl.interaction.InteractionUse)1 InteractionUsePropertiesEditionPart (org.obeonetwork.dsl.interaction.parts.InteractionUsePropertiesEditionPart)1