Class SelectSingle

  • SelectSingle contains configuration information for how a select single is displayed in Data Studio.

  • You can add select options, enable overriding, set help text, ID, dynamic status, and display name for a SelectSingle config entry.

  • The provided code example demonstrates how to create a SelectSingle instance and add options to it.

SelectSingle

Contains select single information for the config. Its properties determine how the select single is displayed in Data Studio.

constcc=DataStudioApp.createCommunityConnector();
constconfig=cc.getConfig();
constoption1=
config.newOptionBuilder().setLabel('option label').setValue('option_value');
constoption2=config.newOptionBuilder()
.setLabel('second option label')
.setValue('option_value_2');
constinfo1=config.newSelectSingle()
.setId('api_endpoint')
.setName('Data Type')
.setHelpText('Select the data type you\'re interested in.')
.setAllowOverride(true)
.addOption(option1)
.addOption(option2);

Methods

MethodReturn typeBrief description
addOption(optionBuilder) SelectSingle Adds a new select option.
setAllowOverride(allowOverride) SelectSingle Enables overriding for this config entry.
setHelpText(helpText) SelectSingle Sets the help text for this configuration entry.
setId(id) SelectSingle Sets the unique ID for this configuration entry.
setIsDynamic(isDynamic) SelectSingle Sets the dynamic status for this configuration entry.
setName(name) SelectSingle Sets the display name for this configuration entry.

Detailed documentation

addOption(optionBuilder)

Adds a new select option.

Parameters

NameTypeDescription
optionBuilderOptionBuilder A builder for an option.

Return

SelectSingle — This builder, for chaining.


setAllowOverride(allowOverride)

Enables overriding for this config entry. If set to true, data source creators have the option to enable this for report editors.

Parameters

NameTypeDescription
allowOverrideBooleanWhether or not this config entry can be overridden in reports.

Return

SelectSingle — This builder, for chaining.


setHelpText(helpText)

Sets the help text for this configuration entry.

Parameters

NameTypeDescription
helpTextStringThe helpText to set.

Return

SelectSingle — This builder, for chaining.


setId(id)

Sets the unique ID for this configuration entry.

Parameters

NameTypeDescription
idStringThe ID to set.

Return

SelectSingle — This builder, for chaining.


setIsDynamic(isDynamic)

Sets the dynamic status for this configuration entry.

If a dynamic configuration entry is modified, subsequent configuration entries are cleared.

Parameters

NameTypeDescription
isDynamicBooleanThe dynamic status to set.

Return

SelectSingle — This builder, for chaining.


setName(name)

Sets the display name for this configuration entry.

Parameters

NameTypeDescription
nameStringThe name to set.

Return

SelectSingle — This builder, for chaining.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2024年12月02日 UTC.