[jboss-svn-commits] JBL Code SVN: r13280 - in labs/jbossrules/trunk/drools-eclipse/drools-eclipse-plugin/src/main: resources/org/drools/eclipse/editors and 1 other directory.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Mon Jul 9 19:55:19 EDT 2007


Author: pombredanne
Date: 2007-07-09 19:55:19 -0400 (Mon, 09 Jul 2007)
New Revision: 13280

Modified:
   labs/jbossrules/trunk/drools-eclipse/drools-eclipse-plugin/src/main/java/org/drools/eclipse/editors/completion/RuleCompletionProcessor.java
   labs/jbossrules/trunk/drools-eclipse/drools-eclipse-plugin/src/main/resources/org/drools/eclipse/editors/keywords.properties
Log:
JBRULES-989: adding support for dialect keyword (as dialect "java" and dialect "mvel" in rules header code completion while editing DRL files, and syntax highlighting for the dialect keyword

Modified: labs/jbossrules/trunk/drools-eclipse/drools-eclipse-plugin/src/main/java/org/drools/eclipse/editors/completion/RuleCompletionProcessor.java
===================================================================
--- labs/jbossrules/trunk/drools-eclipse/drools-eclipse-plugin/src/main/java/org/drools/eclipse/editors/completion/RuleCompletionProcessor.java	2007-07-09 23:27:20 UTC (rev 13279)
+++ labs/jbossrules/trunk/drools-eclipse/drools-eclipse-plugin/src/main/java/org/drools/eclipse/editors/completion/RuleCompletionProcessor.java	2007-07-09 23:55:19 UTC (rev 13280)
@@ -34,16 +34,16 @@
 import org.eclipse.swt.graphics.Image;
 
 /**
- * For handling within rules. 
- * 
+ * For handling within rules.
+ *
  * @author Michael Neale, Kris Verlanen
  */
 public class RuleCompletionProcessor extends DefaultCompletionProcessor {
 
-	private static final Image DROOLS_ICON = 
+	private static final Image DROOLS_ICON =
 		DroolsPluginImages.getImage(DroolsPluginImages.DROOLS);
 
-	private static final Image CLASS_ICON = 
+	private static final Image CLASS_ICON =
 		DroolsPluginImages.getImage(DroolsPluginImages.CLASS);
 
 	public RuleCompletionProcessor(AbstractRuleEditor editor) {
@@ -80,7 +80,7 @@
 		}
 		return null;
 	}
-	
+
 	protected void addRHSCompletionProposals(List list, String prefix, String backText,
 			String conditions, String consequence) {
 		// only add functions and keywords if at the beginning of a
@@ -289,7 +289,7 @@
 			String operator = (String) location
 					.getProperty(Location.LOCATION_PROPERTY_OPERATOR);
 			type = getPropertyClass(className, property);
-			
+
 			if ("in".equals(operator)) {
 				list.add(new RuleCompletionProposal(prefix.length(), "()",
 					"(  )", 2, DROOLS_ICON));
@@ -488,12 +488,12 @@
 					String simplePropertyName = nestedProperties[i];
 					currentClass = getSimplePropertyClass(currentClass, simplePropertyName);
 				}
-				return currentClass; 
+				return currentClass;
 			}
 		}
 		return null;
 	}
-	
+
 	private String getSimplePropertyClass(String className, String propertyName) {
 		if ("this".equals(propertyName)) {
 			return className;
@@ -546,7 +546,7 @@
 		}
 		return result;
 	}
-	
+
 	private boolean isComparable(String type) {
 		if (type == null) {
 			return false;
@@ -586,7 +586,7 @@
 	/**
 	 * Returns true if the first class is the same or a subtype of the second
 	 * class.
-	 * 
+	 *
 	 * @param class1
 	 * @param class2
 	 * @return
@@ -672,7 +672,7 @@
 		list.add(prop);
 	}
 
-	private void addRHSJavaCompletionProposals(List list, String prefix, String backText, 
+	private void addRHSJavaCompletionProposals(List list, String prefix, String backText,
 			String conditions, String consequence) {
 		list.addAll(getJavaCompletionProposals(consequence, prefix,
 				getRuleParameters(backText)));
@@ -754,7 +754,11 @@
 		list.add(new RuleCompletionProposal(prefix.length(), "ruleflow-group",
 				"ruleflow-group \"\"", 16, DROOLS_ICON));
         list.add(new RuleCompletionProposal(prefix.length(), "lock-on-active",
-                "lock-on-active ", DROOLS_ICON));        
+                "lock-on-active ", DROOLS_ICON));
+        list.add(new RuleCompletionProposal(prefix.length(), "dialect \"java\"",
+        		"dialect \"java\"", DROOLS_ICON));
+        list.add(new RuleCompletionProposal(prefix.length(), "dialect \"mvel\"",
+        		"dialect \"mvel\"", DROOLS_ICON));
 	}
 
 	private boolean addFactTemplatePropertyProposals(String prefix,

Modified: labs/jbossrules/trunk/drools-eclipse/drools-eclipse-plugin/src/main/resources/org/drools/eclipse/editors/keywords.properties
===================================================================
--- labs/jbossrules/trunk/drools-eclipse/drools-eclipse-plugin/src/main/resources/org/drools/eclipse/editors/keywords.properties	2007-07-09 23:27:20 UTC (rev 13279)
+++ labs/jbossrules/trunk/drools-eclipse/drools-eclipse-plugin/src/main/resources/org/drools/eclipse/editors/keywords.properties	2007-07-09 23:55:19 UTC (rev 13280)
@@ -35,4 +35,5 @@
 date-effective
 date-expires
 enabled
-forall
\ No newline at end of file
+forall
+dialect
\ No newline at end of file




More information about the jboss-svn-commits mailing list