Class LocalStringDialog

java.lang.Object
org.eclipse.jface.window.Window
org.eclipse.jface.dialogs.Dialog
org.eclipse.jface.dialogs.TrayDialog
org.eclipse.jface.dialogs.TitleAreaDialog
com._1c.g5.v8.dt.ui.dialog.LocalStringDialog
All Implemented Interfaces:
org.eclipse.jface.window.IShellProvider
Direct Known Subclasses:
LocalStringFormatDialog, LocalStringFormattedTextDialog

public class LocalStringDialog extends org.eclipse.jface.dialogs.TitleAreaDialog
Dialog for entering string on multiple languages
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    protected class 
    Show warning indicator for ui editor items associated with unknown language code

    Nested classes/interfaces inherited from class org.eclipse.jface.window.Window

    org.eclipse.jface.window.Window.IExceptionHandler
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected static final String
     
    protected static final String
     
    protected static final String
     

    Fields inherited from class org.eclipse.jface.dialogs.TitleAreaDialog

    DLG_IMG_TITLE_BANNER, DLG_IMG_TITLE_ERROR, INFO_MESSAGE, WARNING_MESSAGE

    Fields inherited from class org.eclipse.jface.dialogs.Dialog

    blockedHandler, buttonBar, DIALOG_DEFAULT_BOUNDS, DIALOG_PERSISTLOCATION, DIALOG_PERSISTSIZE, dialogArea, DLG_IMG_ERROR, DLG_IMG_HELP, DLG_IMG_INFO, DLG_IMG_MESSAGE_ERROR, DLG_IMG_MESSAGE_INFO, DLG_IMG_MESSAGE_WARNING, DLG_IMG_QUESTION, DLG_IMG_WARNING, ELLIPSIS

    Fields inherited from class org.eclipse.jface.window.Window

    CANCEL, OK, resizeHasOccurred
  • Constructor Summary

    Constructors
    Constructor
    Description
    LocalStringDialog(org.eclipse.swt.widgets.Shell parentShell, IV8Project v8project, Map<String,String> inputData, String currentEditingLanguageCode, boolean multiLine, boolean isReadOnly)
    Dialog for entering string on different languages.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    protected void
    configureShell(org.eclipse.swt.widgets.Shell newShell)
     
    protected static Map<String,String>
    convert(List<LocalString> localStrings)
    Converts given list of LocalString into language code to text map.
    protected void
    createButtonsForButtonBar(org.eclipse.swt.widgets.Composite parent)
     
    protected org.eclipse.swt.widgets.Control
    createDialogArea(org.eclipse.swt.widgets.Composite parent)
     
    protected void
    createMultilineEntry(org.eclipse.swt.widgets.Composite parent, org.eclipse.core.databinding.DataBindingContext dbc, LocalString localString, BiFunction<LocalString,Boolean,Boolean> updateTitleFunc)
    Create editor for multyline of local string
    protected void
    createSingleEntry(org.eclipse.swt.widgets.Composite parent, org.eclipse.core.databinding.DataBindingContext dbc, LocalString localString)
    Create editor for single line of local string
    protected void
    createTextEditingArea(org.eclipse.swt.widgets.Composite parent, org.eclipse.core.databinding.DataBindingContext dbc, BiFunction<LocalString,Boolean,Boolean> updateTitleFunc)
    Creates text area with controls to modify localized strings.
    protected void
    createTextEditor(org.eclipse.swt.widgets.Composite parent, LocalString localString, org.eclipse.core.databinding.DataBindingContext dbc, BiFunction<LocalString,Boolean,Boolean> updateTitleFunc)
    Create editor for local string
    protected org.eclipse.jface.dialogs.IDialogSettings
     
    Returns the language code
    Provides local strings
    Returns the map of key-value pairs or null if canceled
    protected void
     

    Methods inherited from class org.eclipse.jface.dialogs.TitleAreaDialog

    createContents, getErrorMessage, getInitialSize, getMessage, getTitleArea, getTitleImageLabel, setErrorMessage, setMessage, setMessage, setTitle, setTitleAreaColor, setTitleImage

    Methods inherited from class org.eclipse.jface.dialogs.TrayDialog

    closeTray, createButtonBar, createHelpControl, getLayout, getTray, handleShellCloseEvent, isDialogHelpAvailable, isHelpAvailable, openTray, setDialogHelpAvailable, setHelpAvailable

    Methods inherited from class org.eclipse.jface.dialogs.Dialog

    applyDialogFont, buttonPressed, cancelPressed, convertHeightInCharsToPixels, convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, convertWidthInCharsToPixels, create, createButton, dialogFontIsDefault, getBlockedHandler, getButton, getButtonBar, getCancelButton, getDialogArea, getDialogBoundsStrategy, getImage, getInitialLocation, getOKButton, initializeBounds, initializeDialogUnits, isResizable, setBlockedHandler, setButtonLayoutData, setButtonLayoutFormData, shortenText

    Methods inherited from class org.eclipse.jface.window.Window

    canHandleShellCloseEvent, constrainShellSize, createShell, getConstrainedShellBounds, getContents, getDefaultImage, getDefaultImages, getDefaultOrientation, getParentShell, getReturnCode, getShell, getShellListener, getShellStyle, getWindowManager, handleFontChange, open, setBlockOnOpen, setDefaultImage, setDefaultImages, setDefaultModalParent, setDefaultOrientation, setExceptionHandler, setParentShell, setReturnCode, setShellStyle, setWindowManager

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • LocalStringDialog

      public LocalStringDialog(org.eclipse.swt.widgets.Shell parentShell, IV8Project v8project, Map<String,String> inputData, String currentEditingLanguageCode, boolean multiLine, boolean isReadOnly)
      Dialog for entering string on different languages.
      Parameters:
      parentShell - the parent SWT shell, cannot be null
      v8project - the current V8 project, cannot be null
      inputData - a map of string key-values pairs where key is language code and value is the input string, cannot be null
      currentEditingLanguageCode - code of configuration editing language, cannot be null
      multiLine - flag, indicating that input text boxes should be multiline
      isReadOnly - flag, indicating that dialog is in read-only mode
  • Method Details

    • getLocalStrings

      public List<LocalString> getLocalStrings()
      Provides local strings
      Returns:
      list of local strings, never null
    • okPressed

      protected void okPressed()
      Overrides:
      okPressed in class org.eclipse.jface.dialogs.Dialog
    • getValues

      public Map<String,String> getValues()
      Returns the map of key-value pairs or null if canceled
      Returns:
      map of Map<String, String> type
    • getLanguageCode

      public String getLanguageCode()
      Returns the language code
      Returns:
      language code, can be null
    • close

      public boolean close()
      Overrides:
      close in class org.eclipse.jface.dialogs.Dialog
    • convert

      protected static Map<String,String> convert(List<LocalString> localStrings)
      Converts given list of LocalString into language code to text map.
      Parameters:
      localStrings - the list of LocalString, cannot be null.
      Returns:
      the map, cannot be null.
    • createDialogArea

      protected org.eclipse.swt.widgets.Control createDialogArea(org.eclipse.swt.widgets.Composite parent)
      Overrides:
      createDialogArea in class org.eclipse.jface.dialogs.TitleAreaDialog
    • createButtonsForButtonBar

      protected void createButtonsForButtonBar(org.eclipse.swt.widgets.Composite parent)
      Overrides:
      createButtonsForButtonBar in class org.eclipse.jface.dialogs.Dialog
    • createSingleEntry

      protected void createSingleEntry(org.eclipse.swt.widgets.Composite parent, org.eclipse.core.databinding.DataBindingContext dbc, LocalString localString)
      Create editor for single line of local string
      Parameters:
      parent - the parent container, cannot be null
      dbc - the data binding context, cannot be null
      localString - the editing local string item, cannot be null
    • createMultilineEntry

      protected void createMultilineEntry(org.eclipse.swt.widgets.Composite parent, org.eclipse.core.databinding.DataBindingContext dbc, LocalString localString, BiFunction<LocalString,Boolean,Boolean> updateTitleFunc)
      Create editor for multyline of local string
      Parameters:
      parent - the parent container, cannot be null
      dbc - the data binding context, cannot be null
      localString - the editing local string item, cannot be null
      updateTitleFunc - the updating function for title local strings, can be null
    • createTextEditingArea

      protected void createTextEditingArea(org.eclipse.swt.widgets.Composite parent, org.eclipse.core.databinding.DataBindingContext dbc, BiFunction<LocalString,Boolean,Boolean> updateTitleFunc)
      Creates text area with controls to modify localized strings.
      Parameters:
      parent - base dialog composite, cannot be null
      dbc - dialog data binding context, cannot be null
      updateTitleFunc - the updating function for title local strings, can be null
    • createTextEditor

      protected void createTextEditor(org.eclipse.swt.widgets.Composite parent, LocalString localString, org.eclipse.core.databinding.DataBindingContext dbc, BiFunction<LocalString,Boolean,Boolean> updateTitleFunc)
      Create editor for local string
      Parameters:
      parent - the parent container, cannot be null
      localString - the editing local string item, cannot be null
      dbc - the data binding context, cannot be null
      updateTitleFunc - the updating function for title local strings, can be null
    • configureShell

      protected void configureShell(org.eclipse.swt.widgets.Shell newShell)
      Overrides:
      configureShell in class org.eclipse.jface.window.Window
    • getDialogBoundsSettings

      protected org.eclipse.jface.dialogs.IDialogSettings getDialogBoundsSettings()
      Overrides:
      getDialogBoundsSettings in class org.eclipse.jface.dialogs.Dialog