Package com.daikit.commons.shared.bean

Examples of com.daikit.commons.shared.bean.AbstractDkModifiableBeanWithId


    {
      final AbstractEditedBeanAwareEditor ancestor = stack.get(i);
      ancestor.setDirty(true);
      if (updateModel && ancestor.getEditedModel() instanceof AbstractDkModifiableBeanWithId)
      {
        final AbstractDkModifiableBeanWithId data = (AbstractDkModifiableBeanWithId) ancestor.getEditedModel();
        data.setDirty(true);
        if (i == stack.size() - 1)
        {
          // update status in bean
          data.getDirtyPaths().add(getLastAttributePath(contextDelegatePath));
        }
        else
        {
          final AbstractEditedBeanAwareEditor childAncestor = stack.get(i + 1);
          data.getDirtyPaths().add(getLastAttributePath(childAncestor.getDelegate().getPath()));
        }
      }
    }
  }
View Full Code Here


      if (!record.getChanges().isEmpty())
      {
        final Object model = record.getModel();
        if (model instanceof AbstractDkModifiableBeanWithId)
        {
          final AbstractDkModifiableBeanWithId modifiableBean = (AbstractDkModifiableBeanWithId) model;
          dirtyBeanAndAncestors(editor.getStore(), modifiableBean);
          for (final Object changeObject : record.getChanges())
          {
            final Change change = (Change) changeObject;
            final String path = ((ValueProvider) change.getChangeTag()).getPath();
            if (DkStringUtils.hasText(path))
            {
              modifiableBean.getDirtyPaths().add(path.indexOf(".") == -1 ? path : path.substring(0, path.indexOf(".")));
            }
          }
        }
      }
    }
View Full Code Here

  @SuppressWarnings(
  { "rawtypes", "unchecked" })
  private static <M extends AbstractDkModifiableBeanWithId> void dirtyBeanAndAncestors(final TreeStore store,
      final AbstractDkModifiableBeanWithId bean)
  {
    AbstractDkModifiableBeanWithId current = bean;
    int i = 0;
    while (current != null)
    {
      current.setDirty(true);
      if (i > 0)
      {
        current.getDirtyPaths().add("children");
      }
      current = (AbstractDkModifiableBeanWithId) store.getParent(current);
      i++;
    }
  }
View Full Code Here

TOP

Related Classes of com.daikit.commons.shared.bean.AbstractDkModifiableBeanWithId

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.