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 124740 Details for
Bug 263714
[DataBinding] IListProperty.lists(IListProperty)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Unfinished draft
clipboard.txt (text/plain), 6.21 KB, created by
Matthew Hall
on 2009-02-04 18:32:40 EST
(
hide
)
Description:
Unfinished draft
Filename:
MIME Type:
Creator:
Matthew Hall
Created:
2009-02-04 18:32:40 EST
Size:
6.21 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.core.databinding >Index: src/org/eclipse/core/databinding/property/list/IListProperty.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.core.databinding/src/org/eclipse/core/databinding/property/list/IListProperty.java,v >retrieving revision 1.2 >diff -u -r1.2 IListProperty.java >--- src/org/eclipse/core/databinding/property/list/IListProperty.java 20 Jan 2009 23:21:25 -0000 1.2 >+++ src/org/eclipse/core/databinding/property/list/IListProperty.java 4 Feb 2009 23:27:42 -0000 >@@ -98,6 +98,19 @@ > public IObservableList observeDetail(IObservableValue master); > > /** >+ * Returns an observable list on the master observable's realm which >+ * concatenates the elements of this list property for each element in the >+ * master observable. >+ * >+ * @param master >+ * the master observable >+ * @return an observable list on the master observable's realm which >+ * concatenates the elements of this property for each element in >+ * the master observable. >+ */ >+ public IObservableList observeDetail(IObservableList master); >+ >+ /** > * Returns the nested combination of this property and the specified detail > * value property. Note that because this property is a projection of value > * properties over a list, the only modification supported is through the >@@ -111,4 +124,18 @@ > * properties > */ > public IListProperty values(IValueProperty detailValue); >+ >+ /** >+ * Returns the nested combination of this property and the specified detail >+ * list property. Note that because this property is a projection of list >+ * properties over a list, the only modifications supported is through the >+ * {@link IObservableList#set(int, Object)} method. Modifications made >+ * through the returned property are delegated to the detail property for >+ * the master element to which that index belongs. >+ * >+ * @param detailList >+ * @return the nested combination of the master list and detail list >+ * properties >+ */ >+ public IListProperty lists(IListProperty detailList); > } >Index: src/org/eclipse/core/databinding/property/list/ListProperty.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.core.databinding/src/org/eclipse/core/databinding/property/list/ListProperty.java,v >retrieving revision 1.2 >diff -u -r1.2 ListProperty.java >--- src/org/eclipse/core/databinding/property/list/ListProperty.java 20 Jan 2009 23:21:25 -0000 1.2 >+++ src/org/eclipse/core/databinding/property/list/ListProperty.java 4 Feb 2009 23:27:42 -0000 >@@ -15,10 +15,12 @@ > import org.eclipse.core.databinding.observable.IObservable; > import org.eclipse.core.databinding.observable.Realm; > import org.eclipse.core.databinding.observable.list.IObservableList; >+import org.eclipse.core.databinding.observable.list.MultiList; > import org.eclipse.core.databinding.observable.masterdetail.IObservableFactory; > import org.eclipse.core.databinding.observable.masterdetail.MasterDetailObservables; > import org.eclipse.core.databinding.observable.value.IObservableValue; > import org.eclipse.core.databinding.property.value.IValueProperty; >+import org.eclipse.core.internal.databinding.property.ListPropertyDetailListsList; > import org.eclipse.core.internal.databinding.property.ListPropertyDetailValuesList; > > /** >@@ -51,8 +53,16 @@ > return MasterDetailObservables.detailList(master, listFactory(master > .getRealm()), getElementType()); > } >+ >+ public IObservableList observeDetail(IObservableList master) { >+ return new MultiList(); >+ } > > public final IListProperty values(IValueProperty detailValue) { > return new ListPropertyDetailValuesList(this, detailValue); > } >+ >+ public IListProperty lists(IListProperty detailList) { >+ return new ListPropertyDetailListsList(this, detailList); >+ } > } >Index: src/org/eclipse/core/internal/databinding/property/ListPropertyDetailListsList.java >=================================================================== >RCS file: src/org/eclipse/core/internal/databinding/property/ListPropertyDetailListsList.java >diff -N src/org/eclipse/core/internal/databinding/property/ListPropertyDetailListsList.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/core/internal/databinding/property/ListPropertyDetailListsList.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,51 @@ >+/******************************************************************************* >+ * Copyright (c) 2009 IBM Corporation 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: >+ * IBM Corporation - initial API and implementation >+ ******************************************************************************/ >+ >+package org.eclipse.core.internal.databinding.property; >+ >+import org.eclipse.core.databinding.observable.Realm; >+import org.eclipse.core.databinding.observable.list.IObservableList; >+import org.eclipse.core.databinding.property.list.IListProperty; >+import org.eclipse.core.databinding.property.list.ListProperty; >+ >+/** >+ * @since 3.3 >+ * >+ */ >+public class ListPropertyDetailListsList extends ListProperty { >+ private final ListProperty masterProperty; >+ private final IListProperty detailProperty; >+ >+ /** >+ * @param masterProperty >+ * @param detailProperty >+ */ >+ public ListPropertyDetailListsList(ListProperty masterProperty, >+ IListProperty detailProperty) { >+ this.masterProperty = masterProperty; >+ this.detailProperty = detailProperty; >+ } >+ >+ public Object getElementType() { >+ return detailProperty.getElementType(); >+ } >+ >+ public IObservableList observe(Realm realm, Object source) { >+ IObservableList masterList = masterProperty.observe(realm, source); >+ IObservableList detailList = detailProperty.observeDetail(masterList); >+ PropertyObservableUtil.cascadeDispose(detailList, masterList); >+ return detailList; >+ } >+ >+ public String toString() { >+ return masterProperty + " => " + detailProperty; //$NON-NLS-1$ >+ } >+}
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 263714
: 124740