Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » highlighting a text of a remote file opened in editor
highlighting a text of a remote file opened in editor [message #991917] Thu, 20 December 2012 13:33 Go to next message
prabuddha singh is currently offline prabuddha singhFriend
Messages: 4
Registered: December 2012
Junior Member
Hi,
i am opening a remote file using a eclipse IDE and filestore.the file is not an Ifile as i do not have it in my workspace and i want to highlight a text or have a marker in that newly opened editor.
code is:
File fileToOpen = new File(filepath);
IFileStore fileStore = EFS.getLocalFileSystem().getStore(fileToOpen.toURI());
IWorkbenchPage page= PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
try {
IDE.openEditorOnFileStore(page, fileStore);
} catch (PartInitException e1) {

}
i am able to open the remote file with this code in a editor,but i dont have any instance of this editor to work on so is there a way of working with such editors and highlighting text or adding markers?
Re: highlighting a text of a remote file opened in editor [message #997600 is a reply to message #991917] Tue, 08 January 2013 12:51 Go to previous message
Dani Megert is currently offline Dani MegertFriend
Messages: 3801
Registered: July 2009
Senior Member
On 20.12.2012 14:44, prabuddha singh wrote:
> Hi,
> i am opening a remote file using a eclipse IDE and filestore.the file
> is not an Ifile as i do not have it in my workspace and i want to
> highlight a text or have a marker in that newly opened editor.
> code is:
> File fileToOpen = new File(filepath);
> IFileStore fileStore =
> EFS.getLocalFileSystem().getStore(fileToOpen.toURI());
> IWorkbenchPage page=
> PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
> try {
> IDE.openEditorOnFileStore(page, fileStore);
> } catch (PartInitException e1) {
>
> }
> i am able to open the remote file with this code in a editor,but i
> dont have any instance of this editor to work on so is there a way of
> working with such editors and highlighting text or adding markers?

IMarker only work for files inside the workspace (IFile). If you want to
highlight things in the editor you might want to use file buffers and
annotation models. Take a look at the following extension points:
org.eclipse.core.filebuffers.annotationModelCreation
org.eclipse.ui.editors.markerAnnotationSpecification

Dani
Previous Topic:simple instructions to disable plugin in juno
Next Topic:Problem with a Job blocking save and build operations
Goto Forum:
  


Current Time: Sun Nov 23 07:32:14 GMT 2014

Powered by FUDForum. Page generated in 0.19099 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software