diff options
author | Brian Vosburgh | 2013-01-28 20:16:59 +0000 |
---|---|---|
committer | Brian Vosburgh | 2013-01-28 21:15:19 +0000 |
commit | 1a911cb6ed7c832339ea3e14dc5ade7b8dcf0810 (patch) | |
tree | 64b1e4638717aca1ab0336af8558922e51b569a3 /common/tests/org.eclipse.jpt.common.ui.tests | |
parent | f7b7e7ff48ae689d470a51e42473d01bebdf4ec8 (diff) | |
download | webtools.dali-1a911cb6ed7c832339ea3e14dc5ade7b8dcf0810.tar.gz webtools.dali-1a911cb6ed7c832339ea3e14dc5ade7b8dcf0810.tar.xz webtools.dali-1a911cb6ed7c832339ea3e14dc5ade7b8dcf0810.zip |
clean up utility classes (iterables and iterators in particular); add
lots of Transformers
Diffstat (limited to 'common/tests/org.eclipse.jpt.common.ui.tests')
-rw-r--r-- | common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/jface/DelegatingTreeContentProviderUiTest.java | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/jface/DelegatingTreeContentProviderUiTest.java b/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/jface/DelegatingTreeContentProviderUiTest.java index a5832fc4e8..782e353a5e 100644 --- a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/jface/DelegatingTreeContentProviderUiTest.java +++ b/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/jface/DelegatingTreeContentProviderUiTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2012 Oracle. All rights reserved. + * Copyright (c) 2008, 2013 Oracle. 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. @@ -29,8 +29,8 @@ import org.eclipse.jpt.common.ui.internal.jface.ItemTreeStateProviderManager; import org.eclipse.jpt.common.ui.jface.ItemTreeContentProvider; import org.eclipse.jpt.common.ui.jface.ItemTreeContentProviderFactory; import org.eclipse.jpt.common.utility.internal.collection.CollectionTools; +import org.eclipse.jpt.common.utility.internal.iterable.IterableTools; import org.eclipse.jpt.common.utility.internal.iterable.LiveCloneListIterable; -import org.eclipse.jpt.common.utility.internal.iterable.TransformationIterable; import org.eclipse.jpt.common.utility.internal.model.AbstractModel; import org.eclipse.jpt.common.utility.internal.model.value.CompositeCollectionValueModel; import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter; @@ -518,15 +518,13 @@ public class DelegatingTreeContentProviderUiTest } public Iterable<Child> getNestlessChildren() { - return new TransformationIterable<TreeNode, Child>(this.getChildren()) { - @Override - protected Child transform(TreeNode next) { - if (next instanceof Nest) { - return ((Nest) next).getChild(); - } - return (Child) next; - } - }; + Transformer<TreeNode, Child> transformer = new TransformerAdapter<TreeNode, Child>() { + @Override + public Child transform(TreeNode node) { + return (node instanceof Nest) ? ((Nest) node).getChild() : (Child) node; + } + }; + return IterableTools.transform(this.getChildren(), transformer); } } |