Package org.apache.shindig.gadgets.spec

Examples of org.apache.shindig.gadgets.spec.MessageBundle


    this.messageBundleFactory = messageBundleFactory;
  }

  public void addSubstitutions(Substitutions substituter, GadgetContext context, GadgetSpec spec)
      throws GadgetException {
    MessageBundle bundle =
        messageBundleFactory.getBundle(spec, context.getLocale(), context.getIgnoreCache(),
                    context.getContainer());
    String dir = bundle.getLanguageDirection();

    boolean rtl = RTL.equals(dir);
    substituter.addSubstitution(Substitutions.Type.BIDI, START_EDGE, rtl ? RIGHT : LEFT);
    substituter.addSubstitution(Substitutions.Type.BIDI, END_EDGE, rtl ? LEFT : RIGHT);
    substituter.addSubstitution(Substitutions.Type.BIDI, DIR, rtl ? RTL : LTR);
View Full Code Here


    this.messageBundleFactory = messageBundleFactory;
  }

  public void addSubstitutions(Substitutions substituter, GadgetContext context, GadgetSpec spec)
          throws GadgetException {
    MessageBundle bundle = messageBundleFactory.getBundle(spec, context.getLocale(),
        context.getIgnoreCache(), context.getContainer());
       
    substituter.addSubstitutions(Substitutions.Type.MESSAGE, bundle.getMessages());
  }
View Full Code Here

      injectFeatureLibraries(gadget, head, firstHeadChild);

      // This can be one script block.
      Element mainScriptTag = document.createElement("script");
      GadgetContext context = gadget.getContext();
      MessageBundle bundle = messageBundleFactory.getBundle(
          gadget.getSpec(), context.getLocale(), context.getIgnoreCache(), context.getContainer());
      injectMessageBundles(bundle, mainScriptTag);
      injectDefaultPrefs(gadget, mainScriptTag);
      injectPreloads(gadget, mainScriptTag);

      // We need to inject our script before any developer scripts.
      head.insertBefore(mainScriptTag, firstHeadChild);

      Element body = (Element)DomUtil.getFirstNamedChildNode(document.getDocumentElement(), "body");

      body.setAttribute("dir", bundle.getLanguageDirection());

      injectOnLoadHandlers(body);

      mutableContent.documentChanged();
    } catch (GadgetException e) {
View Full Code Here

      injectFeatureLibraries(gadget, head, firstHeadChild);

      // This can be one script block.
      Element mainScriptTag = document.createElement("script");
      GadgetContext context = gadget.getContext();
      MessageBundle bundle = messageBundleFactory.getBundle(
          gadget.getSpec(), context.getLocale(), context.getIgnoreCache(), context.getContainer());
      injectMessageBundles(bundle, mainScriptTag);
      injectDefaultPrefs(gadget, mainScriptTag);
      injectPreloads(gadget, mainScriptTag);

      // We need to inject our script before any developer scripts.
      head.insertBefore(mainScriptTag, firstHeadChild);

      Element body = (Element)DomUtil.getFirstNamedChildNode(document.getDocumentElement(), "body");

      body.setAttribute("dir", bundle.getLanguageDirection());

      injectOnLoadHandlers(body);

      mutableContent.documentChanged();
    } catch (GadgetException e) {
View Full Code Here

TOP

Related Classes of org.apache.shindig.gadgets.spec.MessageBundle

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.