Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » How to customize the background color of controls for entering Boolean values generated by EMFForms?
How to customize the background color of controls for entering Boolean values generated by EMFForms? [message #1462239] Wed, 05 November 2014 11:04 Go to next message
Dmitri Pisarenko is currently offline Dmitri PisarenkoFriend
Messages: 24
Registered: September 2014
Junior Member
Hello!

I have an EMF model, from which I generated UI form and embedded it into a wizard.

The check boxes appear with white background (see below) and it doesn't look nice.

http://i.imgur.com/Bdwboz4.png

How can I change the background color of the check box (avoid the white strip) ?

I tried to use BooleanControlSWTRenderer sub-class (see below), but it didn't work.

public class MyRenderer extends BooleanControlSWTRenderer {

		@Override
		protected Control createSWTControl(Composite parent, Setting setting) {
			
			
			final Button check = new Button(parent, SWT.CHECK);
			check.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_GRAY));
			check.setData(CUSTOM_VARIANT, "org_eclipse_emf_ecp_control_boolean"); //$NON-NLS-1$

			return check;

		}
	}


Thanks in advance

Dmitri
Re: How to customize the background color of controls for entering Boolean values generated by EMFFo [message #1463308 is a reply to message #1462239] Thu, 06 November 2014 12:30 Go to previous message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 699
Registered: July 2009
Senior Member
Hi,

have you tried how a check button with background set to grey looks
outsite of EMF Forms, meaning on a plain shell? Does it work as expected
there?

Best regards

Jonas


Am 05.11.2014 12:04, schrieb Dmitri Pisarenko:
> Hello!
>
> I have an EMF model, from which I generated UI form and embedded it into
> a wizard.
>
> The check boxes appear with white background (see below) and it doesn't
> look nice.
>
>
>
> How can I change the background color of the check box (avoid the white
> strip) ?
>
> I tried to use BooleanControlSWTRenderer sub-class (see below), but it
> didn't work.
>
> public class MyRenderer extends BooleanControlSWTRenderer {
>
> @Override
> protected Control createSWTControl(Composite parent, Setting
> setting) {
>
>
> final Button check = new Button(parent, SWT.CHECK);
>
> check.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_GRAY));
> check.setData(CUSTOM_VARIANT,
> "org_eclipse_emf_ecp_control_boolean"); //$NON-NLS-1$
>
> return check;
>
> }
> }
>
> Thanks in advance
>
> Dmitri
Previous Topic:[TEXO] Importing Java package in xpt templates
Next Topic:[Edapt] Can I use Edapt directly on software using generated Model Code?
Goto Forum:
  


Current Time: Thu Apr 25 01:58:13 GMT 2024

Powered by FUDForum. Page generated in 0.03170 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top