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 102527 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]
CellEditorObservables
patch_234496_2.txt (text/plain), 2.78 KB, created by
Matthew Hall
on 2008-05-28 17:28:22 EDT
(
hide
)
Description:
CellEditorObservables
Filename:
MIME Type:
Creator:
Matthew Hall
Created:
2008-05-28 17:28:22 EDT
Size:
2.78 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jface.databinding >Index: src/org/eclipse/jface/databinding/viewers/CellEditorObservables.java >=================================================================== >RCS file: src/org/eclipse/jface/databinding/viewers/CellEditorObservables.java >diff -N src/org/eclipse/jface/databinding/viewers/CellEditorObservables.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/jface/databinding/viewers/CellEditorObservables.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,62 @@ >+/******************************************************************************* >+ * 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 234496) >+ ******************************************************************************/ >+ >+package org.eclipse.jface.databinding.viewers; >+ >+import org.eclipse.core.databinding.observable.IObservable; >+import org.eclipse.core.databinding.observable.masterdetail.IObservableFactory; >+import org.eclipse.core.databinding.observable.value.IObservableValue; >+import org.eclipse.jface.databinding.swt.SWTObservables; >+import org.eclipse.jface.viewers.CellEditor; >+import org.eclipse.jface.viewers.TextCellEditor; >+import org.eclipse.swt.SWT; >+ >+/** >+ * A factory for creating observables for JFace CellEditors. >+ * >+ * @since 1.3 >+ * @author Matthew Hall >+ */ >+public class CellEditorObservables { >+ /** >+ * Returns an IObservableValue tracking the value of the passed in >+ * CellEditor. >+ * >+ * @param cellEditor >+ * the cell editor to track >+ * @return an IObservableValue tracking the value of the passed in >+ * CellEditor. >+ */ >+ public static IObservableValue observeValue(CellEditor cellEditor) { >+ if (cellEditor instanceof TextCellEditor) >+ return SWTObservables.observeText(cellEditor.getControl(), >+ SWT.Modify); >+ >+ throw new IllegalArgumentException( >+ "CellEditor [" + cellEditor.getClass().getName() + "] is not supported."); //$NON-NLS-1$//$NON-NLS-2$ >+ >+ } >+ >+ /** >+ * Returns an IObservableFactory which produces an IObservableValue which >+ * tracks the value of a target CellEditor. >+ * >+ * @return an IObservableFactory which produces an IObservableValue which >+ * tracks the value of a target CellEditor. >+ */ >+ public static IObservableFactory valueFactory() { >+ return new IObservableFactory() { >+ public IObservable createObservable(Object target) { >+ return observeValue((CellEditor) target); >+ } >+ }; >+ } >+}
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