|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdsto.dfc.swt.viewers.SelectionBinding
public class SelectionBinding
Binds the selected entry/entries of a JFace Viewer to the value of a property on a target object.
Subclasses may override
getTargetValue(IStructuredSelection)
and
translate(Object)
to customize behaviour.
Field Summary | |
---|---|
protected static int |
ARRAY
|
protected static int |
LIST
|
protected Class |
multiValueType
The container type for multi-value properties (null for single value) |
protected Class |
propertyType
The type of the property, or type of an element for multi-value properties |
protected static int |
SINGLE
|
protected Object |
target
|
protected String |
targetProperty
|
protected int |
targetType
One of the TYPE_* constants. |
protected org.eclipse.jface.viewers.Viewer |
viewer
|
Constructor Summary | |
---|---|
SelectionBinding(org.eclipse.jface.viewers.Viewer viewer,
Object target,
String targetProperty)
|
|
SelectionBinding(org.eclipse.jface.viewers.Viewer viewer,
Object target,
String targetProperty,
boolean allowMultipleValues)
Create a new instance. |
Method Summary | |
---|---|
protected boolean |
compatibleType(Object value)
Test if a value is a compatible type for the property. |
void |
dispose()
|
protected Object |
getTargetValue(org.eclipse.jface.viewers.IStructuredSelection selection)
Get the value that should be applied to the target for a given selection. |
void |
selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent event)
|
protected Object |
translate(Object selectedObject)
Translate a selected value into the form that the target object expects. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final int SINGLE
protected static final int LIST
protected static final int ARRAY
protected org.eclipse.jface.viewers.Viewer viewer
protected Object target
protected String targetProperty
protected int targetType
protected Class multiValueType
protected Class propertyType
Constructor Detail |
---|
public SelectionBinding(org.eclipse.jface.viewers.Viewer viewer, Object target, String targetProperty)
public SelectionBinding(org.eclipse.jface.viewers.Viewer viewer, Object target, String targetProperty, boolean allowMultipleValues)
viewer
- The viewer to read the selection from.target
- The target object to set the value on.targetProperty
- The property (with a setter method) to copy the
value to.allowMultipleValues
- True if multiple values can be passed to
the property. If true, the property must must be compatible with either
java.util.List or Object [].Method Detail |
---|
public void dispose()
protected Object getTargetValue(org.eclipse.jface.viewers.IStructuredSelection selection)
translate(Object)
protected boolean compatibleType(Object value)
protected Object translate(Object selectedObject)
public void selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent event)
selectionChanged
in interface org.eclipse.jface.viewers.ISelectionChangedListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |