mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-04 14:55:41 +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:
parent
0194c00e49
commit
6a94b3aeb6
2 changed files with 17 additions and 5 deletions
|
@ -13,6 +13,7 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* David Dykstal (IBM) - [197036] fixed parent references and names so that delete references would function correctly
|
* 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;
|
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.ISystemFilterPoolReferenceManager;
|
||||||
import org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManagerProvider;
|
import org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManagerProvider;
|
||||||
import org.eclipse.rse.core.filters.ISystemFilterReference;
|
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.references.IRSEBasePersistableReferencingObject;
|
||||||
import org.eclipse.rse.core.subsystems.ISubSystem;
|
import org.eclipse.rse.core.subsystems.ISubSystem;
|
||||||
import org.eclipse.rse.internal.references.SystemPersistableReferenceManager;
|
import org.eclipse.rse.internal.references.SystemPersistableReferenceManager;
|
||||||
|
@ -384,14 +386,17 @@ public class SystemFilterPoolReferenceManager extends SystemPersistableReference
|
||||||
* moved up in the list.
|
* moved up in the list.
|
||||||
*/
|
*/
|
||||||
public void moveSystemFilterPoolReference(ISystemFilterPoolReference filterPoolRef, int pos) {
|
public void moveSystemFilterPoolReference(ISystemFilterPoolReference filterPoolRef, int pos) {
|
||||||
int oldPos = super.getReferencingObjectPosition(filterPoolRef);
|
int oldPos = getReferencingObjectPosition(filterPoolRef);
|
||||||
super.moveReferencingObjectPosition(pos, filterPoolRef);
|
moveReferencingObjectPosition(pos, filterPoolRef);
|
||||||
invalidateFilterPoolReferencesCache();
|
invalidateFilterPoolReferencesCache();
|
||||||
if (fireEvents && (caller != null) && !noEvents) {
|
if (fireEvents && (caller != null) && !noEvents) {
|
||||||
ISystemFilterPoolReference[] refs = new ISystemFilterPoolReference[1];
|
ISystemFilterPoolReference[] refs = new ISystemFilterPoolReference[1];
|
||||||
refs[0] = filterPoolRef;
|
refs[0] = filterPoolRef;
|
||||||
caller.filterEventFilterPoolReferencesRePositioned(refs, pos - oldPos);
|
caller.filterEventFilterPoolReferencesRePositioned(refs, pos - oldPos);
|
||||||
}
|
}
|
||||||
|
if (caller instanceof IRSEPersistableContainer) {
|
||||||
|
((IRSEPersistableContainer) caller).setDirty(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
||||||
*
|
*
|
||||||
* Contributors:
|
* 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;
|
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.
|
* 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 newPosition New zero-based position
|
||||||
* @param object The referencing object to move
|
* @param object The referencing object to move
|
||||||
*/
|
*/
|
||||||
public void moveReferencingObjectPosition(int newPosition, IRSEBasePersistableReferencingObject object) {
|
public void moveReferencingObjectPosition(int newPosition, IRSEBasePersistableReferencingObject object) {
|
||||||
// List list = internalGetList();
|
int oldPosition = referencingObjectList.indexOf(object);
|
||||||
//FIXME list.move(newPosition, object);
|
if (oldPosition >= 0) {
|
||||||
|
if (oldPosition != newPosition) {
|
||||||
|
referencingObjectList.remove(oldPosition);
|
||||||
|
referencingObjectList.add(newPosition, object);
|
||||||
|
invalidateCache();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue