Package com.e1c.langtool.generatestring
Class ProjectGenerateTranslationStrings
java.lang.Object
com.e1c.langtool.generatestring.ProjectGenerateTranslationStrings
- All Implemented Interfaces:
TranslationStringsGenerator
- Direct Known Subclasses:
ProjectObjectsGenerateTranslationStrings,TranslatedProjectImportTranslationStrings
public class ProjectGenerateTranslationStrings
extends Object
implements TranslationStringsGenerator
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected IFeatureValueCollectingServiceprotected ITranslationStorageManager -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLanguage(TranslateLanguage language) Adds the language to collect and to save.voidaddOrUpdateValue(FeatureValue value) Adds the or update value.booleanchecks if can process collecting and saving translation strings..booleanCheck settings.voidcollectAndSaveStrings(org.eclipse.core.runtime.IProgressMonitor monitor) Collect and save strings.protected booleancollectStrings(TranslationSource object, org.eclipse.core.runtime.IProgressMonitor monitor) Collects strings and return true if do that successful.booleancollectStrings(org.eclipse.core.runtime.IProgressMonitor monitor) Collect translation strings.protected ICollectingParametersvoidvoiddispose()Dispose and free held resources.voidprotected booleanfillUpCollectedValues(org.eclipse.core.runtime.IProgressMonitor monitor) Gets the collected values.Checks if should to collect computed strings.Gets the errors that found during collecting features.Gets the fill up type.Return the languages that should be collected and saved.org.eclipse.core.resources.IProjectGets the project of collection.Gets the storage id.Gets the translating project.Gets the translation provider id.booleanChecks if the translations need to check exists in any available storage.booleanChecks if should to collect interface strings.booleanChecks if should to collect model strings.booleanChecks if the collecting process should continue after first error.voidremoveLanguage(TranslateLanguage language) Removes the language from collecting languages.voidsaveCollectedStrings(org.eclipse.core.runtime.IProgressMonitor monitor) Save collected strings.voidsetCheckTranslationsInAnyAvailableStorage(boolean checkTranslationsInAnyAvailableStorage) Sets the check translations in any available storage.voidsetCollectInterfaceStrings(boolean collectInterfaceStrings) Sets to collect interface strings.voidsetCollectModelStrings(boolean collectModelStrings) Sets to collect model strings.voidsetCollectModelType(ICollectingParameters.CollectModelType collectModelType) Sets to collect computed strings.voidsetContinueAfterFirstError(boolean isContinue) Sets whether to continue collect after first error.voidsetFillUpType(FillUpType fillUpType) Sets the fill up type.voidsetFilterParameters(Map<String, ? extends Object> filterParameters) Sets the filter parameters.voidsetLanguages(List<TranslateLanguage> languages) Sets the languages to collect and to save.voidsetStorageId(StorageID storageId) Sets the storage id.voidsetTranslatingProject(ITranslatingProject translatingProject) Sets the translating project.voidsetTranslationProviderId(String providerId) Sets the translation provider id.
-
Field Details
-
storageManager
-
collectingService
-
filterParameters
-
-
Constructor Details
-
ProjectGenerateTranslationStrings
public ProjectGenerateTranslationStrings()
-
-
Method Details
-
getLanguages
Return the languages that should be collected and saved.- Specified by:
getLanguagesin interfaceTranslationStringsGenerator- Returns:
- the languages
-
setLanguages
Sets the languages to collect and to save.- Specified by:
setLanguagesin interfaceTranslationStringsGenerator- Parameters:
languages- the new languages
-
addLanguage
Adds the language to collect and to save.- Specified by:
addLanguagein interfaceTranslationStringsGenerator- Parameters:
language- the language
-
removeLanguage
Removes the language from collecting languages.- Specified by:
removeLanguagein interfaceTranslationStringsGenerator- Parameters:
language- the language
-
getProject
public org.eclipse.core.resources.IProject getProject()Gets the project of collection.- Specified by:
getProjectin interfaceTranslationStringsGenerator- Returns:
- the project
-
isCollectModelStrings
public boolean isCollectModelStrings()Checks if should to collect model strings.- Specified by:
isCollectModelStringsin interfaceTranslationStringsGenerator- Returns:
- true, if should collect model strings
-
setCollectModelStrings
public void setCollectModelStrings(boolean collectModelStrings) Sets to collect model strings.- Specified by:
setCollectModelStringsin interfaceTranslationStringsGenerator- Parameters:
collectModelStrings- the new collect model strings
-
isCollectInterfaceStrings
public boolean isCollectInterfaceStrings()Checks if should to collect interface strings.- Specified by:
isCollectInterfaceStringsin interfaceTranslationStringsGenerator- Returns:
- true, if should collect interface strings
-
setCollectInterfaceStrings
public void setCollectInterfaceStrings(boolean collectInterfaceStrings) Sets to collect interface strings.- Specified by:
setCollectInterfaceStringsin interfaceTranslationStringsGenerator- Parameters:
collectInterfaceStrings- the new collect interface strings
-
getCollectModelType
Checks if should to collect computed strings.- Specified by:
getCollectModelTypein interfaceTranslationStringsGenerator- Returns:
- true, if should collect computed strings
-
setCollectModelType
Sets to collect computed strings.- Specified by:
setCollectModelTypein interfaceTranslationStringsGenerator- Parameters:
collectComputedStrings- the new collect computed strings
-
getStorageId
Gets the storage id.- Specified by:
getStorageIdin interfaceTranslationStringsGenerator- Returns:
- the storage id
-
setStorageId
Sets the storage id.- Specified by:
setStorageIdin interfaceTranslationStringsGenerator- Parameters:
storageId- the new storage id
-
getFillUpType
Gets the fill up type. Default isFillUpType.NOT_FILLUPnot fill up.- Specified by:
getFillUpTypein interfaceTranslationStringsGenerator- Returns:
- the fillUpType
-
setFillUpType
Sets the fill up type.- Specified by:
setFillUpTypein interfaceTranslationStringsGenerator- Parameters:
fillUpType- the new fill up type
-
isCheckTranslationsInAnyAvailableStorage
public boolean isCheckTranslationsInAnyAvailableStorage()Description copied from interface:TranslationStringsGeneratorChecks if the translations need to check exists in any available storage.- Specified by:
isCheckTranslationsInAnyAvailableStoragein interfaceTranslationStringsGenerator- Returns:
- true, if it need to check translations in any available storage
-
setCheckTranslationsInAnyAvailableStorage
public void setCheckTranslationsInAnyAvailableStorage(boolean checkTranslationsInAnyAvailableStorage) Description copied from interface:TranslationStringsGeneratorSets the check translations in any available storage.- Specified by:
setCheckTranslationsInAnyAvailableStoragein interfaceTranslationStringsGenerator- Parameters:
checkTranslationsInAnyAvailableStorage- the new check translations in any available storage
-
setTranslationProviderId
Sets the translation provider id.- Specified by:
setTranslationProviderIdin interfaceTranslationStringsGenerator- Parameters:
providerId- the new translation provider id
-
getTranslationProviderId
Gets the translation provider id.- Specified by:
getTranslationProviderIdin interfaceTranslationStringsGenerator- Returns:
- the translation provider id
-
getTranslatingProject
Gets the translating project.- Specified by:
getTranslatingProjectin interfaceTranslationStringsGenerator- Returns:
- the translating project
-
setTranslatingProject
Sets the translating project.- Specified by:
setTranslatingProjectin interfaceTranslationStringsGenerator- Parameters:
translatingProject- the new translating project
-
getCollectedValues
Gets the collected values.- Specified by:
getCollectedValuesin interfaceTranslationStringsGenerator- Returns:
- the collected values
-
setContinueAfterFirstError
public void setContinueAfterFirstError(boolean isContinue) Sets whether to continue collect after first error.- Specified by:
setContinueAfterFirstErrorin interfaceTranslationStringsGenerator- Parameters:
isContinue- true, to continue after first error
-
isContinueAfterFirstError
public boolean isContinueAfterFirstError()Checks if the collecting process should continue after first error.- Specified by:
isContinueAfterFirstErrorin interfaceTranslationStringsGenerator- Returns:
- true, if the collecting process should continue after first error
-
canProcess
public boolean canProcess()Description copied from interface:TranslationStringsGeneratorchecks if can process collecting and saving translation strings..- Specified by:
canProcessin interfaceTranslationStringsGenerator- Returns:
- true, if can process collecting and saving translation strings.
-
getErrors
Gets the errors that found during collecting features.- Specified by:
getErrorsin interfaceTranslationStringsGenerator- Returns:
- the errors
-
checkSettings
public boolean checkSettings()Check settings. If checking is unsuccessful get errorsgetErrors()to show details to user.- Specified by:
checkSettingsin interfaceTranslationStringsGenerator- Returns:
- true, checks of settings if successful
-
collectStrings
public boolean collectStrings(org.eclipse.core.runtime.IProgressMonitor monitor) Collect translation strings.- Specified by:
collectStringsin interfaceTranslationStringsGenerator- Parameters:
monitor- the monitor- Returns:
- true, if successfully collected and filled with settings
-
saveCollectedStrings
public void saveCollectedStrings(org.eclipse.core.runtime.IProgressMonitor monitor) Save collected strings.- Specified by:
saveCollectedStringsin interfaceTranslationStringsGenerator- Parameters:
monitor- the monitor
-
dispose
public void dispose()Dispose and free held resources.- Specified by:
disposein interfaceTranslationStringsGenerator
-
collectStrings
protected boolean collectStrings(TranslationSource object, org.eclipse.core.runtime.IProgressMonitor monitor) Collects strings and return true if do that successful.- Parameters:
object- the objectmonitor- the monitor- Returns:
- true, if successful
-
createCollectingParameters
-
fillUpCollectedValues
protected boolean fillUpCollectedValues(org.eclipse.core.runtime.IProgressMonitor monitor) -
collectAndSaveStrings
public void collectAndSaveStrings(org.eclipse.core.runtime.IProgressMonitor monitor) Collect and save strings.- Specified by:
collectAndSaveStringsin interfaceTranslationStringsGenerator- Parameters:
monitor- the monitor
-
addOrUpdateValue
Adds the or update value.- Specified by:
addOrUpdateValuein interfaceTranslationStringsGenerator- Parameters:
value- the value
-
setFilterParameters
Description copied from interface:TranslationStringsGeneratorSets the filter parameters.- Specified by:
setFilterParametersin interfaceTranslationStringsGenerator- Parameters:
filterParameters- the filter parameters, where key is public filter's parameter name and value, usually string or other object appropriate for the filter participant passed form a caller, cannot benull.
-
disableCache
public void disableCache()- Specified by:
disableCachein interfaceTranslationStringsGenerator
-
enableCache
public void enableCache()- Specified by:
enableCachein interfaceTranslationStringsGenerator
-