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

The following are Jave code examples for showing how to use showOpened() 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 6 votes
private void populateQueryClinics(DynamicGridCell cell, String textTyped) 
{
	cell.getItems().clear();
	ClinicLiteVoCollection clinicsColl = domain.listClinics(textTyped);
	
	if(clinicsColl != null)
	{
		for(int i=0; i<clinicsColl.size(); i++)
		{
			if(clinicNotOnScreen(clinicsColl.get(i), cell.getRow().getParent()))
			{
				DynamicGridCellItem newComboItem = cell.getItems().newItem(clinicsColl.get(i));
			}
		}
		
		if(clinicsColl.size() > 0)
		{
			cell.showOpened();
		}
	}
}
 
Example 2
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 6 votes
protected void onDyngrdCollectCellTextSubmited(DynamicGridCell cell)
{
	if (cell.getColumn().equals(getColumn(QUERY_COL)))
	{
		cell.getItems().clear();
		String value = cell.getTypedText();
		PersonName name = new PersonName();
		MemberOfStaffShortVo filter = new MemberOfStaffShortVo();
		name.setSurname(value);
		filter.setIsActive(Boolean.TRUE);
		filter.setName(name);
		MemberOfStaffShortVoCollection voColl = domain.listMembersOfStaff(filter);
		for (int i = 0; i < voColl.size(); i++)
		{
			cell.getItems().newItem(voColl.get(i));
		}
		int cellItemSize = cell.getItems().size();
		if (cellItemSize > 0)
		{
			if (cellItemSize == 1)
				cell.setValue(cell.getItems().get(0));
			cell.showOpened();
		}
	}
}
 
Example 3
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 6 votes
private void populateQueryConsultants(DynamicGridCell cell, String textTyped) 
{
	cell.getItems().clear();
	MedicLiteVoCollection medicColl = domain.listConsultants(textTyped);
	
	if(medicColl != null)
	{
		for(int i=0; i<medicColl.size(); i++)
		{
			if(consultantNotOnScreen(medicColl.get(i), cell.getRow().getParent()))
			{
				DynamicGridCellItem newComboItem = cell.getItems().newItem(medicColl.get(i));
			}
		}
		
		if(medicColl.size() > 0)
		{
			cell.showOpened();
		}
	}
}
 
Example 4
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 6 votes
private void populateQueryComboBox(DynamicGridCell cell, HeaderCollection headerColl) 
{
	cell.getItems().clear();
	
	for(int i=0; i<headerColl.size(); i++)
	{
		if(validTypedText(cell.getTypedText(), headerColl.get(i).getIItemText()))
		{
			DynamicGridCellItem newComboItem = cell.getItems().newItem(headerColl.get(i));	
		}
	}
	
	if(headerColl.size() > 0)
	{
		cell.showOpened();
	}
}
 
Example 5
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 6 votes
private void populateCellItems(DynamicGridCell cell, ValueObjectCollection voColl)
{
	cell.getItems().clear();

	for (int i = 0; voColl != null && i < voColl.getItems().length; i++)
	{
		cell.getItems().newItem(voColl.getItems()[i]);
	}

	if (voColl != null && voColl.getItems() != null)
	{
		if (voColl.getItems().length == 1)
			cell.setValue(voColl.getItems()[0]);
		else if (voColl.getItems().length > 1)
			cell.showOpened();
	}
}
 
Example 6
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 6 votes
private void populateCellItems(DynamicGridCell cell, ValueObjectCollection voColl)
{
	cell.getItems().clear();

	for (int i = 0; voColl != null && i < voColl.getItems().length; i++)
	{
		cell.getItems().newItem(voColl.getItems()[i], (voColl.getItems()[i]).toString());
	}

	if (voColl != null && voColl.getItems() != null)
	{
		if (voColl.getItems().length == 1)
			cell.setValue(voColl.getItems()[0]);
		else if (voColl.getItems().length > 1)
			cell.showOpened();
	}
}
 
Example 7
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 6 votes
private void populateCellItems(DynamicGridCell cell, ValueObjectCollection voColl)
{
	cell.getItems().clear();

	for (int i = 0; voColl != null && i < voColl.getItems().length; i++)
	{
		cell.getItems().newItem(voColl.getItems()[i]);
	}

	if (voColl != null && voColl.getItems() != null)
	{
		if (voColl.getItems().length == 1)
			cell.setValue(voColl.getItems()[0]);
		else if (voColl.getItems().length > 1)
			cell.showOpened();
	}
}
 
Example 8
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 6 votes
@Override
protected void onDyngrdActionsCellTextSubmited(DynamicGridCell cell)
{
	cell.getItems().clear();
	AppUserShortVo appUserFilter = new AppUserShortVo();
	appUserFilter.setUsername(cell.getTypedText());
	AppUserShortVoCollection users = domain.listAppUsers(appUserFilter);
	if (users != null && users.size() > 0)
	{
		for (int i = 0; i < users.size(); i++)
		{
			DynamicGridCellItem item = cell.getItems().newItem(users.get(i).getUserRealName() + " (" + users.get(i).getUsername() + ")");
			item.setIdentifier(users.get(i));
		}
		if (users.size() == 1)
		{
			cell.setValue(users.get(0).getUserRealName() + " (" + users.get(0).getUsername() + ")");
			cell.setIdentifier(users.get(0));
		}
		else if (users.size() > 1)
			cell.showOpened();

		cell.getRow().setIdentifier(cell.getIdentifier());
	}
}
 
Example 9
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 6 votes
protected void onDyngrdCollectCellTextSubmited(DynamicGridCell cell)
{
	if (cell.getColumn().equals(getColumn(QUERY_COL)))
	{
		cell.getItems().clear();
		String value = cell.getTypedText();
		PersonName name = new PersonName();
		MemberOfStaffShortVo filter = new MemberOfStaffShortVo();
		name.setSurname(value);
		filter.setIsActive(Boolean.TRUE);
		filter.setName(name);
		MemberOfStaffShortVoCollection voColl = domain.listMembersOfStaff(filter);
		for (int i = 0; i < voColl.size(); i++)
		{
			cell.getItems().newItem(voColl.get(i));
		}
		int cellItemSize = cell.getItems().size();
		if (cellItemSize > 0)
		{
			if (cellItemSize == 1)
				cell.setValue(cell.getItems().get(0));
			cell.showOpened();
		}
	}
}
 
Example 10
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
protected void onDyngrdInviteesCellTextSubmited(DynamicGridCell cell) 
{
	cell.getItems().clear();
	if (cell.getTypedText() == null || cell.getTypedText().equals(""))
	{
		engine.showMessage("Please enter at least one character to search on.");
		return;
	}

	if (cell.getIdentifier() != null && cell.getIdentifier().equals(HcpLiteVo.class))
	{
		HcpLiteVoCollection collHcps = domain.listHcpLiteVoByName(cell.getTypedText());
		//MemberOfStaffShortVoCollection voCollMos = domain.listMos(cell.getTypedText());
		if (collHcps != null && collHcps.size() > 0)
		{
			for (int i = 0; i < collHcps.size(); i++)
			{
				cell.getItems().newItem(collHcps.get(i));
			}
			if (collHcps.size() == 1)
			{
				cell.setValue(collHcps.get(0));
				onDyngrdInviteesCellValueChanged(cell);
			}
			else if (collHcps.size() > 1)
				cell.showOpened();
		}
		else
			engine.showMessage("No matching records found");
	}
}
 
Example 11
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private void populateQueryComboBox(DynamicGridCell cell, ICspTypeSpecifier[] cspTypeSpecifiers) 
{
	cell.getItems().clear();
	for(int i = 0; i < cspTypeSpecifiers.length; i++)
	{
		DynamicGridCellItem newComboItem = cell.getItems().newItem(cspTypeSpecifiers[i].getIGenericItemInfoName());
		newComboItem.setIdentifier(cspTypeSpecifiers[i]);
	}
	if (cspTypeSpecifiers.length >= 1)
	{
		cell.showOpened();
	}
}
 
Example 12
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private void populateCellItems(DynamicGridCell cell, ArrayList<Object[]> listCustomSearchSeed)
{
	cell.getItems().clear();
	
	if (listCustomSearchSeed == null || listCustomSearchSeed.size() == 0)
	{
		cell.showOpened();
		return;
	}
	
	for (int i = 0; i < listCustomSearchSeed.size(); i++)
	{
		Object[] elements = listCustomSearchSeed.get(i);
		
		if (elements == null || elements.length != 2)
			continue;
		
		CustomSearchSeed seed = new CustomSearchSeed(elements[0], (String) elements[1]);
		
		cell.getItems().newItem(seed, seed.toString());
		
		if (listCustomSearchSeed.size() == 1)
			cell.setValue(seed);
	}
	
	if (listCustomSearchSeed.size() != 1)
		cell.showOpened();
}
 
Example 13
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
protected void onDyngrdProceduresCellTextSubmited(DynamicGridCell cell)
{
	//WDEV-10772 - starts here
	String availableProcedures = "";
	DynamicGridRow row = null;
	
	for (int i = 0; i < form.dyngrdProcedures().getRows().size(); i++)
	{
		row = form.dyngrdProcedures().getRows().get(i);
		
		if(row.getValue() instanceof ProcedureLiteVo)
			availableProcedures += (availableProcedures.length() == 0 ? "" : ", ") + ((ProcedureLiteVo) row.getValue()).getID_Procedure(); 	
	}
	//WDEV-10772 - ends here
	
	cell.getItems().clear();
	
	ProcedureLiteVoCollection procedures = domain.getAvailableProcedures(availableProcedures, cell.getTypedText());
	if (procedures != null && procedures.size() > 0)
	{
		for (int i = 0; i < procedures.size(); i++)
		{
			cell.getItems().newItem(procedures.get(i), procedures.get(i).getProcedureName());
		}
		if (procedures.size() == 1)
		{
			cell.setValue(procedures.get(0));
			onDyngrdProceduresCellValueChanged(cell);
		}
		else if (procedures.size() > 1)
			cell.showOpened();
	}
}
 
Example 14
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
protected void onDyngrdDosesCellTextSubmited(DynamicGridCell cell) 
{
	if(cell.getType().getID() == DynamicCellType.QUERYCOMBOBOX.getID())
	{
		cell.getItems().clear();
		
		HcpFilter filter = new HcpFilter();
		PersonName name = new PersonName();
		name.setSurname(cell.getTypedText());
		filter.setQueryName(name);
		filter.setHcpType(HcpDisType.MEDICAL);
		
		HcpCollection voHCPColl = domain.listHcps(filter);
		
		if(voHCPColl != null)
		{
			for (int i = 0; i < voHCPColl.size(); i++)
			{
				cell.getItems().newItem(voHCPColl.get(i));
			}
			if (voHCPColl.size() == 1)
			{
				cell.setValue(voHCPColl.get(0));
			}
			else if (voHCPColl.size() > 1)
			{
				cell.showOpened();		
			}
			
		}
	}
}
 
Example 15
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 16
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 17
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 18
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 19
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();
}
 
Example 20
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private void searchAndDisplayHcpInGridQCmb(DynamicGridCell cell) throws PresentationLogicException
{
	String typedText = cell.getTypedText();
	
	cell.getItems().clear();
	cell.setTypedText(null);
	
	if (form.getLocalContext().getCurrentEditedConsultantIsNotNull() && 
			(form.getLocalContext().getCurrentEditedConsultant().getValue() instanceof ConsultantProcedureCategoryVo))
	{
		HcpLiteVo savedConsultant = ((ConsultantProcedureCategoryVo)form.getLocalContext().getCurrentEditedConsultant().getValue()).getPerformingHCP();
		if (savedConsultant != null)
		cell.getItems().newItem(savedConsultant);
	}
	
	

	HcpLiteVoCollection result;
	try
	{
		
		result = domain.listHcpLiteNotConfigured(typedText);
	}
	catch (DomainInterfaceException e)
	{
		throw new PresentationLogicException(e);
	}
	
	
	if (result!=null)
	{
		for (int i = 0; i < result.size(); i++)
		{
			cell.getItems().newItem(result.get(i));
		}
	}
	if (cell.getItems().size() > 0)
	{
	if (cell.getItems().size() == 1)
	{
		cell.setValue(cell.getItems().get(0).getValue());
	}
	else
	{
		cell.showOpened();
	}
	}
	DynamicGridRow selectedRow = form.dyngrdMain().getSelectedRow();
	if (selectedRow!=null)
	{
	form.dyngrdMain().setSelectedRow(null);
	form.dyngrdMain().setSelectedRow(selectedRow);
	}
}