diff options
author | ptessier | 2014-03-10 13:47:40 +0000 |
---|---|---|
committer | ptessier | 2014-03-10 13:47:40 +0000 |
commit | aadd70e59010f365353242f60f7f153d8c19f76d (patch) | |
tree | a21f448e5dbbc23ce79f48d34024af4ade3d252a /plugins/facet/org.eclipse.papyrus.emf.facet.custom.core | |
parent | 4fe7d2ae6560050a49778c51fd3a13ea4b5d6c96 (diff) | |
download | org.eclipse.papyrus-aadd70e59010f365353242f60f7f153d8c19f76d.tar.gz org.eclipse.papyrus-aadd70e59010f365353242f60f7f153d8c19f76d.tar.xz org.eclipse.papyrus-aadd70e59010f365353242f60f7f153d8c19f76d.zip |
Bug 386118 - [EMF Facet] Papyrus should progressively support EMF Facet
0.2
add iterator on the list of loaded Customs
Diffstat (limited to 'plugins/facet/org.eclipse.papyrus.emf.facet.custom.core')
-rw-r--r-- | plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/src/org/eclipse/papyrus/emf/facet/custom/core/internal/CustomizationsDelegatingList.java | 53 |
1 files changed, 45 insertions, 8 deletions
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/src/org/eclipse/papyrus/emf/facet/custom/core/internal/CustomizationsDelegatingList.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/src/org/eclipse/papyrus/emf/facet/custom/core/internal/CustomizationsDelegatingList.java index afcebd1f5c7..f3fb45e2d40 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/src/org/eclipse/papyrus/emf/facet/custom/core/internal/CustomizationsDelegatingList.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/src/org/eclipse/papyrus/emf/facet/custom/core/internal/CustomizationsDelegatingList.java @@ -12,6 +12,7 @@ *******************************************************************************/
package org.eclipse.papyrus.emf.facet.custom.core.internal;
+import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
@@ -41,18 +42,45 @@ public class CustomizationsDelegatingList implements List<Customization> { }
public Iterator<Customization> iterator() {
- // FIXME implement
- throw new UnsupportedOperationException("not implemented"); //$NON-NLS-1$
+ ArrayList<Customization> tmp= new ArrayList<Customization>();
+ for(Iterator<FacetSet> iterator = this.delegate.iterator(); iterator.hasNext();) {
+ FacetSet facetSet = (FacetSet)iterator.next();
+ if( facetSet instanceof Customization){
+ tmp.add((Customization)facetSet);
+ }
+
+ }
+
+
+ return tmp.iterator(); //$NON-NLS-1$
}
public Object[] toArray() {
- // FIXME implement
- throw new UnsupportedOperationException("not implemented"); //$NON-NLS-1$
+ ArrayList<Customization> tmp= new ArrayList<Customization>();
+ for(Iterator<FacetSet> iterator = this.delegate.iterator(); iterator.hasNext();) {
+ FacetSet facetSet = (FacetSet)iterator.next();
+ if( facetSet instanceof Customization){
+ tmp.add((Customization)facetSet);
+ }
+
+ }
+
+
+ return tmp.toArray(); //$NON-NLS-1$
}
public <T> T[] toArray(final T[] a) {
- // FIXME implement
- throw new UnsupportedOperationException("not implemented"); //$NON-NLS-1$
+ ArrayList<Customization> tmp= new ArrayList<Customization>();
+ for(Iterator<FacetSet> iterator = this.delegate.iterator(); iterator.hasNext();) {
+ FacetSet facetSet = (FacetSet)iterator.next();
+ if( facetSet instanceof Customization){
+ tmp.add((Customization)facetSet);
+ }
+
+ }
+
+
+ return tmp.toArray(a);
}
public boolean add(final Customization o) {
@@ -64,8 +92,17 @@ public class CustomizationsDelegatingList implements List<Customization> { }
public boolean containsAll(final Collection<?> c) {
- // FIXME implement
- throw new UnsupportedOperationException("not implemented"); //$NON-NLS-1$
+ ArrayList<Customization> tmp= new ArrayList<Customization>();
+ for(Iterator<FacetSet> iterator = this.delegate.iterator(); iterator.hasNext();) {
+ FacetSet facetSet = (FacetSet)iterator.next();
+ if( facetSet instanceof Customization){
+ tmp.add((Customization)facetSet);
+ }
+
+ }
+
+
+ return tmp.containsAll(c);
}
public boolean addAll(final Collection<? extends Customization> c) {
|