Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [e4-dev] CSS image loading

Hi Kevin,

We need to think about all this url stuff so that we can plugin
resolvers for other URIs and we should support.

file:/
http:/
platform:/
theme:/

Out of the box but allow customers to register their own protocol and
lookup at least that's what I have done in UFaceKit.

Automatically prepending stuff is not really a good thing IMHO one has
to specify the complete path in the CSS but maybe we could give them
users the possibility to use variables they can register in the system.

The your CSS looks like this:

Tree {
  font: _Verdana_ 8px;
  color: #666666;
  background: _url_(${productbundle}/images/bluefade-full.gif);

 }

Where appbundle is the bundle of the currently running
Application-Product but I could as well register my own variable.

Tree {
  font: _Verdana_ 8px;
  color: #666666;
  background: _url_(${mybundle}/images/bluefade-full.gif);
 }

I might also explain what theme:/ is. I think this would a special
lookup where people register their images in a central place and the
handler looks them up from there (something like the ISharedImages of
today) allowing us to make better resource handling by sharing image
instances.

Tree {
  font: _Verdana_ 8px;
  color: #666666;
  background: url(theme:/${current}/fadingtree.id);
 }


Tom

Kevin McGuire schrieb:
> 
> I'm working on adding the ability to load resources (images) in CSS.
>  I'm posting this here because it affects the properties config for the
> modelled UI based apps and thought folks might want to know about the
> changes.
> 
> Previously, resource lookup only worked for java apps but not in the
> OSGi context.  To support it, I'm following the pattern we established
> for specifying the style sheet location, but in this case, you specify a
> path to the resources directory.
> 
> For example, in the photo demo you'd add to the plugin.xml:
> 
>          <property
>                name="applicationCSSResources"
>              
>  value="platform:/plugin/org.eclipse.e4.demo.e4photo/images/">
>          </property>
> 
> directory like:
> 
> 
> 
> 
> style sheet like:
> Tree {
>         font: _Verdana_ 8px;
>         color: #666666;
>         background: _url_(_bluefade_-full.gif);                
> }
> 
> and result:
> 
> 
> 
> I'm not sure if this is the best approach though since:
> 1) it gives only a single location for all images
> 2) appends the file name to the end, which maybe isn't cool
> 3) requires the path have a '/' at end (but maybe we could add one for
> free if missing).
> 
> For discussion, please see
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=277471.
> 
> Kevin
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> e4-dev mailing list
> e4-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/e4-dev


-- 
B e s t S o l u t i o n . a t                        EDV Systemhaus GmbH
------------------------------------------------------------------------
tom schindl                                        geschaeftsfuehrer/CEO
------------------------------------------------------------------------
eduard-bodem-gasse 5/1    A-6020 innsbruck      phone    ++43 512 935834


Back to the top