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 45184 Details for
Bug 145123
Support for generic web-based repositories
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]
support for regexp content proposal
mylar.webquery2.patch (text/plain), 3.84 KB, created by
Eugene Kuleshov
on 2006-06-23 11:38:53 EDT
(
hide
)
Description:
support for regexp content proposal
Filename:
MIME Type:
Creator:
Eugene Kuleshov
Created:
2006-06-23 11:38:53 EDT
Size:
3.84 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.mylar.sandbox >Index: src/org/eclipse/mylar/internal/sandbox/web/WebQueryWizardPage.java >=================================================================== >RCS file: /home/technology/org.eclipse.mylar/sandbox/org.eclipse.mylar.sandbox/src/org/eclipse/mylar/internal/sandbox/web/WebQueryWizardPage.java,v >retrieving revision 1.1 >diff -u -r1.1 WebQueryWizardPage.java >--- src/org/eclipse/mylar/internal/sandbox/web/WebQueryWizardPage.java 23 Jun 2006 02:43:58 -0000 1.1 >+++ src/org/eclipse/mylar/internal/sandbox/web/WebQueryWizardPage.java 23 Jun 2006 15:39:13 -0000 >@@ -11,6 +11,11 @@ > import java.util.regex.Matcher; > import java.util.regex.Pattern; > >+import org.eclipse.jface.bindings.keys.KeyStroke; >+import org.eclipse.jface.fieldassist.ContentProposalAdapter; >+import org.eclipse.jface.fieldassist.IContentProposal; >+import org.eclipse.jface.fieldassist.IContentProposalProvider; >+import org.eclipse.jface.fieldassist.TextContentAdapter; > import org.eclipse.jface.wizard.WizardPage; > import org.eclipse.mylar.provisional.tasklist.AbstractRepositoryQuery; > import org.eclipse.mylar.provisional.tasklist.MylarTaskListPlugin; >@@ -67,8 +72,8 @@ > this.query = query; > > setTitle("Create web query"); >- setDescription("http://subclipse.tigris.org/issues/buglist.cgi?issue_status=NEW;issue_status=STARTED;issue_status=REOPENED&order=issues.issue_id\n" + >- "<a href=\"show_bug.cgi\\?id\\=(.+?)\">.+?<span class=\"summary\">(.+?)</span>"); >+ setDescription("Specify URL for web page that show query results and regexp to extract id and description " + >+ repository.getUrl()); > } > > public void createControl(Composite parent) { >@@ -118,7 +123,7 @@ > regexpLabel.setText("Regexp:"); > regexpLabel.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, true)); > >- regexpText = new Text(composite, SWT.V_SCROLL | SWT.MULTI | SWT.BORDER); >+ regexpText = new Text(composite, SWT.V_SCROLL | SWT.MULTI | SWT.BORDER | SWT.WRAP); > GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true); > gridData.heightHint = 39; > regexpText.setLayoutData(gridData); >@@ -129,6 +134,10 @@ > } > } > }); >+ >+ >+ ContentProposalAdapter adapter = new ContentProposalAdapter(regexpText, new TextContentAdapter(), >+ new RegExpProposalProvider(), KeyStroke.getInstance(SWT.CTRL, ' '), null); > > previewTable = new Table(sashForm, SWT.BORDER); > previewTable.setLinesVisible(true); >@@ -206,5 +215,48 @@ > } > return webPage; > } >+ >+ >+ /** >+ * Simple proposal provider for regexps >+ */ >+ private static final class RegExpProposalProvider implements IContentProposalProvider { >+ private static final String[] LABELS = { >+ "IssueZilla", >+ "GForge", >+ "Trac", >+ "Jira" >+ }; >+ private static final String[] PROPOSALS = { >+ "<a href=\"show_bug.cgi\\?id\\=(.+?)\">.+?<span class=\"summary\">(.+?)</span>", >+ "<a class=\"tracker\" href=\"/tracker/index.php\\?func=detail&aid=(.+?)&group_id=GROUP&atid=ATID\">(.+?)</a></td>", >+ "<td class=\"summary\"><a title=\"View ticket\" href=\"/project/ticket/(.+?)\">(.+?)</a></td>", >+ "<td class=\"nav summary\">\\s+?<a href=\"/browse/(.+?)\".+?>(.+?)</a>" >+ }; >+ >+ public IContentProposal[] getProposals(String contents, int position) { >+ IContentProposal[] res = new IContentProposal[LABELS.length]; >+ for (int i = 0; i < LABELS.length; i++) { >+ final String label = LABELS[i]; >+ final String content = PROPOSALS[i]; >+ res[i] = new IContentProposal() { >+ public String getContent() { >+ return content; >+ } >+ public int getCursorPosition() { >+ return content.length(); >+ } >+ public String getDescription() { >+ return content; >+ } >+ public String getLabel() { >+ return label; >+ } >+ }; >+ } >+ return res; >+ } >+ } > > } >+
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 145123
:
44702
|
45141
|
45184
|
45736
|
45811
|
45814
|
45892
|
46105
|
46185
|
46217
|
46219
|
46247
|
46300