diff options
author | kmoore | 2011-10-25 20:03:46 +0000 |
---|---|---|
committer | kmoore | 2011-10-25 20:03:46 +0000 |
commit | 9883f7847944de8edce03262a2c5e0cb9f4c1450 (patch) | |
tree | d07381b38a25efeb3a4a736513efb833ae076c28 /common/plugins/org.eclipse.jpt.common.utility | |
parent | 81b7969ef3daad206ef19c295a2449dcf4e7092e (diff) | |
download | webtools.dali-9883f7847944de8edce03262a2c5e0cb9f4c1450.tar.gz webtools.dali-9883f7847944de8edce03262a2c5e0cb9f4c1450.tar.xz webtools.dali-9883f7847944de8edce03262a2c5e0cb9f4c1450.zip |
revert fix for bug 310720 as it was causing other worse IndexOutOfBounds exceptions
Diffstat (limited to 'common/plugins/org.eclipse.jpt.common.utility')
2 files changed, 2 insertions, 42 deletions
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/SingleAspectChangeSupport.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/SingleAspectChangeSupport.java index f4641d1253..ef13a67927 100644 --- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/SingleAspectChangeSupport.java +++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/SingleAspectChangeSupport.java @@ -84,7 +84,7 @@ public class SingleAspectChangeSupport } } - protected void check(Class<? extends EventListener> listenerClass, String aspectName) { + private void check(Class<? extends EventListener> listenerClass, String aspectName) { this.check(listenerClass); if ( ! aspectName.equals(this.validAspectName)) { throw new IllegalArgumentException( diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/ItemPropertyListValueModelAdapter.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/ItemPropertyListValueModelAdapter.java index e464360242..870a36590f 100644 --- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/ItemPropertyListValueModelAdapter.java +++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/ItemPropertyListValueModelAdapter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2011 Oracle. All rights reserved. + * Copyright (c) 2007, 2009 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. @@ -10,15 +10,8 @@ package org.eclipse.jpt.common.utility.internal.model.value; import java.util.Arrays; -import java.util.EventListener; -import java.util.EventObject; -import org.eclipse.jpt.common.utility.internal.CollectionTools; -import org.eclipse.jpt.common.utility.internal.model.ChangeSupport; -import org.eclipse.jpt.common.utility.internal.model.SingleAspectChangeSupport; import org.eclipse.jpt.common.utility.model.Model; -import org.eclipse.jpt.common.utility.model.event.ListReplaceEvent; import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent; -import org.eclipse.jpt.common.utility.model.listener.ListChangeListener; import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener; import org.eclipse.jpt.common.utility.model.value.CollectionValueModel; import org.eclipse.jpt.common.utility.model.value.ListValueModel; @@ -88,37 +81,4 @@ public class ItemPropertyListValueModelAdapter<E> } } - /** - * bug 310720 - * Override to just fire an itemReplaced event instead of a listChanged event. - * An aspect of the item as changed, so no reason to say that the entire list has changed. - * Added a LocalChangeSupport so that I can fire a ListReplacedEvent for an old list - * and new list containing the same item. - */ - @Override - protected void itemAspectChanged(EventObject event) { - Object item = event.getSource(); - this.getChangeSupport().fireItemsReplaced( - new ListReplaceEvent(this, LIST_VALUES, CollectionTools.indexOf(this.listHolder, item), item, item)); - } - - @Override - protected ChangeSupport buildChangeSupport() { - return new LocalChangeSupport(this, ListChangeListener.class, ListValueModel.LIST_VALUES); - } - - private class LocalChangeSupport extends SingleAspectChangeSupport { - public LocalChangeSupport(Model source, Class<? extends EventListener> validListenerClass, String validAspectName) { - super(source, validListenerClass, validAspectName); - } - @Override - public boolean fireItemsReplaced(ListReplaceEvent event) { - this.check(LIST_CHANGE_LISTENER_CLASS, event.getListName()); - if (event.getItemsSize() != 0) { - this.fireItemsReplaced_(event); - return true; - } - return false; - } - } } |