Class WidgetBuilderImpl<SELF extends WidgetBuilder<SELF,T>,T>
java.lang.Object
net.replaceitem.reconfigure.config.widget.builder.WidgetBuilderImpl<SELF,T>
- All Implemented Interfaces:
WidgetBuilder<SELF,
T>
- Direct Known Subclasses:
AbstractTextFieldWidgetBuilderImpl
,CheckboxWidgetBuilderImpl
,ChipListWidgetBuilderImpl
,ColorPickerWidgetBuilderImpl
,CustomWidgetBuilderImpl
,CyclingButtonWidgetBuilderImpl
,SliderWidgetBuilderImpl
public abstract class WidgetBuilderImpl<SELF extends WidgetBuilder<SELF,T>,T>
extends Object
implements WidgetBuilder<SELF,T>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected @Nullable net.minecraft.text.Text
protected final PropertyBuilderImpl
<?, T> protected @Nullable net.minecraft.text.Text
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
WidgetBuilderImpl
(PropertyBuildContext propertyBuildContext, PropertyBuilderImpl<?, T> propertyBuilder) -
Method Summary
Modifier and TypeMethodDescriptionfinal PropertyImpl
<T> build()
Builds the widget and the property.protected PropertyHolder
<T> buildImpl
(PropertyHolder<T> property) protected abstract ConfigWidgetFactory
<T> buildWidgetFactory
(BaseSettings baseSettings) displayName
(net.minecraft.text.Text displayName) Sets the display name of the widget as rendered in the config screen.protected void
postBuild
(PropertyHolder<T> property) This is run afterbuildImpl(PropertyHolder)
to add the created Property to the tab.protected void
preBuild
(PropertyHolder<T> property) This is run before callingbuildImpl(PropertyHolder)
.protected SELF
self()
tooltip()
Enabled the tooltip for the widget.tooltip
(net.minecraft.text.Text tooltip) Sets the tooltip text for the widget.
-
Field Details
-
propertyBuilder
-
displayName
@Nullable protected @Nullable net.minecraft.text.Text displayName -
tooltip
@Nullable protected @Nullable net.minecraft.text.Text tooltip
-
-
Constructor Details
-
WidgetBuilderImpl
protected WidgetBuilderImpl(PropertyBuildContext propertyBuildContext, PropertyBuilderImpl<?, T> propertyBuilder)
-
-
Method Details
-
displayName
Description copied from interface:WidgetBuilder
Sets the display name of the widget as rendered in the config screen. When not set, defaults to a translatable text with keyreconfigure.property.[namespace].[propertyname]
.- Specified by:
displayName
in interfaceWidgetBuilder<SELF extends WidgetBuilder<SELF,
T>, T> - Parameters:
displayName
- The display name text- Returns:
- The builder for chaining
-
tooltip
Description copied from interface:WidgetBuilder
Sets the tooltip text for the widget. This is shown when hovering over the property display name in the config widget.- Specified by:
tooltip
in interfaceWidgetBuilder<SELF extends WidgetBuilder<SELF,
T>, T> - Parameters:
tooltip
- The tooltip text- Returns:
- The builder for chaining
-
tooltip
Description copied from interface:WidgetBuilder
Enabled the tooltip for the widget. The text of the tooltip will default to a translatable text with keyreconfigure.property.[namespace].[propertyname].tooltip
.- Specified by:
tooltip
in interfaceWidgetBuilder<SELF extends WidgetBuilder<SELF,
T>, T> - Returns:
- The builder for chaining
-
preBuild
This is run before callingbuildImpl(PropertyHolder)
. Can be used to fill in missing default values. -
postBuild
This is run afterbuildImpl(PropertyHolder)
to add the created Property to the tab. -
build
Description copied from interface:WidgetBuilder
Builds the widget and the property. The built widget and property is automatically added to the config tab on which this builder was created.- Specified by:
build
in interfaceWidgetBuilder<SELF extends WidgetBuilder<SELF,
T>, T> - Returns:
- The built property
-
buildImpl
-
buildWidgetFactory
-
self
-