Package com.google.gwt.resources.client

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


     */
    public static void configure() {
        Resources r = Resources.RESOURCES;
        injectJs(r.datetimepickerJs());

        TextResource locale = LocaleUtil.getLocaleJsResource();
        if (locale != null) {
            JavaScriptInjector.inject(locale.getText());
        }
    }
View Full Code Here


   }-*/;


  public static final void forceLocale(String locale_) {
    locale = locale_;
    TextResource t = setupLocale();
    if (loaded.contains(locale) && t != null) {
      JavaScriptInjector.inject(t.getText());
    }
  }
View Full Code Here

  }


  private static TextResource setupLocale() {
    Resources r = Resources.RESOURCES;
    TextResource tr = null;

        /*
           Script used to gen the basic if-else block:
           for a in `ls`; do echo "else if(locale.equals(\"`echo $a | cut -f2 -d.`\")) { tr = r.`echo $a | cut -f2 -d.`(); LANGUAGE = \"`echo $a | cut -f2 -d.`\"; }"; done
        */
 
View Full Code Here

    int i = PrettifyResources.speciallangs.indexOf(lang);

    // XXX thats very very very very ugly, sorry.

    if (i > -1 && !importedLangs.contains(i)) {
      TextResource tr = null;
      switch (i) {
        case 0:
          tr = PrettifyResources.RESOURCES.apollo();
          break;
        case 1:
          tr = PrettifyResources.RESOURCES.clj();
          break;
        case 2:
          tr = PrettifyResources.RESOURCES.css();
          break;
        case 3:
          tr = PrettifyResources.RESOURCES.go();
          break;
        case 4:
          tr = PrettifyResources.RESOURCES.hs();
          break;
        case 5:
          tr = PrettifyResources.RESOURCES.lisp();
          break;
        case 6:
          tr = PrettifyResources.RESOURCES.lua();
          break;
        case 7:
          tr = PrettifyResources.RESOURCES.ml();
          break;
        case 8:
          tr = PrettifyResources.RESOURCES.ml();
          break;
        case 9:
          tr = PrettifyResources.RESOURCES.n();
          break;
        case 10:
          tr = PrettifyResources.RESOURCES.proto();
          break;
        case 11:
          tr = PrettifyResources.RESOURCES.scala();
          break;
        case 12:
          tr = PrettifyResources.RESOURCES.sql();
          break;
        case 13:
          tr = PrettifyResources.RESOURCES.tex();
          break;
        case 14:
          tr = PrettifyResources.RESOURCES.vb();
          break;
        case 15:
          tr = PrettifyResources.RESOURCES.vhdl();
          break;
        case 16:
          tr = PrettifyResources.RESOURCES.wiki();
          break;
        case 17:
          tr = PrettifyResources.RESOURCES.xq();
          break;

        default:
          break;
      }
      if (tr != null) {
        JavaScriptInjector.inject(tr.getText());
        importedLangs.add(i);
      }
    }
  }
View Full Code Here

   }

   @Test
   public void textResource_Txt() {
      // Arrange
      TextResource textResource = MyClientBundle.INSTANCE.textResourceTxt();
      String expectedText = "Hello gwt-test-utils !\r\nThis is a test with a simple text file";

      // Act
      String name = textResource.getName();
      String text = textResource.getText();
      String toString = textResource.toString();

      // Assert
      assertEquals("textResourceTxt", name);
      assertEquals(expectedText, text);
      assertEquals(
View Full Code Here

   }

   @Test
   public void textResource_Xml() {
      // Arrange
      TextResource textResource = MyClientBundle.INSTANCE.textResourceXml();
      String expectedText = "<gwt-test-utils>\r\n\t<test>this is a test</test>\r\n</gwt-test-utils>";

      // Act
      String name = textResource.getName();
      String text = textResource.getText();
      String toString = textResource.toString();

      // Assert
      assertEquals("textResourceXml", name);
      assertEquals(expectedText, text);
      assertEquals(
View Full Code Here

   }

   @Test
   public void textResourceTxt_OverrideWithoutAnnotation() {
      // Arrange
      TextResource textResource = MyOverridedClientBundle.INSTANCE.textResourceTxt();
      String expectedText = "Overrided text resource !";

      // Act
      String name = textResource.getName();
      String text = textResource.getText();

      // Assert
      assertEquals("textResourceTxt", name);
      assertEquals(expectedText, text);
      assertEquals(textResource, MyOverridedClientBundle.INSTANCE.textResourceTxt());
View Full Code Here

        return;
      }

      // Populate the TextResponse cache array
      final String resourceText = extractString(jso, index);
      cache[index] = new TextResource() {

        public String getName() {
          return name;
        }
View Full Code Here

public class CordovaResources {

  public static void configure() {
    Resources res = Resources.RESOURCES;
    String platform = determinePlatform();
    TextResource javascript;

    if ("android".equals(platform)) {
      javascript = res.cordovaAndroid();
    } else if ("ios".equals(platform)) {
      javascript = res.cordovaIOS();
    } else if ("blackberry".equals(platform)) {
      javascript = res.cordovaBlackberry();
    } else if ("window7".equals(platform)) {
      javascript = res.cordovaWindows7();
    } else if ("window8".equals(platform)) {
      javascript = res.cordovaWindows8();
    } else {
      javascript = res.cordovaIOS();
    }

    JavascriptInjector.inject(javascript.getText());
  }
View Full Code Here

public class CordovaResources {

  public static void configure() {
    Resources res = Resources.RESOURCES;
    String platform = determinePlatform();
    TextResource javascript;

    if ("android".equals(platform)) {
      javascript = res.cordovaAndroid();
    } else if ("ios".equals(platform)) {
      javascript = res.cordovaIOS();
    } else if ("blackberry".equals(platform)) {
      javascript = res.cordovaBlackberry();
    } else if ("window7".equals(platform)) {
      javascript = res.cordovaWindows7();
    } else if ("window8".equals(platform)) {
      javascript = res.cordovaWindows8();
    } else {
      javascript = res.cordovaIOS();
    }

    JavascriptInjector.inject(javascript.getText());
  }
View Full Code Here

TOP

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

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.