Search in sources :

Example 1 with TextInputModel

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);
            }
        }
    }
}
Also used : VType(org.diirt.vtype.VType) TextInputModel(org.csstudio.opibuilder.widgets.model.TextInputModel) IPV(org.csstudio.simplepv.IPV)

Example 2 with TextInputModel

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();
}
Also used : TextInputModel(org.csstudio.opibuilder.widgets.model.TextInputModel)

Example 3 with TextInputModel

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);
}
Also used : AbstractContainerModel(org.csstudio.opibuilder.model.AbstractContainerModel) TextInputModel(org.csstudio.opibuilder.widgets.model.TextInputModel)

Aggregations

TextInputModel (org.csstudio.opibuilder.widgets.model.TextInputModel)3 AbstractContainerModel (org.csstudio.opibuilder.model.AbstractContainerModel)1 IPV (org.csstudio.simplepv.IPV)1 VType (org.diirt.vtype.VType)1