1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-04 06:45:43 +02:00

[213353] Wrong Enablement of Move Up/Down on Filter Pools

https://bugs.eclipse.org/bugs/show_bug.cgi?id=213353
This commit is contained in:
David Dykstal 2008-05-16 18:57:41 +00:00
parent 0194c00e49
commit 6a94b3aeb6
2 changed files with 17 additions and 5 deletions

View file

@ -13,6 +13,7 @@
*
* Contributors:
* David Dykstal (IBM) - [197036] fixed parent references and names so that delete references would function correctly
* David Dykstal (IBM) - [213353] fix move of filter pool references
*******************************************************************************/
package org.eclipse.rse.internal.core.filters;
@ -29,6 +30,7 @@ import org.eclipse.rse.core.filters.ISystemFilterPoolReference;
import org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManager;
import org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManagerProvider;
import org.eclipse.rse.core.filters.ISystemFilterReference;
import org.eclipse.rse.core.model.IRSEPersistableContainer;
import org.eclipse.rse.core.references.IRSEBasePersistableReferencingObject;
import org.eclipse.rse.core.subsystems.ISubSystem;
import org.eclipse.rse.internal.references.SystemPersistableReferenceManager;
@ -384,14 +386,17 @@ public class SystemFilterPoolReferenceManager extends SystemPersistableReference
* moved up in the list.
*/
public void moveSystemFilterPoolReference(ISystemFilterPoolReference filterPoolRef, int pos) {
int oldPos = super.getReferencingObjectPosition(filterPoolRef);
super.moveReferencingObjectPosition(pos, filterPoolRef);
int oldPos = getReferencingObjectPosition(filterPoolRef);
moveReferencingObjectPosition(pos, filterPoolRef);
invalidateFilterPoolReferencesCache();
if (fireEvents && (caller != null) && !noEvents) {
ISystemFilterPoolReference[] refs = new ISystemFilterPoolReference[1];
refs[0] = filterPoolRef;
caller.filterEventFilterPoolReferencesRePositioned(refs, pos - oldPos);
}
if (caller instanceof IRSEPersistableContainer) {
((IRSEPersistableContainer) caller).setDirty(true);
}
}
/**

View file

@ -12,7 +12,7 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
* {Name} (company) - description of contribution.
* David Dykstal (IBM) - [213353] fix move of filter pool references within its container
*******************************************************************************/
package org.eclipse.rse.internal.references;
@ -207,12 +207,19 @@ public class SystemPersistableReferenceManager implements IRSEBasePersistableRef
/**
* Move the given referencing object to a new zero-based position in the list.
* This does not call back or send any events nor does it mark anything dirty.
* @param newPosition New zero-based position
* @param object The referencing object to move
*/
public void moveReferencingObjectPosition(int newPosition, IRSEBasePersistableReferencingObject object) {
// List list = internalGetList();
//FIXME list.move(newPosition, object);
int oldPosition = referencingObjectList.indexOf(object);
if (oldPosition >= 0) {
if (oldPosition != newPosition) {
referencingObjectList.remove(oldPosition);
referencingObjectList.add(newPosition, object);
invalidateCache();
}
}
}
/**