|
|
|
|
Re: Recall of IEntryPoint.createUI() after saving editor [message #118672 is a reply to message #118603] |
Mon, 19 January 2009 12:52 |
Bogdan B. Messages: 50 Registered: July 2009 |
Member |
|
|
Rüdiger Herrmann wrote:
> I am not sure if I got you.
> MyEntryPoint is always contained in the stack trace because it is
> one of the first things being called and only ever returned from if
> the session terminates. This is why you will see it in each and
> every stack trace. It is like the main method of a "normal" Java
> application.
Yes, you are right, sorry.
Anyway, I found the problem: on saving the changes made in an editor, the
following will be called (first line of my stack trace):
org.eclipse.jface.action.StatusLineManager$1.setCanceled(Sta tusLineManager.java:188)
But in my application I have overriden
WorkbenchWindowAdvisor.createWindowContents() to not create a menu and a
status line (as it would be created by default, and as the demo
application does), because I don't need them.
Which means that StatusLineManager.createControl(Composite, int) will
never be invoked in my application, which leaves
StatusLineManager.statusLine null, which produces the NPE when the saving
reaches the line 188 of StatusLineManager: "if (statusLine.isDisposed())
{".
To sustain this, if I add the following into
WorkbenchWindowAdvisor.createWindowContents():
getWindowConfigurer().getPresentationFactory().createStatusL ineControl(
((WorkbenchWindow)getWindowConfigurer().getWindow()).getStat usLineManager(),
shell);
than it works fine.
But why should I create a status line if I don't need it? Wouldn't be
better if you check if the statusline is not null before you check if it
has been disposed?
|
|
|
|
|
Re: Recall of IEntryPoint.createUI() after saving editor [message #119216 is a reply to message #118672] |
Thu, 22 January 2009 12:35 |
Matthias Maar Messages: 5 Registered: July 2009 |
Junior Member |
|
|
Hi Bogdan,
as the JavaDoc for WorkbenchWindowAdvisor.createWindowContents() states,
you can control the visibility of some default workbench items by using
the setShow* methods. So simply adding
getWindowConfigurer().setShowStatusLine(false) in the preWindowOpen()
method of your overridden WorkbenchWindowAdvisor class effectively hides
the status bar. Overriding the createWindowContents() is most often not
necessary and error prone.
Regards,
Matthias
Bogdan B. wrote:
> Rüdiger Herrmann wrote:
>> I am not sure if I got you.
>> MyEntryPoint is always contained in the stack trace because it is one
>> of the first things being called and only ever returned from if the
>> session terminates. This is why you will see it in each and every
>> stack trace. It is like the main method of a "normal" Java application.
>
> Yes, you are right, sorry.
>
> Anyway, I found the problem: on saving the changes made in an editor,
> the following will be called (first line of my stack trace):
> org.eclipse.jface.action.StatusLineManager$1.setCanceled(Sta tusLineManager.java:188)
>
>
> But in my application I have overriden
> WorkbenchWindowAdvisor.createWindowContents() to not create a menu and a
> status line (as it would be created by default, and as the demo
> application does), because I don't need them.
> Which means that StatusLineManager.createControl(Composite, int) will
> never be invoked in my application, which leaves
> StatusLineManager.statusLine null, which produces the NPE when the
> saving reaches the line 188 of StatusLineManager: "if
> (statusLine.isDisposed()) {".
>
> To sustain this, if I add the following into
> WorkbenchWindowAdvisor.createWindowContents():
> getWindowConfigurer().getPresentationFactory().createStatusL ineControl(
>
> ((WorkbenchWindow)getWindowConfigurer().getWindow()).getStat usLineManager(),
> shell);
> than it works fine.
>
> But why should I create a status line if I don't need it? Wouldn't be
> better if you check if the statusline is not null before you check if it
> has been disposed?
>
>
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03781 seconds