Skip to main content



      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 10:56 Go to next message
Eclipse UserFriend
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 05:47 Go to previous messageGo to next message
Eclipse UserFriend
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 09:30 Go to previous message
Eclipse UserFriend
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: Tue Mar 25 03:00:29 EDT 2025

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

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

Back to the top