Search in sources :

Example 1 with IMacroTableProvider

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;
}
Also used : XMLPersistence(org.csstudio.trends.databrowser3.persistence.XMLPersistence) AbstractWidgetModel(org.csstudio.opibuilder.model.AbstractWidgetModel) StringProperty(org.csstudio.opibuilder.properties.StringProperty) HashMap(java.util.HashMap) CoreException(org.eclipse.core.runtime.CoreException) Level(java.util.logging.Level) MacroUtil(org.csstudio.apputil.macros.MacroUtil) AbstractContainerModel(org.csstudio.opibuilder.model.AbstractContainerModel) IPath(org.eclipse.core.runtime.IPath) BooleanProperty(org.csstudio.opibuilder.properties.BooleanProperty) Map(java.util.Map) Model(org.csstudio.trends.databrowser3.model.Model) IMacroTableProvider(org.csstudio.apputil.macros.IMacroTableProvider) Logger(java.util.logging.Logger) InfiniteLoopException(org.csstudio.apputil.macros.InfiniteLoopException) MacroTable(org.csstudio.apputil.macros.MacroTable) WidgetPropertyCategory(org.csstudio.opibuilder.properties.WidgetPropertyCategory) SingleSourcePlugin(org.csstudio.utility.singlesource.SingleSourcePlugin) List(java.util.List) MacrosInput(org.csstudio.opibuilder.util.MacrosInput) Path(org.eclipse.core.runtime.Path) MacroValueProvider(org.csstudio.display.builder.model.macros.MacroValueProvider) BorderStyle(org.csstudio.opibuilder.visualparts.BorderStyle) FilePathProperty(org.csstudio.opibuilder.properties.FilePathProperty) Collections(java.util.Collections) InputStream(java.io.InputStream) MacroValueProvider(org.csstudio.display.builder.model.macros.MacroValueProvider) InputStream(java.io.InputStream) AbstractWidgetModel(org.csstudio.opibuilder.model.AbstractWidgetModel) AbstractContainerModel(org.csstudio.opibuilder.model.AbstractContainerModel) Model(org.csstudio.trends.databrowser3.model.Model) XMLPersistence(org.csstudio.trends.databrowser3.persistence.XMLPersistence) IMacroTableProvider(org.csstudio.apputil.macros.IMacroTableProvider)

Aggregations

InputStream (java.io.InputStream)1 Collections (java.util.Collections)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1 Level (java.util.logging.Level)1 Logger (java.util.logging.Logger)1 IMacroTableProvider (org.csstudio.apputil.macros.IMacroTableProvider)1 InfiniteLoopException (org.csstudio.apputil.macros.InfiniteLoopException)1 MacroTable (org.csstudio.apputil.macros.MacroTable)1 MacroUtil (org.csstudio.apputil.macros.MacroUtil)1 MacroValueProvider (org.csstudio.display.builder.model.macros.MacroValueProvider)1 AbstractContainerModel (org.csstudio.opibuilder.model.AbstractContainerModel)1 AbstractWidgetModel (org.csstudio.opibuilder.model.AbstractWidgetModel)1 BooleanProperty (org.csstudio.opibuilder.properties.BooleanProperty)1 FilePathProperty (org.csstudio.opibuilder.properties.FilePathProperty)1 StringProperty (org.csstudio.opibuilder.properties.StringProperty)1 WidgetPropertyCategory (org.csstudio.opibuilder.properties.WidgetPropertyCategory)1 MacrosInput (org.csstudio.opibuilder.util.MacrosInput)1 BorderStyle (org.csstudio.opibuilder.visualparts.BorderStyle)1