Class MuiSelectConfig.MuiSelectConfigBuilder
- java.lang.Object
-
- com.github.grossopa.selenium.component.mui.config.MuiSelectConfig.MuiSelectConfigBuilder
-
- All Implemented Interfaces:
org.apache.commons.lang3.builder.Builder<MuiSelectConfig>
- Enclosing class:
- MuiSelectConfig
public static class MuiSelectConfig.MuiSelectConfigBuilder extends Object implements org.apache.commons.lang3.builder.Builder<MuiSelectConfig>
The builder forMuiSelectConfig.- Since:
- 1.6
- Author:
- Jack Yin
-
-
Constructor Summary
Constructors Constructor Description MuiSelectConfigBuilder(org.openqa.selenium.By optionsLocator)Constructs an instance with options locator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MuiSelectConfigbuild()MuiSelectConfig.MuiSelectConfigBuildercloseOptionsAction(CloseOptionsAction closeOptionsAction)Sets the action to close the options.MuiSelectConfig.MuiSelectConfigBuildermultiple(boolean isMultiple)As of current Material UI version there is no flags indicates whether the component is single or multiple select.MuiSelectConfig.MuiSelectConfigBuilderopenOptionsAction(OpenOptionsAction openOptionsAction)Sets the action to open the options.MuiSelectConfig.MuiSelectConfigBuilderoptionValueAttribute(String optionValueAttribute)Sets the value attribute of each option item
-
-
-
Constructor Detail
-
MuiSelectConfigBuilder
public MuiSelectConfigBuilder(org.openqa.selenium.By optionsLocator)
Constructs an instance with options locator.- Parameters:
optionsLocator- the locator for locating the popup options.MuiSelectwill first locate the popover element then * use the locator for finding the option elements. UseBy.className("MuiMenuItem-root")if the MuiSelect code is copied from Material UI official website.
-
-
Method Detail
-
optionValueAttribute
public MuiSelectConfig.MuiSelectConfigBuilder optionValueAttribute(@Nullable String optionValueAttribute)
Sets the value attribute of each option item- Parameters:
optionValueAttribute- the option value attribute, by default it is "data-value".- Returns:
- this builder instance
-
openOptionsAction
public MuiSelectConfig.MuiSelectConfigBuilder openOptionsAction(OpenOptionsAction openOptionsAction)
Sets the action to open the options.- Parameters:
openOptionsAction- the action to open the options layer, default value isDefaultOpenOptionsAction- Returns:
- this builder instance
-
closeOptionsAction
public MuiSelectConfig.MuiSelectConfigBuilder closeOptionsAction(CloseOptionsAction closeOptionsAction)
Sets the action to close the options.- Parameters:
closeOptionsAction- the action to close the options layer, default value isDefaultCloseOptionsAction- Returns:
- this builder instance
-
multiple
public MuiSelectConfig.MuiSelectConfigBuilder multiple(boolean isMultiple)
As of current Material UI version there is no flags indicates whether the component is single or multiple select. So developers should set their own isMultiple flag in the configuration.- Parameters:
isMultiple- whether the select component allows multiple selection, default value is false.- Returns:
- this builder instance
-
build
public MuiSelectConfig build()
- Specified by:
buildin interfaceorg.apache.commons.lang3.builder.Builder<MuiSelectConfig>
-
-