Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » read a file from context menu
read a file from context menu [message #269357] Mon, 30 August 2004 18:23 Go to next message
Eclipse UserFriend
IObjectActionDelegate is used for context menus.
How can I get from here the contents of the currently selected file.
It should act on Java files only- for which I can use nameFilter.
I want to be able to get the contents of file-
line by line or character by character- whatsoever possible.
Thanks in advance for this.
Re: read a file from context menu [message #269456 is a reply to message #269357] Tue, 31 August 2004 05:53 Go to previous messageGo to next message
Eclipse UserFriend
rohitsoftware wrote:
> IObjectActionDelegate is used for context menus.
> How can I get from here the contents of the currently selected file.
> It should act on Java files only- for which I can use nameFilter.
> I want to be able to get the contents of file-
> line by line or character by character- whatsoever possible.
> Thanks in advance for this.

Don't crosspost to eclipse.tools.jdt!

Save the selection when your IActionDelegate#selectionChanged(..) is called.
The selection is typically an IStructuredSelection, from which you get an
IFile (e.g. from the ResourceNavigator) or an ICompilationUnit (e.g. from
the PackageExplorer). Then, use methods IFile#getContents() or
ICompilationUnit#getSource().

Markus
Re: read a file from context menu [message #269507 is a reply to message #269456] Tue, 31 August 2004 10:10 Go to previous message
Eclipse UserFriend
Thanks...
Previous Topic:Another problem with log4j and the help server
Next Topic:Installing 3rd Party Plugin
Goto Forum:
  


Current Time: Tue Jul 22 08:40:04 EDT 2025

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

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

Back to the top