| about the editor view [message #149368] |
Mon, 27 October 2003 00:24  |
Eclipse User |
|
|
|
Originally posted by: rc316.shaw.ca
Hello all,
I have a couple of questions regarding the editor view. First, I've added
an item to a context menu and the context menu is when you higlight text in
the editor and right-click it. The thing is that my item shows up only when
I highlight text from a .txt file but it doesn't work for a .java file.
Does anyone have any suggestions why this occurs?
My second question is regarding the fact that I want to mimic the action of
when a file opens, it opens up in the editor view and every file you open
tabs the previous one. However, I want to invoke this action when I click
something in a view I've created. What I've done so far is when i
double-click, the information i want displayed is written to a file using
the FileWriter class. Then, I create a class that implements the IFile
interface. Once that's done, I'm calling the openEditor(IFile) function
from the workbenchpage class.
I was wondering if there is any other way of doing it?
Thanks in advance.
Cheers,
Raj
|
|
|
| Re: about the editor view [message #149390 is a reply to message #149368] |
Mon, 27 October 2003 02:44  |
Eclipse User |
|
|
|
Originally posted by: eclipse.tkilla.ch
Raj Chari wrote:
> I have a couple of questions regarding the editor view. First, I've added
> an item to a context menu and the context menu is when you higlight text in
> the editor and right-click it. The thing is that my item shows up only when
> I highlight text from a .txt file but it doesn't work for a .java file.
> Does anyone have any suggestions why this occurs?
Every editor has its own context menu id - you have to add your action
to each editor you want it to show up. Examples are:
- #TextEditorContext - Text editor
- #CompilationUnitEditorContext - Compilation Unit (Java) editor
etc. To find them, search in the newsgroup or look at the respective
editor implementations.
-tom
|
|
|
Powered by
FUDForum. Page generated in 0.03550 seconds