Package de.odysseus.calyxo.panels.conf

Examples of de.odysseus.calyxo.panels.conf.PanelConfig


    URL url3 = getClass().getResource(xml3);
    ModuleContext context = new TestModuleContext("test");
    PanelsRootConfigParser parser = new PanelsRootConfigParser(context);
    PanelsRootConfig root = parser.parse(new URL[]{url1,url2,url3});
//    System.out.println(root);
    PanelConfig foo = root.findPanelConfig("foo", null);
    assertNotNull(foo);
    PanelConfig bar = root.findPanelConfig("bar", null);
    assertNotNull(bar);
    PanelConfig foo_de = root.findPanelConfig("foo", Locale.GERMAN);
    assertNotNull(foo_de);
    assertNotSame(foo, foo_de);
  }
View Full Code Here


  public void testParam() throws ELException {
    HttpServletRequest request =
      (HttpServletRequest)pageContext.getRequest();
    PanelsContext panelsContext =
      support.getOrCreateContext(request, new Locale("", ""));
    PanelConfig panel = support.findPanelConfig("test", new Locale("", ""));
    assertNotNull(panel);
    panelsContext.push(panel);

    PanelsAccessor accessor = new PanelsAccessor(module);
    pageContext.setAttribute("panels", accessor.get(request));
View Full Code Here

  /**
   * Search receiver and generalizations for a contained panel wit
   * given name
   */
  PanelConfig findPanelConfigByGeneralization(String name) {
    PanelConfig panel = getPanelConfig(name);
    if (panel == null && generalizedPanel != null) {
      panel = generalizedPanel.findPanelConfigByGeneralization(name);
    }
    return panel;
  }
View Full Code Here

    }

    if (nearestAncestorPanel != null) { // inner panel
      PanelConfigImpl panel = nearestAncestorPanel.lookupBase(locale);
      while (panel != null) {
        PanelConfig result = panel.findPanelConfigByGeneralization(name);
        if (result != null) {
          return (PanelConfigImpl)result;
        }
        panel = panel.lookupBase(locale);
      }
View Full Code Here

   * @see de.odysseus.calyxo.panels.conf.PanelConfig#findPanelConfig(java.lang.String, java.util.Locale)
   */
  public PanelConfig findPanelConfig(String name, Locale locale) {
    PanelConfigImpl panel = this;
    while (panel != null) {
      PanelConfig result = panel.findPanelConfigByGeneralization(name);
      if (result != null) {
        return result;
      }
      panel = panel.lookupBase(locale);
    }
View Full Code Here

   * Lookup panel by name and locale (exact match).
   */
  private PanelConfig getPanelConfig(String name, Locale locale) {
    PanelsConfig panelsConfig = (PanelsConfig)panelsConfigsByLocale.get(locale);
    if (panelsConfig != null) {
      PanelConfig panelConfig = panelsConfig.getPanelConfig(name);
      if (panelConfig != null) {
        return panelConfig;
      }
    }
    return null;
View Full Code Here

  public PanelConfig findPanelConfig(String name, Locale locale) {
    if (locale == null) {
      locale = defaultLocale;
    }
    do {
      PanelConfig result = getPanelConfig(name, locale);
      if (result != null)
        return result;
      locale = generalize(locale);
    } while (locale != null);
    return null;
View Full Code Here

TOP

Related Classes of de.odysseus.calyxo.panels.conf.PanelConfig

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.