Example usage for org.eclipse.jface.preference StringFieldEditor StringFieldEditor

List of usage examples for org.eclipse.jface.preference StringFieldEditor StringFieldEditor

Introduction

In this page you can find the example usage for org.eclipse.jface.preference StringFieldEditor StringFieldEditor.

Prototype

public StringFieldEditor(String name, String labelText, Composite parent) 

Source Link

Document

Creates a string field editor of unlimited width.

Usage

From source file:com.legstar.eclipse.plugin.jaxwsgen.preferences.JaxwsCixsAdapterPreferencePage.java

License:Open Source License

/**
 * 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.//  w  ww.  j  a  va2 s  .  c o m
 */
public void createFieldEditors() {

    addField(new StringFieldEditor(PreferenceConstants.ADAPTER_WSDL_TARGET_NAMESPACE_PREFIX,
            Messages.preference_wsdl_target_namespace_prefix_label + ':', getFieldEditorParent()));

    addField(new StringFieldEditor(PreferenceConstants.ADAPTER_WSDL_SERVICE_NAME_SUFFIX,
            Messages.preference_wsdl_service_name_suffix_label + ':', getFieldEditorParent()));

    addField(new StringFieldEditor(PreferenceConstants.ADAPTER_WSDL_PORT_NAME_SUFFIX,
            Messages.preference_wsdl_port_name_suffix_label + ':', getFieldEditorParent()));

}

From source file:com.legstar.eclipse.plugin.jaxwsgen.preferences.JaxwsCixsPreferencePage.java

License:Open Source License

/**
 * 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./*from w  w w. ja v  a  2  s. c  o m*/
 */
public void createFieldEditors() {

    super.createFieldEditors();

    addField(new StringFieldEditor(PreferenceConstants.DEFAULT_J2EE_WDD_FOLDER,
            Messages.preference_wdd_folder_label + ':', getFieldEditorParent()));

    addField(new DirectoryFieldEditor(PreferenceConstants.DEFAULT_J2EE_WAR_FOLDER,
            Messages.preference_war_location_label + ':', getFieldEditorParent()));

}

From source file:com.legstar.eclipse.plugin.jaxwsgen.preferences.JaxwsCixsProxyPreferencePage.java

License:Open Source License

/**
 * 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.//from  ww w.ja v a2  s. co m
 */
public void createFieldEditors() {

    addField(new StringFieldEditor(PreferenceConstants.DEFAULT_COBOL_SAMPLE_FOLDER,
            Messages.preference_cobol_folder_label + ':', getFieldEditorParent()));

    /* For now, the only scheme supported by clients is http */
    //      addField(new StringFieldEditor(
    //              PreferenceConstants.PROXY_HTTP_SCHEME,
    //              Messages.preference_proxy_http_scheme_label + ':',
    //              getFieldEditorParent()));

    addField(new StringFieldEditor(PreferenceConstants.PROXY_DEFAULT_HTTP_HOST,
            Messages.preference_proxy_http_host_label + ':', getFieldEditorParent()));

    addField(new StringFieldEditor(PreferenceConstants.PROXY_DEFAULT_HTTP_PORT,
            Messages.preference_proxy_http_port_label + ':', getFieldEditorParent()));

    addField(new StringFieldEditor(PreferenceConstants.PROXY_HTTP_PATH_TEMPLATE,
            Messages.preference_proxy_http_path_template_label + ':', getFieldEditorParent()));
}

From source file:com.legstar.eclipse.plugin.mulegen.preferences.MuleCixsAdapterPreferencePage.java

License:Open Source License

/**
 * 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.// w  w  w  . j a  va  2  s .  c o m
 */
public void createFieldEditors() {

    addField(new StringFieldEditor(PreferenceConstants.ADAPTER_DEFAULT_HTTP_HOST,
            "HTTP " + Messages.adapter_http_host_label + ':', getFieldEditorParent()));
    addField(new StringFieldEditor(PreferenceConstants.ADAPTER_DEFAULT_HTTP_PORT,
            "HTTP " + Messages.adapter_http_port_label + ':', getFieldEditorParent()));
    addField(new StringFieldEditor(PreferenceConstants.ADAPTER_HTTP_PATH,
            "HTTP " + Messages.adapter_http_path_label + ':', getFieldEditorParent()));

    addField(new StringFieldEditor(PreferenceConstants.ADAPTER_DEFAULT_WMQ_JNDI_URL,
            "WMQ " + Messages.adapter_wmq_jndi_url_label + ':', getFieldEditorParent()));
    addField(new StringFieldEditor(PreferenceConstants.ADAPTER_DEFAULT_WMQ_JNDI_CONTEXT_FACTORY,
            "WMQ " + Messages.adapter_wmq_jndi_context_factory_label + ':', getFieldEditorParent()));
    addField(new StringFieldEditor(PreferenceConstants.ADAPTER_DEFAULT_WMQ_CONNECTION_FACTORY,
            "WMQ " + Messages.adapter_wmq_connection_factory_label + ':', getFieldEditorParent()));
    addField(new StringFieldEditor(PreferenceConstants.ADAPTER_DEFAULT_WMQ_ZOS_QUEUE_MANAGER,
            "WMQ " + Messages.adapter_wmq_zos_queue_manager_label + ':', getFieldEditorParent()));
    addField(new StringFieldEditor(PreferenceConstants.ADAPTER_DEFAULT_WMQ_REQUEST_QUEUE,
            "WMQ " + Messages.adapter_wmq_request_queue_label + ':', getFieldEditorParent()));
    addField(new StringFieldEditor(PreferenceConstants.ADAPTER_DEFAULT_WMQ_REPLY_QUEUE,
            "WMQ " + Messages.adapter_wmq_reply_queue_label + ':', getFieldEditorParent()));
    addField(new StringFieldEditor(PreferenceConstants.ADAPTER_DEFAULT_WMQ_ERROR_QUEUE,
            "WMQ " + Messages.adapter_wmq_error_queue_label + ':', getFieldEditorParent()));

    addField(new StringFieldEditor(PreferenceConstants.ADAPTER_DEFAULT_TCP_HOST,
            "TCP " + Messages.adapter_http_host_label + ':', getFieldEditorParent()));
    addField(new StringFieldEditor(PreferenceConstants.ADAPTER_DEFAULT_TCP_PORT,
            "TCP " + Messages.adapter_http_port_label + ':', getFieldEditorParent()));
}

From source file:com.legstar.eclipse.plugin.mulegen.preferences.MuleCixsPreferencePage.java

License:Open Source License

/**
 * 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.//from   w ww.j a  v a2 s .  com
 */
public void createFieldEditors() {

    super.createFieldEditors();

    addField(new DirectoryFieldEditor(PreferenceConstants.MULE_INSTALL_FOLDER,
            Messages.preference_mule_install_location_label + ':', getFieldEditorParent()));

    addField(new DirectoryFieldEditor(PreferenceConstants.MULE_APPS_FOLDER,
            Messages.preference_apps_location_label + ':', getFieldEditorParent()));

    addField(new StringFieldEditor(PreferenceConstants.TARGET_MULE_CONFIG_FOLDER,
            Messages.preference_mule_config_folder_label + ':', getFieldEditorParent()));

}

From source file:com.legstar.eclipse.plugin.mulegen.preferences.MuleCixsProxyPreferencePage.java

License:Open Source License

/**
 * 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.//from  w  w w  . j av  a2s .  com
 */
public void createFieldEditors() {

    addField(new StringFieldEditor(PreferenceConstants.DEFAULT_COBOL_SAMPLE_FOLDER,
            Messages.preference_cobol_folder_label + ':', getFieldEditorParent()));

    addField(new StringFieldEditor(PreferenceConstants.PROXY_DEFAULT_HTTP_HOST,
            "HTTP " + Messages.preference_proxy_http_host_label + ':', getFieldEditorParent()));
    addField(new StringFieldEditor(PreferenceConstants.PROXY_DEFAULT_HTTP_PORT,
            "HTTP " + Messages.preference_proxy_http_port_label + ':', getFieldEditorParent()));
    addField(new StringFieldEditor(PreferenceConstants.PROXY_HTTP_PATH_TEMPLATE,
            "HTTP " + Messages.preference_proxy_http_path_template_label + ':', getFieldEditorParent()));

    addField(new StringFieldEditor(PreferenceConstants.PROXY_DEFAULT_WMQ_JNDI_URL,
            "WMQ " + Messages.proxy_wmq_jndi_url_label + ':', getFieldEditorParent()));
    addField(new StringFieldEditor(PreferenceConstants.PROXY_DEFAULT_WMQ_JNDI_CONTEXT_FACTORY,
            "WMQ " + Messages.proxy_wmq_jndi_context_factory_label + ':', getFieldEditorParent()));
    addField(new StringFieldEditor(PreferenceConstants.PROXY_DEFAULT_WMQ_CONNECTION_FACTORY,
            "WMQ " + Messages.proxy_wmq_connection_factory_label + ':', getFieldEditorParent()));
    addField(new StringFieldEditor(PreferenceConstants.PROXY_DEFAULT_WMQ_ZOS_QUEUE_MANAGER,
            "WMQ " + Messages.proxy_wmq_zos_queue_manager_label + ':', getFieldEditorParent()));
    addField(new StringFieldEditor(PreferenceConstants.PROXY_DEFAULT_WMQ_REQUEST_QUEUE_SUFFIX,
            "WMQ " + Messages.proxy_wmq_request_queue_suffix_label + ':', getFieldEditorParent()));
    addField(new StringFieldEditor(PreferenceConstants.PROXY_DEFAULT_WMQ_REPLY_QUEUE_SUFFIX,
            "WMQ " + Messages.proxy_wmq_reply_queue_suffix_label + ':', getFieldEditorParent()));
    addField(new StringFieldEditor(PreferenceConstants.PROXY_DEFAULT_WMQ_ERROR_QUEUE_SUFFIX,
            "WMQ " + Messages.proxy_wmq_error_queue_suffix_label + ':', getFieldEditorParent()));
}

From source file:com.legstar.eclipse.plugin.schemagen.preferences.SchemaGenPreferencePage.java

License:Open Source License

/**
 * 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.//from  w  w  w . j  a va 2 s  . c  o m
 */
public void createFieldEditors() {

    // createEncodingEditorControls(getFieldEditorParent());
    addField(new ComboFieldEditor32(PreferenceConstants.COBOL_FILES_ENCODING,
            Messages.cobol_files_encoding_label, getEncodings(), getFieldEditorParent()));

    /*
     * -------------------------------------------------------------------
     * COBOL source format related options
     */
    createCodeFormatEditor(getFieldEditorParent());

    addField(new IntegerFieldEditor(PreferenceConstants.DEFAULT_START_COLUMN,
            Messages.preference_default_start_column_label + ':', getFieldEditorParent()));

    addField(new IntegerFieldEditor(PreferenceConstants.DEFAULT_END_COLUMN,
            Messages.preference_default_end_column_label + ':', getFieldEditorParent()));

    /*
     * -------------------------------------------------------------------
     * XML Schema related default options
     */
    addField(new StringFieldEditor(PreferenceConstants.XSD_NAMESPACE_PREFIX,
            Messages.preference_xsd_namespace_prefix_label + ':', getFieldEditorParent()));
    addField(new StringFieldEditor(PreferenceConstants.DEFAULT_XSD_ENCODING,
            Messages.preference_default_xsd_encoding_label + ':', getFieldEditorParent()));
    addField(new BooleanFieldEditor(PreferenceConstants.DEFAULT_XSD_MAP_CONDITIONS_TO_FACETS,
            Messages.preference_default_map_conditions_to_facets_label, getFieldEditorParent()));
    addField(new StringFieldEditor(PreferenceConstants.DEFAULT_XSD_CUSTOM_XSLT_FILE_NAME,
            Messages.preference_default_custom_xslt_file_name_label + ':', getFieldEditorParent()));
    addField(new BooleanFieldEditor(PreferenceConstants.DEFAULT_XSD_NAME_CONFLICT_PREPEND_PARENT_NAME,
            Messages.preference_default_name_conflict_prepend_parent_name_label, getFieldEditorParent()));
    addField(new BooleanFieldEditor(PreferenceConstants.DEFAULT_XSD_ELEMENT_NAMES_START_WITH_UPPERCASE,
            Messages.preference_default_element_names_start_with_uppercase_label, getFieldEditorParent()));

    /*
     * -------------------------------------------------------------------
     * LegStar annotations default options
     */
    addField(new BooleanFieldEditor(PreferenceConstants.DEFAULT_ADD_LEGSTAR_ANNOTATIONS,
            Messages.preference_default_add_legstar_annotations_label, getFieldEditorParent()));

    /*
     * -------------------------------------------------------------------
     * COBOL compiler related options
     */

    addField(new StringFieldEditor(PreferenceConstants.DEFAULT_CURRENCY_SIGN,
            Messages.preference_default_currency_sign_label + ':', getFieldEditorParent()));
    addField(new StringFieldEditor(PreferenceConstants.DEFAULT_CURRENCY_SYMBOL,
            Messages.preference_default_currency_symbol_label + ':', getFieldEditorParent()));
    addField(new BooleanFieldEditor(PreferenceConstants.DEFAULT_DECIMAL_POINT_IS_COMMA,
            Messages.preference_default_decimal_point_is_comma_label, getFieldEditorParent()));
    addField(new BooleanFieldEditor(PreferenceConstants.DEFAULT_NSYMBOL_DBCS,
            Messages.preference_default_nsymbol_dbcs_label, getFieldEditorParent()));
    addField(new BooleanFieldEditor(PreferenceConstants.DEFAULT_QUOTE_IS_QUOTE,
            Messages.preference_default_quote_is_quote_label, getFieldEditorParent()));

}

From source file:com.liferay.ide.debug.ui.DebugPreferencePage.java

License:Open Source License

@Override
protected void createFieldEditors() {
    Group group = SWTUtil.createGroup(getFieldEditorParent(), "FreeMarker Debugger", 1); //$NON-NLS-1$
    GridData gd = new GridData(GridData.FILL_HORIZONTAL);
    group.setLayoutData(gd);/*from w w w.  j  a  v a  2 s .c om*/
    Composite composite = SWTUtil.createComposite(group, 2, 2, GridData.FILL_HORIZONTAL);

    StringFieldEditor passwordEditor = new StringFieldEditor(LiferayDebugCore.PREF_FM_DEBUG_PASSWORD,
            "Password:", composite); //$NON-NLS-1$

    passwordEditor.setPreferenceStore(getPreferenceStore());
    addField(passwordEditor);

    IntegerFieldEditor portEditor = new IntegerFieldEditor(LiferayDebugCore.PREF_FM_DEBUG_PORT, "Port:", //$NON-NLS-1$
            composite);

    portEditor.setPreferenceStore(getPreferenceStore());
    portEditor.setErrorMessage("Port value must be an integer."); //$NON-NLS-1$
    portEditor.setValidateStrategy(StringFieldEditor.VALIDATE_ON_KEY_STROKE);
    addField(portEditor);
}

From source file:com.liferay.ide.maven.ui.pref.MavenProjectPreferencePage.java

License:Open Source License

private void createStringEditior(Composite parent, final String label, final String key) {
    final StringFieldEditor stringEditor = new StringFieldEditor(key, label, parent);
    stringEditor.setPreferenceStore(getPreferenceStore());
    addField(stringEditor);//from   w  w w.j a va 2 s .c  o  m
}

From source file:com.liferay.ide.project.ui.pref.BladeCLIPreferencePage.java

License:Open Source License

@Override
protected void createFieldEditors() {
    Group group = SWTUtil.createGroup(getFieldEditorParent(), "", 1);
    GridData gd = new GridData(GridData.FILL_HORIZONTAL);
    group.setLayoutData(gd);/*from www  .  ja va 2 s . c o  m*/
    Composite composite = SWTUtil.createComposite(group, 2, 2, GridData.FILL_BOTH);

    addField(new StringFieldEditor(BladeCLI.BLADE_CLI_REPO_URL, "Blade CLI Repo URL:", composite));

    Label currentVersionLabel = new Label(composite, SWT.NONE);

    currentVersionLabel.setText("Current Embedded Blade CLI Version:");

    Text currentBladeVersionText = new Text(composite, SWT.BORDER);
    currentBladeVersionText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    currentBladeVersionText.setEditable(false);

    try {
        currentBladeVersionText.setText(getCurrentBladeVersion());
    } catch (Exception e) {
    }

    Label latestVersionLabel = new Label(composite, SWT.NONE);

    latestVersionLabel.setText("Latest Blade Version:");

    Text latestBladeVersionText = new Text(composite, SWT.BORDER);
    latestBladeVersionText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    latestBladeVersionText.setEditable(false);
    latestBladeVersionText.setText("Checking...");

    Button updateBladeButton = new Button(group, SWT.PUSH);

    updateBladeButton.setText("Update Embedded Blade to Latest Version");
    updateBladeButton.setEnabled(false);

    Button restoreBladeJarButton = new Button(group, SWT.PUSH);

    restoreBladeJarButton.setText("Restore Embedded Blade CLI to Original Version");

    updateBladeButton.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent event) {
            try {
                File newBladeJar = BladeCLI.fetchBladeJarFromRepo();

                if (newBladeJar != null) {
                    BladeCLI.addToLocalInstance(newBladeJar);
                }

                currentBladeVersionText.setText(getCurrentBladeVersion());

                MessageDialog.openInformation(getShell(), "Blade CLI", "Update successful.");

                updateBladeButton.setEnabled(false);
            } catch (Exception e) {
                MessageDialog.openError(getShell(), "Blade CLI",
                        "Could not update Blade CLI: " + e.getMessage());
            }
        }
    });

    restoreBladeJarButton.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent event) {
            BladeCLI.restoreOriginal();

            try {
                currentBladeVersionText.setText(getCurrentBladeVersion());

                restoreBladeJarButton.setEnabled(false);
            } catch (Exception e) {
            }
        }
    });

    Job job = new Job("Checking latest blade cli version...") {
        @Override
        public IStatus run(IProgressMonitor monitor) {
            try {
                String currentVersion = getCurrentBladeVersion();

                File updateJar = BladeCLI.fetchBladeJarFromRepo();

                String newVersion = Domain.domain(updateJar).getBundleVersion();

                boolean newAvailable = new Version(newVersion).compareTo(new Version(currentVersion)) > 0;

                UIUtil.async(new Runnable() {
                    @Override
                    public void run() {
                        if (newAvailable) {
                            latestBladeVersionText.setText(newVersion);
                        } else {
                            latestBladeVersionText.setText("");
                        }

                        updateBladeButton.setEnabled(newAvailable);
                    }
                });
            } catch (Exception e) {
            }

            return Status.OK_STATUS;
        }
    };

    job.schedule();
}