Hello, I was trying to use yout add on with Vaadin 7.3.5 and I get this error:
threw exception [com.vaadin.server.ServiceException: java.lang.NullPointerException]
with root cause
java.lang.NullPointerException
at com.vaadin.server.AbstractExtension.extend(AbstractExtension.java:57)
at org.vaadin.cssinject.CSSInject.extend(CSSInject.java:23)
at org.vaadin.cssinject.CSSInject.<init>(CSSInject.java:19)
at com.heb.ordering.console.OrderingItems.<init>(OrderingItems.java:90)
at com.heb.ordering.console.OrderingWorkArea.<init>(OrderingWorkArea.java:12)
at com.heb.ordering.console.OrderingConsole.<init>(OrderingConsole.java:57)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at com.vaadin.navigator.Navigator$ClassBasedViewProvider.getView(Navigator.java:336)
at com.vaadin.navigator.Navigator.navigateTo(Navigator.java:512)
at com.vaadin.ui.UI.doInit(UI.java:646)
this is my code:
CSSInject cssTab = new CSSInject( getUI());
cssTab.setStyles( getTabStyle() );
tbCategorias.setStyleName("orderingtab");
Hi folks!
I am very new to Vaadin and I’ve been trying to do the following:
I have a table that loads a few rows of data with each row representing a logged event in a system I am working on…each event has been color coded through the use of a color picker ( i keep the colors chosen in my database as hex strings).
What i need to do is for each row I need to paint a few cells (not all) according to the colors in my database so, i thought to myself that this could probably be achieved with the table.setCellStyleGenerator by injecting some css…so i tried the following but it does not seem to work…for that matter it does not seem to do anything…what am i doing wrong?
CellStyleGenerator only supports adding new “style names” to the cells, not actual inline CSS styles. So you can add those custom CSS class names and their corresponding CSS rules to the page using CSSInject, and then return those CSS class names with the CellStyleGenerator.
In pseudo-code:
[code]
loop colors
create “selector” for “color”
insert css background property with “color”
cell-style-generator
return correct “selector” for “color”
[/code]Hope this helps!
Hello,
I am trying to use this add-on with the Calendar extension to dynamically modify the color of an event.
But after opening a week the background of the events are plain white though they have the right style name.
Only after jumping to another week and back the coresponding css files are evaluated.
The code snippet is:
for (event ← returnList){
val css = new CSSInject()
css.setValue(“.v-calendar-event-” + event.getStyleName + event.generateBackgroundStyle()) theWindow.addComponent(css)}
Do you have any idea what could be wrong?
Thank you
Tobias
I installed this add-on in Vaadin 7.5.1, installed using ivy. But nothing happen. I was trying to use the native way but after a time switching Colors and Font the “Page” becomes huge and hangs browser.
My settings:
ivy.xml
TextArea textLabel = new TextArea(null, text);
textLabel.setWidth("100%");
textLabel.setHeight("200px");
// IMPORTANT: We are here setting the style name of the label, we are going to use this in our injected styles to
// target the label
textLabel.setStyleName("text-label");
panelContent.addComponent(textLabel);
......
// Version 2 (for Vaadin 7)
CSSInject css = new CSSInject(getUI());
//css.setStyles(".v-app .v-textarea.text-label { color:" + color.getCSS() + "; }");
css.setStyles(".text-label { color:" + color.getCSS() + "; }");
Can somebody provide some documentation on CSSInject and its loading. I would like to know when and where the injected CSS gets loaded. When we initialized the CSSInject object using CSSInject css = new CSSInject(getUI()); inside any component the newly added css will be loaded to the UI of the application or to the component?
Hi, I’ve been trying to make the CSS injection work but I don’t get any new CSS in my code. It doesn’t do anything at all. What am I missing? This is my code:
I was implemented toolbar window in maven application. When extends toolbarwindow it throws “java.lang.NoSuchMethodError: org.vaadin.cssinject.CSSInject: method ()V not found”
16:05:35,942 SEVERE [com.vaadin.server.DefaultErrorHandler]
(http-localhost/127.0.0.1:9870-3) : java.lang.NoSuchMethodError: org.vaadin.cssinject.CSSInject: method ()V not found
at org.vaadin.toolbarwindow.ToolbarWindow.(ToolbarWindow.java:22) [toolbarwindow-0.1.jar:0.1]
at com.shaic.claim.ViewDetails.getViewPreviousClaimDetails(ViewDetails.java:3674) [classes:]
at com.shaic.claim.ViewDetails$1.buttonClick(ViewDetails.java:946) [classes:]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_25]
I want to use minimize button in Window, So i am trying to use toolbar window instead of normal window in vaadin. I got this issue when i am initializing Toolbar Window class.