org.eclipse.emf.databinding.edit_1.2.0.v20120130-0943

16:43:28.451 INFO  jd.cli.Main - Decompiling org.eclipse.emf.databinding.edit_1.2.0.v20120130-0943.jar
package org.eclipse.emf.databinding.edit;

import org.eclipse.emf.common.EMFPlugin.EclipsePlugin;

public class DataBindingEditPlugin$Implementation
  extends EMFPlugin.EclipsePlugin
{
  public DataBindingEditPlugin$Implementation()
  {
    DataBindingEditPlugin.access$0(this);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.emf.databinding.edit.DataBindingEditPlugin.Implementation
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.emf.databinding.edit;

import org.eclipse.emf.common.EMFPlugin;
import org.eclipse.emf.common.EMFPlugin.EclipsePlugin;
import org.eclipse.emf.common.util.ResourceLocator;

public final class DataBindingEditPlugin
  extends EMFPlugin
{
  public static final DataBindingEditPlugin INSTANCE = new DataBindingEditPlugin();
  private static Implementation plugin;
  
  public DataBindingEditPlugin()
  {
    super(new ResourceLocator[0]);
  }
  
  public ResourceLocator getPluginResourceLocator()
  {
    return plugin;
  }
  
  public static Implementation getPlugin()
  {
    return plugin;
  }
  
  public static class Implementation
    extends EMFPlugin.EclipsePlugin
  {
    public Implementation()
    {
      DataBindingEditPlugin.plugin = this;
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.emf.databinding.edit.DataBindingEditPlugin
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.emf.databinding.edit;

import org.eclipse.core.databinding.observable.IObservable;
import org.eclipse.core.databinding.observable.Realm;
import org.eclipse.core.databinding.observable.masterdetail.IObservableFactory;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.edit.domain.EditingDomain;

class EMFEditObservables$1
  implements IObservableFactory
{
  EMFEditObservables$1(Realm paramRealm, EditingDomain paramEditingDomain, EStructuralFeature paramEStructuralFeature) {}
  
  public IObservable createObservable(Object target)
  {
    return EMFEditObservables.observeValue(val$realm, val$domain, (EObject)target, val$eStructuralFeature);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.emf.databinding.edit.EMFEditObservables.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.emf.databinding.edit;

import org.eclipse.core.databinding.observable.IObservable;
import org.eclipse.core.databinding.observable.Realm;
import org.eclipse.core.databinding.observable.masterdetail.IObservableFactory;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.edit.domain.EditingDomain;

class EMFEditObservables$2
  implements IObservableFactory
{
  EMFEditObservables$2(Realm paramRealm, EditingDomain paramEditingDomain, EStructuralFeature paramEStructuralFeature) {}
  
  public IObservable createObservable(Object target)
  {
    return EMFEditObservables.observeList(val$realm, val$domain, (EObject)target, val$eStructuralFeature);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.emf.databinding.edit.EMFEditObservables.2
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.emf.databinding.edit;

import org.eclipse.core.databinding.observable.IObservable;
import org.eclipse.core.databinding.observable.masterdetail.IObservableFactory;
import org.eclipse.core.databinding.observable.set.IObservableSet;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.edit.domain.EditingDomain;

class EMFEditObservables$3
  implements IObservableFactory
{
  EMFEditObservables$3(EditingDomain paramEditingDomain, EStructuralFeature paramEStructuralFeature) {}
  
  public IObservable createObservable(Object target)
  {
    return EMFEditObservables.observeMap(val$domain, (IObservableSet)target, val$eStructuralFeature);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.emf.databinding.edit.EMFEditObservables.3
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.emf.databinding.edit;

import org.eclipse.core.databinding.observable.IObservable;
import org.eclipse.core.databinding.observable.Realm;
import org.eclipse.core.databinding.observable.list.IObservableList;
import org.eclipse.core.databinding.observable.map.IObservableMap;
import org.eclipse.core.databinding.observable.masterdetail.IObservableFactory;
import org.eclipse.core.databinding.observable.masterdetail.MasterDetailObservables;
import org.eclipse.core.databinding.observable.set.IObservableSet;
import org.eclipse.core.databinding.observable.value.IObservableValue;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.edit.domain.EditingDomain;

public class EMFEditObservables
{
  public static IObservableValue observeValue(EditingDomain domain, EObject eObject, EStructuralFeature eStructuralFeature)
  {
    return new EditingDomainEObjectObservableValue(domain, eObject, eStructuralFeature);
  }
  
  public static IObservableValue observeValue(Realm realm, EditingDomain domain, EObject eObject, EStructuralFeature eStructuralFeature)
  {
    return new EditingDomainEObjectObservableValue(realm, domain, eObject, eStructuralFeature);
  }
  
  public static IObservableList observeList(EditingDomain domain, EObject eObject, EStructuralFeature eStructuralFeature)
  {
    return new EditingDomainEObjectObservableList(domain, eObject, eStructuralFeature);
  }
  
  public static IObservableList observeList(Realm realm, EditingDomain domain, EObject eObject, EStructuralFeature eStructuralFeature)
  {
    return new EditingDomainEObjectObservableList(realm, domain, eObject, eStructuralFeature);
  }
  
  public static IObservableMap observeMap(EditingDomain domain, IObservableSet objects, EStructuralFeature eStructuralFeature)
  {
    return new EditingDomainEObjectObservableMap(domain, objects, eStructuralFeature);
  }
  
  public static IObservableMap[] observeMaps(EditingDomain domain, IObservableSet objects, EStructuralFeature[] eStructuralFeatures)
  {
    IObservableMap[] result = new IObservableMap[eStructuralFeatures.length];
    for (int i = 0; i < eStructuralFeatures.length; i++) {
      result[i] = observeMap(domain, objects, eStructuralFeatures[i]);
    }
    return result;
  }
  
  public static IObservableValue observeDetailValue(Realm realm, EditingDomain domain, IObservableValue value, EStructuralFeature eStructuralFeature)
  {
    return MasterDetailObservables.detailValue(value, valueFactory(realm, domain, eStructuralFeature), eStructuralFeature);
  }
  
  public static IObservableFactory valueFactory(Realm realm, final EditingDomain domain, final EStructuralFeature eStructuralFeature)
  {
    new IObservableFactory()
    {
      public IObservable createObservable(Object target)
      {
        return EMFEditObservables.observeValue(EMFEditObservables.this, domain, (EObject)target, eStructuralFeature);
      }
    };
  }
  
  public static IObservableList observeDetailList(Realm realm, EditingDomain domain, IObservableValue value, EStructuralFeature eStructuralFeature)
  {
    return MasterDetailObservables.detailList(value, listFactory(realm, domain, eStructuralFeature), eStructuralFeature);
  }
  
  public static IObservableFactory listFactory(Realm realm, final EditingDomain domain, final EStructuralFeature eStructuralFeature)
  {
    new IObservableFactory()
    {
      public IObservable createObservable(Object target)
      {
        return EMFEditObservables.observeList(EMFEditObservables.this, domain, (EObject)target, eStructuralFeature);
      }
    };
  }
  
  public static IObservableFactory mapFactory(EditingDomain domain, final EStructuralFeature eStructuralFeature)
  {
    new IObservableFactory()
    {
      public IObservable createObservable(Object target)
      {
        return EMFEditObservables.observeMap(EMFEditObservables.this, (IObservableSet)target, eStructuralFeature);
      }
    };
  }
}

/* Location:
 * Qualified Name:     org.eclipse.emf.databinding.edit.EMFEditObservables
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.emf.databinding.edit;

import org.eclipse.core.databinding.property.list.IListProperty;
import org.eclipse.core.databinding.property.map.IMapProperty;
import org.eclipse.core.databinding.property.set.ISetProperty;
import org.eclipse.core.databinding.property.value.IValueProperty;
import org.eclipse.emf.databinding.FeaturePath;
import org.eclipse.emf.databinding.edit.internal.EMFEditListProperty;
import org.eclipse.emf.databinding.edit.internal.EMFEditListPropertyDecorator;
import org.eclipse.emf.databinding.edit.internal.EMFEditMapProperty;
import org.eclipse.emf.databinding.edit.internal.EMFEditMapPropertyDecorator;
import org.eclipse.emf.databinding.edit.internal.EMFEditMultiListProperty;
import org.eclipse.emf.databinding.edit.internal.EMFEditResourceContentProperty;
import org.eclipse.emf.databinding.edit.internal.EMFEditSetProperty;
import org.eclipse.emf.databinding.edit.internal.EMFEditSetPropertyDecorator;
import org.eclipse.emf.databinding.edit.internal.EMFEditValueProperty;
import org.eclipse.emf.databinding.edit.internal.EMFEditValuePropertyDecorator;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.edit.domain.EditingDomain;

public class EMFEditProperties
{
  public static final boolean DEBUG = false;
  
  public static IEMFEditValueProperty value(EditingDomain editingDomain, EStructuralFeature feature)
  {
    return value(editingDomain, FeaturePath.fromList(new EStructuralFeature[] { feature }));
  }
  
  public static IEMFEditValueProperty value(EditingDomain editingDomain, FeaturePath featurePath)
  {
    IValueProperty property = new EMFEditValueProperty(editingDomain, featurePath.getFeaturePath()[0]);
    
    IEMFEditValueProperty featureProperty = new EMFEditValuePropertyDecorator(editingDomain, property, featurePath.getFeaturePath()[0]);
    for (int i = 1; i < featurePath.getFeaturePath().length; i++) {
      featureProperty = featureProperty.value(featurePath.getFeaturePath()[i]);
    }
    return featureProperty;
  }
  
  public static IEMFEditValueProperty[] values(EditingDomain editingDomain, EStructuralFeature... features)
  {
    IEMFEditValueProperty[] properties = new IEMFEditValueProperty[features.length];
    for (int i = 0; i < properties.length; i++) {
      properties[i] = value(editingDomain, features[i]);
    }
    return properties;
  }
  
  public static IEMFEditValueProperty[] values(EditingDomain editingDomain, FeaturePath... featurePaths)
  {
    IEMFEditValueProperty[] properties = new IEMFEditValueProperty[featurePaths.length];
    for (int i = 0; i < properties.length; i++) {
      properties[i] = value(editingDomain, featurePaths[i]);
    }
    return properties;
  }
  
  public static IEMFEditSetProperty set(EditingDomain editingDomain, EStructuralFeature feature)
  {
    ISetProperty property = new EMFEditSetProperty(editingDomain, feature);
    return new EMFEditSetPropertyDecorator(editingDomain, property, feature);
  }
  
  public static IEMFEditSetProperty set(EditingDomain editingDomain, FeaturePath featurePath)
  {
    int len = featurePath.getFeaturePath().length;
    if (len > 1)
    {
      IValueProperty property = new EMFEditValueProperty(editingDomain, featurePath.getFeaturePath()[0]);
      
      IEMFEditValueProperty featureProperty = new EMFEditValuePropertyDecorator(editingDomain, property, featurePath.getFeaturePath()[0]);
      for (int i = 1; i < featurePath.getFeaturePath().length - 1; i++) {
        featureProperty = featureProperty.value(featurePath.getFeaturePath()[i]);
      }
      return featureProperty.set(set(editingDomain, featurePath.getFeaturePath()[(len - 1)]));
    }
    return set(editingDomain, featurePath.getFeaturePath()[(len - 1)]);
  }
  
  public static IEMFEditListProperty list(EditingDomain editingDomain, EStructuralFeature feature)
  {
    IListProperty property = new EMFEditListProperty(editingDomain, feature);
    return new EMFEditListPropertyDecorator(editingDomain, property, feature);
  }
  
  public static IEMFEditListProperty list(EditingDomain editingDomain, FeaturePath featurePath)
  {
    int len = featurePath.getFeaturePath().length;
    if (len > 1)
    {
      IValueProperty property = new EMFEditValueProperty(editingDomain, featurePath.getFeaturePath()[0]);
      
      IEMFEditValueProperty featureProperty = new EMFEditValuePropertyDecorator(editingDomain, property, featurePath.getFeaturePath()[0]);
      for (int i = 1; i < featurePath.getFeaturePath().length - 1; i++) {
        featureProperty = featureProperty.value(featurePath.getFeaturePath()[i]);
      }
      return featureProperty.list(list(editingDomain, featurePath.getFeaturePath()[(len - 1)]));
    }
    return list(editingDomain, featurePath.getFeaturePath()[(len - 1)]);
  }
  
  public static IEMFEditListProperty multiList(EditingDomain editingDomain, EStructuralFeature... features)
  {
    IEMFEditListProperty[] multi = new IEMFEditListProperty[features.length];
    int i = 0;
    EStructuralFeature[] arrayOfEStructuralFeature;
    int j = (arrayOfEStructuralFeature = features).length;
    for (int i = 0; i < j; i++)
    {
      EStructuralFeature feature = arrayOfEStructuralFeature[i];
      
      multi[(i++)] = list(editingDomain, feature);
    }
    return multiList(editingDomain, multi);
  }
  
  public static IEMFEditListProperty multiList(EditingDomain editingDomain, FeaturePath rootPath, EStructuralFeature... features)
  {
    IEMFEditListProperty[] multi = new IEMFEditListProperty[features.length];
    int i = 0;
    int l = rootPath.getFeaturePath().length;
    EStructuralFeature[] arrayOfEStructuralFeature1;
    int j = (arrayOfEStructuralFeature1 = features).length;
    for (int i = 0; i < j; i++)
    {
      EStructuralFeature f = arrayOfEStructuralFeature1[i];
      
      EStructuralFeature[] p = new EStructuralFeature[l + 1];
      System.arraycopy(rootPath.getFeaturePath(), 0, p, 0, l);
      p[l] = f;
      multi[(i++)] = list(editingDomain, FeaturePath.fromList(p));
    }
    return multiList(editingDomain, multi);
  }
  
  public static IEMFEditListProperty multiList(EditingDomain editingDomain, FeaturePath... featurePaths)
  {
    IEMFEditListProperty[] multi = new IEMFEditListProperty[featurePaths.length];
    int i = 0;
    FeaturePath[] arrayOfFeaturePath;
    int j = (arrayOfFeaturePath = featurePaths).length;
    for (int i = 0; i < j; i++)
    {
      FeaturePath path = arrayOfFeaturePath[i];
      
      multi[(i++)] = list(editingDomain, path);
    }
    return multiList(editingDomain, multi);
  }
  
  public static IEMFEditListProperty multiList(EditingDomain editingDomain, IEMFEditListProperty... properties)
  {
    return new EMFEditMultiListProperty(editingDomain, properties);
  }
  
  public static IEMFEditMapProperty map(EditingDomain editingDomain, EStructuralFeature feature)
  {
    IMapProperty property = new EMFEditMapProperty(editingDomain, feature);
    return new EMFEditMapPropertyDecorator(editingDomain, property, feature);
  }
  
  public static IEMFEditListProperty resource(EditingDomain editingDomain)
  {
    IListProperty property = new EMFEditResourceContentProperty(editingDomain);
    return new EMFEditListPropertyDecorator(editingDomain, property, null);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.emf.databinding.edit.EMFEditProperties
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.emf.databinding.edit;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import org.eclipse.core.databinding.observable.Realm;
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.common.command.CommandStack;
import org.eclipse.emf.databinding.EObjectObservableList;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.edit.command.AddCommand;
import org.eclipse.emf.edit.command.MoveCommand;
import org.eclipse.emf.edit.command.RemoveCommand;
import org.eclipse.emf.edit.command.SetCommand;
import org.eclipse.emf.edit.domain.EditingDomain;

public class EditingDomainEObjectObservableList
  extends EObjectObservableList
{
  protected EditingDomain domain;
  
  public EditingDomainEObjectObservableList(EditingDomain domain, EObject eObject, EStructuralFeature eStructuralFeature)
  {
    this(Realm.getDefault(), domain, eObject, eStructuralFeature);
  }
  
  public EditingDomainEObjectObservableList(Realm realm, EditingDomain domain, EObject eObject, EStructuralFeature eStructuralFeature)
  {
    super(realm, eObject, eStructuralFeature);
    this.domain = domain;
  }
  
  public synchronized void dispose()
  {
    domain = null;
    super.dispose();
  }
  
  protected boolean execute(Command command)
  {
    if (command.canExecute())
    {
      domain.getCommandStack().execute(command);
      return true;
    }
    return false;
  }
  
  public boolean add(Object object)
  {
    checkRealm();
    return execute(AddCommand.create(domain, eObject, eStructuralFeature, object));
  }
  
  public void add(int index, Object object)
  {
    checkRealm();
    execute(AddCommand.create(domain, eObject, eStructuralFeature, object, index));
  }
  
  public boolean addAll(Collection collection)
  {
    checkRealm();
    return execute(AddCommand.create(domain, eObject, eStructuralFeature, collection));
  }
  
  public boolean addAll(int index, Collection collection)
  {
    checkRealm();
    return execute(AddCommand.create(domain, eObject, eStructuralFeature, collection, index));
  }
  
  public Object set(int index, Object element)
  {
    checkRealm();
    Object oldElement = wrappedList.get(index);
    execute(SetCommand.create(domain, eObject, eStructuralFeature, element, index));
    return oldElement;
  }
  
  public Object remove(int index)
  {
    checkRealm();
    Object element = wrappedList.get(index);
    execute(RemoveCommand.create(domain, eObject, eStructuralFeature, element));
    return element;
  }
  
  public boolean remove(Object element)
  {
    checkRealm();
    return execute(RemoveCommand.create(domain, eObject, eStructuralFeature, element));
  }
  
  public boolean removeAll(Collection collection)
  {
    checkRealm();
    return execute(RemoveCommand.create(domain, eObject, eStructuralFeature, collection));
  }
  
  public boolean retainAll(Collection collection)
  {
    checkRealm();
    Collection<Object> objectsToRemove = new ArrayList(wrappedList());
    objectsToRemove.removeAll(collection);
    return execute(RemoveCommand.create(domain, eObject, eStructuralFeature, objectsToRemove));
  }
  
  public void clear()
  {
    checkRealm();
    execute(RemoveCommand.create(domain, eObject, eStructuralFeature, new ArrayList(wrappedList())));
  }
  
  public Object move(int newPosition, int oldPosition)
  {
    Object result = wrappedList.get(oldPosition);
    move(newPosition, result);
    return result;
  }
  
  public void move(int newPosition, Object object)
  {
    checkRealm();
    execute(MoveCommand.create(domain, eObject, eStructuralFeature, object, newPosition));
  }
}

/* Location:
 * Qualified Name:     org.eclipse.emf.databinding.edit.EditingDomainEObjectObservableList
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.emf.databinding.edit;

import org.eclipse.core.databinding.observable.set.IObservableSet;
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.common.command.CommandStack;
import org.eclipse.emf.databinding.EObjectObservableMap;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.edit.command.SetCommand;
import org.eclipse.emf.edit.domain.EditingDomain;

public class EditingDomainEObjectObservableMap
  extends EObjectObservableMap
{
  protected EditingDomain domain;
  
  public EditingDomainEObjectObservableMap(EditingDomain domain, IObservableSet objects, EStructuralFeature eStructuralFeature)
  {
    super(objects, eStructuralFeature);
    this.domain = domain;
  }
  
  protected Object doPut(Object key, Object value)
  {
    EObject eObject = (EObject)key;
    Object result = eObject.eGet(eStructuralFeature);
    Command command = SetCommand.create(domain, eObject, eStructuralFeature, value);
    domain.getCommandStack().execute(command);
    
    eObject.eSet(eStructuralFeature, value);
    return result;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.emf.databinding.edit.EditingDomainEObjectObservableMap
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.emf.databinding.edit;

import org.eclipse.core.databinding.observable.Realm;
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.common.command.CommandStack;
import org.eclipse.emf.databinding.EObjectObservableValue;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.edit.command.SetCommand;
import org.eclipse.emf.edit.domain.EditingDomain;

public class EditingDomainEObjectObservableValue
  extends EObjectObservableValue
{
  protected EditingDomain domain;
  
  public EditingDomainEObjectObservableValue(EditingDomain domain, EObject eObject, EStructuralFeature eStructuralFeature)
  {
    this(Realm.getDefault(), domain, eObject, eStructuralFeature);
  }
  
  public EditingDomainEObjectObservableValue(Realm realm, EditingDomain domain, EObject eObject, EStructuralFeature eStructuralFeature)
  {
    super(realm, eObject, eStructuralFeature);
    this.domain = domain;
  }
  
  public synchronized void dispose()
  {
    domain = null;
    super.dispose();
  }
  
  protected void doSetValue(Object value)
  {
    Command command = SetCommand.create(domain, eObject, eStructuralFeature, value);
    domain.getCommandStack().execute(command);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.emf.databinding.edit.EditingDomainEObjectObservableValue
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.emf.databinding.edit;

import org.eclipse.emf.databinding.FeaturePath;
import org.eclipse.emf.databinding.IEMFListProperty;
import org.eclipse.emf.databinding.IEMFListProperty.ListElementAccess;
import org.eclipse.emf.databinding.IEMFValueProperty;
import org.eclipse.emf.ecore.EStructuralFeature;

public abstract interface IEMFEditListProperty
  extends IEMFEditProperty, IEMFListProperty
{
  public abstract IEMFEditListProperty values(FeaturePath paramFeaturePath);
  
  public abstract IEMFEditListProperty values(EStructuralFeature paramEStructuralFeature);
  
  public abstract IEMFEditListProperty values(IEMFEditValueProperty paramIEMFEditValueProperty);
  
  public abstract IEMFEditListProperty values(IEMFValueProperty paramIEMFValueProperty);
  
  public abstract IEMFEditValueProperty value(IEMFListProperty.ListElementAccess<?> paramListElementAccess);
}

/* Location:
 * Qualified Name:     org.eclipse.emf.databinding.edit.IEMFEditListProperty
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.emf.databinding.edit;

import org.eclipse.emf.databinding.FeaturePath;
import org.eclipse.emf.databinding.IEMFMapProperty;
import org.eclipse.emf.databinding.IEMFValueProperty;
import org.eclipse.emf.ecore.EStructuralFeature;

public abstract interface IEMFEditMapProperty
  extends IEMFEditProperty, IEMFMapProperty
{
  public abstract IEMFEditMapProperty values(FeaturePath paramFeaturePath);
  
  public abstract IEMFEditMapProperty values(EStructuralFeature paramEStructuralFeature);
  
  public abstract IEMFEditMapProperty values(IEMFEditValueProperty paramIEMFEditValueProperty);
  
  public abstract IEMFEditMapProperty values(IEMFValueProperty paramIEMFValueProperty);
}

/* Location:
 * Qualified Name:     org.eclipse.emf.databinding.edit.IEMFEditMapProperty
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.emf.databinding.edit;

import org.eclipse.emf.databinding.IEMFObservable;
import org.eclipse.emf.edit.domain.EditingDomain;

public abstract interface IEMFEditObservable
  extends IEMFObservable
{
  public abstract EditingDomain getEditingDomain();
}

/* Location:
 * Qualified Name:     org.eclipse.emf.databinding.edit.IEMFEditObservable
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.emf.databinding.edit;

import org.eclipse.emf.databinding.IEMFProperty;
import org.eclipse.emf.edit.domain.EditingDomain;

public abstract interface IEMFEditProperty
  extends IEMFProperty
{
  public abstract EditingDomain getEditingDomain();
}

/* Location:
 * Qualified Name:     org.eclipse.emf.databinding.edit.IEMFEditProperty
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.emf.databinding.edit;

import org.eclipse.emf.databinding.FeaturePath;
import org.eclipse.emf.databinding.IEMFSetProperty;
import org.eclipse.emf.ecore.EStructuralFeature;

public abstract interface IEMFEditSetProperty
  extends IEMFEditProperty, IEMFSetProperty
{
  public abstract IEMFEditMapProperty values(EStructuralFeature paramEStructuralFeature);
  
  public abstract IEMFEditMapProperty values(FeaturePath paramFeaturePath);
  
  public abstract IEMFEditMapProperty values(IEMFEditValueProperty paramIEMFEditValueProperty);
}

/* Location:
 * Qualified Name:     org.eclipse.emf.databinding.edit.IEMFEditSetProperty
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.emf.databinding.edit;

import org.eclipse.emf.databinding.FeaturePath;
import org.eclipse.emf.databinding.IEMFListProperty;
import org.eclipse.emf.databinding.IEMFMapProperty;
import org.eclipse.emf.databinding.IEMFValueProperty;
import org.eclipse.emf.ecore.EStructuralFeature;

public abstract interface IEMFEditValueProperty
  extends IEMFEditProperty, IEMFValueProperty
{
  public abstract IEMFEditValueProperty value(FeaturePath paramFeaturePath);
  
  public abstract IEMFEditValueProperty value(EStructuralFeature paramEStructuralFeature);
  
  public abstract IEMFEditValueProperty value(IEMFEditValueProperty paramIEMFEditValueProperty);
  
  public abstract IEMFEditListProperty list(EStructuralFeature paramEStructuralFeature);
  
  public abstract IEMFEditListProperty list(IEMFEditListProperty paramIEMFEditListProperty);
  
  public abstract IEMFEditMapProperty map(EStructuralFeature paramEStructuralFeature);
  
  public abstract IEMFEditMapProperty map(IEMFEditMapProperty paramIEMFEditMapProperty);
  
  public abstract IEMFEditListProperty list(IEMFListProperty paramIEMFListProperty);
  
  public abstract IEMFEditMapProperty map(IEMFMapProperty paramIEMFMapProperty);
  
  public abstract IEMFEditValueProperty value(IEMFValueProperty paramIEMFValueProperty);
  
  public abstract IEMFEditSetProperty set(EStructuralFeature paramEStructuralFeature);
  
  public abstract IEMFEditSetProperty set(IEMFEditSetProperty paramIEMFEditSetProperty);
}

/* Location:
 * Qualified Name:     org.eclipse.emf.databinding.edit.IEMFEditValueProperty
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.emf.databinding.edit.internal;

import java.util.List;
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.common.command.CompoundCommand;

class EMFEditListProperty$1
  extends CompoundCommand
{
  protected int index = 0;
  
  EMFEditListProperty$1(EMFEditListProperty paramEMFEditListProperty, EMFEditListProperty.ListVisitorImpl paramListVisitorImpl) {}
  
  protected boolean prepare()
  {
    for (int size = val$visitor.commands.size(); index < size; index += 1) {
      if (((Command)val$visitor.commands.get(index)).canExecute()) {
        return true;
      }
    }
    return false;
  }
  
  public void execute()
  {
    for (int size = val$visitor.commands.size(); index < size; index += 1) {
      appendAndExecute((Command)val$visitor.commands.get(index));
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.emf.databinding.edit.internal.EMFEditListProperty.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.emf.databinding.edit.internal;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.eclipse.core.databinding.observable.list.ListDiffVisitor;
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.edit.command.AddCommand;
import org.eclipse.emf.edit.command.MoveCommand;
import org.eclipse.emf.edit.command.RemoveCommand;
import org.eclipse.emf.edit.command.ReplaceCommand;

class EMFEditListProperty$ListVisitorImpl
  extends ListDiffVisitor
{
  private EObject eObj;
  private EStructuralFeature feature;
  protected final List<Command> commands = new ArrayList();
  
  private EMFEditListProperty$ListVisitorImpl(EMFEditListProperty paramEMFEditListProperty, EObject eObj, EStructuralFeature feature)
  {
    this.eObj = eObj;
    this.feature = feature;
  }
  
  public void handleAdd(int index, Object element)
  {
    commands.add(AddCommand.create(EMFEditListProperty.access$0(this$0), eObj, feature, element, index));
  }
  
  public void handleMove(int oldIndex, int newIndex, Object element)
  {
    commands.add(MoveCommand.create(EMFEditListProperty.access$0(this$0), eObj, feature, element, newIndex));
  }
  
  public void handleReplace(int index, Object oldElement, Object newElement)
  {
    commands.add(ReplaceCommand.create(EMFEditListProperty.access$0(this$0), eObj, feature, oldElement, Collections.singleton(newElement)));
  }
  
  public void handleRemove(int index, Object element)
  {
    commands.add(RemoveCommand.create(EMFEditListProperty.access$0(this$0), eObj, feature, element));
  }
}

/* Location:
 * Qualified Name:     org.eclipse.emf.databinding.edit.internal.EMFEditListProperty.ListVisitorImpl
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.emf.databinding.edit.internal;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.eclipse.core.databinding.observable.list.ListDiff;
import org.eclipse.core.databinding.observable.list.ListDiffVisitor;
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.common.command.CommandStack;
import org.eclipse.emf.common.command.CompoundCommand;
import org.eclipse.emf.databinding.internal.EMFListProperty;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.edit.command.AddCommand;
import org.eclipse.emf.edit.command.MoveCommand;
import org.eclipse.emf.edit.command.RemoveCommand;
import org.eclipse.emf.edit.command.ReplaceCommand;
import org.eclipse.emf.edit.domain.EditingDomain;

public class EMFEditListProperty
  extends EMFListProperty
{
  private final EditingDomain editingDomain;
  
  public EMFEditListProperty(EditingDomain editingDomain, EStructuralFeature eStructuralFeature)
  {
    super(eStructuralFeature);
    this.editingDomain = editingDomain;
  }
  
  protected void doSetList(Object source, List list, ListDiff diff)
  {
    final ListVisitorImpl visitor = new ListVisitorImpl((EObject)source, getFeature(), null);
    diff.accept(visitor);
    editingDomain.getCommandStack().execute(
      new CompoundCommand()
      {
        protected int index = 0;
        
        protected boolean prepare()
        {
          for (int size = visitorcommands.size(); index < size; index += 1) {
            if (((Command)visitorcommands.get(index)).canExecute()) {
              return true;
            }
          }
          return false;
        }
        
        public void execute()
        {
          for (int size = visitorcommands.size(); index < size; index += 1) {
            appendAndExecute((Command)visitorcommands.get(index));
          }
        }
      });
  }
  
  private class ListVisitorImpl
    extends ListDiffVisitor
  {
    private EObject eObj;
    private EStructuralFeature feature;
    protected final List<Command> commands = new ArrayList();
    
    private ListVisitorImpl(EObject eObj, EStructuralFeature feature)
    {
      this.eObj = eObj;
      this.feature = feature;
    }
    
    public void handleAdd(int index, Object element)
    {
      commands.add(AddCommand.create(editingDomain, eObj, feature, element, index));
    }
    
    public void handleMove(int oldIndex, int newIndex, Object element)
    {
      commands.add(MoveCommand.create(editingDomain, eObj, feature, element, newIndex));
    }
    
    public void handleReplace(int index, Object oldElement, Object newElement)
    {
      commands.add(ReplaceCommand.create(editingDomain, eObj, feature, oldElement, Collections.singleton(newElement)));
    }
    
    public void handleRemove(int index, Object element)
    {
      commands.add(RemoveCommand.create(editingDomain, eObj, feature, element));
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.emf.databinding.edit.internal.EMFEditListProperty
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.emf.databinding.edit.internal;

import org.eclipse.core.databinding.observable.Realm;
import org.eclipse.core.databinding.observable.list.IObservableList;
import org.eclipse.core.databinding.observable.masterdetail.IObservableFactory;
import org.eclipse.core.databinding.observable.value.IObservableValue;
import org.eclipse.core.databinding.property.list.IListProperty;
import org.eclipse.core.databinding.property.list.ListProperty;
import org.eclipse.emf.databinding.FeaturePath;
import org.eclipse.emf.databinding.IEMFListProperty.ListElementAccess;
import org.eclipse.emf.databinding.IEMFValueProperty;
import org.eclipse.emf.databinding.edit.EMFEditProperties;
import org.eclipse.emf.databinding.edit.IEMFEditListProperty;
import org.eclipse.emf.databinding.edit.IEMFEditValueProperty;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.edit.domain.EditingDomain;

public class EMFEditListPropertyDecorator
  extends ListProperty
  implements IEMFEditListProperty
{
  private final IListProperty delegate;
  private final EStructuralFeature eStructuralFeature;
  private final EditingDomain editingDomain;
  
  public EMFEditListPropertyDecorator(EditingDomain editingDomain, IListProperty delegate, EStructuralFeature eStructuralFeature)
  {
    this.delegate = delegate;
    this.eStructuralFeature = eStructuralFeature;
    this.editingDomain = editingDomain;
  }
  
  public Object getElementType()
  {
    return delegate.getElementType();
  }
  
  public IEMFEditListProperty values(EStructuralFeature feature)
  {
    return values(FeaturePath.fromList(new EStructuralFeature[] { feature }));
  }
  
  public IEMFEditListProperty values(FeaturePath featurePath)
  {
    return values(EMFEditProperties.value(editingDomain, featurePath));
  }
  
  public IEMFEditListProperty values(IEMFEditValueProperty property)
  {
    return new EMFEditListPropertyDecorator(editingDomain, super.values(property), property.getStructuralFeature());
  }
  
  public EStructuralFeature getStructuralFeature()
  {
    return eStructuralFeature;
  }
  
  public IObservableList observe(Object source)
  {
    return new EMFEditObservableListDecorator(editingDomain, delegate.observe(source), eStructuralFeature);
  }
  
  public IObservableList observe(Realm realm, Object source)
  {
    return new EMFEditObservableListDecorator(editingDomain, delegate.observe(realm, source), eStructuralFeature);
  }
  
  public IObservableFactory listFactory()
  {
    return delegate.listFactory();
  }
  
  public IObservableFactory listFactory(Realm realm)
  {
    return delegate.listFactory(realm);
  }
  
  public IObservableList observeDetail(IObservableValue master)
  {
    return new EMFEditObservableListDecorator(editingDomain, delegate.observeDetail(master), eStructuralFeature);
  }
  
  public String toString()
  {
    return delegate.toString();
  }
  
  public EditingDomain getEditingDomain()
  {
    return editingDomain;
  }
  
  public IEMFEditListProperty values(IEMFValueProperty property)
  {
    return new EMFEditListPropertyDecorator(editingDomain, super.values(property), property.getStructuralFeature());
  }
  
  public IEMFEditValueProperty value(IEMFListProperty.ListElementAccess elementAccess)
  {
    return new EMFEditValuePropertyDecorator(editingDomain, new EMFEditListValueProperty(editingDomain, eStructuralFeature, elementAccess), eStructuralFeature);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.emf.databinding.edit.internal.EMFEditListPropertyDecorator
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.emf.databinding.edit.internal;

import java.util.List;
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.common.command.CommandStack;
import org.eclipse.emf.databinding.IEMFListProperty.ListElementAccess;
import org.eclipse.emf.databinding.IEMFListProperty.ListElementAccess.WriteData;
import org.eclipse.emf.databinding.internal.EMFListValueProperty;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.edit.command.AddCommand;
import org.eclipse.emf.edit.command.SetCommand;
import org.eclipse.emf.edit.domain.EditingDomain;

public class EMFEditListValueProperty
  extends EMFListValueProperty
{
  private EditingDomain editingDomain;
  
  public EMFEditListValueProperty(EditingDomain editingDomain, EStructuralFeature eStructuralFeature, IEMFListProperty.ListElementAccess elementAccess)
  {
    super(eStructuralFeature, elementAccess);
    this.editingDomain = editingDomain;
  }
  
  protected void doSetListValue(EObject source, List<Object> targetList, IEMFListProperty.ListElementAccess.WriteData data, Object value)
  {
    Command cmd;
    Command cmd;
    if (insert)
    {
      Command cmd;
      if (index == -1) {
        cmd = AddCommand.create(editingDomain, source, getValueType(), value);
      } else {
        cmd = AddCommand.create(editingDomain, source, getValueType(), Integer.valueOf(index));
      }
    }
    else
    {
      cmd = SetCommand.create(editingDomain, source, getValueType(), value, index);
    }
    editingDomain.getCommandStack().execute(cmd);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.emf.databinding.edit.internal.EMFEditListValueProperty
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.emf.databinding.edit.internal;

import java.util.Map;
import org.eclipse.core.databinding.observable.map.MapDiff;
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.common.command.CommandStack;
import org.eclipse.emf.databinding.internal.EMFMapProperty;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.edit.command.SetCommand;
import org.eclipse.emf.edit.domain.EditingDomain;

public class EMFEditMapProperty
  extends EMFMapProperty
{
  private final EditingDomain editingDomain;
  
  public EMFEditMapProperty(EditingDomain editingDomain, EStructuralFeature eStructuralFeature)
  {
    super(eStructuralFeature);
    this.editingDomain = editingDomain;
  }
  
  protected void doSetMap(Object source, Map map, MapDiff diff)
  {
    EObject eObject = (EObject)source;
    Command command = SetCommand.create(editingDomain, eObject, getFeature(), map);
    editingDomain.getCommandStack().execute(command);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.emf.databinding.edit.internal.EMFEditMapProperty
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.emf.databinding.edit.internal;

import org.eclipse.core.databinding.observable.Realm;
import org.eclipse.core.databind
1 2

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd