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

The following are Jave code examples for showing how to use setTypedText() 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 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   View Source Code 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   View Source Code 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   View Source Code 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   View Source Code 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   View Source Code 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: 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);
	}
}
 
Example 8
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
protected void onDyngrdReportToCellValueChanged(DynamicGridCell cell)
{
	if (cell.getIdentifier() != null)
	{
		DynamicGridRow row = cell.getRow();
		DynamicGridCell cellAddress = row.getCells().get(form.lyrDetails().tabGenDetails().dyngrdReportTo().getColumns().getByIdentifier(ADDRESS_COLUMN));
		DynamicGridCell cellWardClinic = row.getCells().get(form.lyrDetails().tabGenDetails().dyngrdReportTo().getColumns().getByIdentifier(WARDOUTPAT_COLUMN));

		if (cell.getIdentifier().equals(MemberOfStaffRefVo.class))
		{
			MemberOfStaffShortVo voMos = ((MemberOfStaffShortVo) cell.getValue());

			if (voMos != null && voMos.getPrimaryLocationIsNotNull() && voMos.getPrimaryLocation().getAddressIsNotNull())
			{
				cellAddress.setValue(((MemberOfStaffShortVo) cell.getValue()).getPrimaryLocation().getAddress().toDisplayString());
				cellAddress.setTooltip(((MemberOfStaffShortVo) cell.getValue()).getPrimaryLocation().getAddress().toDisplayString());
			}
			else
			{
				cellAddress.setValue(null);
				cellAddress.setTooltip(null);
			}
		}
		else if (cell.getIdentifier().equals(GpRefVo.class))
		{
			GpShortVo voGp = ((GpShortVo) cell.getValue());

			if (voGp != null && voGp.getPracticesIsNotNull() && voGp.getPractices().size() > 0 && voGp.getPractices().get(0).getPracticeIsNotNull() && voGp.getPractices().get(0).getPractice().getAddressIsNotNull())
			{
				cellAddress.setValue(((GpShortVo) cell.getValue()).getPractices().get(0).getPractice().getAddress().toDisplayString());
				cellAddress.setTooltip(((GpShortVo) cell.getValue()).getPractices().get(0).getPractice().getAddress().toDisplayString());
			}
			else
			{
				cellAddress.setValue(null);
				cellAddress.setTooltip(null);
			}
		}
		else if (cell.getIdentifier().equals(LocationType.HOSP) && cell.getValue() != null)
		{
			if (cell.getValue() == null)
				cellWardClinic.setReadOnly(true);
			else
				cellWardClinic.setReadOnly(false);

			cellWardClinic.setTypedText(null);
			cellWardClinic.getItems().clear();
			cellAddress.setValue(null);
		}
		else if ((cell.getIdentifier().equals(LocationType.WARD) || cell.getIdentifier().equals(LocationType.OUTPATIENT_DEPT)) && cell.getValue() != null)
		{
			LocShortVo voLocation = (LocShortVo) cell.getValue();

			if (voLocation != null && voLocation.getAddressIsNotNull())
				cellAddress.setValue(voLocation.getAddress().toDisplayString());
			else
				cellAddress.setValue(null);
		}
	}
}
 
Example 9
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
protected void onFormDialogClosed(FormName formName, DialogResult result) throws PresentationLogicException
{
	if (formName.equals(form.getForms().Clinical.TeamMemberSelection) && (result.equals(DialogResult.OK) || result.equals(DialogResult.YES)))
	{
		ClinicalTeamMemberVoCollection voClinicalTeamMemberColl = form.getGlobalContext().Clinical.getTeamMemberSelection();
		if (voClinicalTeamMemberColl == null || voClinicalTeamMemberColl.size() == 0)
			return;

		for (int x = 0; x < voClinicalTeamMemberColl.size(); x++)
		{
			if (voClinicalTeamMemberColl.get(x) != null)
			{
				DynamicGridRow row = form.ctnDetails().dyngrdInvitees().getRows().newRow();

				row.setValue(voClinicalTeamMemberColl.get(x).getHCP());

				if (voClinicalTeamMemberColl.get(x).getHCPIsNotNull())
				{
					DynamicGridCell cellInvitee = row.getCells().newCell(getColByIdentifier(INVITEE_COLUMN), DynamicCellType.QUERYCOMBOBOX);
					cellInvitee.setWidth(100);
					cellInvitee.getItems().newItem(voClinicalTeamMemberColl.get(x).getHCP());
					cellInvitee.setTypedText(voClinicalTeamMemberColl.get(x).getHCP().toString());
					cellInvitee.setValue(voClinicalTeamMemberColl.get(x).getHCP());
					cellInvitee.setReadOnly(true);
					cellInvitee.setIdentifier(HcpLiteVo.class);
					cellInvitee.setStringMaxLength(55);
				}

				// Show a Label cell
				DynamicGridCell cellStatus = row.getCells().newCell(getColByIdentifier(STATUS_COLUMN), DynamicCellType.ENUMERATION);
				cellStatus.setReadOnly(false);
				cellStatus.setWidth(100);
				cellStatus.setTooltip("Please select a status");

				AttendanceStatusCollection collAttendStatus = ims.clinical.vo.lookups.LookupHelper.getAttendanceStatus(domain.getLookupService());
				for (int k = 0; k < collAttendStatus.size(); k++)
					cellStatus.getItems().newItem(collAttendStatus.get(k));

				DynamicGridCell cellNote = row.getCells().newCell(form.ctnDetails().dyngrdInvitees().getColumns().getByIdentifier(NOTE_COLUMN), DynamicCellType.STRING);
				cellNote.setWidth(-1);
				cellNote.setReadOnly(false);
				cellNote.setTooltip("Please add a note");
				cellNote.setStringMaxLength(255);

				row.setValue(voClinicalTeamMemberColl.get(x).getHCP());
			}
		}
	}
}
 
Example 10
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
protected void onFormDialogClosed(FormName formName, DialogResult result) throws PresentationLogicException 
{
	if (formName.equals(form.getForms().Clinical.TeamMemberSelection) && (result.equals(DialogResult.OK) ||result.equals(DialogResult.YES) ))
	{
		ClinicalTeamMemberVoCollection voClinicalTeamMemberColl = form.getGlobalContext().Clinical.getTeamMemberSelection(); 
		if(voClinicalTeamMemberColl == null || voClinicalTeamMemberColl.size() == 0)
			return;
		
		for(int x = 0; x < voClinicalTeamMemberColl.size(); x++)
		{
			if(voClinicalTeamMemberColl.get(x) != null)
			{
				DynamicGridRow row = form.ctnDetails().dyngrdInvitees().getRows().newRow();

				row.setValue(voClinicalTeamMemberColl.get(x).getHCP());
				
				if(voClinicalTeamMemberColl.get(x).getHCPIsNotNull())
				{
					DynamicGridCell cellInvitee = row.getCells().newCell(getColByIdentifier(INVITEE_COLUMN), DynamicCellType.QUERYCOMBOBOX);
					cellInvitee.setWidth(100);
					cellInvitee.getItems().newItem(voClinicalTeamMemberColl.get(x).getHCP());
					cellInvitee.setTypedText(voClinicalTeamMemberColl.get(x).getHCP().toString());
					cellInvitee.setValue(voClinicalTeamMemberColl.get(x).getHCP());
					cellInvitee.setReadOnly(true);
					cellInvitee.setIdentifier(HcpLiteVo.class);
				}
				
				//Show a Label cell
				DynamicGridCell cellStatus = row.getCells().newCell(getColByIdentifier(STATUS_COLUMN), DynamicCellType.ENUMERATION);
				cellStatus.setReadOnly(false);
				cellStatus.setWidth(100);
				cellStatus.setTooltip("Please select a status");
				
				AttendanceStatusCollection collAttendStatus = ims.clinical.vo.lookups.LookupHelper.getAttendanceStatus(domain.getLookupService());
				for(int k = 0 ; k < collAttendStatus.size() ; k++) 
					cellStatus.getItems().newItem(collAttendStatus.get(k));

				DynamicGridCell cellNote = row.getCells().newCell(form.ctnDetails().dyngrdInvitees().getColumns().getByIdentifier(NOTE_COLUMN), DynamicCellType.STRING);
				cellNote.setWidth(-1);
				cellNote.setStringMaxLength(255);
				cellNote.setReadOnly(false);
				cellNote.setTooltip("Please add a note");
				
				row.setValue(voClinicalTeamMemberColl.get(x).getHCP());
			}
		}
		form.ctnDetails().dyngrdInvitees().setValue(null);
		form.getContextMenus().getGoalPlanningMeetingInviteesREMOVEItem().setVisible(false);
	}
}