Пример #1
0
  /**
   * Translate the string passed as parameter
   *
   * @param string string to translate
   * @param fromLanguage language ID to translate from
   * @param toLanguage language ID to translate to
   * @return a TranslationResult object with information about the translation
   */
  public TranslationResult translate(String string, String fromLanguage, String toLanguage) {

    TranslationResult translationResults = null;

    ITranslator translator = preferencesManager.getDefaultTranslator();

    try {
      translationResults = translator.translate(string, fromLanguage, toLanguage);
    } catch (Exception e) {
      BasePlugin.logError(Messages.TranslatorManager_1);
    }

    return translationResults;
  }
Пример #2
0
  /**
   * Translate all strings passed as parameter
   *
   * @param strings strings to translate
   * @param fromLanguage language ID to translate from
   * @param toLanguage language ID to translate to
   * @return a TranslationResult object with information about the translation
   */
  public List<TranslationResult> translateAll(
      List<String> strings, String fromLanguage, String toLanguage) {

    List<TranslationResult> translationResults = null;

    ITranslator translator = preferencesManager.getDefaultTranslator();

    try {
      translationResults = translator.translateAll(strings, fromLanguage, toLanguage, null);
    } catch (Exception e) {
      BasePlugin.logError(Messages.TranslatorManager_2);
    }

    return translationResults;
  }
 @Override
 public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
   try {
     getEditorInput().revert(actualState.getId());
   } catch (IOException e) {
     BasePlugin.logError("Error reverting column: " + actualState.getId(), e);
   }
   savedState =
       new ColumnInfo(
           actualState.getId(),
           actualState.getTooltip(),
           getEditorInput().getValues(actualState.getId()),
           actualState.canRemove());
   return redo(monitor, info);
 }