| Home » Eclipse Projects » Eclipse Platform » Some very very strange thing about the open action in the CNF?
 Goto Forum:| 
| Some very very strange thing about the open action in the CNF? [message #330657] | Thu, 07 August 2008 11:55  |  | 
| Eclipse User  |  |  |  |  | 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 #330658 is a reply to message #330657] | Thu, 07 August 2008 12:24   |  | 
| Eclipse User  |  |  |  |  | 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 #330698 is a reply to message #330658] | Sun, 10 August 2008 01:29   |  | 
| Eclipse User  |  |  |  |  | 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 04:54  |  | 
| Eclipse User  |  |  |  |  | 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
 |  |  |  | 
 
 
 Current Time: Mon Oct 27 16:44:37 EDT 2025 
 Powered by FUDForum . Page generated in 0.43644 seconds |