Class MultiAttributeSWTRenderer

    • Method Detail

      • getTableHeightHint

        protected int getTableHeightHint()
        Returns the height for the table that will be created.
        Returns:
        the height hint
      • getTableViewer

        protected org.eclipse.jface.viewers.TableViewer getTableViewer()
        Gives access to the tableViewer used to display the attributes.
        Returns:
        the viewer
      • createControlComposite

        protected org.eclipse.swt.widgets.Composite createControlComposite​(org.eclipse.swt.widgets.Composite composite)
        Creates the composite which will be the parent for the table.
        Parameters:
        composite - the parent composite
        Returns:
        the table composite
      • getImage

        protected org.eclipse.swt.graphics.Image getImage​(java.lang.String path)
        Returns an Image from the image registry.
        Parameters:
        path - the path to the image
        Returns:
        the image
      • updateButtons

        protected void updateButtons()
        Updates button visibility and enablement.
      • updateButtonVisibility

        protected void updateButtonVisibility()
        Updates the visibility of 'Add', 'Remove', 'Up', 'Down' buttons according to the bound input.
      • updateButtonEnabling

        protected void updateButtonEnabling()
        Updates the enablement of 'addExisting', 'addNew', 'delete', 'moveUp' and 'moveDown' buttons according to the bound input.
      • createTitleComposite

        protected org.eclipse.swt.widgets.Composite createTitleComposite​(org.eclipse.swt.widgets.Composite parent)
        Creates the Title Composite containing validation and buttons. Buttons have to be initialized afterwards.
        Parameters:
        parent - the parent Composite.
        Returns:
        the created Composite.
        Since:
        1.14
      • createButtonComposite

        protected org.eclipse.swt.widgets.Composite createButtonComposite​(org.eclipse.swt.widgets.Composite parent,
                                                                          org.eclipse.core.databinding.observable.list.IObservableList list)
        Create the button composite. Buttons have to be initialized after the table is created.
        Parameters:
        parent - the Composite parent.
        list - the IObservableList.
        Returns:
        the created Composite.
        Since:
        1.14
      • initButtons

        protected void initButtons​(org.eclipse.core.databinding.observable.list.IObservableList list)
        Initializes the buttons. Call this after table is created.
        Parameters:
        list - the IObservableList.
        Since:
        1.14
      • createUpDownButtons

        protected void createUpDownButtons​(org.eclipse.swt.widgets.Composite composite,
                                           org.eclipse.core.databinding.observable.list.IObservableList list)
        Create the up and down buttons.
        Parameters:
        composite - The Composite to create the buttons on
        list - The IObservableList of the current MultiAttributeSWTRenderer
        Since:
        1.17
      • getValueForNewRow

        protected java.lang.Object getValueForNewRow​(org.eclipse.emf.ecore.EAttribute attribute)
        Returns the attribute value which should be added as a new element.
        Parameters:
        attribute - the EAttribute with the data type
        Returns:
        the new value
        Since:
        1.13
      • dispose

        public void dispose()
        Disposes all resources used by the renderer. Don't forget to call super.dispose if overwriting this method.
        Overrides:
        dispose in class AbstractControlSWTRenderer<VControl>
      • postRemove

        protected void postRemove​(org.eclipse.jface.viewers.IStructuredSelection selection)
        This is called after the selected elements were deleted so that the user can handle this removal.
        Parameters:
        selection - The IStructuredSelection of the TableViewer before deletion.
        Since:
        1.17
      • createErrorLabel

        protected org.eclipse.swt.widgets.Control createErrorLabel​(org.eclipse.swt.widgets.Composite parent,
                                                                   java.lang.Exception ex)
        Creates an error label for the given Exception.
        Parameters:
        parent - The parent of the Label
        ex - The Exception causing the error
        Returns:
        The error Label
        Since:
        1.14