Search in sources :

Example 1 with MapperSettingModel

use of org.talend.designer.mapper.model.MapperSettingModel in project tdi-studio-se by Talend.

the class MapReducePropertySetDialog method okPressed.

@Override
protected void okPressed() {
    MapperSettingModel currentModel = settingsManager.getCurrnentModel();
    currentModel.setReplicatedJoin(replicatedJoinButton.getSelection());
    super.okPressed();
}
Also used : MapperSettingModel(org.talend.designer.mapper.model.MapperSettingModel)

Example 2 with MapperSettingModel

use of org.talend.designer.mapper.model.MapperSettingModel in project tdi-studio-se by Talend.

the class PropertySetDialog method updateStatus.

private void updateStatus() {
    final MapperSettingModel defaultModel = settingsManager.getDefaultModel();
    if (defaultModel.isDieOnError() == dieOnErrorButton.getSelection()) {
        dieOnErrorButton.setBackground(null);
    } else {
        dieOnErrorButton.setBackground(color);
    }
    if (defaultModel.isLookInParallel() == lookupInParallelButton.getSelection()) {
        lookupInParallelButton.setBackground(null);
    } else {
        lookupInParallelButton.setBackground(color);
    }
    if (defaultModel.isEnableAutoConvertType() == enableAutoConvertTypeBtn.getSelection()) {
        enableAutoConvertTypeBtn.setBackground(null);
    } else {
        enableAutoConvertTypeBtn.setBackground(color);
    }
    if (defaultModel.getTempDataDir().equals(directoryField.getText())) {
        directoryField.getTextControl().setBackground(null);
        directoryField.setToolTipText(null);
    } else {
        directoryField.getTextControl().setBackground(color);
        directoryField.setToolTipText("Default is empty.");
    }
    if (defaultModel.getRowBufferSize().equals(sizeField.getText())) {
        sizeField.getTextControl().setBackground(null);
        sizeField.setToolTipText(null);
    } else {
        sizeField.getTextControl().setBackground(color);
        sizeField.setToolTipText("Default is 2000000.");
    }
}
Also used : MapperSettingModel(org.talend.designer.mapper.model.MapperSettingModel)

Example 3 with MapperSettingModel

use of org.talend.designer.mapper.model.MapperSettingModel in project tdi-studio-se by Talend.

the class PropertySetDialog method okPressed.

@Override
protected void okPressed() {
    // bug TDI-19070
    if (directoryField.getText() != null && StringUtils.trimToNull(directoryField.getText()) != null && (!directoryField.getText().startsWith(QUOTATION_MARK) || !directoryField.getText().endsWith(QUOTATION_MARK))) {
        directoryField.setText(TalendQuoteUtils.addQuotesIfNotExist(directoryField.getText()));
    }
    MapperSettingModel currentModel = settingsManager.getCurrnentModel();
    currentModel.setDieOnError(dieOnErrorButton.getSelection());
    currentModel.setLookInParallel(lookupInParallelButton.getSelection());
    currentModel.setEnableAutoConvertType(enableAutoConvertTypeBtn.getSelection());
    currentModel.setTempDataDir(directoryField.getText());
    currentModel.setRowBufferSize(sizeField.getText());
    if (dieOnErrorButton.getSelection()) {
        mapperManager.removeRejectOutput();
    } else {
        if (!mapperManager.hasRejectOutput(mapperManager.getOutputTables())) {
            mapperManager.addRejectOutput();
        }
    }
    super.okPressed();
}
Also used : MapperSettingModel(org.talend.designer.mapper.model.MapperSettingModel)

Example 4 with MapperSettingModel

use of org.talend.designer.mapper.model.MapperSettingModel in project tdi-studio-se by Talend.

the class MapperSettingsManager method initCurrnentModel.

private void initCurrnentModel() {
    currentModel = new MapperSettingModel();
    // Ensure that the unmodified fields are the same as the default model.
    currentModel.setReplicatedJoin(defaultModel.isReplicatedJoin());
    currentModel.setDieOnError(defaultModel.isDieOnError());
    currentModel.setLookInParallel(defaultModel.isLookInParallel());
    currentModel.setEnableAutoConvertType(defaultModel.isEnableAutoConvertType());
    currentModel.setTempDataDir(defaultModel.getTempDataDir());
    currentModel.setRowBufferSize(defaultModel.getRowBufferSize());
    AbstractMapComponent component = manager.getAbstractMapComponent();
    IElementParameter parameter = component.getElementParameter(DIE_ON_ERROR);
    if (parameter != null && parameter.getValue() != null && parameter.getValue() instanceof Boolean) {
        currentModel.setDieOnError((Boolean) parameter.getValue());
    }
    parameter = component.getElementParameter(REPLICATED_JOIN);
    if (parameter != null && parameter.getValue() != null && parameter.getValue() instanceof Boolean) {
        currentModel.setReplicatedJoin((Boolean) parameter.getValue());
    }
    parameter = component.getElementParameter(TEMPORARY_DATA_DIRECTORY);
    if (parameter != null && parameter.getValue() != null) {
        currentModel.setTempDataDir(String.valueOf(parameter.getValue()));
    }
    parameter = component.getElementParameter(ROWS_BUFFER_SIZE);
    if (parameter != null && parameter.getValue() != null) {
        currentModel.setRowBufferSize(String.valueOf(parameter.getValue()));
    }
    boolean parallel = false;
    IElementParameter paraEle = component.getElementParameter(LOOKUP_IN_PARALLEL);
    if (paraEle != null) {
        parallel = (Boolean) paraEle.getValue();
    }
    currentModel.setLookInParallel(parallel);
    parameter = component.getElementParameter(ENABLE_AUTO_CONVERT_TYPE);
    if (parameter != null && parameter.getValue() != null && parameter.getValue() instanceof Boolean) {
        currentModel.setEnableAutoConvertType((Boolean) parameter.getValue());
    }
}
Also used : AbstractMapComponent(org.talend.designer.abstractmap.AbstractMapComponent) IElementParameter(org.talend.core.model.process.IElementParameter) MapperSettingModel(org.talend.designer.mapper.model.MapperSettingModel)

Example 5 with MapperSettingModel

use of org.talend.designer.mapper.model.MapperSettingModel in project tdi-studio-se by Talend.

the class PropertySetDialog method init.

private void init() {
    MapperSettingModel currnentModel = settingsManager.getCurrnentModel();
    dieOnErrorButton.setSelection(currnentModel.isDieOnError());
    lookupInParallelButton.setSelection(currnentModel.isLookInParallel());
    enableAutoConvertTypeBtn.setSelection(currnentModel.isEnableAutoConvertType());
    directoryField.setText(StringUtils.trimToEmpty(currnentModel.getTempDataDir()));
    sizeField.setText(StringUtils.trimToEmpty(currnentModel.getRowBufferSize()));
}
Also used : MapperSettingModel(org.talend.designer.mapper.model.MapperSettingModel)

Aggregations

MapperSettingModel (org.talend.designer.mapper.model.MapperSettingModel)7 IElementParameter (org.talend.core.model.process.IElementParameter)1 AbstractMapComponent (org.talend.designer.abstractmap.AbstractMapComponent)1