Search in sources :

Example 51 with MetadataCol52

use of org.drools.workbench.models.guided.dtable.shared.model.MetadataCol52 in project drools-wb by kiegroup.

the class GuidedDecisionTablePresenterAttributesAndMetadataTest method updateMetadataColumn.

@Test
public void updateMetadataColumn() throws VetoException {
    final MetadataCol52 column = new MetadataCol52();
    column.setMetadata("metadata");
    dtPresenter.appendColumn(column);
    reset(modellerPresenter);
    final MetadataCol52 update = new MetadataCol52();
    column.setMetadata("update");
    dtPresenter.updateColumn(column, update);
    verify(synchronizer, times(1)).updateColumn(eq(column), eq(update));
    verify(modellerPresenter, times(1)).updateLinks();
}
Also used : MetadataCol52(org.drools.workbench.models.guided.dtable.shared.model.MetadataCol52) Test(org.junit.Test)

Example 52 with MetadataCol52

use of org.drools.workbench.models.guided.dtable.shared.model.MetadataCol52 in project drools-wb by kiegroup.

the class GuidedDecisionTablePresenterAttributesAndMetadataTest method deleteMetadataColumn.

@Test
public void deleteMetadataColumn() throws VetoException {
    final MetadataCol52 column = new MetadataCol52();
    column.setMetadata("metadata");
    dtPresenter.appendColumn(column);
    reset(modellerPresenter);
    dtPresenter.deleteColumn(column);
    verify(synchronizer, times(1)).deleteColumn(eq(column));
    verify(modellerPresenter, times(1)).updateLinks();
}
Also used : MetadataCol52(org.drools.workbench.models.guided.dtable.shared.model.MetadataCol52) Test(org.junit.Test)

Example 53 with MetadataCol52

use of org.drools.workbench.models.guided.dtable.shared.model.MetadataCol52 in project drools-wb by kiegroup.

the class CellContextMenuTest method testOnDecisionTableSelectedEventWithSelections.

@Test
public void testOnDecisionTableSelectedEventWithSelections() {
    model.getMetadataCols().add(new MetadataCol52());
    model.getData().add(new ArrayList<DTCellValue52>() {

        {
            add(new DTCellValue52(1));
            add(new DTCellValue52("descr"));
            add(new DTCellValue52("md"));
        }
    });
    uiModel.selectCell(0, 2);
    menu.onDecisionTableSelectedEvent(new DecisionTableSelectedEvent(dtPresenter));
    verify(view, times(1)).enableCutMenuItem(eq(true));
    verify(view, times(1)).enableCopyMenuItem(eq(true));
    verify(view, times(1)).enablePasteMenuItem(eq(false));
    verify(view, times(1)).enableDeleteCellMenuItem(eq(true));
}
Also used : MetadataCol52(org.drools.workbench.models.guided.dtable.shared.model.MetadataCol52) DTCellValue52(org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52) DecisionTableSelectedEvent(org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.DecisionTableSelectedEvent) Test(org.junit.Test)

Example 54 with MetadataCol52

use of org.drools.workbench.models.guided.dtable.shared.model.MetadataCol52 in project drools-wb by kiegroup.

the class CellContextMenuTest method testOnDecisionTableSelectionsChangedEventWithSelections.

@Test
public void testOnDecisionTableSelectionsChangedEventWithSelections() {
    model.getMetadataCols().add(new MetadataCol52());
    model.getData().add(new ArrayList<DTCellValue52>() {

        {
            add(new DTCellValue52(1));
            add(new DTCellValue52("descr"));
            add(new DTCellValue52("md"));
        }
    });
    uiModel.selectCell(0, 2);
    menu.onDecisionTableSelectionsChangedEvent(new DecisionTableSelectionsChangedEvent(dtPresenter));
    verify(view, times(1)).enableCutMenuItem(eq(true));
    verify(view, times(1)).enableCopyMenuItem(eq(true));
    verify(view, times(1)).enablePasteMenuItem(eq(false));
    verify(view, times(1)).enableDeleteCellMenuItem(eq(true));
}
Also used : MetadataCol52(org.drools.workbench.models.guided.dtable.shared.model.MetadataCol52) DecisionTableSelectionsChangedEvent(org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.DecisionTableSelectionsChangedEvent) DTCellValue52(org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52) Test(org.junit.Test)

Example 55 with MetadataCol52

use of org.drools.workbench.models.guided.dtable.shared.model.MetadataCol52 in project drools-wb by kiegroup.

the class CellContextMenuTest method testOnDecisionTableSelectedEventWithSelectionsWithClipboardPopulated.

@Test
public void testOnDecisionTableSelectedEventWithSelectionsWithClipboardPopulated() {
    model.getMetadataCols().add(new MetadataCol52());
    model.getData().add(new ArrayList<DTCellValue52>() {

        {
            add(new DTCellValue52(1));
            add(new DTCellValue52("descr"));
            add(new DTCellValue52("md"));
        }
    });
    uiModel.selectCell(0, 2);
    clipboard.setData(new HashSet<Clipboard.ClipboardData>() {

        {
            add(new DefaultClipboard.ClipboardDataImpl(0, 2, model.getData().get(0).get(2)));
        }
    });
    menu.onDecisionTableSelectedEvent(new DecisionTableSelectedEvent(dtPresenter));
    verify(view, times(1)).enableCutMenuItem(eq(true));
    verify(view, times(1)).enableCopyMenuItem(eq(true));
    verify(view, times(1)).enablePasteMenuItem(eq(true));
    verify(view, times(1)).enableDeleteCellMenuItem(eq(true));
}
Also used : MetadataCol52(org.drools.workbench.models.guided.dtable.shared.model.MetadataCol52) DTCellValue52(org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52) DecisionTableSelectedEvent(org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.DecisionTableSelectedEvent) Test(org.junit.Test)

Aggregations

MetadataCol52 (org.drools.workbench.models.guided.dtable.shared.model.MetadataCol52)67 Test (org.junit.Test)52 DTCellValue52 (org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52)18 BaseColumn (org.drools.workbench.models.guided.dtable.shared.model.BaseColumn)12 ArrayList (java.util.ArrayList)11 ConditionCol52 (org.drools.workbench.models.guided.dtable.shared.model.ConditionCol52)10 GuidedDecisionTable52 (org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52)10 DescriptionCol52 (org.drools.workbench.models.guided.dtable.shared.model.DescriptionCol52)9 RowNumberCol52 (org.drools.workbench.models.guided.dtable.shared.model.RowNumberCol52)9 AttributeCol52 (org.drools.workbench.models.guided.dtable.shared.model.AttributeCol52)8 DecisionTableSelectionsChangedEvent (org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.DecisionTableSelectionsChangedEvent)8 DecisionTableSelectedEvent (org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.DecisionTableSelectedEvent)7 ActionCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionCol52)6 Pattern52 (org.drools.workbench.models.guided.dtable.shared.model.Pattern52)6 RuleModel (org.drools.workbench.models.datamodel.rule.RuleModel)5 GuidedDecisionTableView (org.drools.workbench.screens.guided.dtable.client.widget.table.GuidedDecisionTableView)5 GuidedDTTemplateDataProvider (org.drools.workbench.models.guided.dtable.backend.util.GuidedDTTemplateDataProvider)4 TemplateDataProvider (org.drools.workbench.models.guided.dtable.backend.util.TemplateDataProvider)4 BaseColumnFieldDiff (org.drools.workbench.models.guided.dtable.shared.model.BaseColumnFieldDiff)4 CompositeColumn (org.drools.workbench.models.guided.dtable.shared.model.CompositeColumn)4