Class StorageSettingsManager
java.lang.Object
com.e1c.langtool.internal.storage.StorageSettingsManager
- All Implemented Interfaces:
IManagedService,IStorageSettingsManager
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate()voidAdds the settings change listener.voidprotected voidfireSettingsChanged(org.eclipse.core.resources.IProject project, boolean projectClosed) getReadStorageIds(org.eclipse.core.resources.IProject project) Gets only available (enabled) settings for the project.getSettingsOrDefault(org.eclipse.core.resources.IProject project) Gets the storage settings by the project or default configured settings by the project type.booleanisStorageAvailable(org.eclipse.core.resources.IProject project, StorageID storageId) Check that storage with givenstorageIdis available for the specifiedproject.voidRemoves the settings change listener.voidsaveDefaultEditingStorageId(org.eclipse.core.resources.IProject project, StorageID id) Save default editing storage id for the project.voidsaveReadSettings(org.eclipse.core.resources.IProject project, List<StorageSettings> settings) Save the list of settings for the project.voidsaveReadStorageIds(org.eclipse.core.resources.IProject project, List<StorageID> ids) Saves the available storage ids for the project.voidsaveSettings(org.eclipse.core.resources.IProject project, ProjectStorageSettings settings, org.eclipse.core.runtime.IProgressMonitor monitor) Saves the project storage settings into the file of the project in/.settings/translation_storages.yml
-
Constructor Details
-
StorageSettingsManager
public StorageSettingsManager()
-
-
Method Details
-
activate
public void activate()- Specified by:
activatein interfaceIManagedService
-
deactivate
public void deactivate()- Specified by:
deactivatein interfaceIManagedService
-
getSettingsOrDefault
Description copied from interface:IStorageSettingsManagerGets the storage settings by the project or default configured settings by the project type.- Specified by:
getSettingsOrDefaultin interfaceIStorageSettingsManager- Parameters:
project- the translating project (the project of the source code), cannot benull.- Returns:
- the settings or default, cannot return
null.
-
saveSettings
public void saveSettings(org.eclipse.core.resources.IProject project, ProjectStorageSettings settings, org.eclipse.core.runtime.IProgressMonitor monitor) Description copied from interface:IStorageSettingsManagerSaves the project storage settings into the file of the project in/.settings/translation_storages.yml- Specified by:
saveSettingsin interfaceIStorageSettingsManager- Parameters:
project- the translating project to save, cannot benull.settings- the settings, cannot benull.monitor- the monitor, cannot benull.
-
getReadStorageIds
Description copied from interface:IStorageSettingsManagerGets only available (enabled) settings for the project.- Specified by:
getReadStorageIdsin interfaceIStorageSettingsManager- Parameters:
project- the project, cannot benull.- Returns:
- the available storage settings, cannot return
null.
-
saveReadSettings
public void saveReadSettings(org.eclipse.core.resources.IProject project, List<StorageSettings> settings) Description copied from interface:IStorageSettingsManagerSave the list of settings for the project.- Specified by:
saveReadSettingsin interfaceIStorageSettingsManager- Parameters:
project- the translating project, cannot benull.settings- the list of settings that should use to read with order, cannot benull.
-
saveReadStorageIds
Description copied from interface:IStorageSettingsManagerSaves the available storage ids for the project.- Specified by:
saveReadStorageIdsin interfaceIStorageSettingsManager- Parameters:
project- the translating project, cannot benull.ids- the list of ids that should use to read with order, cannot benull.
-
isStorageAvailable
Description copied from interface:IStorageSettingsManagerCheck that storage with givenstorageIdis available for the specifiedproject.- Specified by:
isStorageAvailablein interfaceIStorageSettingsManager- Parameters:
project- the translating project, cannot benull.storageId- Storage identifier to check, cannot benull.- Returns:
-
saveDefaultEditingStorageId
Description copied from interface:IStorageSettingsManagerSave default editing storage id for the project.- Specified by:
saveDefaultEditingStorageIdin interfaceIStorageSettingsManager- Parameters:
project- the translating project, cannot benull.id- the storage ID, cannot benull.
-
addChangeListener
Description copied from interface:IStorageSettingsManagerAdds the settings change listener. Has no effect if an identical listener is already registered.- Specified by:
addChangeListenerin interfaceIStorageSettingsManager- Parameters:
listener- the listener, cannot benull.
-
removeChangeListener
Description copied from interface:IStorageSettingsManagerRemoves the settings change listener. Has no effect if an identical listener is not registered.- Specified by:
removeChangeListenerin interfaceIStorageSettingsManager- Parameters:
listener- the listener, cannot benull.
-
fireSettingsChanged
protected void fireSettingsChanged(org.eclipse.core.resources.IProject project, boolean projectClosed)
-