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

The following are Jave code examples for showing how to use setMaxDropDownItems() 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 4 votes
private void populateQueryComboboxClinics(DynamicGridCell cell, ClinicLiteVoCollection clinicList)
{
	if (cell == null)
		throw new CodingRuntimeException("Major Logical Error - Can not populate a null cell");
	
	// Clear the query combobox
	cell.getItems().clear();
	
	if (clinicList == null || clinicList.size() == 0)
		return;
	
	if (cell.getRow() == null || cell.getRow().getParent() == null)
		throw new CodingRuntimeException("Major Logical Error - Cell must belong to a non category row");
	
	
	// Remove the clinics that are already added
	DynamicGridRow parentRow = cell.getRow().getParent();
	DynamicGridRow row;
	
	for (int i = 0; i < parentRow.getRows().size(); i++)
	{
		row = parentRow.getRows().get(i);
		
		// If it is the same row as the cell row or the row has a null value move on to the next row
		if (row == null || row == cell.getRow() || row.getValue() == null)
			continue;
		
		if (!(row.getValue() instanceof ClinicLiteVo))
			throw new CodingRuntimeException("Non clinical association added to CLINICS category");
		
		clinicList.remove((ClinicLiteVo) row.getValue());
	}
	
	
	if (clinicList.size() == 0)
		return;
	
	
	// Add clinics to the query combobox item collection
	DynamicGridCellItem newClinicEntry;
	
	for (int i = 0; i < clinicList.size(); i++)
	{
		// Create a new row for each entry
		newClinicEntry = cell.getItems().newItem();
		newClinicEntry.setValue(clinicList.get(i));
	}
	
	// Expand the cell
	cell.setMaxDropDownItems(MAX_DROPDOWN_ITEMS);
	cell.showOpened();
}
 
Example 2
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private void populateQueryComboboxConsultants(DynamicGridCell cell, MedicLiteVoCollection consultantList)
{
	if (cell == null)
		throw new CodingRuntimeException("Major Logical Error - Can not populate a null cell");
	
	// Clear the query combobox
	cell.getItems().clear();
	
	if (consultantList == null || consultantList.size() == 0)
		return;
	
	if (cell.getRow() == null || cell.getRow().getParent() == null)
		throw new CodingRuntimeException("Major Logical Error - Cell must belong to a non category row");
	
	
	// Remove the medics that are already added
	DynamicGridRow parentRow = cell.getRow().getParent();
	DynamicGridRow row;
	
	for (int i = 0; i < parentRow.getRows().size(); i++)
	{
		row = parentRow.getRows().get(i);
		
		// If it is the same row as the cell row or the row has a null value move on to the next row
		if (row == null || row == cell.getRow() || row.getValue() == null)
			continue;
		
		if (!(row.getValue() instanceof MedicLiteVo))
			throw new CodingRuntimeException("Non consultant association added to CONSULTANTS category");
		
		consultantList.remove((MedicLiteVo) row.getValue());
	}
	
	
	if (consultantList.size() == 0)
		return;
	
	
	// Add consultants to the query combobox item collection
	DynamicGridCellItem newConsultantEntry;
	
	for (int i = 0; i < consultantList.size(); i++)
	{
		// Create a new row for each entry
		newConsultantEntry = cell.getItems().newItem();
		newConsultantEntry.setValue(consultantList.get(i));
	}
	
	// Expand the cell
	cell.setMaxDropDownItems(MAX_DROPDOWN_ITEMS);
	cell.showOpened();
}
 
Example 3
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private void populateQueryComboboxSpecialties(DynamicGridCell cell, ArrayList<Specialty> specialtyList)
{
	if (cell == null)
		throw new CodingRuntimeException("Major Logical Error - Can not populate a null cell");
	
	// Clear the combobox
	cell.getItems().clear();
	
	if (specialtyList == null || specialtyList.size() == 0)
		return;
	
	if (cell.getRow() == null || cell.getRow().getParent() == null)
		throw new CodingRuntimeException("Major Logical Error - Cell must belong to a non category row");
	
	
	// Remove the specialties already added
	DynamicGridRow parentRow = cell.getRow().getParent();
	DynamicGridRow row;
	
	for (int i = 0; i < parentRow.getRows().size(); i++)
	{
		row = parentRow.getRows().get(i);
		
		// If it is the same row as the cell row or the row has a null value move on to the next row
		if (row == null || row == cell.getRow() || row.getValue() == null)
			continue;
		
		if (!(row.getValue() instanceof Specialty))
			throw new CodingRuntimeException("Non specialty association added to SPECIALTY category");

		specialtyList.remove(null);
		specialtyList.remove(row.getValue());
	}
	
	if (specialtyList.size() == 0)
		return;
	
	// Add specialties to the query combobox item collection
	DynamicGridCellItem newSpecialtyEntry;
	
	for (int i = 0; i < specialtyList.size(); i++)
	{
		// Create a new row for each entry
		newSpecialtyEntry = cell.getItems().newItem();
		newSpecialtyEntry.setValue(specialtyList.get(i));
	}
	
	// Expand the cell
	cell.setMaxDropDownItems(MAX_DROPDOWN_ITEMS);
	cell.showOpened();
}
 
Example 4
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private void populateQueryComboboxClinics(DynamicGridCell cell, ClinicLiteVoCollection clinicList)
{
	if (cell == null)
		throw new CodingRuntimeException("Major Logical Error - Can not populate a null cell");
	
	// Clear the query combobox
	cell.getItems().clear();

	if (clinicList == null || clinicList.size() == 0)
		return;

	if (cell.getRow() == null || cell.getRow().getParent() == null)
		throw new CodingRuntimeException("Major Logical Error - Cell must belong to a non category row");
	
	
	// Remove the clinics already added
	DynamicGridRow parentRow = cell.getRow().getParent();
	DynamicGridRow row;
	for (int i = 0; i < parentRow.getRows().size(); i++)
	{
		row = parentRow.getRows().get(i);
		
		// If it is the same row as the cell row or the row has a null value move on to the next row
		if (row == null || row == cell.getRow() || row.getValue() == null)
			continue;
		
		if (!(row.getValue() instanceof ClinicAccessVo))
			throw new CodingRuntimeException("Non clinical correspondence added to clinical category");

		clinicList.remove(((ClinicAccessVo) row.getValue()).getClinic());
	}
	
	
	if (clinicList.size() == 0)
		return;

	// Add clinics to the query combobox item collection
	DynamicGridCellItem newClinicEntry;
	
	for (int i = 0; i < clinicList.size(); i++)
	{
		// Create a new row for each entry
		newClinicEntry = cell.getItems().newItem();
		newClinicEntry.setValue(clinicList.get(i));
	}

	// Expand the cell
	cell.setMaxDropDownItems(MAXDROPDOWNITEMS);
	cell.showOpened();
}
 
Example 5
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private void populateQueryComboboxConsultants(DynamicGridCell cell, MedicLiteVoCollection medicList)
{
	if (cell == null)
		throw new CodingRuntimeException("Major Logical Error - Can not populate a null cell");

	// Clear the query combobox
	cell.getItems().clear();
	
	if (medicList == null || medicList.size() == 0)
		return;
	
	if (cell.getRow() == null || cell.getRow().getParent() == null)
		throw new CodingRuntimeException("Major Logical Error - Cell must belong to a non category row");
	
	
	// Remove the medics already added
	DynamicGridRow parentRow = cell.getRow().getParent();
	DynamicGridRow row;
	
	for (int i = 0; i < parentRow.getRows().size(); i++)
	{
		row = parentRow.getRows().get(i);
		
		// If it is the same row as the cell row or the row has a null value move on to the next row
		if (row == null || row == cell.getRow() || row.getValue() == null)
			continue;
		
		if (!(row.getValue() instanceof ConsultantAccessVo))
			throw new CodingRuntimeException("Non consultant correspondence added to consultant category");
		
		medicList.remove(((ConsultantAccessVo) row.getValue()).getConsultant());
	}
	
	
	if (medicList.size() == 0)
		return;
	
	
	// Add consultants to query combobox item collection
	DynamicGridCellItem newMedicEntry;
	
	for (int i = 0; i < medicList.size(); i++)
	{
		// Create a new row for each entry
		newMedicEntry = cell.getItems().newItem();
		newMedicEntry.setValue(medicList.get(i));
	}
	
	// Expand the cell
	cell.setMaxDropDownItems(MAXDROPDOWNITEMS);
	cell.showOpened();
}
 
Example 6
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private void populateQueryComboboxSpecialties(DynamicGridCell cell, ArrayList<Specialty> specialties)
{
	if (cell == null)
		throw new CodingRuntimeException("Major Logical Error - Can not populate a null cell");
	
	// Clear the combobox
	cell.getItems().clear();
	
	if (specialties == null || specialties.size() == 0)
		return;
	
	if (cell.getRow() == null || cell.getRow().getParent() == null)
		throw new CodingRuntimeException("Major Logical Error - Cell must belong to a non category row");
	
	
	// Remove the specialties already added
	DynamicGridRow parentRow = cell.getRow().getParent();
	DynamicGridRow row;
	
	for (int i = 0; i < parentRow.getRows().size(); i++)
	{
		row = parentRow.getRows().get(i);
		
		// If it is the same row as the cell row or the row has a null value move on to the next row
		if (row == null || row == cell.getRow() || row.getValue() == null)
			continue;
		
		if (!(row.getValue() instanceof SpecialtyAccessVo))
			throw new CodingRuntimeException("Non specialty correspondence added to specialty category");

		SpecialtyAccessVo specialtyAccess = (SpecialtyAccessVo) row.getValue();
		
		if (specialtyAccess.getSpecialty() != null)
			specialties.remove(specialtyAccess.getSpecialty());
	}


	if (specialties.size() == 0)
		return;
	

	// Add spcialties to the query combobox item collection
	DynamicGridCellItem newSpecialtyEntry;
	
	for (int i = 0; i < specialties.size(); i++)
	{
		// Create a new row for each entry
		newSpecialtyEntry = cell.getItems().newItem();
		newSpecialtyEntry.setValue(specialties.get(i));
	}
	
	// Expand the cell
	cell.setMaxDropDownItems(MAXDROPDOWNITEMS);
	cell.showOpened();
}