use of org.activityinfo.ui.client.component.importDialog.model.strategy.ImportTarget in project activityinfo by bedatadriven.
the class ColumnActionSelector method updateStyles.
public void updateStyles() {
for (Map.Entry<ColumnAction, RadioButton> entry : buttons.entrySet()) {
final ColumnAction columnAction = entry.getKey();
if (columnAction instanceof MapExistingAction) {
final ImportTarget target = ((MapExistingAction) columnAction).getTarget();
final RadioButton button = entry.getValue();
button.removeStyleName(ColumnMappingStyles.INSTANCE.stateBound());
button.removeStyleName(ColumnMappingStyles.INSTANCE.stateUnset());
if (!importModel.getMappedColumns(target.getFormField().getId()).isEmpty()) {
button.addStyleName(ColumnMappingStyles.INSTANCE.stateBound());
} else if (target.getFormField().isRequired()) {
button.addStyleName(ColumnMappingStyles.INSTANCE.stateUnset());
}
}
}
}
use of org.activityinfo.ui.client.component.importDialog.model.strategy.ImportTarget in project activityinfo by bedatadriven.
the class ImportPresenter method createMatchingColumnActions.
private List<MapExistingAction> createMatchingColumnActions() {
final List<MapExistingAction> columnActions = Lists.newArrayList();
final List<ImportTarget> importTargets = importer.getImportTargets();
for (ImportTarget target : importTargets) {
columnActions.add(new MapExistingAction(target));
}
return columnActions;
}
Aggregations