Search in sources :

Example 6 with OpenDisplayActionInfo

use of org.csstudio.display.builder.model.properties.OpenDisplayActionInfo in project org.csstudio.display.builder by kasemir.

the class StandaloneAction method run.

@Override
public void run() {
    final DisplayModel parent_model = view.getDisplayModel();
    final DisplayInfo info = view.getDisplayInfo();
    ActionUtil.handleAction(parent_model, new OpenDisplayActionInfo(Messages.OpenStandalone, info.getPath(), info.getMacros(), OpenDisplayActionInfo.Target.STANDALONE));
}
Also used : DisplayInfo(org.csstudio.display.builder.rcp.DisplayInfo) DisplayModel(org.csstudio.display.builder.model.DisplayModel) OpenDisplayActionInfo(org.csstudio.display.builder.model.properties.OpenDisplayActionInfo)

Example 7 with OpenDisplayActionInfo

use of org.csstudio.display.builder.model.properties.OpenDisplayActionInfo in project org.csstudio.display.builder by kasemir.

the class ScriptUtil method openDisplay.

// ====================
// open/close displays
/**
 * Open a new display
 *
 *  @param widget Widget in 'current' display, used to resolve relative paths
 *  @param file Path to the display
 *  @param target Where to show the display: "REPLACE", "TAB", "WINDOW", "STANDALONE"
 *  @param macros Macros, may be <code>null</code>
 */
public static void openDisplay(final Widget widget, final String file, final String target, final Map<String, String> macros) {
    OpenDisplayActionInfo.Target the_target;
    try {
        the_target = OpenDisplayActionInfo.Target.valueOf(target);
    } catch (Throwable ex) {
        the_target = OpenDisplayActionInfo.Target.TAB;
    }
    final Macros the_macros;
    if (macros == null || macros.isEmpty())
        the_macros = null;
    else {
        the_macros = new Macros();
        for (String name : macros.keySet()) the_macros.add(name, macros.get(name));
    }
    final OpenDisplayActionInfo open = new OpenDisplayActionInfo("Open from script", file, the_macros, the_target);
    ActionUtil.handleAction(widget, open);
}
Also used : Macros(org.csstudio.display.builder.model.macros.Macros) OpenDisplayActionInfo(org.csstudio.display.builder.model.properties.OpenDisplayActionInfo)

Aggregations

OpenDisplayActionInfo (org.csstudio.display.builder.model.properties.OpenDisplayActionInfo)7 Macros (org.csstudio.display.builder.model.macros.Macros)3 Widget (org.csstudio.display.builder.model.Widget)2 ActionInfo (org.csstudio.display.builder.model.properties.ActionInfo)2 ActionInfos (org.csstudio.display.builder.model.properties.ActionInfos)2 Target (org.csstudio.display.builder.model.properties.OpenDisplayActionInfo.Target)2 FileOutputStream (java.io.FileOutputStream)1 Node (javafx.scene.Node)1 Scene (javafx.scene.Scene)1 Toggle (javafx.scene.control.Toggle)1 DisplayModel (org.csstudio.display.builder.model.DisplayModel)1 ModelWriter (org.csstudio.display.builder.model.persist.ModelWriter)1 ExecuteScriptActionInfo (org.csstudio.display.builder.model.properties.ExecuteScriptActionInfo)1 ScriptInfo (org.csstudio.display.builder.model.properties.ScriptInfo)1 WritePVActionInfo (org.csstudio.display.builder.model.properties.WritePVActionInfo)1 ActionButtonWidget (org.csstudio.display.builder.model.widgets.ActionButtonWidget)1 DisplayInfo (org.csstudio.display.builder.rcp.DisplayInfo)1 ActionsDialog (org.csstudio.display.builder.representation.javafx.ActionsDialog)1 RuntimeAction (org.csstudio.display.builder.runtime.RuntimeAction)1 Action (org.eclipse.jface.action.Action)1