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