Class ImageSpriteCreator

java.lang.Object
com.google.gwt.thirdparty.common.css.compiler.ast.DefaultTreeVisitor
com.google.gwt.resources.gss.ImageSpriteCreator
All Implemented Interfaces:
com.google.gwt.thirdparty.common.css.compiler.ast.AtRuleHandler, com.google.gwt.thirdparty.common.css.compiler.ast.CssCompilerPass, com.google.gwt.thirdparty.common.css.compiler.ast.CssTreeVisitor

public class ImageSpriteCreator extends com.google.gwt.thirdparty.common.css.compiler.ast.DefaultTreeVisitor implements com.google.gwt.thirdparty.common.css.compiler.ast.CssCompilerPass
Visitor that detects sprite definitions and replace them by several css rules in order to create the corresponding sprited image.

This visitor will replace the following gss: .foo { padding: 5px; gwt-sprite: imageResource; width: 150px; } to the corresponding gss: .foo { padding: 5px; /* @alternate */ width: eval("imageResource.getWidth", "px"); /* @alternate */ height: eval("imageResource.getHeight", "px"); /* @alternate */ overflow: hidden; /* @alternate */ background: resourceUrl("imageResource") eval("imageResource.getLeft", "px") eval("imageResource.getTop", "px") no-repeat; width: 150px; }

This visitor will also check the presence of the ImageResource.ImageOptions annotation on the image resource in order to support correctly horizontal or vertical repetition.