use of org.csstudio.opibuilder.widgets.model.TextInputModel in project yamcs-studio by yamcs.
the class TextInputEditpart method registerLoadLimitsListener.
/**
*/
private void registerLoadLimitsListener() {
if (getExecutionMode() == ExecutionMode.RUN_MODE) {
final TextInputModel model = getWidgetModel();
if (model.isLimitsFromPV()) {
IPV pv = getPV(AbstractPVWidgetModel.PROP_PVNAME);
if (pv != null) {
if (pvLoadLimitsListener == null)
pvLoadLimitsListener = new IPVListener.Stub() {
@Override
public void valueChanged(IPV pv) {
VType value = pv.getValue();
if (value != null && VTypeHelper.getDisplayInfo(value) != null) {
org.diirt.vtype.Display new_meta = VTypeHelper.getDisplayInfo(value);
if (meta == null || !meta.equals(new_meta)) {
meta = new_meta;
// Update min/max from the control range of the PV
model.setPropertyValue(TextInputModel.PROP_MAX, meta.getUpperCtrlLimit());
model.setPropertyValue(TextInputModel.PROP_MIN, meta.getLowerCtrlLimit());
}
}
}
};
pv.addListener(pvLoadLimitsListener);
}
}
}
}
use of org.csstudio.opibuilder.widgets.model.TextInputModel in project yamcs-studio by yamcs.
the class TextInputEditpart method updatePropSheet.
/**
* @param newValue
*/
protected void updatePropSheet() {
TextInputModel model = getWidgetModel();
model.setPropertyVisible(TextInputModel.PROP_MAX, !getWidgetModel().isLimitsFromPV());
model.setPropertyVisible(TextInputModel.PROP_MIN, !getWidgetModel().isLimitsFromPV());
// set native text related properties visibility
boolean isNative = delegate instanceof NativeTextEditpartDelegate;
model.setPropertyVisible(TextInputModel.PROP_SHOW_NATIVE_BORDER, isNative);
model.setPropertyVisible(TextInputModel.PROP_PASSWORD_INPUT, isNative);
model.setPropertyVisible(TextInputModel.PROP_READ_ONLY, isNative);
model.setPropertyVisible(TextInputModel.PROP_SHOW_H_SCROLL, isNative);
model.setPropertyVisible(TextInputModel.PROP_SHOW_V_SCROLL, isNative);
model.setPropertyVisible(TextInputModel.PROP_NEXT_FOCUS, isNative);
model.setPropertyVisible(TextInputModel.PROP_WRAP_WORDS, isNative);
// set classic text figure related properties visibility
model.setPropertyVisible(TextInputModel.PROP_TRANSPARENT, !isNative);
model.setPropertyVisible(TextInputModel.PROP_ROTATION, !isNative);
model.setPropertyVisible(TextInputModel.PROP_SELECTOR_TYPE, !isNative);
delegate.updatePropSheet();
}
use of org.csstudio.opibuilder.widgets.model.TextInputModel in project yamcs-studio by yamcs.
the class TextInputEditpart method reCreateWidget.
private void reCreateWidget() {
TextInputModel model = getWidgetModel();
AbstractContainerModel parent = model.getParent();
parent.removeChild(model);
parent.addChild(model);
parent.selectWidget(model, true);
}
Aggregations