Example #1
0
 protected void initTemplates() {
   int templatesCount = Integer.parseInt(localeHelper.getLocaleString(UIConstants.TEMPLATE_COUNT));
   String[] templates = new String[templatesCount];
   for (int i = 0; i < templatesCount; i++) {
     templates[i] = localeHelper.getLocaleString(UIConstants.TEMPLATE_BASE + i);
   }
   templateList.setModel(new DefaultComboBoxModel(templates));
 }
Example #2
0
  final void setTextByLocale(Locale locale) {
    changeLocale(locale);
    // remove all template item to re-add other locale-spec items
    // if (templateList.getModel().getSize() > 0) {
    // templateList.removeAllItems();
    // }
    initTemplates();

    mainFrame.setTitle(localeHelper.getLocaleString(UIConstants.MAIN_WINDOW_TITLE));
    optionsBorder.setTitle(localeHelper.getLocaleString(UIConstants.BORDER_OPTIONS_TITLE));
    templateLabel.setText(localeHelper.getLocaleString(UIConstants.LABEL_TEMPLATE));
    useTemplateCheckBox.setText(localeHelper.getLocaleString(UIConstants.CHECKBOX_USETEMPLATE));
    useNumberRadioButton.setText(localeHelper.getLocaleString(UIConstants.RADIO_NUMTOCHANGE));
    useAlphaBetaRadioButton.setText(localeHelper.getLocaleString(UIConstants.RADIO_ALPHATOCHANGE));
    startPositionLabel.setText(localeHelper.getLocaleString(UIConstants.LABEL_STARTPOSITION));
    previewButton.setText(localeHelper.getLocaleString(UIConstants.BUTTON_PREVIEW));
    beginButton.setText(localeHelper.getLocaleString(UIConstants.BUTTON_BEGIN));
    changeSuffixCheck.setText(localeHelper.getLocaleString(UIConstants.LABEL_CHANGESUFFIX));
    previewLabel.setText(localeHelper.getLocaleString(UIConstants.LABEL_PREVIEW));
    addButton.setText(localeHelper.getLocaleString(UIConstants.BUTTON_ADD));
    removeButton.setText(localeHelper.getLocaleString(UIConstants.BUTTON_REMOVE));
    upperLowerTransformLabel.setText(localeHelper.getLocaleString(UIConstants.LABEL_ULTRANSFORM));

    fileMenu.setText(localeHelper.getLocaleString(UIConstants.MENU_FILE));
    fileOpen.setText(localeHelper.getLocaleString(UIConstants.MENU_FILE_OPEN));
    fileClose.setText(localeHelper.getLocaleString(UIConstants.MENU_FILE_EXIT));

    // used for language selection, for future add-on
    /*
    languageMenu.setText(localHelper
    .getLocalString(UIConstants.MENU_LANGUAGE));
    eng.setText(localHelper.getLocalString(UIConstants.MENU_LANGUAGE_ENG));
    chn.setText(localHelper.getLocalString(UIConstants.MENU_LANGUAGE_CHN));
    */
    textArea.replaceRange(
        localeHelper.getLocaleString(UIConstants.TEMPLATE_README),
        0,
        textArea.getDocument().getLength());

    mainFrame.pack();
  }