Java Code Examples for ims.framework.enumerations.DynamicCellType.STRING

The following are Jave code examples for showing how to use STRING of the ims.framework.enumerations.DynamicCellType class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 5 votes
private void updateClinicAssociationRowValue(DynamicGridRow row)
{
	if (row == null
		|| (row.getParent() == null)
		|| (!(row.getParent().getValue() instanceof AssociationCategory))
		|| (((AssociationCategory) row.getParent().getValue()) != AssociationCategory.CLINICS))
		throw new CodingRuntimeException("Major Logical Failure");
	
	if (row.getValue() == null)
		row.setValue(new ClinicLiteVo());
	
	if (!(row.getValue() instanceof ClinicLiteVo))
		throw new CodingRuntimeException("Major Logical Error - Clinic value expected");
	

	DynamicGridColumn column;
	DynamicGridCell cell;
	
	// Get the second cell value
	column = form.dyngrdAssociations().getColumns().getByIdentifier(COL_ASSOCIATION);
	cell = row.getCells().get(column);
	
	if (cell.getType() != DynamicCellType.STRING)
	{
		if (cell.getValue() == null)
		{
			row.setValue(null);
			cell.setTypedText(null);
		}
		else
			row.setValue((ClinicLiteVo) cell.getValue());
	}
}
 
Example 2
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 5 votes
private void updateConsultantAssociationRowValue(DynamicGridRow row)
{
	if (row == null
		|| row.getParent() == null
		|| (!(row.getParent().getValue() instanceof AssociationCategory))
		|| (((AssociationCategory) row.getParent().getValue()) != AssociationCategory.CONSULTANTS))
		throw new CodingRuntimeException("Major Logical Failure");
	
	if (row.getValue() == null)
		row.setValue(new MedicLiteVo());
	
	if (!(row.getValue() instanceof MedicLiteVo))
		throw new CodingRuntimeException("Major Logical Error - Consultant value expected");
	
	
	DynamicGridColumn column;
	DynamicGridCell cell;
	
	// Get the second cell value
	column = form.dyngrdAssociations().getColumns().getByIdentifier(COL_ASSOCIATION);
	cell = row.getCells().get(column);
	
	if (cell.getType() != DynamicCellType.STRING)
	{
		if (cell.getValue() == null)
		{
			row.setValue(null);
			cell.setTypedText(null);
		}
		else
		{
			row.setValue((MedicLiteVo) cell.getValue());
		}
	}
}
 
Example 3
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 5 votes
private void updateSpecialtyAssociationRowValue(DynamicGridRow row)
{
	if (row == null
		|| row.getParent() == null
		|| (!(row.getParent().getValue() instanceof AssociationCategory))
		|| (((AssociationCategory) row.getParent().getValue()) != AssociationCategory.SPECIALTY))
		throw new CodingRuntimeException("Mojor Logical Failure");
	
	if (row.getValue() == null)
		row.setValue(new Specialty());
	
	if (!(row.getValue() instanceof Specialty))
		throw new CodingRuntimeException("Major Logical Error - Specialty value expected");
	
	
	DynamicGridColumn column;
	DynamicGridCell cell;
	
	// Get the second cell value
	column = form.dyngrdAssociations().getColumns().getByIdentifier(COL_ASSOCIATION);
	cell = row.getCells().get(column);
	
	if (cell.getType() != DynamicCellType.STRING)
	{
		if (cell.getValue() == null)
		{
			row.setValue(null);
			cell.setTypedText(null);
		}
		else
		{
			row.setValue((Specialty) cell.getValue());
		}
	}
}
 
Example 4
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 5 votes
private void updateClinicAccessRowValue(DynamicGridRow row)
{
	DynamicGridColumn column;
	DynamicGridCell cell;
	
	if (row == null || (row.getParent() == null) || (!(row.getParent().getValue() instanceof AccessCategory)) || (((AccessCategory)row.getParent().getValue()) != AccessCategory.CLINICS))
		throw new CodingRuntimeException("Major Logical Error");
	
	if (row.getValue() == null)
		row.setValue(new ClinicAccessVo());
	
	if (!(row.getValue() instanceof ClinicAccessVo))
		throw new CodingRuntimeException("BUG");
	

	// Get second cell value
	column = form.dyngrdDetails().getColumns().getByIdentifier(COL_ACCESS_CATEGORY);
	cell = row.getCells().get(column);
	if (cell.getType() != DynamicCellType.STRING)
	{
		if (cell.getValue() == null)
		{
			((ClinicAccessVo) row.getValue()).setClinic(null);
			cell.setTypedText(null);
		}
		else
		{
			((ClinicAccessVo) row.getValue()).setClinic((ClinicLiteVo) cell.getValue());
		}
	}
	
	// Get third cell value
	column = form.dyngrdDetails().getColumns().getByIdentifier(COL_ACCESSRIGHTS);
	cell = row.getCells().get(column);
	cell.getValue();
	((ClinicAccessVo) row.getValue()).setAccessRight((Access) cell.getValue());
}
 
Example 5
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 5 votes
private void updateConsultantAccessRowValue(DynamicGridRow row)
{
	if (row == null || (row.getParent() == null) || (!(row.getParent().getValue() instanceof AccessCategory)) || (((AccessCategory)row.getParent().getValue()) != AccessCategory.CONSULTANTS))
		throw new CodingRuntimeException("Major Logical Problem");
	
	if (row.getValue() == null)
		row.setValue(new ConsultantAccessVo());
	
	if (!(row.getValue() instanceof ConsultantAccessVo))
		throw new CodingRuntimeException("BUG");


	DynamicGridColumn column;
	DynamicGridCell cell;
	
	// Get second cell value
	column = form.dyngrdDetails().getColumns().getByIdentifier(COL_ACCESS_CATEGORY);
	cell = row.getCells().get(column);
	if (cell.getType() != DynamicCellType.STRING)
	{
		if (cell.getValue() == null)
		{
			((ConsultantAccessVo) row.getValue()).setConsultant(null);
			cell.setTypedText(null);
		}
		else
		{
			((ConsultantAccessVo) row.getValue()).setConsultant((MedicLiteVo) cell.getValue());
		}
	}
	
	// Get third cell value
	column = form.dyngrdDetails().getColumns().getByIdentifier(COL_ACCESSRIGHTS);
	cell = row.getCells().get(column);
	((ConsultantAccessVo) row.getValue()).setAccessRight((Access) cell.getValue());
}
 
Example 6
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 5 votes
private void updateSpecialtyAccessRowValue(DynamicGridRow row)
{
	DynamicGridColumn column;
	DynamicGridCell cell;
	
	if (row == null || (row.getParent() == null) || (!(row.getParent().getValue() instanceof AccessCategory)) || (((AccessCategory)row.getParent().getValue()) != AccessCategory.SPECIALTY))
		throw new CodingRuntimeException("Major Logical Problem");
	
	if (row.getValue() == null)
		row.setValue(new SpecialtyAccessVo());
	
	if (!(row.getValue() instanceof SpecialtyAccessVo))
		throw new CodingRuntimeException("BUG");

	
	// Get second cell value
	column = form.dyngrdDetails().getColumns().getByIdentifier(COL_ACCESS_CATEGORY);
	cell = row.getCells().get(column);
	if (cell.getType() != DynamicCellType.STRING)
	{
		if (cell.getValue() == null)
		{
			cell.setTypedText(null);
			((SpecialtyAccessVo) row.getValue()).setSpecialty(null);
		}
		else
		{
			((SpecialtyAccessVo) row.getValue()).setSpecialty((Specialty) cell.getValue());
		}
	}
	
	// Get third cell value
	column = form.dyngrdDetails().getColumns().getByIdentifier(COL_ACCESSRIGHTS);
	cell = row.getCells().get(column);
	((SpecialtyAccessVo) row.getValue()).setAccessRight((Access) cell.getValue());
}
 
Example 7
Project: AvoinApotti   File: ReportSeedsHelper.java   Source Code and License Vote up 5 votes
public DynamicCellType getCellType(ReportSeedParsedVo voReportSeed)
{
	if (voReportSeed == null)
		return DynamicCellType.LABEL;

	String dataType = voReportSeed.getType();
	if (dataType == null)
		return DynamicCellType.LABEL;

	if (dataType.equals(INTEGER) || dataType.equals(BIG_INTEGER) || dataType.equals(SHORT) || dataType.equals(LONG))
	{
		DynamicCellType defaultType = DynamicCellType.INT;

		if (dataType.equals(INTEGER))
			defaultType = getBoReportType(voReportSeed);

		return defaultType;
	}

	if (dataType.equals(BOOOLEAN))
		return DynamicCellType.BOOL;

	if (dataType.equals(STRING))
		return DynamicCellType.STRING;

	if (dataType.equals(BIG_DECIMAL) || dataType.equals(FLOAT) || dataType.equals(DOUBLE))
		return DynamicCellType.DECIMAL;

	if (dataType.equals(SQL_DATE))
		return DynamicCellType.DATE;

	if (dataType.equals(UTIL_DATE))
		return DynamicCellType.DATETIME;
	
	if (dataType.equals(SQL_TIME))
		return DynamicCellType.TIME;

	return DynamicCellType.LABEL;
}
 
Example 8
Project: AvoinApotti   File: MyOrderQuestionsPopulation.java   Source Code and License Vote up 5 votes
private void setCellAnswerTooltip(DynamicGridCell cell, AnswerDetailsVo answer)
{
	if(cell == null || answer == null)
		return;
	
	else if(cell.getType() == DynamicCellType.COMMENT)
	{
		cell.setTooltip(answer.getStringAnswer());
	}
	else if(cell.getType() == DynamicCellType.DATE && answer.getDateAnswer() != null)
	{
		cell.setTooltip(answer.getDateAnswer().toString());
	}
	else if(cell.getType() == DynamicCellType.PARTIALDATE && answer.getPartialDate() != null)
	{
		cell.setTooltip(answer.getPartialDate().toString());
	}
	else if(cell.getType() == DynamicCellType.DECIMAL && answer.getDecimalAnswer() != null)
	{
		cell.setTooltip(answer.getDecimalAnswer().toString());
	}
	else if(cell.getType() == DynamicCellType.INT && answer.getIntegerAnswer() != null)
	{
		cell.setTooltip(answer.getIntegerAnswer().toString());
	}
	else if(cell.getType() == DynamicCellType.STRING)
	{
		cell.setTooltip(answer.getStringAnswer());
	}
	else if(cell.getType() == DynamicCellType.TIME && answer.getTimeAnswer() != null)
	{
		cell.setTooltip(answer.getTimeAnswer().toString());
	}
	else if(cell.getType() == DynamicCellType.WRAPTEXT)
	{
		cell.setTooltip(answer.getStringAnswer());
	}
	
}
 
Example 9
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 4 votes
private void setCellAnswer(DynamicGridCell cell, Answer_DetailsVo answer)
{
	if (cell == null)
		return;
	if (answer == null)
		return;
	Question_AnswerTypeVo answerType = null;
	if (cell.getIdentifier() instanceof Question_AnswerTypeVo)
		answerType = (Question_AnswerTypeVo) cell.getIdentifier();
	else if (cell.getIdentifier() instanceof Answer_CellData)
		answerType = ((Answer_CellData) cell.getIdentifier()).getConfigData();

	cell.setIdentifier(new Answer_CellData(answerType, answer));

	if (cell.getType() == DynamicCellType.ANSWER)
	{
		if (answer.getBoolValueAnswerIsNotNull())
			cell.setValue(answer.getBoolValueAnswer().booleanValue() ? this.optionYes : this.optionNo);
		else
			cell.setValue(null);
	}
	else if (cell.getType() == DynamicCellType.COMMENT)
	{
		cell.setValue(answer.getStringAnswer());
	}
	else if (cell.getType() == DynamicCellType.DATE)
	{
		cell.setValue(answer.getDateAnswer());
	}
	else if (cell.getType() == DynamicCellType.PARTIALDATE)
	{
		cell.setValue(answer.getPartialDate());
	}
	else if (cell.getType() == DynamicCellType.DECIMAL)
	{
		cell.setValue(answer.getDecimalAnswer());
	}
	else if (cell.getType() == DynamicCellType.ENUMERATION)
	{
		cell.setValue(answer.getPicklist());
	}
	else if (cell.getType() == DynamicCellType.INT)
	{
		cell.setValue(answer.getIntegerAnswer());
	}
	else if (cell.getType() == DynamicCellType.STRING)
	{
		cell.setValue(answer.getStringAnswer());
	}
	else if (cell.getType() == DynamicCellType.TIME)
	{
		cell.setValue(answer.getTimeAnswer());
	}
	else if (cell.getType() == DynamicCellType.WRAPTEXT)
	{
		cell.setValue(answer.getStringAnswer());
	}
	else if (cell.getType() == DynamicCellType.MULTISELECT)
	{
		setCellMultiAnswer(cell, answer.getMultiSelectAnswers());
	}
}
 
Example 10
Project: AvoinApotti   File: UserAssessmentInstHelper.java   Source Code and License Vote up 4 votes
private void setCellAnswer(DynamicGridCell cell, Answer_DetailsVo answer)
{
	if (cell == null)
		return;
	if (answer == null)
		return;

	Question_AnswerTypeVo answerType = null;

	if (cell.getIdentifier() instanceof Question_AnswerTypeVo)
		answerType = (Question_AnswerTypeVo) cell.getIdentifier();
	else if (cell.getIdentifier() instanceof AnswerCellData)
		answerType = ((Answer_CellData) cell.getIdentifier()).getConfigData();

	cell.setIdentifier(new Answer_CellData(answerType, answer));
	
	if(cell.getType() == DynamicCellType.ANSWER)
	{
		if(answer.getBoolValueAnswerIsNotNull())
			cell.setValue(answer.getBoolValueAnswer().booleanValue() ? this.optionYes : this.optionNo);
		else
			cell.setValue(null);
	}
	else if(cell.getType() == DynamicCellType.COMMENT)
	{
		cell.setValue(answer.getStringAnswer());
	}
	else if(cell.getType() == DynamicCellType.DATE)
	{
		cell.setValue(answer.getDateAnswer());
	}
	else if(cell.getType() == DynamicCellType.PARTIALDATE)
	{
		cell.setValue(answer.getPartialDate());
	}
	else if(cell.getType() == DynamicCellType.DECIMAL)
	{
		cell.setValue(answer.getDecimalAnswer());
	}
	else if(cell.getType() == DynamicCellType.ENUMERATION)
	{
		cell.setValue(answer.getPicklist());			
	}
	else if(cell.getType() == DynamicCellType.INT)
	{
		cell.setValue(answer.getIntegerAnswer());
	}
	else if(cell.getType() == DynamicCellType.STRING)
	{
		cell.setValue(answer.getStringAnswer());
	}
	else if(cell.getType() == DynamicCellType.TIME)
	{
		cell.setValue(answer.getTimeAnswer());
	}
	else if(cell.getType() == DynamicCellType.WRAPTEXT)
	{
		cell.setValue(answer.getStringAnswer());
	}
	else if(cell.getType() == DynamicCellType.MULTISELECT)
	{			
		setCellMultiAnswer(cell, answer.getMultiSelectAnswers());
	}
}
 
Example 11
Project: AvoinApotti   File: MyOrderQuestionsPopulation.java   Source Code and License Vote up 4 votes
public void setCellAnswer(DynamicGridCell cell, AnswerDetailsVo answer)
{
	if(cell == null)
		return;
	if(answer == null)
		return;
	
	if(cell.getType() == DynamicCellType.ANSWER)
	{
		if(answer.getBoolValueAnswerIsNotNull())
			cell.setValue(answer.getBoolValueAnswer().booleanValue() ? this.optionYes : this.optionNo);
		else
			cell.setValue(null);
	}
	else if(cell.getType() == DynamicCellType.COMMENT)
	{
		cell.setValue(answer.getStringAnswer());
	}
	else if(cell.getType() == DynamicCellType.DATE)
	{
		cell.setValue(answer.getDateAnswer());
	}
	else if(cell.getType() == DynamicCellType.PARTIALDATE)
	{
		cell.setValue(answer.getPartialDate());
	}
	else if(cell.getType() == DynamicCellType.DECIMAL)
	{
		cell.setValue(answer.getDecimalAnswer());
	}
	else if(cell.getType() == DynamicCellType.ENUMERATION)
	{
		cell.setValue(answer.getPicklist());			
	}
	else if(cell.getType() == DynamicCellType.INT)
	{
		cell.setValue(answer.getIntegerAnswer());
	}
	else if(cell.getType() == DynamicCellType.STRING)
	{
		cell.setValue(answer.getStringAnswer());
	}
	else if(cell.getType() == DynamicCellType.TIME)
	{
		cell.setValue(answer.getTimeAnswer());
	}
	else if(cell.getType() == DynamicCellType.WRAPTEXT)
	{
		cell.setValue(answer.getStringAnswer());
	}
	else if(cell.getType() == DynamicCellType.MULTISELECT)
	{			
		setCellMultiAnswer(cell, answer.getMultiSelectAnswers());
	}
}