Search in sources :

Example 1 with DecoratedDisclosurePanel

use of org.uberfire.ext.widgets.common.client.common.DecoratedDisclosurePanel in project drools-wb by kiegroup.

the class GuidedScoreCardEditor method setContent.

public void setContent(final ScoreCardModel model, final AsyncPackageDataModelOracle oracle) {
    this.model = model;
    this.oracle = oracle;
    final DecoratedDisclosurePanel disclosurePanel = new DecoratedDisclosurePanel(GuidedScoreCardConstants.INSTANCE.scoreCardTitle0(model.getName()));
    disclosurePanel.setWidth("100%");
    disclosurePanel.setTitle(GuidedScoreCardConstants.INSTANCE.scorecard());
    disclosurePanel.setOpen(true);
    final DecoratedDisclosurePanel configPanel = new DecoratedDisclosurePanel(GuidedScoreCardConstants.INSTANCE.setupParameters());
    configPanel.setWidth("95%");
    configPanel.setOpen(true);
    configPanel.add(getScorecardProperties());
    final DecoratedDisclosurePanel ruleAttributesPanel = new DecoratedDisclosurePanel(GuidedScoreCardConstants.INSTANCE.ruleAttributes());
    ruleAttributesPanel.setWidth("95%");
    ruleAttributesPanel.setOpen(false);
    ruleAttributesPanel.add(getRuleAttributesPanel());
    final DecoratedDisclosurePanel characteristicsPanel = new DecoratedDisclosurePanel(GuidedScoreCardConstants.INSTANCE.characteristics());
    characteristicsPanel.setOpen(model.getCharacteristics().size() > 0);
    characteristicsPanel.setWidth("95%");
    characteristicsPanel.add(getCharacteristics());
    final VerticalPanel config = new VerticalPanel();
    config.setWidth("100%");
    config.add(ruleAttributesPanel);
    config.add(configPanel);
    config.add(characteristicsPanel);
    disclosurePanel.add(config);
    container.setWidget(disclosurePanel);
    characteristicsAttrMap.clear();
    characteristicsAttrPanelMap.clear();
    for (final Characteristic characteristic : model.getCharacteristics()) {
        final FlexTable flexTable = addCharacteristic(characteristic);
        for (Attribute attribute : characteristic.getAttributes()) {
            addAttribute(flexTable, attribute);
        }
    }
}
Also used : VerticalPanel(com.google.gwt.user.client.ui.VerticalPanel) Attribute(org.drools.workbench.models.guided.scorecard.shared.Attribute) Characteristic(org.drools.workbench.models.guided.scorecard.shared.Characteristic) FlexTable(com.google.gwt.user.client.ui.FlexTable) DecoratedDisclosurePanel(org.uberfire.ext.widgets.common.client.common.DecoratedDisclosurePanel)

Aggregations

FlexTable (com.google.gwt.user.client.ui.FlexTable)1 VerticalPanel (com.google.gwt.user.client.ui.VerticalPanel)1 Attribute (org.drools.workbench.models.guided.scorecard.shared.Attribute)1 Characteristic (org.drools.workbench.models.guided.scorecard.shared.Characteristic)1 DecoratedDisclosurePanel (org.uberfire.ext.widgets.common.client.common.DecoratedDisclosurePanel)1