Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Some very very strange thing about the open action in the CNF?
Some very very strange thing about the open action in the CNF? [message #330657] Thu, 07 August 2008 15:55 Go to next message
Dollyn Sun is currently offline Dollyn SunFriend
Messages: 68
Registered: July 2009
Location: China
Member

Hi,
I extend the ProjectExplorer, and maped some file to my elements.
To open that elements, I added an actionProvider in the navigatorContent
extension.

In my actionProvider class I called the
actionBars.setGlobalActionHandler(ICommonActionConstants.OPE N, myAction);
The run() in my action just called the IDE.openEditor() method.

The strange thing is that, for some editors (infact which extends the
EditPart directly) , there can by one instance of that kind of editor,
for example, there is AEditor which is used to open the files like *.a
and BEditor which is used to open the files like *.b.
if i opened an AEditor, the if I double-click on the elements that will
open BEditor, nothing happen.

And, if I add a break-point in the run method, if I double-click, it
always will be arrive to the break-point in the run method.
That is to say, with the break-point, the run method will always be excuted.
but if I remove the break-point, the run method will not excuted(it can
be konw throug the System.out.printl("****")).

But if I right-click on the element B, and select "Open" in the context
menu, It works well.

This had made me crazy, hope that there is some one can help me.


Dollyn
Re: Some very very strange thing about the open action in the CNF? [message #330658 is a reply to message #330657] Thu, 07 August 2008 16:24 Go to previous messageGo to next message
Dollyn Sun is currently offline Dollyn SunFriend
Messages: 68
Registered: July 2009
Location: China
Member

Addtional,

If I opened an AEditor, then if I double-click on some B elements,
nothing will happen.
But I switch to another window, in windows xp, and switch back, and then
double-click on some
B elements, BEditor will open.

This message maybe help.

Dollyn 写道:
> Hi,
> I extend the ProjectExplorer, and maped some file to my elements.
> To open that elements, I added an actionProvider in the navigatorContent
> extension.
>
> In my actionProvider class I called the
> actionBars.setGlobalActionHandler(ICommonActionConstants.OPE N, myAction);
> The run() in my action just called the IDE.openEditor() method.
>
> The strange thing is that, for some editors (infact which extends the
> EditPart directly) , there can by one instance of that kind of editor,
> for example, there is AEditor which is used to open the files like *.a
> and BEditor which is used to open the files like *.b.
> if i opened an AEditor, the if I double-click on the elements that will
> open BEditor, nothing happen.
>
> And, if I add a break-point in the run method, if I double-click, it
> always will be arrive to the break-point in the run method.
> That is to say, with the break-point, the run method will always be excuted.
> but if I remove the break-point, the run method will not excuted(it can
> be konw throug the System.out.printl("****")).
>
> But if I right-click on the element B, and select "Open" in the context
> menu, It works well.
>
> This had made me crazy, hope that there is some one can help me.
>
>
>


Dollyn
Re: Some very very strange thing about the open action in the CNF? [message #330698 is a reply to message #330658] Sun, 10 August 2008 05:29 Go to previous messageGo to next message
Shawn Spiars is currently offline Shawn SpiarsFriend
Messages: 16
Registered: July 2009
Junior Member
Dollyn,

It's hard to determine what you problem is without seeing the code,
I had a similar problem recently and I resolved it by overriding the
handleDoubleClick method in my class which extends the CommonNavigator.


Shawn


Dollyn wrote:
> Addtional,
>
> If I opened an AEditor, then if I double-click on some B elements,
> nothing will happen.
> But I switch to another window, in windows xp, and switch back, and then
> double-click on some
> B elements, BEditor will open.
>
> This message maybe help.
>
> Dollyn 写道:
>> Hi,
>> I extend the ProjectExplorer, and maped some file to my elements.
>> To open that elements, I added an actionProvider in the navigatorContent
>> extension.
>>
>> In my actionProvider class I called the
>> actionBars.setGlobalActionHandler(ICommonActionConstants.OPE N, myAction);
>> The run() in my action just called the IDE.openEditor() method.
>>
>> The strange thing is that, for some editors (infact which extends the
>> EditPart directly) , there can by one instance of that kind of editor,
>> for example, there is AEditor which is used to open the files like *.a
>> and BEditor which is used to open the files like *.b.
>> if i opened an AEditor, the if I double-click on the elements that will
>> open BEditor, nothing happen.
>>
>> And, if I add a break-point in the run method, if I double-click, it
>> always will be arrive to the break-point in the run method.
>> That is to say, with the break-point, the run method will always be
>> excuted.
>> but if I remove the break-point, the run method will not excuted(it can
>> be konw throug the System.out.printl("****")).
>>
>> But if I right-click on the element B, and select "Open" in the context
>> menu, It works well.
>>
>> This had made me crazy, hope that there is some one can help me.
>>
>>
>>
Re: Some very very strange thing about the open action in the CNF? [message #330704 is a reply to message #330698] Mon, 11 August 2008 08:54 Go to previous message
Dollyn Sun is currently offline Dollyn SunFriend
Messages: 68
Registered: July 2009
Location: China
Member

Well, I replaced the method IDE.openEditor(page, file); to
IDE.openEditor(page, file, false);
and everyting seams ok now.

In the JavaDoc of this method, the description about the third parameter
is: "If |activate == true| the editor will be activated. "
I'm not sure about the meanning of the "activated" here, because my
editor always "getFocus", although I give it a "false".

Shawn Spiars wrote:
> Dollyn,
>
> It's hard to determine what you problem is without seeing the code,
> I had a similar problem recently and I resolved it by overriding the
> handleDoubleClick method in my class which extends the CommonNavigator.
>
>
> Shawn
>
>
> Dollyn wrote:
>> Addtional,
>>
>> If I opened an AEditor, then if I double-click on some B elements,
>> nothing will happen.
>> But I switch to another window, in windows xp, and switch back, and
>> then double-click on some
>> B elements, BEditor will open.
>>
>> This message maybe help.
>>
>> Dollyn


Dollyn
Previous Topic:how to change editor font size
Next Topic:Open a file from outside workspace in my form editor.
Goto Forum:
  


Current Time: Wed Jun 26 19:39:45 GMT 2024

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

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

Back to the top