use of org.csstudio.apputil.macros.IMacroTableProvider in project org.csstudio.display.builder by kasemir.
the class DataBrowserWidgedModel method createDataBrowserModel.
/**
* Create a Data Browser model, loaded with the configuration file
* @return Data Browser Model
* @throws Exception
*/
public Model createDataBrowserModel() throws CoreException, Exception {
final Model model = new Model();
final IMacroTableProvider opi_macros = getAllMacros();
final MacroValueProvider db_macros = name -> opi_macros.getMacroValue(name);
model.setMacros(db_macros);
try (final InputStream input = SingleSourcePlugin.getResourceHelper().getInputStream(getExpandedFilename())) {
new XMLPersistence().load(model, input);
}
return model;
}
Aggregations