Search in sources :

Example 21 with RuntimePV

use of org.csstudio.display.builder.runtime.pv.RuntimePV in project org.csstudio.display.builder by kasemir.

the class WidgetInfoAction method runWithEvent.

@Override
public void runWithEvent(final Event event) {
    final WidgetRuntime<?> runtime = WidgetRuntime.ofWidget(widget);
    final List<WidgetInfoDialog.NameStateValue> pvs = new ArrayList<>();
    for (RuntimePV pv : runtime.getPVs()) pvs.add(new WidgetInfoDialog.NameStateValue(pv.getName(), pv.isReadonly() ? "read-only" : "writable", pv.read()));
    final WidgetInfoDialog dialog = new WidgetInfoDialog(widget, pvs);
    if (event.display != null) {
        final Point mouse = event.display.getCursorLocation();
        dialog.setX(mouse.x);
        dialog.setY(mouse.y);
    }
    dialog.show();
    ModalityHack.forDialog(dialog);
}
Also used : RuntimePV(org.csstudio.display.builder.runtime.pv.RuntimePV) ArrayList(java.util.ArrayList) Point(org.eclipse.swt.graphics.Point) WidgetInfoDialog(org.csstudio.display.builder.representation.javafx.WidgetInfoDialog)

Aggregations

RuntimePV (org.csstudio.display.builder.runtime.pv.RuntimePV)21 CountDownLatch (java.util.concurrent.CountDownLatch)6 RuntimePVListener (org.csstudio.display.builder.runtime.pv.RuntimePVListener)6 List (java.util.List)5 WidgetProperty (org.csstudio.display.builder.model.WidgetProperty)5 ArrayList (java.util.ArrayList)4 Map (java.util.Map)4 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)4 AtomicReference (java.util.concurrent.atomic.AtomicReference)4 WidgetPropertyListener (org.csstudio.display.builder.model.WidgetPropertyListener)4 ArrayPVDispatcher (org.csstudio.display.builder.runtime.pv.ArrayPVDispatcher)4 VType (org.diirt.vtype.VType)4 Test (org.junit.Test)4 Listener (org.csstudio.display.builder.runtime.pv.ArrayPVDispatcher.Listener)3 Collection (java.util.Collection)2 CopyOnWriteArrayList (java.util.concurrent.CopyOnWriteArrayList)2 Level (java.util.logging.Level)2 ExecuteScriptActionInfo (org.csstudio.display.builder.model.properties.ExecuteScriptActionInfo)2 VTypeUtil (org.csstudio.display.builder.model.util.VTypeUtil)2 ROIWidgetProperty (org.csstudio.display.builder.model.widgets.plots.ImageWidget.ROIWidgetProperty)2