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

The following are Jave code examples for showing how to use setMaxVisibleItemsForMultiSelect() 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: Logic.java   View Source Code Vote up 5 votes
private void setAnswerCellOptions(Question_AnswerTypeVo answer, DynamicGridCell cell, Answer_DetailsVo instAnswer)
{
	cell.getItems().clear();
	// WDEV-3617
	cell.setAutoWrapForMultiSelect(true);

	int maxVisibleItems = 0;
	if (answer.getOptionsIsNotNull())
	{
		for (int x = 0; x < answer.getOptions().size(); x++)
		{
			Answer_OptionVo answerItem = answer.getOptions().get(x);
			if (answerItem != null)
			{
				if (displayAnsweredOnly && isNotAnswered(answerItem, instAnswer))
					continue;
				DynamicGridCellItem item = cell.getItems().newItem(answerItem);
				item.setIdentifier(answerItem);
				
				// WDEV-3708
				item.setTooltip(answerItem.getOptionDescription() != null ? answerItem.getOptionDescription() : "");
				maxVisibleItems++;
				if (answerItem.getColourIsNotNull() && answer.getAnswerTypeIsNotNull() && answer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.MULTISELECT))
				{
					item.setMarkerColor(answerItem.getColour());
				}
			}
		}
	}

	cell.setMaxVisibleItemsForMultiSelect(0);
}
 
Example 2
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View Source Code Vote up 5 votes
private void setAnswerCellOptions(QuestionAnswerTypeVo answer, DynamicGridCell cell, AnswerDetailsVo instAnswer) 
{
	cell.getItems().clear();
 	// WDEV-3617
	cell.setAutoWrapForMultiSelect(true);
	int maxVisibleItems = 0;
	if(answer.getOptionsIsNotNull())
	{
		for(int x = 0; x < answer.getOptions().size(); x++)
		{
			AnswerOptionVo answerItem = answer.getOptions().get(x);									
			if(answerItem != null)
			{
				//WDEV-1631 - When Viewing an Instantiated Assessment i simply want to see all the question and answered given, in edit mode i want to see all the questions and answer options. 
				if(displayAnsweredOnly && isNotAnswered(answerItem, instAnswer))
					continue;
				DynamicGridCellItem item = cell.getItems().newItem(answerItem);				
				item.setIdentifier(answerItem);
				maxVisibleItems++;
				if(answerItem.getColourIsNotNull() 
						&& answer.getAnswerTypeIsNotNull() 
						&& answer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.MULTISELECT))
				{
					item.setMarkerColor(answerItem.getColour());					
				}
			}
		}			
	}		
	
	cell.setMaxVisibleItemsForMultiSelect(0);
	
	// This line is no longer needed, the answer is going to be wrapped.
	// MM - WDEV-3617
	//cell.setMaxVisibleItemsForMultiSelect(maxVisibleItems == 0 ? 1 : maxVisibleItems + 1);
}
 
Example 3
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View Source Code Vote up 5 votes
private void setAnswerCellOptions(Question_AnswerTypeVo answer, DynamicGridCell cell, Answer_DetailsVo instAnswer) 
{
	cell.getItems().clear();
 	// WDEV-3617
	cell.setAutoWrapForMultiSelect(true);
	int maxVisibleItems = 0;
	if(answer.getOptionsIsNotNull())
	{
		for(int x = 0; x < answer.getOptions().size(); x++)
		{
			Answer_OptionVo answerItem = answer.getOptions().get(x);									
			if(answerItem != null)
			{
				//WDEV-1631 - When Viewing an Instantiated Assessment i simply want to see all the question and answered given, in edit mode i want to see all the questions and answer options. 
				if(displayAnsweredOnly && isNotAnswered(answerItem, instAnswer))
					continue;
				DynamicGridCellItem item = cell.getItems().newItem(answerItem);				
				item.setIdentifier(answerItem);
				maxVisibleItems++;
				if(answerItem.getColourIsNotNull() 
						&& answer.getAnswerTypeIsNotNull() 
						&& answer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.MULTISELECT))
				{
					item.setMarkerColor(answerItem.getColour());					
				}
			}
		}			
	}		
	
	cell.setMaxVisibleItemsForMultiSelect(0);
	
	// This line is no longer needed, the answer is going to be wrapped.
	// MM - WDEV-3617
	//cell.setMaxVisibleItemsForMultiSelect(maxVisibleItems == 0 ? 1 : maxVisibleItems + 1);
}
 
Example 4
Project: AvoinApotti   File: MyOrderQuestionsPopulation.java   View Source Code Vote up 5 votes
private void setAnswerCellOptions(QuestionAnswerTypeVo answer, DynamicGridCell cell) 
	{
		cell.getItems().clear();
		int maxVisibleItems = 0;
		if(answer.getOptionsIsNotNull())
		{
			for(int x = 0; x < answer.getOptions().size(); x++)
			{
				AnswerOptionVo answerItem = answer.getOptions().get(x);									
				if(answerItem != null)
				{
/*					//WDEV-1631 - When Viewing an Instantiated Assessment i simply want to see all the question and answered given, in edit mode i want to see all the questions and answer options. 
					if(displayAnsweredOnly && isNotAnswered(answerItem, instAnswer))
						continue;*/
					DynamicGridCellItem item = cell.getItems().newItem(answerItem);				
					item.setIdentifier(answerItem);
					maxVisibleItems++;
					if(answerItem.getColourIsNotNull() 
							&& answer.getAnswerTypeIsNotNull() 
							&& answer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.MULTISELECT))
					{
						item.setMarkerColor(answerItem.getColour());					
					}
				}
			}			
		}		
		
		cell.setMaxVisibleItemsForMultiSelect(maxVisibleItems == 0?1:maxVisibleItems);
	}
 
Example 5
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private void populateChildRow(DynamicGridRow childRow, HandlingMovementDetailVo voHandlingMovementDetail)
{
	if (voHandlingMovementDetail == null)
		return;

	childRow.setValue(voHandlingMovementDetail);
	
	
	DynamicGridCell cellMovement = childRow.getCells().newCell(form.dyngrdDetails().getColumns().getByIdentifier(MOVEMENT_COLUMN), DynamicCellType.STRING);
	if(voHandlingMovementDetail.getMovementIsNotNull())
		cellMovement.setValue(voHandlingMovementDetail.getMovement().toString());
	

	DynamicGridCell cellEquipment = childRow.getCells().newCell(form.dyngrdDetails().getColumns().getByIdentifier(EQUIPMENT_COLUMN), DynamicCellType.MULTISELECT);

	MechanicalEquipCollection items = voHandlingMovementDetail.getMechanicalEquipment();
	if(items != null)
	{
		for(int y = 0; y < items.size(); y++)
		{
			cellEquipment.getItems().newItem(items.get(y));
			cellEquipment.getItems().get(y).setIdentifier(items.get(y));
			cellEquipment.getItems().get(y).setMarkerColor(items.get(y).getColor());
			cellEquipment.getItems().get(y).setChecked(true);
		}
		//WDEV-2935 
		cellEquipment.setMaxVisibleItemsForMultiSelect(items.size());
	}
	
	
	
	DynamicGridCell cellOtherEquipment = childRow.getCells().newCell(form.dyngrdDetails().getColumns().getByIdentifier(OTHEREQUIPMENT_COLUMN), DynamicCellType.STRING);
	cellOtherEquipment.setValue(voHandlingMovementDetail.getOtherEquipment());
	cellOtherEquipment.setTooltip(voHandlingMovementDetail.getOtherEquipment());

	DynamicGridCell cellNoOfStaff = childRow.getCells().newCell(form.dyngrdDetails().getColumns().getByIdentifier(NOOFSTAFF_COLUMN), DynamicCellType.INT);
	cellNoOfStaff.setValue(voHandlingMovementDetail.getNoOfStaff());
	
	DynamicGridCell cellDetails = childRow.getCells().newCell(form.dyngrdDetails().getColumns().getByIdentifier(DETAILS_COLUMN), DynamicCellType.STRING);
	cellDetails.setValue(voHandlingMovementDetail.getDetails());

	// if not saved then set the colour
	if (voHandlingMovementDetail.getID_HandlingMovementDetail() == null)
		childRow.setTextColor(Color.Red);
}
 
Example 6
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private void setAnswerCellOptions(QuestionAnswerTypeVo answer, DynamicGridCell cell, AnswerDetailsVo instAnswer)
{
	cell.getItems().clear();
	// WDEV-3617
	cell.setAutoWrapForMultiSelect(true);

	int maxVisibleItems = 0;
	if (answer.getOptionsIsNotNull())
	{
		for (int x = 0; x < answer.getOptions().size(); x++)
		{
			AnswerOptionVo answerItem = answer.getOptions().get(x);
			if (answerItem != null)
			{
				// WDEV-1631 - When Viewing an Instantiated Assessment i
				// simply want to see all the question and answered
				// given, in edit mode i want to see all the questions
				// and answer options.
				if (displayAnsweredOnly && isNotAnswered(answerItem, instAnswer))
					continue;
				DynamicGridCellItem item = cell.getItems().newItem(answerItem);
				item.setIdentifier(answerItem);
				// WDEV-3708
				item.setTooltip(answerItem.getOptionDescription() != null ? answerItem.getOptionDescription() : "");
				maxVisibleItems++;
				if (answerItem.getColourIsNotNull() && answer.getAnswerTypeIsNotNull() && answer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.MULTISELECT))
				{
					item.setMarkerColor(answerItem.getColour());
				}
			}
		}
	}

	cell.setMaxVisibleItemsForMultiSelect(0);

	// This line is no longer needed, the answer is going to be wrapped.
	// MM - WDEV-3617
	// cell.setMaxVisibleItemsForMultiSelect(maxVisibleItems == 0 ? 1 :
	// maxVisibleItems + 1);

	// cell.setMaxVisibleItemsForMultiSelect(maxVisibleItems ==
	// 0?1:maxVisibleItems);
}