Package ch.ralscha.extdirectspring.bean

Examples of ch.ralscha.extdirectspring.bean.MetaData


  @ExtDirectMethod(value = ExtDirectMethodType.STORE_READ)
  public ExtDirectStoreResult<Row> methodMetadata(ExtDirectStoreReadRequest request) {
    ExtDirectStoreResult<Row> response = createExtDirectStoreResult(request, "");

    if (request.getStart() == null && request.getSort() == null) {
      MetaData metaData = new MetaData();

      metaData.setPagingParameter(0, 50);
      metaData.setSortInfo("name", SortDirection.ASCENDING);

      Field field = new Field("id");
      field.setType(DataType.INTEGER);
      field.addCustomProperty("header", "ID");
      field.addCustomProperty("width", 20);
      field.addCustomProperty("sortable", Boolean.TRUE);
      field.addCustomProperty("resizable", Boolean.TRUE);
      field.addCustomProperty("hideable", Boolean.FALSE);
      metaData.addField(field);

      field = new Field("name");
      field.setType(DataType.STRING);
      field.addCustomProperty("header", "Name");
      field.addCustomProperty("width", 70);
      field.addCustomProperty("sortable", Boolean.TRUE);
      field.addCustomProperty("resizable", Boolean.TRUE);
      field.addCustomProperty("hideable", Boolean.FALSE);
      metaData.addField(field);

      field = new Field("admin");
      field.setType(DataType.BOOLEAN);
      field.addCustomProperty("header", "Administrator");
      field.addCustomProperty("width", 30);
      field.addCustomProperty("sortable", Boolean.TRUE);
      field.addCustomProperty("resizable", Boolean.TRUE);
      field.addCustomProperty("hideable", Boolean.TRUE);
      metaData.addField(field);

      field = new Field("salary");
      field.setType(DataType.FLOAT);
      field.addCustomProperty("header", "Salary");
      field.addCustomProperty("width", 50);
      field.addCustomProperty("sortable", Boolean.FALSE);
      field.addCustomProperty("resizable", Boolean.TRUE);
      field.addCustomProperty("hideable", Boolean.TRUE);
      metaData.addField(field);

      response.setMetaData(metaData);
    }

    return response;
View Full Code Here

TOP

Related Classes of ch.ralscha.extdirectspring.bean.MetaData

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.