Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Usage of CSS3 @media print Rule in RAP
Usage of CSS3 @media print Rule in RAP [message #1776624] Sat, 18 November 2017 20:45 Go to next message
Vincenzo Caselli is currently offline Vincenzo CaselliFriend
Messages: 190
Registered: January 2012
Senior Member
We know how to use CSS for customizing RAP applications introducing a special CSS file, but also know that this CSS file is specific for RAP and you cannot put into it what you would put into a standard JEE CSS3 file.
For example you cannot use the CSS3 '@media print' Rule
https://www.w3schools.com/cssref/css3_pr_mediaquery.asp

We would like to set some customization when the user does Ctrl-P to print the page, e.g. scaling to 50% all the page content.
In a standard JEE approach you could use a CSS3 '@media print' Rule to perform this.
In RAP how could we link a standard JEE CSS file to the HTML application page or alternatively how can we set attributes for the '@media print' output?

Thank you very much
Vincenzo
Re: Usage of CSS3 @media print Rule in RAP [message #1776751 is a reply to message #1776624] Tue, 21 November 2017 08:06 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2263
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Vincenzo,
standard CSS file can be loaded with ClientFileLoader client service.

[1] http://download.eclipse.org/rt/rap/doc/3.3/guide/reference/api/org/eclipse/rap/rwt/client/service/ClientFileLoader.html

HTH,
Ivan
Re: Usage of CSS3 @media print Rule in RAP [message #1776779 is a reply to message #1776751] Tue, 21 November 2017 15:13 Go to previous messageGo to next message
Vincenzo Caselli is currently offline Vincenzo CaselliFriend
Messages: 190
Registered: January 2012
Senior Member
Hi Ivan,
thank you very much.
Unfortunately we are tied to RAP 3.0.2, since Java 8 is not available on the server's customer.
Is there some way/hack to register a standard CSS file before RAP 3.1 ?
Thank you very much.
Vincenzo

[Updated on: Tue, 21 November 2017 15:16]

Report message to a moderator

Re: Usage of CSS3 @media print Rule in RAP [message #1776815 is a reply to message #1776779] Tue, 21 November 2017 21:07 Go to previous messageGo to next message
Chris Fairhall is currently offline Chris FairhallFriend
Messages: 193
Registered: February 2011
Senior Member
You could use the org.eclipse.rap.ui.branding extension point to load a body html fragment with Javascript to load your CSS file. The contents of the file specified gets put in the <body> tag of the start page.
Re: Usage of CSS3 @media print Rule in RAP [message #1776847 is a reply to message #1776779] Wed, 22 November 2017 09:15 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2263
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi,
you can also specify your CSS file in your application configuration. See [1]

[1] http://download.eclipse.org/rt/rap/doc/3.3/guide/reference/api/org/eclipse/rap/rwt/client/WebClient.html#HEAD_HTML

HTH,
Ivan
Re: Usage of CSS3 @media print Rule in RAP [message #1776848 is a reply to message #1776847] Wed, 22 November 2017 09:18 Go to previous message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2263
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
... and here is a working example [1]

[1] https://github.com/eclipse/rap/blob/master/examples/org.eclipse.rap.examples/src/org/eclipse/rap/examples/internal/ExampleApplication.java#L35
Previous Topic:Nebula Grid text color using Table-GridLine:horizontal
Next Topic:Inconsistencies with selection in a table via keyboard
Goto Forum:
  


Current Time: Mon Feb 19 15:57:37 GMT 2018

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

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