Search in sources :

Example 11 with CheckBox

use of org.gwtbootstrap3.client.ui.CheckBox in project drools-wb by kiegroup.

the class AttributeColumnConfigRowView method addHideColumnCheckBox.

public CheckBox addHideColumnCheckBox(AttributeCol52 attributeColumn, ClickHandler clickHandler) {
    final CheckBox chkHideColumn = new CheckBox(new StringBuilder(GuidedDecisionTableConstants.INSTANCE.HideThisColumn()).append(GuidedDecisionTableConstants.COLON).toString());
    chkHideColumn.setValue(attributeColumn.isHideColumn());
    chkHideColumn.addClickHandler(clickHandler);
    add(chkHideColumn);
    return chkHideColumn;
}
Also used : CheckBox(org.gwtbootstrap3.client.ui.CheckBox)

Example 12 with CheckBox

use of org.gwtbootstrap3.client.ui.CheckBox in project drools-wb by kiegroup.

the class AttributeColumnConfigRowView method addReverseOrderCheckBox.

public CheckBox addReverseOrderCheckBox(AttributeCol52 attributeColumn, boolean isEditable, ClickHandler clickHandler) {
    final CheckBox chkReverseOrder = new CheckBox(GuidedDecisionTableConstants.INSTANCE.ReverseOrder());
    chkReverseOrder.setValue(attributeColumn.isReverseOrder());
    chkReverseOrder.setEnabled(attributeColumn.isUseRowNumber() && isEditable);
    chkReverseOrder.addClickHandler(clickHandler);
    add(chkReverseOrder);
    return chkReverseOrder;
}
Also used : CheckBox(org.gwtbootstrap3.client.ui.CheckBox)

Example 13 with CheckBox

use of org.gwtbootstrap3.client.ui.CheckBox in project drools-wb by kiegroup.

the class AttributeColumnConfigRowView method addUseRowNumberCheckBox.

public CheckBox addUseRowNumberCheckBox(AttributeCol52 attributeColumn, boolean isEditable, ClickHandler clickHandler) {
    final CheckBox chkUseRowNumber = new CheckBox(GuidedDecisionTableConstants.INSTANCE.UseRowNumber());
    chkUseRowNumber.setValue(attributeColumn.isUseRowNumber());
    chkUseRowNumber.setEnabled(isEditable);
    chkUseRowNumber.addClickHandler(clickHandler);
    add(chkUseRowNumber);
    return chkUseRowNumber;
}
Also used : CheckBox(org.gwtbootstrap3.client.ui.CheckBox)

Example 14 with CheckBox

use of org.gwtbootstrap3.client.ui.CheckBox 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;
}
Also used : CheckBox(org.gwtbootstrap3.client.ui.CheckBox) HorizontalPanel(com.google.gwt.user.client.ui.HorizontalPanel) HTML(com.google.gwt.user.client.ui.HTML) InfoPopup(org.uberfire.ext.widgets.common.client.common.InfoPopup)

Aggregations

CheckBox (org.gwtbootstrap3.client.ui.CheckBox)14 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)5 Test (org.junit.Test)5 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)4 HorizontalPanel (com.google.gwt.user.client.ui.HorizontalPanel)4 ValueChangeEvent (com.google.gwt.event.logical.shared.ValueChangeEvent)2 HTML (com.google.gwt.user.client.ui.HTML)2 MetadataCol52 (org.drools.workbench.models.guided.dtable.shared.model.MetadataCol52)2 GuidedDecisionTableView (org.drools.workbench.screens.guided.dtable.client.widget.table.GuidedDecisionTableView)2 ColumnLabelWidget (org.drools.workbench.screens.guided.dtable.client.widget.table.columns.control.ColumnLabelWidget)2 DeleteColumnManagementAnchorWidget (org.drools.workbench.screens.guided.dtable.client.widget.table.columns.control.DeleteColumnManagementAnchorWidget)2 InfoPopup (org.uberfire.ext.widgets.common.client.common.InfoPopup)2 ChangeEvent (com.google.gwt.event.dom.client.ChangeEvent)1 ChangeHandler (com.google.gwt.event.dom.client.ChangeHandler)1 ValueChangeHandler (com.google.gwt.event.logical.shared.ValueChangeHandler)1 Widget (com.google.gwt.user.client.ui.Widget)1 Date (java.util.Date)1 DTCellValue52 (org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52)1 ModelSynchronizer (org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.ModelSynchronizer)1 RuleAttributeWidget (org.drools.workbench.screens.guided.rule.client.editor.RuleAttributeWidget)1