Package com.google.gwt.resources.client
Annotation Type CssResource.Import
-
@Documented @Retention(RUNTIME) @Target(METHOD) public static @interface CssResource.Import
Makes class selectors from other CssResource types available in the raw source of a CssResource. String accessor methods can be referred to using the value of the imported type'sCssResource.ImportedWithPrefix
value.This is an example of creating a descendant selector with two unrelated types:
@ImportedWithPrefix("some-prefix") interface ToImport extends CssResource { String widget(); } @ImportedWithPrefix("other-import") interface OtherImport extends CssResource { String widget(); } interface Resources extends ClientBundle { @Import(value = {ToImport.class, OtherImport.class}) @Source("my.css") CssResource usesImports(); } my.css: // Now I can refer to these classes defined elsewhere with no // fear of name collisions .some-prefix-widget .other-import-widget {...}
If the imported CssResource type is lacking anCssResource.ImportedWithPrefix
annotation, the simple name of the type will be used instead. In the above example, without the annotation onToImport
, the class selector would have been.ToImport-widget
. Notice also that both interfaces defined a method calledwidget()
, which would prevent meaningful composition of the original interfaces.It is an error to import multiple classes with the same prefix into one CssResource.
-
-
Required Element Summary
Required Elements Modifier and Type Required Element Description java.lang.Class<? extends CssResource>[]
value
-
-
-
Element Detail
-
value
java.lang.Class<? extends CssResource>[] value
-
-