| 1 |
/** |
| 2 |
* Copyright (c) 2008, 2009 Matthew Hall and others. |
| 3 |
* All rights reserved. This program and the accompanying materials |
| 4 |
* are made available under the terms of the Eclipse Public License v2.0 |
| 5 |
* which accompanies this distribution, and is available at |
| 6 |
* http://www.eclipse.org/legal/epl-v20.html |
| 7 |
* |
| 8 |
* Contributors: |
| 9 |
* Matthew Hall - initial API and implementation (bug 195222) |
| 10 |
* Tom Schindl - port to EMF in bug 295683 |
| 11 |
*/ |
| 12 |
|
| 13 |
package org.eclipse.emf.databinding.edit; |
| 14 |
|
| 15 |
import org.eclipse.core.databinding.property.set.ISetProperty; |
| 16 |
|
| 17 |
import org.eclipse.emf.databinding.FeaturePath; |
| 18 |
import org.eclipse.emf.databinding.IEMFSetProperty; |
| 19 |
import org.eclipse.emf.ecore.EStructuralFeature; |
| 20 |
|
| 21 |
/** |
| 22 |
* An {@link ISetProperty} extension interface with convenience methods for |
| 23 |
* creating nested {@link EStructuralFeature} properties. |
| 24 |
* |
| 25 |
* @since 2.6 |
| 26 |
* @noextend This interface is not intended to be extended by clients. |
| 27 |
* @noimplement This interface is not intended to be implemented by clients. |
| 28 |
*/ |
| 29 |
public interface IEMFEditSetProperty extends IEMFEditProperty, IEMFSetProperty { |
| 30 |
/** |
| 31 |
* Returns a master-detail combination of this property and the specified |
| 32 |
* value property. |
| 33 |
* |
| 34 |
* @param feature |
| 35 |
* the value property to observe. |
| 36 |
* @return a master-detail combination of this property and the specified |
| 37 |
* value property. |
| 38 |
* @see #values(IEMFEditValueProperty) |
| 39 |
*/ |
| 40 |
public IEMFEditMapProperty values(EStructuralFeature feature); |
| 41 |
|
| 42 |
/** |
| 43 |
* Returns a master-detail combination of this property and the specified |
| 44 |
* value property. |
| 45 |
* |
| 46 |
* @param featurePath |
| 47 |
* the value property to observe. May be nested e.g. |
| 48 |
* "parent.name" |
| 49 |
* @return a master-detail combination of this property and the specified |
| 50 |
* value property. |
| 51 |
* @see #values(IEMFEditValueProperty) |
| 52 |
*/ |
| 53 |
public IEMFEditMapProperty values(FeaturePath featurePath); |
| 54 |
|
| 55 |
/** |
| 56 |
* Returns a master-detail combination of this property and the specified |
| 57 |
* value property. The returned property will observe the specified value |
| 58 |
* property for all elements observed by this set property, mapping from |
| 59 |
* this set property's elements (keys) to the specified value property's |
| 60 |
* value for each element (values). |
| 61 |
* <p> |
| 62 |
* Example: |
| 63 |
* |
| 64 |
* <pre> |
| 65 |
* // Observes the set-typed "children" property of a Person object, |
| 66 |
* // where the elements are Person objects |
| 67 |
* IEMFEditSetProperty children = EMFEditProperties.set(domain, MyPackage.Literals.PERSON_CHILDREN); |
| 68 |
* // Observes the string-typed "name" property of a Person object |
| 69 |
* IEMFEditValueProperty name = EMFEditProperties.value(domain, MyPackage.Literals.PERSON_NAME); |
| 70 |
* // Observes a map of children objects to their respective names. |
| 71 |
* IEMFEditMapProperty childrenNames = children.values(name); |
| 72 |
* </pre> |
| 73 |
* |
| 74 |
* @param property |
| 75 |
* the detail property to observe |
| 76 |
* @return a master-detail combination of this property and the specified |
| 77 |
* value property. |
| 78 |
*/ |
| 79 |
public IEMFEditMapProperty values(IEMFEditValueProperty property); |
| 80 |
} |