Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » How to change the font size of the title in a TitleAreaDialog?
How to change the font size of the title in a TitleAreaDialog? [message #522829] Wed, 24 March 2010 06:15 Go to next message
tingel christian is currently offline tingel christianFriend
Messages: 46
Registered: December 2009
Member
Hi everyone:

I need to change the font size of the title string in a TitleAreaDialog.I have found that modifying the \org\eclipse\jface\resource\jfacefonts.properties in org.eclipse.rap.jface_1.2.0.20090616-1425.jar could make it work which means I have to make changes to the RAP config files directly in the jar file.

So I wish to know, can I change the font size without changing RAP itself or creating a new fragment project? And how? If I can achieve this by theme, what key word should I use?

Or, If I have to create a new fragement project, do I have to make it EPL and opensource?

Thanks and Best Regards

Tingel Christian

[Updated on: Wed, 24 March 2010 06:30]

Report message to a moderator

Re: How to change the font size of the title in a TitleAreaDialog [message #522861 is a reply to message #522829] Wed, 24 March 2010 08:59 Go to previous messageGo to next message
Holger Staudacher is currently offline Holger StaudacherFriend
Messages: 166
Registered: July 2009
Senior Member
Hi Christian,
please see my comments bellow.

On 2010-03-24 07:16:00 +0100, tingel christian <jillhan520@126.com> said:

> Hi everyone:
>
> I need to change the font size of the title string in a
> TitleAreaDialog.I have found that modifying the
> \org\eclipse\jface\resource\jfacefonts.properties in
> org.eclipse.rap.jface_1.2.0.20090616-1425.jar could make it work which
> means I have to make changes to the RAP config files directly in the
> jar file.
>
> So I wish to know, can I change the font size without changing RAP
> itself or creating a new fragment project? And how? If I can achieve
> this by theme, what key word should I use?

If you take a look a the deprecated method TitleAreaDialog#getTitleArea
you will see that it just calls #getShell(). So my suggestion would be
to get the Shell, set a CustomVariant and style the area with css. Take
a look on [1] and [2] to see how to do this.


>
> Or, If I have to create a new fragement project, do I have to make it
> EPL and opensource?

No, you haven't. Just create a new Theme Extension in your project. You
don't have to make it open source. See [3] for more infos.

Regards Holger

>

[1]
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .rap.help/help/html/advanced/theming.html
[2]

http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .rap.help/help/html/reference/theming/index.html
[3]

http://www.eclipse.org/legal/epl-v10.html

--
-----------------------------------------

http://eclipsesource.com

http://twitter.com/eclipsesource
Re: How to change the font size of the title in a TitleAreaDialog [message #522885 is a reply to message #522861] Wed, 24 March 2010 10:47 Go to previous messageGo to next message
tingel christian is currently offline tingel christianFriend
Messages: 46
Registered: December 2009
Member
Hi Holger:

Thanks a lot for you information.

I followed your direction, but it did not work at all Sad

Actually, I extended the org.eclipse.ui.newWizard extension point and the WizardDialog is instantiated within the NewWizardAction itself so I am not able to control the instance of WizardDialog directly, you know.

So I called the setData method in a subclass of WizardPage when override the createControl(Composite parent) method with the following code:

this.getContainer().getShell().setData(WidgetUtil.CUSTOM_VAR IANT, "mySample");

In the css file, I coded something like this:

Shell.mySample {
font: 12px Verdana, "Lucida Sans", Arial, Helvetica, sans-serif;
color: blue;
}

and the theme and branding are both extended.

But all these steps made no differences...

(I also tried to setData in subclass of Wizard, the effect was the same...)

Did I missed anything?

Thanks and Best Regards!

Tingel Christian
Re: How to change the font size of the title in a TitleAreaDialog [message #522908 is a reply to message #522861] Wed, 24 March 2010 13:45 Go to previous messageGo to next message
tingel christian is currently offline tingel christianFriend
Messages: 46
Registered: December 2009
Member
Hi Holger:

I changed the "Shell.mySample" to ".mySample", and it "worked", but not as what I had expected...

you know, In a wizard dialog, there are two "title"s. One is the title in the title bar of the dialog, the other is the title of the current page in the wizard page description area and what I wish to change is the second one but the one actually changed is the first...

that sounds like a cold joke~~~(-_-!!) Smile

So could you please tell me how I can change the size of the title in the title area?

Sorry but I forgot to tell that my RAP version is 1.2.0, and there is no api to get a reference to the titleLabel there.

Thanks and Best Regards

Tingel Christian

[Updated on: Wed, 24 March 2010 13:53]

Report message to a moderator

Re: How to change the font size of the title in a TitleAreaDialog [message #522909 is a reply to message #522885] Wed, 24 March 2010 13:45 Go to previous messageGo to next message
Holger Staudacher is currently offline Holger StaudacherFriend
Messages: 166
Registered: July 2009
Senior Member
Hi Christian,
ok this sounds not good. I tooked a closer look at TitleAreaDialog. it
seems that the title will be displayed in the private Label titleLabel.
To change this text you need to set a CustomVariant on this Label. The
bad thing is, you have no opportunity to access this field. Another
solution would be to change the global font of Labels. But I think this
is not what you want. So, the conclusion is, you have no clean
possibility to change this font.

Hope this helps.

Regards Holger

On 2010-03-24 11:47:03 +0100, tingel christian <jillhan520@126.com> said:

> Hi Holger:
>
> Thanks a lot for you information.
>
> I followed your direction, but it did not work at all :(
> Actually, I extended the org.eclipse.ui.newWizard extension point and
> the WizardDialog is instantiated within the NewWizardAction itself so I
> am not able to control the instance of WizardDialog directly, you know.
>
> So I called the setData method in a subclass of WizardPage when
> override the createControl(Composite parent) method with the following
> code:
>
> this.getContainer().getShell().setData(WidgetUtil.CUSTOM_VAR IANT,
> "mySample");
>
> In the css file, I coded something like this:
>
> Shell.mySample {
> font: 12px Verdana, "Lucida Sans", Arial, Helvetica, sans-serif;
> color: blue;
> }
>
> and the theme and branding are both extended.
>
> But all these steps made no differences...
>
> (I also tried to setData in subclass of Wizard, the effect was the same...)
>
> Did I missed anything?
>
> Thanks and Best Regards!
>
> Tingel Christian


--
-----------------------------------------

http://eclipsesource.com

http://twitter.com/eclipsesource
Re: How to change the font size of the title in a TitleAreaDialog [message #522917 is a reply to message #522909] Wed, 24 March 2010 14:14 Go to previous messageGo to next message
tingel christian is currently offline tingel christianFriend
Messages: 46
Registered: December 2009
Member
Thank you Holger Smile

The fact is that...I do changed the font size globally and that made different to every label but the one in the title area of the wizard page.I think this is probably a bug...

Finally I created a fragment project and moved the jfacefonts.properties to it and had the org.eclipse.jface.bannerfont.0=MS Sans Serif-bold-10 configuration item changed to org.eclipse.jface.bannerfont.0=MS Sans Serif-bold-12.

Anyway, thank you very much for you kind help Smile

Best Regards

Tingel Christian
Re: How to change the font size of the title in a TitleAreaDialog [message #523140 is a reply to message #522917] Thu, 25 March 2010 05:00 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1313
Registered: July 2009
Senior Member

Christian,

you might also want to cc yourself on this bug:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=280773

I think, until we have a solution for this one, the fragment approach is
probably the easiest workaround.

Best regards, Ralf

tingel christian wrote:
> Thank you Holger :)
> The fact is that...I do changed the font size globally and that made
> different to every label but the one in the title area of the wizard
> page.I think this is probably a bug...
>
> Finally I created a fragment project and moved the jfacefonts.properties
> to it and had the org.eclipse.jface.bannerfont.0=MS Sans Serif-bold-10
> configuration item changed to org.eclipse.jface.bannerfont.0=MS Sans
> Serif-bold-12.
>
> Anyway, thank you very much for you kind help :)
> Best Regards
>
> Tingel Christian
Re: How to change the font size of the title in a TitleAreaDialog [message #523347 is a reply to message #523140] Fri, 26 March 2010 03:17 Go to previous message
tingel christian is currently offline tingel christianFriend
Messages: 46
Registered: December 2009
Member
Thank you, Ralf .

That's exactly the same problem as the one I am facing~~~I'll be waiting for the solution and use the workaround before the solution is carried out Smile

Thanks and Best Regards!

Tingel Christian

Ralf Sternberg wrote on Thu, 25 March 2010 01:00
Christian,

you might also want to cc yourself on this bug:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=280773

I think, until we have a solution for this one, the fragment approach is
probably the easiest workaround.

Best regards, Ralf

tingel christian wrote:
> Thank you Holger Smile
> The fact is that...I do changed the font size globally and that made
> different to every label but the one in the title area of the wizard
> page.I think this is probably a bug...
>
> Finally I created a fragment project and moved the jfacefonts.properties
> to it and had the org.eclipse.jface.bannerfont.0=MS Sans Serif-bold-10
> configuration item changed to org.eclipse.jface.bannerfont.0=MS Sans
> Serif-bold-12.
>
> Anyway, thank you very much for you kind help Smile
> Best Regards
>
> Tingel Christian

Previous Topic:Allow Java Servlet API 3.0 in RAP?
Next Topic:RAP Deployment problems / unresolved constraints
Goto Forum:
  


Current Time: Mon Nov 29 03:33:59 GMT 2021

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

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

Back to the top