Search in sources :

Example 1 with BooleanFieldEditor

use of org.eclipse.jface.preference.BooleanFieldEditor in project tdi-studio-se by Talend.

the class SqlBuilderPreferencePage method createFieldEditors.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
     */
@Override
protected void createFieldEditors() {
    booleanFieldEditor = new BooleanFieldEditor(ITalendCorePrefConstants.SQL_ADD_QUOTE, Messages.getString("SqlBuilderPreferencePage.AddQuotes"), //$NON-NLS-1$
    getFieldEditorParent());
    choiceAS4Sql = new RadioGroupFieldEditor(ITalendCorePrefConstants.AS400_SQL_SEG, Messages.getString("SqlBuilderPreferencePage.AS400SqlGen"), 1, new String[][] { //$NON-NLS-1$
    { Messages.getString("SqlBuilderPreferencePage.StandardSQL"), STANDARD_MODE }, { Messages.getString("SqlBuilderPreferencePage.SystemSQL"), SYSTEM_MODE } }, //$NON-NLS-1$
    getFieldEditorParent());
    sqlwarn = new BooleanFieldEditor(ITalendCorePrefConstants.SQL_ADD_WARNING, //$NON-NLS-1$
    Messages.getString("SqlBuilderPreferencePage.sql"), getFieldEditorParent());
    // dbConnTimeoutActive = new CheckBoxFieldEditor(ITalendCorePrefConstants.DB_CONNECTION_TIMEOUT_ACTIVED,
    // Messages
    //                .getString("SqlBuilderPreferencePage.ActivedTimeoutSetting"), getFieldEditorParent()); //$NON-NLS-1$
    // dbConnTimeoutActive.getButton().addSelectionListener(new SelectionAdapter() {
    //
    // public void widgetSelected(SelectionEvent e) {
    // checkDBTimeout();
    // }
    // });
    // dbConnTimeout = new IntegerFieldEditor(ITalendCorePrefConstants.DB_CONNECTION_TIMEOUT, Messages
    //                .getString("SqlBuilderPreferencePage.ConnectionTimeout"), //$NON-NLS-1$
    // getFieldEditorParent());
    // Text textControl = dbConnTimeout.getTextControl(getFieldEditorParent());
    //        textControl.setToolTipText(Messages.getString("SqlBuilderPreferencePage.ConnectionTimeoutTip")); //$NON-NLS-1$
    // dbConnTimeout.setValidRange(0, Short.MAX_VALUE);
    addField(booleanFieldEditor);
    addField(choiceAS4Sql);
    addField(sqlwarn);
// addField(dbConnTimeoutActive);
// addField(dbConnTimeout);
}
Also used : RadioGroupFieldEditor(org.eclipse.jface.preference.RadioGroupFieldEditor) BooleanFieldEditor(org.eclipse.jface.preference.BooleanFieldEditor)

Example 2 with BooleanFieldEditor

use of org.eclipse.jface.preference.BooleanFieldEditor in project tesb-studio-se by Talend.

the class RunContainerPreferencePage method createPageContents.

/**
     * Create contents of the preference page.
     * 
     * @param parent
     */
@Override
public Control createPageContents(Composite parent) {
    serverFieldEditors = new ArrayList<FieldEditor>();
    optionFieldEditors = new ArrayList<FieldEditor>();
    runtimeEnable = getPreferenceStore().getBoolean(RunContainerPreferenceInitializer.P_ESB_IN_OSGI);
    GridLayout gridLayoutDefault = new GridLayout(1, false);
    Composite body = new Composite(parent, SWT.NONE);
    body.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    body.setLayout(gridLayoutDefault);
    getPreferenceStore().getBoolean(RunContainerPreferenceInitializer.P_ESB_IN_OSGI);
    useOSGiEditor = new BooleanFieldEditor(RunContainerPreferenceInitializer.P_ESB_IN_OSGI, "ESB Studio Runtime - Use Local Talend Runtime (OSGi Container)", body);
    addField(useOSGiEditor);
    Label lblNote = new Label(body, SWT.WRAP);
    lblNote.setText("Note: It will be only taken into account for an ESB Artifact:\n" + "  · A Route (Any Route)\n" + "  · A DataService (SOAP/REST)\n" + "  · A Job contains tRESTClient or tESBConsumer component");
    Group groupServer = new Group(body, SWT.NONE);
    //$NON-NLS-1$
    groupServer.setText(RunContainerMessages.getString("RunContainerPreferencePage.Group1"));
    groupServer.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    groupServer.setLayout(new GridLayout(2, false));
    compositeServerBody = new Composite(groupServer, SWT.BORDER);
    compositeServerBody.setLayout(gridLayoutDefault);
    compositeServerBody.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    StringFieldEditor locationEditor = new StringFieldEditor(RunContainerPreferenceInitializer.P_ESB_RUNTIME_LOCATION, RunContainerMessages.getString("RunContainerPreferencePage.Location"), //$NON-NLS-1$
    compositeServerBody);
    addField(locationEditor);
    serverFieldEditors.add(locationEditor);
    StringFieldEditor hostFieldEditor = new StringFieldEditor(RunContainerPreferenceInitializer.P_ESB_RUNTIME_HOST, RunContainerMessages.getString("RunContainerPreferencePage.Host"), compositeServerBody);
    addField(hostFieldEditor);
    // only support local runtime server, if need support remote server ,enable this editor
    hostFieldEditor.setEnabled(false, compositeServerBody);
    StringFieldEditor userFieldEditor = new StringFieldEditor(RunContainerPreferenceInitializer.P_ESB_RUNTIME_USERNAME, RunContainerMessages.getString("RunContainerPreferencePage.Username"), //$NON-NLS-1$
    compositeServerBody);
    addField(userFieldEditor);
    serverFieldEditors.add(userFieldEditor);
    StringFieldEditor passwordFieldEditor = new StringFieldEditor(RunContainerPreferenceInitializer.P_ESB_RUNTIME_PASSWORD, RunContainerMessages.getString("RunContainerPreferencePage.Password"), //$NON-NLS-1$
    compositeServerBody);
    addField(passwordFieldEditor);
    serverFieldEditors.add(passwordFieldEditor);
    StringFieldEditor instanceFieldEditor = new StringFieldEditor(RunContainerPreferenceInitializer.P_ESB_RUNTIME_INSTANCE, RunContainerMessages.getString("RunContainerPreferencePage.Instance"), //$NON-NLS-1$
    compositeServerBody);
    addField(instanceFieldEditor);
    serverFieldEditors.add(instanceFieldEditor);
    IntegerFieldEditor portFieldEditor = new IntegerFieldEditor(RunContainerPreferenceInitializer.P_ESB_RUNTIME_PORT, RunContainerMessages.getString("RunContainerPreferencePage.Port"), //$NON-NLS-1$
    compositeServerBody);
    addField(portFieldEditor);
    serverFieldEditors.add(portFieldEditor);
    StringFieldEditor jmxPortFieldEditor = new StringFieldEditor(RunContainerPreferenceInitializer.P_ESB_RUNTIME_JMX_PORT, RunContainerMessages.getString("RunContainerPreferencePage.JMXPort"), //$NON-NLS-1$
    compositeServerBody);
    addField(jmxPortFieldEditor);
    serverFieldEditors.add(jmxPortFieldEditor);
    Composite compBtn = new Composite(groupServer, SWT.NONE);
    GridData gridDataBtn = new GridData(SWT.LEFT, SWT.FILL, false, true, 1, 1);
    gridDataBtn.widthHint = 100;
    compBtn.setLayoutData(gridDataBtn);
    GridLayout layoutCompBtn = new GridLayout(1, false);
    layoutCompBtn.marginWidth = 0;
    layoutCompBtn.marginHeight = 0;
    compBtn.setLayout(layoutCompBtn);
    buttonAddServer = new Button(compBtn, SWT.NONE);
    buttonAddServer.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    buttonAddServer.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            AddRuntimeWizard dirWizard = new AddRuntimeWizard(locationEditor.getStringValue());
            dirWizard.setNeedsProgressMonitor(true);
            WizardDialog wizardDialog = new WizardDialog(getShell(), dirWizard);
            if (wizardDialog.open() == Window.OK) {
                locationEditor.setStringValue(dirWizard.getTarget());
            }
        }
    });
    //$NON-NLS-1$
    buttonAddServer.setText(RunContainerMessages.getString("RunContainerPreferencePage.ServerButton"));
    // Button btnTestConnection = new Button(compBtn, SWT.NONE);
    // btnTestConnection.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    // btnTestConnection.setText("Server Info...");
    buttonInitalizeServer = new Button(compBtn, SWT.NONE);
    buttonInitalizeServer.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    //$NON-NLS-1$
    buttonInitalizeServer.setText(RunContainerMessages.getString("RunContainerPreferencePage.InitalizeButton"));
    buttonInitalizeServer.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            if (initalizeRuntime(locationEditor.getStringValue(), hostFieldEditor.getStringValue())) {
                try {
                    new InitFinishMessageDialog(getShell(), JMXUtil.getBundlesName()).open();
                } catch (Exception ex) {
                    ex.printStackTrace();
                }
            }
        }
    });
    Group groupOption = new Group(body, SWT.NONE);
    groupOption.setLayout(gridLayoutDefault);
    groupOption.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    //$NON-NLS-1$
    groupOption.setText(RunContainerMessages.getString("RunContainerPreferencePage.Group2"));
    compositeOptionBody = new Composite(groupOption, SWT.NONE);
    compositeOptionBody.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    BooleanFieldEditor filterLogEditor = new BooleanFieldEditor(RunContainerPreferenceInitializer.P_ESB_RUNTIME_SYS_LOG, RunContainerMessages.getString("RunContainerPreferencePage.FilterLogs"), //$NON-NLS-1$
    compositeOptionBody);
    addField(filterLogEditor);
    optionFieldEditors.add(filterLogEditor);
    manager = ProcessManager.getInstance();
    return body;
}
Also used : IntegerFieldEditor(org.eclipse.jface.preference.IntegerFieldEditor) BooleanFieldEditor(org.eclipse.jface.preference.BooleanFieldEditor) FieldEditor(org.eclipse.jface.preference.FieldEditor) StringFieldEditor(org.eclipse.jface.preference.StringFieldEditor) Group(org.eclipse.swt.widgets.Group) Composite(org.eclipse.swt.widgets.Composite) InitFinishMessageDialog(org.talend.designer.esb.runcontainer.ui.dialog.InitFinishMessageDialog) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) Label(org.eclipse.swt.widgets.Label) BooleanFieldEditor(org.eclipse.jface.preference.BooleanFieldEditor) InvocationTargetException(java.lang.reflect.InvocationTargetException) IOException(java.io.IOException) StringFieldEditor(org.eclipse.jface.preference.StringFieldEditor) AddRuntimeWizard(org.talend.designer.esb.runcontainer.ui.wizard.AddRuntimeWizard) GridLayout(org.eclipse.swt.layout.GridLayout) Button(org.eclipse.swt.widgets.Button) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) IntegerFieldEditor(org.eclipse.jface.preference.IntegerFieldEditor) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Example 3 with BooleanFieldEditor

use of org.eclipse.jface.preference.BooleanFieldEditor in project tdi-studio-se by Talend.

the class RunProcessPreferencePage method createFieldEditors.

/**
     * DOC chuang Comment method "addConsoleFont".
     */
// private void addConsoleFont() {
// Group group = new Group(parent, SWT.NONE);
// group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
// group.setLayout(new GridLayout(1, false));
//        group.setText(Messages.getString("RunProcessPreferencePage.outputConsole")); //$NON-NLS-1$
//
// Composite composite = new Composite(group, SWT.NONE);
// composite.setLayout(new GridLayout(3, false));
// GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
// gridData.grabExcessHorizontalSpace = true;
// gridData.horizontalSpan = 3;
// composite.setLayoutData(gridData);
// consoleFontField = new FontFieldEditor(RunProcessPrefsConstants.CONSOLE_FONT, Messages
//                .getString("RunProcessPreferencePage.consoleFont"), composite); //$NON-NLS-1$
//
// }
/**
     * Create all field editors for this page.
     */
@Override
public void createFieldEditors() {
    parent = new Composite(getFieldEditorParent(), SWT.NONE);
    GridLayout gridLayout = new GridLayout(1, false);
    gridLayout.marginBottom = 0;
    gridLayout.marginWidth = 0;
    gridLayout.marginTop = 0;
    gridLayout.marginRight = 0;
    gridLayout.marginLeft = 0;
    gridLayout.marginHeight = 0;
    parent.setLayout(gridLayout);
    GridData gridData = new GridData(GridData.FILL_BOTH);
    parent.setLayoutData(gridData);
    clientGroup = new Group(parent, SWT.NONE);
    //$NON-NLS-1$
    clientGroup.setText(Messages.getString("prefs.clientConfiguration"));
    GridLayout layout = new GridLayout();
    layout.numColumns = 1;
    clientGroup.setLayout(layout);
    GridData gd = new GridData(GridData.FILL_HORIZONTAL);
    clientGroup.setLayoutData(gd);
    // /////////////////////////////////////////////////////////////////////////////
    // CLIENT_STATS_PORTS
    Composite compositeStatsPorts = new Composite(clientGroup, SWT.NONE);
    compositeStatsPorts.setLayoutData(new GridData(GridData.FILL_BOTH));
    gridLayout = new GridLayout(2, true);
    compositeStatsPorts.setLayout(gridLayout);
    Composite compositeStatsPort1 = new Composite(compositeStatsPorts, SWT.NONE);
    compositeStatsPort1.setLayoutData(new GridData(GridData.FILL_BOTH));
    gridLayout = new GridLayout(2, true);
    compositeStatsPort1.setLayout(gridLayout);
    fClientStatPortEditor = new IntegerFieldEditor(RunProcessPrefsConstants.CLIENT_STATS_PORT_BOUND1, Messages.getString("prefs.clientStatsPortBound1"), //$NON-NLS-1$
    compositeStatsPort1);
    addField(fClientStatPortEditor);
    fClientStatPortEditor.setValidRange(1024, 65535);
    //$NON-NLS-1$
    fClientStatPortEditor.setErrorMessage(Messages.getString("runProcessRemote.clientStatInvalidRange"));
    Composite compositeStatsPort2 = new Composite(compositeStatsPorts, SWT.NONE);
    compositeStatsPort2.setLayoutData(new GridData(GridData.FILL_BOTH));
    gridLayout = new GridLayout(2, true);
    compositeStatsPort2.setLayout(gridLayout);
    fClientStatPortEditor = new IntegerFieldEditor(RunProcessPrefsConstants.CLIENT_STATS_PORT_BOUND2, Messages.getString("prefs.clientStatsPortBound2"), //$NON-NLS-1$
    compositeStatsPort2);
    addField(fClientStatPortEditor);
    fClientStatPortEditor.setValidRange(1024, 65535);
    //$NON-NLS-1$
    fClientStatPortEditor.setErrorMessage(Messages.getString("prefs.clientStatInvalidRange"));
    // /////////////////////////////////////////////////////////////////////////////
    // /////////////////////////////////////////////////////////////////////////////
    // CLIENT_TRACE_PORTS
    Composite compositeTracePorts = new Composite(clientGroup, SWT.NONE);
    compositeTracePorts.setLayoutData(new GridData(GridData.FILL_BOTH));
    gridLayout = new GridLayout(2, true);
    compositeTracePorts.setLayout(gridLayout);
    Composite compositeTracePorts1 = new Composite(compositeTracePorts, SWT.NONE);
    compositeTracePorts1.setLayoutData(new GridData(GridData.FILL_BOTH));
    gridLayout = new GridLayout(2, true);
    compositeTracePorts1.setLayout(gridLayout);
    fClientStatPortEditor = new IntegerFieldEditor(RunProcessPrefsConstants.CLIENT_TRACE_PORT_BOUND1, Messages.getString("prefs.clientTracePortBound1"), //$NON-NLS-1$
    compositeTracePorts1);
    addField(fClientStatPortEditor);
    fClientStatPortEditor.setValidRange(1024, 65535);
    //$NON-NLS-1$
    fClientStatPortEditor.setErrorMessage(Messages.getString("prefs.clientStatInvalidRange"));
    Composite compositeTracePort2 = new Composite(compositeTracePorts, SWT.NONE);
    compositeTracePort2.setLayoutData(new GridData(GridData.FILL_BOTH));
    gridLayout = new GridLayout(2, true);
    compositeTracePort2.setLayout(gridLayout);
    fClientStatPortEditor = new IntegerFieldEditor(RunProcessPrefsConstants.CLIENT_TRACE_PORT_BOUND2, Messages.getString("prefs.clientTracePortBound2"), //$NON-NLS-1$
    compositeTracePort2);
    addField(fClientStatPortEditor);
    fClientStatPortEditor.setValidRange(1024, 65535);
    //$NON-NLS-1$
    fClientStatPortEditor.setErrorMessage(Messages.getString("prefs.clientStatInvalidRange"));
    // /////////////////////////////////////////////////////////////////////////////
    Composite compositeStateTraceRun = new Composite(clientGroup, SWT.NONE);
    compositeStateTraceRun.setLayoutData(new GridData(GridData.FILL_BOTH));
    GridLayout gridLayoutStateTraceRun = new GridLayout(3, true);
    compositeStateTraceRun.setLayout(gridLayoutStateTraceRun);
    Composite compositeSaveBeforeRun = new Composite(compositeStateTraceRun, SWT.NONE);
    compositeSaveBeforeRun.setLayoutData(new GridData(GridData.FILL_BOTH));
    GridLayout gridLayoutSaveBeforeRun = new GridLayout(1, true);
    compositeSaveBeforeRun.setLayout(gridLayoutSaveBeforeRun);
    onSavebeforeField = new BooleanFieldEditor(RunProcessPrefsConstants.ISSAVEBEFORERUN, //$NON-NLS-1$
    Messages.getString("RunProcessPreferencePage.save"), //$NON-NLS-1$
    SWT.NONE, compositeSaveBeforeRun);
    addField(onSavebeforeField);
    Composite compositeClearBeforeRun = new Composite(compositeStateTraceRun, SWT.NONE);
    compositeClearBeforeRun.setLayoutData(new GridData(GridData.FILL_BOTH));
    GridLayout gridLayoutClearBeforeRun = new GridLayout(1, true);
    compositeClearBeforeRun.setLayout(gridLayoutClearBeforeRun);
    onClearbeforeField = new BooleanFieldEditor(RunProcessPrefsConstants.ISCLEARBEFORERUN, //$NON-NLS-1$
    Messages.getString("RunProcessPreferencePage.clear"), //$NON-NLS-1$
    SWT.NONE, compositeClearBeforeRun);
    addField(onClearbeforeField);
    Composite compositeExecTimeRun = new Composite(compositeStateTraceRun, SWT.NONE);
    compositeExecTimeRun.setLayoutData(new GridData(GridData.FILL_BOTH));
    GridLayout gridLayoutExecTimeRun = new GridLayout(1, true);
    compositeExecTimeRun.setLayout(gridLayoutExecTimeRun);
    onExecTimeField = new BooleanFieldEditor(RunProcessPrefsConstants.ISEXECTIMERUN, //$NON-NLS-1$
    Messages.getString("RunProcessPreferencePage.execTime"), //$NON-NLS-1$
    SWT.NONE, compositeExecTimeRun);
    addField(onExecTimeField);
    Composite compositeStatisticsRun = new Composite(compositeStateTraceRun, SWT.NONE);
    compositeStatisticsRun.setLayoutData(new GridData(GridData.FILL_BOTH));
    GridLayout gridLayoutStatisticsRun = new GridLayout(1, true);
    compositeStatisticsRun.setLayout(gridLayoutStatisticsRun);
    onStatisticsField = new BooleanFieldEditor(RunProcessPrefsConstants.ISSTATISTICSRUN, //$NON-NLS-1$
    Messages.getString("RunProcessPreferencePage.statistics"), //$NON-NLS-1$
    SWT.NONE, compositeStatisticsRun);
    addField(onStatisticsField);
    Composite compositeTracesRun = new Composite(compositeStateTraceRun, SWT.NONE);
    compositeTracesRun.setLayoutData(new GridData(GridData.FILL_BOTH));
    GridLayout gridLayoutTracesRun = new GridLayout(1, false);
    compositeTracesRun.setLayout(gridLayoutTracesRun);
    onTracesField = new BooleanFieldEditor(RunProcessPrefsConstants.ISTRACESRUN, Messages.getString("RunProcessPreferencePage.traces"), SWT.NONE, //$NON-NLS-1$
    compositeTracesRun);
    addField(onTracesField);
    Composite compositeTracesTime = new Composite(compositeStateTraceRun, SWT.NONE);
    compositeTracesTime.setLayoutData(new GridData(GridData.FILL_BOTH));
    GridLayout gridLayoutTracesTime = new GridLayout(1, false);
    compositeTracesTime.setLayout(gridLayoutTracesTime);
    tracesTime = new IntegerFieldEditor(RunProcessPrefsConstants.STRACESTIME, Messages.getString("RunProcessPreferencePage.pauseTime"), //$NON-NLS-1$
    compositeTracesTime);
    addField(tracesTime);
    // 0004895: Font size of the output console are very small
    // addConsoleFont();
    Composite argumentsComposite = new Composite(parent, SWT.NONE);
    argumentsComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
    GridLayout gridLayoutArguments = new GridLayout(1, false);
    argumentsComposite.setLayout(gridLayoutArguments);
    String text = "RunProcessPreferencePage.vmArgument";
    IBrandingService breaningService = (IBrandingService) GlobalServiceRegister.getDefault().getService(IBrandingService.class);
    if (breaningService.isPoweredOnlyCamel()) {
        text = "RunProcessPreferencePage.RouteVmArgument";
    }
    VMArgumentsViewer argumentsViewer = new //$NON-NLS-1$
    VMArgumentsViewer(//$NON-NLS-1$
    RunProcessPrefsConstants.VMARGUMENTS, //$NON-NLS-1$
    Messages.getString(text), argumentsComposite);
    addField(argumentsViewer);
    manager = ProcessManager.getInstance();
}
Also used : Group(org.eclipse.swt.widgets.Group) GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) GridData(org.eclipse.swt.layout.GridData) IntegerFieldEditor(org.eclipse.jface.preference.IntegerFieldEditor) BooleanFieldEditor(org.eclipse.jface.preference.BooleanFieldEditor) IBrandingService(org.talend.core.ui.branding.IBrandingService)

Example 4 with BooleanFieldEditor

use of org.eclipse.jface.preference.BooleanFieldEditor in project tdi-studio-se by Talend.

the class DesignerPreferencePage method createFieldEditors.

/**
     * Creates the field editors. Field editors are abstractions of the common GUI blocks needed to manipulate various
     * types of preferences. Each field editor knows how to save and restore itself.
     */
@Override
public void createFieldEditors() {
    StringFieldEditor labelField;
    StringFieldEditor hintField;
    StringFieldEditor connectionField;
    BooleanFieldEditor showHint;
    // BooleanFieldEditor displayComponent;
    BooleanFieldEditor useRepositoryName;
    // BooleanFieldEditor deactiveRepositoryUpdate;
    labelField = new StringFieldEditor(TalendDesignerPrefConstants.DEFAULT_LABEL, //$NON-NLS-1$
    Messages.getString("DesignerPreferencePage.component.defaultLabel"), getFieldEditorParent());
    hintField = new StringFieldEditor(TalendDesignerPrefConstants.DEFAULT_HINT, //$NON-NLS-1$
    Messages.getString("DesignerPreferencePage.component.defaultHint"), getFieldEditorParent());
    connectionField = new StringFieldEditor(TalendDesignerPrefConstants.DEFAULT_CONNECTION_FORMAT, Messages.getString("DesignerPreferencePage.defaultConnection"), //$NON-NLS-1$
    getFieldEditorParent());
    showHint = new BooleanFieldEditor(TalendDesignerPrefConstants.DEFAULT_HINT_USED, //$NON-NLS-1$
    Messages.getString("DesignerPreferencePage.hintShowed"), getFieldEditorParent());
    // displayComponent = new BooleanFieldEditor(TalendDesignerPrefConstants.DEFAULT_DISPLAY, Messages
    // .getString("DesignerPreferencePage.display.hiddenComponents"), getFieldEditorParent()); //$NON-NLS-1$
    useRepositoryName = new BooleanFieldEditor(TalendDesignerPrefConstants.USE_REPOSITORY_NAME, Messages.getString("DesignerPreferencePage.display.useRepositoryName"), //$NON-NLS-1$
    getFieldEditorParent());
    // deactiveRepositoryUpdate = new BooleanFieldEditor(ITalendCorePrefConstants.DEACTIVE_REPOSITORY_UPDATE,
    // Messages
    //                .getString("DesignerPreferencePage.display.deactiveRepositoryUpdate"), getFieldEditorParent()); //$NON-NLS-1$
    addField(labelField);
    addField(hintField);
    addField(connectionField);
    addField(showHint);
    // addField(displayComponent);
    addField(useRepositoryName);
    // addField(deactiveRepositoryUpdate);
    // addField(new BooleanFieldEditor(TalendDesignerPrefConstants.PROPERTY_CODE_CHECK, Messages
    //                .getString("DesignerPreferencePage.propertyCodeCheck"), getFieldEditorParent())); //$NON-NLS-1$
    BooleanFieldEditor antialiasing;
    antialiasing = new BooleanFieldEditor(TalendDesignerPrefConstants.EDITOR_ANTIALIASING, Messages.getString("DesignerPreferencePage.actionInJobDesigner"), //$NON-NLS-1$
    getFieldEditorParent());
    addField(antialiasing);
    BooleanFieldEditor lineStyle;
    lineStyle = new BooleanFieldEditor(TalendDesignerPrefConstants.EDITOR_LINESTYLE, Messages.getString("DesignerPreferencePage.lineStyle"), //$NON-NLS-1$
    getFieldEditorParent());
    addField(lineStyle);
    if (PluginChecker.isTestCasePluginLoaded()) {
        BooleanFieldEditor duplicateTestCases;
        duplicateTestCases = new BooleanFieldEditor(TalendDesignerPrefConstants.DUPLICATE_TESTCASE, Messages.getString("DesignerPreferencePage.duplicateTestCases"), //$NON-NLS-1$
        getFieldEditorParent());
        addField(duplicateTestCases);
    }
    DirectoryFieldEditor compDefaultFileDir = new DirectoryFieldEditor(TalendDesignerPrefConstants.COMP_DEFAULT_FILE_DIR, Messages.getString("DesignerPreferencePage.defaultFilePathDirectory"), getFieldEditorParent()) {

        @Override
        protected // wzhang added to set the separator as "/" of default component filePath in preference.
        String changePressed() {
            File f = new File(getTextControl().getText());
            if (!f.exists()) {
                f = null;
            }
            DirectoryDialog fileDialog = new DirectoryDialog(getShell(), SWT.OPEN);
            if (f != null) {
                fileDialog.setFilterPath(f.getPath());
            }
            String openDir = fileDialog.open();
            if (openDir != null) {
                openDir.trim();
                if (openDir.length() > 0) {
                    File filePath = new File(openDir);
                    if (!filePath.exists()) {
                        return null;
                    }
                }
                return Path.fromOSString(openDir).toPortableString();
            }
            return null;
        }
    };
    addField(compDefaultFileDir);
    RadioGroupFieldEditor largeIconsSizeField = new RadioGroupFieldEditor(TalendDesignerPrefConstants.LARGE_ICONS_SIZE, Messages.getString("DesignerPreferencePage.largeIconsSize"), 2, new String[][] { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ 
    { Messages.getString("DesignerPreferencePage.iconSize24"), "" + 24 }, { Messages.getString("DesignerPreferencePage.iconSize32"), "" + 32 } }, //$NON-NLS-1$ //$NON-NLS-2$
    getFieldEditorParent());
    addField(largeIconsSizeField);
    // disable this feature 1722 for the M1 release as it's not used yet in Perl or Java.
    // RadioGroupFieldEditor schemaOptions = new RadioGroupFieldEditor(
    // TalendDesignerPrefConstants.SCHEMA_OPTIONS,
    // Messages.getString("DesignerPreferencePage.schemaOptions"), 4, new String[][] { { "do nothing", "nothing" },
    // { "die", "die" }, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    // { "warn", "warn" }, { "enlarge or truncate row", "adapt" } }, getFieldEditorParent(), true); //$NON-NLS-1$
    // //$NON-NLS-2$
    // addField(schemaOptions);
    RadioGroupFieldEditor viewOptions = new RadioGroupFieldEditor(TalendDesignerPrefConstants.VIEW_OPTIONS, Messages.getString("DesignerPreferencePage.viewOptions"), 2, new String[][] { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    { Messages.getString("DesignerPreferencePage.compactView"), "default" }, { Messages.getString("DesignerPreferencePage.tableView"), "table view" } }, getFieldEditorParent(), //$NON-NLS-1$ //$NON-NLS-2$
    true);
    addField(viewOptions);
    // BooleanFieldEditor viewSubjobs = new BooleanFieldEditor(TalendDesignerPrefConstants.DISPLAY_SUBJOBS,
    // "Highlight subjobs in the job designs", getFieldEditorParent());
    // addField(viewSubjobs);
    // BooleanFieldEditor generateCodeWhenOpenJob = new BooleanFieldEditor(
    // TalendDesignerPrefConstants.GENERATE_CODE_WHEN_OPEN_JOB, Messages
    //                        .getString("DesignerPreferencePage.generateCode"), //$NON-NLS-1$
    // getFieldEditorParent());
    // addField(generateCodeWhenOpenJob);
    // When updating jobs or joblets, check only the last version, and checked by default
    // BooleanFieldEditor checkOnlyLastVersion = new
    // BooleanFieldEditor(TalendDesignerPrefConstants.CHECK_ONLY_LAST_VERSION,
    //                Messages.getString("DesignerPreferencePage.checkVersion"), getFieldEditorParent()); //$NON-NLS-1$
    // addField(checkOnlyLastVersion);
    // BooleanFieldEditor propagateContextVariable = new BooleanFieldEditor(
    // TalendDesignerPrefConstants.PROPAGATE_CONTEXT_VARIABLE, Messages
    //                        .getString("DesignerPreferencePage.addOrDeleteVariable"), getFieldEditorParent()); //$NON-NLS-1$
    // addField(propagateContextVariable);
    BooleanFieldEditor displayMethodSize = new BooleanFieldEditor(TalendDesignerPrefConstants.DISPLAY_METHOD_SIZE, Messages.getString("DesignerPreferencePage.computeLength"), //$NON-NLS-1$
    getFieldEditorParent());
    addField(displayMethodSize);
    BooleanFieldEditor allowDelConnWithJLTriggLinkCompField = new BooleanFieldEditor(TalendDesignerPrefConstants.NOT_SHOW_WARNING_WHEN_DELETE_LINK_WITH_JOBLETTRIGGERLINKCOMPONENT, Messages.getString("DesignerPreferencePage.notShowWarningDialog"), //$NON-NLS-1$
    getFieldEditorParent());
    addField(allowDelConnWithJLTriggLinkCompField);
}
Also used : StringFieldEditor(org.eclipse.jface.preference.StringFieldEditor) RadioGroupFieldEditor(org.eclipse.jface.preference.RadioGroupFieldEditor) BooleanFieldEditor(org.eclipse.jface.preference.BooleanFieldEditor) DirectoryFieldEditor(org.eclipse.jface.preference.DirectoryFieldEditor) File(java.io.File) DirectoryDialog(org.eclipse.swt.widgets.DirectoryDialog)

Example 5 with BooleanFieldEditor

use of org.eclipse.jface.preference.BooleanFieldEditor in project tdi-studio-se by Talend.

the class DocumentationPreferencePage method createFieldEditors.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
     */
@Override
protected void createFieldEditors() {
    sourceCodeGenFieldEditor = new BooleanFieldEditor(ITalendCorePrefConstants.DOC_GENERATESOURCECODE, org.talend.repository.i18n.Messages.getString("DocumentationPreferencePage.sourceCodeToHTML"), //$NON-NLS-1$
    getFieldEditorParent());
    addField(sourceCodeGenFieldEditor);
    generateLatestVersionFieldEditor = new BooleanFieldEditor(ITalendCorePrefConstants.DOC_GENERATE_LASTEST_VERSION, Messages.getString("PerformancePreferencePage.generateLatestVersion"), //$NON-NLS-1$
    getFieldEditorParent());
    addField(generateLatestVersionFieldEditor);
    // see the bug 7073,qli
    if (isDocumentationPluginLoaded) {
        BooleanFieldEditor booleanFieldEditor = new BooleanFieldEditor(ITalendCorePrefConstants.DOC_GENERATION, Messages.getString("PerformancePreferencePage.autoUpdateDoc"), //$NON-NLS-1$
        getFieldEditorParent());
        addField(booleanFieldEditor);
        FileFieldEditor documentationLogo = new FileFieldEditor(ITalendCorePrefConstants.DOC_USER_LOGO, Messages.getString("DocumentationPreferencePage.userDocLogo"), getFieldEditorParent());
        addField(documentationLogo);
        StringFieldEditor companyName = new StringFieldEditor(ITalendCorePrefConstants.DOC_COMPANY_NAME, Messages.getString("DocumentationPreferencePage.companyName"), getFieldEditorParent());
        addField(companyName);
    }
    useCss = new BooleanFieldEditor(ITalendCorePrefConstants.USE_CSS_TEMPLATE, Messages.getString("DocumentationPreferencePage.use_css_template"), //$NON-NLS-1$
    getFieldEditorParent());
    addField(useCss);
    documentCssFile = new FileFieldEditor(ITalendCorePrefConstants.CSS_FILE_PATH, Messages.getString("DocumentationPreferencePage.css_file"), //$NON-NLS-1$
    getFieldEditorParent());
    //$NON-NLS-1$
    documentCssFile.setFileExtensions(new String[] { "*.css" });
    addField(documentCssFile);
    activateFields(getPreferenceStore().getBoolean(ITalendCorePrefConstants.USE_CSS_TEMPLATE));
    addCssFileListener();
}
Also used : StringFieldEditor(org.eclipse.jface.preference.StringFieldEditor) FileFieldEditor(org.eclipse.jface.preference.FileFieldEditor) BooleanFieldEditor(org.eclipse.jface.preference.BooleanFieldEditor)

Aggregations

BooleanFieldEditor (org.eclipse.jface.preference.BooleanFieldEditor)114 Composite (org.eclipse.swt.widgets.Composite)55 GridData (org.eclipse.swt.layout.GridData)32 IntegerFieldEditor (org.eclipse.jface.preference.IntegerFieldEditor)27 GridLayout (org.eclipse.swt.layout.GridLayout)27 StringFieldEditor (org.eclipse.jface.preference.StringFieldEditor)26 Group (org.eclipse.swt.widgets.Group)23 Label (org.eclipse.swt.widgets.Label)23 ComboFieldEditor (org.eclipse.jface.preference.ComboFieldEditor)13 RadioGroupFieldEditor (org.eclipse.jface.preference.RadioGroupFieldEditor)13 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)11 SelectionEvent (org.eclipse.swt.events.SelectionEvent)11 ColorFieldEditor (org.eclipse.jface.preference.ColorFieldEditor)9 DirectoryFieldEditor (org.eclipse.jface.preference.DirectoryFieldEditor)8 Button (org.eclipse.swt.widgets.Button)8 IPropertyChangeListener (org.eclipse.jface.util.IPropertyChangeListener)5 PropertyChangeEvent (org.eclipse.jface.util.PropertyChangeEvent)5 ScrolledComposite (org.eclipse.swt.custom.ScrolledComposite)5 FileFieldEditor (org.eclipse.jface.preference.FileFieldEditor)4 Text (org.eclipse.swt.widgets.Text)4