Java Code Examples for ims.core.vo.QuestionAnswerTypeVo.getAnswerWidth()

The following are Jave code examples for showing how to use getAnswerWidth() of the ims.core.vo.QuestionAnswerTypeVo class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private int getCellAnswerWidth(QuestionAnswerTypeVo configAnswer, AnswerDetailsVo instAnswer)
{
	if (configAnswer == null || configAnswer.getAnswerType() == null)
		return 0;

	ims.core.vo.lookups.QuestionAnswerType answerType = configAnswer.getAnswerType();

	if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.DATE))
		return DEFAULT_DATE_ANSWER_CELL_WIDTH;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.DECIMAL))
		return DEFAULT_DECIMAL_ANSWER_CELL_WIDTH;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.INTEGER))
		return DEFAULT_INTEGER_ANSWER_CELL_WIDTH;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.MULTISELECT))
	{
		if (instAnswer != null)
			return instAnswer.getAnswerWidth() == null ? DEFAULT_MULTISELECT_ANSWER_CELL_WIDTH : instAnswer.getAnswerWidth().intValue();

		return configAnswer.getAnswerWidth() == null ? DEFAULT_MULTISELECT_ANSWER_CELL_WIDTH : configAnswer.getAnswerWidth().intValue();
	}
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.PARTIALDATE))
		return DEFAULT_PARTIALDATE_ANSWER_CELL_WIDTH;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.PICKLIST))
	{
		if (instAnswer != null)
			return instAnswer.getAnswerWidth() == null ? DEFAULT_PICKLIST_ANSWER_CELL_WIDTH : instAnswer.getAnswerWidth().intValue();

		return configAnswer.getAnswerWidth() == null ? DEFAULT_PICKLIST_ANSWER_CELL_WIDTH : configAnswer.getAnswerWidth().intValue();
	}
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.SEPARATOR))
		return DEFAULT_SEPARATOR_ANSWER_CELL_WIDTH;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.TEXT))
	{
		if (instAnswer != null)
			return instAnswer.getAnswerWidth() == null ? DEFAULT_TEXT_ANSWER_CELL_WIDTH : instAnswer.getAnswerWidth().intValue();

		return configAnswer.getAnswerWidth() == null ? DEFAULT_TEXT_ANSWER_CELL_WIDTH : configAnswer.getAnswerWidth().intValue();
	}
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.TIME))
		return DEFAULT_TIME_ANSWER_CELL_WIDTH;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.YESNO))
		return DEFAULT_YESNO_ANSWER_CELL_WIDTH;

	return DEFAULT_UNKNOWN_ANSWER_CELL_WIDTH;
}
 
Example 2
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View Source Code Vote up 4 votes
private int getCellAnswerWidth(QuestionAnswerTypeVo configAnswer, AnswerDetailsVo instAnswer)
{
	if(configAnswer == null || configAnswer.getAnswerType() == null)
		return 0;
	
	ims.core.vo.lookups.QuestionAnswerType answerType = configAnswer.getAnswerType();
	
	if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.DATE))
		return DEFAULT_DATE_ANSWER_CELL_WIDTH;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.DECIMAL))
		return DEFAULT_DECIMAL_ANSWER_CELL_WIDTH;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.INTEGER))
		return DEFAULT_INTEGER_ANSWER_CELL_WIDTH;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.MULTISELECT))
	{
		int defaultMultiSelect = DEFAULT_MULTISELECT_ANSWER_CELL_WIDTH;
		if(isDPP)
			defaultMultiSelect = DEFAULT_MULTISELECT_ANSWER_CELL_WIDTH + 190;
		if(instAnswer != null)
			return instAnswer.getAnswerWidth() == null ? defaultMultiSelect : instAnswer.getAnswerWidth().intValue();
		
		return configAnswer.getAnswerWidth() == null ? defaultMultiSelect : configAnswer.getAnswerWidth().intValue();
	}
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.PARTIALDATE))
		return DEFAULT_PARTIALDATE_ANSWER_CELL_WIDTH;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.PICKLIST))
	{
		if(instAnswer != null)
			return instAnswer.getAnswerWidth() == null ? DEFAULT_PICKLIST_ANSWER_CELL_WIDTH : instAnswer.getAnswerWidth().intValue();
		
		return configAnswer.getAnswerWidth() == null ? DEFAULT_PICKLIST_ANSWER_CELL_WIDTH : configAnswer.getAnswerWidth().intValue();
	}
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.SEPARATOR))
		return DEFAULT_SEPARATOR_ANSWER_CELL_WIDTH;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.TEXT))
	{
		if(instAnswer != null)
			return instAnswer.getAnswerWidth() == null ? DEFAULT_TEXT_ANSWER_CELL_WIDTH : instAnswer.getAnswerWidth().intValue();
		
		return configAnswer.getAnswerWidth() == null ? DEFAULT_TEXT_ANSWER_CELL_WIDTH : configAnswer.getAnswerWidth().intValue();
	}
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.TIME))
		return DEFAULT_TIME_ANSWER_CELL_WIDTH;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.YESNO))
		return DEFAULT_YESNO_ANSWER_CELL_WIDTH;
	
	return DEFAULT_UNKNOWN_ANSWER_CELL_WIDTH;
}
 
Example 3
Project: AvoinApotti   File: MyOrderQuestionsPopulation.java   View Source Code Vote up 4 votes
private int getCellAnswerWidth(QuestionAnswerTypeVo configAnswer, AnswerDetailsVo instAnswer)
{
	if(configAnswer == null || configAnswer.getAnswerType() == null)
		return 0;
	
	ims.core.vo.lookups.QuestionAnswerType answerType = configAnswer.getAnswerType();
	
	if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.DATE))
		return DEFAULT_DATE_ANSWER_CELL_WIDTH;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.DECIMAL))
		return DEFAULT_DECIMAL_ANSWER_CELL_WIDTH;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.INTEGER))
		return DEFAULT_INTEGER_ANSWER_CELL_WIDTH;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.MULTISELECT))
	{
		int defaultMultiSelect = DEFAULT_MULTISELECT_ANSWER_CELL_WIDTH;
		if(instAnswer != null)
			return instAnswer.getAnswerWidth() == null ? defaultMultiSelect : instAnswer.getAnswerWidth().intValue();
		
		return configAnswer.getAnswerWidth() == null ? defaultMultiSelect : configAnswer.getAnswerWidth().intValue();
	}
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.PARTIALDATE))
		return DEFAULT_PARTIALDATE_ANSWER_CELL_WIDTH;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.PICKLIST))
	{
		if(instAnswer != null)
			return instAnswer.getAnswerWidth() == null ? DEFAULT_PICKLIST_ANSWER_CELL_WIDTH : instAnswer.getAnswerWidth().intValue();
		
		return configAnswer.getAnswerWidth() == null ? DEFAULT_PICKLIST_ANSWER_CELL_WIDTH : configAnswer.getAnswerWidth().intValue();
	}
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.SEPARATOR))
		return DEFAULT_SEPARATOR_ANSWER_CELL_WIDTH;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.TEXT))
	{
		if(instAnswer != null)
			return instAnswer.getAnswerWidth() == null ? DEFAULT_TEXT_ANSWER_CELL_WIDTH : instAnswer.getAnswerWidth().intValue();
		
		return configAnswer.getAnswerWidth() == null ? DEFAULT_TEXT_ANSWER_CELL_WIDTH : configAnswer.getAnswerWidth().intValue();
	}
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.TIME))
		return DEFAULT_TIME_ANSWER_CELL_WIDTH;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.YESNO))
		return DEFAULT_YESNO_ANSWER_CELL_WIDTH;
	
	return DEFAULT_UNKNOWN_ANSWER_CELL_WIDTH;
}
 
Example 4
Project: openMAXIMS   File: Logic.java   View Source Code Vote up 4 votes
private int getCellAnswerWidth(QuestionAnswerTypeVo configAnswer, AnswerDetailsVo instAnswer)
{
	if (configAnswer == null || configAnswer.getAnswerType() == null)
		return 0;

	ims.core.vo.lookups.QuestionAnswerType answerType = configAnswer.getAnswerType();

	if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.DATE))
		return DEFAULT_DATE_ANSWER_CELL_WIDTH;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.DECIMAL))
		return DEFAULT_DECIMAL_ANSWER_CELL_WIDTH;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.INTEGER))
		return DEFAULT_INTEGER_ANSWER_CELL_WIDTH;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.MULTISELECT))
	{
		if (instAnswer != null)
			return instAnswer.getAnswerWidth() == null ? DEFAULT_MULTISELECT_ANSWER_CELL_WIDTH : instAnswer.getAnswerWidth().intValue();

		return configAnswer.getAnswerWidth() == null ? DEFAULT_MULTISELECT_ANSWER_CELL_WIDTH : configAnswer.getAnswerWidth().intValue();
	}
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.PARTIALDATE))
		return DEFAULT_PARTIALDATE_ANSWER_CELL_WIDTH;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.PICKLIST))
	{
		if (instAnswer != null)
			return instAnswer.getAnswerWidth() == null ? DEFAULT_PICKLIST_ANSWER_CELL_WIDTH : instAnswer.getAnswerWidth().intValue();

		return configAnswer.getAnswerWidth() == null ? DEFAULT_PICKLIST_ANSWER_CELL_WIDTH : configAnswer.getAnswerWidth().intValue();
	}
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.SEPARATOR))
		return DEFAULT_SEPARATOR_ANSWER_CELL_WIDTH;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.TEXT))
	{
		if (instAnswer != null)
			return instAnswer.getAnswerWidth() == null ? DEFAULT_TEXT_ANSWER_CELL_WIDTH : instAnswer.getAnswerWidth().intValue();

		return configAnswer.getAnswerWidth() == null ? DEFAULT_TEXT_ANSWER_CELL_WIDTH : configAnswer.getAnswerWidth().intValue();
	}
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.TIME))
		return DEFAULT_TIME_ANSWER_CELL_WIDTH;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.YESNO))
		return DEFAULT_YESNO_ANSWER_CELL_WIDTH;

	return DEFAULT_UNKNOWN_ANSWER_CELL_WIDTH;
}
 
Example 5
Project: openMAXIMS   File: UserAssessmentInstHelper.java   View Source Code Vote up 4 votes
private int getCellAnswerWidth(QuestionAnswerTypeVo configAnswer, AnswerDetailsVo instAnswer)
{
	if(configAnswer == null || configAnswer.getAnswerType() == null)
		return 0;
	
	ims.core.vo.lookups.QuestionAnswerType answerType = configAnswer.getAnswerType();
	
	if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.DATE))
		return DEFAULT_DATE_ANSWER_CELL_WIDTH;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.DECIMAL))
		return DEFAULT_DECIMAL_ANSWER_CELL_WIDTH;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.INTEGER))
		return DEFAULT_INTEGER_ANSWER_CELL_WIDTH;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.MULTISELECT))
	{
		int defaultMultiSelect = DEFAULT_MULTISELECT_ANSWER_CELL_WIDTH;
		if(isDPP)
			defaultMultiSelect = DEFAULT_MULTISELECT_ANSWER_CELL_WIDTH + 190;
		if(instAnswer != null)
			return instAnswer.getAnswerWidth() == null ? defaultMultiSelect : instAnswer.getAnswerWidth().intValue();
		
		return configAnswer.getAnswerWidth() == null ? defaultMultiSelect : configAnswer.getAnswerWidth().intValue();
	}
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.PARTIALDATE))
		return DEFAULT_PARTIALDATE_ANSWER_CELL_WIDTH;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.PICKLIST))
	{
		if(instAnswer != null)
			return instAnswer.getAnswerWidth() == null ? DEFAULT_PICKLIST_ANSWER_CELL_WIDTH : instAnswer.getAnswerWidth().intValue();
		
		return configAnswer.getAnswerWidth() == null ? DEFAULT_PICKLIST_ANSWER_CELL_WIDTH : configAnswer.getAnswerWidth().intValue();
	}
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.SEPARATOR))
		return DEFAULT_SEPARATOR_ANSWER_CELL_WIDTH;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.TEXT))
	{
		if(instAnswer != null)
			return instAnswer.getAnswerWidth() == null ? DEFAULT_TEXT_ANSWER_CELL_WIDTH : instAnswer.getAnswerWidth().intValue();
		
		return configAnswer.getAnswerWidth() == null ? DEFAULT_TEXT_ANSWER_CELL_WIDTH : configAnswer.getAnswerWidth().intValue();
	}
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.TIME))
		return DEFAULT_TIME_ANSWER_CELL_WIDTH;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.YESNO))
		return DEFAULT_YESNO_ANSWER_CELL_WIDTH;
	
	return DEFAULT_UNKNOWN_ANSWER_CELL_WIDTH;
}
 
Example 6
Project: openMAXIMS   File: MyOrderQuestionsPopulation.java   View Source Code Vote up 4 votes
private int getCellAnswerWidth(QuestionAnswerTypeVo configAnswer, AnswerDetailsVo instAnswer)
{
	if(configAnswer == null || configAnswer.getAnswerType() == null)
		return 0;
	
	ims.core.vo.lookups.QuestionAnswerType answerType = configAnswer.getAnswerType();
	
	if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.DATE))
		return DEFAULT_DATE_ANSWER_CELL_WIDTH;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.DECIMAL))
		return DEFAULT_DECIMAL_ANSWER_CELL_WIDTH;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.INTEGER))
		return DEFAULT_INTEGER_ANSWER_CELL_WIDTH;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.MULTISELECT))
	{
		int defaultMultiSelect = DEFAULT_MULTISELECT_ANSWER_CELL_WIDTH;
		if(instAnswer != null)
			return instAnswer.getAnswerWidth() == null ? defaultMultiSelect : instAnswer.getAnswerWidth().intValue();
		
		return configAnswer.getAnswerWidth() == null ? defaultMultiSelect : configAnswer.getAnswerWidth().intValue();
	}
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.PARTIALDATE))
		return DEFAULT_PARTIALDATE_ANSWER_CELL_WIDTH;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.PICKLIST))
	{
		if(instAnswer != null)
			return instAnswer.getAnswerWidth() == null ? DEFAULT_PICKLIST_ANSWER_CELL_WIDTH : instAnswer.getAnswerWidth().intValue();
		
		return configAnswer.getAnswerWidth() == null ? DEFAULT_PICKLIST_ANSWER_CELL_WIDTH : configAnswer.getAnswerWidth().intValue();
	}
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.SEPARATOR))
		return DEFAULT_SEPARATOR_ANSWER_CELL_WIDTH;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.TEXT))
	{
		if(instAnswer != null)
			return instAnswer.getAnswerWidth() == null ? DEFAULT_TEXT_ANSWER_CELL_WIDTH : instAnswer.getAnswerWidth().intValue();
		
		return configAnswer.getAnswerWidth() == null ? DEFAULT_TEXT_ANSWER_CELL_WIDTH : configAnswer.getAnswerWidth().intValue();
	}
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.TIME))
		return DEFAULT_TIME_ANSWER_CELL_WIDTH;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.YESNO))
		return DEFAULT_YESNO_ANSWER_CELL_WIDTH;
	
	return DEFAULT_UNKNOWN_ANSWER_CELL_WIDTH;
}
 
Example 7
Project: openMAXIMS   File: Logic.java   View Source Code Vote up 4 votes
private int getCellAnswerWidth(QuestionAnswerTypeVo configAnswer, AnswerDetailsVo instAnswer)
{
	if (configAnswer == null || configAnswer.getAnswerType() == null)
		return 0;

	ims.core.vo.lookups.QuestionAnswerType answerType = configAnswer.getAnswerType();

	if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.DATE))
		return DEFAULT_DATE_ANSWER_CELL_WIDTH;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.DECIMAL))
		return DEFAULT_DECIMAL_ANSWER_CELL_WIDTH;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.INTEGER))
		return DEFAULT_INTEGER_ANSWER_CELL_WIDTH;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.MULTISELECT))
	{
		int defaultMultiSelect = DEFAULT_MULTISELECT_ANSWER_CELL_WIDTH;
		if (instAnswer != null)
			return instAnswer.getAnswerWidth() == null ? defaultMultiSelect : instAnswer.getAnswerWidth().intValue();

		return configAnswer.getAnswerWidth() == null ? defaultMultiSelect : configAnswer.getAnswerWidth().intValue();
	}
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.PARTIALDATE))
		return DEFAULT_PARTIALDATE_ANSWER_CELL_WIDTH;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.PICKLIST))
	{
		if (instAnswer != null)
			return instAnswer.getAnswerWidth() == null ? DEFAULT_PICKLIST_ANSWER_CELL_WIDTH : instAnswer.getAnswerWidth().intValue();

		return configAnswer.getAnswerWidth() == null ? DEFAULT_PICKLIST_ANSWER_CELL_WIDTH : configAnswer.getAnswerWidth().intValue();
	}
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.SEPARATOR))
		return DEFAULT_SEPARATOR_ANSWER_CELL_WIDTH;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.TEXT))
	{
		if (instAnswer != null)
			return instAnswer.getAnswerWidth() == null ? DEFAULT_TEXT_ANSWER_CELL_WIDTH : instAnswer.getAnswerWidth().intValue();

		return configAnswer.getAnswerWidth() == null ? DEFAULT_TEXT_ANSWER_CELL_WIDTH : configAnswer.getAnswerWidth().intValue();
	}
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.TIME))
		return DEFAULT_TIME_ANSWER_CELL_WIDTH;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.YESNO))
		return DEFAULT_YESNO_ANSWER_CELL_WIDTH;

	return DEFAULT_UNKNOWN_ANSWER_CELL_WIDTH;
}
 
Example 8
Project: openMAXIMS   File: Logic.java   View Source Code Vote up 4 votes
private int getCellAnswerWidth(QuestionAnswerTypeVo configAnswer, AnswerDetailsVo instAnswer)
{
	if (configAnswer == null || configAnswer.getAnswerType() == null)
		return 0;

	ims.core.vo.lookups.QuestionAnswerType answerType = configAnswer.getAnswerType();

	if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.DATE))
		return DEFAULT_DATE_ANSWER_CELL_WIDTH;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.DECIMAL))
		return DEFAULT_DECIMAL_ANSWER_CELL_WIDTH;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.INTEGER))
		return DEFAULT_INTEGER_ANSWER_CELL_WIDTH;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.MULTISELECT))
	{
		if (instAnswer != null)
			return instAnswer.getAnswerWidth() == null ? DEFAULT_MULTISELECT_ANSWER_CELL_WIDTH : instAnswer.getAnswerWidth().intValue();

		return configAnswer.getAnswerWidth() == null ? DEFAULT_MULTISELECT_ANSWER_CELL_WIDTH : configAnswer.getAnswerWidth().intValue();
	}
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.PARTIALDATE))
		return DEFAULT_PARTIALDATE_ANSWER_CELL_WIDTH;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.PICKLIST))
	{
		if (instAnswer != null)
			return instAnswer.getAnswerWidth() == null ? DEFAULT_PICKLIST_ANSWER_CELL_WIDTH : instAnswer.getAnswerWidth().intValue();

		return configAnswer.getAnswerWidth() == null ? DEFAULT_PICKLIST_ANSWER_CELL_WIDTH : configAnswer.getAnswerWidth().intValue();
	}
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.SEPARATOR))
		return DEFAULT_SEPARATOR_ANSWER_CELL_WIDTH;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.TEXT))
	{
		if (instAnswer != null)
			return instAnswer.getAnswerWidth() == null ? DEFAULT_TEXT_ANSWER_CELL_WIDTH : instAnswer.getAnswerWidth().intValue();

		return configAnswer.getAnswerWidth() == null ? DEFAULT_TEXT_ANSWER_CELL_WIDTH : configAnswer.getAnswerWidth().intValue();
	}
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.TIME))
		return DEFAULT_TIME_ANSWER_CELL_WIDTH;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.YESNO))
		return DEFAULT_YESNO_ANSWER_CELL_WIDTH;

	return DEFAULT_UNKNOWN_ANSWER_CELL_WIDTH;
}
 
Example 9
Project: openMAXIMS   File: UserAssessmentInstHelper.java   View Source Code Vote up 4 votes
private int getCellAnswerWidth(QuestionAnswerTypeVo configAnswer, AnswerDetailsVo instAnswer)
{
	if(configAnswer == null || configAnswer.getAnswerType() == null)
		return 0;
	
	ims.core.vo.lookups.QuestionAnswerType answerType = configAnswer.getAnswerType();
	
	if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.DATE))
		return DEFAULT_DATE_ANSWER_CELL_WIDTH;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.DECIMAL))
		return DEFAULT_DECIMAL_ANSWER_CELL_WIDTH;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.INTEGER))
		return DEFAULT_INTEGER_ANSWER_CELL_WIDTH;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.MULTISELECT))
	{
		int defaultMultiSelect = DEFAULT_MULTISELECT_ANSWER_CELL_WIDTH;
		if(isDPP)
			defaultMultiSelect = DEFAULT_MULTISELECT_ANSWER_CELL_WIDTH + 190;
		if(instAnswer != null)
			return instAnswer.getAnswerWidth() == null ? defaultMultiSelect : instAnswer.getAnswerWidth().intValue();
		
		return configAnswer.getAnswerWidth() == null ? defaultMultiSelect : configAnswer.getAnswerWidth().intValue();
	}
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.PARTIALDATE))
		return DEFAULT_PARTIALDATE_ANSWER_CELL_WIDTH;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.PICKLIST))
	{
		if(instAnswer != null)
			return instAnswer.getAnswerWidth() == null ? DEFAULT_PICKLIST_ANSWER_CELL_WIDTH : instAnswer.getAnswerWidth().intValue();
		
		return configAnswer.getAnswerWidth() == null ? DEFAULT_PICKLIST_ANSWER_CELL_WIDTH : configAnswer.getAnswerWidth().intValue();
	}
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.SEPARATOR))
		return DEFAULT_SEPARATOR_ANSWER_CELL_WIDTH;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.TEXT))
	{
		if(instAnswer != null)
			return instAnswer.getAnswerWidth() == null ? DEFAULT_TEXT_ANSWER_CELL_WIDTH : instAnswer.getAnswerWidth().intValue();
		
		return configAnswer.getAnswerWidth() == null ? DEFAULT_TEXT_ANSWER_CELL_WIDTH : configAnswer.getAnswerWidth().intValue();
	}
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.TIME))
		return DEFAULT_TIME_ANSWER_CELL_WIDTH;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.YESNO))
		return DEFAULT_YESNO_ANSWER_CELL_WIDTH;
	
	return DEFAULT_UNKNOWN_ANSWER_CELL_WIDTH;
}
 
Example 10
Project: openMAXIMS   File: MyOrderQuestionsPopulation.java   View Source Code Vote up 4 votes
private int getCellAnswerWidth(QuestionAnswerTypeVo configAnswer, AnswerDetailsVo instAnswer)
{
	if(configAnswer == null || configAnswer.getAnswerType() == null)
		return 0;
	
	ims.core.vo.lookups.QuestionAnswerType answerType = configAnswer.getAnswerType();
	
	if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.DATE))
		return DEFAULT_DATE_ANSWER_CELL_WIDTH;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.DECIMAL))
		return DEFAULT_DECIMAL_ANSWER_CELL_WIDTH;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.INTEGER))
		return DEFAULT_INTEGER_ANSWER_CELL_WIDTH;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.MULTISELECT))
	{
		int defaultMultiSelect = DEFAULT_MULTISELECT_ANSWER_CELL_WIDTH;
		if(instAnswer != null)
			return instAnswer.getAnswerWidth() == null ? defaultMultiSelect : instAnswer.getAnswerWidth().intValue();
		
		return configAnswer.getAnswerWidth() == null ? defaultMultiSelect : configAnswer.getAnswerWidth().intValue();
	}
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.PARTIALDATE))
		return DEFAULT_PARTIALDATE_ANSWER_CELL_WIDTH;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.PICKLIST))
	{
		if(instAnswer != null)
			return instAnswer.getAnswerWidth() == null ? DEFAULT_PICKLIST_ANSWER_CELL_WIDTH : instAnswer.getAnswerWidth().intValue();
		
		return configAnswer.getAnswerWidth() == null ? DEFAULT_PICKLIST_ANSWER_CELL_WIDTH : configAnswer.getAnswerWidth().intValue();
	}
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.SEPARATOR))
		return DEFAULT_SEPARATOR_ANSWER_CELL_WIDTH;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.TEXT))
	{
		if(instAnswer != null)
			return instAnswer.getAnswerWidth() == null ? DEFAULT_TEXT_ANSWER_CELL_WIDTH : instAnswer.getAnswerWidth().intValue();
		
		return configAnswer.getAnswerWidth() == null ? DEFAULT_TEXT_ANSWER_CELL_WIDTH : configAnswer.getAnswerWidth().intValue();
	}
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.TIME))
		return DEFAULT_TIME_ANSWER_CELL_WIDTH;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.YESNO))
		return DEFAULT_YESNO_ANSWER_CELL_WIDTH;
	
	return DEFAULT_UNKNOWN_ANSWER_CELL_WIDTH;
}
 
Example 11
Project: openmaxims-linux   File: Logic.java   View Source Code Vote up 4 votes
private int getCellAnswerWidth(QuestionAnswerTypeVo configAnswer, AnswerDetailsVo instAnswer)
{
	if (configAnswer == null || configAnswer.getAnswerType() == null)
		return 0;

	ims.core.vo.lookups.QuestionAnswerType answerType = configAnswer.getAnswerType();

	if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.DATE))
		return DEFAULT_DATE_ANSWER_CELL_WIDTH;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.DECIMAL))
		return DEFAULT_DECIMAL_ANSWER_CELL_WIDTH;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.INTEGER))
		return DEFAULT_INTEGER_ANSWER_CELL_WIDTH;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.MULTISELECT))
	{
		if (instAnswer != null)
			return instAnswer.getAnswerWidth() == null ? DEFAULT_MULTISELECT_ANSWER_CELL_WIDTH : instAnswer.getAnswerWidth().intValue();

		return configAnswer.getAnswerWidth() == null ? DEFAULT_MULTISELECT_ANSWER_CELL_WIDTH : configAnswer.getAnswerWidth().intValue();
	}
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.PARTIALDATE))
		return DEFAULT_PARTIALDATE_ANSWER_CELL_WIDTH;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.PICKLIST))
	{
		if (instAnswer != null)
			return instAnswer.getAnswerWidth() == null ? DEFAULT_PICKLIST_ANSWER_CELL_WIDTH : instAnswer.getAnswerWidth().intValue();

		return configAnswer.getAnswerWidth() == null ? DEFAULT_PICKLIST_ANSWER_CELL_WIDTH : configAnswer.getAnswerWidth().intValue();
	}
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.SEPARATOR))
		return DEFAULT_SEPARATOR_ANSWER_CELL_WIDTH;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.TEXT))
	{
		if (instAnswer != null)
			return instAnswer.getAnswerWidth() == null ? DEFAULT_TEXT_ANSWER_CELL_WIDTH : instAnswer.getAnswerWidth().intValue();

		return configAnswer.getAnswerWidth() == null ? DEFAULT_TEXT_ANSWER_CELL_WIDTH : configAnswer.getAnswerWidth().intValue();
	}
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.TIME))
		return DEFAULT_TIME_ANSWER_CELL_WIDTH;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.YESNO))
		return DEFAULT_YESNO_ANSWER_CELL_WIDTH;

	return DEFAULT_UNKNOWN_ANSWER_CELL_WIDTH;
}
 
Example 12
Project: openmaxims-linux   File: UserAssessmentInstHelper.java   View Source Code Vote up 4 votes
private int getCellAnswerWidth(QuestionAnswerTypeVo configAnswer, AnswerDetailsVo instAnswer)
{
	if(configAnswer == null || configAnswer.getAnswerType() == null)
		return 0;
	
	ims.core.vo.lookups.QuestionAnswerType answerType = configAnswer.getAnswerType();
	
	if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.DATE))
		return DEFAULT_DATE_ANSWER_CELL_WIDTH;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.DECIMAL))
		return DEFAULT_DECIMAL_ANSWER_CELL_WIDTH;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.INTEGER))
		return DEFAULT_INTEGER_ANSWER_CELL_WIDTH;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.MULTISELECT))
	{
		int defaultMultiSelect = DEFAULT_MULTISELECT_ANSWER_CELL_WIDTH;
		if(isDPP)
			defaultMultiSelect = DEFAULT_MULTISELECT_ANSWER_CELL_WIDTH + 190;
		if(instAnswer != null)
			return instAnswer.getAnswerWidth() == null ? defaultMultiSelect : instAnswer.getAnswerWidth().intValue();
		
		return configAnswer.getAnswerWidth() == null ? defaultMultiSelect : configAnswer.getAnswerWidth().intValue();
	}
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.PARTIALDATE))
		return DEFAULT_PARTIALDATE_ANSWER_CELL_WIDTH;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.PICKLIST))
	{
		if(instAnswer != null)
			return instAnswer.getAnswerWidth() == null ? DEFAULT_PICKLIST_ANSWER_CELL_WIDTH : instAnswer.getAnswerWidth().intValue();
		
		return configAnswer.getAnswerWidth() == null ? DEFAULT_PICKLIST_ANSWER_CELL_WIDTH : configAnswer.getAnswerWidth().intValue();
	}
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.SEPARATOR))
		return DEFAULT_SEPARATOR_ANSWER_CELL_WIDTH;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.TEXT))
	{
		if(instAnswer != null)
			return instAnswer.getAnswerWidth() == null ? DEFAULT_TEXT_ANSWER_CELL_WIDTH : instAnswer.getAnswerWidth().intValue();
		
		return configAnswer.getAnswerWidth() == null ? DEFAULT_TEXT_ANSWER_CELL_WIDTH : configAnswer.getAnswerWidth().intValue();
	}
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.TIME))
		return DEFAULT_TIME_ANSWER_CELL_WIDTH;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.YESNO))
		return DEFAULT_YESNO_ANSWER_CELL_WIDTH;
	
	return DEFAULT_UNKNOWN_ANSWER_CELL_WIDTH;
}
 
Example 13
Project: openmaxims-linux   File: MyOrderQuestionsPopulation.java   View Source Code Vote up 4 votes
private int getCellAnswerWidth(QuestionAnswerTypeVo configAnswer, AnswerDetailsVo instAnswer)
{
	if(configAnswer == null || configAnswer.getAnswerType() == null)
		return 0;
	
	ims.core.vo.lookups.QuestionAnswerType answerType = configAnswer.getAnswerType();
	
	if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.DATE))
		return DEFAULT_DATE_ANSWER_CELL_WIDTH;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.DECIMAL))
		return DEFAULT_DECIMAL_ANSWER_CELL_WIDTH;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.INTEGER))
		return DEFAULT_INTEGER_ANSWER_CELL_WIDTH;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.MULTISELECT))
	{
		int defaultMultiSelect = DEFAULT_MULTISELECT_ANSWER_CELL_WIDTH;
		if(instAnswer != null)
			return instAnswer.getAnswerWidth() == null ? defaultMultiSelect : instAnswer.getAnswerWidth().intValue();
		
		return configAnswer.getAnswerWidth() == null ? defaultMultiSelect : configAnswer.getAnswerWidth().intValue();
	}
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.PARTIALDATE))
		return DEFAULT_PARTIALDATE_ANSWER_CELL_WIDTH;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.PICKLIST))
	{
		if(instAnswer != null)
			return instAnswer.getAnswerWidth() == null ? DEFAULT_PICKLIST_ANSWER_CELL_WIDTH : instAnswer.getAnswerWidth().intValue();
		
		return configAnswer.getAnswerWidth() == null ? DEFAULT_PICKLIST_ANSWER_CELL_WIDTH : configAnswer.getAnswerWidth().intValue();
	}
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.SEPARATOR))
		return DEFAULT_SEPARATOR_ANSWER_CELL_WIDTH;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.TEXT))
	{
		if(instAnswer != null)
			return instAnswer.getAnswerWidth() == null ? DEFAULT_TEXT_ANSWER_CELL_WIDTH : instAnswer.getAnswerWidth().intValue();
		
		return configAnswer.getAnswerWidth() == null ? DEFAULT_TEXT_ANSWER_CELL_WIDTH : configAnswer.getAnswerWidth().intValue();
	}
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.TIME))
		return DEFAULT_TIME_ANSWER_CELL_WIDTH;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.YESNO))
		return DEFAULT_YESNO_ANSWER_CELL_WIDTH;
	
	return DEFAULT_UNKNOWN_ANSWER_CELL_WIDTH;
}