use of org.csstudio.opibuilder.widgets.model.MenuButtonModel.PROP_LABEL in project yamcs-studio by yamcs.
the class MenuButtonEditPart method registerPropertyChangeHandlers.
@Override
protected void registerPropertyChangeHandlers() {
setPropertyChangeHandler(PROP_PVNAME, (oldValue, newValue, figure) -> {
registerLoadActionsListener();
return false;
});
setPropertyChangeHandler(PROP_PVVALUE, (oldValue, newValue, refreshableFigure) -> {
if ((newValue != null) && (newValue instanceof Scalar)) {
((MenuButtonFigure) refreshableFigure).setText(VTypeHelper.getString((VType) newValue));
}
return true;
});
setPropertyChangeHandler(PROP_LABEL, (oldValue, newValue, refreshableFigure) -> {
((MenuButtonFigure) refreshableFigure).setText(newValue.toString());
return true;
});
setPropertyChangeHandler(PROP_TRANSPARENT, (oldValue, newValue, refreshableFigure) -> {
((MenuButtonFigure) refreshableFigure).setOpaque(!(Boolean) newValue);
return true;
});
setPropertyChangeHandler(PROP_SHOW_DOWN_ARROW, (oldValue, newValue, refreshableFigure) -> {
((MenuButtonFigure) refreshableFigure).setDownArrowVisible((boolean) newValue);
return true;
});
IWidgetPropertyChangeHandler handler = (oldValue, newValue, refreshableFigure) -> {
updatePropSheet((Boolean) newValue);
return false;
};
getWidgetModel().getProperty(PROP_ACTIONS_FROM_PV).addPropertyChangeListener(evt -> handler.handleChange(evt.getOldValue(), evt.getNewValue(), getFigure()));
}
Aggregations