@Test public void testShowFactTypeSelector() throws Exception { fromCollectWidget.showFactTypeSelector(); verify(listBox).addItem("ArrayList", "ArrayList"); verify(listBox).addItem("HashSet", "HashSet"); }
@Override protected void showFactTypeSelector() { final FormStylePopup popup = new FormStylePopup(GuidedRuleEditorResources.CONSTANTS.NewFactPattern()); popup.setTitle(GuidedRuleEditorResources.CONSTANTS.NewFactPattern()); final ListBox box = GWT.create(ListBox.class); box.addItem(GuidedRuleEditorResources.CONSTANTS.Choose()); for (Map.Entry<String, String> entry : this.getExtraLeftSidePatternFactTypes().entrySet()) { box.addItem(entry.getKey(), entry.getValue()); } box.setSelectedIndex(0); box.addChangeHandler(new ChangeHandler() { public void onChange(ChangeEvent event) { pattern.setFactPattern(new FactPattern(box.getValue(box.getSelectedIndex()))); setModified(true); getModeller().refreshWidget(); popup.hide(); } }); popup.addAttribute(GuidedRuleEditorResources.CONSTANTS.chooseFactType(), box); popup.show(); }
FromCollectCompositeFactPatternWidget extends FromCompositeFactPatternWidget { @Override protected void showFactTypeSelector() { final FormStylePopup popup = new FormStylePopup(GuidedRuleEditorResources.CONSTANTS.NewFactPattern()); popup.setTitle(GuidedRuleEditorResources.CONSTANTS.NewFactPattern()); final ListBox box = GWT.create(ListBox.class); box.addItem(GuidedRuleEditorResources.CONSTANTS.Choose()); for (Map.Entry<String, String> entry : this.getExtraLeftSidePatternFactTypes().entrySet()) { box.addItem(entry.getKey(), entry.getValue()); } box.setSelectedIndex(0); box.addChangeHandler(new ChangeHandler() { public void onChange(ChangeEvent event) { pattern.setFactPattern(new FactPattern(box.getValue(box.getSelectedIndex()))); setModified(true); getModeller().refreshWidget(); popup.hide(); } }); popup.addAttribute(GuidedRuleEditorResources.CONSTANTS.chooseFactType(), box); popup.show(); } }
FromCollectCompositeFactPatternWidget extends FromCompositeFactPatternWidget { @Override protected void showFactTypeSelector() { final FormStylePopup popup = new FormStylePopup(GuidedRuleEditorResources.CONSTANTS.NewFactPattern()); popup.setTitle(GuidedRuleEditorResources.CONSTANTS.NewFactPattern()); final ListBox box = GWT.create(ListBox.class); box.addItem(GuidedRuleEditorResources.CONSTANTS.Choose()); for (Map.Entry<String, String> entry : this.getExtraLeftSidePatternFactTypes().entrySet()) { box.addItem(entry.getKey(), entry.getValue()); } box.setSelectedIndex(0); box.addChangeHandler(new ChangeHandler() { public void onChange(ChangeEvent event) { pattern.setFactPattern(new FactPattern(box.getValue(box.getSelectedIndex()))); setModified(true); getModeller().refreshWidget(); popup.hide(); } }); popup.addAttribute(GuidedRuleEditorResources.CONSTANTS.chooseFactType(), box); popup.show(); } FromCollectCompositeFactPatternWidget(RuleModeller modeller,
                                                 EventBus eventBus,
                                                 FromCollectCompositeFactPattern pattern);  FromCollectCompositeFactPatternWidget(RuleModeller modeller,
                                                 EventBus eventBus,
                                                 FromCollectCompositeFactPattern pattern,
                                                 Boolean readOnly); }
FromCollectCompositeFactPatternWidget extends FromCompositeFactPatternWidget { @Override protected void showFactTypeSelector() { final FormStylePopup popup = new FormStylePopup(GuidedRuleEditorResources.CONSTANTS.NewFactPattern()); popup.setTitle(GuidedRuleEditorResources.CONSTANTS.NewFactPattern()); final ListBox box = GWT.create(ListBox.class); box.addItem(GuidedRuleEditorResources.CONSTANTS.Choose()); for (Map.Entry<String, String> entry : this.getExtraLeftSidePatternFactTypes().entrySet()) { box.addItem(entry.getKey(), entry.getValue()); } box.setSelectedIndex(0); box.addChangeHandler(new ChangeHandler() { public void onChange(ChangeEvent event) { pattern.setFactPattern(new FactPattern(box.getValue(box.getSelectedIndex()))); setModified(true); getModeller().refreshWidget(); popup.hide(); } }); popup.addAttribute(GuidedRuleEditorResources.CONSTANTS.chooseFactType(), box); popup.show(); } FromCollectCompositeFactPatternWidget(RuleModeller modeller,
                                                 EventBus eventBus,
                                                 FromCollectCompositeFactPattern pattern);  FromCollectCompositeFactPatternWidget(RuleModeller modeller,
                                                 EventBus eventBus,
                                                 FromCollectCompositeFactPattern pattern,
                                                 Boolean readOnly);  }
FromCollectCompositeFactPatternWidget extends FromCompositeFactPatternWidget { @Override protected void showFactTypeSelector() { final FormStylePopup popup = new FormStylePopup(GuidedRuleEditorResources.CONSTANTS.NewFactPattern()); popup.setTitle(GuidedRuleEditorResources.CONSTANTS.NewFactPattern()); final ListBox box = GWT.create(ListBox.class); box.addItem(GuidedRuleEditorResources.CONSTANTS.Choose()); for (Map.Entry<String, String> entry : this.getExtraLeftSidePatternFactTypes().entrySet()) { box.addItem(entry.getKey(), entry.getValue()); } box.setSelectedIndex(0); box.addChangeHandler(new ChangeHandler() { public void onChange(ChangeEvent event) { pattern.setFactPattern(new FactPattern(box.getValue(box.getSelectedIndex()))); setModified(true); getModeller().refreshWidget(); popup.hide(); } }); popup.addAttribute(GuidedRuleEditorResources.CONSTANTS.chooseFactType(), box); popup.show(); } FromCollectCompositeFactPatternWidget(RuleModeller modeller,
                                                 EventBus eventBus,
                                                 FromCollectCompositeFactPattern pattern);  FromCollectCompositeFactPatternWidget(RuleModeller modeller,
                                                 EventBus eventBus,
                                                 FromCollectCompositeFactPattern pattern,
                                                 Boolean readOnly);   }