Пример #1
0
 public FilterComponentFactory getFilterComponentFactory() {
   if (filterComponentFactory == null) {
     // Is the default configuration known for this type?
     if (columnType != null
         && FilterDatatypeConfig.DEFAULT_CONFIGURATION.containsKey(columnType)) {
       return FilterDatatypeConfig.DEFAULT_CONFIGURATION.get(columnType);
     } else if (columnModel.getMaster().getFilterModel().isWysiwyg()) {
       return FilterDatatypeConfig.DEFAULT_CONFIGURATION.get(String.class);
     } else {
       throw new UnsupportedOperationException(
           "Unknown datatype was used in listbox filter for column '"
               + column
               + "'. For type "
               + (columnType == null ? "unknown" : columnType.getCanonicalName())
               + " have to be defined special filter component.");
     }
   } else {
     return filterComponentFactory;
   }
 }
Пример #2
0
 public List<DLFilterOperator> getFilterOperators() {
   if (filterOperators == null) { // No
     LOGGER.debug(
         "Get operators for type: '{}'.",
         (getColumnType() == null ? "null" : getColumnType().getCanonicalName()));
     if (columnType == null && column == null) { // empty model
       filterOperators = Collections.emptyList();
     } else if (columnType == null) { // Is this type defined? know name but known type
       filterOperators = Collections.singletonList(DLFilterOperator.EQUAL);
     } else if (FilterDatatypeConfig.DEFAULT_CONFIGURATION.containsKey(
         columnType)) { // Is the default configuration known for this type?
       filterOperators = FilterDatatypeConfig.DEFAULT_CONFIGURATION.get(columnType).getOperators();
     } else if (columnModel.getMaster().getFilterModel().isWysiwyg()) {
       return FilterDatatypeConfig.DEFAULT_CONFIGURATION.get(String.class).getOperators();
     } else {
       throw new UnsupportedOperationException(
           "Unknown datatype was used in listbox filter. For type "
               + columnType.getCanonicalName()
               + " have to be defined special filter component.");
     }
     LOGGER.debug("Operator list: '{}'.", filterOperators.size());
   }
   return filterOperators;
 }