[jboss-svn-commits] JBL Code SVN: r19340 - labs/jbossrules/branches/mic_20080325/drools-jbrms/src/main/java/org/drools/brms/client/qa.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Mon Mar 31 08:46:07 EDT 2008


Author: michael.neale at jboss.com
Date: 2008-03-31 08:46:07 -0400 (Mon, 31 Mar 2008)
New Revision: 19340

Modified:
   labs/jbossrules/branches/mic_20080325/drools-jbrms/src/main/java/org/drools/brms/client/qa/ScenarioWidget.java
Log:
adding ability to check for existence of any fact in WM

Modified: labs/jbossrules/branches/mic_20080325/drools-jbrms/src/main/java/org/drools/brms/client/qa/ScenarioWidget.java
===================================================================
--- labs/jbossrules/branches/mic_20080325/drools-jbrms/src/main/java/org/drools/brms/client/qa/ScenarioWidget.java	2008-03-31 12:43:56 UTC (rev 19339)
+++ labs/jbossrules/branches/mic_20080325/drools-jbrms/src/main/java/org/drools/brms/client/qa/ScenarioWidget.java	2008-03-31 12:46:07 UTC (rev 19340)
@@ -380,11 +380,37 @@
 					}
 				});
 
+
+
 				HorizontalPanel h = new HorizontalPanel();
 				h.add(facts);
 				h.add(ok);
 				pop.addAttribute("Fact value:", h);
 
+				//add in list box for anon facts
+				final ListBox factTypes = new ListBox();
+				for (int i = 0; i < sce.factTypes.length; i++) {
+					String ft = sce.factTypes[i];
+					factTypes.addItem(ft);
+				}
+
+				ok = new Button("Add");
+				ok.addClickListener(new ClickListener() {
+					public void onClick(Widget w) {
+						String t = factTypes.getItemText(factTypes.getSelectedIndex());
+						sc.insertAfter(ex, new VerifyFact(t, new ArrayList(), true));
+						renderEditor();
+						pop.hide();
+					}
+
+				});
+
+				h = new HorizontalPanel();
+				h.add(factTypes);
+				h.add(ok);
+				pop.addAttribute("Any fact that matches:", h);
+
+
 				pop.show();
 			}
 		});
@@ -1020,8 +1046,13 @@
         outer.setStyleName("modeller-fact-pattern-Widget");
         this.sce = sce;
         HorizontalPanel ab = new HorizontalPanel();
-        type = (String) sc.getVariableTypes().get(vf.name);
-        ab.add(new SmallLabel(type + " [" + vf.name + "] has values:"));
+        if (!vf.anonymous) {
+	        type = (String) sc.getVariableTypes().get(vf.name);
+	        ab.add(new SmallLabel(type + " [" + vf.name + "] has values:"));
+        } else {
+        	type = vf.name;
+        	ab.add(new SmallLabel("A fact of type [" + vf.name + "] has values:"));
+        }
         this.showResults = showResults;
 
         Image add = new ImageButton("images/add_field_to_fact.gif", "Add a field to this expectation.", new ClickListener() {




More information about the jboss-svn-commits mailing list