package org.apache.jsp.webcontent.birt.pages.parameter;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import org.eclipse.birt.report.utility.ParameterAccessor;
import org.eclipse.birt.report.context.BaseAttributeBean;
import org.eclipse.birt.report.context.ScalarParameterBean;

public final class TextBoxParameterFragment_jsp extends org.apache.jasper.runtime.HttpJspBase
    implements org.apache.jasper.runtime.JspSourceDependent {

  private static final javax.servlet.jsp.JspFactory _jspxFactory =
          javax.servlet.jsp.JspFactory.getDefaultFactory();

  private static java.util.List<java.lang.String> _jspx_dependants;

  private javax.el.ExpressionFactory _el_expressionfactory;
  private org.apache.tomcat.InstanceManager _jsp_instancemanager;

  public java.util.List<java.lang.String> getDependants() {
    return _jspx_dependants;
  }

  public void _jspInit() {
    _el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
    _jsp_instancemanager = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(getServletConfig());
  }

  public void _jspDestroy() {
  }

  public void _jspService(final javax.servlet.http.HttpServletRequest request, final javax.servlet.http.HttpServletResponse response)
        throws java.io.IOException, javax.servlet.ServletException {

    final javax.servlet.jsp.PageContext pageContext;
    final javax.servlet.ServletContext application;
    final javax.servlet.ServletConfig config;
    javax.servlet.jsp.JspWriter out = null;
    final java.lang.Object page = this;
    javax.servlet.jsp.JspWriter _jspx_out = null;
    javax.servlet.jsp.PageContext _jspx_page_context = null;


    try {
      response.setContentType("text/html; charset=utf-8");
      pageContext = _jspxFactory.getPageContext(this, request, response,
      			null, false, 0, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write("\n");
      out.write("\n");
      out.write("\n");
      out.write("\n");
      out.write("\n");
      out.write('\n');
      org.eclipse.birt.report.context.BaseAttributeBean attributeBean = null;
      attributeBean = (org.eclipse.birt.report.context.BaseAttributeBean) _jspx_page_context.getAttribute("attributeBean", javax.servlet.jsp.PageContext.REQUEST_SCOPE);
      if (attributeBean == null){
        throw new java.lang.InstantiationException("bean attributeBean not found within scope");
      }
      out.write('\n');
      out.write('\n');
      out.write('\n');

	ScalarParameterBean parameterBean = ( ScalarParameterBean ) attributeBean.getParameterBean( );
	String encodedParameterName = ParameterAccessor.htmlEncode( parameterBean.getName( ) );

      out.write("\n");
      out.write("<TR>\n");
      out.write("\t<TD NOWRAP>\n");
      out.write("\t\t<IMG SRC=\"birt/images/parameter.gif\" ALT=\"");
      out.print( parameterBean.getDisplayName( ) );
      out.write("\" TITLE=\"");
      out.print( parameterBean.getToolTip( ) );
      out.write("\"/>\n");
      out.write("\t</TD>\n");
      out.write("\t<TD NOWRAP>\n");
      out.write("\t\t<FONT TITLE=\"");
      out.print( parameterBean.getToolTip( ) );
      out.write("\"><LABEL FOR=\"");
      out.print( encodedParameterName );
      out.write('"');
      out.write('>');
      out.print( parameterBean.getDisplayName( ) );
      out.write(":</LABEL></FONT>\n");
      out.write("\t\t");
      out.write('\n');
      out.write('	');
      out.write('	');

		if ( parameterBean.isRequired( ) )
		{
		
      out.write("\n");
      out.write("\t\t\t<FONT COLOR=\"red\"><LABEL FOR=\"");
      out.print( encodedParameterName );
      out.write("\">*</LABEL></FONT>\n");
      out.write("\t\t");

		}
		
      out.write("\n");
      out.write("\t</TD>\n");
      out.write("</TR>\n");
      out.write("<TR>\n");
      out.write("\t<TD NOWRAP></TD>\n");
      out.write("\t<TD NOWRAP WIDTH=\"100%\">\n");
      out.write("\t<INPUT TYPE=\"HIDDEN\" ID=\"control_type\" VALUE=\"text\">\n");
      out.write("\t<INPUT TYPE=\"HIDDEN\" ID=\"data_type\" VALUE=\"");
      out.print("" + parameterBean.getParameter( ).getDataType( ) );
      out.write('"');
      out.write('>');
      out.write('\n');

	if ( !parameterBean.isRequired( ) )
	{

      out.write("\t\n");
      out.write("\t\t<LABEL FOR=\"");
      out.print( encodedParameterName + "_radio_notnull" );
      out.write("\" CLASS=\"birtviewer_hidden_label\">Input text</LABEL>\t\n");
      out.write("\t\t<INPUT TYPE=\"RADIO\"\n");
      out.write("\t\t\tID=\"");
      out.print( encodedParameterName + "_radio_notnull" );
      out.write("\"\n");
      out.write("\t\t\tVALUE=\"");
      out.print( encodedParameterName );
      out.write("\"\n");
      out.write("\t\t\t");
      out.print( (parameterBean.getValue( ) != null)? "CHECKED" : "" );
      out.write('>');
      out.write('\n');

	}

      out.write("\t\n");
      out.write("\t\t<INPUT CLASS=\"BirtViewer_parameter_dialog_Input\"\n");
      out.write("\t\t\tTYPE=\"");
      out.print( parameterBean.isValueConcealed( )? "PASSWORD" : "TEXT" );
      out.write("\"\n");
      out.write("\t\t\tNAME=\"");
      out.print( encodedParameterName );
      out.write("\"\n");
      out.write("\t\t\tID=\"");
      out.print( encodedParameterName );
      out.write("\" \n");
      out.write("\t\t\tTITLE=\"");
      out.print( parameterBean.getToolTip( ) );
      out.write("\"\n");
      out.write("\t\t\tVALUE=\"");
      out.print( ParameterAccessor.htmlEncode( ( parameterBean.getDisplayText( ) == null )? "" : parameterBean.getDisplayText( ) ) );
      out.write("\" \n");
      out.write("\t\t\t");
      out.print( ( !parameterBean.isRequired( ) && parameterBean.getValue( ) == null )? "DISABLED='true'" : "" );
      out.write("\n");
      out.write("\t\t\t");
      out.print( parameterBean.isRequired( ) ? "aria-required='true'" : "" );
      out.write("\n");
      out.write("            >\n");
      out.write("\n");
      out.write("\t\t<INPUT TYPE=\"HIDDEN\"\n");
      out.write("\t\t\tID=\"");
      out.print( encodedParameterName + "_value" );
      out.write("\"\n");
      out.write("\t\t\tVALUE=\"");
      out.print( ParameterAccessor.htmlEncode( ( parameterBean.getValue( ) == null )? "" : parameterBean.getValue( ) ) );
      out.write("\"\n");
      out.write("\t\t\t>\n");
      out.write("\t\t\n");
      out.write("\t\t<INPUT TYPE=\"HIDDEN\"\n");
      out.write("\t\t\tID=\"");
      out.print( encodedParameterName + "_displayText" );
      out.write("\"\n");
      out.write("\t\t\tVALUE=\"");
      out.print( ParameterAccessor.htmlEncode( ( parameterBean.getDisplayText( ) == null )? "" : parameterBean.getDisplayText( ) ) );
      out.write("\"\n");
      out.write("\t\t\t>\n");

	if ( !parameterBean.isRequired( ) )
	{

      out.write("\n");
      out.write("\t\t<BR>\n");
      out.write("\t\t<LABEL FOR=\"");
      out.print( encodedParameterName + "_radio_null" );
      out.write("\" CLASS=\"birtviewer_hidden_label\">Null Value</LABEL>\t\n");
      out.write("\t\t<INPUT TYPE=\"RADIO\"\n");
      out.write("\t\t\tID=\"");
      out.print( encodedParameterName + "_radio_null");
      out.write("\"\n");
      out.write("\t\t\tVALUE=\"");
      out.print( encodedParameterName );
      out.write("\"\n");
      out.write("\t\t\t");
      out.print( ( parameterBean.getValue( ) == null )? "CHECKED" : "" );
      out.write("> Null Value\n");

	}

      out.write("\n");
      out.write("\n");
      out.write("\t\t<INPUT TYPE=\"HIDDEN\" ID=\"isRequired\" \n");
      out.write("\t\t\tVALUE = \"");
      out.print( parameterBean.isRequired( )? "true": "false" );
      out.write("\">\n");
      out.write("\t</TD>\n");
      out.write("</TR>");
    } catch (java.lang.Throwable t) {
      if (!(t instanceof javax.servlet.jsp.SkipPageException)){
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          try { out.clearBuffer(); } catch (java.io.IOException e) {}
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
      }
    } finally {
      _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
}
