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 200222 Details for
Bug 352911
support refactoring handles within a context
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]
proof of concept patch
clipboard.txt (text/plain), 5.25 KB, created by
Shawn Minto
on 2011-07-22 16:30:37 EDT
(
hide
)
Description:
proof of concept patch
Filename:
MIME Type:
Creator:
Shawn Minto
Created:
2011-07-22 16:30:37 EDT
Size:
5.25 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.mylyn.context.core >Index: src/org/eclipse/mylyn/internal/context/core/DegreeOfInterest.java >=================================================================== >RCS file: /cvsroot/mylyn/org.eclipse.mylyn.contexts/org.eclipse.mylyn.context.core/src/org/eclipse/mylyn/internal/context/core/DegreeOfInterest.java,v >retrieving revision 1.25 >diff -u -r1.25 DegreeOfInterest.java >--- src/org/eclipse/mylyn/internal/context/core/DegreeOfInterest.java 13 Oct 2009 00:58:03 -0000 1.25 >+++ src/org/eclipse/mylyn/internal/context/core/DegreeOfInterest.java 22 Jul 2011 20:30:21 -0000 >@@ -62,10 +62,37 @@ > this.contextScaling = scaling; > } > >+ public synchronized void updateHandleIdentifier(String newHandle) { >+ List<InteractionEvent> oldInteractionHistory = new ArrayList<InteractionEvent>(events); >+ events.clear(); >+ collapsedEvents.clear(); >+ for (InteractionEvent e : oldInteractionHistory) { >+ e = new InteractionEvent(e.getKind(), e.getStructureKind(), newHandle, e.getOriginId(), e.getNavigation(), >+ e.getDelta(), e.getInterestContribution(), e.getDate(), e.getEndDate()); >+ events.add(e); // NOTE: was events.add(0, event); >+ InteractionEvent last = collapsedEvents.get(e.getKind()); >+ if (last != null) { >+ >+ int numCollapsedEvents = 1; >+ if (last instanceof AggregateInteractionEvent) { >+ numCollapsedEvents = ((AggregateInteractionEvent) last).getNumCollapsedEvents(); >+ } >+ >+ AggregateInteractionEvent aggregateEvent = new AggregateInteractionEvent(e.getKind(), >+ e.getStructureKind(), e.getStructureHandle(), e.getOriginId(), e.getNavigation(), e.getDelta(), >+ last.getInterestContribution() + e.getInterestContribution(), last.getDate(), e.getEndDate(), >+ numCollapsedEvents + 1, eventCountOnCreation); >+ collapsedEvents.put(e.getKind(), aggregateEvent); >+ } else { >+ collapsedEvents.put(e.getKind(), e); >+ } >+ } >+ } >+ > /** > * TODO: make package-visible > */ >- public void addEvent(InteractionEvent event) { >+ public synchronized void addEvent(InteractionEvent event) { > events.add(event); // NOTE: was events.add(0, event); > InteractionEvent last = collapsedEvents.get(event.getKind()); > if (last != null) { >@@ -161,8 +188,8 @@ > > @Override > public String toString() { >- return "(" + "selections: " + selections + ", edits: " + edits + ", commands: " + commands + ", predicted: " //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ >- + predictedBias + ", propagated: " + propagatedBias + ", manipulation: " + manipulationBias + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ >+ return "(" + "selections: " + selections + ", edits: " + edits + ", commands: " + commands + ", predicted: " //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ >+ + predictedBias + ", propagated: " + propagatedBias + ", manipulation: " + manipulationBias + ")"; > } > > /** >Index: src/org/eclipse/mylyn/internal/context/core/InteractionContext.java >=================================================================== >RCS file: /cvsroot/mylyn/org.eclipse.mylyn.contexts/org.eclipse.mylyn.context.core/src/org/eclipse/mylyn/internal/context/core/InteractionContext.java,v >retrieving revision 1.27 >diff -u -r1.27 InteractionContext.java >--- src/org/eclipse/mylyn/internal/context/core/InteractionContext.java 21 Feb 2011 20:07:58 -0000 1.27 >+++ src/org/eclipse/mylyn/internal/context/core/InteractionContext.java 22 Jul 2011 20:30:21 -0000 >@@ -179,10 +179,24 @@ > > public synchronized void updateElementHandle(IInteractionElement element, String newHandle) { > InteractionContextElement currElement = elementMap.remove(element.getHandleIdentifier()); >+ String oldHandle = null; > if (currElement != null) { >+ oldHandle = currElement.getHandleIdentifier(); > currElement.setHandleIdentifier(newHandle); > elementMap.put(newHandle, currElement); > } >+ // XXX IMPROVE THE PERFORMANCE!! >+ if (oldHandle != null) { >+ List<InteractionEvent> oldInteractionHistory = new ArrayList<InteractionEvent>(interactionHistory); >+ interactionHistory.clear(); >+ for (InteractionEvent e : oldInteractionHistory) { >+ if (oldHandle.equals(e.getStructureHandle())) { >+ e = new InteractionEvent(e.getKind(), e.getStructureKind(), newHandle, e.getOriginId(), >+ e.getNavigation(), e.getDelta(), e.getInterestContribution(), e.getDate(), e.getEndDate()); >+ } >+ interactionHistory.add(e); >+ } >+ } > } > > public synchronized IInteractionElement getActiveNode() { >Index: src/org/eclipse/mylyn/internal/context/core/InteractionContextElement.java >=================================================================== >RCS file: /cvsroot/mylyn/org.eclipse.mylyn.contexts/org.eclipse.mylyn.context.core/src/org/eclipse/mylyn/internal/context/core/InteractionContextElement.java,v >retrieving revision 1.13 >diff -u -r1.13 InteractionContextElement.java >--- src/org/eclipse/mylyn/internal/context/core/InteractionContextElement.java 8 Jun 2010 23:06:18 -0000 1.13 >+++ src/org/eclipse/mylyn/internal/context/core/InteractionContextElement.java 22 Jul 2011 20:30:21 -0000 >@@ -57,6 +57,7 @@ > > public void setHandleIdentifier(String handle) { > this.handle = handle; >+ interest.updateHandleIdentifier(handle); > } > > public String getContentType() {
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 352911
: 200222