use of org.uberfire.ext.widgets.common.client.common.SmallLabel in project drools-wb by kiegroup.
the class DSLSentenceWidget method getLabel.
public Widget getLabel(String labelDef) {
SmallLabel label = new SmallLabel();
label.setText(labelDef.trim());
return label;
}
use of org.uberfire.ext.widgets.common.client.common.SmallLabel in project drools-wb by kiegroup.
the class ExpressionBuilder method initializeWidgets.
private void initializeWidgets() {
panel.clear();
StringBuilder bindingLabel = new StringBuilder();
String binding = getBoundText();
bindingLabel.append("<b>");
bindingLabel.append(binding);
bindingLabel.append("</b>");
bindingLabel.append(":");
if (isExpressionEmpty()) {
if (this.readOnly) {
panel.add(new SmallLabel("<b>-</b>"));
} else {
panel.add(createStartPointWidget());
}
} else {
if (this.readOnly) {
panel.add(createBindingWidgetForExpression(bindingLabel.toString()));
panel.add(createWidgetForExpression());
} else {
panel.add(createBindingWidgetForExpression(bindingLabel.toString()));
panel.add(createWidgetForExpression());
panel.add(getWidgetForCurrentType());
}
}
}
use of org.uberfire.ext.widgets.common.client.common.SmallLabel in project drools-wb by kiegroup.
the class FactPatternWidget method expressionBuilderLS.
private HorizontalPanel expressionBuilderLS(final SingleFieldConstraintEBLeftSide con, boolean showBinding) {
HorizontalPanel ab = new HorizontalPanel();
ab.setStyleName("modeller-field-Label");
if (!con.isBound()) {
if (bindable && showBinding && !this.readOnly) {
ab.add(new ExpressionBuilder(getModeller(), getEventBus(), con.getExpressionLeftSide()));
} else {
final DRLConstraintValueBuilder constraintValueBuilder = DRLConstraintValueBuilder.getBuilder(getRuleDialect());
final ToStringExpressionVisitor visitor = new ToStringExpressionVisitor(constraintValueBuilder);
ab.add(new SmallLabel(con.getExpressionLeftSide().getText(visitor)));
}
} else {
ab.add(new ExpressionBuilder(getModeller(), getEventBus(), con.getExpressionLeftSide()));
}
return ab;
}
use of org.uberfire.ext.widgets.common.client.common.SmallLabel in project drools-wb by kiegroup.
the class FactDataWidgetFactory method build.
public void build(final String headerText, final Fact fact) {
if (fact instanceof FactData) {
FactData factData = (FactData) fact;
widget.setWidget(0, ++col, new SmallLabel("[" + factData.getName() + "]"));
} else {
col++;
}
widget.setWidget(0, 0, new ClickableLabel(headerText, createAddFieldButton(fact)));
Map<FieldData, FieldDataConstraintEditor> enumEditorMap = new HashMap<FieldData, FieldDataConstraintEditor>();
// Sets row name and delete button.
for (final Field field : fact.getFieldData()) {
// Avoid duplicate field rows, only one for each name.
if (rowIndexByFieldName.doesNotContain(field.getName())) {
newRow(fact, field.getName());
}
// Sets row data
int fieldRowIndex = rowIndexByFieldName.getRowIndex(field.getName());
IsWidget editableCell = editableCell(field, fact, fact.getType());
widget.setWidget(fieldRowIndex, col, editableCell);
if (field instanceof FieldData) {
FieldData fieldData = (FieldData) field;
if (fieldData.getNature() == FieldData.TYPE_ENUM) {
enumEditorMap.put(fieldData, (FieldDataConstraintEditor) editableCell);
}
}
}
for (FieldDataConstraintEditor outerEnumEditor : enumEditorMap.values()) {
for (FieldDataConstraintEditor innerEnumEditor : enumEditorMap.values()) {
if (outerEnumEditor != innerEnumEditor) {
outerEnumEditor.addIfDependentEnumEditor(innerEnumEditor);
}
}
}
if (fact instanceof FactData) {
DeleteFactColumnButton deleteFactColumnButton = new DeleteFactColumnButton((FactData) fact);
widget.setWidget(rowIndexByFieldName.amountOrRows() + 1, col, deleteFactColumnButton);
}
}
use of org.uberfire.ext.widgets.common.client.common.SmallLabel in project drools-wb by kiegroup.
the class RetractWidget method render.
private void render() {
clear();
getCellFormatter().setStyleName(0, 0, "modeller-fact-TypeHeader");
getCellFormatter().setAlignment(0, 0, HasHorizontalAlignment.ALIGN_CENTER, HasVerticalAlignment.ALIGN_MIDDLE);
setStyleName("modeller-fact-pattern-Widget");
setWidget(0, 0, new SmallLabel(TestScenarioConstants.INSTANCE.DeleteFacts()));
getFlexCellFormatter().setColSpan(0, 0, 2);
int row = 1;
for (Fixture fixture : retractList) {
if (fixture instanceof RetractFact) {
final RetractFact retractFact = (RetractFact) fixture;
setWidget(row, 0, new SmallLabel(retractFact.getName()));
setWidget(row, 1, new DeleteButton(retractFact));
row++;
}
}
ScenarioUtils.addBottomAndRightPaddingToTableCells(this);
}
Aggregations