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 134625 Details for
Bug 97228
[navigation] NLSKeyHyperlink to reveal/goto the key in the properties file editor
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 for using IFindReplaceTarget for non Text Editors
NLSKeyHyperlink_nonTextEditors.patch (text/plain), 2.05 KB, created by
Florian Albrecht
on 2009-05-06 10:50:01 EDT
(
hide
)
Description:
Patch for using IFindReplaceTarget for non Text Editors
Filename:
MIME Type:
Creator:
Florian Albrecht
Created:
2009-05-06 10:50:01 EDT
Size:
2.05 KB
patch
obsolete
>Index: ui/org/eclipse/jdt/internal/ui/javaeditor/NLSKeyHyperlink.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/NLSKeyHyperlink.java,v >retrieving revision 1.23 >diff -u -r1.23 NLSKeyHyperlink.java >--- ui/org/eclipse/jdt/internal/ui/javaeditor/NLSKeyHyperlink.java 6 May 2008 09:43:45 -0000 1.23 >+++ ui/org/eclipse/jdt/internal/ui/javaeditor/NLSKeyHyperlink.java 6 May 2009 14:46:45 -0000 >@@ -10,6 +10,8 @@ > *******************************************************************************/ > package org.eclipse.jdt.internal.ui.javaeditor; > >+import java.util.regex.Pattern; >+ > import org.eclipse.core.runtime.Assert; > > import org.eclipse.core.resources.IStorage; >@@ -21,6 +23,8 @@ > import org.eclipse.jface.text.FindReplaceDocumentAdapter; > import org.eclipse.jface.text.IDocument; > import org.eclipse.jface.text.IDocumentExtension3; >+import org.eclipse.jface.text.IFindReplaceTarget; >+import org.eclipse.jface.text.IFindReplaceTargetExtension3; > import org.eclipse.jface.text.IRegion; > import org.eclipse.jface.text.ITypedRegion; > import org.eclipse.jface.text.hyperlink.IHyperlink; >@@ -163,6 +167,16 @@ > showErrorInStatusLine(editor, Messages.format(JavaEditorMessages.Editor_OpenPropertiesFile_error_keyNotFound, fKeyName)); > } > } >+ else { >+ // for non-text editors, use IFindReplaceTargetExtension3, if present >+ // search for a line beginning with <keyName>\s*= >+ IFindReplaceTarget findReplace= (IFindReplaceTarget) editor.getAdapter(IFindReplaceTarget.class); >+ if (findReplace instanceof IFindReplaceTargetExtension3) { >+ String search= "^\\s*" + Pattern.quote(PropertyFileDocumentModel.unwindEscapeChars(fKeyName)) + "\\s*="; //$NON-NLS-1$ //$NON-NLS-2$ >+ IFindReplaceTargetExtension3 findReplaceExt= (IFindReplaceTargetExtension3) findReplace; >+ findReplaceExt.findAndSelect(0, search, true, true, false, true); >+ } >+ } > } > > private void showErrorInStatusLine(IEditorPart editor, final String message) {
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
Flags:
daniel_megert
:
review-
Actions:
View
|
Diff
Attachments on
bug 97228
:
134625
|
134755
|
134757
|
134766
|
134937