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 92521 Details for
Bug 187127
support content assist to work after a comma in the cc list
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]
updated Patch
patch187127.txt (text/plain), 7.12 KB, created by
Frank Becker
on 2008-03-13 17:47:24 EDT
(
hide
)
Description:
updated Patch
Filename:
MIME Type:
Creator:
Frank Becker
Created:
2008-03-13 17:47:24 EDT
Size:
7.12 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.mylyn.tasks.tests >Index: src/org/eclipse/mylyn/tasks/tests/PersonProposalProviderTest.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/PersonProposalProviderTest.java,v >retrieving revision 1.2 >diff -u -r1.2 PersonProposalProviderTest.java >--- src/org/eclipse/mylyn/tasks/tests/PersonProposalProviderTest.java 1 Mar 2008 21:38:41 -0000 1.2 >+++ src/org/eclipse/mylyn/tasks/tests/PersonProposalProviderTest.java 13 Mar 2008 21:41:54 -0000 >@@ -49,6 +49,57 @@ > assertNotNull(result); > assertEquals(1, result.length); > assertEquals("foo", result[0].getContent()); >+ >+ // tests for add more the one Person >+ result = provider.getProposals("f", 1); >+ assertNotNull(result); >+ assertEquals(1, result.length); >+ assertEquals("foo", result[0].getContent()); >+ >+ result = provider.getProposals("f,xx", 1); >+ assertNotNull(result); >+ assertEquals(1, result.length); >+ assertEquals("foo,xx", result[0].getContent()); >+ result = provider.getProposals("f xx", 1); >+ assertNotNull(result); >+ assertEquals(1, result.length); >+ assertEquals("foo xx", result[0].getContent()); >+ result = provider.getProposals("a,xx", 1); >+ assertNotNull(result); >+ assertEquals(0, result.length); >+ >+ result = provider.getProposals("xx,f", 4); >+ assertNotNull(result); >+ assertEquals(1, result.length); >+ assertEquals("xx,foo", result[0].getContent()); >+ result = provider.getProposals("xx f", 4); >+ assertNotNull(result); >+ assertEquals(1, result.length); >+ assertEquals("xx foo", result[0].getContent()); >+ result = provider.getProposals("xx,a", 4); >+ assertNotNull(result); >+ assertEquals(0, result.length); >+ >+ result = provider.getProposals("xx,f,yy", 4); >+ assertNotNull(result); >+ assertEquals(1, result.length); >+ assertEquals("xx,foo,yy", result[0].getContent()); >+ result = provider.getProposals("xx f yy", 4); >+ assertNotNull(result); >+ assertEquals(1, result.length); >+ assertEquals("xx foo yy", result[0].getContent()); >+ result = provider.getProposals("xx,a,yy", 4); >+ assertNotNull(result); >+ assertEquals(0, result.length); >+ >+ result = provider.getProposals("xx,,yy", 3); >+ assertNotNull(result); >+ assertEquals(1, result.length); >+ assertEquals("xx,foo,yy", result[0].getContent()); >+ result = provider.getProposals("xx yy", 3); >+ assertNotNull(result); >+ assertEquals(1, result.length); >+ assertEquals("xx foo yy", result[0].getContent()); > } > > } >#P org.eclipse.mylyn.tasks.ui >Index: src/org/eclipse/mylyn/internal/tasks/ui/PersonContentProposal.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/PersonContentProposal.java,v >retrieving revision 1.6 >diff -u -r1.6 PersonContentProposal.java >--- src/org/eclipse/mylyn/internal/tasks/ui/PersonContentProposal.java 1 Mar 2008 21:38:50 -0000 1.6 >+++ src/org/eclipse/mylyn/internal/tasks/ui/PersonContentProposal.java 13 Mar 2008 21:41:54 -0000 >@@ -20,9 +20,12 @@ > > private boolean isCurrentUser = false; > >- public PersonContentProposal(String address, boolean isCurrentUser) { >+ private final String resultAddress; >+ >+ public PersonContentProposal(String address, boolean isCurrentUser, String resultAddress) { > this.address = address; > this.isCurrentUser = isCurrentUser; >+ this.resultAddress = resultAddress; > } > > public String getLabel() { >@@ -38,7 +41,7 @@ > } > > public String getContent() { >- return address; >+ return resultAddress; > } > > public Image getImage() { >Index: src/org/eclipse/mylyn/internal/tasks/ui/PersonProposalProvider.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/PersonProposalProvider.java,v >retrieving revision 1.18 >diff -u -r1.18 PersonProposalProvider.java >--- src/org/eclipse/mylyn/internal/tasks/ui/PersonProposalProvider.java 1 Mar 2008 21:38:50 -0000 1.18 >+++ src/org/eclipse/mylyn/internal/tasks/ui/PersonProposalProvider.java 13 Mar 2008 21:41:55 -0000 >@@ -49,20 +49,90 @@ > throw new IllegalArgumentException(); > } > >+ String resultPrefix = ""; >+ String resultPostfix = ""; > SortedSet<String> addressSet = getAddressSet(); > if (position > 0) { >+ String searchElement = contents; >+ int comma_prev = contents.substring(0, position).lastIndexOf(','); >+ int comma_next = contents.substring(position).indexOf(','); >+ int space_prev = contents.substring(0, position).lastIndexOf(' '); >+ int space_next = contents.substring(position).indexOf(' '); >+ int pos_prev; >+ int pos_next; >+ >+ if (comma_prev != -1) { >+ if (space_prev != -1) { >+ pos_prev = Math.max(comma_prev, space_prev); >+ } else { >+ pos_prev = comma_prev; >+ } >+ } else { >+ if (space_prev != -1) { >+ pos_prev = space_prev; >+ } else { >+ pos_prev = -1; >+ } >+ } >+ >+ if (comma_next != -1) { >+ if (space_next != -1) { >+ pos_next = Math.min(comma_next, space_next); >+ } else { >+ pos_next = comma_next; >+ } >+ } else { >+ if (space_next != -1) { >+ pos_next = space_next; >+ } else { >+ pos_next = -1; >+ } >+ } >+ >+ int new_position; >+ if (pos_prev != -1) { >+ new_position = position - pos_prev - 1; >+ if (pos_next != -1) { >+ searchElement = contents.substring(pos_prev + 1, position + pos_next); >+ resultPrefix = contents.substring(0, pos_prev + 1); >+ resultPostfix = contents.substring(position + pos_next); >+ } else { >+ searchElement = contents.substring(pos_prev + 1); >+ resultPrefix = contents.substring(0, pos_prev + 1); >+ resultPostfix = ""; >+ } >+ } else { >+ new_position = position; >+ if (pos_next != -1) { >+ searchElement = contents.substring(0, position + pos_next); >+ resultPrefix = ""; >+ resultPostfix = contents.substring(position + pos_next); >+ } else { >+ searchElement = contents; >+ resultPrefix = ""; >+ resultPostfix = ""; >+ } >+ } >+ > // retrieve subset of the tree set using key range >- char[] chars = contents.toLowerCase().toCharArray(); >- String contents1 = new String(chars, 0, position); >- chars[position - 1]++; >- String contents2 = new String(chars, 0, position); >- addressSet = addressSet.subSet(contents1, contents2); >+ if (!searchElement.equals("")) { >+ char[] chars = searchElement.toLowerCase().toCharArray(); >+ String contents1 = new String(chars, 0, searchElement.length()); >+ if (new_position > 0) { >+ chars[new_position - 1]++; >+ } else { >+ chars[new_position]++; >+ } >+ String contents2 = new String(chars, 0, searchElement.length()); >+ addressSet = addressSet.subSet(contents1, contents2); >+ } > } > > IContentProposal[] result = new IContentProposal[addressSet.size()]; > int i = 0; > for (final String address : addressSet) { >- result[i++] = new PersonContentProposal(address, address.equalsIgnoreCase(currentUser)); >+ result[i++] = new PersonContentProposal(address, address.equalsIgnoreCase(currentUser), resultPrefix >+ + address + resultPostfix); > } > Arrays.sort(result); > return result;
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 187127
:
92375
|
92376
| 92521 |
92522
|
92524
|
93935
|
93936
|
94077
|
94078
|
94079
|
94124
|
94125
|
94126
|
94127