Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » SSE ITextHover Extension(How to get the IDocument or ITextViewer related EditorInput.)
SSE ITextHover Extension [message #1273791] Thu, 20 March 2014 14:47 Go to next message
Florian Rain is currently offline Florian RainFriend
Messages: 11
Registered: March 2014
Junior Member
Hi Community,

I want to add a ITextHover extension to the SSE, with the org.eclipse.wst.sse.ui.editorConfiguration extension point. The information i want to provide, is based on spezific information, stored on an server. But for this I need the URI of the file I actually editing. How can I get this information?

Thanks for help.
Re: SSE ITextHover Extension [message #1282728 is a reply to message #1273791] Wed, 02 April 2014 18:18 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4435
Registered: July 2009
Senior Member

Typically, in any text editor that's opened a file, you would get the IDocument from the ITextViewer, and then using the result of org.eclipse.core.filebuffers.FileBuffers.getTextFileBufferManager(), call ITextFileBufferManager.getTextFileBuffer(IDocument). The IFileBuffer's location then indicates where it came from, although it's not explicit whether the IPath refers to one in the workspace or at a disk location.

_
Nitin Dahyabhai
Eclipse Web Tools Platform
Re: SSE ITextHover Extension [message #1284206 is a reply to message #1282728] Fri, 04 April 2014 07:50 Go to previous message
Florian Rain is currently offline Florian RainFriend
Messages: 11
Registered: March 2014
Junior Member
Thanks very much! That was not directly what I was looking for, but this is what I got from your help Very Happy
ITextFileBufferManager manager = FileBuffers.getTextFileBufferManager ();
  if (manager != null) {
    ITextFileBuffer buffer = manager.getTextFileBuffer (document);
    if (buffer != null) {
      URI uri = buffer.getFileStore ().toURI ();
      ...
      ...

That has helped me a lot!!! Very Happy Very Happy Very Happy
Thank you.
Previous Topic:SourceViewer with StructuredTextViewerConfigurationXSL not editable
Next Topic:Trying to nest a static web project in eclipse
Goto Forum:
  


Current Time: Fri Apr 26 12:02:24 GMT 2024

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

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

Back to the top