use of org.uberfire.ext.widgets.common.client.common.InfoPopup in project drools-wb by kiegroup.
the class RuleModellerActionSelectorPopup method getContent.
@Override
public Widget getContent() {
if (position == null) {
positionCbo.addItem(GuidedRuleEditorResources.CONSTANTS.Bottom(), String.valueOf(this.model.rhs.length));
positionCbo.addItem(GuidedRuleEditorResources.CONSTANTS.Top(), "0");
for (int i = 1; i < model.rhs.length; i++) {
positionCbo.addItem(GuidedRuleEditorResources.CONSTANTS.Line0(i), String.valueOf(i));
}
} else {
// if position is fixed, we just add one element to the drop down.
positionCbo.addItem(String.valueOf(position));
positionCbo.setSelectedIndex(0);
}
if (oracle.getDSLConditions().size() == 0 && oracle.getFactTypes().length == 0) {
layoutPanel.addRow(new HTML("<div class='highlight'>" + GuidedRuleEditorResources.CONSTANTS.NoModelTip() + "</div>"));
}
// only show the drop down if we are not using fixed position.
if (position == null) {
HorizontalPanel hp0 = new HorizontalPanel();
hp0.add(new HTML(GuidedRuleEditorResources.CONSTANTS.PositionColon()));
hp0.add(positionCbo);
hp0.add(new InfoPopup(GuidedRuleEditorResources.CONSTANTS.PositionColon(), GuidedRuleEditorResources.CONSTANTS.ActionPositionExplanation()));
layoutPanel.addRow(hp0);
layoutPanel.addRow(new HTML("<hr/>"));
}
choices = makeChoicesListBox();
choicesPanel.add(choices);
layoutPanel.addRow(choicesPanel);
// DSL might be prohibited (e.g. editing a DRL file. Only DSLR files can contain DSL)
if (ruleModeller.isDSLEnabled()) {
CheckBox chkOnlyDisplayDSLConditions = new CheckBox();
chkOnlyDisplayDSLConditions.setText(GuidedRuleEditorResources.CONSTANTS.OnlyDisplayDSLActions());
chkOnlyDisplayDSLConditions.setValue(onlyShowDSLStatements);
chkOnlyDisplayDSLConditions.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
public void onValueChange(ValueChangeEvent<Boolean> event) {
onlyShowDSLStatements = event.getValue();
choicesPanel.setWidget(makeChoicesListBox());
}
});
layoutPanel.addRow(chkOnlyDisplayDSLConditions);
}
return layoutPanel;
}
use of org.uberfire.ext.widgets.common.client.common.InfoPopup in project drools-wb by kiegroup.
the class GuidedRuleAttributeSelectorPopup method setFreezePanel.
private void setFreezePanel(final boolean lockLHS, final boolean lockRHS) {
HorizontalPanel hz = new HorizontalPanel();
if (!lockLHS) {
hz.add(createFreezeButton(GuidedRuleEditorResources.CONSTANTS.Conditions(), RuleAttributeWidget.LOCK_LHS));
}
if (!lockRHS) {
hz.add(createFreezeButton(GuidedRuleEditorResources.CONSTANTS.Actions(), RuleAttributeWidget.LOCK_RHS));
}
hz.add(new InfoPopup(GuidedRuleEditorResources.CONSTANTS.FrozenAreas(), GuidedRuleEditorResources.CONSTANTS.FrozenExplanation()));
if (hz.getWidgetCount() > 1) {
addAttribute(GuidedRuleEditorResources.CONSTANTS.FreezeAreasForEditing(), hz);
}
}
use of org.uberfire.ext.widgets.common.client.common.InfoPopup in project drools-wb by kiegroup.
the class RuleAttributeWidget method getEditorWidget.
private Widget getEditorWidget(final RuleMetadata rm, final int idx, final boolean isReadOnly) {
IsWidget editor;
if (rm.getAttributeName().equals(LOCK_LHS) || rm.getAttributeName().equals(LOCK_RHS)) {
editor = new InfoPopup(GuidedRuleEditorResources.CONSTANTS.FrozenAreas(), GuidedRuleEditorResources.CONSTANTS.FrozenExplanation());
} else {
editor = textBoxEditor(rm, isReadOnly);
}
DirtyableHorizontalPane horiz = new DirtyableHorizontalPane();
horiz.add(editor);
if (!isReadOnly) {
horiz.add(getRemoveMetaIcon(idx));
}
return horiz;
}
use of org.uberfire.ext.widgets.common.client.common.InfoPopup in project drools-wb by kiegroup.
the class RuleModellerConditionSelectorPopup method getContent.
@Override
public Widget getContent() {
if (position == null) {
positionCbo.addItem(GuidedRuleEditorResources.CONSTANTS.Bottom(), String.valueOf(this.model.lhs.length));
positionCbo.addItem(GuidedRuleEditorResources.CONSTANTS.Top(), "0");
for (int i = 1; i < model.lhs.length; i++) {
positionCbo.addItem(GuidedRuleEditorResources.CONSTANTS.Line0(i), String.valueOf(i));
}
} else {
// if position is fixed, we just add one element to the drop down.
positionCbo.addItem(String.valueOf(position));
positionCbo.setSelectedIndex(0);
}
if (oracle.getDSLConditions().size() == 0 && oracle.getFactTypes().length == 0) {
layoutPanel.addRow(new HTML("<div class='highlight'>" + GuidedRuleEditorResources.CONSTANTS.NoModelTip() + "</div>"));
}
// only show the drop down if we are not using fixed position.
if (position == null) {
HorizontalPanel hp0 = new HorizontalPanel();
hp0.add(new HTML(GuidedRuleEditorResources.CONSTANTS.PositionColon()));
hp0.add(positionCbo);
hp0.add(new InfoPopup(GuidedRuleEditorResources.CONSTANTS.PositionColon(), GuidedRuleEditorResources.CONSTANTS.ConditionPositionExplanation()));
layoutPanel.addRow(hp0);
layoutPanel.addRow(new HTML("<hr/>"));
}
choices = makeChoicesListBox();
choicesPanel.add(choices);
layoutPanel.addRow(choicesPanel);
// DSL might be prohibited (e.g. editing a DRL file. Only DSLR files can contain DSL)
if (ruleModeller.isDSLEnabled()) {
CheckBox chkOnlyDisplayDSLConditions = new CheckBox();
chkOnlyDisplayDSLConditions.setText(GuidedRuleEditorResources.CONSTANTS.OnlyDisplayDSLConditions());
chkOnlyDisplayDSLConditions.setValue(onlyShowDSLStatements);
chkOnlyDisplayDSLConditions.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
public void onValueChange(ValueChangeEvent<Boolean> event) {
onlyShowDSLStatements = event.getValue();
choicesPanel.setWidget(makeChoicesListBox());
}
});
layoutPanel.addRow(chkOnlyDisplayDSLConditions);
}
return layoutPanel;
}
use of org.uberfire.ext.widgets.common.client.common.InfoPopup in project drools-wb by kiegroup.
the class TypeChoiceFormPopup method addCreateNewObject.
private void addCreateNewObject() {
Button button = new Button(TestScenarioConstants.INSTANCE.CreateNewFact());
button.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent w) {
fireSelection(FieldData.TYPE_FACT);
}
});
addAttribute(TestScenarioConstants.INSTANCE.Fact(), widgets(button, new InfoPopup(TestScenarioConstants.INSTANCE.CreateNewFact(), TestScenarioConstants.INSTANCE.CreateNewFactTip())));
}
Aggregations