Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » [JFace] Background gradients work (yeah), but does the Textclient still do?
[JFace] Background gradients work (yeah), but does the Textclient still do? [message #139405] Mon, 06 July 2009 13:27 Go to next message
Eclipse UserFriend
Originally posted by: bjoern.bjoernfischer.de

Hello everybody,
I checked out the latest CVS today because Ivan finished his work on the
background gradients. Many thanks for that, Ivan!

Unfortionately the label I set as textClient of a section (it will soon
become a ToolBar) does not show up anymore. To add the label I use the
following code:

final Section searchSection = formsToolkit.createSection(body,
Section.TITLE_BAR | Section.TWISTIE);
Label label = formsToolkit.createLabel(searchSection, "");
label.setImage(image);
label.setToolTipText("Execute search");
searchSection.setTextClient(label);

Could this be a side-effect of Ivans patch? I have not changed my code
recently...

Thanks for your opinions and thoughts on that!

Regards,
Björn
Re: [JFace] Background gradients work (yeah), but does the Textclient still do? [message #139417 is a reply to message #139405] Mon, 06 July 2009 13:42 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Björn,

yes... It seems that enabling background gradient in Section introduced
this problem. Please file a bugzilla about it to track the progress.

Best,
Ivan

Björn Fischer wrote:
> Hello everybody,
> I checked out the latest CVS today because Ivan finished his work on the
> background gradients. Many thanks for that, Ivan!
>
> Unfortionately the label I set as textClient of a section (it will soon
> become a ToolBar) does not show up anymore. To add the label I use the
> following code:
>
> final Section searchSection = formsToolkit.createSection(body,
> Section.TITLE_BAR | Section.TWISTIE);
> Label label = formsToolkit.createLabel(searchSection, "");
> label.setImage(image);
> label.setToolTipText("Execute search");
> searchSection.setTextClient(label);
>
> Could this be a side-effect of Ivans patch? I have not changed my code
> recently...
>
> Thanks for your opinions and thoughts on that!
>
> Regards,
> Björn
>
Re: [JFace] Background gradients work (yeah), but does the Textclient still do? [message #139450 is a reply to message #139405] Mon, 06 July 2009 14:15 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Björn,

it is fixed in CVS HEAD. Thanks for pointing this out.

Best,
Ivan

Björn Fischer wrote:
> Hello everybody,
> I checked out the latest CVS today because Ivan finished his work on the
> background gradients. Many thanks for that, Ivan!
>
> Unfortionately the label I set as textClient of a section (it will soon
> become a ToolBar) does not show up anymore. To add the label I use the
> following code:
>
> final Section searchSection = formsToolkit.createSection(body,
> Section.TITLE_BAR | Section.TWISTIE);
> Label label = formsToolkit.createLabel(searchSection, "");
> label.setImage(image);
> label.setToolTipText("Execute search");
> searchSection.setTextClient(label);
>
> Could this be a side-effect of Ivans patch? I have not changed my code
> recently...
>
> Thanks for your opinions and thoughts on that!
>
> Regards,
> Björn
>
Re: [JFace] Background gradients work (yeah), but does the Textclient still do? [message #139482 is a reply to message #139450] Mon, 06 July 2009 15:19 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bjoern.bjoernfischer.de

Hi Ivan,
thaks for resolving this so quick.

I have another question: are the rounded corners of Sections active by
default (like in RCP), or do I have to make a setting somewhere? I see
the background gradients, but the corners still seem to be rather sharp.

Regards,
Björn

Ivan Furnadjiev schrieb:
> Hi Björn,
>
> it is fixed in CVS HEAD. Thanks for pointing this out.
>
> Best,
> Ivan
>
> Björn Fischer wrote:
>> Hello everybody,
>> I checked out the latest CVS today because Ivan finished his work on the
>> background gradients. Many thanks for that, Ivan!
>>
>> Unfortionately the label I set as textClient of a section (it will soon
>> become a ToolBar) does not show up anymore. To add the label I use the
>> following code:
>>
>> final Section searchSection = formsToolkit.createSection(body,
>> Section.TITLE_BAR | Section.TWISTIE);
>> Label label = formsToolkit.createLabel(searchSection, "");
>> label.setImage(image);
>> label.setToolTipText("Execute search");
>> searchSection.setTextClient(label);
>>
>> Could this be a side-effect of Ivans patch? I have not changed my code
>> recently...
>>
>> Thanks for your opinions and thoughts on that!
>>
>> Regards,
>> Björn
>>
Re: [JFace] Background gradients work (yeah), but does the Textclient still do? [message #139494 is a reply to message #139482] Mon, 06 July 2009 15:25 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Björn,

the rounded corners of Sections are not supported yet. If you need them
:-)... file an enhancement request.

Best,
Ivan

Björn Fischer wrote:
> Hi Ivan,
> thaks for resolving this so quick.
>
> I have another question: are the rounded corners of Sections active by
> default (like in RCP), or do I have to make a setting somewhere? I see
> the background gradients, but the corners still seem to be rather sharp.
>
> Regards,
> Björn
>
> Ivan Furnadjiev schrieb:
>
>> Hi Björn,
>>
>> it is fixed in CVS HEAD. Thanks for pointing this out.
>>
>> Best,
>> Ivan
>>
>> Björn Fischer wrote:
>>
>>> Hello everybody,
>>> I checked out the latest CVS today because Ivan finished his work on the
>>> background gradients. Many thanks for that, Ivan!
>>>
>>> Unfortionately the label I set as textClient of a section (it will soon
>>> become a ToolBar) does not show up anymore. To add the label I use the
>>> following code:
>>>
>>> final Section searchSection = formsToolkit.createSection(body,
>>> Section.TITLE_BAR | Section.TWISTIE);
>>> Label label = formsToolkit.createLabel(searchSection, "");
>>> label.setImage(image);
>>> label.setToolTipText("Execute search");
>>> searchSection.setTextClient(label);
>>>
>>> Could this be a side-effect of Ivans patch? I have not changed my code
>>> recently...
>>>
>>> Thanks for your opinions and thoughts on that!
>>>
>>> Regards,
>>> Björn
>>>
>>>
Re: [JFace] Background gradients work (yeah), but does the Textclient still do? [message #139515 is a reply to message #139494] Mon, 06 July 2009 15:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bjoern.bjoernfischer.de

Hi Ivan,
ok, they are not THAT important :-) Just thought they were included in
the patch...

Thanks for the explanation.

Regards,
Björn

Ivan Furnadjiev schrieb:
> Hi Björn,
>
> the rounded corners of Sections are not supported yet. If you need them
> :-)... file an enhancement request.
>
> Best,
> Ivan
>
> Björn Fischer wrote:
>> Hi Ivan,
>> thaks for resolving this so quick.
>>
>> I have another question: are the rounded corners of Sections active by
>> default (like in RCP), or do I have to make a setting somewhere? I see
>> the background gradients, but the corners still seem to be rather sharp.
>>
>> Regards,
>> Björn
>>
>> Ivan Furnadjiev schrieb:
>>
>>> Hi Björn,
>>>
>>> it is fixed in CVS HEAD. Thanks for pointing this out.
>>>
>>> Best,
>>> Ivan
>>>
>>> Björn Fischer wrote:
>>>
>>>> Hello everybody,
>>>> I checked out the latest CVS today because Ivan finished his work on
>>>> the
>>>> background gradients. Many thanks for that, Ivan!
>>>>
>>>> Unfortionately the label I set as textClient of a section (it will soon
>>>> become a ToolBar) does not show up anymore. To add the label I use the
>>>> following code:
>>>>
>>>> final Section searchSection = formsToolkit.createSection(body,
>>>> Section.TITLE_BAR | Section.TWISTIE);
>>>> Label label = formsToolkit.createLabel(searchSection, "");
>>>> label.setImage(image);
>>>> label.setToolTipText("Execute search");
>>>> searchSection.setTextClient(label);
>>>>
>>>> Could this be a side-effect of Ivans patch? I have not changed my code
>>>> recently...
>>>>
>>>> Thanks for your opinions and thoughts on that!
>>>>
>>>> Regards,
>>>> Björn
>>>>
Re: [JFace] Background gradients work (yeah), but does the Textclient still do? [message #139888 is a reply to message #139494] Thu, 09 July 2009 17:05 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bjoern.bjoernfischer.de

Hi Ivan,
according to Benny and Ralf the rounded corners are supposed to work
already. Is it that the rounded corners only don't work on _Sections_,
but they do on other widgets? So where would they be working then (right
now there come no RCP widgets in my mind that have them...)?

Regards,
Björn

Ivan Furnadjiev schrieb:
> Hi Björn,
>
> the rounded corners of Sections are not supported yet. If you need them
> :-)... file an enhancement request.
>
> Best,
> Ivan
>
> Björn Fischer wrote:
>> Hi Ivan,
>> thaks for resolving this so quick.
>>
>> I have another question: are the rounded corners of Sections active by
>> default (like in RCP), or do I have to make a setting somewhere? I see
>> the background gradients, but the corners still seem to be rather sharp.
>>
>> Regards,
>> Björn
>>
>> Ivan Furnadjiev schrieb:
>>
>>> Hi Björn,
>>>
>>> it is fixed in CVS HEAD. Thanks for pointing this out.
>>>
>>> Best,
>>> Ivan
>>>
>>> Björn Fischer wrote:
>>>
>>>> Hello everybody,
>>>> I checked out the latest CVS today because Ivan finished his work on
>>>> the
>>>> background gradients. Many thanks for that, Ivan!
>>>>
>>>> Unfortionately the label I set as textClient of a section (it will soon
>>>> become a ToolBar) does not show up anymore. To add the label I use the
>>>> following code:
>>>>
>>>> final Section searchSection = formsToolkit.createSection(body,
>>>> Section.TITLE_BAR | Section.TWISTIE);
>>>> Label label = formsToolkit.createLabel(searchSection, "");
>>>> label.setImage(image);
>>>> label.setToolTipText("Execute search");
>>>> searchSection.setTextClient(label);
>>>>
>>>> Could this be a side-effect of Ivans patch? I have not changed my code
>>>> recently...
>>>>
>>>> Thanks for your opinions and thoughts on that!
>>>>
>>>> Regards,
>>>> Björn
>>>>
Re: [JFace] Background gradients work (yeah), but does the Textclient still do? [message #139895 is a reply to message #139888] Thu, 09 July 2009 17:40 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Björn,

the Sections already has rounded corners - just use the latest forms
plugin from CVS HEAD :-).

Best,
Ivan

Björn Fischer wrote:
> Hi Ivan,
> according to Benny and Ralf the rounded corners are supposed to work
> already. Is it that the rounded corners only don't work on _Sections_,
> but they do on other widgets? So where would they be working then (right
> now there come no RCP widgets in my mind that have them...)?
>
> Regards,
> Björn
>
> Ivan Furnadjiev schrieb:
>
>> Hi Björn,
>>
>> the rounded corners of Sections are not supported yet. If you need them
>> :-)... file an enhancement request.
>>
>> Best,
>> Ivan
>>
>> Björn Fischer wrote:
>>
>>> Hi Ivan,
>>> thaks for resolving this so quick.
>>>
>>> I have another question: are the rounded corners of Sections active by
>>> default (like in RCP), or do I have to make a setting somewhere? I see
>>> the background gradients, but the corners still seem to be rather sharp.
>>>
>>> Regards,
>>> Björn
>>>
>>> Ivan Furnadjiev schrieb:
>>>
>>>
>>>> Hi Björn,
>>>>
>>>> it is fixed in CVS HEAD. Thanks for pointing this out.
>>>>
>>>> Best,
>>>> Ivan
>>>>
>>>> Björn Fischer wrote:
>>>>
>>>>
>>>>> Hello everybody,
>>>>> I checked out the latest CVS today because Ivan finished his work on
>>>>> the
>>>>> background gradients. Many thanks for that, Ivan!
>>>>>
>>>>> Unfortionately the label I set as textClient of a section (it will soon
>>>>> become a ToolBar) does not show up anymore. To add the label I use the
>>>>> following code:
>>>>>
>>>>> final Section searchSection = formsToolkit.createSection(body,
>>>>> Section.TITLE_BAR | Section.TWISTIE);
>>>>> Label label = formsToolkit.createLabel(searchSection, "");
>>>>> label.setImage(image);
>>>>> label.setToolTipText("Execute search");
>>>>> searchSection.setTextClient(label);
>>>>>
>>>>> Could this be a side-effect of Ivans patch? I have not changed my code
>>>>> recently...
>>>>>
>>>>> Thanks for your opinions and thoughts on that!
>>>>>
>>>>> Regards,
>>>>> Björn
>>>>>
>>>>>
Re: [JFace] Background gradients work (yeah), but does the Textclient still do? [message #139905 is a reply to message #139895] Thu, 09 July 2009 20:27 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: paul.kendall.orionhealth.com

Ivan Furnadjiev wrote:

> Hi Björn,
>
> the Sections already has rounded corners - just use the latest forms
> plugin from CVS HEAD :-).
>
> Best,
> Ivan
>

They work nicely for me! One thing I have noticed though is that the
separator on the form heading is not implemented yet. Should I raise a bug
for this?

Also, the border around the section gradient is not there either.

Cheers,
Paul
Re: [JFace] Background gradients work (yeah), but does the Textclient still do? [message #139915 is a reply to message #139905] Thu, 09 July 2009 20:41 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Paul,

such a bug already exists:

268923: Separator does not show on UI Form
https://bugs.eclipse.org/bugs/show_bug.cgi?id=268923

Best,
Ivan

Paul Kendall wrote:
> Ivan Furnadjiev wrote:
>
>
>> Hi Björn,
>>
>> the Sections already has rounded corners - just use the latest forms
>> plugin from CVS HEAD :-).
>>
>> Best,
>> Ivan
>>
>>
>
> They work nicely for me! One thing I have noticed though is that the
> separator on the form heading is not implemented yet. Should I raise a bug
> for this?
>
> Also, the border around the section gradient is not there either.
>
> Cheers,
> Paul
>
>
Re: [JFace] Background gradients work (yeah), but does the Textclient still do? [message #139936 is a reply to message #139905] Fri, 10 July 2009 07:33 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Paul,

BTW the FormHeading has background gradient too. Just use:
....
toolkit.decorateFormHeading( form );
....

Best,
Ivan

Paul Kendall wrote:
> Ivan Furnadjiev wrote:
>
>
>> Hi Björn,
>>
>> the Sections already has rounded corners - just use the latest forms
>> plugin from CVS HEAD :-).
>>
>> Best,
>> Ivan
>>
>>
>
> They work nicely for me! One thing I have noticed though is that the
> separator on the form heading is not implemented yet. Should I raise a bug
> for this?
>
> Also, the border around the section gradient is not there either.
>
> Cheers,
> Paul
>
>
Re: [JFace] Background gradients work (yeah), but does the Textclient still do? [message #139959 is a reply to message #139936] Fri, 10 July 2009 08:34 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bjoern.bjoernfischer.de

Hi Ivan,
yes I can confirm that, and also the rounded corners. Good work!

Concerning the Form gradient, ist this code supposed to work?

form.setHeadColor(IFormColors.H_GRADIENT_START, darkgrey);
form.setHeadColor(IFormColors.H_GRADIENT_END, lightgrey);

I tried to set the colors like this but (at least in my app) this does
nothing, there is still the white-to-light-blue gradient. Can the form
gradient colors be set in some other way?

Thanks for your hints!

Regards,
Björn

Ivan Furnadjiev schrieb:
> Paul,
>
> BTW the FormHeading has background gradient too. Just use:
> ...
> toolkit.decorateFormHeading( form );
> ...
>
> Best,
> Ivan
>
> Paul Kendall wrote:
>> Ivan Furnadjiev wrote:
>>
>>
>>> Hi Björn,
>>>
>>> the Sections already has rounded corners - just use the latest forms
>>> plugin from CVS HEAD :-).
>>>
>>> Best,
>>> Ivan
>>>
>>>
>>
>> They work nicely for me! One thing I have noticed though is that the
>> separator on the form heading is not implemented yet. Should I raise a
>> bug for this?
>>
>> Also, the border around the section gradient is not there either.
>>
>> Cheers,
>> Paul
>>
>>
Re: [JFace] Background gradients work (yeah), but does the Textclient still do? [message #139970 is a reply to message #139959] Fri, 10 July 2009 09:08 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Bjorn,

is this working in RCP? If you want to change the gradient colors, use
FormHeading#setTextBackground(Color[], int[], boolean):
.....
Color[] gradientColors = new Color[] {
darkgrey,
lightgrey
};
int[] percents = new int[] { 0, 100 };
head.setTextBackground(gradientColors, percents, false);
.....
For section use Section#setTitleBarBackground();

This should work.

Best,
Ivan

Björn Fischer wrote:
> Hi Ivan,
> yes I can confirm that, and also the rounded corners. Good work!
>
> Concerning the Form gradient, ist this code supposed to work?
>
> form.setHeadColor(IFormColors.H_GRADIENT_START, darkgrey);
> form.setHeadColor(IFormColors.H_GRADIENT_END, lightgrey);
>
> I tried to set the colors like this but (at least in my app) this does
> nothing, there is still the white-to-light-blue gradient. Can the form
> gradient colors be set in some other way?
>
> Thanks for your hints!
>
> Regards,
> Björn
>
> Ivan Furnadjiev schrieb:
>
>> Paul,
>>
>> BTW the FormHeading has background gradient too. Just use:
>> ...
>> toolkit.decorateFormHeading( form );
>> ...
>>
>> Best,
>> Ivan
>>
>> Paul Kendall wrote:
>>
>>> Ivan Furnadjiev wrote:
>>>
>>>
>>>
>>>> Hi Björn,
>>>>
>>>> the Sections already has rounded corners - just use the latest forms
>>>> plugin from CVS HEAD :-).
>>>>
>>>> Best,
>>>> Ivan
>>>>
>>>>
>>>>
>>> They work nicely for me! One thing I have noticed though is that the
>>> separator on the form heading is not implemented yet. Should I raise a
>>> bug for this?
>>>
>>> Also, the border around the section gradient is not there either.
>>>
>>> Cheers,
>>> Paul
>>>
>>>
>>>
Re: [JFace] Background gradients work (yeah), but does the Textclient still do? [message #139997 is a reply to message #139970] Fri, 10 July 2009 13:20 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bjoern.bjoernfischer.de

Hi Ivan,
sorry I did not cross-check this with RCP. You're right, it does not
work in RCP either, even though it should as I understand from this
document:

http://www.eclipse.org/eclipse/platform-ua/proposals/forms/e nhancements-3.3/index.html

Now I tried your alternative solution. The FormHeading class seems to be
not part of the public API, but Form has the method too:

------------------
Form form = formsToolkit.createForm(parent);
[set a HeadClient on the form]
Color[] gradientColors = { darkgrey, lightgrey };
int[] percents = { 0, 100 };
form.setTextBackground(gradientColors, percents, false);
formsToolkit.decorateFormHeading(form);
------------------

This leads to an ArrayIndexOutOfBoundsException in RCP (I don't really
understand why, maybe you can have a quick look at the stacktrace below?).

In RAP this simply does nothing, the gradient is still the default blue.
Any other ideas about that?

Googling on this topic brought me no further. Is it confirmed that
setting the gradient color of Form heading works anyway (in RCP or RAP)?
At least the API is quite confusing at this point.

Thanks for your help.

Regards,
Björn


Stacktrace (RCP)
----------------
java.lang.ArrayIndexOutOfBoundsException: 2
at
org.eclipse.ui.internal.forms.widgets.FormImages$ComplexImag eDescriptor.drawTextGradient(FormImages.java:207)
at
org.eclipse.ui.internal.forms.widgets.FormImages$ComplexImag eDescriptor.createImage(FormImages.java:183)
at
org.eclipse.jface.resource.ImageDescriptor.createResource(Im ageDescriptor.java:165)
at
org.eclipse.jface.resource.DeviceResourceManager.allocate(De viceResourceManager.java:56)
at
org.eclipse.jface.resource.AbstractResourceManager.create(Ab stractResourceManager.java:88)
at
org.eclipse.jface.resource.LocalResourceManager.allocate(Loc alResourceManager.java:82)
at
org.eclipse.jface.resource.AbstractResourceManager.create(Ab stractResourceManager.java:88)
at
org.eclipse.jface.resource.ResourceManager.createImage(Resou rceManager.java:172)
at
org.eclipse.ui.internal.forms.widgets.FormImages.getGradient (FormImages.java:263)
at
org.eclipse.ui.internal.forms.widgets.FormImages.getGradient (FormImages.java:258)
at
org.eclipse.ui.internal.forms.widgets.FormHeading.updateGrad ientImage(FormHeading.java:860)
at
org.eclipse.ui.internal.forms.widgets.FormHeading.setTextBac kground(FormHeading.java:711)
at org.eclipse.ui.forms.widgets.Form.setTextBackground(Form.jav a:319)
at
com.tp.ui.framework.SwtWidgetToolkit.createSearchForm(SwtWid getToolkit.java:1015)
at
com.tp.lisa.masterdata.ui.views.PseudoTableSummary.createPar tControl(PseudoTableSummary.java:102)
Ivan Furnadjiev schrieb:
> Bjorn,
>
> is this working in RCP? If you want to change the gradient colors, use
> FormHeading#setTextBackground(Color[], int[], boolean):
> ....
> Color[] gradientColors = new Color[] { darkgrey,
> lightgrey
> };
> int[] percents = new int[] { 0, 100 };
> head.setTextBackground(gradientColors, percents, false);
> ....
> For section use Section#setTitleBarBackground();
>
> This should work.
>
> Best,
> Ivan
>
> Björn Fischer wrote:
>> Hi Ivan,
>> yes I can confirm that, and also the rounded corners. Good work!
>>
>> Concerning the Form gradient, ist this code supposed to work?
>>
>> form.setHeadColor(IFormColors.H_GRADIENT_START, darkgrey);
>> form.setHeadColor(IFormColors.H_GRADIENT_END, lightgrey);
>>
>> I tried to set the colors like this but (at least in my app) this does
>> nothing, there is still the white-to-light-blue gradient. Can the form
>> gradient colors be set in some other way?
>>
>> Thanks for your hints!
>>
>> Regards,
>> Björn
>>
>> Ivan Furnadjiev schrieb:
>>
>>> Paul,
>>>
>>> BTW the FormHeading has background gradient too. Just use:
>>> ...
>>> toolkit.decorateFormHeading( form );
>>> ...
>>>
>>> Best,
>>> Ivan
>>>
>>> Paul Kendall wrote:
>>>
>>>> Ivan Furnadjiev wrote:
>>>>
>>>>
>>>>
>>>>> Hi Björn,
>>>>>
>>>>> the Sections already has rounded corners - just use the latest forms
>>>>> plugin from CVS HEAD :-).
>>>>>
>>>>> Best,
>>>>> Ivan
>>>>>
>>>>>
>>>> They work nicely for me! One thing I have noticed though is that the
>>>> separator on the form heading is not implemented yet. Should I raise a
>>>> bug for this?
>>>>
>>>> Also, the border around the section gradient is not there either.
>>>>
>>>> Cheers,
>>>> Paul
>>>>
>>>>
Re: [JFace] Background gradients work (yeah), but does the Textclient still do? [message #140009 is a reply to message #139997] Fri, 10 July 2009 13:53 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Björn,

this is the correct one. In RCP the percents array lenght must be with 1
less than the gradientColors array:

Form form = formsToolkit.createForm(parent);
[set a HeadClient on the form]
Color[] gradientColors = { darkgrey, lightgrey };
int[] percents = { 100 };
form.setTextBackground(gradientColors, percents, false);

In RAP only the vertical gradient is supported, that is way the third
parameter is ignored.
And don't call formsToolkit.decorateFormHeading(form);. This override
your colors set in setTextBackground with the default one.
Please update to the latest forms plugin from CVS HEAD. Today I've
updated the FormHeading class.

Best,
Ivan


Björn Fischer wrote:
> Hi Ivan,
> sorry I did not cross-check this with RCP. You're right, it does not
> work in RCP either, even though it should as I understand from this
> document:
>
> http://www.eclipse.org/eclipse/platform-ua/proposals/forms/e nhancements-3.3/index.html
>
> Now I tried your alternative solution. The FormHeading class seems to be
> not part of the public API, but Form has the method too:
>
> ------------------
> Form form = formsToolkit.createForm(parent);
> [set a HeadClient on the form]
> Color[] gradientColors = { darkgrey, lightgrey };
> int[] percents = { 0, 100 };
> form.setTextBackground(gradientColors, percents, false);
> formsToolkit.decorateFormHeading(form);
> ------------------
>
> This leads to an ArrayIndexOutOfBoundsException in RCP (I don't really
> understand why, maybe you can have a quick look at the stacktrace below?).
>
> In RAP this simply does nothing, the gradient is still the default blue.
> Any other ideas about that?
>
> Googling on this topic brought me no further. Is it confirmed that
> setting the gradient color of Form heading works anyway (in RCP or RAP)?
> At least the API is quite confusing at this point.
>
> Thanks for your help.
>
> Regards,
> Björn
>
>
> Stacktrace (RCP)
> ----------------
> java.lang.ArrayIndexOutOfBoundsException: 2
> at
> org.eclipse.ui.internal.forms.widgets.FormImages$ComplexImag eDescriptor.drawTextGradient(FormImages.java:207)
> at
> org.eclipse.ui.internal.forms.widgets.FormImages$ComplexImag eDescriptor.createImage(FormImages.java:183)
> at
> org.eclipse.jface.resource.ImageDescriptor.createResource(Im ageDescriptor.java:165)
> at
> org.eclipse.jface.resource.DeviceResourceManager.allocate(De viceResourceManager.java:56)
> at
> org.eclipse.jface.resource.AbstractResourceManager.create(Ab stractResourceManager.java:88)
> at
> org.eclipse.jface.resource.LocalResourceManager.allocate(Loc alResourceManager.java:82)
> at
> org.eclipse.jface.resource.AbstractResourceManager.create(Ab stractResourceManager.java:88)
> at
> org.eclipse.jface.resource.ResourceManager.createImage(Resou rceManager.java:172)
> at
> org.eclipse.ui.internal.forms.widgets.FormImages.getGradient (FormImages.java:263)
> at
> org.eclipse.ui.internal.forms.widgets.FormImages.getGradient (FormImages.java:258)
> at
> org.eclipse.ui.internal.forms.widgets.FormHeading.updateGrad ientImage(FormHeading.java:860)
> at
> org.eclipse.ui.internal.forms.widgets.FormHeading.setTextBac kground(FormHeading.java:711)
> at org.eclipse.ui.forms.widgets.Form.setTextBackground(Form.jav a:319)
> at
> com.tp.ui.framework.SwtWidgetToolkit.createSearchForm(SwtWid getToolkit.java:1015)
> at
> com.tp.lisa.masterdata.ui.views.PseudoTableSummary.createPar tControl(PseudoTableSummary.java:102)
> Ivan Furnadjiev schrieb:
>
>> Bjorn,
>>
>> is this working in RCP? If you want to change the gradient colors, use
>> FormHeading#setTextBackground(Color[], int[], boolean):
>> ....
>> Color[] gradientColors = new Color[] { darkgrey,
>> lightgrey
>> };
>> int[] percents = new int[] { 0, 100 };
>> head.setTextBackground(gradientColors, percents, false);
>> ....
>> For section use Section#setTitleBarBackground();
>>
>> This should work.
>>
>> Best,
>> Ivan
>>
>> Björn Fischer wrote:
>>
>>> Hi Ivan,
>>> yes I can confirm that, and also the rounded corners. Good work!
>>>
>>> Concerning the Form gradient, ist this code supposed to work?
>>>
>>> form.setHeadColor(IFormColors.H_GRADIENT_START, darkgrey);
>>> form.setHeadColor(IFormColors.H_GRADIENT_END, lightgrey);
>>>
>>> I tried to set the colors like this but (at least in my app) this does
>>> nothing, there is still the white-to-light-blue gradient. Can the form
>>> gradient colors be set in some other way?
>>>
>>> Thanks for your hints!
>>>
>>> Regards,
>>> Björn
>>>
>>> Ivan Furnadjiev schrieb:
>>>
>>>
>>>> Paul,
>>>>
>>>> BTW the FormHeading has background gradient too. Just use:
>>>> ...
>>>> toolkit.decorateFormHeading( form );
>>>> ...
>>>>
>>>> Best,
>>>> Ivan
>>>>
>>>> Paul Kendall wrote:
>>>>
>>>>
>>>>> Ivan Furnadjiev wrote:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>> Hi Björn,
>>>>>>
>>>>>> the Sections already has rounded corners - just use the latest forms
>>>>>> plugin from CVS HEAD :-).
>>>>>>
>>>>>> Best,
>>>>>> Ivan
>>>>>>
>>>>>>
>>>>>>
>>>>> They work nicely for me! One thing I have noticed though is that the
>>>>> separator on the form heading is not implemented yet. Should I raise a
>>>>> bug for this?
>>>>>
>>>>> Also, the border around the section gradient is not there either.
>>>>>
>>>>> Cheers,
>>>>> Paul
>>>>>
>>>>>
>>>>>
Re: [JFace] Background gradients work (yeah), but does the Textclient still do? [message #140053 is a reply to message #139905] Fri, 10 July 2009 21:55 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Paul,

separator is implemented. Changes are in CVS HEAD.

Best,
Ivan

Paul Kendall wrote:
> Ivan Furnadjiev wrote:
>
>
>> Hi Björn,
>>
>> the Sections already has rounded corners - just use the latest forms
>> plugin from CVS HEAD :-).
>>
>> Best,
>> Ivan
>>
>>
>
> They work nicely for me! One thing I have noticed though is that the
> separator on the form heading is not implemented yet. Should I raise a bug
> for this?
>
> Also, the border around the section gradient is not there either.
>
> Cheers,
> Paul
>
>
Re: [JFace] Background gradients work (yeah), but does the Textclient still do? [message #140074 is a reply to message #140053] Sun, 12 July 2009 22:27 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: paul.kendall.orionhealth.com

Ivan Furnadjiev wrote:

> Hi Paul,
>
> separator is implemented. Changes are in CVS HEAD.
>
> Best,
> Ivan
>
Yeah, I got that this morning. Works great!

Thanks Ivan.
Re: [JFace] Background gradients work (yeah), but does the Textclient still do? [message #140144 is a reply to message #140009] Mon, 13 July 2009 12:36 Go to previous message
Eclipse UserFriend
Originally posted by: bjoern.bjoernfischer.de

Yes, that works. Thanks Ivan!

Ivan Furnadjiev schrieb:
> Hi Björn,
>
> this is the correct one. In RCP the percents array lenght must be with 1
> less than the gradientColors array:
>
> Form form = formsToolkit.createForm(parent);
> [set a HeadClient on the form]
> Color[] gradientColors = { darkgrey, lightgrey };
> int[] percents = { 100 };
> form.setTextBackground(gradientColors, percents, false);
>
> In RAP only the vertical gradient is supported, that is way the third
> parameter is ignored.
> And don't call formsToolkit.decorateFormHeading(form);. This override
> your colors set in setTextBackground with the default one.
> Please update to the latest forms plugin from CVS HEAD. Today I've
> updated the FormHeading class.
>
> Best,
> Ivan
>
>
> Björn Fischer wrote:
>> Hi Ivan,
>> sorry I did not cross-check this with RCP. You're right, it does not
>> work in RCP either, even though it should as I understand from this
>> document:
>>
>> http://www.eclipse.org/eclipse/platform-ua/proposals/forms/e nhancements-3.3/index.html
>>
>>
>> Now I tried your alternative solution. The FormHeading class seems to be
>> not part of the public API, but Form has the method too:
>>
>> ------------------
>> Form form = formsToolkit.createForm(parent);
>> [set a HeadClient on the form]
>> Color[] gradientColors = { darkgrey, lightgrey };
>> int[] percents = { 0, 100 };
>> form.setTextBackground(gradientColors, percents, false);
>> formsToolkit.decorateFormHeading(form);
>> ------------------
>>
>> This leads to an ArrayIndexOutOfBoundsException in RCP (I don't really
>> understand why, maybe you can have a quick look at the stacktrace
>> below?).
>>
>> In RAP this simply does nothing, the gradient is still the default blue.
>> Any other ideas about that?
>>
>> Googling on this topic brought me no further. Is it confirmed that
>> setting the gradient color of Form heading works anyway (in RCP or RAP)?
>> At least the API is quite confusing at this point.
>>
>> Thanks for your help.
>>
>> Regards,
>> Björn
>>
>>
>> Stacktrace (RCP)
>> ----------------
>> java.lang.ArrayIndexOutOfBoundsException: 2
>> at
>> org.eclipse.ui.internal.forms.widgets.FormImages$ComplexImag eDescriptor.drawTextGradient(FormImages.java:207)
>>
>> at
>> org.eclipse.ui.internal.forms.widgets.FormImages$ComplexImag eDescriptor.createImage(FormImages.java:183)
>>
>> at
>> org.eclipse.jface.resource.ImageDescriptor.createResource(Im ageDescriptor.java:165)
>>
>> at
>> org.eclipse.jface.resource.DeviceResourceManager.allocate(De viceResourceManager.java:56)
>>
>> at
>> org.eclipse.jface.resource.AbstractResourceManager.create(Ab stractResourceManager.java:88)
>>
>> at
>> org.eclipse.jface.resource.LocalResourceManager.allocate(Loc alResourceManager.java:82)
>>
>> at
>> org.eclipse.jface.resource.AbstractResourceManager.create(Ab stractResourceManager.java:88)
>>
>> at
>> org.eclipse.jface.resource.ResourceManager.createImage(Resou rceManager.java:172)
>>
>> at
>> org.eclipse.ui.internal.forms.widgets.FormImages.getGradient (FormImages.java:263)
>>
>> at
>> org.eclipse.ui.internal.forms.widgets.FormImages.getGradient (FormImages.java:258)
>>
>> at
>> org.eclipse.ui.internal.forms.widgets.FormHeading.updateGrad ientImage(FormHeading.java:860)
>>
>> at
>> org.eclipse.ui.internal.forms.widgets.FormHeading.setTextBac kground(FormHeading.java:711)
>>
>> at org.eclipse.ui.forms.widgets.Form.setTextBackground(Form.jav a:319)
>> at
>> com.tp.ui.framework.SwtWidgetToolkit.createSearchForm(SwtWid getToolkit.java:1015)
>>
>> at
>> com.tp.lisa.masterdata.ui.views.PseudoTableSummary.createPar tControl(PseudoTableSummary.java:102)
>>
>> Ivan Furnadjiev schrieb:
>>
>>> Bjorn,
>>>
>>> is this working in RCP? If you want to change the gradient colors, use
>>> FormHeading#setTextBackground(Color[], int[], boolean):
>>> ....
>>> Color[] gradientColors = new Color[] { darkgrey,
>>> lightgrey
>>> };
>>> int[] percents = new int[] { 0, 100 };
>>> head.setTextBackground(gradientColors, percents, false);
>>> ....
>>> For section use Section#setTitleBarBackground();
>>>
>>> This should work.
>>>
>>> Best,
>>> Ivan
>>>
>>> Björn Fischer wrote:
>>>
>>>> Hi Ivan,
>>>> yes I can confirm that, and also the rounded corners. Good work!
>>>>
>>>> Concerning the Form gradient, ist this code supposed to work?
>>>>
>>>> form.setHeadColor(IFormColors.H_GRADIENT_START, darkgrey);
>>>> form.setHeadColor(IFormColors.H_GRADIENT_END, lightgrey);
>>>>
>>>> I tried to set the colors like this but (at least in my app) this does
>>>> nothing, there is still the white-to-light-blue gradient. Can the form
>>>> gradient colors be set in some other way?
>>>>
>>>> Thanks for your hints!
>>>>
>>>> Regards,
>>>> Björn
>>>>
>>>> Ivan Furnadjiev schrieb:
>>>>
>>>>
>>>>> Paul,
>>>>>
>>>>> BTW the FormHeading has background gradient too. Just use:
>>>>> ...
>>>>> toolkit.decorateFormHeading( form );
>>>>> ...
>>>>>
>>>>> Best,
>>>>> Ivan
>>>>>
>>>>> Paul Kendall wrote:
>>>>>
>>>>>> Ivan Furnadjiev wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>> Hi Björn,
>>>>>>>
>>>>>>> the Sections already has rounded corners - just use the latest forms
>>>>>>> plugin from CVS HEAD :-).
>>>>>>>
>>>>>>> Best,
>>>>>>> Ivan
>>>>>>>
>>>>>>>
>>>>>> They work nicely for me! One thing I have noticed though is that the
>>>>>> separator on the form heading is not implemented yet. Should I
>>>>>> raise a
>>>>>> bug for this?
>>>>>>
>>>>>> Also, the border around the section gradient is not there either.
>>>>>>
>>>>>> Cheers,
>>>>>> Paul
>>>>>>
>>>>>>
Previous Topic:TinyMCE integration in RAP
Next Topic:Integrating BIRT into RAP applications
Goto Forum:
  


Current Time: Thu Apr 25 23:23:56 GMT 2024

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

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

Back to the top