Class ListViewItemBinder

java.lang.Object
io.github.snoopy137.languagemanager.binding.ListViewItemBinder
All Implemented Interfaces:
ControlBinder

public class ListViewItemBinder extends Object implements ControlBinder
Binds specific ListView items to language keys.

This binder applies translation to specific string elements in the ListView's items list. It assumes the items are Strings and binds only the first item to the provided language key.

Since:
1.1.0
Author:
alan
  • Constructor Details

    • ListViewItemBinder

      public ListViewItemBinder()
  • Method Details

    • supports

      public boolean supports(Object control)
      Returns true if the control is a ListView.
      Specified by:
      supports in interface ControlBinder
      Parameters:
      control - the control to check
      Returns:
      true if the control is a ListView, otherwise false
    • bind

      public void bind(Object control, String key)
      Binds the first item in the ListView to the specified language key. This method assumes the items are Strings.
      Specified by:
      bind in interface ControlBinder
      Parameters:
      control - the control to bind
      key - the language key used to retrieve localized text from the resource bundle