Skip to main content



      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 08:33 Go to next message
Eclipse UserFriend
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 07:51 Go to previous message
Eclipse UserFriend
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: Tue Jul 01 03:51:03 EDT 2025

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

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

Back to the top