Search in sources :

Example 6 with IntegerFieldEditor

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);
}
Also used : SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) SelectionEvent(org.eclipse.swt.events.SelectionEvent) IntegerFieldEditor(org.eclipse.jface.preference.IntegerFieldEditor) BooleanFieldEditor(org.eclipse.jface.preference.BooleanFieldEditor) Text(org.eclipse.swt.widgets.Text) IBrandingService(org.talend.core.ui.branding.IBrandingService) CheckBoxFieldEditor(org.talend.commons.ui.swt.preferences.CheckBoxFieldEditor)

Aggregations

IntegerFieldEditor (org.eclipse.jface.preference.IntegerFieldEditor)6 BooleanFieldEditor (org.eclipse.jface.preference.BooleanFieldEditor)3 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)3 SelectionEvent (org.eclipse.swt.events.SelectionEvent)3 GridData (org.eclipse.swt.layout.GridData)3 CheckBoxFieldEditor (org.talend.commons.ui.swt.preferences.CheckBoxFieldEditor)3 GridLayout (org.eclipse.swt.layout.GridLayout)2 Composite (org.eclipse.swt.widgets.Composite)2 Group (org.eclipse.swt.widgets.Group)2 Text (org.eclipse.swt.widgets.Text)2 IBrandingService (org.talend.core.ui.branding.IBrandingService)2 IOException (java.io.IOException)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 FieldEditor (org.eclipse.jface.preference.FieldEditor)1 StringFieldEditor (org.eclipse.jface.preference.StringFieldEditor)1 WizardDialog (org.eclipse.jface.wizard.WizardDialog)1 Button (org.eclipse.swt.widgets.Button)1 Label (org.eclipse.swt.widgets.Label)1 InitFinishMessageDialog (org.talend.designer.esb.runcontainer.ui.dialog.InitFinishMessageDialog)1 AddRuntimeWizard (org.talend.designer.esb.runcontainer.ui.wizard.AddRuntimeWizard)1