Search in sources :

Example 6 with MacroValueProvider

use of org.csstudio.display.builder.model.macros.MacroValueProvider 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

MacroValueProvider (org.csstudio.display.builder.model.macros.MacroValueProvider)6 HashMap (java.util.HashMap)2 Widget (org.csstudio.display.builder.model.Widget)2 InputStream (java.io.InputStream)1 ArrayList (java.util.ArrayList)1 Collections (java.util.Collections)1 List (java.util.List)1 Map (java.util.Map)1 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)1 Level (java.util.logging.Level)1 Logger (java.util.logging.Logger)1 Tooltip (javafx.scene.control.Tooltip)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 DisplayModel (org.csstudio.display.builder.model.DisplayModel)1 MacroizedWidgetProperty (org.csstudio.display.builder.model.MacroizedWidgetProperty)1 ActionInfo (org.csstudio.display.builder.model.properties.ActionInfo)1 ExecuteScriptActionInfo (org.csstudio.display.builder.model.properties.ExecuteScriptActionInfo)1