All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.frameworkset.platform.dictionary.input.CurrentTimeScript Maven / Gradle / Ivy

There is a newer version: 5.6.4
Show newest version
/**
 * 
 */
package com.frameworkset.platform.dictionary.input;

import java.text.Format;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.frameworkset.util.DataFormatUtil;

import com.frameworkset.platform.dictionary.DictAttachField;

/**
 * 

Title: InputCurrentTimeScript.java

* *

Description:

* *

Copyright: Copyright (c) 2006

* *

Company: bbossgroups

* @Date 2007-12-17 14:58:28 * @author ge.tao * @version 1.0 */ public class CurrentTimeScript extends BaseInputTypeScript{ public CurrentTimeScript(DictAttachField dictatt) { super(dictatt); } /* (non-Javadoc) * @see com.frameworkset.platform.dictionary.input.InputTypeScript#getFunctionScript(java.lang.String, java.lang.String, java.lang.String, int) */ // public String getFunctionScript(String fiedName, String inputTypeName, String value, int maxLength) { // // TODO Auto-generated method stub // return null; // } // // /* (non-Javadoc) // * @see com.frameworkset.platform.dictionary.input.InputTypeScript#getFunctionContent(java.lang.String, java.lang.String, java.lang.String, int) // */ // public String getFunctionContent(String fiedName, String inputTypeName, String value, int maxLength) { // // TODO Auto-generated method stub // return null; // } /* (non-Javadoc) * @see com.frameworkset.platform.dictionary.input.InputTypeScript#getExtendHtmlContent(com.frameworkset.platform.dictionary.DictAttachField) */ // public String getExtendHtmlContent(DictAttachField dictatt) { // String defaultValue = ""; // Date currentDate = new Date(); // Format format = new SimpleDateFormat(dictatt.getDateFormat()); // defaultValue = format.format(currentDate); // if(dictatt.getFieldValue()!=null && !"".equals(dictatt.getFieldValue())){ // defaultValue = dictatt.getFieldValue(); // } // int initLength = dictatt.getMaxLength(); // if(initLength == 0){//没有设置长度 long int // initLength = 5; // } // String isNullStr = ""; // if(dictatt.getIsnullable()==DictAttachField.NOTNULLABLE){ // isNullStr = "必填"; // } // StringBuffer html = new StringBuffer() // .append("").append(isNullStr); // return html.toString(); // } public String getEditExtendHtmlContent(HttpServletRequest request, HttpServletResponse response, Map keyWords) { boolean readonly = this.isReadOnly(keyWords); String defaultValue = ""; Date currentDate = new Date(); Format format = DataFormatUtil.getSimpleDateFormat(dictatt.getDateFormat()); defaultValue = format.format(currentDate); if(dictatt.getFieldValue()!=null && !"".equals(dictatt.getFieldValue())){ defaultValue = dictatt.getFieldValue(); } int initLength = dictatt.getMaxLength(); if(initLength == 0){//没有设置长度 long int initLength = 5; } String isNullStr = ""; if(dictatt.getIsnullable()==DictAttachField.NOTNULLABLE){ isNullStr = "必填"; } StringBuffer html = new StringBuffer() .append("").append(isNullStr); return html.toString(); } public String getNewExtendHtmlContent(HttpServletRequest request, HttpServletResponse response) { String defaultValue = ""; Date currentDate = new Date(); Format format = DataFormatUtil.getSimpleDateFormat(request,dictatt.getDateFormat()); defaultValue = format.format(currentDate); if(dictatt.getFieldValue()!=null && !"".equals(dictatt.getFieldValue())){ defaultValue = dictatt.getFieldValue(); } int initLength = dictatt.getMaxLength(); if(initLength == 0){//没有设置长度 long int initLength = 5; } String isNullStr = ""; if(dictatt.getIsnullable()==DictAttachField.NOTNULLABLE){ isNullStr = "必填"; } StringBuffer html = new StringBuffer() .append("").append(isNullStr); return html.toString(); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy