use of org.gwtbootstrap3.client.ui.TextBox in project drools-wb by kiegroup.
the class GuidedScoreCardEditor method removeCharacteristic.
private void removeCharacteristic(final FlexTable selectedTable) {
if (selectedTable != null) {
final TextBox tbName = (TextBox) selectedTable.getWidget(0, 1);
String name = tbName.getValue();
if (name == null || name.trim().length() == 0) {
name = "Untitled";
}
final String msg = GuidedScoreCardConstants.INSTANCE.promptDeleteCharacteristic0(name);
if (Window.confirm(msg)) {
characteristicsTables.remove(selectedTable);
characteristicsAttrMap.remove(selectedTable);
final Widget parent = selectedTable.getParent().getParent();
final int i = characteristicsPanel.getWidgetIndex(parent);
characteristicsPanel.remove(parent);
characteristicsPanel.remove(i);
}
}
}
use of org.gwtbootstrap3.client.ui.TextBox in project drools-wb by kiegroup.
the class FactPatternWidget method predicateEditor.
/**
* This provides an inline formula editor, not unlike a spreadsheet does.
*/
private Widget predicateEditor(final SingleFieldConstraint c) {
HorizontalPanel pred = new HorizontalPanel();
pred.setWidth("100%");
Image img = new Image(GuidedRuleEditorResources.INSTANCE.images().functionAssets());
img.setTitle(GuidedRuleEditorResources.CONSTANTS.FormulaBooleanTip());
pred.add(img);
if (c.getValue() == null) {
c.setValue("");
}
final TextBox box = new TextBox();
box.setText(c.getValue());
if (!this.readOnly) {
box.addChangeHandler(new ChangeHandler() {
public void onChange(ChangeEvent event) {
setModified(true);
c.setValue(box.getText());
}
});
box.setWidth("100%");
pred.add(box);
} else {
pred.add(new SmallLabel(c.getValue()));
}
return pred;
}
use of org.gwtbootstrap3.client.ui.TextBox in project drools-wb by kiegroup.
the class ActionValueEditor method formulaEditor.
/**
* An editor for formula
* @return
*/
private Widget formulaEditor() {
if (this.readOnly) {
return new SmallLabel(assertValue());
}
final TextBox box = new TextBox();
box.addValueChangeHandler(new ValueChangeHandler<String>() {
@Override
public void onValueChange(ValueChangeEvent<String> event) {
value.setValue(event.getValue());
executeOnChangeCommand();
}
});
// FireEvents as the box could assume a default value
box.setValue(assertValue(), true);
attachDisplayLengthHandler(box);
return box;
}
use of org.gwtbootstrap3.client.ui.TextBox in project drools-wb by kiegroup.
the class ConstraintValueEditor method getNewTextBox.
TextBox getNewTextBox(final String fieldType) {
final TextBox box = getDefaultTextBox(fieldType);
setUpTextBoxStyleAndHandlers(box, onValueChangeCommand);
box.setText(getSanitizedValue());
attachDisplayLengthHandler(box);
return box;
}
use of org.gwtbootstrap3.client.ui.TextBox in project drools-wb by kiegroup.
the class ConstraintValueEditor method returnValueEditor.
/**
* An editor for the retval "formula" (expression).
*/
private Widget returnValueEditor() {
TextBox box = new BoundTextBox(constraint);
if (this.readOnly) {
return new SmallLabel(box.getText());
}
String msg = GuidedRuleEditorResources.CONSTANTS.FormulaEvaluateToAValue();
Image img = new Image(GuidedRuleEditorResources.INSTANCE.images().functionAssets());
img.setTitle(msg);
box.setTitle(msg);
box.addValueChangeHandler(new ValueChangeHandler<String>() {
public void onValueChange(final ValueChangeEvent event) {
executeOnValueChangeCommand();
}
});
Widget ed = widgets(img, box);
return ed;
}
Aggregations