HtmlFormRenderer.java :  » J2EE » WiSerFramework » de » ug2t » channel » markup » html » renderer » Java Open Source

Java Open Source » J2EE » WiSerFramework 
WiSerFramework » de » ug2t » channel » markup » html » renderer » HtmlFormRenderer.java
// @@
// @@
/*
 * Wi.Ser Framework
 *
 * Version: 1.8.1, 20-September-2007  
 * Copyright (C) 2005 Dirk von der Weiden <dvdw@imail.de>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library located in LGPL.txt in the 
 * license directory; if not, write to the 
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA  02111-1307, USA.
 * 
 * If this agreement does not cover your requirements, please contact us
 * via email to get detailed information about the commercial license 
 * or our service offerings!
 *
 */
// @@

package de.ug2t.channel.markup.html.renderer;

import java.util.*;

import de.ug2t.channel.markup.generic.*;
import de.ug2t.kernel.*;
import de.ug2t.unifiedGui.interfaces.*;

public final class HtmlFormRenderer implements IKeView
{
  private MuGenericCache       pem_cache = new MuGenericCache();
  private MuGenericApplication pem_appl  = null;

  public boolean pcmf_supportsCaching()
  {
    return (true);
  }

  public void pcmf_clearCache()
  {
    this.pem_cache.pcmf_clearCache();
  }

  public void pcmf_reset()
  {
    this.pem_appl = null;
  };

  public void pcmf_activateCache(boolean xAc)
  {
    this.pem_cache.pcmf_activateThisCache(xAc);
    return;
  }

  public Object pcmf_output(KeTreeElement xTreeEl)
  {
    MuGenericForm html_xTreeEl = (MuGenericForm) xTreeEl;

    // @@

    if (pem_appl == null)
    {
      Object l_appl = KeRegisteredObject.pcmf_getObjByName(IUnApplication.MY_APPL);
      if (l_appl instanceof MuGenericApplication)
        pem_appl = (MuGenericApplication) l_appl;
      else
        pem_appl = (MuGenericApplication) html_xTreeEl.pcmf_getAppl();
    }

    pem_appl.pcmf_getRenderer().pcmf_addScrollPos(html_xTreeEl.pcmf_getScrollCrt());

    // @@

    KeStringTemplate l_string = html_xTreeEl.pcmf_getMarkupString("MAIN");

    l_string = html_xTreeEl.pcmf_insertToolTip(l_string);
    l_string = html_xTreeEl.pcmf_insertColorandFontandBorder(l_string);
    l_string = html_xTreeEl.pcmf_insertPosition(l_string);
    l_string = html_xTreeEl.pcmf_insertChannelandMenu(l_string);
    l_string = html_xTreeEl.pcmf_insertBgImage(l_string);

    l_string.pcmf_beginTR();

    l_string = KeTools.pcmf_stringSubst(l_string, "$URL", pem_appl.pcmf_getHostName() + ":" + Integer.toString(pem_appl.pcmf_getPort()) + "/"
        + pem_appl.pcmf_getRootUrl());
    l_string = KeTools.pcmf_stringSubst(l_string, "$STATE", xTreeEl.pcmf_getObjName());
    l_string = KeTools.pcmf_stringSubst(l_string, "$PG_ID", pem_appl.pcmf_getActive().pcmf_getObjName());
    l_string = KeTools.pcmf_stringSubst(l_string, "$NAME", html_xTreeEl.pcmf_getObjName());
    l_string = KeTools.pcmf_stringSubst(l_string, "$OID", html_xTreeEl.pcmf_getObjName());
    l_string = KeTools.pcmf_stringSubst(l_string, "$PNAME", html_xTreeEl.pcmf_getScrollCrt().pcmf_getObjName());
    if (html_xTreeEl.pcmf_getScroll())
    {
      l_string = KeTools.pcmf_stringSubst(l_string, "$SCROLL", "auto");
      l_string = KeTools.pcmf_stringSubst(l_string, "$POS_SCROLL", html_xTreeEl.pcmf_getScrollCrt().pcmf_getValue().toString());
    }
    else
    {
      l_string = KeTools.pcmf_stringSubst(l_string, "$SCROLL", "hidden");
      l_string = KeTools.pcmf_stringSubst(l_string, "$POS_SCROLL", "");
    }

    l_string.pcmf_endTR(true);

    // @@

    return (l_string);
  };

  public Object pcmf_execView(KeTreeElement xTreeEl)
  {
    return (xTreeEl.pcmf_execView());
  };
};

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.