Support for CSS style name autocompletion

Hi all,

I was wondering if there’s a way to get autocompletion capabilities when setting styles on components.
It would be nice to be able to have style name autocompletion when using set/addStyleName on a component to be less error prone.
The source of this style names should of course be the vaadin theme defined styles
I’m using IntelliJ Idea 14.
Is there anyway to achieve that?
In GWT you can use the "
" interface to define methods that return Strings and that match style names, so you get support for this, but I ignore if there’s such a thing in Vaadin:

@CssResource.ImportedWithPrefix("widget") public interface Style extends CssResource { String DEFAULT_PANEL_CSS = "style/widget.css"; public String filterPanel(); ... Any light on this?

Thanks a lot in advance,


You probably already know, but just pointing out that there are the constants you can use to at least know the available styles for each theme, such as ValoTheme.BUTTON_SMALL etc.

Reindeer has, Base has, Runo has, Chameleon has (I know, the naming is not very consistent, they should all have the “Theme” suffix).

Thanks for the quick response Jouni,

My idea/wish was more on the topic of being less error prone and faster when assigning styles on the components.
Available constants work great for the default styles. I use a lot constants on ValoTheme.

I will probably then build my own constants. It’s a bit of work in the end, but reusability and ease of use for other members in the team, specially if they’re not that much used to work on the UI side, would improve quite a lot.

Still with the problem of no “connectivity” between the css/scss file and the Java constant to be able to refactor in a comfortable way.

Thanks again