use of com.google.gwt.user.client.ui.HorizontalPanel in project drools-wb by kiegroup.
the class Connectives method connectives.
public Widget connectives(final SingleFieldConstraint c) {
final HorizontalPanel hp = new HorizontalPanel();
if (c.getConnectives() != null && c.getConnectives().length > 0) {
hp.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
hp.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
for (int i = 0; i < c.getConnectives().length; i++) {
final int index = i;
final ConnectiveConstraint con = c.getConnectives()[i];
connectiveOperatorDropDown(con, new Callback<Widget>() {
@Override
public void callback(final Widget w) {
hp.add(w);
hp.add(connectiveValueEditor(con));
if (!isReadOnly) {
Image clear = GuidedRuleEditorImages508.INSTANCE.DeleteItemSmall();
clear.setAltText(GuidedRuleEditorResources.CONSTANTS.RemoveThisRestriction());
clear.setTitle(GuidedRuleEditorResources.CONSTANTS.RemoveThisRestriction());
clear.addClickHandler(createClickHandlerForClearImageButton(c, index));
hp.add(clear);
}
}
});
}
}
return hp;
}
use of com.google.gwt.user.client.ui.HorizontalPanel in project drools-wb by kiegroup.
the class ActionCallMethodWidget method getSetterLabel.
private Widget getSetterLabel() {
HorizontalPanel horiz = new HorizontalPanel();
if (model.getState() == ActionCallMethod.TYPE_UNDEFINED) {
Image edit = GuidedRuleEditorImages508.INSTANCE.AddFieldToFact();
edit.setAltText(GuidedRuleEditorResources.CONSTANTS.AddAnotherFieldToThisSoYouCanSetItsValue());
edit.setTitle(GuidedRuleEditorResources.CONSTANTS.AddAnotherFieldToThisSoYouCanSetItsValue());
edit.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
Widget w = (Widget) event.getSource();
showAddFieldPopup(w);
}
});
// NON-NLS
horiz.add(new SmallLabel(HumanReadable.getActionDisplayName("call") + " [" + model.getVariable() + "]"));
if (!this.readOnly) {
horiz.add(edit);
}
} else {
// NON-NLS
horiz.add(new SmallLabel(HumanReadable.getActionDisplayName("call") + " [" + model.getVariable() + "." + model.getMethodName() + "]"));
}
return horiz;
}
use of com.google.gwt.user.client.ui.HorizontalPanel 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 com.google.gwt.user.client.ui.HorizontalPanel in project drools-wb by kiegroup.
the class MethodParameterCallValueEditor method widgets.
private Widget widgets(final Button lit, final InfoPopup popup) {
HorizontalPanel h = new HorizontalPanel();
h.add(lit);
h.add(popup);
return h;
}
use of com.google.gwt.user.client.ui.HorizontalPanel in project drools-wb by kiegroup.
the class TypeChoiceFormPopup method widgets.
private Panel widgets(final IsWidget left, final IsWidget right) {
HorizontalPanel panel = new HorizontalPanel();
panel.add(left);
panel.add(right);
panel.setWidth("100%");
return panel;
}
Aggregations