示例#1
0
 public void setDefaultValues() {
   for (MetaTab t : MetaTabsDefaultValues.getMetaTabsForModel(getMetaComponent().getName())) {
     if (t.getMetaFilter() != null && getMetaFilter() == null) setMetaFilter(t.getMetaFilter());
     if (t.getMetaRowStyles() != null && getMetaRowStyles() == null)
       setMetaRowStyles(t.getMetaRowStyles());
     if (t.properties != null && properties == null) properties = t.properties;
     if (!Is.emptyString(t.getBaseCondition()) && Is.emptyString(getBaseCondition()))
       setBaseCondition(t.getBaseCondition());
     if (!Is.emptyString(t.getDefaultOrder()) & Is.emptyString(getDefaultOrder()))
       setDefaultOrder(t.getDefaultOrder());
   }
 }
示例#2
0
 private List obtainPropertiesNamesUsedToCalculate() throws XavaException {
   Set result = new HashSet();
   Iterator itProperties = getMetaPropertiesCalculated().iterator();
   while (itProperties.hasNext()) {
     MetaProperty metaProperty = (MetaProperty) itProperties.next();
     if (!metaProperty.hasCalculator()) continue;
     MetaSetsContainer metaCalculator = metaProperty.getMetaCalculator();
     if (!metaCalculator.containsMetaSets()) continue;
     Iterator itSets = metaCalculator.getMetaSets().iterator();
     while (itSets.hasNext()) {
       MetaSet set = (MetaSet) itSets.next();
       String propertyNameFrom = set.getPropertyNameFrom();
       if (!Is.emptyString(propertyNameFrom)) {
         String qualifiedName = metaProperty.getQualifiedName();
         int idx = qualifiedName.indexOf('.');
         String ref = idx < 0 ? "" : qualifiedName.substring(0, idx + 1);
         String qualifiedPropertyNameFrom = ref + propertyNameFrom;
         if (!getPropertiesNames().contains(qualifiedPropertyNameFrom)) {
           result.add(qualifiedPropertyNameFrom);
         }
       }
     }
   }
   return new ArrayList(result);
 }
示例#3
0
 public static String getTitleI18n(Locale locale, String modelName, String tabName)
     throws XavaException {
   String id = null;
   if (Is.emptyString(tabName)) {
     id = modelName + ".tab.title";
   } else {
     id = modelName + ".tabs." + tabName + ".title";
   }
   if (Labels.existsExact(id, locale)) {
     return Labels.get(id, locale);
   } else {
     return null;
   }
 }
示例#4
0
 public boolean hasDefaultOrder() {
   return !Is.emptyString(this.defaultOrder);
 }
示例#5
0
 public boolean hasBaseCondition() {
   return !Is.emptyString(this.baseCondition);
 }