Search in sources :

Example 6 with AbstractRestrictedEntryTextBox

use of org.uberfire.ext.widgets.common.client.common.AbstractRestrictedEntryTextBox in project drools-wb by kiegroup.

the class DTCellValueWidgetFactory method makeNumericBigDecimalTextBox.

private AbstractRestrictedEntryTextBox makeNumericBigDecimalTextBox(final DTCellValue52 value) {
    final AbstractRestrictedEntryTextBox tb = new NumericBigDecimalTextBox(allowEmptyValues);
    final BigDecimal numericValue = (BigDecimal) value.getNumericValue();
    tb.setValue(numericValue == null ? "" : numericValue.toPlainString());
    // Wire up update handler
    tb.setEnabled(!isReadOnly);
    addNumericTextBoxChangeHandler(tb, value, (input -> new BigDecimal(input)), (BigDecimal) null, BigDecimal.ZERO);
    return tb;
}
Also used : ChangeEvent(com.google.gwt.event.dom.client.ChangeEvent) ValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler) ActionSetFieldCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionSetFieldCol52) OperatorsOracle(org.kie.soup.project.datamodel.oracle.OperatorsOracle) NumericBigDecimalTextBox(org.uberfire.ext.widgets.common.client.common.NumericBigDecimalTextBox) ValueChangeEvent(com.google.gwt.event.logical.shared.ValueChangeEvent) GuidedDecisionTableConstants(org.drools.workbench.screens.guided.dtable.client.resources.i18n.GuidedDecisionTableConstants) Arrays(java.util.Arrays) DataType(org.kie.soup.project.datamodel.oracle.DataType) BaseColumn(org.drools.workbench.models.guided.dtable.shared.model.BaseColumn) ConditionCol52(org.drools.workbench.models.guided.dtable.shared.model.ConditionCol52) ApplicationPreferences(org.kie.workbench.common.services.shared.preferences.ApplicationPreferences) ListBox(org.gwtbootstrap3.client.ui.ListBox) ChangeHandler(com.google.gwt.event.dom.client.ChangeHandler) Function(java.util.function.Function) LimitedEntryDropDownManager(org.drools.workbench.screens.guided.dtable.client.widget.table.utilities.LimitedEntryDropDownManager) BigDecimal(java.math.BigDecimal) DateTimeFormat(com.google.gwt.i18n.client.DateTimeFormat) DatePicker(org.uberfire.ext.widgets.common.client.common.DatePicker) AbstractRestrictedEntryTextBox(org.uberfire.ext.widgets.common.client.common.AbstractRestrictedEntryTextBox) Map(java.util.Map) BigInteger(java.math.BigInteger) Pattern52(org.drools.workbench.models.guided.dtable.shared.model.Pattern52) DefaultValueDropDownManager(org.drools.workbench.screens.guided.dtable.client.widget.table.utilities.DefaultValueDropDownManager) DropDownData(org.kie.soup.project.datamodel.oracle.DropDownData) DTColumnConfig52(org.drools.workbench.models.guided.dtable.shared.model.DTColumnConfig52) NumericShortTextBox(org.uberfire.ext.widgets.common.client.common.NumericShortTextBox) NumericTextBox(org.uberfire.ext.widgets.common.client.common.NumericTextBox) NumericIntegerTextBox(org.uberfire.ext.widgets.common.client.common.NumericIntegerTextBox) GuidedDecisionTable52(org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52) LimitedEntryCol(org.drools.workbench.models.guided.dtable.shared.model.LimitedEntryCol) Set(java.util.Set) TextBox(org.gwtbootstrap3.client.ui.TextBox) ActionInsertFactCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionInsertFactCol52) AsyncPackageDataModelOracle(org.kie.workbench.common.widgets.client.datamodel.AsyncPackageDataModelOracle) ColumnUtilities(org.drools.workbench.screens.guided.dtable.client.widget.table.utilities.ColumnUtilities) EnumDropDownUtilities(org.kie.workbench.common.widgets.client.widget.EnumDropDownUtilities) List(java.util.List) Widget(com.google.gwt.user.client.ui.Widget) NumericLongTextBox(org.uberfire.ext.widgets.common.client.common.NumericLongTextBox) Label(org.gwtbootstrap3.client.ui.Label) NumericDoubleTextBox(org.uberfire.ext.widgets.common.client.common.NumericDoubleTextBox) NumericFloatTextBox(org.uberfire.ext.widgets.common.client.common.NumericFloatTextBox) NumericByteTextBox(org.uberfire.ext.widgets.common.client.common.NumericByteTextBox) NumericBigIntegerTextBox(org.uberfire.ext.widgets.common.client.common.NumericBigIntegerTextBox) DTCellValue52(org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52) NumericBigDecimalTextBox(org.uberfire.ext.widgets.common.client.common.NumericBigDecimalTextBox) AbstractRestrictedEntryTextBox(org.uberfire.ext.widgets.common.client.common.AbstractRestrictedEntryTextBox) BigDecimal(java.math.BigDecimal)

Example 7 with AbstractRestrictedEntryTextBox

use of org.uberfire.ext.widgets.common.client.common.AbstractRestrictedEntryTextBox in project drools-wb by kiegroup.

the class DTCellValueWidgetFactory method makeNumericTextBox.

private AbstractRestrictedEntryTextBox makeNumericTextBox(final DTCellValue52 value) {
    final AbstractRestrictedEntryTextBox tb = new NumericTextBox(allowEmptyValues);
    final BigDecimal numericValue = (BigDecimal) value.getNumericValue();
    tb.setValue(numericValue == null ? "" : numericValue.toPlainString());
    // Wire up update handler
    tb.setEnabled(!isReadOnly);
    addNumericTextBoxChangeHandler(tb, value, (input -> new BigDecimal(input)), (BigDecimal) null, BigDecimal.ZERO);
    return tb;
}
Also used : ChangeEvent(com.google.gwt.event.dom.client.ChangeEvent) ValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler) ActionSetFieldCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionSetFieldCol52) OperatorsOracle(org.kie.soup.project.datamodel.oracle.OperatorsOracle) NumericBigDecimalTextBox(org.uberfire.ext.widgets.common.client.common.NumericBigDecimalTextBox) ValueChangeEvent(com.google.gwt.event.logical.shared.ValueChangeEvent) GuidedDecisionTableConstants(org.drools.workbench.screens.guided.dtable.client.resources.i18n.GuidedDecisionTableConstants) Arrays(java.util.Arrays) DataType(org.kie.soup.project.datamodel.oracle.DataType) BaseColumn(org.drools.workbench.models.guided.dtable.shared.model.BaseColumn) ConditionCol52(org.drools.workbench.models.guided.dtable.shared.model.ConditionCol52) ApplicationPreferences(org.kie.workbench.common.services.shared.preferences.ApplicationPreferences) ListBox(org.gwtbootstrap3.client.ui.ListBox) ChangeHandler(com.google.gwt.event.dom.client.ChangeHandler) Function(java.util.function.Function) LimitedEntryDropDownManager(org.drools.workbench.screens.guided.dtable.client.widget.table.utilities.LimitedEntryDropDownManager) BigDecimal(java.math.BigDecimal) DateTimeFormat(com.google.gwt.i18n.client.DateTimeFormat) DatePicker(org.uberfire.ext.widgets.common.client.common.DatePicker) AbstractRestrictedEntryTextBox(org.uberfire.ext.widgets.common.client.common.AbstractRestrictedEntryTextBox) Map(java.util.Map) BigInteger(java.math.BigInteger) Pattern52(org.drools.workbench.models.guided.dtable.shared.model.Pattern52) DefaultValueDropDownManager(org.drools.workbench.screens.guided.dtable.client.widget.table.utilities.DefaultValueDropDownManager) DropDownData(org.kie.soup.project.datamodel.oracle.DropDownData) DTColumnConfig52(org.drools.workbench.models.guided.dtable.shared.model.DTColumnConfig52) NumericShortTextBox(org.uberfire.ext.widgets.common.client.common.NumericShortTextBox) NumericTextBox(org.uberfire.ext.widgets.common.client.common.NumericTextBox) NumericIntegerTextBox(org.uberfire.ext.widgets.common.client.common.NumericIntegerTextBox) GuidedDecisionTable52(org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52) LimitedEntryCol(org.drools.workbench.models.guided.dtable.shared.model.LimitedEntryCol) Set(java.util.Set) TextBox(org.gwtbootstrap3.client.ui.TextBox) ActionInsertFactCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionInsertFactCol52) AsyncPackageDataModelOracle(org.kie.workbench.common.widgets.client.datamodel.AsyncPackageDataModelOracle) ColumnUtilities(org.drools.workbench.screens.guided.dtable.client.widget.table.utilities.ColumnUtilities) EnumDropDownUtilities(org.kie.workbench.common.widgets.client.widget.EnumDropDownUtilities) List(java.util.List) Widget(com.google.gwt.user.client.ui.Widget) NumericLongTextBox(org.uberfire.ext.widgets.common.client.common.NumericLongTextBox) Label(org.gwtbootstrap3.client.ui.Label) NumericDoubleTextBox(org.uberfire.ext.widgets.common.client.common.NumericDoubleTextBox) NumericFloatTextBox(org.uberfire.ext.widgets.common.client.common.NumericFloatTextBox) NumericByteTextBox(org.uberfire.ext.widgets.common.client.common.NumericByteTextBox) NumericBigIntegerTextBox(org.uberfire.ext.widgets.common.client.common.NumericBigIntegerTextBox) DTCellValue52(org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52) NumericTextBox(org.uberfire.ext.widgets.common.client.common.NumericTextBox) AbstractRestrictedEntryTextBox(org.uberfire.ext.widgets.common.client.common.AbstractRestrictedEntryTextBox) BigDecimal(java.math.BigDecimal)

Example 8 with AbstractRestrictedEntryTextBox

use of org.uberfire.ext.widgets.common.client.common.AbstractRestrictedEntryTextBox in project drools-wb by kiegroup.

the class DTCellValueWidgetFactory method makeNumericLongTextBox.

private AbstractRestrictedEntryTextBox makeNumericLongTextBox(final DTCellValue52 value) {
    final AbstractRestrictedEntryTextBox tb = new NumericLongTextBox(allowEmptyValues);
    final Long numericValue = (Long) value.getNumericValue();
    tb.setValue(numericValue == null ? "" : numericValue.toString());
    // Wire up update handler
    tb.setEnabled(!isReadOnly);
    addNumericTextBoxChangeHandler(tb, value, (input -> Long.valueOf(input)), (Long) null, 0L);
    return tb;
}
Also used : ChangeEvent(com.google.gwt.event.dom.client.ChangeEvent) ValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler) ActionSetFieldCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionSetFieldCol52) OperatorsOracle(org.kie.soup.project.datamodel.oracle.OperatorsOracle) NumericBigDecimalTextBox(org.uberfire.ext.widgets.common.client.common.NumericBigDecimalTextBox) ValueChangeEvent(com.google.gwt.event.logical.shared.ValueChangeEvent) GuidedDecisionTableConstants(org.drools.workbench.screens.guided.dtable.client.resources.i18n.GuidedDecisionTableConstants) Arrays(java.util.Arrays) DataType(org.kie.soup.project.datamodel.oracle.DataType) BaseColumn(org.drools.workbench.models.guided.dtable.shared.model.BaseColumn) ConditionCol52(org.drools.workbench.models.guided.dtable.shared.model.ConditionCol52) ApplicationPreferences(org.kie.workbench.common.services.shared.preferences.ApplicationPreferences) ListBox(org.gwtbootstrap3.client.ui.ListBox) ChangeHandler(com.google.gwt.event.dom.client.ChangeHandler) Function(java.util.function.Function) LimitedEntryDropDownManager(org.drools.workbench.screens.guided.dtable.client.widget.table.utilities.LimitedEntryDropDownManager) BigDecimal(java.math.BigDecimal) DateTimeFormat(com.google.gwt.i18n.client.DateTimeFormat) DatePicker(org.uberfire.ext.widgets.common.client.common.DatePicker) AbstractRestrictedEntryTextBox(org.uberfire.ext.widgets.common.client.common.AbstractRestrictedEntryTextBox) Map(java.util.Map) BigInteger(java.math.BigInteger) Pattern52(org.drools.workbench.models.guided.dtable.shared.model.Pattern52) DefaultValueDropDownManager(org.drools.workbench.screens.guided.dtable.client.widget.table.utilities.DefaultValueDropDownManager) DropDownData(org.kie.soup.project.datamodel.oracle.DropDownData) DTColumnConfig52(org.drools.workbench.models.guided.dtable.shared.model.DTColumnConfig52) NumericShortTextBox(org.uberfire.ext.widgets.common.client.common.NumericShortTextBox) NumericTextBox(org.uberfire.ext.widgets.common.client.common.NumericTextBox) NumericIntegerTextBox(org.uberfire.ext.widgets.common.client.common.NumericIntegerTextBox) GuidedDecisionTable52(org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52) LimitedEntryCol(org.drools.workbench.models.guided.dtable.shared.model.LimitedEntryCol) Set(java.util.Set) TextBox(org.gwtbootstrap3.client.ui.TextBox) ActionInsertFactCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionInsertFactCol52) AsyncPackageDataModelOracle(org.kie.workbench.common.widgets.client.datamodel.AsyncPackageDataModelOracle) ColumnUtilities(org.drools.workbench.screens.guided.dtable.client.widget.table.utilities.ColumnUtilities) EnumDropDownUtilities(org.kie.workbench.common.widgets.client.widget.EnumDropDownUtilities) List(java.util.List) Widget(com.google.gwt.user.client.ui.Widget) NumericLongTextBox(org.uberfire.ext.widgets.common.client.common.NumericLongTextBox) Label(org.gwtbootstrap3.client.ui.Label) NumericDoubleTextBox(org.uberfire.ext.widgets.common.client.common.NumericDoubleTextBox) NumericFloatTextBox(org.uberfire.ext.widgets.common.client.common.NumericFloatTextBox) NumericByteTextBox(org.uberfire.ext.widgets.common.client.common.NumericByteTextBox) NumericBigIntegerTextBox(org.uberfire.ext.widgets.common.client.common.NumericBigIntegerTextBox) DTCellValue52(org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52) AbstractRestrictedEntryTextBox(org.uberfire.ext.widgets.common.client.common.AbstractRestrictedEntryTextBox) NumericLongTextBox(org.uberfire.ext.widgets.common.client.common.NumericLongTextBox)

Example 9 with AbstractRestrictedEntryTextBox

use of org.uberfire.ext.widgets.common.client.common.AbstractRestrictedEntryTextBox in project drools-wb by kiegroup.

the class DTCellValueWidgetFactory method makeNumericShortTextBox.

private AbstractRestrictedEntryTextBox makeNumericShortTextBox(final DTCellValue52 value) {
    final AbstractRestrictedEntryTextBox tb = new NumericShortTextBox(allowEmptyValues);
    final Short numericValue = (Short) value.getNumericValue();
    tb.setValue(numericValue == null ? "" : numericValue.toString());
    // Wire up update handler
    tb.setEnabled(!isReadOnly);
    addNumericTextBoxChangeHandler(tb, value, (input -> Short.valueOf(input)), (Short) null, Short.valueOf("0"));
    return tb;
}
Also used : NumericShortTextBox(org.uberfire.ext.widgets.common.client.common.NumericShortTextBox) ChangeEvent(com.google.gwt.event.dom.client.ChangeEvent) ValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler) ActionSetFieldCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionSetFieldCol52) OperatorsOracle(org.kie.soup.project.datamodel.oracle.OperatorsOracle) NumericBigDecimalTextBox(org.uberfire.ext.widgets.common.client.common.NumericBigDecimalTextBox) ValueChangeEvent(com.google.gwt.event.logical.shared.ValueChangeEvent) GuidedDecisionTableConstants(org.drools.workbench.screens.guided.dtable.client.resources.i18n.GuidedDecisionTableConstants) Arrays(java.util.Arrays) DataType(org.kie.soup.project.datamodel.oracle.DataType) BaseColumn(org.drools.workbench.models.guided.dtable.shared.model.BaseColumn) ConditionCol52(org.drools.workbench.models.guided.dtable.shared.model.ConditionCol52) ApplicationPreferences(org.kie.workbench.common.services.shared.preferences.ApplicationPreferences) ListBox(org.gwtbootstrap3.client.ui.ListBox) ChangeHandler(com.google.gwt.event.dom.client.ChangeHandler) Function(java.util.function.Function) LimitedEntryDropDownManager(org.drools.workbench.screens.guided.dtable.client.widget.table.utilities.LimitedEntryDropDownManager) BigDecimal(java.math.BigDecimal) DateTimeFormat(com.google.gwt.i18n.client.DateTimeFormat) DatePicker(org.uberfire.ext.widgets.common.client.common.DatePicker) AbstractRestrictedEntryTextBox(org.uberfire.ext.widgets.common.client.common.AbstractRestrictedEntryTextBox) Map(java.util.Map) BigInteger(java.math.BigInteger) Pattern52(org.drools.workbench.models.guided.dtable.shared.model.Pattern52) DefaultValueDropDownManager(org.drools.workbench.screens.guided.dtable.client.widget.table.utilities.DefaultValueDropDownManager) DropDownData(org.kie.soup.project.datamodel.oracle.DropDownData) DTColumnConfig52(org.drools.workbench.models.guided.dtable.shared.model.DTColumnConfig52) NumericShortTextBox(org.uberfire.ext.widgets.common.client.common.NumericShortTextBox) NumericTextBox(org.uberfire.ext.widgets.common.client.common.NumericTextBox) NumericIntegerTextBox(org.uberfire.ext.widgets.common.client.common.NumericIntegerTextBox) GuidedDecisionTable52(org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52) LimitedEntryCol(org.drools.workbench.models.guided.dtable.shared.model.LimitedEntryCol) Set(java.util.Set) TextBox(org.gwtbootstrap3.client.ui.TextBox) ActionInsertFactCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionInsertFactCol52) AsyncPackageDataModelOracle(org.kie.workbench.common.widgets.client.datamodel.AsyncPackageDataModelOracle) ColumnUtilities(org.drools.workbench.screens.guided.dtable.client.widget.table.utilities.ColumnUtilities) EnumDropDownUtilities(org.kie.workbench.common.widgets.client.widget.EnumDropDownUtilities) List(java.util.List) Widget(com.google.gwt.user.client.ui.Widget) NumericLongTextBox(org.uberfire.ext.widgets.common.client.common.NumericLongTextBox) Label(org.gwtbootstrap3.client.ui.Label) NumericDoubleTextBox(org.uberfire.ext.widgets.common.client.common.NumericDoubleTextBox) NumericFloatTextBox(org.uberfire.ext.widgets.common.client.common.NumericFloatTextBox) NumericByteTextBox(org.uberfire.ext.widgets.common.client.common.NumericByteTextBox) NumericBigIntegerTextBox(org.uberfire.ext.widgets.common.client.common.NumericBigIntegerTextBox) DTCellValue52(org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52) AbstractRestrictedEntryTextBox(org.uberfire.ext.widgets.common.client.common.AbstractRestrictedEntryTextBox)

Example 10 with AbstractRestrictedEntryTextBox

use of org.uberfire.ext.widgets.common.client.common.AbstractRestrictedEntryTextBox in project drools-wb by kiegroup.

the class CEPWindowOperatorsDropdown method operatorChanged.

// Hide\display the additional CEP widget is appropriate
private void operatorChanged(OperatorSelection selection) {
    parametersContainer.clear();
    String operator = selection.getValue();
    if (CEPOracle.isCEPWindowOperatorTime(operator)) {
        AbstractRestrictedEntryTextBox txt = new CEPTimeParameterTextBox(hcw.getWindow(), 1);
        initialiseTextBox(txt);
    } else if (CEPOracle.isCEPWindowOperatorLength(operator)) {
        AbstractRestrictedEntryTextBox txt = new CEPLengthParameterTextBox(hcw.getWindow(), 1);
        initialiseTextBox(txt);
    } else {
        parametersContainer.setVisible(false);
        hcw.getWindow().clearParameters();
    }
}
Also used : AbstractRestrictedEntryTextBox(org.uberfire.ext.widgets.common.client.common.AbstractRestrictedEntryTextBox)

Aggregations

AbstractRestrictedEntryTextBox (org.uberfire.ext.widgets.common.client.common.AbstractRestrictedEntryTextBox)10 ChangeEvent (com.google.gwt.event.dom.client.ChangeEvent)9 ChangeHandler (com.google.gwt.event.dom.client.ChangeHandler)9 ValueChangeEvent (com.google.gwt.event.logical.shared.ValueChangeEvent)9 ValueChangeHandler (com.google.gwt.event.logical.shared.ValueChangeHandler)9 DateTimeFormat (com.google.gwt.i18n.client.DateTimeFormat)9 Widget (com.google.gwt.user.client.ui.Widget)9 BigDecimal (java.math.BigDecimal)9 BigInteger (java.math.BigInteger)9 Arrays (java.util.Arrays)9 List (java.util.List)9 Map (java.util.Map)9 Set (java.util.Set)9 Function (java.util.function.Function)9 ActionInsertFactCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionInsertFactCol52)9 ActionSetFieldCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionSetFieldCol52)9 BaseColumn (org.drools.workbench.models.guided.dtable.shared.model.BaseColumn)9 ConditionCol52 (org.drools.workbench.models.guided.dtable.shared.model.ConditionCol52)9 DTCellValue52 (org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52)9 DTColumnConfig52 (org.drools.workbench.models.guided.dtable.shared.model.DTColumnConfig52)9