View Javadoc

1   package org.vectomatic.dom.svg.ui;
2   
3   import java.lang.annotation.Documented;
4   import java.lang.annotation.ElementType;
5   import java.lang.annotation.Retention;
6   import java.lang.annotation.RetentionPolicy;
7   import java.lang.annotation.Target;
8   
9   import org.vectomatic.dev.svg.impl.gen.ExternalSVGResourceGenerator;
10  
11  import com.google.gwt.resources.client.ResourceCallback;
12  import com.google.gwt.resources.client.ResourceException;
13  import com.google.gwt.resources.client.ResourcePrototype;
14  import com.google.gwt.resources.ext.DefaultExtensions;
15  import com.google.gwt.resources.ext.ResourceGeneratorType;
16  
17  /**
18   * Identical to {@link SVGResource}, except the contents of the resource are
19   * not inlined into the compiled output. This is suitable for resources that are
20   * not required as part of program initialization.
21   * Note that by default SVG resources are validated against the SVG 1.1 XSD schema.
22   * You can opt out of validation by setting the <code>validated="false"</code>
23   * attribute on the annotation.
24   */
25  @DefaultExtensions(value = {".svg"})
26  @ResourceGeneratorType(ExternalSVGResourceGenerator.class)
27  public interface ExternalSVGResource extends ResourcePrototype {
28  	/**
29  	 * Specifies additional options to control how an SVG is bundled.
30  	 */
31  	@Documented
32  	@Retention(RetentionPolicy.RUNTIME)
33  	@Target(ElementType.METHOD)
34  	public @interface Validated {
35  		/**
36  		 * If <code>true</code>, the SVG resource will be validated
37  		 * against SVG 1.1 schema. Use <code>false</code> value if
38  		 * you need to disable validation
39  		 */
40  	    boolean validated() default true;
41  	}
42  	/**
43  	 * Starts an asynchronous request to retrieve the root element of the SVG resource.
44  	 * @param callback The callback interface to invoke once the resource has been retrieved
45  	 */
46  	 void getSvg(ResourceCallback<SVGResource> callback) throws ResourceException;
47  }