Search in sources :

Example 1 with Column

use of org.jmesa.view.component.Column in project OpenClinica by OpenClinica.

the class EventStatusView method setCustomCellEditors.

/**
	     * Setting the group cell editor.
	     */
private void setCustomCellEditors() {
    List<Column> columns = getTable().getRow().getColumns();
    for (Column column : columns) {
        CellEditor decoratedCellEditor = column.getCellRenderer().getCellEditor();
        column.getCellRenderer().setCellEditor(new GroupCellEditor(decoratedCellEditor));
    }
}
Also used : Column(org.jmesa.view.component.Column) GroupCellEditor(org.jmesa.view.editor.GroupCellEditor) CellEditor(org.jmesa.view.editor.CellEditor) GroupCellEditor(org.jmesa.view.editor.GroupCellEditor)

Example 2 with Column

use of org.jmesa.view.component.Column in project OpenClinica by OpenClinica.

the class StudyStatisticsView method setCustomCellEditors.

/**
	     * Setting the group cell editor.
	     */
private void setCustomCellEditors() {
    List<Column> columns = getTable().getRow().getColumns();
    for (Column column : columns) {
        CellEditor decoratedCellEditor = column.getCellRenderer().getCellEditor();
        column.getCellRenderer().setCellEditor(new GroupCellEditor(decoratedCellEditor));
    }
}
Also used : Column(org.jmesa.view.component.Column) GroupCellEditor(org.jmesa.view.editor.GroupCellEditor) CellEditor(org.jmesa.view.editor.CellEditor) GroupCellEditor(org.jmesa.view.editor.GroupCellEditor)

Example 3 with Column

use of org.jmesa.view.component.Column 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();
}
Also used : RuleActionBean(org.akaza.openclinica.domain.rule.action.RuleActionBean) HtmlTable(org.jmesa.view.html.component.HtmlTable) Table(org.jmesa.view.component.Table) BasicCellEditor(org.jmesa.view.editor.BasicCellEditor) HtmlColumn(org.jmesa.view.html.component.HtmlColumn) Column(org.jmesa.view.component.Column) CellEditor(org.jmesa.view.editor.CellEditor) BasicCellEditor(org.jmesa.view.editor.BasicCellEditor) ArrayList(java.util.ArrayList) List(java.util.List) Row(org.jmesa.view.component.Row) HtmlRow(org.jmesa.view.html.component.HtmlRow)

Example 4 with Column

use of org.jmesa.view.component.Column in project OpenClinica by OpenClinica.

the class StatisticsView method setCustomCellEditors.

/**
	     * Setting the group cell editor.
	     */
private void setCustomCellEditors() {
    List<Column> columns = getTable().getRow().getColumns();
    for (Column column : columns) {
        CellEditor decoratedCellEditor = column.getCellRenderer().getCellEditor();
        column.getCellRenderer().setCellEditor(new GroupCellEditor(decoratedCellEditor));
    }
}
Also used : Column(org.jmesa.view.component.Column) GroupCellEditor(org.jmesa.view.editor.GroupCellEditor) CellEditor(org.jmesa.view.editor.CellEditor) GroupCellEditor(org.jmesa.view.editor.GroupCellEditor)

Example 5 with Column

use of org.jmesa.view.component.Column in project OpenClinica by OpenClinica.

the class StudySubjectStatusView method setCustomCellEditors.

/**
	     * Setting the group cell editor.
	     */
private void setCustomCellEditors() {
    List<Column> columns = getTable().getRow().getColumns();
    for (Column column : columns) {
        CellEditor decoratedCellEditor = column.getCellRenderer().getCellEditor();
        column.getCellRenderer().setCellEditor(new GroupCellEditor(decoratedCellEditor));
    }
}
Also used : Column(org.jmesa.view.component.Column) GroupCellEditor(org.jmesa.view.editor.GroupCellEditor) CellEditor(org.jmesa.view.editor.CellEditor) GroupCellEditor(org.jmesa.view.editor.GroupCellEditor)

Aggregations

Column (org.jmesa.view.component.Column)5 CellEditor (org.jmesa.view.editor.CellEditor)5 GroupCellEditor (org.jmesa.view.editor.GroupCellEditor)4 ArrayList (java.util.ArrayList)1 List (java.util.List)1 RuleActionBean (org.akaza.openclinica.domain.rule.action.RuleActionBean)1 Row (org.jmesa.view.component.Row)1 Table (org.jmesa.view.component.Table)1 BasicCellEditor (org.jmesa.view.editor.BasicCellEditor)1 HtmlColumn (org.jmesa.view.html.component.HtmlColumn)1 HtmlRow (org.jmesa.view.html.component.HtmlRow)1 HtmlTable (org.jmesa.view.html.component.HtmlTable)1