org.eclipse.emf.databinding_1.2.0.v20120130-0943

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

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

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

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

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

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

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

import org.eclipse.core.databinding.DataBindingContext;
import org.eclipse.core.databinding.UpdateValueStrategy;
import org.eclipse.core.databinding.observable.Realm;
import org.eclipse.core.databinding.observable.value.IObservableValue;

public class EMFDataBindingContext
  extends DataBindingContext
{
  public EMFDataBindingContext()
  {
    this(Realm.getDefault());
  }
  
  public EMFDataBindingContext(Realm validationRealm)
  {
    super(validationRealm);
  }
  
  protected UpdateValueStrategy createModelToTargetUpdateValueStrategy(IObservableValue fromValue, IObservableValue toValue)
  {
    return new EMFUpdateValueStrategy();
  }
  
  protected UpdateValueStrategy createTargetToModelUpdateValueStrategy(IObservableValue fromValue, IObservableValue toValue)
  {
    return new EMFUpdateValueStrategy();
  }
}

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

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;

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

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

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;

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

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

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;

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

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

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.common.notify.NotifyingList;
import org.eclipse.emf.databinding.internal.EWritableList;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.resource.Resource;

public class EMFObservables
{
  public static IObservableValue observeValue(EObject eObject, EStructuralFeature eStructuralFeature)
  {
    return new EObjectObservableValue(eObject, eStructuralFeature);
  }
  
  public static IObservableValue observeValue(Realm realm, EObject eObject, EStructuralFeature eStructuralFeature)
  {
    return new EObjectObservableValue(realm, eObject, eStructuralFeature);
  }
  
  public static IObservableList observeList(EObject eObject, EStructuralFeature eStructuralFeature)
  {
    return new EObjectObservableList(eObject, eStructuralFeature);
  }
  
  public static IObservableList observeList(Realm realm, EObject eObject, EStructuralFeature eStructuralFeature)
  {
    return new EObjectObservableList(realm, eObject, eStructuralFeature);
  }
  
  public static IObservableMap observeMap(IObservableSet objects, EStructuralFeature eStructuralFeature)
  {
    return new EObjectObservableMap(objects, eStructuralFeature);
  }
  
  public static IObservableMap[] observeMaps(IObservableSet objects, EStructuralFeature[] eStructuralFeatures)
  {
    IObservableMap[] result = new IObservableMap[eStructuralFeatures.length];
    for (int i = 0; i < eStructuralFeatures.length; i++) {
      result[i] = observeMap(objects, eStructuralFeatures[i]);
    }
    return result;
  }
  
  public static IObservableValue observeDetailValue(Realm realm, IObservableValue value, EStructuralFeature eStructuralFeature)
  {
    return MasterDetailObservables.detailValue(value, valueFactory(realm, eStructuralFeature), eStructuralFeature);
  }
  
  public static IObservableFactory valueFactory(Realm realm, final EStructuralFeature eStructuralFeature)
  {
    new IObservableFactory()
    {
      public IObservable createObservable(Object target)
      {
        return EMFObservables.observeValue(EMFObservables.this, (EObject)target, eStructuralFeature);
      }
    };
  }
  
  public static IObservableList observeDetailList(Realm realm, IObservableValue value, EStructuralFeature eStructuralFeature)
  {
    return MasterDetailObservables.detailList(value, listFactory(realm, eStructuralFeature), eStructuralFeature);
  }
  
  public static IObservableFactory listFactory(Realm realm, final EStructuralFeature eStructuralFeature)
  {
    new IObservableFactory()
    {
      public IObservable createObservable(Object target)
      {
        return EMFObservables.observeList(EMFObservables.this, (EObject)target, eStructuralFeature);
      }
    };
  }
  
  public static IObservableFactory mapFactory(EStructuralFeature eStructuralFeature)
  {
    new IObservableFactory()
    {
      public IObservable createObservable(Object target)
      {
        return EMFObservables.observeMap((IObservableSet)target, EMFObservables.this);
      }
    };
  }
  
  public static IObservableList observeResourceContents(Resource resource)
  {
    return new EWritableList((NotifyingList)resource.getContents());
  }
}

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

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.internal.EMFListProperty;
import org.eclipse.emf.databinding.internal.EMFListPropertyDecorator;
import org.eclipse.emf.databinding.internal.EMFMapProperty;
import org.eclipse.emf.databinding.internal.EMFMapPropertyDecorator;
import org.eclipse.emf.databinding.internal.EMFMultiListProperty;
import org.eclipse.emf.databinding.internal.EMFResourceContentProperty;
import org.eclipse.emf.databinding.internal.EMFSetProperty;
import org.eclipse.emf.databinding.internal.EMFSetPropertyDecorator;
import org.eclipse.emf.databinding.internal.EMFValueProperty;
import org.eclipse.emf.databinding.internal.EMFValuePropertyDecorator;
import org.eclipse.emf.ecore.EStructuralFeature;

public class EMFProperties
{
  public static final boolean DEBUG = false;
  
  public static IEMFValueProperty value(EStructuralFeature feature)
  {
    return value(FeaturePath.fromList(new EStructuralFeature[] { feature }));
  }
  
  public static IEMFValueProperty value(FeaturePath featurePath)
  {
    IValueProperty property = new EMFValueProperty(featurePath.getFeaturePath()[0]);
    
    IEMFValueProperty featureProperty = new EMFValuePropertyDecorator(property, featurePath.getFeaturePath()[0]);
    for (int i = 1; i < featurePath.getFeaturePath().length; i++) {
      featureProperty = featureProperty.value(featurePath.getFeaturePath()[i]);
    }
    return featureProperty;
  }
  
  public static IEMFValueProperty[] values(EStructuralFeature... features)
  {
    IEMFValueProperty[] properties = new IEMFValueProperty[features.length];
    for (int i = 0; i < properties.length; i++) {
      properties[i] = value(features[i]);
    }
    return properties;
  }
  
  public static IEMFValueProperty[] values(FeaturePath... featurePaths)
  {
    IEMFValueProperty[] properties = new IEMFValueProperty[featurePaths.length];
    for (int i = 0; i < properties.length; i++) {
      properties[i] = value(featurePaths[i]);
    }
    return properties;
  }
  
  public static IEMFListProperty list(EStructuralFeature feature)
  {
    IListProperty property = new EMFListProperty(feature);
    return new EMFListPropertyDecorator(property, feature);
  }
  
  public static IEMFListProperty list(FeaturePath featurePath)
  {
    int len = featurePath.getFeaturePath().length;
    if (len > 1)
    {
      IValueProperty property = new EMFValueProperty(featurePath.getFeaturePath()[0]);
      
      IEMFValueProperty featureProperty = new EMFValuePropertyDecorator(property, featurePath.getFeaturePath()[0]);
      for (int i = 1; i < featurePath.getFeaturePath().length - 1; i++) {
        featureProperty = featureProperty.value(featurePath.getFeaturePath()[i]);
      }
      return featureProperty.list(list(featurePath.getFeaturePath()[(len - 1)]));
    }
    return list(featurePath.getFeaturePath()[(len - 1)]);
  }
  
  public static IEMFSetProperty set(EStructuralFeature feature)
  {
    ISetProperty property = new EMFSetProperty(feature);
    return new EMFSetPropertyDecorator(property, feature);
  }
  
  public static IEMFSetProperty set(FeaturePath featurePath)
  {
    int len = featurePath.getFeaturePath().length;
    if (len > 1)
    {
      IValueProperty property = new EMFValueProperty(featurePath.getFeaturePath()[0]);
      
      IEMFValueProperty featureProperty = new EMFValuePropertyDecorator(property, featurePath.getFeaturePath()[0]);
      for (int i = 1; i < featurePath.getFeaturePath().length - 1; i++) {
        featureProperty = featureProperty.value(featurePath.getFeaturePath()[i]);
      }
      return featureProperty.set(set(featurePath.getFeaturePath()[(len - 1)]));
    }
    return set(featurePath.getFeaturePath()[(len - 1)]);
  }
  
  public static IEMFListProperty multiList(EStructuralFeature... features)
  {
    IEMFListProperty[] multi = new IEMFListProperty[features.length];
    int i = 0;
    EStructuralFeature[] arrayOfEStructuralFeature = features;int j = features.length;
    for (int i = 0; i < j; i++)
    {
      EStructuralFeature feature = arrayOfEStructuralFeature[i];
      
      multi[(i++)] = list(feature);
    }
    return multiList(multi);
  }
  
  public static IEMFListProperty multiList(FeaturePath rootPath, EStructuralFeature... features)
  {
    IEMFListProperty[] multi = new IEMFListProperty[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(FeaturePath.fromList(p));
    }
    return multiList(multi);
  }
  
  public static IEMFListProperty multiList(FeaturePath... featurePaths)
  {
    IEMFListProperty[] multi = new IEMFListProperty[featurePaths.length];
    int i = 0;
    
    FeaturePath[] arrayOfFeaturePath = featurePaths;int j = featurePaths.length;
    for (int i = 0; i < j; i++)
    {
      FeaturePath path = arrayOfFeaturePath[i];
      
      multi[(i++)] = list(path);
    }
    return multiList(multi);
  }
  
  public static IEMFListProperty multiList(IEMFListProperty... properties)
  {
    return new EMFMultiListProperty(properties);
  }
  
  public static IEMFMapProperty map(EStructuralFeature feature)
  {
    IMapProperty property = new EMFMapProperty(feature);
    return new EMFMapPropertyDecorator(property, feature);
  }
  
  public static IEMFListProperty resource()
  {
    IListProperty property = new EMFResourceContentProperty();
    return new EMFListPropertyDecorator(property, null);
  }
}

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

import org.eclipse.core.databinding.conversion.Converter;
import org.eclipse.emf.ecore.EDataType;
import org.eclipse.emf.ecore.EFactory;

class EMFUpdateListStrategy$1
  extends Converter
{
  EMFUpdateListStrategy$1(EMFUpdateListStrategy paramEMFUpdateListStrategy, Object $anonymous0, Object $anonymous1, EFactory paramEFactory, EDataType paramEDataType)
  {
    super($anonymous0, $anonymous1);
  }
  
  public Object convert(Object fromObject)
  {
    return val$eFactory.createFromString(val$eDataType, (String)fromObject);
  }
}

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

import org.eclipse.core.databinding.conversion.Converter;
import org.eclipse.emf.ecore.EDataType;
import org.eclipse.emf.ecore.EFactory;

class EMFUpdateListStrategy$2
  extends Converter
{
  EMFUpdateListStrategy$2(EMFUpdateListStrategy paramEMFUpdateListStrategy, Object $anonymous0, Object $anonymous1, EFactory paramEFactory, EDataType paramEDataType)
  {
    super($anonymous0, $anonymous1);
  }
  
  public Object convert(Object fromObject)
  {
    return val$eFactory.convertToString(val$eDataType, fromObject);
  }
}

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

import org.eclipse.core.databinding.UpdateListStrategy;
import org.eclipse.core.databinding.conversion.Converter;
import org.eclipse.core.databinding.conversion.IConverter;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EDataType;
import org.eclipse.emf.ecore.EFactory;
import org.eclipse.emf.ecore.EPackage;

public class EMFUpdateListStrategy
  extends UpdateListStrategy
{
  public EMFUpdateListStrategy()
  {
    this(true, POLICY_UPDATE);
  }
  
  public EMFUpdateListStrategy(int updatePolicy)
  {
    this(true, updatePolicy);
  }
  
  public EMFUpdateListStrategy(boolean provideDefaults, int updatePolicy)
  {
    super(provideDefaults, updatePolicy);
  }
  
  protected IConverter createConverter(Object fromType, Object toType)
  {
    if (fromType == String.class)
    {
      if ((toType instanceof EAttribute))
      {
        EAttribute eAttribute = (EAttribute)toType;
        final EDataType eDataType = eAttribute.getEAttributeType();
        final EFactory eFactory = eDataType.getEPackage().getEFactoryInstance();
        new Converter(fromType, toType)
        {
          public Object convert(Object fromObject)
          {
            return eFactory.createFromString(eDataType, (String)fromObject);
          }
        };
      }
    }
    else if (toType == String.class) {
      if ((fromType instanceof EAttribute))
      {
        EAttribute eAttribute = (EAttribute)fromType;
        final EDataType eDataType = eAttribute.getEAttributeType();
        final EFactory eFactory = eDataType.getEPackage().getEFactoryInstance();
        new Converter(fromType, toType)
        {
          public Object convert(Object fromObject)
          {
            return eFactory.convertToString(eDataType, fromObject);
          }
        };
      }
    }
    return super.createConverter(fromType, toType);
  }
}

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

import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.databinding.conversion.Converter;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EDataType;
import org.eclipse.emf.ecore.EFactory;

class EMFUpdateValueStrategy$1
  extends Converter
{
  EMFUpdateValueStrategy$1(EMFUpdateValueStrategy paramEMFUpdateValueStrategy, Object $anonymous0, Object $anonymous1, EAttribute paramEAttribute, EFactory paramEFactory, EDataType paramEDataType)
  {
    super($anonymous0, $anonymous1);
  }
  
  public Object convert(Object fromObject)
  {
    String value = fromObject == null ? null : fromObject.toString();
    if (val$eAttribute.isMany())
    {
      List<Object> result = new ArrayList();
      if (value != null)
      {
        String[] arrayOfString;
        int j = (arrayOfString = value.split(" ")).length;
        for (int i = 0; i < j; i++)
        {
          String element = arrayOfString[i];
          
          result.add(val$eFactory.createFromString(val$eDataType, element));
        }
      }
      return result;
    }
    return val$eFactory.createFromString(val$eDataType, value);
  }
}

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

import java.util.List;
import org.eclipse.core.databinding.conversion.Converter;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EDataType;
import org.eclipse.emf.ecore.EFactory;

class EMFUpdateValueStrategy$2
  extends Converter
{
  EMFUpdateValueStrategy$2(EMFUpdateValueStrategy paramEMFUpdateValueStrategy, Object $anonymous0, Object $anonymous1, EAttribute paramEAttribute, EFactory paramEFactory, EDataType paramEDataType)
  {
    super($anonymous0, $anonymous1);
  }
  
  public Object convert(Object fromObject)
  {
    if (val$eAttribute.isMany())
    {
      StringBuilder result = new StringBuilder();
      for (Object value : (List)fromObject)
      {
        if (result.length() == 0) {
          result.append(' ');
        }
        result.append(val$eFactory.convertToString(val$eDataType, value));
      }
      return result.toString();
    }
    return val$eFactory.convertToString(val$eDataType, fromObject);
  }
}

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

import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.databinding.UpdateValueStrategy;
import org.eclipse.core.databinding.conversion.Converter;
import org.eclipse.core.databinding.conversion.IConverter;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EDataType;
import org.eclipse.emf.ecore.EFactory;
import org.eclipse.emf.ecore.EPackage;

public class EMFUpdateValueStrategy
  extends UpdateValueStrategy
{
  public EMFUpdateValueStrategy()
  {
    this(true, POLICY_UPDATE);
  }
  
  public EMFUpdateValueStrategy(int updatePolicy)
  {
    this(true, updatePolicy);
  }
  
  public EMFUpdateValueStrategy(boolean provideDefaults, int updatePolicy)
  {
    super(provideDefaults, updatePolicy);
  }
  
  protected IConverter createConverter(Object fromType, Object toType)
  {
    if (fromType == String.class)
    {
      if ((toType instanceof EAttribute))
      {
        final EAttribute eAttribute = (EAttribute)toType;
        final EDataType eDataType = eAttribute.getEAttributeType();
        final EFactory eFactory = eDataType.getEPackage().getEFactoryInstance();
        new Converter(fromType, toType)
        {
          public Object convert(Object fromObject)
          {
            String value = fromObject == null ? null : fromObject.toString();
            if (eAttribute.isMany())
            {
              List<Object> result = new ArrayList();
              if (value != null)
              {
                String[] arrayOfString;
                int j = (arrayOfString = value.split(" ")).length;
                for (int i = 0; i < j; i++)
                {
                  String element = arrayOfString[i];
                  
                  result.add(eFactory.createFromString(eDataType, element));
                }
              }
              return result;
            }
            return eFactory.createFromString(eDataType, value);
          }
        };
      }
    }
    else if (toType == String.class) {
      if ((fromType instanceof EAttribute))
      {
        final EAttribute eAttribute = (EAttribute)fromType;
        final EDataType eDataType = eAttribute.getEAttributeType();
        final EFactory eFactory = eDataType.getEPackage().getEFactoryInstance();
        new Converter(fromType, toType)
        {
          public Object convert(Object fromObject)
          {
            if (eAttribute.isMany())
            {
              StringBuilder result = new StringBuilder();
              for (Object value : (List)fromObject)
              {
                if (result.length() == 0) {
                  result.append(' ');
                }
                result.append(eFactory.convertToString(eDataType, value));
              }
              return result.toString();
            }
            return eFactory.convertToString(eDataType, fromObject);
          }
        };
      }
    }
    return super.createConverter(fromType, toType);
  }
}

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

import org.eclipse.core.databinding.observable.list.ListDiff;

class EObjectObservableList$1$1
  implements Runnable
{
  EObjectObservableList$1$1(EObjectObservableList.1 param1, ListDiff paramListDiff) {}
  
  public void run()
  {
    EObjectObservableList.access$0(EObjectObservableList.1.access$0(this$1), val$diff);
  }
}

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

import java.util.Collection;
import org.eclipse.core.databinding.observable.Diffs;
import org.eclipse.core.databinding.observable.Realm;
import org.eclipse.core.databinding.observable.list.ListDiff;
import org.eclipse.core.databinding.observable.list.ListDiffEntry;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.impl.AdapterImpl;

class EObjectObservableList$1
  extends AdapterImpl
{
  EObjectObservableList$1(EObjectObservableList paramEObjectObservableList) {}
  
  public void notifyChanged(Notification notification)
  {
    if ((this$0.eStructuralFeature == notification.getFeature()) && (!notification.isTouch()))
    {
      ListDiff diff;
      ListDiff diff;
      ListDiff diff;
      ListDiff diff;
      ListDiff diff;
      ListDiff diff;
      switch (notification.getEventType())
      {
      case 3: 
        diff = Diffs.createListDiff(Diffs.createListDiffEntry(notification.getPosition(), true, notification.getNewValue()));
        break;
      case 5: 
        Collection<?> newValues = (Collection)notification.getNewValue();
        ListDiffEntry[] listDiffEntries = new ListDiffEntry[newValues.size()];
        int position = notification.getPosition();
        int index = 0;
        for (Object newValue : newValues) {
          listDiffEntries[(index++)] = Diffs.createListDiffEntry(position++, true, newValue);
        }
        diff = Diffs.createListDiff(listDiffEntries);
        break;
      case 4: 
        diff = Diffs.createListDiff(Diffs.createListDiffEntry(notification.getPosition(), false, notification.getOldValue()));
        break;
      case 6: 
        Collection<?> oldValues = (Collection)notification.getOldValue();
        ListDiffEntry[] listDiffEntries = new ListDiffEntry[oldValues.size()];
        int position = notification.getPosition();
        int index = 0;
        for (Object oldValue : oldValues) {
          listDiffEntries[(index++)] = Diffs.createListDiffEntry(position++, false, oldValue);
        }
        diff = Diffs.createListDiff(listDiffEntries);
        break;
      case 1: 
      case 9: 
        ListDiffEntry[] listDiffEntries = new ListDiffEntry[2];
        listDiffEntries[0] = Diffs.createListDiffEntry(notification.getPosition(), false, notification.getOldValue());
        listDiffEntries[1] = Diffs.createListDiffEntry(notification.getPosition(), true, notification.getNewValue());
        diff = Diffs.createListDiff(listDiffEntries);
        break;
      case 7: 
        Object movedValue = notification.getNewValue();
        ListDiffEntry[] listDiffEntries = new ListDiffEntry[2];
        listDiffEntries[0] = Diffs.createListDiffEntry(((Integer)notification.getOldValue()).intValue(), false, movedValue);
        listDiffEntries[1] = Diffs.createListDiffEntry(notification.getPosition(), true, movedValue);
        diff = Diffs.createListDiff(listDiffEntries);
        break;
      case 2: 
        return;
      case 8: 
      default: 
        throw new RuntimeException("unhandled case");
      }
      final ListDiff diff;
      this$0.getRealm().exec(new Runnable()
      {
        public void run()
        {
          EObjectObservableList.access$0(this$0, diff);
        }
      });
    }
  }
}

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

import java.util.Collection;
import java.util.List;
import org.eclipse.core.databinding.observable.Diffs;
import org.eclipse.core.databinding.observable.IObserving;
import org.eclipse.core.databinding.observable.Realm;
import org.eclipse.core.databinding.observable.list.ListDiff;
import org.eclipse.core.databinding.observable.list.ListDiffEntry;
import org.eclipse.core.databinding.observable.list.ObservableList;
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.impl.AdapterImpl;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;

public class EObjectObservableList
  extends ObservableList
  implements IObserving, InternalRawEList
{
  protected EObject eObject;
  protected EStructuralFeature eStructuralFeature;
  protected Adapter listener;
  
  public EObjectObservableList(EObject eObject, EStructuralFeature eStructuralFeature)
  {
    this(Realm.getDefault(), eObject, eStructuralFeature);
  }
  
  public EObjectObservableList(Realm realm, EObject eObject, EStructuralFeature eStructuralFeature)
  {
    super(realm, (EList)eObject.eGet(eStructuralFeature), eStructuralFeature);
    this.eObject = eObject;
    this.eStructuralFeature = eStructuralFeature;
  }
  
  protected void firstListenerAdded()
  {
    listener = new AdapterImpl()
    {
      public void notifyChanged(Notification notification)
      {
        if ((eStructuralFeature == notification.getFeature()) && (!notification.isTouch()))
        {
          ListDiff diff;
          ListDiff diff;
          ListDiff diff;
          ListDiff diff;
          ListDiff diff;
          ListDiff diff;
          switch (notification.getEventType())
          {
          case 3: 
            diff = Diffs.createListDiff(Diffs.createListDiffEntry(notification.getPosition(), true, notification.getNewValue()));
            break;
          case 5: 
            Collection<?> newValues = (Collection)notification.getNewValue();
            ListDiffEntry[] listDiffEntries = new ListDiffEntry[newValues.size()];
            int position = notification.getPosition();
            int index = 0;
            for (Object newValue : newValues) {
              listDiffEntries[(index++)] = Diffs.createListDiffEntry(position++, true, newValue);
            }
            diff = Diffs.createListDiff(listDiffEntries);
            break;
          case 4: 
            diff = Diffs.createListDiff(Diffs.createListDiffEntry(notification.getPosition(), false, notification.getOldValue()));
            break;
          case 6: 
            Collection<?> oldValues = (Collection)notification.getOldValue();
            ListDiffEntry[] listDiffEntries = new ListDiffEntry[oldValues.size()];
            int position = notification.getPosition();
            int index = 0;
            for (Object oldValue : oldValues) {
              listDiffEntries[(index++)] = Diffs.createListDiffEntry(position++, false, oldValue);
            }
            diff = Diffs.createListDiff(listDiffEntries);
            break;
          case 1: 
          case 9: 
            ListDiffEntry[] listDiffEntries = new ListDiffEntry[2];
            listDiffEntries[0] = Diffs.createListDiffEntry(notification.getPosition(), false, notification.getOldValue());
            listDiffEntries[1] = Diffs.createListDiffEntry(notification.getPosition(), true, notification.getNewValue());
            diff = Diffs.createListDiff(listDiffEntries);
            break;
          case 7: 
            Object movedValue = notification.getNewValue();
            ListDiffEntry[] listDiffEntries = new ListDiffEntry[2];
            listDiffEntries[0] = Diffs.createListDiffEntry(((Integer)notification.getOldValue()).intValue(), false, movedValue);
            listDiffEntries[1] = Diffs.createListDiffEntry(notification.getPosition(), true, movedValue);
            diff = Diffs.createListDiff(listDiffEntries);
            break;
          case 2: 
            return;
          case 8: 
          default: 
            throw new RuntimeException("unhandled case");
          }
          final ListDiff diff;
          getRealm().exec(new Runnable()
          {
            public void run()
            {
              fireListChange(diff);
            }
          });
        }
      }
    };
    eObject.eAdapters().add(listener);
  }
  
  protected void lastListenerRemoved()
  {
    eObject.eAdapters().remove(listener);
    listener = null;
  }
  
  public synchronized void dispose()
  {
    if (listener != null)
    {
      eObject.eAdapters().remove(listener);
      listener = null;
    }
    eObject = null;
    eStructuralFeature = null;
    super.dispose();
  }
  
  protected final List<Object> wrappedList()
  {
    return wrappedList;
  }
  
  public Object getObserved()
  {
    return eObject;
  }
  
  public boolean add(Object object)
  {
    checkRealm();
    return wrappedList().add(object);
  }
  
  public void add(int index, Object object)
  {
    checkRealm();
    wrappedList().add(index, object);
  }
  
  public boolean addAll(Collection collection)
  {
    checkRealm();
    return wrappedList().addAll(collection);
  }
  
  public boolean addAll(int index, Collection collection)
  {
    checkRealm();
    return wrappedList().addAll(index, collection);
  }
  
  public Object set(int index, Object element)
  {
    checkRealm();
    return wrappedList().set(index, element);
  }
  
  public Object remove(int index)
  {
    checkRealm();
    return wrappedList.remove(index);
  }
  
  public boolean remove(Object element)
  {
    checkRealm();
    return wrappedList.remove(element);
  }
  
  public boolean removeAll(Collection collection)
  {
    checkRealm();
    return wrappedList().removeAll(collection);
  }
  
  public boolean retainAll(Collection collection)
  {
    checkRealm();
    return wrappedList().retainAll(collection);
  }
  
  public void clear()
  {
    checkRealm();
    wrappedList.clear();
  }
  
  public Object move(int newPosition, int oldPosition)
  {
    checkRealm();
    return ((EList)wrappedList).move(newPosition, oldPosition);
  }
  
  public void move(int newPosition, Object object)
  {
    move(newPosition, indexOf(object));
  }
  
  public String toString()
  {
    StringBuilder result = new StringBuilder(getClass().getName());
    result.append('@');
    result.append(Integer.toHexString(hashCode()));
    
    result.append(" (eObject:");
    result.append(eObject);
    result.append(")");
    
    result.append(" (eStructuralFeature: ");
    result.append(eStructuralFeature);
    result.append(")");
    
    result.append(" (wrappedList: ");
    result.append(wrappedList);
    result.append(")");
    
    return result.toString();
  }
}

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

import org.eclipse.core.databinding.observable.map.MapDiff;

class EObjectObservableMap$1$1
  implements Runnable
{
  EObjectObservableMap$1$1(EObjectObservableMap.1 param1, MapDiff paramMapDiff) {}
  
  public void run()
  {
    EObjectObservableMap.access$0(EObjectObservableMap.1.access$0(this$1), val$diff);
  }
}

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

import org.eclipse.core.databinding.observable.Diffs;
import org.eclipse.core.databinding.observable.Realm;
import org.eclipse.core.databinding.observable.map.MapDiff;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.impl.AdapterImpl;

class EObjectObservableMap$1
  extends AdapterImpl
{
  EObjectObservableMap$1(EObjectObservableMap paramEObjectObservableMap) {}
  
  public void notifyChanged(Notification notification)
  {
    if ((this$0.eStructuralFeature == notification.getFeature()) && (!notification.isTouch()))
    {
      final MapDiff diff = Diffs.createMapDiffSingleChange(
        notification.getNotifier(), 
        notification.getOldValue(), 
        notification.getNewValue());
      this$0.getRealm().exec(new Runnable()
      {
        public void run()
        {
          EObjectObservableMap.access$0(this$0, diff);
        }
      });
    }
  }
}

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

import org.eclipse.core.databinding.observable.Diffs;
import org.eclipse.core.databinding.observable.Realm;
import org.eclipse.core.databinding.observable.map.ComputedObservableMap;
import org.eclipse.core.databinding.observable.map.MapDiff;
import org.eclipse.core.databinding.observable.set.IObservableSet;
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.impl.AdapterImpl;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.util.ExtendedMetaData;

public class EObjectObservableMap
  extends ComputedObservableMap
{
  protected EStructuralFeature eStructuralFeature;
  private Adapter elementListener = new AdapterImpl()
  {
    public void notifyChanged(Notification notification)
    {
      if ((eStructuralFeature == notification.getFeature()) && (!notification.isTouch()))
      {
        final MapDiff diff = Diffs.createMapDiffSingleChange(
          notification.getNotifier(), 
          notification.getOldValue(), 
          notification.getNewValue());
        getRealm().exec(new Runnable()
        {
          public void run()
          {
            fireMapChange(diff);
          }
        });
      }
    }
  };
  
  public EObjectObservableMap(IObservableSet objects, EStructuralFeature feature)
  {
    super(objects);
    eStructuralFeature = feature;
  }
  
  protected void hookListener(Object domainElement)
  {
    ((EObject)domainElement).eAdapters().add(elementListener);
  }
  
  protected void unhookListener(Object domainElement)
  {
    ((EObject)domainElement).eAdapters().remove(elementListener);
  }
  
  protected Object doGet(Object key)
  {
    EObject eObject = (EObject)key;
    return ExtendedMetaData.INSTANCE.getAffiliation(eObject.eClass(), eStructuralFeature) == null ? null : eObject.eGet(eStructuralFeature);
  }
  
  protected Object doPut(Object key, Object value)
  {
    EObject eObject = (EObject)key;
    Object result = eObject.eGet(eStructuralFeature);
    eObject.eSet(eStructuralFeature, value);
    return result;
  }
}

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

import org.eclipse.core.databinding.observable.value.ValueDiff;

class EObjectObservableValue$1$1
  implements Runnable
{
  EObjectObservableValue$1$1(EObjectObservableValue.1 param1, ValueDiff paramValueDiff) {}
  
  public void run()
  {
    EObjectObservableValue.access$0(EObjectObservableValue.1.access$0(this$1), val$diff);
  }
}

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

import org.eclipse.core.databinding.observable.Diffs;
import org.eclipse.core.databinding.observable.Realm;
import org.eclipse.core.databinding.observable.value.ValueDiff;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.impl.AdapterImpl;

class EObjectObservableValue$1
  extends AdapterImpl
{
  EObjectObservableValue$1(EObjectObservableValue paramEObjectObservableValue) {}
  
  public void notifyChanged(Notification notification)
  {
    if ((this$0.eStructuralFeature == notification.getFeature()) && (!n
1 2 3 4

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