Search in sources :

Example 1 with WidgetInfoDialog

use of org.csstudio.display.builder.representation.javafx.WidgetInfoDialog 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

ArrayList (java.util.ArrayList)1 WidgetInfoDialog (org.csstudio.display.builder.representation.javafx.WidgetInfoDialog)1 RuntimePV (org.csstudio.display.builder.runtime.pv.RuntimePV)1 Point (org.eclipse.swt.graphics.Point)1