use of org.jmesa.view.component.Row in project OpenClinica by OpenClinica.
the class ListEventsForSubjectTableFactory method configureColumns.
@Override
protected void configureColumns(TableFacade tableFacade, Locale locale) {
resword = ResourceBundleProvider.getWordsBundle(locale);
resformat = ResourceBundleProvider.getFormatBundle(locale);
tableFacade.setColumnProperties(columnNames);
Row row = tableFacade.getTable().getRow();
int index = 0;
configureColumn(row.getColumn(columnNames[index]), resword.getString("study_subject_ID"), null, null);
++index;
configureColumn(row.getColumn(columnNames[index]), resword.getString("subject_status"), new StatusCellEditor(), new StatusDroplistFilterEditor());
++index;
configureColumn(row.getColumn(columnNames[index]), resword.getString("site_id"), null, null);
++index;
configureColumn(row.getColumn(columnNames[index]), resword.getString("gender"), null, null, true, false);
++index;
// group class columns
for (int i = index; i < index + studyGroupClasses.size(); i++) {
StudyGroupClassBean studyGroupClass = studyGroupClasses.get(i - index);
configureColumn(row.getColumn(columnNames[i]), studyGroupClass.getName(), new StudyGroupClassCellEditor(studyGroupClass), new SubjectGroupClassDroplistFilterEditor(studyGroupClass), true, false);
}
configureColumn(row.getColumn(columnNames[index + studyGroupClasses.size()]), resword.getString("event_status"), new EventStatusCellEditor(), new SubjectEventStatusDroplistFilterEditor(), true, false);
++index;
configureColumn(row.getColumn(columnNames[index + studyGroupClasses.size()]), resword.getString("event_date"), new EventStartDateCellEditor(), null);
++index;
// crf columns
for (int i = index + studyGroupClasses.size(); i < columnNames.length - 1; i++) {
CRFBean crfBean = crfBeans.get(i - (index + studyGroupClasses.size()));
configureColumn(row.getColumn(columnNames[i]), crfBean.getName(), new EventCrfCellEditor(), new SubjectEventCRFStatusDroplistFilterEditor(), true, false);
}
String actionsHeader = resword.getString("rule_actions") + "               ";
configureColumn(row.getColumn(columnNames[columnNames.length - 1]), actionsHeader, new ActionsCellEditor(), new DefaultActionsEditor(locale), true, false);
}
use of org.jmesa.view.component.Row in project OpenClinica by OpenClinica.
the class ViewCRFServlet method export.
private void export(TableFacade tableFacade) {
// set the column properties
tableFacade.setColumnProperties("versionName", "ruleName", "ruleExpression", "executeOnPlaceHolder", "actionTypePlaceHolder", "actionSummaryPlaceHolder");
Table table = tableFacade.getTable();
table.setCaption("Rules");
Row row = table.getRow();
Column executeOn = row.getColumn("executeOnPlaceHolder");
executeOn.setTitle("Execute On");
executeOn.getCellRenderer().setCellEditor(new CellEditor() {
@SuppressWarnings("unchecked")
public Object getValue(Object item, String property, int rowcount) {
String value = "";
List<RuleActionBean> ruleActions = (List<RuleActionBean>) new BasicCellEditor().getValue(item, "actions", rowcount);
for (int i = 0; i < ruleActions.size(); i++) {
value += ruleActions.get(i).getExpressionEvaluatesTo();
// Do not add horizontal line after last Summary
if (i != ruleActions.size() - 1) {
value += " | ";
}
}
return value;
}
});
Column actionTypePlaceHolder = row.getColumn("actionTypePlaceHolder");
actionTypePlaceHolder.setTitle("Action Type");
actionTypePlaceHolder.getCellRenderer().setCellEditor(new CellEditor() {
@SuppressWarnings("unchecked")
public Object getValue(Object item, String property, int rowcount) {
String value = "";
List<RuleActionBean> ruleActions = (List<RuleActionBean>) new BasicCellEditor().getValue(item, "actions", rowcount);
for (int i = 0; i < ruleActions.size(); i++) {
value += ruleActions.get(i).getActionType().name();
// Do not add horizontal line after last Summary
if (i != ruleActions.size() - 1) {
value += " | ";
}
}
return value;
}
});
Column actionSummaryPlaceHolder = row.getColumn("actionSummaryPlaceHolder");
actionSummaryPlaceHolder.setTitle("Action Summary");
actionSummaryPlaceHolder.getCellRenderer().setCellEditor(new CellEditor() {
@SuppressWarnings("unchecked")
public Object getValue(Object item, String property, int rowcount) {
String value = "";
List<RuleActionBean> ruleActions = (List<RuleActionBean>) new BasicCellEditor().getValue(item, "actions", rowcount);
for (int i = 0; i < ruleActions.size(); i++) {
value += ruleActions.get(i).getSummary();
// Do not add horizontal line after last Summary
if (i != ruleActions.size() - 1) {
value += " | ";
}
}
return value;
}
});
tableFacade.render();
}
use of org.jmesa.view.component.Row in project OpenClinica by OpenClinica.
the class ListNotesTableFactory method configureColumns.
@Override
protected void configureColumns(TableFacade tableFacade, Locale locale) {
tableFacade.setColumnProperties("studySubject.label", "discrepancyNoteBean.disType", "discrepancyNoteBean.resolutionStatus", "siteId", "discrepancyNoteBean.createdDate", "discrepancyNoteBean.updatedDate", "age", "days", "eventName", "eventStartDate", "crfName", "crfStatus", "entityName", "entityValue", "discrepancyNoteBean.entityType", "discrepancyNoteBean.description", "discrepancyNoteBean.detailedNotes", "numberOfNotes", "discrepancyNoteBean.user", "discrepancyNoteBean.owner", "actions");
Row row = tableFacade.getTable().getRow();
configureColumn(row.getColumn("studySubject.label"), resword.getString("study_subject_ID"), null, null, true, true);
configureColumn(row.getColumn("siteId"), resword.getString("site_id"), null, null, true, false);
configureColumn(row.getColumn("discrepancyNoteBean.createdDate"), resword.getString("date_created"), new DateCellEditor(getDateFormat()), null, true, true);
configureColumn(row.getColumn("discrepancyNoteBean.updatedDate"), resword.getString("date_updated"), new DateCellEditor(getDateFormat()), null, true, false);
configureColumn(row.getColumn("eventStartDate"), resword.getString("event_date"), new DateCellEditor(getDateFormat()), null, false, false);
configureColumn(row.getColumn("eventName"), resword.getString("event_name"), null, null, true, false);
configureColumn(row.getColumn("crfName"), resword.getString("CRF"), null, null, true, false);
configureColumn(row.getColumn("crfStatus"), resword.getString("CRF_status"), null, null, false, false);
configureColumn(row.getColumn("entityName"), resword.getString("entity_name"), new EntityNameCellEditor(), null, true, false);
configureColumn(row.getColumn("entityValue"), resword.getString("entity_value"), null, null, true, false);
configureColumn(row.getColumn("discrepancyNoteBean.description"), resword.getString("description"), null, null, true, false);
configureColumn(row.getColumn("discrepancyNoteBean.detailedNotes"), resword.getString("detailed_notes"), null, null, false, false);
configureColumn(row.getColumn("numberOfNotes"), resword.getString("of_notes"), null, null, false, false);
configureColumn(row.getColumn("discrepancyNoteBean.user"), resword.getString("assigned_user"), new AssignedUserCellEditor(), null, true, false);
configureColumn(row.getColumn("discrepancyNoteBean.resolutionStatus"), resword.getString("resolution_status"), new ResolutionStatusCellEditor(), resolutionStatusDropdown, true, false);
configureColumn(row.getColumn("discrepancyNoteBean.disType"), resword.getString("type"), new DiscrepancyNoteTypeCellEditor(), discrepancyNoteTypeDropdown, true, false);
configureColumn(row.getColumn("discrepancyNoteBean.entityType"), resword.getString("entity_type"), null, null, true, false);
configureColumn(row.getColumn("discrepancyNoteBean.owner"), resword.getString("owner"), new OwnerCellEditor(), null, false, false);
String actionsHeader = resword.getString("actions") + "           ";
configureColumn(row.getColumn("actions"), actionsHeader, new ActionsCellEditor(), new DefaultActionsEditor(locale), true, false);
configureColumn(row.getColumn("age"), resword.getString("days_open"), null, null);
configureColumn(row.getColumn("days"), resword.getString("days_since_updated"), null, null);
}
use of org.jmesa.view.component.Row in project OpenClinica by OpenClinica.
the class AuditUserLoginTableFactory method configureColumns.
@Override
protected void configureColumns(TableFacade tableFacade, Locale locale) {
tableFacade.setColumnProperties("userName", "loginAttemptDate", "loginStatus", "details", "actions");
Row row = tableFacade.getTable().getRow();
configureColumn(row.getColumn("userName"), "User Name", null, null);
configureColumn(row.getColumn("loginAttemptDate"), "Attempt Date", new DateCellEditor("yyyy-MM-dd HH:mm:ss"), null);
configureColumn(row.getColumn("loginStatus"), "Status", null, new AvailableDroplistFilterEditor());
configureColumn(row.getColumn("details"), "Details", null, null);
String actionsHeader = resword.getString("actions") + "           ";
configureColumn(row.getColumn("actions"), actionsHeader, new ActionsCellEditor(), new DefaultActionsEditor(locale), true, false);
}
use of org.jmesa.view.component.Row in project OpenClinica by OpenClinica.
the class ListSubjectTableFactory method configureColumns.
@Override
protected void configureColumns(TableFacade tableFacade, Locale locale) {
tableFacade.setColumnProperties("subject.uniqueIdentifier", "studySubjectIdAndStudy", "subject.gender", "subject.createdDate", "subject.owner", "subject.updatedDate", "subject.updater", "subject.status", "actions");
Row row = tableFacade.getTable().getRow();
configureColumn(row.getColumn("subject.uniqueIdentifier"), resword.getString("person_ID"), null, null);
configureColumn(row.getColumn("studySubjectIdAndStudy"), resword.getString("Protocol_Study_subject_IDs"), null, null, true, false);
configureColumn(row.getColumn("subject.gender"), resword.getString("gender"), null, null);
configureColumn(row.getColumn("subject.createdDate"), resword.getString("date_created"), new DateCellEditor(getDateFormat()), null);
configureColumn(row.getColumn("subject.owner"), resword.getString("owner"), new OwnerCellEditor(), null, true, false);
configureColumn(row.getColumn("subject.updatedDate"), resword.getString("date_updated"), new DateCellEditor(getDateFormat()), null);
configureColumn(row.getColumn("subject.updater"), resword.getString("last_updated_by"), new UpdaterCellEditor(), null, true, false);
configureColumn(row.getColumn("subject.status"), resword.getString("status"), new StatusCellEditor(), new StatusDroplistFilterEditor());
configureColumn(row.getColumn("actions"), resword.getString("actions") + // " "
"                                 ", new ActionsCellEditor(), new DefaultActionsEditor(locale), true, false);
// >> tbh #4003, 08/2009
}
Aggregations