src/org/tiefaces/components/websheet/configuration/ConfigurationHandler.java
private void buildSheetConfigMapFromFormCommand(final Sheet sheet,
			final Map<String, SheetConfiguration> sheetConfigMap, final List<ConfigCommand> commandList,
			final List<String> formList, final int sheetRightCol) {
		boolean foundForm = false;
		int minRowNum = sheet.getLastRowNum();
		int maxRowNum = sheet.getFirstRowNum();
		for (Command command : commandList) {
			// check whether is form command
			if (command.getCommandTypeName().equalsIgnoreCase(TieConstants.COMMAND_FORM)) {
				foundForm = true;
				FormCommand fcommand = (FormCommand) command;
				sheetConfigMap.put(fcommand.getName(),
						getSheetConfigurationFromConfigCommand(sheet, fcommand, sheetRightCol));
				formList.add(fcommand.getName());
				if (fcommand.getTopRow() < minRowNum) {
					minRowNum = fcommand.getTopRow();
				}
				if (fcommand.getLastRow() > maxRowNum) {
					maxRowNum = fcommand.getLastRow();
				}
			}
		}
		// if no form found, then use the whole sheet as form
		if (!foundForm) {
			WebSheetUtility.clearHiddenColumns(sheet);
			String formName = sheet.getSheetName();
			SheetConfiguration sheetConfig = getSheetConfiguration(sheet, formName, sheetRightCol);
			FormCommand fcommand = buildFormCommandFromSheetConfig(sheetConfig, sheet);
			commandList.add(fcommand);
			sheetConfig.setFormCommand(fcommand);
			sheetConfigMap.put(formName, sheetConfig);
			formList.add(formName);
			minRowNum = sheet.getFirstRowNum();
			maxRowNum = sheet.getLastRowNum();
		}

		// if skip config then return.
		if (parent.isSkipConfiguration()) {
			return;
		}
		SaveAttrsUtility.setSaveAttrsForSheet(sheet, minRowNum, maxRowNum,
				parent.getCellAttributesMap().getTemplateCommentMap().get(TieConstants.SAVE_COMMENT_KEY_IN_MAP));
	}
private void buildSheetConfigMapFromFormCommand(final Sheet sheet,
			final Map<String, SheetConfiguration> sheetConfigMap, final List<ConfigCommand> commandList,
			final List<String> formList, final int sheetRightCol) {
		boolean foundForm = false;
		int minRowNum = sheet.getLastRowNum();
		int maxRowNum = sheet.getFirstRowNum();
		for (Command command : commandList) {
			// check whether is form command
			if (command.getCommandTypeName().equalsIgnoreCase(TieConstants.COMMAND_FORM)) {
				foundForm = true;
				FormCommand fcommand = (FormCommand) command;
				sheetConfigMap.put(fcommand.getName(),
						getSheetConfigurationFromConfigCommand(sheet, fcommand, sheetRightCol));
				formList.add(fcommand.getName());
				if (fcommand.getTopRow() < minRowNum) {
					minRowNum = fcommand.getTopRow();
				}
				if (fcommand.getLastRow() > maxRowNum) {
					maxRowNum = fcommand.getLastRow();
				}
			}
		}
		// if no form found, then use the whole sheet as form
		if (!foundForm) {
			WebSheetUtility.clearHiddenColumns(sheet);
			String formName = sheet.getSheetName();
			SheetConfiguration sheetConfig = getSheetConfiguration(sheet, formName, sheetRightCol);
			FormCommand fcommand = buildFormCommandFromSheetConfig(sheetConfig, sheet);
			commandList.add(fcommand);
			sheetConfig.setFormCommand(fcommand);
			sheetConfigMap.put(formName, sheetConfig);
			formList.add(formName);
			minRowNum = sheet.getFirstRowNum();
			maxRowNum = sheet.getLastRowNum();
		}

		// if skip config then return.
		if (parent.isSkipConfiguration()) {
			return;
		}
		SaveAttrsUtility.setSaveAttrsForSheet(sheet, minRowNum, maxRowNum,
				parent.getCellAttributesMap().getTemplateCommentMap().get(TieConstants.SAVE_COMMENT_KEY_IN_MAP));
	}
private void buildSheetConfigMapFromFormCommand ( final Sheet sheet , final Map < String , SheetConfiguration > sheetConfigMap , final List < ConfigCommand > commandList , final List < String > formList , final int sheetRightCol ) { boolean foundForm = false ; int minRowNum = sheet . getLastRowNum ( ) ; int maxRowNum = sheet . getFirstRowNum ( ) ; for ( Command command : commandList ) { // check whether is form command
 if ( command . getCommandTypeName ( ) . equalsIgnoreCase ( TieConstants . COMMAND_FORM ) ) { foundForm = true ; FormCommand fcommand = ( FormCommand ) command ; sheetConfigMap . put ( fcommand . getName ( ) , getSheetConfigurationFromConfigCommand ( sheet , fcommand , sheetRightCol ) ) ; formList . add ( fcommand . getName ( ) ) ; if ( fcommand . getTopRow ( ) < minRowNum ) { minRowNum = fcommand . getTopRow ( ) ; } if ( fcommand . getLastRow ( ) > maxRowNum ) { maxRowNum = fcommand . getLastRow ( ) ; } } } // if no form found, then use the whole sheet as form
 if ( ! foundForm ) { WebSheetUtility . clearHiddenColumns ( sheet ) ; String formName = sheet . getSheetName ( ) ; SheetConfiguration sheetConfig = getSheetConfiguration ( sheet , formName , sheetRightCol ) ; FormCommand fcommand = buildFormCommandFromSheetConfig ( sheetConfig , sheet ) ; commandList . add ( fcommand ) ; sheetConfig . setFormCommand ( fcommand ) ; sheetConfigMap . put ( formName , sheetConfig ) ; formList . add ( formName ) ; minRowNum = sheet . getFirstRowNum ( ) ; maxRowNum = sheet . getLastRowNum ( ) ; } // if skip config then return.
 if ( parent . isSkipConfiguration ( ) ) { return ; } SaveAttrsUtility . setSaveAttrsForSheet ( sheet , minRowNum , maxRowNum , parent . getCellAttributesMap ( ) . getTemplateCommentMap ( ) . get ( TieConstants . SAVE_COMMENT_KEY_IN_MAP ) ) ; }
build top level configuration map from command list. User can either put
tie:form command in the comments (which will transfer to sheetConfig), Or
just ignore it, then use whole sheet as one form.

@param sheet
sheet.
@param sheetConfigMap
sheetConfigMap.
@param commandList
command list.
@param formList
form list.
@param sheetRightCol
the sheet right col
build top level configuration map from command list . User can either put tie : form command in the comments ( which will transfer to sheetConfig ) Or just ignore it then use whole sheet as one form .