• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Bootstrap CSS content assist in xhtml pages

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Guys,

I would like to see bootstrap CSS auto complete options when developing xhthml pages in eclipse.

Could you please advise how can I enable this CSS autocomplete in eclipse?

Best regards,
 
Saloon Keeper
Posts: 27752
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This isn't about JSF, it's about the Eclipse IDE. Moving to the IDEs forum.
 
Tim Holloway
Saloon Keeper
Posts: 27752
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you create the CSS in a .css file, the Eclipse IDE will auto-complete for you. Just type in the first few letters of the style and press control+space.

It is better to define your styles in a CSS file than to embed them in in a JSF xhtml template. I usually only do that for very specialized cases.
 
R Kintali
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Thanks for your reply.

All the css classes are defined in bootstrap.css file only. Now I want to use these classes in xhtml file in eclipse.

When I type text for any element's class attribute in xhtml I would like to see all the classes that start with the entered text (on ctrl+space)

For example, for <div class=""> - for the class attribute if I type 'nav' I would like to see all the classes that start with nav.

Can you please assist?
 
Tim Holloway
Saloon Keeper
Posts: 27752
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There are a couple of problems with that.

First, and most importantly, Eclipse cannot do style suggestions for any sort of page definition as far as I can tell, including html and jsp pages. Part of the reason for that is that the Eclipse J2EE plugins don't assume that they know where CSS definitions are. A plugin would have to scan the CSS sources and digest them into something that could be popped up at computer speeds to be useful. And know what to scan.

Which leads to another problem. Not all the CSS you'll see is patently defined. If you use an extension tag library like RichFaces or IceFaces, then there are a whole raft of additional styles introduced internally to those tagsets. And if that wasn't enough, some web browsers have their own internally-defined CSS classes, which vary depending on browser and browser version. Just because they're defined internally doesn't mean that you cannot use them (and in some cases, even redefine them).

Then there's the issue that in JSF, the attribute that references CSS classes in JSF HTML tags is "styleClass", not "style", so you'd have to have an additional hook in the J2EE plugins to allow for that.

So what I do is flip back and forth to the style definition files and use the Outline View to present me with the style names.

Incidentally, I don't recommend using raw HTML in JSF View Templates. Instead of a DIV, I'd recommend a 1x1 cell panelGrid.
 
We begin by testing your absorbancy by exposing you to this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic