Package com.github.dandelion.datatables.core.exception

Examples of com.github.dandelion.datatables.core.exception.ExtensionLoadingException


      // Allways pretty prints the JSON
      try {
        JSONValue.writeJSONString(conf, writer);
      } catch (IOException e) {
        throw new ExtensionLoadingException("Unable to convert the configuration into JSON", e);
      }

      mainJsFile.appendToDataTablesExtraConf(writer.toString());
    }
  }
View Full Code Here


    List<Class<?>> customExtensionClassList = null;
   
    try {
      customExtensionClassList = ClassUtils.getSubClassesInPackage(packageName, AbstractExtension.class);
    } catch (ClassNotFoundException e) {
      throw new ExtensionLoadingException("Unable to load extensions", e);
    } catch (IOException e) {
      throw new ExtensionLoadingException("Unable to access the package '" + packageName + "'", e);
    }
   
    // Instanciate all found classes
    for (Class<?> clazz : customExtensionClassList) {

      try {
        retval.add((AbstractExtension) ClassUtils.getClass(clazz.getName()).newInstance());
      } catch (InstantiationException e) {
        throw new ExtensionLoadingException("Unable to instanciate the class " + clazz.getName(), e);
      } catch (IllegalAccessException e) {
        throw new ExtensionLoadingException("Unable to access the class " + clazz.getName(), e);
      } catch (ClassNotFoundException e) {
        throw new ExtensionLoadingException("Unable to load the class " + clazz.getName(), e);
      }
    }

    return retval;
  }
View Full Code Here

    String buttonId = TableConfig.FEATURE_FILTER_SELECTOR.valueFrom(table.getTableConfiguration());
    if (StringUtils.isBlank(buttonId)) {
      StringBuilder msg = new StringBuilder();
      msg.append("A filter button must be set in order to make the multi-filter work.");
      msg.append(" Please use the filterButton/dt:filterButton (JSP/Thymeleaf) table attribute.");
      throw new ExtensionLoadingException(msg.toString());
    }

    Set<String> columnWithoutName = new HashSet<String>();
    for (HtmlColumn headerColumn : table.getLastHeaderRow().getColumns()) {
      String name = ColumnConfig.NAME.valueFrom(headerColumn.getColumnConfiguration());
      if (StringUtils.isBlank(name)) {
        columnWithoutName.add(name);
      }
    }

    if (!columnWithoutName.isEmpty()) {
      StringBuilder msg = new StringBuilder();
      msg.append("All columns must have a name in order to make the multi-filter work.");
      msg.append(" Please use the name/dt:name (JSP/Thymeleaf) column attribute to assign a name to each column.");
      throw new ExtensionLoadingException(msg.toString());
    }
  }
View Full Code Here

    if (themeOption != null) {
      if(themeOption.equals(ThemeOption.TABLECLOTH)){
        addBundle(DatatableBundles.DDL_DT_THEME_BOOTSTRAP2_TABLECLOTH);
      }
      else{
        throw new ExtensionLoadingException("Only the 'tablecloth' theme option is compatible with the 'bootstrap2' theme");
      }
    }
   
    addParameter(DTConstants.DT_AS_STRIPE_CLASSES, new JavascriptSnippet("[]"));
  }
View Full Code Here

TOP

Related Classes of com.github.dandelion.datatables.core.exception.ExtensionLoadingException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.