Search in sources :

Example 1 with ScriptsDialog

use of org.csstudio.display.builder.representation.javafx.ScriptsDialog in project org.csstudio.display.builder by kasemir.

the class JFXScriptsDialogDemo method start.

@Override
public void start(final Stage stage) {
    final List<ScriptInfo> scripts = new ArrayList<>();
    scripts.add(new ScriptInfo("/tmp/demo1.py", true, new ScriptPV("pv1")));
    scripts.add(new ScriptInfo("/tmp/demo2.py", false, new ScriptPV("pv1"), new ScriptPV("pv2", false)));
    final ScriptsDialog dialog = new ScriptsDialog(new Widget("demo"), scripts);
    final Optional<List<ScriptInfo>> result = dialog.showAndWait();
    if (result.isPresent()) {
        for (ScriptInfo info : result.get()) System.out.println(info + ", embedded text: " + info.getText());
    } else
        System.out.println("Cancelled");
}
Also used : ScriptInfo(org.csstudio.display.builder.model.properties.ScriptInfo) ArrayList(java.util.ArrayList) Widget(org.csstudio.display.builder.model.Widget) ScriptsDialog(org.csstudio.display.builder.representation.javafx.ScriptsDialog) List(java.util.List) ArrayList(java.util.ArrayList) ScriptPV(org.csstudio.display.builder.model.properties.ScriptPV)

Aggregations

ArrayList (java.util.ArrayList)1 List (java.util.List)1 Widget (org.csstudio.display.builder.model.Widget)1 ScriptInfo (org.csstudio.display.builder.model.properties.ScriptInfo)1 ScriptPV (org.csstudio.display.builder.model.properties.ScriptPV)1 ScriptsDialog (org.csstudio.display.builder.representation.javafx.ScriptsDialog)1