Search in sources :

Example 6 with MapExistingAction

use of org.activityinfo.ui.client.component.importDialog.model.MapExistingAction in project activityinfo by bedatadriven.

the class GridHeaderCell method render.

@Override
public void render(Context context, SourceColumn column, SafeHtmlBuilder sb) {
    if (context.getIndex() == ColumnMappingGrid.SOURCE_COLUMN_HEADER_ROW) {
        sb.append(SafeHtmlUtils.fromTrustedString("<span title='" + column.getHeader() + "'>"));
        sb.appendEscaped(column.getHeader());
        sb.append(SafeHtmlUtils.fromTrustedString("</span>"));
    } else {
        ColumnAction action = model.getColumnAction(column);
        if (action == null) {
            sb.appendHtmlConstant(I18N.CONSTANTS.chooseFieldHeading());
        } else if (action == IgnoreAction.INSTANCE) {
            sb.appendEscaped(I18N.CONSTANTS.ignoreColumnAction());
        } else if (action instanceof MapExistingAction) {
            String label = ((MapExistingAction) action).getTarget().getLabel();
            sb.append(SafeHtmlUtils.fromTrustedString("<span title='" + label + "'>"));
            sb.appendEscaped(label);
            sb.append(SafeHtmlUtils.fromTrustedString("</span>"));
        }
    }
}
Also used : ColumnAction(org.activityinfo.ui.client.component.importDialog.model.ColumnAction) MapExistingAction(org.activityinfo.ui.client.component.importDialog.model.MapExistingAction)

Aggregations

MapExistingAction (org.activityinfo.ui.client.component.importDialog.model.MapExistingAction)6 ImportTarget (org.activityinfo.ui.client.component.importDialog.model.strategy.ImportTarget)4 ColumnAction (org.activityinfo.ui.client.component.importDialog.model.ColumnAction)3 Map (java.util.Map)2 RadioButton (org.activityinfo.ui.client.widget.RadioButton)2 FormField (org.activityinfo.model.form.FormField)1 FieldTypeClass (org.activityinfo.model.type.FieldTypeClass)1 SourceColumn (org.activityinfo.ui.client.component.importDialog.model.source.SourceColumn)1 ColumnAccessor (org.activityinfo.ui.client.component.importDialog.model.strategy.ColumnAccessor)1 TargetSiteId (org.activityinfo.ui.client.component.importDialog.model.strategy.TargetSiteId)1