I am developing an editor in Java in which I want to include bullets of different types. I am using HtmlEditorKit. I wanted to add a style sheet but it is not working, I wanted to know if following Pseudo element is supported in Java, if it is supported can you please guide me where I am going wrong?
styleSheet.addRule("ul{list-style-type:none;margin:0px 20px;}");
styleSheet.addRule("li:before{content: \"✤\";}");
The Java HTML rendering engine only supports a (very) limited amount of CSS.
Related
I have a function that generates a Dgrid and fills it with content which it receives from Javaside.
I tried to do dojo-css to handle this like here:
Style Dojox Grid Row depending on data
After this didn´t work I tried to work with Dojo.connect to change the color of the row when the grid is being built and filled.
After that didn´t work I tried to use dojo.on or dojo.aspect.after but since I am a total Newbie in Dojo I have no clue where you can intersect in the code and do theses things.
with a code like so :
require(["dojo/request/xhr","dojo/dom-form", "dojo/dom", "dojo/_base/array", "dojo/json",'dgrid/Grid','dgrid/Selection',"dijit/registry","dojo/_base/declare","dojo/domReady!"],
function(xhr,domForm,dom, array, json, grid, selection,registry, declare){
..... Here the grid and data is declared java function called
}.then(function(data, array, grid, selection,registry, declare){
.....Here the dgrid is filled
}
Where/when should i use Dojo.Connect , Dojo.on or Dojo.after?
I´ve spent mutiple days trying to figure this out but the program either stops working or ignores my changes.
The link you mention above is for dojox grid, which is different to dgrid. Here is the link to css styling for dgrid.
It won't answer your question though which is about changing a row color based on content. The way I do this is cell by cell, using a custom renderCell function.
Documentation on renderCell can be found here, and an example can be found here.
ps: a bit of caution. The learning curve for dojo 1.x is quite steep. When looking for documentation, make sure you get the latest possible (1.10). If you find a link which is about version 1.6 or less, be careful: many 1.6 and before features have been deprecated in version 1.7.
I am using the docx4j in a java app which parses HTML/CSS and exports a docx.
What I need is to make something like:
but seems like I can only make a couple of tables with docx4j. Can it read entire html css files or only basic html with no css?
Also I've been trying to use everything from flexbox, to display table, to just float ( like 15 years ago ), for making the gird layout.
I am curious if it is a dead end or it's just me and I don't know how to use it
docx4j-ImportXHTML can read CSS.
It uses Flying Saucer to parse the XHTML: https://github.com/flyingsaucerproject/flyingsaucer
Flying Saucer uses CSS 2.1.
If you hit a limitation, the first thing to do is to see whether Flying Saucer has captured the relevant value. If it has, then docx4j-ImportXHTML needs to handle it correctly.
Alternatively, Google to check whether FS handles flexbox etc. I don't think ImportXHTML handles float right now. You could add that, of course.
As a means to display information on a website developed mainly with GWT and EXT-GWT, i am using a HTMLLayoutContainer. So far, the information it is displayed correctly, but it is too harsh or rough to display this way, meaning rough, not nice to see.
So the question is : Is there any other and nicer way to display (print, draw) information with GWT?.
If so, how?
You need to work on CSS
GWT CSS Ref
I know this question has been asked before on S.O. and other websites but I haven't found a definite answer -- most of them say its not easily done but I wanted to make sure that was the final verdict.
Here's my situation:
I'm testing a website that is using Highcharts (http://www.highcharts.com) using Selenium WebDriver (Java).
I basically want to grab the information that is displayed in a small tooltip pop-up that appears when you hover your mouse over each datapoint on the Highchart's line graph.
Looking at the web page's HTML code, I noticed there is <g class="highcharts-tooltip".... I also noticed that, as you move your mouse, the (X,Y) values in ...transform="translate(X,Y)"> change, which then changes the information displayed in the tool tip.
Knowing this, my approach would be to somehow grab all the (X,Y) values and plug them into the transform fields and grab the tooltip data. But I don't know how to programmatically grab all the (X,Y) values through Selenium.
Has anyone tackles this issue in the past or has a better way to grab the necessary information?
I started creating a library to work with HighCharts, what I currently have is available here:
https://github.com/Ardesco/Powder-Monkey/tree/master/src/main/java/com/lazerycode/selenium/graphs
It's quite hard to provide a generic library that deals with HighCharts as the customisation options on the individual charts can modify the SVG markup quite a bit. Hopefully the above will help to a degree.
As I do more it will be updated.
The Line Charts have to have a background to work. If the chart is created with .setBackgroundColour(null), then the "rect" is not added to the html.
I was able to to add the background colour back in set to the body background colour. However I'll try and figure out a way of doing it without the "rect".
how i can add header to each PDF page using iText 5.0.5.
This is covered in chapter 5 of iText In Action, 2nd ed. The code examples are all freely available online. In particular MovieCountries1 and MovieHistory2 both deal with page headers and footers.
It boils down to using a PdfPageEvent implementation (usually derived from PdfPageEventHelper to cut down on boilerplate) to draw into the page's Direct Content during an EndPage (or BeginPage I suppose) event.
You have to know where you want them, and you have to draw using a PdfContentByte instance, so you can't use the high-level Paragraph/Chapter/Chunk/Image/etc classes. You have to draw-this-there, draw-that-here. ColumnText can help a bit... but only for Plain Text. Anything even remotely fancy and you're on your own.
See the below link having video to show you.
http://itextpdf.com/book/chapter.php?id=4
For Header-Footer:
http://kuujinbo.info/cs/itext.aspx
http://www.codeproject.com/KB/graphics/ITextSharpHelperClass.aspx
Please Vote if this helps to you.