Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 128120 Details for
Bug 234496
[DataBinding] ObservableValueEditingSupport: option to use IObservableFactory instead of subclassing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch
clipboard.txt (text/plain), 7.11 KB, created by
Matthew Hall
on 2009-03-09 18:51:27 EDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Matthew Hall
Created:
2009-03-09 18:51:27 EDT
Size:
7.11 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jface.databinding >Index: src/org/eclipse/jface/databinding/viewers/ObservableValueEditingSupport.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/viewers/ObservableValueEditingSupport.java,v >retrieving revision 1.3 >diff -u -r1.3 ObservableValueEditingSupport.java >--- src/org/eclipse/jface/databinding/viewers/ObservableValueEditingSupport.java 2 Apr 2008 20:44:13 -0000 1.3 >+++ src/org/eclipse/jface/databinding/viewers/ObservableValueEditingSupport.java 9 Mar 2009 22:51:32 -0000 >@@ -7,6 +7,7 @@ > * > * Contributors: > * IBM Corporation - initial API and implementation >+ * Matthew Hall - bug 234496 > *******************************************************************************/ > > package org.eclipse.jface.databinding.viewers; >@@ -15,6 +16,7 @@ > import org.eclipse.core.databinding.DataBindingContext; > import org.eclipse.core.databinding.UpdateValueStrategy; > import org.eclipse.core.databinding.observable.value.IObservableValue; >+import org.eclipse.core.databinding.property.value.IValueProperty; > import org.eclipse.core.runtime.Assert; > import org.eclipse.jface.viewers.CellEditor; > import org.eclipse.jface.viewers.ColumnViewer; >@@ -32,6 +34,46 @@ > */ > public abstract class ObservableValueEditingSupport extends EditingSupport { > /** >+ * Returns an ObservableValueEditingSupport instance which binds the given >+ * cell editor property to the given element property. >+ * >+ * @param viewer >+ * the column viewer >+ * @param dbc >+ * the DataBindingContext used for binding between the cell >+ * editor and the viewer element. >+ * @param cellEditor >+ * the cell editor >+ * @param cellEditorProperty >+ * the cell editor property to be bound to the element. >+ * @param elementProperty >+ * the element property to be bound to the cell editor. >+ * @return an ObservableValueEditingSupport instance using the given >+ * arguments. >+ * @since 1.3 >+ */ >+ public static EditingSupport create(ColumnViewer viewer, >+ DataBindingContext dbc, final CellEditor cellEditor, >+ final IValueProperty cellEditorProperty, >+ final IValueProperty elementProperty) { >+ return new ObservableValueEditingSupport(viewer, dbc) { >+ protected IObservableValue doCreateCellEditorObservable( >+ CellEditor cellEditor) { >+ return cellEditorProperty.observe(cellEditor); >+ } >+ >+ protected IObservableValue doCreateElementObservable( >+ Object element, ViewerCell cell) { >+ return elementProperty.observe(element); >+ } >+ >+ protected CellEditor getCellEditor(Object element) { >+ return cellEditor; >+ } >+ }; >+ } >+ >+ /** > * Maintains references to the instances currently imployed while editing. > * Will be <code>null</code> when not editing. > */ >@@ -145,9 +187,9 @@ > > /** > * Creates a new binding for the provided <code>target</code> and >- * <code>model</code>. Default >- * {@link UpdateValueStrategy value update strategies} are used with the >- * target to model updating on {@link UpdateValueStrategy#POLICY_CONVERT}. >+ * <code>model</code>. Default {@link UpdateValueStrategy value update >+ * strategies} are used with the target to model updating on >+ * {@link UpdateValueStrategy#POLICY_CONVERT}. > * > * @param target > * @param model >Index: src/org/eclipse/jface/internal/databinding/viewers/CellEditorControlProperty.java >=================================================================== >RCS file: src/org/eclipse/jface/internal/databinding/viewers/CellEditorControlProperty.java >diff -N src/org/eclipse/jface/internal/databinding/viewers/CellEditorControlProperty.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/jface/internal/databinding/viewers/CellEditorControlProperty.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,45 @@ >+/******************************************************************************* >+ * Copyright (c) 2009 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 234496) >+ ******************************************************************************/ >+ >+package org.eclipse.jface.internal.databinding.viewers; >+ >+import org.eclipse.core.databinding.property.INativePropertyListener; >+import org.eclipse.core.databinding.property.ISimplePropertyListener; >+import org.eclipse.core.databinding.property.value.SimpleValueProperty; >+import org.eclipse.jface.viewers.CellEditor; >+import org.eclipse.swt.widgets.Control; >+ >+/** >+ * @since 3.3 >+ * >+ */ >+public class CellEditorControlProperty extends SimpleValueProperty { >+ public Object getValueType() { >+ return Control.class; >+ } >+ >+ protected Object doGetValue(Object source) { >+ return ((CellEditor) source).getControl(); >+ } >+ >+ protected void doSetValue(Object source, Object value) { >+ throw new UnsupportedOperationException(); >+ } >+ >+ public INativePropertyListener adaptListener( >+ ISimplePropertyListener listener) { >+ return null; >+ } >+ >+ public String toString() { >+ return super.toString(); >+ } >+} >Index: src/org/eclipse/jface/databinding/viewers/CellEditorProperties.java >=================================================================== >RCS file: src/org/eclipse/jface/databinding/viewers/CellEditorProperties.java >diff -N src/org/eclipse/jface/databinding/viewers/CellEditorProperties.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/jface/databinding/viewers/CellEditorProperties.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,34 @@ >+/******************************************************************************* >+ * Copyright (c) 2009 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 234496) >+ ******************************************************************************/ >+ >+package org.eclipse.jface.databinding.viewers; >+ >+import org.eclipse.core.databinding.property.value.IValueProperty; >+import org.eclipse.jface.internal.databinding.viewers.CellEditorControlProperty; >+import org.eclipse.jface.viewers.CellEditor; >+ >+/** >+ * A factory for creating properties of JFace {@link CellEditor cell editors}. >+ * >+ * @since 1.3 >+ */ >+public class CellEditorProperties { >+ /** >+ * Returns a value property for observing the control of a >+ * {@link CellEditor}. >+ * >+ * @return a value property for observing the control of a >+ * {@link CellEditor}. >+ */ >+ public static IValueProperty control() { >+ return new CellEditorControlProperty(); >+ } >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 234496
:
102521
|
102527
|
127953
| 128120 |
128121
|
128130