Package org.richfaces.model

Examples of org.richfaces.model.Modifiable


    }
    sortFields.addAll(sortFieldsMap.values());
    ExtendedDataModel dataModel = super.createDataModel();
    if ((filterFields != null && !filterFields.isEmpty())
        || (sortFields != null && !sortFields.isEmpty())) {
      Modifiable modifiable = null;
      if (dataModel instanceof Modifiable) {
        modifiable = (Modifiable) dataModel;
      } else {
        ModifiableModel modifiableModel = new ModifiableModel(dataModel, getVar());
        dataModel = modifiableModel;
        modifiable = modifiableModel;
      }
     
      if (dataModel instanceof LocaleAware) {
        FacesContext facesContext = getFacesContext();
        if (ContextInitParameters.isDatatableUsesViewLocale(facesContext)) {
          UIViewRoot viewRoot = facesContext.getViewRoot();
          ((LocaleAware) dataModel).setLocale(viewRoot.getLocale());
        }
      }
     
      modifiable.modify(filterFields, sortFields);
    }
    return dataModel;
  }
View Full Code Here


        model = new DataModelCache((ScrollableTableDataModel<?>) model);
      }
    } else {
      List<SortField2> sortFields = getSortFields();
      if (sortFields != null && !sortFields.isEmpty()) {
        Modifiable modifiable = null;
        if (model instanceof Modifiable) {
          modifiable = (Modifiable) model;
        } else {
          ModifiableModel modifiableModel = new ModifiableModel(
              model, getVar());
          model = modifiableModel;
          modifiable = modifiableModel;
        }
        modifiable.modify(null, sortFields);
      }
    }
    /*
     * TODO: Verify - do we really need it
      model.setSortOrder(getSortOrder());
View Full Code Here

    }
    sortFields.addAll(sortFieldsMap.values());
    ExtendedDataModel dataModel = super.createDataModel();
    if ((filterFields != null && !filterFields.isEmpty())
        || (sortFields != null && !sortFields.isEmpty())) {
      Modifiable modifiable = null;
      if (dataModel instanceof Modifiable) {
        modifiable = (Modifiable) dataModel;
      } else {
        ModifiableModel modifiableModel = new ModifiableModel(dataModel, getVar());
        dataModel = modifiableModel;
        modifiable = modifiableModel;
      }
      modifiable.modify(filterFields, sortFields);
    }
    return dataModel;
  }
View Full Code Here

        model = new DataModelCache((ScrollableTableDataModel<?>) model);
      }
    } else {
      List<SortField2> sortFields = getSortFields();
      if (sortFields != null && !sortFields.isEmpty()) {
        Modifiable modifiable = null;
        if (model instanceof Modifiable) {
          modifiable = (Modifiable) model;
        } else {
          ModifiableModel modifiableModel = new ModifiableModel(
              model, getVar());
          model = modifiableModel;
          modifiable = modifiableModel;
        }
        modifiable.modify(null, sortFields);
      }
    }
    /*
     * TODO: Verify - do we really need it
      model.setSortOrder(getSortOrder());
View Full Code Here

    if (dataModel instanceof ExtendedTableDataModifiableModel<?>) {
      ((ExtendedTableDataModifiableModel<?>) dataModel).setVar(getVar());
    }
    if ((filterFields != null && !filterFields.isEmpty())
        || (sortFields != null && !sortFields.isEmpty())) {
      Modifiable modifiable = null;
      if (dataModel instanceof Modifiable) {
        modifiable = (Modifiable) dataModel;
      } else if (dataModel instanceof ExtendedTableDataModel<?>) {
        ExtendedTableDataModel<?> tableDataModel = (ExtendedTableDataModel<?>) dataModel;
        //ExtendedTableDataModifiableModelOld<?> modifiableModel = new ExtendedTableDataModifiableModelOld(tableDataModel, getVar());
        ExtendedTableDataModifiableModel<?> modifiableModel = new ExtendedTableDataModifiableModel(tableDataModel, getVar());
        dataModel = modifiableModel;
        modifiable = modifiableModel;
      }
      else {
        ModifiableModel modifiableModel = new ModifiableModel(dataModel, getVar());
        dataModel = modifiableModel;
        modifiable = modifiableModel; 
      }
     
      if (dataModel instanceof LocaleAware) {
        FacesContext facesContext = getFacesContext();
        if (ContextInitParameters.isDatatableUsesViewLocale(facesContext)) {
          UIViewRoot viewRoot = facesContext.getViewRoot();
          ((LocaleAware) dataModel).setLocale(viewRoot.getLocale());
        }
      }
     
      modifiable.modify(filterFields, sortFields);
    }
    return dataModel;
  }
View Full Code Here

    if (dataModel instanceof ExtendedTableDataModifiableModel<?>) {
      ((ExtendedTableDataModifiableModel<?>) dataModel).setVar(getVar());
    }
    if ((filterFields != null && !filterFields.isEmpty())
        || (sortFields != null && !sortFields.isEmpty())) {
      Modifiable modifiable = null;
      if (dataModel instanceof Modifiable) {
        modifiable = (Modifiable) dataModel;
      } else if (dataModel instanceof ExtendedTableDataModel<?>) {
        ExtendedTableDataModel<?> tableDataModel = (ExtendedTableDataModel<?>) dataModel;
        //ExtendedTableDataModifiableModelOld<?> modifiableModel = new ExtendedTableDataModifiableModelOld(tableDataModel, getVar());
        ExtendedTableDataModifiableModel<?> modifiableModel = new ExtendedTableDataModifiableModel(tableDataModel, getVar());
        dataModel = modifiableModel;
        modifiable = modifiableModel;
      }
      else {
        ModifiableModel modifiableModel = new ModifiableModel(dataModel, getVar());
        dataModel = modifiableModel;
        modifiable = modifiableModel; 
      }
     
      if (dataModel instanceof LocaleAware) {
        FacesContext facesContext = getFacesContext();
        if (ContextInitParameters.isDatatableUsesViewLocale(facesContext)) {
          UIViewRoot viewRoot = facesContext.getViewRoot();
          ((LocaleAware) dataModel).setLocale(viewRoot.getLocale());
        }
      }
     
      modifiable.modify(filterFields, sortFields);
    }
    return dataModel;
  }
View Full Code Here

        model = new DataModelCache((ScrollableTableDataModel<?>) model);
      }
    } else {
      List<SortField2> sortFields = getSortFields();
      if (sortFields != null && !sortFields.isEmpty()) {
        Modifiable modifiable = null;
        if (model instanceof Modifiable) {
          modifiable = (Modifiable) model;
        } else {
          ModifiableModel modifiableModel = new ModifiableModel(
              model, getVar());
          model = modifiableModel;
          modifiable = modifiableModel;
        }
        modifiable.modify(null, sortFields);
      }
    }
    /*
     * TODO: Verify - do we really need it
      model.setSortOrder(getSortOrder());
View Full Code Here

        }
      }
    }
    sortFields.addAll(sortFieldsMap.values());
    ExtendedDataModel dataModel = super.createDataModel();
    Modifiable modifiable = null;
    if (dataModel instanceof Modifiable) {
      modifiable = (Modifiable) dataModel;
    } else if (!filterFields.isEmpty() || !sortFields.isEmpty()) {
      ModifiableModel modifiableModel = new ModifiableModel(dataModel, getVar());
      dataModel = modifiableModel;
      modifiable = modifiableModel;
    }
   
    if (dataModel instanceof LocaleAware) {
      FacesContext facesContext = getFacesContext();
      if (ContextInitParameters.isDatatableUsesViewLocale(facesContext)) {
        UIViewRoot viewRoot = facesContext.getViewRoot();
        ((LocaleAware) dataModel).setLocale(viewRoot.getLocale());
      }
    }
   
    if (modifiable != null) {
      modifiable.modify(filterFields, sortFields);
    }
    return dataModel;
  }
View Full Code Here

    }
    sortFields.addAll(sortFieldsMap.values());
    ExtendedDataModel dataModel = super.createDataModel();
    if ((filterFields != null && !filterFields.isEmpty())
        || (sortFields != null && !sortFields.isEmpty())) {
      Modifiable modifiable = null;
      if (dataModel instanceof Modifiable) {
        modifiable = (Modifiable) dataModel;
      } else {
        ModifiableModel modifiableModel = new ModifiableModel(dataModel, getVar());
        dataModel = modifiableModel;
        modifiable = modifiableModel;
      }
     
      if (dataModel instanceof LocaleAware) {
        FacesContext facesContext = getFacesContext();
        if (ContextInitParameters.isDatatableUsesViewLocale(facesContext)) {
          UIViewRoot viewRoot = facesContext.getViewRoot();
          ((LocaleAware) dataModel).setLocale(viewRoot.getLocale());
        }
      }
     
      modifiable.modify(filterFields, sortFields);
    }
    return dataModel;
  }
View Full Code Here

TOP

Related Classes of org.richfaces.model.Modifiable

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.