use of gen.core.filters.Filters in project omegat by omegat-org.
the class RealProject method loadFilterSettings.
/**
* Load filter settings, either from the project or from global options
*/
private void loadFilterSettings() {
// Set project specific file filters if they exist, or defaults otherwise.
// This MUST happen before calling loadTranslations() because the setting to ignore file context
// for alt translations is a filter setting, and it affects how alt translations are hashed.
Filters filters = Optional.ofNullable(config.getProjectFilters()).orElse(Preferences.getFilters());
Core.setFilterMaster(new FilterMaster(filters));
}
use of gen.core.filters.Filters in project omegat by omegat-org.
the class FilterMaster method createDefaultFiltersConfig.
// ////////////////////////////////////////////////////////////////////////
// Filters
// ////////////////////////////////////////////////////////////////////////
/**
* Reverts Filter Configuration to Default values. Basically
* <ul>
* <li>Sets up built-in filters
* <li>Reloads the plugins
* <li>Loads filters from plugins
* <li>Saves the configuration
* </ul>
*/
public static Filters createDefaultFiltersConfig() {
Filters c = new Filters();
addNewFiltersToConfig(c);
return c;
}
use of gen.core.filters.Filters in project omegat by omegat-org.
the class FilterMaster method cloneConfig.
/**
* Clone config for editing
*
* @return new config instance
*/
public static Filters cloneConfig(Filters orig) {
Filters c = new Filters();
c.setRemoveTags(orig.isRemoveTags());
c.setRemoveSpacesNonseg(orig.isRemoveSpacesNonseg());
c.setPreserveSpaces(orig.isPreserveSpaces());
c.setIgnoreFileContext(orig.isIgnoreFileContext());
for (Filter f : orig.getFilters()) {
c.getFilters().add(cloneFilter(f));
}
return c;
}
Aggregations