Class LanguageCodeComposite

All Implemented Interfaces:
EventListener, ModifyListener, Drawable, SWTEventListener

public class LanguageCodeComposite extends Composite implements ModifyListener
Language selection composite.
Author:
Christopher Mindus
  • Constructor Details

    • LanguageCodeComposite

      public LanguageCodeComposite(Composite parent, int style, int marginWidth, int marginHeight, boolean addNoLanguageEntry)
      Creates the language composite with a callback when text changes. This composite is laid out using a GridLayout with 3 columns.
      Parameters:
      parent - The parent.
      style - Style for this composite (e.g. SWT.NONE or SWT.BORDER).
      marginWidth - Margin width in the composite.
      marginHeight - Margin height in the composite.
      addNoLanguageEntry - Flag indicating the "none" language (empty string) is allowed and should be added.
  • Method Details

    • setLanguageCode

      public void setLanguageCode(String languageCode, Runnable callback)
      Sets the current language and defines the callback that will be called whenever the language changes.
    • addDoubleClickListener

      public void addDoubleClickListener(Runnable doubleClick)
      Adds a double-click listener.
    • getLanguageCode

      public String getLanguageCode()
      Gets the current language code.
    • modifyText

      public void modifyText(ModifyEvent e)
      Changes in new name.
      Specified by:
      modifyText in interface ModifyListener
      Parameters:
      e - The modify event.
    • addValidator

      public void addValidator(ValidatorManager validatorManager, boolean mustValidate)
      Adds a validator to the language code.
    • getTable

      public Table getTable()
      Gets the table.
    • isValid

      public boolean isValid()
      Returns if the language code is valid.
    • isLanguageValid

      public boolean isLanguageValid(String languageCode)
      Checks if a language code is valid.
      Parameters:
      languageCode - Language code to verify.
      Returns:
      true if OK, false otherwise.