Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 


Eclipse Platform
Release 3.5

org.eclipse.jface.databinding.viewers
Class ObservableValueEditingSupport

java.lang.Object
  extended by 

org.eclipse.jface.viewers.EditingSupport
      extended by 
org.eclipse.jface.databinding.viewers.ObservableValueEditingSupport

public abstract class ObservableValueEditingSupport
extends EditingSupport

EditingSupport using the JFace Data Binding concepts to handle the updating of an element from a CellEditor.

Since:
1.2

Constructor Summary
ObservableValueEditingSupport ( ColumnViewer viewer, DataBindingContext dbc)
          Constructs a new instance with the provided viewer and dbc.
 
Method Summary
protected  boolean canEdit ( Object element)
          Default implementation always returns true.
static  EditingSupport create ( ColumnViewer viewer, DataBindingContext dbc, CellEditor cellEditor, org.eclipse.core.databinding.property.value.IValueProperty cellEditorProperty, org.eclipse.core.databinding.property.value.IValueProperty elementProperty)
          Returns an ObservableValueEditingSupport instance which binds the given cell editor property to the given element property.
protected   Binding createBinding ( IObservableValue target, IObservableValue model)
          Creates a new binding for the provided target and model.
protected abstract   IObservableValue doCreateCellEditorObservable ( CellEditor cellEditor)
          Creates the observable value for the CellEditor.
protected abstract   IObservableValue doCreateElementObservable ( Object element, ViewerCell cell)
          Creates the observable value for the element.
protected   Object getValue ( Object element)
          Default implementation always returns null as this will be handled by the Binding.
protected  void initializeCellEditorValue ( CellEditor cellEditor, ViewerCell cell)
          Creates a Binding between the editor and the element to be edited.
protected  void saveCellEditorValue ( CellEditor cellEditor, ViewerCell cell)
          Updates the model from the target.
protected  void setValue ( Object element, Object value)
          Default implementation does nothing as this will be handled by the Binding.
 
Methods inherited from class org.eclipse.jface.viewers. EditingSupport
getCellEditor, getViewer
 
Methods inherited from class java.lang. Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObservableValueEditingSupport

public ObservableValueEditingSupport(
ColumnViewer viewer,
                                     
DataBindingContext dbc)
Constructs a new instance with the provided viewer and dbc.

Parameters:
viewer - viewer to edit
dbc - dbc to create Bindings
Method Detail

create

public static 
EditingSupport create(
ColumnViewer viewer,
                                    
DataBindingContext dbc,
                                    
CellEditor cellEditor,
                                    org.eclipse.core.databinding.property.value.IValueProperty cellEditorProperty,
                                    org.eclipse.core.databinding.property.value.IValueProperty elementProperty)
Returns an ObservableValueEditingSupport instance which binds the given cell editor property to the given element property.

Parameters:
viewer - the column viewer
dbc - the DataBindingContext used for binding between the cell editor and the viewer element.
cellEditor - the cell editor
cellEditorProperty - the cell editor property to be bound to the element.
elementProperty - the element property to be bound to the cell editor.
Returns:
an ObservableValueEditingSupport instance using the given arguments.
Since:
1.3

canEdit

protected boolean canEdit(
Object element)
Default implementation always returns true.

Specified by:
canEdit in class EditingSupport
Parameters:
element - the model element
Returns:
true if editable
See Also:
EditingSupport.canEdit(java.lang.Object)

getValue

protected 
Object getValue(
Object element)
Default implementation always returns null as this will be handled by the Binding.

Specified by:
getValue in class EditingSupport
Parameters:
element - the model element
Returns:
the value shown
See Also:
EditingSupport.getValue(java.lang.Object)

setValue

protected void setValue(
Object element,
                        
Object value)
Default implementation does nothing as this will be handled by the Binding.

Specified by:
setValue in class EditingSupport
Parameters:
element - the model element
value - the new value
See Also:
EditingSupport.setValue(java.lang.Object, java.lang.Object)

initializeCellEditorValue

protected final void initializeCellEditorValue(
CellEditor cellEditor,
                                               
ViewerCell cell)
Creates a Binding between the editor and the element to be edited. Invokes doCreateCellEditorObservable(CellEditor), doCreateElementObservable(Object, ViewerCell), and then createBinding(IObservableValue, IObservableValue).

Overrides:
initializeCellEditorValue in class EditingSupport
Parameters:
cellEditor - the cell editor
cell - the cell the editor is working for

doCreateCellEditorObservable

protected abstract 
IObservableValue doCreateCellEditorObservable(
CellEditor cellEditor)
Creates the observable value for the CellEditor.

Parameters:
cellEditor -
Returns:
observable value

doCreateElementObservable

protected abstract 
IObservableValue doCreateElementObservable(
Object element,
                                                              
ViewerCell cell)
Creates the observable value for the element.

Parameters:
element -
cell -
Returns:
observable value

createBinding

protected 
Binding createBinding(
IObservableValue target,
                                
IObservableValue model)
Creates a new binding for the provided target and model. Default value update strategies are used with the target to model updating on UpdateValueStrategy.POLICY_CONVERT.

Parameters:
target -
model -
Returns:
binding

saveCellEditorValue

protected final void saveCellEditorValue(
CellEditor cellEditor,
                                         
ViewerCell cell)
Updates the model from the target.

Overrides:
saveCellEditorValue in class EditingSupport
Parameters:
cellEditor - the cell-editor
cell - the cell the editor is working for

Eclipse Platform
Release 3.5

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire