Package org.apache.myfaces.trinidad.component.core

Examples of org.apache.myfaces.trinidad.component.core.CoreDocument


  {
    Map<String, String> requestParams =
      context.getExternalContext().getRequestParameterMap();
   
    RenderingContext arc = RenderingContext.getCurrentInstance();
    CoreDocument doc = new CoreDocument();
    context.getViewRoot().getChildren().add(doc);

    doc.setTitle(arc.getTranslatedString("af_inputColor.PICKER_TITLE"));
   
    CoreForm form = new CoreForm();
    form.setId("d");
    doc.getChildren().add(form);
   
    HtmlTableLayout tl = new HtmlTableLayout();
    form.getChildren().add(tl);
   
    HtmlRowLayout rl1 = new HtmlRowLayout();
    tl.getChildren().add(rl1);
    HtmlCellFormat cf1 = new HtmlCellFormat();
    rl1.getChildren().add(cf1);
    cf1.setHalign("center");
   
    CoreInputColor sic = new CoreInputColor();
    cf1.getChildren().add(sic);
    sic.setId("c");
    sic.setOnkeypress("if(_getKC(event)==13){selectColor();return false}");
    Converter converter = _getConverter(requestParams);
    Object value =
      converter.getAsObject(context, sic, requestParams.get("value"));
    sic.setConverter(converter);
    sic.setValue(value);
    sic.setChooseId("choose");
    sic.setLabel(arc.getTranslatedString("af_inputColor.PICKER_PROMPT"));

    HtmlRowLayout rl2 = new HtmlRowLayout();
    tl.getChildren().add(rl2);
    CoreSpacer spacer = new CoreSpacer();
    rl2.getChildren().add(spacer);
    spacer.setHeight("8");
   
    HtmlRowLayout rl3 = new HtmlRowLayout();
    tl.getChildren().add(rl3);
    HtmlCellFormat cf3 = new HtmlCellFormat();
    rl3.getChildren().add(cf3);
    cf3.setHalign("center");
   
    CoreChooseColor choose = new CoreChooseColor();
    cf3.getChildren().add(choose);
    choose.setId("choose");
    choose.setWidth(7);
   
    HtmlRowLayout rl4 = new HtmlRowLayout();
    tl.getChildren().add(rl4);
    CoreSpacer spacer2 = new CoreSpacer();
    rl4.getChildren().add(spacer2);
    spacer2.setHeight("8");
   
    HtmlRowLayout rl5 = new HtmlRowLayout();
    tl.getChildren().add(rl5);
    HtmlCellFormat cf5 = new HtmlCellFormat();
    rl5.getChildren().add(cf5);
    cf5.setHalign("end");
    CorePanelButtonBar bar = new CorePanelButtonBar();
    cf5.getChildren().add(bar);


    CoreGoButton cancel =
       JspUtils.createGoButton(arc, "af_inputColor.CANCEL");
    bar.getChildren().add(cancel);
    cancel.setOnclick("doCancel()");

    CoreGoButton select =
       JspUtils.createGoButton(arc, "af_inputColor.APPLY");
    bar.getChildren().add(select);
    select.setOnclick("return selectColor()");

    HtmlScript script = new HtmlScript();
    script.setText(_SCRIPT);
    doc.getChildren().add(script);
  }
View Full Code Here


  @SuppressWarnings("unchecked")
  static public void service(FacesContext context)
    throws IOException
  {
    RenderingContext arc = RenderingContext.getCurrentInstance();
    CoreDocument doc = new CoreDocument();
    context.getViewRoot().getChildren().add(doc);
    doc.setTitle(arc.getTranslatedString(_DIALOG_TITLE_KEY));

    CoreForm form = new CoreForm();
    doc.getChildren().add(form);
    form.setId("a");

    boolean isDesktop = (arc.getAgent().getType().equals(Agent.TYPE_DESKTOP));

    //
    // Create the calendar row
    //
    UIComponent calendarRow = _createRow(isDesktop,
                                         XhtmlConstants.H_ALIGN_END);
    CoreChooseDate ccd = CalendarUtils.createChooseDate(context);
    calendarRow.getChildren().add(ccd);

    // Get a destination that points back to this dialog, including
    // any viewIDs
    String destination =
      GenericEntry.getGenericEntryURL(context,
                                      GenericEntry.CALENDAR_DIALOG_ENTRY);
    ccd.getAttributes().put("destination", destination);

    //
    // Create a spacer
    //
    UIComponent spacerRow = _createRow(isDesktop, null);
    CoreSpacer cos = new CoreSpacer();
    spacerRow.getChildren().add(cos);
    cos.setHeight("8");

    //
    // Create the button row
    //
    UIComponent buttonRow = _createRow(isDesktop, XhtmlConstants.H_ALIGN_END);

    CoreGoButton cancelButton =
       JspUtils.createGoButton(arc, _CANCEL_LABEL_KEY);
    buttonRow.getChildren().add(cancelButton);

    Object cap = arc.getAgent().getCapabilities().get(
                     TrinidadAgent.CAP_MULTIPLE_WINDOWS);
    boolean multWindowsSupported = Boolean.TRUE.equals( cap );
    if (multWindowsSupported )
    {
      cancelButton.setOnclick("return _doCancel()");
    }
    else
    {
      // create the destination of the cancel button
      StringBuffer cancelDest = new StringBuffer();
      EncoderUtils.appendURLArguments(cancelDest,
                                      destination,
                                      new String[]{
                                        XhtmlConstants.EVENT_PARAM,
                                        XhtmlConstants.CANCEL_EVENT
                                      });

      // Prepend a slash, because this destination already
      // includes the context root
      cancelButton.setDestination("/" + cancelDest.toString());

      String value = __getParam(context, XhtmlConstants.VALUE_PARAM);
      if (value != null)
      {
        long lg = Long.parseLong(value);
        ccd.getAttributes().put("value", new Date(lg));
      }

      // get the scrolled value
      String month = __getParam(context,XhtmlConstants.MONTH_PARAM);
      String year = __getParam(context,XhtmlConstants.YEAR_PARAM);

      // try to create scrolledValue
      if ( month != null && year != null )
      {
        try
        {
          long scrolledValue = Long.parseLong(month) + Long.parseLong(year);


          ccd.getAttributes().put("scrolledValue", new Date(scrolledValue));
        }
        catch ( NumberFormatException nfe){;}
      }
    }

    if (multWindowsSupported )
    {
      CoreImportScript cis = new CoreImportScript();
      cis.setNames(new String[]{"_doCancel()", "_selectDate()"});
      doc.getFacets().put(CoreDocument.META_CONTAINER_FACET, cis);

      HtmlTableLayout htl = new HtmlTableLayout();
      form.getChildren().add(htl);

      //
View Full Code Here

  @SuppressWarnings("unchecked")
  static public void service(FacesContext context)
    throws IOException
  {
    RenderingContext arc = RenderingContext.getCurrentInstance();
    CoreDocument doc = new CoreDocument();
    context.getViewRoot().getChildren().add(doc);
    doc.setTitle(arc.getTranslatedString(_DIALOG_TITLE_KEY));

    CoreForm form = new CoreForm();
    doc.getChildren().add(form);
    form.setId("a");

    boolean isDesktop = (arc.getAgent().getType().equals(Agent.TYPE_DESKTOP));

    //
    // Create the calendar row
    //
    UIComponent calendarRow = _createRow(isDesktop,
                                         XhtmlConstants.H_ALIGN_END);
    CoreChooseDate ccd = CalendarUtils.createChooseDate(context);
    calendarRow.getChildren().add(ccd);

    // Get a destination that points back to this dialog, including
    // any viewIDs
    String destination =
      GenericEntry.getGenericEntryURL(context,
                                      GenericEntry.CALENDAR_DIALOG_ENTRY);
    ccd.getAttributes().put("destination", destination);

    //
    // Create a spacer
    //
    UIComponent spacerRow = _createRow(isDesktop, null);
    CoreSpacer cos = new CoreSpacer();
    spacerRow.getChildren().add(cos);
    cos.setHeight("8");

    //
    // Create the button row
    //
    UIComponent buttonRow = _createRow(isDesktop, XhtmlConstants.H_ALIGN_END);

    CoreGoButton cancelButton =
       JspUtils.createGoButton(arc, _CANCEL_LABEL_KEY);
    buttonRow.getChildren().add(cancelButton);

    Object cap = arc.getAgent().getCapabilities().get(
                     TrinidadAgent.CAP_MULTIPLE_WINDOWS);
    boolean multWindowsSupported = Boolean.TRUE.equals( cap );
    if (multWindowsSupported )
    {
      cancelButton.setOnclick("return _doCancel()");
    }
    else
    {
      // create the destination of the cancel button
      StringBuffer cancelDest = new StringBuffer();
      EncoderUtils.appendURLArguments(cancelDest,
                                      destination,
                                      new String[]{
                                        XhtmlConstants.EVENT_PARAM,
                                        XhtmlConstants.CANCEL_EVENT
                                      });

      // Prepend a slash, because this destination already
      // includes the context root
      cancelButton.setDestination("/" + cancelDest.toString());

      String value = __getParam(context, XhtmlConstants.VALUE_PARAM);
      if (value != null)
      {
        long lg = Long.parseLong(value);
        ccd.getAttributes().put("value", new Date(lg));
      }

      // get the scrolled value
      String month = __getParam(context,XhtmlConstants.MONTH_PARAM);
      String year = __getParam(context,XhtmlConstants.YEAR_PARAM);

      // try to create scrolledValue
      if ( month != null && year != null )
      {
        try
        {
          long scrolledValue = Long.parseLong(month) + Long.parseLong(year);


          ccd.getAttributes().put("scrolledValue", new Date(scrolledValue));
        }
        catch ( NumberFormatException nfe){;}
      }
    }

    if (multWindowsSupported )
    {
      CoreImportScript cis = new CoreImportScript();
      cis.setNames(new String[]{"_doCancel()", "_selectDate()"});
      doc.getFacets().put(CoreDocument.META_CONTAINER_FACET, cis);

      HtmlTableLayout htl = new HtmlTableLayout();
      form.getChildren().add(htl);

      //
View Full Code Here

    RenderingContext arc = RenderingContext.getCurrentInstance();
    arc.getPartialPageContext().addPartialTarget(
              requestParams.get(XhtmlConstants.SOURCE_PARAM));

    CoreDocument doc = new CoreDocument();
    context.getViewRoot().getChildren().add(doc);
    doc.getChildren().add(CalendarUtils.createChooseDate(context));
  }
View Full Code Here

  {
    Map<String, String> requestParams =
      context.getExternalContext().getRequestParameterMap();
   
    RenderingContext arc = RenderingContext.getCurrentInstance();
    CoreDocument doc = new CoreDocument();
    context.getViewRoot().getChildren().add(doc);

    doc.setTitle(arc.getTranslatedString("af_inputColor.PICKER_TITLE"));
   
    CoreForm form = new CoreForm();
    form.setId("d");
    doc.getChildren().add(form);
   
    HtmlTableLayout tl = new HtmlTableLayout();
    form.getChildren().add(tl);
   
    HtmlRowLayout rl1 = new HtmlRowLayout();
    tl.getChildren().add(rl1);
    HtmlCellFormat cf1 = new HtmlCellFormat();
    rl1.getChildren().add(cf1);
    cf1.setHalign("center");
   
    CoreInputColor sic = new CoreInputColor();
    cf1.getChildren().add(sic);
    sic.setId("c");
    sic.setOnkeypress("if(_getKC(event)==13){selectColor();return false}");
    Converter converter = _getConverter(requestParams);
    Object value =
      converter.getAsObject(context, sic, requestParams.get("value"));
    sic.setConverter(converter);
    sic.setValue(value);
    sic.setChooseId("choose");
    sic.setLabel(arc.getTranslatedString("af_inputColor.PICKER_PROMPT"));

    HtmlRowLayout rl2 = new HtmlRowLayout();
    tl.getChildren().add(rl2);
    CoreSpacer spacer = new CoreSpacer();
    rl2.getChildren().add(spacer);
    spacer.setHeight("8");
   
    HtmlRowLayout rl3 = new HtmlRowLayout();
    tl.getChildren().add(rl3);
    HtmlCellFormat cf3 = new HtmlCellFormat();
    rl3.getChildren().add(cf3);
    cf3.setHalign("center");
   
    CoreChooseColor choose = new CoreChooseColor();
    cf3.getChildren().add(choose);
    choose.setId("choose");
    choose.setWidth(7);
   
    HtmlRowLayout rl4 = new HtmlRowLayout();
    tl.getChildren().add(rl4);
    CoreSpacer spacer2 = new CoreSpacer();
    rl4.getChildren().add(spacer2);
    spacer2.setHeight("8");
   
    HtmlRowLayout rl5 = new HtmlRowLayout();
    tl.getChildren().add(rl5);
    HtmlCellFormat cf5 = new HtmlCellFormat();
    rl5.getChildren().add(cf5);
    cf5.setHalign("end");
    CorePanelButtonBar bar = new CorePanelButtonBar();
    cf5.getChildren().add(bar);


    CoreGoButton cancel =
       JspUtils.createGoButton(arc, "af_inputColor.CANCEL");
    bar.getChildren().add(cancel);
    cancel.setOnclick("doCancel()");

    CoreGoButton select =
       JspUtils.createGoButton(arc, "af_inputColor.APPLY");
    bar.getChildren().add(select);
    select.setOnclick("return selectColor()");

    HtmlScript script = new HtmlScript();
    script.setText(_SCRIPT);
    doc.getChildren().add(script);
  }
View Full Code Here

  @SuppressWarnings("unchecked")
  static public void service(FacesContext context)
    throws IOException
  {
    RenderingContext arc = RenderingContext.getCurrentInstance();
    CoreDocument doc = new CoreDocument();
    context.getViewRoot().getChildren().add(doc);
    doc.setTitle(arc.getTranslatedString(_DIALOG_TITLE_KEY));

    CoreForm form = new CoreForm();
    doc.getChildren().add(form);
    form.setId("a");

    boolean isDesktop = (arc.getAgent().getType().equals(Agent.TYPE_DESKTOP));

    //
    // Create the calendar row
    //
    UIComponent calendarRow = _createRow(isDesktop,
                                         XhtmlConstants.H_ALIGN_END);
    CoreChooseDate ccd = CalendarUtils.createChooseDate(context);
    calendarRow.getChildren().add(ccd);

    // Get a destination that points back to this dialog, including
    // any viewIDs
    String destination =
      GenericEntry.getGenericEntryURL(context,
                                      GenericEntry.CALENDAR_DIALOG_ENTRY);
    ccd.getAttributes().put("destination", destination);

    //
    // Create a spacer
    //
    UIComponent spacerRow = _createRow(isDesktop, null);
    CoreSpacer cos = new CoreSpacer();
    spacerRow.getChildren().add(cos);
    cos.setHeight("8");

    //
    // Create the button row
    //
    UIComponent buttonRow = _createRow(isDesktop, XhtmlConstants.H_ALIGN_END);

    CoreGoButton cancelButton =
       JspUtils.createGoButton(arc, _CANCEL_LABEL_KEY);
    buttonRow.getChildren().add(cancelButton);

    Object cap = arc.getAgent().getCapabilities().get(
                     TrinidadAgent.CAP_MULTIPLE_WINDOWS);
    boolean multWindowsSupported = Boolean.TRUE.equals( cap );
    if (multWindowsSupported )
    {
      cancelButton.setOnclick("return _doCancel()");
    }
    else
    {
      // create the destination of the cancel button
      StringBuffer cancelDest = new StringBuffer();
      EncoderUtils.appendURLArguments(cancelDest,
                                      destination,
                                      new String[]{
                                        TrinidadRenderingConstants.EVENT_PARAM,
                                        TrinidadRenderingConstants.CANCEL_EVENT
                                      });

      // Prepend a slash, because this destination already
      // includes the context root
      cancelButton.setDestination("/" + cancelDest.toString());

      String value = __getParam(context, TrinidadRenderingConstants.VALUE_PARAM);
      if (value != null)
      {
        long lg = Long.parseLong(value);
        ccd.getAttributes().put("value", new Date(lg));
      }

      // get the scrolled value
      String month = __getParam(context,TrinidadRenderingConstants.MONTH_PARAM);
      String year = __getParam(context,TrinidadRenderingConstants.YEAR_PARAM);

      // try to create scrolledValue
      if ( month != null && year != null )
      {
        try
        {
          long scrolledValue = Long.parseLong(month) + Long.parseLong(year);


          ccd.getAttributes().put("scrolledValue", new Date(scrolledValue));
        }
        catch ( NumberFormatException nfe){;}
      }
    }

    if (multWindowsSupported )
    {
      CoreImportScript cis = new CoreImportScript();
      cis.setNames(new String[]{"_doCancel()", "_selectDate()"});
      doc.getFacets().put(CoreDocument.META_CONTAINER_FACET, cis);

      HtmlTableLayout htl = new HtmlTableLayout();
      form.getChildren().add(htl);

      //
View Full Code Here

    RenderingContext arc = RenderingContext.getCurrentInstance();
    arc.getPartialPageContext().addPartialTarget(
              requestParams.get(TrinidadRenderingConstants.SOURCE_PARAM));

    CoreDocument doc = new CoreDocument();
    context.getViewRoot().getChildren().add(doc);
    doc.getChildren().add(CalendarUtils.createChooseDate(context));
  }
View Full Code Here

      _fileWriter.write("----------------------------------\n");
    }
    UIViewRoot root = RenderKitBootstrap.createUIViewRoot(_facesContext);
    root.setRenderKitId(getRenderKitId());

    CoreDocument doc = new CoreDocument();
    doc.setId("docId");
    root.getChildren().add(doc);
    CoreForm form = new CoreForm();
    form.setId("formId");
    doc.getChildren().add(form);

    PerfComp perfer = new PerfComp(count, testName);
    form.getChildren().add(perfer);
    perfer.getChildren().add(compToTest);
View Full Code Here

      root.getChildren().add(html);
      return html;
    }
    else
    {
      CoreDocument doc = new CoreDocument();
      doc.setId("docId");
      root.getChildren().add(doc);
      CoreForm form = new CoreForm();
      form.setId("formId");
      if (script.getDefinition().isUsesUpload())
        form.setUsesUpload(true);
      doc.getChildren().add(form);
      return form;
    }
  }
View Full Code Here

  @SuppressWarnings("unchecked")
  static public void service(FacesContext context)
    throws IOException
  {
    RenderingContext arc = RenderingContext.getCurrentInstance();
    CoreDocument doc = new CoreDocument();
    context.getViewRoot().getChildren().add(doc);
    doc.setTitle(arc.getTranslatedString(_DIALOG_TITLE_KEY));

    CoreForm form = new CoreForm();
    doc.getChildren().add(form);
    form.setId("a");

    boolean isDesktop = (arc.getAgent().getType().equals(Agent.TYPE_DESKTOP));

    //
    // Create the calendar row
    //
    UIComponent calendarRow = _createRow(isDesktop,
                                         XhtmlConstants.H_ALIGN_END);
    CoreChooseDate ccd = CalendarUtils.createChooseDate(context);
    calendarRow.getChildren().add(ccd);

    // Get a destination that points back to this dialog, including
    // any viewIDs
    String destination =
      GenericEntry.getGenericEntryURL(context,
                                      GenericEntry.CALENDAR_DIALOG_ENTRY);
    ccd.getAttributes().put("destination", destination);

    //
    // Create a spacer
    //
    UIComponent spacerRow = _createRow(isDesktop, null);
    CoreSpacer cos = new CoreSpacer();
    spacerRow.getChildren().add(cos);
    cos.setHeight("8");

    //
    // Create the button row
    //
    UIComponent buttonRow = _createRow(isDesktop, XhtmlConstants.H_ALIGN_END);

    CoreGoButton cancelButton =
       JspUtils.createGoButton(arc, _CANCEL_LABEL_KEY);
    buttonRow.getChildren().add(cancelButton);

    Object cap = arc.getAgent().getCapabilities().get(
                     TrinidadAgent.CAP_MULTIPLE_WINDOWS);
    boolean multWindowsSupported = Boolean.TRUE.equals( cap );
    if (multWindowsSupported )
    {
      cancelButton.setOnclick("return _doCancel()");
    }
    else
    {
      // create the destination of the cancel button
      StringBuffer cancelDest = new StringBuffer();
      EncoderUtils.appendURLArguments(cancelDest,
                                      destination,
                                      new String[]{
                                        XhtmlConstants.EVENT_PARAM,
                                        XhtmlConstants.CANCEL_EVENT
                                      });

      // Prepend a slash, because this destination already
      // includes the context root
      cancelButton.setDestination("/" + cancelDest.toString());

      String value = __getParam(context, XhtmlConstants.VALUE_PARAM);
      if (value != null)
      {
        long lg = Long.parseLong(value);
        ccd.getAttributes().put("value", new Date(lg));
      }

      // get the scrolled value
      String month = __getParam(context,XhtmlConstants.MONTH_PARAM);
      String year = __getParam(context,XhtmlConstants.YEAR_PARAM);

      // try to create scrolledValue
      if ( month != null && year != null )
      {
        try
        {
          long scrolledValue = Long.parseLong(month) + Long.parseLong(year);


          ccd.getAttributes().put("scrolledValue", new Date(scrolledValue));
        }
        catch ( NumberFormatException nfe){;}
      }
    }

    if (multWindowsSupported )
    {
      CoreImportScript cis = new CoreImportScript();
      cis.setNames(new String[]{"_doCancel()", "_selectDate()"});
      doc.getFacets().put(CoreDocument.META_CONTAINER_FACET, cis);

      HtmlTableLayout htl = new HtmlTableLayout();
      form.getChildren().add(htl);

      //
View Full Code Here

TOP

Related Classes of org.apache.myfaces.trinidad.component.core.CoreDocument

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.