Java Code Examples for ims.framework.controls.DynamicGridColumn

The following are top voted examples for showing how to use ims.framework.controls.DynamicGridColumn. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void createNotificationCells(DynamicGridRow row, RuleValueConditionEntry entry, int count) throws ParseException
{
	DynamicGridColumn valueColl = getColByIndexForActionGrid(count);
	if (valueColl == null)
	{
		valueColl = createColumnForActionGrid("", count);
	}
	setRowIdentifier(row, count, RuleConditionType.VALUE);

	DynamicGridCell preComparatorCell = row.getCells().newCell(valueColl, DynamicCellType.ENUMERATION);
	for (int i = 0; i < entry.getField().getParentEntity().getFields().size(); i++)
	{
		preComparatorCell.getItems().newItem(entry.getField().getParentEntity().getFields().get(i).getName());
		preComparatorCell.getItems().get(i).setIdentifier(entry.getField().getParentEntity().getFields().get(i));
	}

	preComparatorCell.setAutoPostBack(true);
	preComparatorCell.setValue(entry.getField().getName());
	preComparatorCell.setIdentifier(entry.getField());
}
 
Example 2
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
/**
 * WDEV-12569
 * 
 * Function used to set the sort order for appropriate column
 * @param column
 */
private void setColumnSortOrder(DynamicGridColumn column)
{
	if (column != null && column.getIdentifier() == null)
		throw new CodingRuntimeException("Logical Error - All grid columns must have an identifier. Check grid initialization");
	
	// Toggle between ASCENDING and DESCENDING sort mode
	// In the case where sort mode has not been set then default to ASCENDING sort mode
	// Each line will toggle if the column matches, else the sort mode will be cleared (null)
	form.getLocalContext().setSortOrder_T(column != null && column.getIdentifier().equals(COL_T_VALUE) ? (SortOrder.ASCENDING.equals(form.getLocalContext().getSortOrder_T()) ? SortOrder.DESCENDING : SortOrder.ASCENDING) : null);
	form.getLocalContext().setSortOrder_N(column != null && column.getIdentifier().equals(COL_N_VALUE) ? (SortOrder.ASCENDING.equals(form.getLocalContext().getSortOrder_N()) ? SortOrder.DESCENDING : SortOrder.ASCENDING) : null);
	form.getLocalContext().setSortOrder_M(column != null && column.getIdentifier().equals(COL_M_VALUE) ? (SortOrder.ASCENDING.equals(form.getLocalContext().getSortOrder_M()) ? SortOrder.DESCENDING : SortOrder.ASCENDING) : null);
	form.getLocalContext().setSortOrder_HisType(column != null && column.getIdentifier().equals(COL_HIST_TYPE) ? (SortOrder.ASCENDING.equals(form.getLocalContext().getSortOrder_HisType()) ? SortOrder.DESCENDING : SortOrder.ASCENDING) : null);
	form.getLocalContext().setSortOrder_HisGrade(column != null && column.getIdentifier().equals(COL_HIST_GRADE) ? (SortOrder.ASCENDING.equals(form.getLocalContext().getSortOrder_HisGrade()) ? SortOrder.DESCENDING : SortOrder.ASCENDING) : null);
	form.getLocalContext().setSortOrder_Serum(column != null && column.getIdentifier().equals(COL_SERUM) ? (SortOrder.ASCENDING.equals(form.getLocalContext().getSortOrder_Serum()) ? SortOrder.DESCENDING : SortOrder.ASCENDING) : null);
	form.getLocalContext().setSortOrder_O45(column != null && column.getIdentifier().equals(COL_OVER_45) ? (SortOrder.ASCENDING.equals(form.getLocalContext().getSortOrder_O45()) ? SortOrder.DESCENDING : SortOrder.ASCENDING) : null);
	form.getLocalContext().setSortOrder_Overall(column != null && column.getIdentifier().equals(COL_OVERALL) ? (SortOrder.ASCENDING.equals(form.getLocalContext().getSortOrder_Overall()) ? SortOrder.DESCENDING : SortOrder.ASCENDING) : null);
}
 
Example 3
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private void createStaticColumns(boolean isComplete)
{
	 if(this.questionImage != null && this.mandatoryQuestionImage != null)
		 createImageColumnWhenFlat();
	 
	DynamicGridColumn questionColumn = this.grid.getColumns().newColumn("Question", QUESTION_COLUMN);
	questionColumn.setCanGrow(false);
	questionColumn.setWidth(DEFAULT_GRAPHIC_QUESTION_COLUMN_WIDTH);	
			
	if(!isComplete)
	{
		DynamicGridColumn buttonColumn = this.grid.getColumns().newColumn("", BUTTON_COLUMN);
		buttonColumn.setAlignment(Alignment.CENTER);
		buttonColumn.setCanGrow(false);
		buttonColumn.setWidth(0);			
	}
}
 
Example 4
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void initializeDynamicGrid()
{
	form.dyngrdNotes().clear();
	form.dyngrdNotes().setSelectable(true);	
	
	DynamicGridColumn column;
	column = form.dyngrdNotes().getColumns().newColumn("HCP", COL_USER);
	column.setWidth(200);
	column.setCanGrow(true);
			
	column = form.dyngrdNotes().getColumns().newColumn("DateTime", COL_DATE);
	column.setWidth(100);		
	column.setCanGrow(false);				
			
	column = form.dyngrdNotes().getColumns().newColumn("Summary Note", COL_NOTES);
	column.setCanGrow(false);
	column.setWidth(480);
	
}
 
Example 5
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void createdDynamicGridSpecialInterest()
{
	form.dyngrdSpecialInterest().getRows().clear();
	
	DynamicGridColumn columnName = form.dyngrdSpecialInterest().getColumns().newColumn("Category", COLUMN_SPECIALINTERESTCATEGORY);
	columnName.setWidth(155);
	columnName.setAlignment(Alignment.LEFT);
	columnName.setReadOnly(true);
	
	columnName = form.dyngrdSpecialInterest().getColumns().newColumn("Start Date", COLUMN_STARTDATE);
	columnName.setWidth(100);
	columnName.setReadOnly(true);
	
	columnName = form.dyngrdSpecialInterest().getColumns().newColumn("End Date", COLUMN_ENDDATE);
	columnName.setWidth(-1);
	columnName.setReadOnly(true);

}
 
Example 6
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void setColStatus(ClinicalNotesShortVo note, DynamicGridRow row)
{
	DynamicGridColumn col = getCol("Status");
	if (col == null)
		throw new DomainRuntimeException("No column for Identifier");

	DynamicGridCell statusCell = row.getCells().newCell(col, DynamicCellType.STRING);
	statusCell.setValue(note.getCurrentStatus().getStatus().getText());
	
	StringBuffer sb = new StringBuffer();
	sb.append("Status set by : ");
	sb.append(note.getCurrentStatus().getMOSIsNotNull() ? note.getCurrentStatus().getMOS().getName() : "");
	sb.append(" on ");
	sb.append(note.getCurrentStatus().getDateTimeIsNotNull() ? note.getCurrentStatus().getDateTime().toString() : "");
	statusCell.setTooltip(sb.toString());
}
 
Example 7
Project: AvoinApotti   File: OrderEntryTemplatePopulation.java   View source code 6 votes vote down vote up
void addSeparator(int columnIndex, int rowIndex, String dividerText, Color dividerColour, Boolean dividerIsBold) 
{
	if(dividerText != null && dividerText.trim().length() > 0)
	{
		String text = dividerText; 
		DynamicGridRow row = grid.getRows().get(rowIndex);
		DynamicGridColumn column = grid.getColumns().get(columnIndex);			
		DynamicGridCell cell = row.getCells().newCell(column, DynamicCellType.HTMLVIEW);
		
		if(dividerColour != null)
		{
			text = "<font color=\"" + dividerColour.getValue() + "\">" + text + "</font>";
		}			
		if(dividerIsBold != null && dividerIsBold.booleanValue())
		{
			text = "<b>" + text + "</b>";
		}
		
		cell.setValue(text);
	}
}
 
Example 8
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
public boolean isPocSelected(AssessmentQuestionRefVo voAssessmQuestion)
{
	for (int i = 0; i < grid.getRows().size(); i++)
	{
		DynamicGridRow row = grid.getRows().get(i);

		if (row.getIdentifier() instanceof AssessmentQuestionVo && row.getIdentifier().equals(voAssessmQuestion))
		{
			DynamicGridColumn column = this.grid.getColumns().getByIdentifier(POC_COLUMN);
			if (column != null)
			{
				DynamicGridCell cell = row.getCells().get(column);
				if (cell.getValue() instanceof Boolean)
					return ((Boolean) cell.getValue()).booleanValue();
			}
		}
	}

	return false;
}
 
Example 9
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private void createStaticColumns(boolean flatView, Integer questionColumnWidth, boolean isComplete) 
{
	if(flatView && this.questionImage != null && this.mandatoryQuestionImage != null)
		createImageColumnWhenFlat();
	
	DynamicGridColumn questionColumn = this.grid.getColumns().newColumn(flatView ? "Question" : "Group / Question", QUESTION_COLUMN);
	questionColumn.setCanGrow(false);
	questionColumn.setWidth(questionColumnWidth == null ? (isDPP ? DEFAULT_QUESTION_COLUMN_WIDTH - 240 : DEFAULT_QUESTION_COLUMN_WIDTH) : questionColumnWidth.intValue());	
			
	if(!isComplete)
	{
		DynamicGridColumn buttonColumn = this.grid.getColumns().newColumn("", BUTTON_COLUMN);
		buttonColumn.setAlignment(Alignment.CENTER);
		buttonColumn.setCanGrow(false);
		buttonColumn.setWidth(0);			
	}
}
 
Example 10
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void initDynGrid()
{
	DynamicGridColumn newColumn = form.dyngrdTTA().getColumns().newColumn("TTA Record/MedicationName", NAME_IDENTIFIER);
	newColumn.setCanGrow(true);
	newColumn.setWidth(NAME_WIDTH);
	newColumn = form.dyngrdTTA().getColumns().newColumn("Form", FORM_IDENTIFIER);
	newColumn.setWidth(FORM_WIDTH);
	newColumn = form.dyngrdTTA().getColumns().newColumn("Route", ROUTE_IDENTIFIER);
	newColumn.setWidth(ROUTE_WIDTH);
	newColumn = form.dyngrdTTA().getColumns().newColumn("Dose", DOSE_IDENTIFIER);
	newColumn.setWidth(DOSE_WIDTH);
	newColumn = form.dyngrdTTA().getColumns().newColumn("Frequency", FREQUENCY_IDENTIFIER);
	newColumn.setWidth(FREQUENCY_WIDTH);
	newColumn = form.dyngrdTTA().getColumns().newColumn("Select", SELECT_IDENTIFIER);
	newColumn.setWidth(SELECT_WIDTH);
	newColumn.setDynamicWidthSupported(true);
}
 
Example 11
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void setDefaultTimeValue(DynamicGridCell cell)
{
	DynamicGridRow parentRow = cell.getRow().getParent();
	//Get Previous row time and set it to the current row
	for (int i = 0; parentRow != null && i < parentRow.getRows().size(); i++)
	{
		if(i > 0 && parentRow.getRows().get(i).getValue().equals(cell.getRow().getValue()))
		{
			DynamicGridColumn column = getColumn(TIME_COL);
			if(column != null)
			{
				DynamicGridCell timCell = parentRow.getRows().get(i-1).getCells().get(column);
				if(timCell != null)
				{
					Object previousTime = timCell.getValue();
					if(previousTime instanceof Time)
						cell.setValue(previousTime); 
				}
			}
			
			break;
		}
	}
}
 
Example 12
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
public boolean isPocSelected(AssessmentQuestionRefVo voAssessmQuestion)
{
	for (int i = 0; i < grid.getRows().size(); i++)
	{
		DynamicGridRow row = grid.getRows().get(i);
		
		if(row.getIdentifier() instanceof AssessmentQuestionVo && row.getIdentifier().equals(voAssessmQuestion))
		{
			DynamicGridColumn column = this.grid.getColumns().getByIdentifier(POC_COLUMN);
			if(column != null)
			{
				DynamicGridCell cell = row.getCells().get(column);
				if(cell.getValue() instanceof Boolean)
					return ((Boolean)cell.getValue()).booleanValue();
			}
		}
	}
	
	return false;
}
 
Example 13
Project: AvoinApotti   File: MyOrderQuestionsPopulation.java   View source code 6 votes vote down vote up
private DynamicGridCell addAnswerCell(DynamicGridRow row, DynamicGridColumn column, QuestionAnswerTypeVo configAnswer, AnswerDetailsVo instAnswer, boolean readOnly)  throws PresentationLogicException
{
	checkDataIntegrity(configAnswer);

	DynamicCellType cellAnswerType = getCellAnswerType(configAnswer.getAnswerType());
	DynamicGridCell cell = row.getCells().newCell(column, cellAnswerType);
	
	cell.setWidth(getCellAnswerWidth(configAnswer, instAnswer));
	cell.setDecoratorType(DynamicCellDecoratorMode.ALWAYS);
	cell.setIdentifier(configAnswer);
	cell.setReadOnly(readOnly);
	setAnswerCellValue(cell, configAnswer, instAnswer);
	setCellAnswer(cell, instAnswer);
	
	if (instAnswer == null)
	{
		setCellTooltip(cell, configAnswer);
	}
	else //WDEV-16927
	{
		setCellAnswerTooltip(cell, instAnswer);
	}
	
	return cell;
}
 
Example 14
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void addAnaesthetisRow(LocalAnaestheticAdministeredVo localAnaestheticAdministeredVo)
{
	DynamicGridRow newRow = form.lyr1().tabDetails().ctn1().dyngrdAnaesthetis().getRows().newRow();
	newRow.setValue(localAnaestheticAdministeredVo);

	DynamicGridColumn column = null;
	DynamicGridCell cell = null;

	column = form.lyr1().tabDetails().ctn1().dyngrdAnaesthetis().getColumns().getByIdentifier(COL_DRUG);
	cell = newRow.getCells().newCell(column, DynamicCellType.ENUMERATION);

	populateLocalAnaesthetic(ims.clinical.vo.lookups.LookupHelper.getLocalAnaesthetic(domain.getLookupService()), cell);
	cell.setValue(localAnaestheticAdministeredVo != null ? localAnaestheticAdministeredVo.getLocalAnaesthetic() : null);
	cell.setAutoPostBack(true);
	updateCell(cell);

	column = form.lyr1().tabDetails().ctn1().dyngrdAnaesthetis().getColumns().getByIdentifier(COL_MLS);
	cell = newRow.getCells().newCell(column, DynamicCellType.DECIMAL);
	cell.setValue(localAnaestheticAdministeredVo != null ? localAnaestheticAdministeredVo.getMls() : null);
	form.lyr1().tabDetails().ctn1().dyngrdAnaesthetis().setSelectedRow(null);
}
 
Example 15
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void createStaticColumns(boolean flatView, Integer questionColumnWidth, boolean isComplete)
{
	if (flatView && this.questionImage != null && this.mandatoryQuestionImage != null)
		createImageColumnWhenFlat();

	DynamicGridColumn questionColumn = this.grid.getColumns().newColumn(flatView ? "Question" : "Group / Question", QUESTION_COLUMN);
	questionColumn.setCanGrow(false);
	questionColumn.setWidth(questionColumnWidth == null ? (isDPP ? DEFAULT_QUESTION_COLUMN_WIDTH - 50 : DEFAULT_QUESTION_COLUMN_WIDTH) : questionColumnWidth.intValue());

	if (!isComplete)
	{
		DynamicGridColumn buttonColumn = this.grid.getColumns().newColumn("", BUTTON_COLUMN);
		buttonColumn.setAlignment(Alignment.CENTER);
		buttonColumn.setCanGrow(false);
		buttonColumn.setWidth(0);
	}
}
 
Example 16
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private DynamicGridCell addAnswerCell(DynamicGridRow row, DynamicGridColumn column, Question_AnswerTypeVo configAnswer, Answer_DetailsVo instAnswer, boolean readOnly) throws PresentationLogicException 
{
	checkDataIntegrity(configAnswer);

	DynamicCellType cellAnswerType = getCellAnswerType(configAnswer.getAnswerType());
	DynamicGridCell cell = row.getCells().newCell(column, cellAnswerType);
	
	cell.setWidth(getCellAnswerWidth(configAnswer, instAnswer));
	cell.setDecoratorType(DynamicCellDecoratorMode.ALWAYS);
	cell.setIdentifier(configAnswer);
	cell.setReadOnly(readOnly);
	setAnswerCellValue(cell, configAnswer, instAnswer);				
	setCellTooltip(cell, configAnswer);
	if(isDPP && cellAnswerType != null && cellAnswerType.equals(DynamicCellType.MULTISELECT))
	{
		cell.setAutoPostBack(true);
	}
	
	return cell;
}
 
Example 17
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
/**
 * WDEV-12569
 * Function used to check for stages not yet configured for the tumour site 
 */
private boolean hasUnconfiguredStages()
{
	// Check for overall value (other values should be populated)
	for (int i = 0; i < form.dyngrdOverall().getRows().size(); i++)
	{
		DynamicGridColumn column = form.dyngrdOverall().getColumns().getByIdentifier(COL_OVERALL);
		DynamicGridRow row = form.dyngrdOverall().getRows().get(i);

		// If the row has an active overall value
		// Use the LiteVo version for value as this is the smallest type of VO
		if (row.getValue() instanceof TumourGroupSiteOverallStagingLiteVo && ((TumourGroupSiteOverallStagingLiteVo)row.getValue()).getIsActive())
		{
			DynamicGridCell cell = row.getCells().get(column);

			// If the value is null or TOBECONFIGURED (-2151) then return as having stages not configured
			if (cell.getValue() == null || TumourOverallStage.TOBECONFIGURED.equals(cell.getValue()))
				return true;
		}
	}

	// All stages are configured
	return false;
}
 
Example 18
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void initGridComments()
{
	form.dyngrdComments().clear();
	DynamicGridColumnCollection columns = form.dyngrdComments().getColumns();
	DynamicGridColumn newColumn = columns.newColumn("Authoring Date/Time", COLUMN_ADTE, true);
	newColumn.setWidth(COLUMN_ADTEWIDTH);

	newColumn = columns.newColumn("Authoring HCP", COLUMN_AHCP, true);
	newColumn.setWidth(COLUMN_AHCPWIDTH);

	newColumn = columns.newColumn("Comments", COLUMN_COMMENTS, true);
	newColumn.setWidth(COLUMN_COMMENTSWIDTH);
	newColumn.setCanGrow(true);

	form.dyngrdComments().setSelectable(true);
}
 
Example 19
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private DynamicGridCell addAnswerCell(DynamicGridRow row, DynamicGridColumn column, QuestionAnswerTypeVo configAnswer, AnswerDetailsVo instAnswer, boolean readOnly) throws PresentationLogicException 
{
	checkDataIntegrity(configAnswer);

	DynamicCellType cellAnswerType = getCellAnswerType(configAnswer.getAnswerType());
	DynamicGridCell cell = row.getCells().newCell(column, cellAnswerType);
	
	cell.setWidth(getCellAnswerWidth(configAnswer, instAnswer));
	cell.setDecoratorType(DynamicCellDecoratorMode.ALWAYS);
	cell.setIdentifier(configAnswer);
	cell.setReadOnly(readOnly);
	setAnswerCellValue(cell, configAnswer, instAnswer);				
	setCellTooltip(cell, configAnswer);
	if(isDPP && cellAnswerType != null && cellAnswerType.equals(DynamicCellType.MULTISELECT))
	{
		cell.setAutoPostBack(true);
	}
	
	return cell;
}
 
Example 20
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void setColAuthoringDetails(ClinicalNotesShortVoCollection voCollNotes, int i, DynamicGridRow row)
{
	DynamicGridColumn col = getCol("Authoring Details");
	
	if(col == null)
		throw new DomainRuntimeException("No column for Identifier");

	DynamicGridCell dateCell = row.getCells().newCell(col, DynamicCellType.WRAPTEXT);
	StringBuffer value = new StringBuffer();
	
	if(voCollNotes.get(i).getAuthoringInfo().getAuthoringHcpIsNotNull())
		value.append("HCP: " + voCollNotes.get(i).getAuthoringInfo().getAuthoringHcp().toString());
	
	if(voCollNotes.get(i).getAuthoringInfo().getAuthoringDateTimeIsNotNull())
	{
		if(value.length() > 0)
			value.append("\n");
		value.append("Date:" + voCollNotes.get(i).getAuthoringInfo().getAuthoringDateTime().toString());
	}
	
	dateCell.setValue(value.toString());
}
 
Example 21
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void addLineSeparator()
{
	DynamicGridRow messageRow = form.lyrRules().tabActions().dyngrdActions().getSelectedRow();
	if (messageRow != null)
	{
		DynamicGridRow lineSeparatorInstanceRow = messageRow.getRows().newRow();
		DynamicGridColumn lineSeparatorInstanceColl = getColByIndexForActionGrid(0);
		if (lineSeparatorInstanceColl == null)
		{
			lineSeparatorInstanceColl = createColumnForActionGrid("", 0);
		}
		DynamicGridCell lineSeparatorInstanceCell = lineSeparatorInstanceRow.getCells().newCell(lineSeparatorInstanceColl, DynamicCellType.HTMLVIEW);
		lineSeparatorInstanceCell.setAutoPostBack(true);
		lineSeparatorInstanceCell.setWidth(250);
		lineSeparatorInstanceCell.setValue("--- Line Separator ---");
		lineSeparatorInstanceRow.setIdentifier(NOTIFICATION_LINE_SEPARATOR_INSTANCE);
	}
}
 
Example 22
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private DynamicGridRow getIdentifierRow(DynamicGridRow row, DynamicGridColumn column, PatientId identifier) 
{
	if(row == null)
		return null;
	
	for(int i=0; i<row.getRows().size(); i++)
	{
		if(row.getRows().get(i).getValue().equals(identifier.getType()) && (row.getRows().get(i).getCells().get(column) == null || (row.getRows().get(i).getCells().get(column) != null && row.getRows().get(i).getCells().get(column).getValue() == null)))
		{
			return row.getRows().get(i);
		}
	}
	
	DynamicGridRow childRow = row.getRows().newRow();
	
	DynamicGridCell cell = childRow.getCells().newCell(getColumn(COL_FIELD_NAME), DynamicCellType.STRING);
	cell.setValue("<b>" + identifier.getType().getText() + "</b>");
	cell.setReadOnly(true);
	
	childRow.setValue(identifier.getType());
	return childRow;
}
 
Example 23
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void initialiseDetailsGrid()
{
	DynamicGridColumn col1 = form.dyngrdDetails().getColumns().newColumn("Movement", MOVEMENT_COLUMN);
	col1.setWidth(250);

	DynamicGridColumn col2 = form.dyngrdDetails().getColumns().newColumn("Equipment", EQUIPMENT_COLUMN);
	col2.setWidth(150);

	DynamicGridColumn col3 = form.dyngrdDetails().getColumns().newColumn("Other Equipment", OTHEREQUIPMENT_COLUMN);
	col3.setWidth(100);

	DynamicGridColumn col4 = form.dyngrdDetails().getColumns().newColumn("No. of Staff", NOOFSTAFF_COLUMN);
	col4.setWidth(160);
	
	DynamicGridColumn col5 = form.dyngrdDetails().getColumns().newColumn("Details", DETAILS_COLUMN);
	col5.setWidth(150);
	
	form.dyngrdDetails().setReadOnly(true);
	
}
 
Example 24
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void initializeDynamicGrid()
{		
	form.lyrContract().tabContractChargeItems().dyngrdContractCharge().clear();
	form.lyrContract().tabContractChargeItems().dyngrdContractCharge().setSelectable(true);		
	
	DynamicGridColumn colCheck = form.lyrContract().tabContractChargeItems().dyngrdContractCharge().getColumns().newColumn(" ", COL_CHECK);
	colCheck.setWidth(60);
	
	DynamicGridColumn colName = form.lyrContract().tabContractChargeItems().dyngrdContractCharge().getColumns().newColumn("Name", COL_NAME);
	colName.setWidth(300);	

	DynamicGridColumn colCategory = form.lyrContract().tabContractChargeItems().dyngrdContractCharge().getColumns().newColumn("Cost Price", COL_COST);
	colCategory.setWidth(80);	

	DynamicGridColumn colType = form.lyrContract().tabContractChargeItems().dyngrdContractCharge().getColumns().newColumn("Base Price", COL_BASE);
	colType.setWidth(80);	
	
	DynamicGridColumn colUser = form.lyrContract().tabContractChargeItems().dyngrdContractCharge().getColumns().newColumn("MarkUp Price", COL_MARKUP);
	colUser.setWidth(80);	
}
 
Example 25
Project: AvoinApotti   File: ResultDisplayHelper.java   View source code 6 votes vote down vote up
private void addCommentsToResult(DynamicGridRow row, ResultComponentCommentsVoCollection resultComments)
{
	if (resultComments == null)
		return;
	for (int i = 0 ; i < resultComments.size() ; i++)
	{
		DynamicGridRow newRow = row.getRows().newRow();
		DynamicGridColumn colTest = grid.getColumns().getByIdentifier(ResultDisplayHelper.COL_TEST);
		DynamicGridCell cell = newRow.getCells().newCell(colTest,DynamicCellType.WRAPTEXT);
		cell.setReadOnly(true);//WDEV-16232
		cell.setValue(resultComments.get(i).getCmtText());
		colTest.setCanGrow(true);
		colTest.setDynamicWidthSupported(true);
		cell.setWidth(700);
	}
	
}
 
Example 26
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void setColNeedReviewed(DynamicGridRow row, ClinicalNotesShortVoCollection voCollNotes, int i)
{
	DynamicGridColumn col = getCol("ICON");
	
	if(col == null)
		throw new DomainRuntimeException("No column for ICON");

	DynamicGridCell iconCell = row.getCells().newCell(col, DynamicCellType.IMAGE);

	StringBuffer value = new StringBuffer();

	if (voCollNotes.get(i).getForReviewDisciplineIsNotNull() &&
			voCollNotes.get(i).getSourceOfNoteIsNotNull())
	{
			value.append("Review Discipline: " + voCollNotes.get(i).getForReviewDiscipline().toString().toUpperCase());
	}
	
	iconCell.setTooltip(value.toString());
	iconCell.setValue(form.getImages().Admin.ClinicalTeam);
}
 
Example 27
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void addQuestionLegend(Assessment_QuestionVo question, DynamicGridRow groupRow)
{
	DynamicGridColumn questionColumn = this.grid.getColumns().getByIdentifier(QUESTION_COLUMN);
	DynamicGridRow row;

	if (groupRow != null)
		row = groupRow.getRows().newRow();
	else
		row = this.grid.getRows().newRow();

	row.setSelectable(false);

	questionColumn.setDynamicWidthSupported(true);

	DynamicGridCell questionCell = row.getCells().newCell(questionColumn, DynamicCellType.HTMLVIEW);
	questionCell.setValue(question.getLegendText());
	questionCell.setWidth(DEFAULT_LEGEND_CELL_WIDTH);
	questionCell.setReadOnly(true);

}
 
Example 28
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void setDefaultTimeValue(DynamicGridCell cell)
{
	DynamicGridRow parentRow = cell.getRow().getParent();
	//Get Previous row time and set it to the current row
	for (int i = 0; parentRow != null && i < parentRow.getRows().size(); i++)
	{
		if(i > 0 && parentRow.getRows().get(i).getValue().equals(cell.getRow().getValue()))
		{
			DynamicGridColumn column = getColumn(TIME_COL);
			if(column != null)
			{
				DynamicGridCell timCell = parentRow.getRows().get(i-1).getCells().get(column);
				if(timCell != null)
				{
					Object previousTime = timCell.getValue();
					if(previousTime instanceof Time)
						cell.setValue(previousTime);
				}
			}
			
			break;
		}
	}
	if (cell.getValue() == null)
		cell.setValue(new Time()); 

}
 
Example 29
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void createSeedColumns()
{
	form.dyngrdParameters().clear();
	DynamicGridColumn nameCol = form.dyngrdParameters().getColumns().newColumn("Name", NAME_COLUMN);
	nameCol.setWidth(250);
	nameCol.setBackColor(Color.Gray);
	nameCol.setReadOnly(true);

	DynamicGridColumn seedCol = form.dyngrdParameters().getColumns().newColumn("Value", VALUE_COLUMN);
	seedCol.setWidth(205);
	
	DynamicGridColumn mandatoryCol = form.dyngrdParameters().getColumns().newColumn("", MANDATORY_COLUMN);
	mandatoryCol.setWidth(-1);
	mandatoryCol.setAlignment(Alignment.CENTER);
}
 
Example 30
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void initializeDynamicGrid()
{
	form.dyngrdPrescription().clear();
	form.dyngrdPrescription().setSelectable(true);	
	
	DynamicGridColumn column;
	column = form.dyngrdPrescription().getColumns().newColumn("", COL_DATE);
	column.setWidth(200);		
	column.setCanGrow(false);
	column.setReadOnly(true);
		
	column = form.dyngrdPrescription().getColumns().newColumn("", COL_USER);
	column.setWidth(200);
	column.setCanGrow(true);
			
	column = form.dyngrdPrescription().getColumns().newColumn("", COL_DRUG);
	column.setWidth(200);		
	column.setCanGrow(false);
	
	column = form.dyngrdPrescription().getColumns().newColumn("", COL_FREQUENCY);
	column.setWidth(100);
	column.setCanGrow(true);
	
	column = form.dyngrdPrescription().getColumns().newColumn("", COL_DAYS_SUPPLY);
	column.setWidth(60);
	column.setCanGrow(true);
}
 
Example 31
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
/**
 * Function used to retrieve a column with given identifier from prognostic dyanmic grid
 */
private DynamicGridColumn getPrognosticColumnByIdentifier(Object identifer)
{
	if (identifer == null)
		return null;
	
	return form.lyrMain().tabTumourDetails().lyrPrognosticTNM().tabPrognosticTab().dyngrdPrognosticPreTreatment().getColumns().getByIdentifier(identifer);
}
 
Example 32
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
/**
 * 
 */
private void initializeDynamicGrid()
{
	// Allow un-selection
	form.dyngrdRules().setUnselectable(true);

	// Set up the columns
	DynamicGridColumn column;

	column = form.dyngrdRules().getColumns().newColumn("", COL_IMAGE);
	column.setWidth(20);
	column.setAlignment(Alignment.RIGHT);
	column.setCanGrow(false);

	column = form.dyngrdRules().getColumns().newColumn("Name", COL_RULE_NAME);
	column.setWidth(300);
	column.setAlignment(Alignment.LEFT);
	column.setCanGrow(true);

	column = form.dyngrdRules().getColumns().newColumn("Category", COL_RULE_CATEGORY);
	column.setWidth(200);
	column.setCanGrow(true);

	column = form.dyngrdRules().getColumns().newColumn("Entity", COL_RULE_BUSINESS_OBJECT);
	column.setWidth(200);
	column.setCanGrow(true);

	column = form.dyngrdRules().getColumns().newColumn("Status", COL_RULE_STATUS);
	column.setWidth(60);
	column.setCanGrow(false);
}
 
Example 33
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void initializeFlagsGrid()
{
	form.dyngrdFlags().clear();

	DynamicGridColumn col = form.dyngrdFlags().getColumns().newColumn("Group", COL_GROUP);
	col.setWidth(85);
	col.setCanGrow(Boolean.TRUE);
	col.setReadOnly(Boolean.TRUE);
	col.setSortMode(SortMode.AUTOMATIC);

	col = form.dyngrdFlags().getColumns().newColumn("Configuration Flag", COL_FLAG);
	col.setWidth(300);
	col.setCanGrow(Boolean.TRUE);
	col.setReadOnly(Boolean.TRUE);
	col.setSortMode(SortMode.AUTOMATIC);

	col = form.dyngrdFlags().getColumns().newColumn("Default Value",COL_DEFAULT);
	col.setWidth(175);
	col.setCanGrow(Boolean.TRUE);
	col.setReadOnly(Boolean.TRUE);

	col = form.dyngrdFlags().getColumns().newColumn("Current Value",COL_CURRENT);
	col.setWidth(200);
	col.setCanGrow(Boolean.TRUE);
	col.setReadOnly(Boolean.TRUE);

	col = form.dyngrdFlags().getColumns().newColumn("Last Updated Date/Time",COL_UPD_DATE);
	col.setWidth(-1);
	col.setCanGrow(Boolean.TRUE);
	col.setReadOnly(Boolean.TRUE);
	col.setSortMode(SortMode.MANUAL);
}
 
Example 34
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void initializeDynamicGrid()
{
	form.dyngrdReasons().clear();
	form.dyngrdReasons().setSelectable(true);
	
	DynamicGridColumn reasonColumn = null;
	reasonColumn = form.dyngrdReasons().getColumns().newColumn(" ", false);				
	reasonColumn.setIdentifier("REASON");
	reasonColumn.setWidth(-1);
	reasonColumn.setSortMode(SortMode.AUTOMATIC);
}
 
Example 35
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View source code 5 votes vote down vote up
public void notifyFormModeChange(FormMode formMode)
{
	DynamicGridColumn buttonColumn = this.grid.getColumns().getByIdentifier(BUTTON_COLUMN);
	if(buttonColumn != null)
	{
		buttonColumn.setWidth(formMode == FormMode.EDIT ? DEFAULT_BUTTON_CELL_WIDTH : 0);
	}			
}
 
Example 36
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void newConsultantAssociationRow(DynamicGridRow parrentRow, MedicLiteVo medic)
{
	if (parrentRow == null)
		throw new CodingRuntimeException("Major Logical Error - Can not add consultant association row to a null parrent row");
	
	if (medic == null)
		return;

	
	DynamicGridCell newCell;
	DynamicGridColumn column;
	
	// Create a new row
	DynamicGridRow newRow = parrentRow.getRows().newRow();
	newRow.setValue(medic);
	
	// Create the fist cell in the row (IMAGE)
	column = form.dyngrdAssociations().getColumns().getByIdentifier(COL_IMAGE);
	newCell = newRow.getCells().newCell(column, DynamicCellType.IMAGE);
	newCell.setValue(form.getImages().Core.User);
	
	// Create the second cell in the row (STRING)
	column = form.dyngrdAssociations().getColumns().getByIdentifier(COL_ASSOCIATION);
	newCell = newRow.getCells().newCell(column, DynamicCellType.STRING);
	newCell.setValue(medic.getName().toString());
	newCell.setReadOnly(true);
}
 
Example 37
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private DynamicGridColumn getColumn(String columnIdentifier)
{
	if (columnIdentifier == null)
		return null;

	return form.dyngrdParameters().getColumns().getByIdentifier(columnIdentifier);
}
 
Example 38
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void initializeDynamicGrdMotor()
{
	form.dyngrdMotor().clear();
	DynamicGridColumn colMotor = form.dyngrdMotor().getColumns().newColumn("Area/Movements", MOTOR_COLUMN, true);
	colMotor.setWidth(600);

	DynamicGridColumn colRight = form.dyngrdMotor().getColumns().newColumn("Right", RIGHT_COLUMN, false);
	colRight.setWidth(100);
	
	DynamicGridColumn colLeft = form.dyngrdMotor().getColumns().newColumn("Left", LEFT_COLUMN, false);
	colLeft.setWidth(-1);
}
 
Example 39
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void setColCorrect(DynamicGridRow row)
{
	DynamicGridColumn col = getCol("CORRECT");
	if (col == null)
		throw new DomainRuntimeException("No column for CORRECT");

	DynamicGridCell correctCell = row.getCells().newCell(col, DynamicCellType.IMAGE);
	correctCell.setValue(form.getImages().Core.CareSpell);
}
 
Example 40
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void initDynAssessmentGrid()
{
	form.dyngrdAssessments().clear();
	
	DynamicGridColumn column_parent = form.dyngrdAssessments().getColumns().getByIdentifier(HEADER_COLUMN);
	if(column_parent == null)
		column_parent = form.dyngrdAssessments().getColumns().newColumn("Patient Assessment", HEADER_COLUMN);
	column_parent.setWidth(HEADER_COLUMN_WIDTH);
	column_parent.setCanGrow(true);
			
	DynamicGridColumn column_status = form.dyngrdAssessments().getColumns().getByIdentifier(STATUS_COLUMN);
	if(column_status == null)
		column_status = form.dyngrdAssessments().getColumns().newColumn("Status", STATUS_COLUMN);
	column_status.setWidth(STATUS_COLUMN_WIDTH);
	column_status.setCanGrow(false);
					
	DynamicGridColumn column_reason = form.dyngrdAssessments().getColumns().getByIdentifier(REASON_COLUMN);
	if(column_reason == null)
		column_reason = form.dyngrdAssessments().getColumns().newColumn("Reason", REASON_COLUMN);
	column_reason.setWidth(REASON_COLUMN_WIDTH);
	column_reason.setCanGrow(false);
			
	DynamicGridColumn column_url_help = form.dyngrdAssessments().getColumns().getByIdentifier(HELP_URL_COLUMN);
	if(column_url_help == null)
		column_url_help = form.dyngrdAssessments().getColumns().newColumn("URL", HELP_URL_COLUMN);
	column_url_help.setWidth(HELP_URL_COLUMN_WIDTH);
	column_url_help.setCanGrow(false);
	column_url_help.setHeaderAlignment(Alignment.CENTER);
	column_url_help.setAlignment(Alignment.CENTER);
	
	DynamicGridColumn column_authoring = form.dyngrdAssessments().getColumns().getByIdentifier(AUTHORING_COLUMN);
	if(column_authoring == null)
		column_authoring = form.dyngrdAssessments().getColumns().newColumn("Authoring Information", AUTHORING_COLUMN);
	column_authoring.setWidth(AUTHORING_COLUMN_WIDTH);
	column_authoring.setCanGrow(false);
}