Package com.google.gwt.resources.client

Examples of com.google.gwt.resources.client.ResourcePrototype


      this.prototypes=prototypes;
     
    }
    @Override
    public boolean execute() {
      ResourcePrototype prototype=prototypes[index];
      Asset asset;
      if(prototype instanceof ImageResource){
        asset=generateSpriteSheet((ImageResource)prototype);
       
      }else if(prototype instanceof DataResource){
        String url=((DataResource) prototype).getSafeUri().asString();
        if(url.endsWith(".json")){
          asset=generateJsonFile((DataResource)prototype);
        }else{
          return willThisContinue();
        }
      }else{
        return willThisContinue();
      }
     
      assets.put(prototype.getName(),asset);
      return willThisContinue();
     
     
    }
View Full Code Here


  public void doShowSources2(Map<String, ResourcePrototype> r) {
    List<GalleryResource> resources = new LinkedList<GalleryResource>();

    for (String resName : r.keySet()) {
      ResourcePrototype res = util.getCurrentTest().getTestResources().get(resName);
      resources.add(new GalleryResource(res, resName));
    }
    showJavaSource2(Y, resources);
  }
View Full Code Here

    // for (int i = 0; i < resources.size(); i++) {
    for (GalleryResource resource : resources) {
      // final GalleryResource resource = resources[i];
      final String resName = resource.getName();
      ResourcePrototype res = resource.getResource();

      util.getText(res, new ResourceCallback<TextResource>() {
        @Override
        public void onError(ResourceException e) {
          // showJavaSourceError=true;
View Full Code Here

   
    final List<String> headers = new LinkedList<String>();
    final List<String> bodies = new LinkedList<String>();
   
    for(final String resName : test.getTestResources().keySet()) {
      ResourcePrototype res = test.getTestResources().get(resName);
      galleryUtil.getText(res, new ResourceCallback<TextResource>() {
       
        @Override
        public void onSuccess(TextResource resource) {
          String scapedContent = y.Escape().html(resource.getText().replace("\t", "  "));
View Full Code Here

    showSourceBtn.addClickHandler(new ClickHandler() {
      @Override
      public void onClick(ClickEvent event) {
        String demoName = demos.get(selectedIndex).getDemoName()
            .replace(" ", "").toLowerCase();
        ResourcePrototype resource = Resources.INSTANCE.getResource(demoName);
        if (resource == null) {
          sourceTextArea.setText("Source codes not included for this demo.\n"
              + "See the trunk for the codes.");
        }
        loadExternalTextResource((ExternalTextResource) resource);
View Full Code Here

  public void property(String name, LexicalUnit unit, boolean important)
      throws CSSException {

    if (name.equals("gwt-image")) {
      String v = unit.toString();
      ResourcePrototype resource = _parentBundle.getResource(v);

      if (resource == null) {
        _log.warn("unknown resource: " + v);
        return;
      }
View Full Code Here

  /***************************************************************************
   *
   **************************************************************************/

  private void handleUrl(String name, String value) {
    ResourcePrototype resource = _parentBundle.getResource(value);

    if (resource == null)
      throw new IllegalStateException("unknown resource name=" + name
          + " value: " + value);

View Full Code Here

            methodName, localURL);
        if (localFile != null)
          resourceImpl.setLocalFile(localFile);
        resources.add(resourceImpl);

        ResourcePrototype resourceProxy = (ResourcePrototype) Proxy.newProxyInstance(
            bundleType.getClassLoader(), new Class[] {
                returnType, ResourceWithUrl.class}, resourceImpl);
        bundle.addResource(resourceProxy);

      } else if (ImageResource.class.isAssignableFrom(returnType)) {
View Full Code Here

TOP

Related Classes of com.google.gwt.resources.client.ResourcePrototype

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.