Class TextControlSWTRenderer

    • Method Detail

      • convert

        protected java.lang.Object convert​(org.eclipse.swt.widgets.Text text,
                                           org.eclipse.emf.ecore.EDataType attributeType,
                                           java.lang.String value)
                                    throws DatabindingFailedException
        Convert the given value from target to model.
        Parameters:
        text - the Text control
        attributeType - the model data type
        value - the target value to convert
        Returns:
        the converted value
        Throws:
        DatabindingFailedException - in case the databinding failed
        Since:
        1.13
      • getTextMessage

        protected java.lang.String getTextMessage()
        Returns the text which should be set as the message text on the Text field.
        Returns:
        the string to show as the message
        Since:
        1.6
      • bindValue

        protected org.eclipse.core.databinding.Binding bindValue​(org.eclipse.swt.widgets.Control text,
                                                                 org.eclipse.core.databinding.observable.value.IObservableValue modelValue,
                                                                 org.eclipse.core.databinding.DataBindingContext dataBindingContext,
                                                                 org.eclipse.core.databinding.UpdateValueStrategy targetToModel,
                                                                 org.eclipse.core.databinding.UpdateValueStrategy modelToTarget)
        Creates a focus out binding for this control.
        Parameters:
        text - the Text to bind
        modelValue - the IObservableValue to bind
        dataBindingContext - the DataBindingContext to use
        targetToModel - the UpdateValueStrategy from target to Model
        modelToTarget - the UpdateValueStrategy from model to target
        Returns:
        the created Binding
      • useOnModifyDatabinding

        protected boolean useOnModifyDatabinding()
        Whether SWT.Modify or SWT.FocusOut shall be used as the target databinding trigger.
        Returns:
        true if Modify should be used, false otherwise
        Since:
        1.9
      • createTooltipBinding

        protected org.eclipse.core.databinding.Binding createTooltipBinding​(org.eclipse.swt.widgets.Control text,
                                                                            org.eclipse.core.databinding.observable.value.IObservableValue modelValue,
                                                                            org.eclipse.core.databinding.DataBindingContext dataBindingContext,
                                                                            org.eclipse.core.databinding.UpdateValueStrategy targetToModel,
                                                                            org.eclipse.core.databinding.UpdateValueStrategy modelToTarget)
        Creates a tooltip binding for this control.
        Parameters:
        text - the Text to bind
        modelValue - the IObservableValue to bind
        dataBindingContext - the DataBindingContext to use
        targetToModel - the UpdateValueStrategy from target to Model
        modelToTarget - the UpdateValueStrategy from model to target
        Returns:
        the created Binding
      • getTextWidgetStyle

        protected int getTextWidgetStyle()
        The style to apply to the text widget. This can be changed by the concrete classes.
        Returns:
        the style to apply
      • getDefaultAlignment

        protected int getDefaultAlignment()
        Return the default alignment value for this renderer.
        Returns:
        the alignment to use if no style was defined
      • getTextVariantID

        protected java.lang.String getTextVariantID()
        The VariantId to use e.g. for RAP
        Returns:
        the String identifying this control
      • setControlEnabled

        protected void setControlEnabled​(SWTGridCell gridCell,
                                         org.eclipse.swt.widgets.Control control,
                                         boolean enabled)
        Description copied from class: AbstractSWTRenderer
        Wraps the call to enable/disable a control.
        Overrides:
        setControlEnabled in class SimpleControlSWTRenderer
        Parameters:
        gridCell - the SWTGridCell to enable/disable
        control - the Control to enable/disable
        enabled - true if control should be enabled, false otherwise
      • getTextFromTextField

        protected java.lang.String getTextFromTextField​(org.eclipse.swt.widgets.Text text,
                                                        org.eclipse.emf.ecore.EDataType attributeType)
        Gets the text displayed in the textfield.
        Parameters:
        text - the Text
        attributeType - the EDataType
        Returns:
        the string displayed in the Text
        Since:
        1.13
      • setValidationColor

        protected void setValidationColor​(org.eclipse.swt.widgets.Control control,
                                          org.eclipse.swt.graphics.Color validationColor)
        Description copied from class: SimpleControlSWTRenderer
        Set the provided validation color as the background for the provided control.
        Overrides:
        setValidationColor in class SimpleControlSWTRenderer
        Parameters:
        control - the control to set the color on
        validationColor - the validation color to set
      • setValidationForegroundColor

        protected void setValidationForegroundColor​(org.eclipse.swt.widgets.Control control,
                                                    org.eclipse.swt.graphics.Color validationColor)
        Description copied from class: SimpleControlSWTRenderer
        Set the provided validation color as the foreground for the provided control.
        Overrides:
        setValidationForegroundColor in class SimpleControlSWTRenderer
        Parameters:
        control - the control to set the color on
        validationColor - the validation color to set
      • isUnsetButtonLeftOfControlComposite

        protected boolean isUnsetButtonLeftOfControlComposite()
        Returns whether the unset button is placed left of the control composite containing the text field.
        Returns:
        true if the control is unsettable and the unset button is left of the text field, false otherwise
        Since:
        1.14
      • getControlCompositeFromControl

        protected org.eclipse.swt.widgets.Control getControlCompositeFromControl​(org.eclipse.swt.widgets.Control control)
        Returns the control composite that contains the text field from the parent composite created by the SimpleControlSWTRenderer.
        Parameters:
        control - The edit control created by the SimpleControlSWTRenderer
        Returns:
        the control composite containing the text field
        Since:
        1.14