Java Code Examples for ims.framework.controls.DynamicGridCell.setTextColor()

The following are Jave code examples for showing how to use setTextColor() of the ims.framework.controls.DynamicGridCell 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: MyOrderQuestionsPopulation.java   View Source Code Vote up 6 votes
private void setAnswerCellValue(DynamicGridCell cell, QuestionAnswerTypeVo configAnswer) 
{
	if(configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.SEPARATOR))
	{
		cell.setTextColor(DEFAULT_SEPARATOR_CELL_TEXT_COLOR);
		cell.setValue(" " + (configAnswer.getSeparatorTextIsNotNull() ? configAnswer.getSeparatorText() : "") + " ");
	}
	else if(configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.YESNO))
	{
		cell.getItems().clear();
		cell.getItems().newItem(this.optionYes);
		cell.getItems().newItem(this.optionNo);
	}
	else if(configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.PICKLIST))
	{
		setAnswerCellOptions(configAnswer, cell);
	}
	else if(configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.MULTISELECT))				
	{
		setAnswerCellOptions(configAnswer, cell);
		if(configAnswer.getMaxMultiselectAllowedIsNotNull())
		{
			cell.setMaxCheckedItemsForMultiSelect(configAnswer.getMaxMultiselectAllowed());
		}								
	}
}
 
Example 2
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private void setAnswerCellValue(DynamicGridCell cell, QuestionAnswerTypeVo configAnswer, AnswerDetailsVo instAnswer)
{
	if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.SEPARATOR))
	{
		cell.setTextColor(DEFAULT_SEPARATOR_CELL_TEXT_COLOR);
		cell.setValue(" " + (configAnswer.getSeparatorTextIsNotNull() ? configAnswer.getSeparatorText() : "") + " ");
	}
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.YESNO))
	{
		cell.getItems().clear();
		cell.getItems().newItem(this.optionYes, this.optionYes.getIItemImage());
		cell.getItems().newItem(this.optionNo, this.optionNo.getIItemImage());
	}
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.PICKLIST))
	{
		setAnswerCellOptions(configAnswer, cell);
	}
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.MULTISELECT))
	{
		setAnswerCellOptions(configAnswer, cell, instAnswer);

		if (instAnswer != null)
		{
			if (instAnswer.getMaxMultiselectAllowedIsNotNull())
			{
				cell.setMaxCheckedItemsForMultiSelect(instAnswer.getMaxMultiselectAllowed());
			}
		}
		else
		{
			if (configAnswer.getMaxMultiselectAllowedIsNotNull())
			{
				cell.setMaxCheckedItemsForMultiSelect(configAnswer.getMaxMultiselectAllowed());
			}
		}
	}
}
 
Example 3
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private void setAnswerCellValue(DynamicGridCell cell, Question_AnswerTypeVo configAnswer, Answer_DetailsVo instAnswer)
{
	if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.SEPARATOR))
	{
		cell.setTextColor(DEFAULT_SEPARATOR_CELL_TEXT_COLOR);
		cell.setValue(" " + (configAnswer.getSeparatorTextIsNotNull() ? configAnswer.getSeparatorText() : "") + " ");
	}
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.YESNO))
	{
		cell.getItems().clear();
		cell.getItems().newItem(this.optionYes, this.optionYes.getIItemImage());
		cell.getItems().newItem(this.optionNo, this.optionNo.getIItemImage());
	}
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.PICKLIST))
	{
		setAnswerCellOptions(configAnswer, cell);
	}
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.MULTISELECT))
	{
		setAnswerCellOptions(configAnswer, cell, instAnswer);

		if (instAnswer != null)
		{
			if (instAnswer.getMaxMultiselectAllowedIsNotNull())
			{
				cell.setMaxCheckedItemsForMultiSelect(instAnswer.getMaxMultiselectAllowed());
			}
		}
		else
		{
			if (configAnswer.getMaxMultiselectAllowedIsNotNull())
			{
				cell.setMaxCheckedItemsForMultiSelect(configAnswer.getMaxMultiselectAllowed());
			}
		}
	}
}
 
Example 4
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View Source Code Vote up 5 votes
private void setAnswerCellValue(DynamicGridCell cell, QuestionAnswerTypeVo configAnswer, AnswerDetailsVo instAnswer) 
{
	if(configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.SEPARATOR))
	{
		cell.setTextColor(DEFAULT_SEPARATOR_CELL_TEXT_COLOR);
		cell.setValue(" " + (configAnswer.getSeparatorTextIsNotNull() ? configAnswer.getSeparatorText() : "") + " ");
	}
	else if(configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.YESNO))
	{
		cell.getItems().clear();
		cell.getItems().newItem(this.optionYes, this.optionYes.getIItemImage());
		cell.getItems().newItem(this.optionNo, this.optionNo.getIItemImage());
	}
	else if(configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.PICKLIST))
	{
		setAnswerCellOptions(configAnswer, cell);
	}
	else if(configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.MULTISELECT))				
	{
		setAnswerCellOptions(configAnswer, cell, instAnswer);
		
		if(instAnswer != null)
		{
			if(instAnswer.getMaxMultiselectAllowedIsNotNull())
			{
				cell.setMaxCheckedItemsForMultiSelect(instAnswer.getMaxMultiselectAllowed());						
			}
		}
		else
		{
			if(configAnswer.getMaxMultiselectAllowedIsNotNull())
			{
				cell.setMaxCheckedItemsForMultiSelect(configAnswer.getMaxMultiselectAllowed());
			}
		}							
	}
}
 
Example 5
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View Source Code Vote up 5 votes
private void setAnswerCellValue(DynamicGridCell cell, Question_AnswerTypeVo configAnswer, Answer_DetailsVo instAnswer) 
{
	if(configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.SEPARATOR))
	{
		cell.setTextColor(DEFAULT_SEPARATOR_CELL_TEXT_COLOR);
		cell.setValue(" " + (configAnswer.getSeparatorTextIsNotNull() ? configAnswer.getSeparatorText() : "") + " ");
	}
	else if(configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.YESNO))
	{
		cell.getItems().clear();
		cell.getItems().newItem(this.optionYes, this.optionYes.getIItemImage());
		cell.getItems().newItem(this.optionNo, this.optionNo.getIItemImage());
	}
	else if(configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.PICKLIST))
	{
		setAnswerCellOptions(configAnswer, cell);
	}
	else if(configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.MULTISELECT))				
	{
		setAnswerCellOptions(configAnswer, cell, instAnswer);
		
		if(instAnswer != null)
		{
			if(instAnswer.getMaxMultiselectAllowedIsNotNull())
			{
				cell.setMaxCheckedItemsForMultiSelect(instAnswer.getMaxMultiselectAllowed());						
			}
		}
		else
		{
			if(configAnswer.getMaxMultiselectAllowedIsNotNull())
			{
				cell.setMaxCheckedItemsForMultiSelect(configAnswer.getMaxMultiselectAllowed());
			}
		}							
	}
}
 
Example 6
Project: AvoinApotti   File: MyOrderQuestionsPopulation.java   View Source Code Vote up 5 votes
private void setAnswerCellValue(DynamicGridCell cell, QuestionAnswerTypeVo configAnswer, AnswerDetailsVo instAnswer) 
{
	if(configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.SEPARATOR))
	{
		cell.setTextColor(DEFAULT_SEPARATOR_CELL_TEXT_COLOR);
		cell.setValue(" " + (configAnswer.getSeparatorTextIsNotNull() ? configAnswer.getSeparatorText() : "") + " ");
	}
	else if(configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.YESNO))
	{
		cell.getItems().clear();
		cell.getItems().newItem(this.optionYes, this.optionYes.getIItemImage());
		cell.getItems().newItem(this.optionNo, this.optionNo.getIItemImage());
	}
	else if(configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.PICKLIST))
	{
		setAnswerCellOptions(configAnswer, cell);
	}
	else if(configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.MULTISELECT))				
	{
		setAnswerCellOptions(configAnswer, cell);
		
		if(instAnswer != null)
		{
			if(instAnswer.getMaxMultiselectAllowedIsNotNull())
			{
				cell.setMaxCheckedItemsForMultiSelect(instAnswer.getMaxMultiselectAllowed());						
			}
		}
		else
		{
			if(configAnswer.getMaxMultiselectAllowedIsNotNull())
			{
				cell.setMaxCheckedItemsForMultiSelect(configAnswer.getMaxMultiselectAllowed());
			}
		}							
	}
}
 
Example 7
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
/**
 * WDEV-12627
 * Function used to populate values & comments to grid
 * It will add the columns as it needs it for values and comments. It will attempt to 
 * @param tooltip 
 */
private void populateValue(IChartValueSet set, IChartValueGroup group, IChartValue value, int valueIndex, int groupIndex, StringBuffer tooltip)// 	WDEV-16395 
{
	if(group == null || value == null)
		return;
	
	boolean isAbnormal = value.getIChartValueIsAbnormal() != null && value.getIChartValueIsAbnormal().booleanValue();
	
	//WDEV-12547
	if(form.getLocalContext().getViewingStyleIsNotNull() && form.getLocalContext().getViewingStyle().equals(VIEW_GRAPHICAL))
	{
		if(isSelected(group))
		{
			if (value.getIChartValueValue() != null)
			{
				getGraphing().addPoint(new GraphingCustomOneValue(graphingGroups.get(group), value.getIChartValueDateTime(), normalizeValue(set, group, value), value, buildValueTooltip(group, value)));
			}
		}
	}
	
	DynamicGridRow row = getGroupRow(group);

	// Find a column based on the identifier created (the equals method in ColumnIdentifierValue class is overwritten with custom code)
	// If no column exists then a new one is created
	DynamicGridColumn valueColumn = getValueColumn(value.getIChartValueDateTime(), groupIndex, value.getIChartValueLabSpecimen(), value.getIChartValueOrderSpecimen());//WDEV-12627, WDEV-12628
	
	DynamicGridCell cell = row.getCells().newCell(valueColumn, DynamicCellType.STRING);
	StringBuilder valueTooltip = new StringBuilder();
	if (value.getIChartValueValue() != null)
	{
		cell.setValue(value.getIChartValueValue().toString());
		valueTooltip.append(value.getIChartValueValue().toString()).append("<br>");
	}
	else
	{
		cell.setValue(value.getIChartValue().substring(0, Math.min(value.getIChartValue().length(), CHARS_TO_TRIM_ST_RESULTS)));
		valueTooltip.append(value.getIChartValue()).append("<br>");
	}
	
	cell.setReadOnly(true);

	// Find a column based on the identifier created (the equals method in ColumnIdentifierComments class is overwritten with custom code)
	DynamicGridColumn commentColumn = getCommentColumn(valueColumn);//WDEV-12627, WDEV-12628
		
	if ((value.getIChartValueComments() != null && value.getIChartValueComments().length > 0)
			|| Boolean.TRUE.equals(ConfigFlag.UI.DISPLAY_INVESTIGATION_COMMENTS_ON_CUMULATE_RESULTS.getValue()) && (value.getIChartValueInvestigationComments() != null && value.getIChartValueInvestigationComments().length > 0)
			|| Boolean.TRUE.equals(ConfigFlag.UI.DISPLAY_INVESTIGATION_COMMENTS_ON_CUMULATE_RESULTS.getValue()) && (value.getIChartValueSpecimenComments() != null && value.getIChartValueSpecimenComments().length > 0))
	{
		DynamicGridCell commentCell = row.getCells().newCell(commentColumn, DynamicCellType.BUTTON);			
		commentCell.setIdentifier(value);
		commentCell.setReadOnly(true);
	}
	
	if(isAbnormal)
	{
		DynamicGridCell nameCell = row.getCells().get(getGrid().getColumns().getByIdentifier(COLUMN_NAME));
		nameCell.setTextColor(CELL_ABNORMAL_TEXTCOLOR);
		nameCell.setBackColor(CELL_ABNORMAL_BACKCOLOR);
		cell.setTextColor(CELL_ABNORMAL_TEXTCOLOR);
		cell.setBackColor(CELL_ABNORMAL_BACKCOLOR);			
	}
	
	cell.setIdentifier(value);

	valueTooltip.append(tooltip.toString());
	valueTooltip.append("<br><b>Units:</b> ").append(value.getIChartValueUnitOfMeasure() != null ? value.getIChartValueUnitOfMeasure() : "-");
	valueTooltip.append("<br><b>Ref. Range:</b> ").append(value.getIChartValueRefRange() != null ? value.getIChartValueRefRange() : "-");
	cell.setTooltip(valueTooltip.toString());
}
 
Example 8
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private void displayListedFindings(DrawingGraphicFindingVoCollection voColl)
{
	if(voColl == null)
		return;
	
	DynamicGridColumn colFinding = getDynamicColumn(COLFINDING);
	DynamicGridColumn colImageColour = getDynamicColumn(COLIMAGECOLOUR);
	DynamicGridColumn colStatus = getDynamicColumn(COLSTATUS);
	DynamicGridColumn colSelect = getDynamicColumn(COLSELECT);

	for (int i = 0; i < voColl.size(); i++)
	{
		DrawingGraphicFindingVo voDrawingGraphicFinding = voColl.get(i);
		String rowTooltip = getRowTooltip(voDrawingGraphicFinding);
		if (voDrawingGraphicFinding != null)
		{
			//Row
			DynamicGridRow row = getNewDynamicGridRow();
			if (isDialog())
				row.setSelectable(false);
			row.setValue(voDrawingGraphicFinding);
			row.setReadOnly(form.getMode().equals(FormMode.EDIT));

			//Finding
			DynamicGridCell cellFinding = row.getCells().get(colFinding);
			if (cellFinding == null)
				cellFinding = row.getCells().newCell(colFinding, DynamicCellType.STRING);

			cellFinding.setValue(voDrawingGraphicFinding.getDisplayText());
			cellFinding.setTooltip(rowTooltip);
			
			if ( isDialog()) //wdev-15448
				cellFinding.setReadOnly(true);
				

			//ImageColour
			DynamicGridCell cellImageColour = row.getCells().get(colImageColour);
			if (voDrawingGraphicFinding.getImageIsNotNull())
			{
				if (cellImageColour == null || cellImageColour.getType().equals(DynamicCellType.STRING))
					cellImageColour = row.getCells().newCell(colImageColour, DynamicCellType.IMAGE);
				cellImageColour.setValue(engine.getRegisteredImage(voDrawingGraphicFinding.getImage().getID_AppImage().intValue()));
			}
			else
			{
				if (cellImageColour == null || cellImageColour.getType().equals(DynamicCellType.IMAGE))
					cellImageColour = row.getCells().newCell(colImageColour, DynamicCellType.STRING);

				cellImageColour.setValue("Line");
				cellImageColour.setTextColor(voDrawingGraphicFinding.getColour());
			}
			cellImageColour.setTooltip(rowTooltip);
			if( isDialog()) //wdev-15448
				cellImageColour.setReadOnly(true);	
			//Status
			DynamicGridCell cellStatus = row.getCells().get(colStatus);
			if (cellStatus == null)
				cellStatus = row.getCells().newCell(colStatus, DynamicCellType.STRING);
			cellStatus.setValue(voDrawingGraphicFinding.getActiveStatusIsNotNull() ? voDrawingGraphicFinding.getActiveStatus().toString() : "");
			cellStatus.setTooltip(rowTooltip);
			
			if ( isDialog()) //wdev-15448
				cellStatus.setReadOnly(true);

			//Select
			if (colSelect != null)
			{
				DynamicGridCell cellSelect = row.getCells().get(colSelect);
				if (cellSelect == null)
					cellSelect = row.getCells().newCell(colSelect, DynamicCellType.BOOL);
				cellSelect.setReadOnly(false);
				cellSelect.setAutoPostBack(true);
				cellSelect.setTooltip(rowTooltip);
			}
		}
	}
}
 
Example 9
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private DynamicGridRow addFindingWithStagesGridRow(GraphicAssessmentFindingVo voGAFinding)
{
	if (voGAFinding == null || voGAFinding.getFinding() == null)
		return null;

	DynamicGridRow row = form.lyrDetails().tabFindingsWithStages().dyngrdFindingWithStage().getRows().newRow();
	
	row.setValue(voGAFinding);
	
	DrawingGraphicFindingVo voDrawingGraphicFinding = voGAFinding.getFinding();
	DynamicGridColumn colFinding = form.lyrDetails().tabFindingsWithStages().dyngrdFindingWithStage().getColumns().getByIdentifier(COLFINDING);
	if (colFinding == null)
	{
		colFinding = form.lyrDetails().tabFindings().dyngrdAssessmentFindings().getColumns().newColumn("Finding");
		colFinding.setWidth(180);
	}

	DynamicGridColumn colImage = form.lyrDetails().tabFindingsWithStages().dyngrdFindingWithStage().getColumns().getByIdentifier(COLIMAGE);
	if (colImage == null)
	{
		colImage = form.lyrDetails().tabFindingsWithStages().dyngrdFindingWithStage().getColumns().newColumn("Colour/Image");
		colImage.setWidth(-1);
	}

	row.setValue(voGAFinding);
	row.setReadOnly(true);
	row.setSelectable(true);
	if (row != null)
	{
		DynamicGridCell cellFinding = row.getCells().get(colFinding);
		if (cellFinding == null)
			cellFinding = row.getCells().newCell(colFinding, DynamicCellType.STRING);

		cellFinding.setValue(voDrawingGraphicFinding.getDisplayText());
		cellFinding.setReadOnly(true);

		DynamicGridCell cellImage = row.getCells().get(colImage);
		if (voDrawingGraphicFinding.getImageIsNotNull())
		{
			// Change the type to be image
			if (cellImage == null || cellImage.getType().equals(DynamicCellType.STRING))
				cellImage = row.getCells().newCell(colImage, DynamicCellType.IMAGE);

			cellImage.setValue(engine.getRegisteredImage(voDrawingGraphicFinding.getImage().getID_AppImage().intValue()));
		}
		else
		{
			// Change the type to be String
			if (cellImage == null || cellImage.getType().equals(DynamicCellType.IMAGE))
				cellImage = row.getCells().newCell(colImage, DynamicCellType.STRING);

			cellImage.setValue("Line");
			cellImage.setTextColor(voDrawingGraphicFinding.getColour());
		}
	}
	
	//add FindingStageQuestions
	if(voGAFinding.getFindingStageIsNotNull())
	{
		for (int i = 0; i < voGAFinding.getFindingStage().size(); i++)
		{
			DynamicGridRow fsqRow = row.getRows().newRow();
			
			FindingStageQuestionsVo findingStageQuestionsVo = voGAFinding.getFindingStage().get(i);
			createFindingStageRow(colFinding, fsqRow, findingStageQuestionsVo);
		}		
	}
	
	row.setExpanded(true);

	return row;
}
 
Example 10
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private DynamicGridRow createDynamicGridRow(DynamicGridRow row, GraphicAssessmentFindingVo voGAFinding)
{
	if (voGAFinding == null || voGAFinding.getFinding() == null)
		return null;

	DrawingGraphicFindingVo voDrawingGraphicFinding = voGAFinding.getFinding();
	DynamicGridColumn colFinding = form.lyrDetails().tabFindings().dyngrdAssessmentFindings().getColumns().getByIdentifier(COLFINDING);
	if (colFinding == null)
	{
		colFinding = form.lyrDetails().tabFindings().dyngrdAssessmentFindings().getColumns().newColumn("Finding");
		colFinding.setWidth(FINDING_COLUMN_WIDTH);
	}

	DynamicGridColumn colImage = form.lyrDetails().tabFindings().dyngrdAssessmentFindings().getColumns().getByIdentifier(COLIMAGE);
	if (colImage == null)
	{
		colImage = form.lyrDetails().tabFindings().dyngrdAssessmentFindings().getColumns().newColumn("Colour/Image");
		colImage.setWidth(-1);
	}

	row.setValue(voGAFinding);
	row.setReadOnly(true);
	row.setSelectable(true);
	if (row != null)
	{
		DynamicGridCell cellFinding = row.getCells().get(colFinding);
		if (cellFinding == null)
			cellFinding = row.getCells().newCell(colFinding, DynamicCellType.STRING);

		cellFinding.setValue(voDrawingGraphicFinding.getDisplayText());

		DynamicGridCell cellImage = row.getCells().get(colImage);
		if (voDrawingGraphicFinding.getImageIsNotNull())
		{
			// Change the type to be image
			if (cellImage == null || cellImage.getType().equals(DynamicCellType.STRING))
				cellImage = row.getCells().newCell(colImage, DynamicCellType.IMAGE);

			cellImage.setValue(engine.getRegisteredImage(voDrawingGraphicFinding.getImage().getID_AppImage().intValue()));
		}
		else
		{
			// Change the type to be String
			if (cellImage == null || cellImage.getType().equals(DynamicCellType.IMAGE))
				cellImage = row.getCells().newCell(colImage, DynamicCellType.STRING);

			cellImage.setValue("Line");
			cellImage.setTextColor(voDrawingGraphicFinding.getColour());
		}
	}

	return row;
}