use of org.eclipse.jface.preference.IntegerFieldEditor in project tdi-studio-se by Talend.
the class PerformancePreferencePage method createFieldEditors.
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
*/
@Override
protected void createFieldEditors() {
IBrandingService breaningService = (IBrandingService) GlobalServiceRegister.getDefault().getService(IBrandingService.class);
if (breaningService.isPoweredOnlyCamel()) {
addField(new BooleanFieldEditor(ITalendCorePrefConstants.DEACTIVE_REPOSITORY_UPDATE, //$NON-NLS-1$
Messages.getString("PerformancePreferencePage.display.deactiveRepositoryUpdate"), getFieldEditorParent()));
addField(new BooleanFieldEditor(TalendDesignerPrefConstants.PROPERTY_CODE_CHECK, Messages.getString("PerformancePreferencePage.propertyCodeCheck"), //$NON-NLS-1$
getFieldEditorParent()));
addField(new BooleanFieldEditor(TalendDesignerPrefConstants.GENERATE_CODE_WHEN_OPEN_JOB, //$NON-NLS-1$
Messages.getString("PerformancePreferencePage.generateCode"), getFieldEditorParent()));
addField(new BooleanFieldEditor(TalendDesignerPrefConstants.CHECK_ONLY_LAST_VERSION, //$NON-NLS-1$
Messages.getString("PerformancePreferencePage.checkVersion"), getFieldEditorParent()));
addField(new BooleanFieldEditor(TalendDesignerPrefConstants.PROPAGATE_CONTEXT_VARIABLE, //$NON-NLS-1$
Messages.getString("PerformancePreferencePage.addOrDeleteVariable"), getFieldEditorParent()));
dbConnTimeoutActive = new CheckBoxFieldEditor(ITalendCorePrefConstants.DB_CONNECTION_TIMEOUT_ACTIVED, Messages.getString("PerformancePreferencePage.ActivedTimeoutSetting"), //$NON-NLS-1$
getFieldEditorParent());
dbConnTimeoutActive.getButton().addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
checkDBTimeout();
}
});
dbConnTimeout = new IntegerFieldEditor(ITalendCorePrefConstants.DB_CONNECTION_TIMEOUT, //$NON-NLS-1$
Messages.getString("PerformancePreferencePage.ConnectionTimeout"), getFieldEditorParent());
Text textControl = dbConnTimeout.getTextControl(getFieldEditorParent());
//$NON-NLS-1$
textControl.setToolTipText(Messages.getString("PerformancePreferencePage.ConnectionTimeoutTip"));
dbConnTimeout.setValidRange(0, Short.MAX_VALUE);
textControl.setEnabled(getPreferenceStore().getBoolean(ITalendCorePrefConstants.DB_CONNECTION_TIMEOUT_ACTIVED));
addField(dbConnTimeoutActive);
addField(dbConnTimeout);
addSVNInforAutoCheckFiled();
} else {
addField(new BooleanFieldEditor(ITalendCorePrefConstants.DEACTIVE_REPOSITORY_UPDATE, //$NON-NLS-1$
Messages.getString("PerformancePreferencePage.display.deactiveRepositoryUpdate"), getFieldEditorParent()));
addField(new BooleanFieldEditor(TalendDesignerPrefConstants.PROPERTY_CODE_CHECK, Messages.getString("PerformancePreferencePage.propertyCodeCheck"), //$NON-NLS-1$
getFieldEditorParent()));
addField(new BooleanFieldEditor(TalendDesignerPrefConstants.GENERATE_CODE_WHEN_OPEN_JOB, //$NON-NLS-1$
Messages.getString("PerformancePreferencePage.generateCode"), getFieldEditorParent()));
addField(new BooleanFieldEditor(TalendDesignerPrefConstants.CHECK_ONLY_LAST_VERSION, //$NON-NLS-1$
Messages.getString("PerformancePreferencePage.checkVersion"), getFieldEditorParent()));
addField(new BooleanFieldEditor(TalendDesignerPrefConstants.PROPAGATE_CONTEXT_VARIABLE, //$NON-NLS-1$
Messages.getString("PerformancePreferencePage.addOrDeleteVariable"), getFieldEditorParent()));
dbConnTimeoutActive = new CheckBoxFieldEditor(ITalendCorePrefConstants.DB_CONNECTION_TIMEOUT_ACTIVED, Messages.getString("PerformancePreferencePage.ActivedTimeoutSetting"), //$NON-NLS-1$
getFieldEditorParent());
dbConnTimeoutActive.getButton().addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
checkDBTimeout();
}
});
dbConnTimeout = new IntegerFieldEditor(ITalendCorePrefConstants.DB_CONNECTION_TIMEOUT, //$NON-NLS-1$
Messages.getString("PerformancePreferencePage.ConnectionTimeout"), getFieldEditorParent());
Text textControl = dbConnTimeout.getTextControl(getFieldEditorParent());
//$NON-NLS-1$
textControl.setToolTipText(Messages.getString("PerformancePreferencePage.ConnectionTimeoutTip"));
dbConnTimeout.setValidRange(0, Short.MAX_VALUE);
textControl.setEnabled(getPreferenceStore().getBoolean(ITalendCorePrefConstants.DB_CONNECTION_TIMEOUT_ACTIVED));
addField(dbConnTimeoutActive);
addField(dbConnTimeout);
addField(new BooleanFieldEditor(ITalendCorePrefConstants.ADD_USER_ROUTINES, //$NON-NLS-1$
Messages.getString("PerformancePreferencePage.addAllUserRoutines"), getFieldEditorParent()));
// TDI-8323:remove this one,we do not need this since we always add all system routines for new job
// addField(new BooleanFieldEditor(ITalendCorePrefConstants.ADD_SYSTEM_ROUTINES, Messages
// .getString("PerformancePreferencePage.addAllSystemRoutines"),//$NON-NLS-1$
// getFieldEditorParent()));
addSVNInforAutoCheckFiled();
}
IntegerFieldEditor codeFormatTimeout = new IntegerFieldEditor(ITalendCorePrefConstants.PERFORMANCE_JAVA_PROCESS_CODE_FORMATE_TIMEOUT, //$NON-NLS-1$
Messages.getString("PerformancePreferencePage.CodeFormatTimeout"), getFieldEditorParent());
codeFormatTimeout.setValidRange(1, Short.MAX_VALUE);
addField(codeFormatTimeout);
}
Aggregations