Interface IValueComponentPart<VM extends ValueControlViewModel,​M extends IValueModel,​T extends Value>

    • Method Detail

      • isSuitable

        boolean isSuitable​(M model)
        Returns the true if the part is suitable for the given model.
        Parameters:
        model - the IValueModel.
        Returns:
        the true if the part is suitable for the given model.
      • createViewModel

        VM createViewModel​(M model)
        Creates a view model for the given model.
        Parameters:
        model - the IValueModel.
        Returns:
        the newly created view model.
      • bindViewModel

        void bindViewModel​(VM viewModel,
                           M model,
                           IMapper<T,​?> mapper)
        Binds the given view model to model. It is the extra binding that is needed to fill view model with additional data.
        NOTE: implement this functionality only if the default component binding using getViewModelBindingFeature() and #createMapper() is not enough.
        Parameters:
        viewModel - the view model to bind.
        model - the IValueModel.
        mapper - the IMapper instance.
      • handleButtonPressed

        void handleButtonPressed​(VM viewModel,
                                 M model)
        Handles the button events.
        Parameters:
        viewModel - the view model.
        model - the IValueModel.
      • getViewModelBindingFeature

        org.eclipse.emf.ecore.EStructuralFeature getViewModelBindingFeature()
        Returns the view model feature that is binds by value component.
        Returns:
        the view model feature that is binds by value component or null.
      • createMapper

        IMapper<T,​?> createMapper​(VM viewModel,
                                        M model)
        Returns the newly created mapper that maps the Value to view model.
        Parameters:
        viewModel - the view model.
        model - the IValueModel.
        Returns:
        the mapper.
      • hasClearAction

        boolean hasClearAction​(VM viewModel,
                               M model)
        Returns true if the value component should create clear action button for the given model.
        Parameters:
        viewModel - the view model.
        model - the IValueModel.
        Returns:
        true if the clear action button is required.