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 94124 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]
Enhancement
patch187127Enhancement.txt (text/plain), 4.97 KB, created by
Frank Becker
on 2008-03-29 18:51:10 EDT
(
hide
)
Description:
Enhancement
Filename:
MIME Type:
Creator:
Frank Becker
Created:
2008-03-29 18:51:10 EDT
Size:
4.97 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.mylyn.tasks.ui >Index: src/org/eclipse/mylyn/tasks/ui/editors/AbstractRepositoryTaskEditor.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractRepositoryTaskEditor.java,v >retrieving revision 1.281 >diff -u -r1.281 AbstractRepositoryTaskEditor.java >--- src/org/eclipse/mylyn/tasks/ui/editors/AbstractRepositoryTaskEditor.java 27 Mar 2008 22:54:30 -0000 1.281 >+++ src/org/eclipse/mylyn/tasks/ui/editors/AbstractRepositoryTaskEditor.java 29 Mar 2008 22:47:14 -0000 >@@ -45,7 +45,11 @@ > import org.eclipse.jface.fieldassist.ControlDecoration; > import org.eclipse.jface.fieldassist.FieldDecoration; > import org.eclipse.jface.fieldassist.FieldDecorationRegistry; >+import org.eclipse.jface.fieldassist.IContentProposal; >+import org.eclipse.jface.fieldassist.IContentProposalListener; >+import org.eclipse.jface.fieldassist.IContentProposalListener2; > import org.eclipse.jface.fieldassist.IContentProposalProvider; >+import org.eclipse.jface.fieldassist.IControlContentAdapter; > import org.eclipse.jface.fieldassist.TextContentAdapter; > import org.eclipse.jface.layout.GridDataFactory; > import org.eclipse.jface.resource.JFaceResources; >@@ -2000,7 +2004,7 @@ > GridDataFactory.fillDefaults().hint(150, SWT.DEFAULT).applyTo(text); > > if (hasContentAssist(addCCattribute)) { >- ContentAssistCommandAdapter adapter = applyContentAssist(text, >+ ContentAssistCommandAdapter adapter = applyCCContentAssist(text, > createContentProposalProvider(addCCattribute)); > ILabelProvider propsalLabelProvider = createProposalLabelProvider(addCCattribute); > if (propsalLabelProvider != null) { >@@ -3999,4 +4003,95 @@ > return hyperlink; > } > >+ /** >+ * Adds content assist to the given text field. >+ * >+ * @param text >+ * text field to decorate. >+ * @param proposalProvider >+ * instance providing content proposals >+ * @return the ContentAssistCommandAdapter for the field. >+ */ >+ protected ContentAssistCommandAdapter applyCCContentAssist(Text text, IContentProposalProvider proposalProvider) { >+ ControlDecoration controlDecoration = new ControlDecoration(text, (SWT.TOP | SWT.LEFT)); >+ controlDecoration.setMarginWidth(0); >+ controlDecoration.setShowHover(true); >+ controlDecoration.setShowOnlyOnFocus(true); >+ >+ FieldDecoration contentProposalImage = FieldDecorationRegistry.getDefault().getFieldDecoration( >+ FieldDecorationRegistry.DEC_CONTENT_PROPOSAL); >+ controlDecoration.setImage(contentProposalImage.getImage()); >+ >+ TextContentAdapter textContentAdapter = new TextContentAdapter(); >+ >+ MultiContentAssistCommandAdapter adapter = new MultiContentAssistCommandAdapter(text, textContentAdapter, >+ proposalProvider, "org.eclipse.ui.edit.text.contentAssist.proposals", new char[0]); >+ MultiProposalListener listener = new MultiProposalListener(adapter); >+ >+ adapter.addContentProposalListener((IContentProposalListener) listener); >+ adapter.addContentProposalListener((IContentProposalListener2) listener); >+ >+ IBindingService bindingService = (IBindingService) PlatformUI.getWorkbench().getService(IBindingService.class); >+ controlDecoration.setDescriptionText(NLS.bind("Content Assist Available ({0})", >+ bindingService.getBestActiveBindingFormattedFor(adapter.getCommandId()))); >+ >+ return adapter; >+ } >+ >+ static class MultiProposalListener implements IContentProposalListener, IContentProposalListener2 { >+ >+ private final MultiContentAssistCommandAdapter adapter; >+ >+ public MultiProposalListener(MultiContentAssistCommandAdapter adapter) { >+ super(); >+ this.adapter = adapter; >+ } >+ >+ private int getIndexOfLeftSeparator(String contents, int position) { >+ int i = contents.lastIndexOf(' ', position - 1); >+ i = Math.max(contents.lastIndexOf(',', position - 1), i); >+ return i; >+ } >+ >+ public void proposalAccepted(IContentProposal proposal) { >+ String contents = proposal.getContent(); >+ int position = proposal.getCursorPosition(); >+ int leftSeparator = getIndexOfLeftSeparator(contents, position); >+ >+ assert leftSeparator <= position; >+ if (leftSeparator != -1) { >+ Control c = adapter.getControl(); >+ if (c instanceof Text) { >+ Text t = (Text) c; >+ t.setSelection(leftSeparator); >+ adapter.reopen(); >+ } >+ } >+ } >+ >+ public void proposalPopupClosed(ContentProposalAdapter adapter) { >+ // ignore >+ >+ } >+ >+ public void proposalPopupOpened(ContentProposalAdapter adapter) { >+ // ignore >+ >+ } >+ }; >+ >+ private class MultiContentAssistCommandAdapter extends ContentAssistCommandAdapter { >+ >+ public MultiContentAssistCommandAdapter(Control control, IControlContentAdapter controlContentAdapter, >+ IContentProposalProvider proposalProvider, String commandId, char[] autoActivationCharacters) { >+ super(control, controlContentAdapter, proposalProvider, commandId, autoActivationCharacters); >+ // ignore >+ } >+ >+ public void reopen() { >+ this.openProposalPopup(); >+ } >+ >+ } >+ > }
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