Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 134337 Details for
Bug 274904
[api] support deletion of multiple interaction elements
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
patch
mylyn.remove.invisible.patch.txt (text/plain), 7.48 KB, created by
Shawn Minto
on 2009-05-04 18:36:00 EDT
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Shawn Minto
Created:
2009-05-04 18:36:00 EDT
Size:
7.48 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.mylyn.context.core >Index: src/org/eclipse/mylyn/internal/context/core/InteractionContext.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.context.core/src/org/eclipse/mylyn/internal/context/core/InteractionContext.java,v >retrieving revision 1.21 >diff -u -r1.21 InteractionContext.java >--- src/org/eclipse/mylyn/internal/context/core/InteractionContext.java 22 Jan 2009 01:24:03 -0000 1.21 >+++ src/org/eclipse/mylyn/internal/context/core/InteractionContext.java 4 May 2009 22:32:52 -0000 >@@ -11,10 +11,13 @@ > package org.eclipse.mylyn.internal.context.core; > > import java.util.ArrayList; >+import java.util.Collection; > import java.util.Collections; > import java.util.HashMap; >+import java.util.HashSet; > import java.util.List; > import java.util.Map; >+import java.util.Set; > import java.util.concurrent.ConcurrentHashMap; > import java.util.concurrent.CopyOnWriteArrayList; > >@@ -178,6 +181,29 @@ > return activeNode; > } > >+ public void delete(Collection<IInteractionElement> nodes) { >+ >+ List<InteractionEvent> eventsToRemove = new ArrayList<InteractionEvent>(); >+ Set<String> handlesToRemove = new HashSet<String>(); >+ for (IInteractionElement node : nodes) { >+ handlesToRemove.add(node.getHandleIdentifier()); >+ landmarkMap.remove(node.getHandleIdentifier()); >+ elementMap.remove(node.getHandleIdentifier()); >+ >+ if (activeNode != null && node.getHandleIdentifier().equals(activeNode.getHandleIdentifier())) { >+ activeNode = null; >+ } >+ } >+ >+ for (InteractionEvent event : interactionHistory) { >+ if (handlesToRemove.contains(event.getStructureHandle())) { >+ eventsToRemove.add(event); >+ } >+ } >+ interactionHistory.removeAll(eventsToRemove); >+ >+ } >+ > public void delete(IInteractionElement node) { > landmarkMap.remove(node.getHandleIdentifier()); > elementMap.remove(node.getHandleIdentifier()); >Index: src/org/eclipse/mylyn/internal/context/core/InteractionContextManager.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.context.core/src/org/eclipse/mylyn/internal/context/core/InteractionContextManager.java,v >retrieving revision 1.71 >diff -u -r1.71 InteractionContextManager.java >--- src/org/eclipse/mylyn/internal/context/core/InteractionContextManager.java 1 May 2009 22:59:12 -0000 1.71 >+++ src/org/eclipse/mylyn/internal/context/core/InteractionContextManager.java 4 May 2009 22:32:53 -0000 >@@ -457,6 +457,20 @@ > notifyElementsDeleted(getActiveContext(), Arrays.asList(new IInteractionElement[] { element })); > } > >+ public void deleteElements(Collection<IInteractionElement> elements) { >+ IInteractionContext context = getActiveContext(); >+ >+ if (elements == null || elements.size() == 0 || context == null) { >+ return; >+ } >+ >+ context.delete(elements); >+ >+ if (elements.size() > 0) { >+ notifyElementsDeleted(getActiveContext(), new ArrayList<IInteractionElement>(elements)); >+ } >+ } >+ > private void delete(IInteractionElement element, IInteractionContext context) { > if (element == null || context == null) { > return; >Index: src/org/eclipse/mylyn/internal/context/core/CompositeInteractionContext.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.context.core/src/org/eclipse/mylyn/internal/context/core/CompositeInteractionContext.java,v >retrieving revision 1.11 >diff -u -r1.11 CompositeInteractionContext.java >--- src/org/eclipse/mylyn/internal/context/core/CompositeInteractionContext.java 2 Oct 2008 03:26:16 -0000 1.11 >+++ src/org/eclipse/mylyn/internal/context/core/CompositeInteractionContext.java 4 May 2009 22:32:52 -0000 >@@ -12,6 +12,7 @@ > package org.eclipse.mylyn.internal.context.core; > > import java.util.ArrayList; >+import java.util.Collection; > import java.util.HashMap; > import java.util.HashSet; > import java.util.List; >@@ -109,6 +110,12 @@ > } > } > >+ public void delete(Collection<IInteractionElement> nodes) { >+ for (InteractionContext taskscape : contexts.values()) { >+ taskscape.delete(nodes); >+ } >+ } >+ > public void clear() { > for (InteractionContext taskscape : contexts.values()) { > taskscape.reset(); >Index: src/org/eclipse/mylyn/context/core/IInteractionContextManager.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.context.core/src/org/eclipse/mylyn/context/core/IInteractionContextManager.java,v >retrieving revision 1.12 >diff -u -r1.12 IInteractionContextManager.java >--- src/org/eclipse/mylyn/context/core/IInteractionContextManager.java 12 Sep 2008 04:16:02 -0000 1.12 >+++ src/org/eclipse/mylyn/context/core/IInteractionContextManager.java 4 May 2009 22:32:52 -0000 >@@ -11,6 +11,7 @@ > > package org.eclipse.mylyn.context.core; > >+import java.util.Collection; > import java.util.Set; > > import org.eclipse.mylyn.monitor.core.InteractionEvent; >@@ -47,6 +48,11 @@ > > public abstract void deleteElement(IInteractionElement element); > >+ /** >+ * @since 3.2 >+ */ >+ public abstract void deleteElements(Collection<IInteractionElement> element); >+ > public IInteractionElement getActiveElement(); > > public IInteractionElement processInteractionEvent(InteractionEvent event); >Index: src/org/eclipse/mylyn/context/core/IInteractionContext.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.context.core/src/org/eclipse/mylyn/context/core/IInteractionContext.java,v >retrieving revision 1.13 >diff -u -r1.13 IInteractionContext.java >--- src/org/eclipse/mylyn/context/core/IInteractionContext.java 21 Sep 2008 06:19:29 -0000 1.13 >+++ src/org/eclipse/mylyn/context/core/IInteractionContext.java 4 May 2009 22:32:52 -0000 >@@ -11,6 +11,7 @@ > > package org.eclipse.mylyn.context.core; > >+import java.util.Collection; > import java.util.List; > > import org.eclipse.mylyn.monitor.core.InteractionEvent; >@@ -46,6 +47,11 @@ > > public abstract void delete(IInteractionElement element); > >+ /** >+ * @since 3.2 >+ */ >+ public abstract void delete(Collection<IInteractionElement> elements); >+ > public abstract void updateElementHandle(IInteractionElement element, String newHandle); > > public abstract List<IInteractionElement> getAllElements(); >#P org.eclipse.mylyn.context.ui >Index: src/org/eclipse/mylyn/internal/context/ui/editors/ContextEditorFormPage.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.context.ui/src/org/eclipse/mylyn/internal/context/ui/editors/ContextEditorFormPage.java,v >retrieving revision 1.73 >diff -u -r1.73 ContextEditorFormPage.java >--- src/org/eclipse/mylyn/internal/context/ui/editors/ContextEditorFormPage.java 1 May 2009 22:59:18 -0000 1.73 >+++ src/org/eclipse/mylyn/internal/context/ui/editors/ContextEditorFormPage.java 4 May 2009 22:32:54 -0000 >@@ -391,9 +391,7 @@ > } > } > allToRemove.removeAll(allVisibleElements); >- for (IInteractionElement interactionElement : allToRemove) { >- ContextCore.getContextManager().deleteElement(interactionElement); >- } >+ ContextCore.getContextManager().deleteElements(allToRemove); > } else { > MessageDialog.openInformation(Display.getCurrent().getActiveShell(), > Messages.ContextEditorFormPage_Remove_Invisible,
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 274904
: 134337 |
134338
|
134340