@Inject public DecimalInputPropertyEditor( AppTemplateWizardAppearance appearance, AppsWidgetsPropertyPanelLabels appLabels, AppsWidgetsContextualHelpMessages help, ArgumentValidatorEditor validatorsEditor) { super(appearance); this.appLabels = appLabels; this.doubleInputLabels = appLabels; this.validatorsEditor = validatorsEditor; SpinnerField<Double> dblSpinnerField = new SpinnerField<Double>(new NumberPropertyEditor.DoublePropertyEditor()); dblSpinnerField.setErrorSupport(new IPlantSideErrorHandler(dblSpinnerField)); dblSpinnerField.setMinValue(-Double.MAX_VALUE); dblSpinnerField.setEmptyText(doubleInputLabels.doubleInputWidgetEmptyEditText()); defaultValueEditor = new ArgumentEditorConverter<Double>(dblSpinnerField, new SplittableToDoubleConverter()); initWidget(uiBinder.createAndBindUi(this)); argumentOptionEditor.addValidator( new CmdLineArgCharacterValidator(I18N.V_CONSTANTS.restrictedCmdLineChars())); defaultValueLabel.setHTML( appearance.createContextualHelpLabel( appLabels.integerInputDefaultLabel(), help.integerInputDefaultValue())); omitIfBlank.setHTML( new SafeHtmlBuilder() .appendHtmlConstant(" ") .append( appearance.createContextualHelpLabelNoFloat( appLabels.excludeWhenEmpty(), help.integerInputExcludeArgument())) .toSafeHtml()); toolTipLabel.setHTML( appearance.createContextualHelpLabel(appLabels.toolTipText(), help.toolTip())); argumentOptionLabel.setHTML( appearance.createContextualHelpLabel(appLabels.argumentOption(), help.argumentOption())); doNotDisplay.setHTML( new SafeHtmlBuilder() .appendHtmlConstant(" ") .append(appLabels.doNotDisplay()) .toSafeHtml()); requiredEditor.setHTML( new SafeHtmlBuilder() .appendHtmlConstant(" ") .append(appLabels.isRequired()) .toSafeHtml()); editorDriver.initialize(this); editorDriver.accept(new InitializeTwoWayBinding(this)); }
@UiHandler("validatorsEditor") void onValidatorListChanged( @SuppressWarnings("unused") ValueChangeEvent<List<ArgumentValidator>> event) { // FIXME CORE-4806 Refactor ArgumentValidatorEditor s.t. it integrates with // InitializeTwoWayBinding editorDriver.flush(); this.getBoundEditorDelegate().accept(new Refresher()); }
@Override public void edit(Argument argument) { super.edit(argument); editorDriver.edit(argument); }