Implement initial functionality of showWindowInClassicMode() method
authorAntonio Moreno <antonio.moreno@openbravo.com>
Wed, 26 Jan 2011 12:51:16 +0100
changeset 10141 27b5cc218e46
parent 10140 7eb5aee711a2
child 10142 db63f6c4a29b
Implement initial functionality of showWindowInClassicMode() method
modules/org.openbravo.client.application/src/org/openbravo/client/application/ApplicationUtils.java
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/ApplicationUtils.java	Wed Jan 26 12:48:40 2011 +0100
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/ApplicationUtils.java	Wed Jan 26 12:51:16 2011 +0100
@@ -31,6 +31,7 @@
 import org.openbravo.model.ad.access.User;
 import org.openbravo.model.ad.access.UserRoles;
 import org.openbravo.model.ad.ui.Field;
+import org.openbravo.model.ad.ui.Tab;
 import org.openbravo.model.ad.ui.Window;
 
 /**
@@ -43,7 +44,20 @@
   private static Logger log = Logger.getLogger(ApplicationUtils.class);
 
   static boolean showWindowInClassicMode(Window window) {
-    // TODO: implement me
+    for (Tab tab : window.getADTabList()) {
+      if (tab.getSQLWhereClause() != null && tab.getHqlwhereclause() == null) {
+        // There is a tab with a SQL whereclause, but without a defined HQL whereclause
+        return true;
+      }
+      if (tab.getSQLOrderByClause() != null && tab.getHqlorderbyclause() == null) {
+        // There is a tab with a SQL order by clause, but without a defined HQL order by clause
+        return true;
+      }
+      if (tab.getFilterClause() != null && tab.getHqlfilterclause() == null) {
+        // There is a tab with a SQL filter clause, but without a defined HQL filter clause
+        return true;
+      }
+    }
     return false;
   }