use of org.talend.commons.ui.swt.formtools.LabelledCheckboxCombo in project tdi-studio-se by Talend.
the class JSONFileStep2Form method checkFieldsValue.
/**
* Ensures that fields are set. Update checkEnable / use to checkConnection().
*
* @return
*/
@Override
protected boolean checkFieldsValue() {
previewInformationLabel.setText(" " + "The settings must be completed to show the preview");
updateStatus(IStatus.OK, null);
previewButton.setEnabled(false);
String msg = fieldsTableEditorView.checkColumnNames();
if (!StringUtils.isEmpty(msg)) {
updateStatus(IStatus.ERROR, msg);
return false;
} else {
previewButton.setEnabled(true);
}
// Labelled Checkbox Combo (Row to Skip and Limit)
ArrayList<LabelledCheckboxCombo> labelledCheckboxCombo2Control = new ArrayList<LabelledCheckboxCombo>();
Iterator<LabelledCheckboxCombo> iCheckboxCombo;
LabelledCheckboxCombo labelledCheckboxCombo;
for (iCheckboxCombo = labelledCheckboxCombo2Control.iterator(); iCheckboxCombo.hasNext(); ) {
labelledCheckboxCombo = iCheckboxCombo.next();
// if the checkbox is checked, check Numeric value
if (labelledCheckboxCombo.getCheckbox().getSelection()) {
if (labelledCheckboxCombo.getText() == "") {
updateStatus(IStatus.ERROR, labelledCheckboxCombo.getLabelText() + "must be specified");
return false;
}
}
}
//$NON-NLS-1$
previewInformationLabel.setText("");
String pathStr = getConnection().getJSONFilePath();
if (isContextMode()) {
ContextType contextType = ConnectionContextHelper.getContextTypeForContextMode(connectionItem.getConnection(), connectionItem.getConnection().getContextName());
pathStr = TalendQuoteUtils.removeQuotes(ConnectionContextHelper.getOriginalValue(contextType, pathStr));
}
previewButton.setEnabled(true);
updateStatus(IStatus.OK, null);
return true;
}
Aggregations