Class LinkControlSWTRenderer

    • Constructor Detail

      • LinkControlSWTRenderer

        @Deprecated
        @Inject
        public LinkControlSWTRenderer​(VControl vElement,
                                      ViewModelContext viewContext,
                                      ReportService reportService,
                                      EMFFormsDatabinding emfFormsDatabinding,
                                      EMFFormsLabelProvider emfFormsLabelProvider,
                                      VTViewTemplateProvider vtViewTemplateProvider,
                                      EMFFormsLocalizationService localizationService,
                                      ImageRegistryService imageRegistryService,
                                      EMFFormsEditSupport emfFormsEditSupport)
        Deprecated.
        with 1.22
        Parameters:
        vElement - the element to render
        viewContext - the view model context
        reportService - the report service
        emfFormsDatabinding - the data binding service
        emfFormsLabelProvider - the label provider
        vtViewTemplateProvider - the view template provider
        localizationService - the localization service
        imageRegistryService - the image registry service
        emfFormsEditSupport - the EMFFormsEditSupport
      • LinkControlSWTRenderer

        @Inject
        public LinkControlSWTRenderer​(VControl vElement,
                                      ViewModelContext viewContext,
                                      ReportService reportService,
                                      EMFFormsDatabinding emfFormsDatabinding,
                                      EMFFormsLabelProvider emfFormsLabelProvider,
                                      VTViewTemplateProvider vtViewTemplateProvider,
                                      EMFFormsLocalizationService localizationService,
                                      ImageRegistryService imageRegistryService)
        Parameters:
        vElement - the element to render
        viewContext - the view model context
        reportService - the report service
        emfFormsDatabinding - the data binding service
        emfFormsLabelProvider - the label provider
        vtViewTemplateProvider - the view template provider
        localizationService - the localization service
        imageRegistryService - the image registry service
    • Method Detail

      • createButtons

        protected void createButtons​(org.eclipse.swt.widgets.Composite parent)
        Called by createSWTControl(Composite) in order to create the buttons.
        Parameters:
        parent - the parent composite
      • createAddReferenceButton

        protected void createAddReferenceButton​(org.eclipse.swt.widgets.Composite parent,
                                                java.lang.String elementDisplayName)
        Called by createButtons(Composite) to create the add existing reference button.
        Parameters:
        parent - the parent composite
        elementDisplayName - the display name of the reference
      • getAddReferenceButtonImage

        protected org.eclipse.swt.graphics.Image getAddReferenceButtonImage()
        Returns the add reference image for button.
        Returns:
        the add reference image for button
      • createNewReferenceButton

        protected void createNewReferenceButton​(org.eclipse.swt.widgets.Composite parent,
                                                java.lang.String elementDisplayName)
        Called by createButtons(Composite) to create the create new reference button.
        Parameters:
        parent - the parent composite
        elementDisplayName - the display name of the reference
      • getNewReferenceButtonImage

        protected org.eclipse.swt.graphics.Image getNewReferenceButtonImage()
        Returns the new reference image for button.
        Returns:
        the new reference image for button
      • openNewReferenceInContext

        protected boolean openNewReferenceInContext()
        Whether a new reference should be opened in a new context. True to open in new context, false otherwise.
        Returns:
        true to open in new context, false otherwise
      • createDeleteReferenceButton

        protected void createDeleteReferenceButton​(org.eclipse.swt.widgets.Composite parent,
                                                   java.lang.String elementDisplayName)
        Called by createButtons(Composite) to create the delete reference button.
        Parameters:
        parent - the parent composite
        elementDisplayName - the display name of the reference
      • getDeleteReferenceButtonImage

        protected org.eclipse.swt.graphics.Image getDeleteReferenceButtonImage()
        Returns the image for delete reference button.
        Returns:
        the image for delete reference button
      • getImage

        protected org.eclipse.swt.graphics.Image getImage​(org.osgi.framework.Bundle bundle,
                                                          java.lang.String iconPath)
        Returns an image to be displayed given the bundle and path in the bundle where icon file can be found.

        The image found is not meant to be disposed by user.

        Parameters:
        bundle - the bundle where the image file is located
        iconPath - the path of the icon file in the bundle
        Returns:
        the image to be displayed.
      • getIconBundle

        protected org.osgi.framework.Bundle getIconBundle()
        Returns the bundle where the icon file is located.
        Returns:
        the bundle where the icon file is located
      • getText

        protected java.lang.String getText​(java.lang.Object value)
        Returns the link text to be used for the given linked value.
        Parameters:
        value - the value
        Returns:
        The link text.
        Throws:
        DatabindingFailedException
        NoLabelFoundException
      • getImage

        protected org.eclipse.swt.graphics.Image getImage​(java.lang.Object value)
        Returns the image to be used for the given linked value.
        Parameters:
        value - the object for which the image is retrieved
        Returns:
        the image
      • linkClicked

        protected void linkClicked​(org.eclipse.emf.ecore.EObject value)
        This code is called whenever the link of the link widget is clicked. You can overwrite this to change the behavior.
        Parameters:
        value - the EObject that is linked
      • getNumButtons

        protected int getNumButtons()
        Returns:
        number of buttons added by the link control.
      • updateButtonVisibility

        protected void updateButtonVisibility()
        Updates the visibility of 'add reference', 'new reference', and 'delete reference' buttons according to the bound input.