Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Eclipse Communications Framework (ECF) » How-to use css to customise ECF views ?
How-to use css to customise ECF views ? [message #1223157] Sun, 22 December 2013 15:56 Go to next message
Bernard Sarter is currently offline Bernard SarterFriend
Messages: 88
Registered: August 2011
Location: Paris, France
Member
Hello,

I have a RCP app, that includes some ECF view (chat room); it works fine.

I would like to customise the fonts of the messages visible in the chat room windows, if possible through a css file (Eclipse Theme).

According to the code of MessageRenderer.java, ECF does something like this (I simplified the code):

String RECEIVED_FONT = "org.eclipse.ecf.presence.ui.receivedFont";
(...)
ITheme theme = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme();
Font f = theme.getFontRegistry().get(RECEIVED_FONT);
(...)


Now my question is: what shall I add to my css file to change the font ?

I tried

#org.eclipse.ecf.presence.ui.receivedFont {
	font-size: 16;
	font-family: 'Arial';
}


but it had no effect (and I admit that I'm not a css expert).

Any suggestion welcome,

Best regards,
Bernard.
Re: How-to use css to customise ECF views ? [message #1223424 is a reply to message #1223157] Mon, 23 December 2013 10:47 Go to previous messageGo to next message
Wim Jongman is currently offline Wim JongmanFriend
Messages: 493
Registered: July 2009
Senior Member

Eclipse 3 Theming and the new CSS theming of eclipse 4 are two different things. So if you want to style that specific text you have to probably do something like using the view id and inside that use the widget class. Please see [1] for more information.

[1] http://wiki.eclipse.org/Eclipse4/RCP/CSS
Re: How-to use css to customise ECF views ? [message #1224377 is a reply to message #1223424] Thu, 26 December 2013 14:30 Go to previous message
Bernard Sarter is currently offline Bernard SarterFriend
Messages: 88
Registered: August 2011
Location: Paris, France
Member
Thank you for this reply.

Using e4 css file (and thanks to css spy), I could change some parameters of the chat view (eg. the background colour), but not the fonts.

I could nevertheless change the fonts by code, eg.:

        PlatformUI.getWorkbench().getThemeManager().getCurrentTheme().getFontRegistry()
                .put("org.eclipse.ecf.presence.ui.receivedFont", myFont);


so it's fine now.

Regards,
Bernard.
Previous Topic:Can't Connect to ECF Server
Next Topic:NullPointerException in PollingInputStream.readPendingInput()
Goto Forum:
  


Current Time: Sun Dec 08 02:37:10 GMT 2024

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

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

Back to the top