Class TranslationManager

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
com.inductiveautomation.ignition.designer.i18n.workspace.TranslationManager
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class TranslationManager extends JPanel
The translation manager content panel: a toolbar plus three swappable surfaces (the translation editor, the language picker, and the key-entry workspace). Construct it, then call bind(MutableTranslationPackage, Runnable, Runnable, Consumer) once with the data model — the panels read and write that model directly, so this class only owns layout, surface navigation, and the toolbar.
See Also:
  • Constructor Details

    • TranslationManager

      public TranslationManager()
  • Method Details

    • bind

      public void bind(MutableTranslationPackage model, Runnable onImport, Runnable onExport, Consumer<JComponent> onSettings)
      Binds the panel to its data model. The editor reads and writes model directly; staged keys and locale-selection changes are committed to it here. Import, export, and settings are gateway/IO concerns owned by the caller, so they arrive as callbacks. Call once before the panel is shown.
      Parameters:
      model - the translation model the panels read from and write to (including per-key notes)
      onImport - invoked when the toolbar Import button is pressed
      onExport - invoked when the toolbar Export button is pressed
      onSettings - invoked with the anchor component when the editor's settings action fires
    • showSurface

      public void showSurface(TranslationManager.Surface target)
    • addNotify

      public void addNotify()
      Overrides:
      addNotify in class JComponent
    • reloadLocales

      public void reloadLocales()
      Reseeds the language picker from the model's locales and refreshes the editor.
    • refreshTranslationsIfIdle

      public void refreshTranslationsIfIdle()
      Refreshes the editor unless the user is mid-edit, so external changes don't clobber typing.
    • getVisibleKeys

      public List<String> getVisibleKeys()
      The keys currently visible in the editor (i.e. matching the active filter, if any).
    • isFilterActive

      public boolean isFilterActive()
      Whether the editor's key filter is currently narrowing the visible keys.
    • setIncludeRegionalVariants

      public void setIncludeRegionalVariants(boolean include)
      Whether the language picker offers regional variants in addition to base languages.