Class TextArgumentFactory
java.lang.Object
nl.pim16aap2.animatedarchitecture.core.text.TextArgumentFactory
Contains some quality-of-life features to aid the creation of new
TextArguments.-
Constructor Summary
ConstructorsConstructorDescriptionTextArgumentFactory(ITextComponentFactory textComponentFactory, @Nullable PersonalizedLocalizer personalizedLocalizer) -
Method Summary
Modifier and TypeMethodDescriptionShortcut for creating a newTextArgumentwith aTextComponentfor a clickable argument without any information for theTextType.CLICKABLEtext type.Shortcut for creating a newTextArgumentwith aTextComponentfor a clickable argument for theTextType.CLICKABLEtext type.Shortcut for creating a newTextArgumentwith aTextComponentfor a clickable argument without any information.Shortcut for creating a newTextArgumentwith aTextComponentfor a clickable argument.Localizes the provided key using thePersonalizedLocalizerof this factory.localizedHighlight(String key) Shortcut for localizing a String usinglocalized(String)and creating a newTextArgumentwith aTextComponentfor theTextType.HIGHLIGHTtext type.localizedHighlight(IStructureConst structure) Shortcut for localizing a structure type usinglocalized(String)and creating a newTextArgumentwith aTextComponentfor theTextType.HIGHLIGHTtext type.localizedHighlight(StructureType structureType) Shortcut for localizing a structure type usinglocalized(String)and creating a newTextArgumentwith aTextComponentfor theTextType.HIGHLIGHTtext type.localizedInfo(String key) Shortcut for localizing a String usinglocalized(String)and creating a newTextArgumentwith aTextComponentfor theTextType.INFOtext type.localizedInfo(IStructureConst structure) Shortcut for localizing a structure type usinglocalized(String)and creating a newTextArgumentwith aTextComponentfor theTextType.INFOtext type.localizedInfo(StructureType structureType) Shortcut for localizing a structure type usinglocalized(String)and creating a newTextArgumentwith aTextComponentfor theTextType.INFOtext type.newTextArgument(@Nullable Object argument, @Nullable TextType type) Shortcut for creating a newTextArgumentwith aTextComponentfor the provided text type.
-
Constructor Details
-
TextArgumentFactory
public TextArgumentFactory(ITextComponentFactory textComponentFactory, @Nullable PersonalizedLocalizer personalizedLocalizer)
-
-
Method Details
-
localized
Localizes the provided key using thePersonalizedLocalizerof this factory.- Parameters:
key- The key to localize.- Returns:
- The localized key or the key itself if the localizer is null.
-
newTextArgument
Shortcut for creating a newTextArgumentwith aTextComponentfor the provided text type.- Parameters:
argument- The argument.type- The text type to use for the argument.- Returns:
- The new TextArgument.
-
highlight
- Parameters:
argument- The argument.- Returns:
- The new TextArgument.
-
localizedHighlight
Shortcut for localizing a String usinglocalized(String)and creating a newTextArgumentwith aTextComponentfor theTextType.HIGHLIGHTtext type.- Parameters:
key- The key to localize and whose value to highlight.- Returns:
- The new TextArgument.
-
localizedHighlight
Shortcut for localizing a structure type usinglocalized(String)and creating a newTextArgumentwith aTextComponentfor theTextType.HIGHLIGHTtext type.- Parameters:
structureType- The structure type to localize and highlight.- Returns:
- The new TextArgument.
-
localizedHighlight
Shortcut for localizing a structure type usinglocalized(String)and creating a newTextArgumentwith aTextComponentfor theTextType.HIGHLIGHTtext type.- Parameters:
structure- The structure whose type to localize and highlight.- Returns:
- The new TextArgument.
-
info
- Parameters:
argument- The argument.- Returns:
- The new TextArgument.
-
localizedInfo
Shortcut for localizing a String usinglocalized(String)and creating a newTextArgumentwith aTextComponentfor theTextType.INFOtext type.- Parameters:
key- The key to localize and whose value to info.- Returns:
- The new TextArgument.
-
localizedInfo
Shortcut for localizing a structure type usinglocalized(String)and creating a newTextArgumentwith aTextComponentfor theTextType.INFOtext type.- Parameters:
structureType- The structure type to localize and info.- Returns:
- The new TextArgument.
-
localizedInfo
Shortcut for localizing a structure type usinglocalized(String)and creating a newTextArgumentwith aTextComponentfor theTextType.INFOtext type.- Parameters:
structure- The structure whose type to localize and info.- Returns:
- The new TextArgument.
-
error
- Parameters:
argument- The argument.- Returns:
- The new TextArgument.
-
success
- Parameters:
argument- The argument.- Returns:
- The new TextArgument.
-
clickable
public TextArgument clickable(Object argument, @Nullable TextType type, String command, @Nullable String info) Shortcut for creating a newTextArgumentwith aTextComponentfor a clickable argument.See
ITextComponentFactory.newClickableTextComponent(TextType, String, String).- Parameters:
argument- The argument.type- The type of the text.command- The command to execute when this text is clicked.info- The optional information String explaining what clicking the text will do.- Returns:
- The new TextArgument.
-
clickable
Shortcut for creating a newTextArgumentwith aTextComponentfor a clickable argument without any information.See
ITextComponentFactory.newClickableTextComponent(TextType, String, String).- Parameters:
argument- The argument.type- The type of the text.command- The command to execute when this text is clicked.- Returns:
- The new TextArgument.
-
clickable
Shortcut for creating a newTextArgumentwith aTextComponentfor a clickable argument for theTextType.CLICKABLEtext type.See
ITextComponentFactory.newClickableTextComponent(TextType, String, String).- Parameters:
argument- The argument.command- The command to execute when this text is clicked.info- The optional information String explaining what clicking the text will do.- Returns:
- The new TextArgument.
-
clickable
Shortcut for creating a newTextArgumentwith aTextComponentfor a clickable argument without any information for theTextType.CLICKABLEtext type.See
ITextComponentFactory.newClickableTextComponent(TextType, String, String).- Parameters:
argument- The argument.command- The command to execute when this text is clicked.- Returns:
- The new TextArgument.
-
getTextComponentFactory
-