Search in sources :

Example 1 with WizardPage

use of org.uberfire.ext.widgets.core.client.wizards.WizardPage in project kie-wb-common by kiegroup.

the class ExamplesWizard method getPageWidget.

@Override
public Widget getPageWidget(final int pageNumber) {
    WizardPage page = pages.get(pageNumber);
    page.prepareView();
    return page.asWidget();
}
Also used : WizardPage(org.uberfire.ext.widgets.core.client.wizards.WizardPage) ExamplesWizardPage(org.kie.workbench.common.screens.examples.client.wizard.pages.ExamplesWizardPage)

Example 2 with WizardPage

use of org.uberfire.ext.widgets.core.client.wizards.WizardPage in project kie-wb-common by kiegroup.

the class AbstractMultiPageWizard method getPageWidget.

@Override
public Widget getPageWidget(final int pageNumber) {
    WizardPage page = pages.get(pageNumber);
    page.prepareView();
    return page.asWidget();
}
Also used : WizardPage(org.uberfire.ext.widgets.core.client.wizards.WizardPage)

Example 3 with WizardPage

use of org.uberfire.ext.widgets.core.client.wizards.WizardPage in project drools-wb by kiegroup.

the class NewGuidedDecisionTableWizard method setContent.

public void setContent(final Path contextPath, final String baseFileName, final GuidedDecisionTable52.TableFormat tableFormat, final GuidedDecisionTable52.HitPolicy hitPolicy, final AsyncPackageDataModelOracle oracle, final GuidedDecisionTableWizardHandler handler) {
    this.model = new GuidedDecisionTable52();
    this.model.setTableFormat(tableFormat);
    this.model.setHitPolicy(hitPolicy);
    if (GuidedDecisionTable52.HitPolicy.RESOLVED_HIT.equals(hitPolicy)) {
        final MetadataCol52 metadataCol52 = new MetadataCol52();
        metadataCol52.setMetadata(GuidedDecisionTable52.HitPolicy.RESOLVED_HIT_METADATA_NAME);
        this.model.getMetadataCols().add(metadataCol52);
    }
    this.contextPath = contextPath;
    this.oracle = oracle;
    this.handler = handler;
    final Validator validator = new Validator(model.getConditions());
    for (WizardPage page : pages) {
        final AbstractGuidedDecisionTableWizardPage dtp = (AbstractGuidedDecisionTableWizardPage) page;
        dtp.setContent(contextPath, baseFileName, tableFormat, hitPolicy, oracle, model, validator);
        dtp.initialise();
    }
}
Also used : MetadataCol52(org.drools.workbench.models.guided.dtable.shared.model.MetadataCol52) GuidedDecisionTable52(org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52) AbstractGuidedDecisionTableWizardPage(org.drools.workbench.screens.guided.dtable.client.wizard.table.pages.AbstractGuidedDecisionTableWizardPage) WizardPage(org.uberfire.ext.widgets.core.client.wizards.WizardPage) AbstractGuidedDecisionTableWizardPage(org.drools.workbench.screens.guided.dtable.client.wizard.table.pages.AbstractGuidedDecisionTableWizardPage) Validator(org.drools.workbench.screens.guided.dtable.client.widget.Validator)

Example 4 with WizardPage

use of org.uberfire.ext.widgets.core.client.wizards.WizardPage in project drools-wb by kiegroup.

the class NewGuidedDecisionTableWizard method complete.

@Override
public void complete() {
    // Ensure each page updates the decision table as necessary
    for (WizardPage page : this.pages) {
        AbstractGuidedDecisionTableWizardPage gep = (AbstractGuidedDecisionTableWizardPage) page;
        gep.makeResult(model);
    }
    // Expand rows
    final RowExpander re = new RowExpander(model, oracle);
    // Mark columns on which we are to expand (default is to include all)
    for (BaseColumn c : model.getExpandedColumns()) {
        re.setExpandColumn(c, false);
    }
    final List<ConditionCol52> columns = columnExpansionPage.getColumnsToExpand();
    for (ConditionCol52 c : columns) {
        re.setExpandColumn(c, true);
    }
    // Slurp out expanded rows and construct decision table data
    int rowIndex = 0;
    final RowExpander.RowIterator ri = re.iterator();
    while (ri.hasNext()) {
        List<DTCellValue52> row = ri.next();
        model.getData().add(row);
        model.getData().get(rowIndex).get(0).setNumericValue(new BigDecimal(rowIndex + 1));
        rowIndex++;
    }
    // Save it!
    final String baseFileName = summaryPage.getBaseFileName();
    final Path contextPath = this.contextPath;
    model.setTableName(baseFileName);
    super.complete();
    handler.save(contextPath, baseFileName, model);
}
Also used : Path(org.uberfire.backend.vfs.Path) DTCellValue52(org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52) BigDecimal(java.math.BigDecimal) RowExpander(org.drools.workbench.screens.guided.dtable.client.wizard.table.pages.RowExpander) ConditionCol52(org.drools.workbench.models.guided.dtable.shared.model.ConditionCol52) AbstractGuidedDecisionTableWizardPage(org.drools.workbench.screens.guided.dtable.client.wizard.table.pages.AbstractGuidedDecisionTableWizardPage) WizardPage(org.uberfire.ext.widgets.core.client.wizards.WizardPage) AbstractGuidedDecisionTableWizardPage(org.drools.workbench.screens.guided.dtable.client.wizard.table.pages.AbstractGuidedDecisionTableWizardPage) BaseColumn(org.drools.workbench.models.guided.dtable.shared.model.BaseColumn)

Example 5 with WizardPage

use of org.uberfire.ext.widgets.core.client.wizards.WizardPage in project drools-wb by kiegroup.

the class NewGuidedDecisionTableColumnWizard method getPageWidget.

@Override
public Widget getPageWidget(final int pageNumber) {
    final WizardPage wizardPage = this.pages.get(pageNumber);
    final Widget widget = wizardPage.asWidget();
    wizardPage.prepareView();
    return widget;
}
Also used : WizardPage(org.uberfire.ext.widgets.core.client.wizards.WizardPage) Widget(com.google.gwt.user.client.ui.Widget)

Aggregations

WizardPage (org.uberfire.ext.widgets.core.client.wizards.WizardPage)9 BaseDecisionTableColumnPage (org.drools.workbench.screens.guided.dtable.client.wizard.column.pages.common.BaseDecisionTableColumnPage)2 AbstractGuidedDecisionTableWizardPage (org.drools.workbench.screens.guided.dtable.client.wizard.table.pages.AbstractGuidedDecisionTableWizardPage)2 ExamplesWizardPage (org.kie.workbench.common.screens.examples.client.wizard.pages.ExamplesWizardPage)2 Widget (com.google.gwt.user.client.ui.Widget)1 BigDecimal (java.math.BigDecimal)1 BaseColumn (org.drools.workbench.models.guided.dtable.shared.model.BaseColumn)1 ConditionCol52 (org.drools.workbench.models.guided.dtable.shared.model.ConditionCol52)1 DTCellValue52 (org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52)1 GuidedDecisionTable52 (org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52)1 MetadataCol52 (org.drools.workbench.models.guided.dtable.shared.model.MetadataCol52)1 Validator (org.drools.workbench.screens.guided.dtable.client.widget.Validator)1 RowExpander (org.drools.workbench.screens.guided.dtable.client.wizard.table.pages.RowExpander)1 RemoteCallback (org.jboss.errai.common.client.api.RemoteCallback)1 ExampleRepository (org.kie.workbench.common.screens.examples.model.ExampleRepository)1 ExamplesMetaData (org.kie.workbench.common.screens.examples.model.ExamplesMetaData)1 Path (org.uberfire.backend.vfs.Path)1