Home » Eclipse Projects » Rich Client Platform (RCP) » getSourceViewer() returning null on AbstractDecoratedTextEditor init
getSourceViewer() returning null on AbstractDecoratedTextEditor init [message #459310] |
Thu, 30 November 2006 06:28  |
Eclipse User |
|
|
|
Originally posted by: diebosto.fi.vupv.es
I define my own editor that inherits from AbstractDecoratedTextEditor, and
when i do the init of my editor i do a super.init to initialize the
AbstractDecoratedTextEditor too.
The problem is that while doing super.init, inside of
installChangeRulerModel() method getSourceViewer() returns null and as it
tries to get its annnotation model (with getSourceViewer
().getAnnotationModel()) it halts.
The fact is that despite that, the editor launches perfectly, but when i'm
debugging my own program is kind of amusing to have the debugger halt on
that line every time.
So i really have two questions:
Need i have to create a source viewer before calling super.init?
if i can't... is possible to disable the change ruler before so
installChangeRulerModel doesn't get called?
Thanks!
|
|
| |
Re: getSourceViewer() returning null on AbstractDecoratedTextEditor init [message #459359 is a reply to message #459358] |
Thu, 30 November 2006 07:02   |
Eclipse User |
|
|
|
Originally posted by: diebosto.fi.vupv.es
Daniel Megert <daniel_megert@ch.ibm.com> wrote in
news:ekmfuu$vm7$1@utils.eclipse.org:
> Diego Bosca wrote:
>
>>I define my own editor that inherits from AbstractDecoratedTextEditor,
>>and when i do the init of my editor i do a super.init to initialize
>>the AbstractDecoratedTextEditor too.
>>The problem is that while doing super.init, inside of
>>installChangeRulerModel() method getSourceViewer() returns null and as
>>it
>>
>>
> Are you overriding init(IEditorSite, IEditorInput) or do you refer to
> another "init"?
>
> Dani
>
>>tries to get its annnotation model (with getSourceViewer
>>().getAnnotationModel()) it halts.
>>The fact is that despite that, the editor launches perfectly, but when
>>i'm debugging my own program is kind of amusing to have the debugger
>>halt on that line every time.
>>So i really have two questions:
>>Need i have to create a source viewer before calling super.init?
>>if i can't... is possible to disable the change ruler before so
>>installChangeRulerModel doesn't get called?
>>Thanks!
>>
>>
>
Exactly that, i'm calling super.init(IEditorSite, IEditorInput) too
This is my custom init method
public void init(IEditorSite site, IEditorInput input)
{
try {
super.init(site,input);
} catch (PartInitException e) {
e.printStackTrace();
}
getEditorSite().getActionBars().getStatusLineManager
().setMessage(input.getName());
}
simple isn't it?
|
|
|
Re: getSourceViewer() returning null on AbstractDecoratedTextEditor init [message #460122 is a reply to message #459359] |
Thu, 14 December 2006 05:48   |
Eclipse User |
|
|
|
Diego Bosca wrote:
>Daniel Megert <daniel_megert@ch.ibm.com> wrote in
>news:ekmfuu$vm7$1@utils.eclipse.org:
>
>
>
>>Diego Bosca wrote:
>>
>>
>>
>>>I define my own editor that inherits from AbstractDecoratedTextEditor,
>>>and when i do the init of my editor i do a super.init to initialize
>>>the AbstractDecoratedTextEditor too.
>>>The problem is that while doing super.init, inside of
>>>installChangeRulerModel() method getSourceViewer() returns null and as
>>>it
>>>
>>>
>>>
>>>
>>Are you overriding init(IEditorSite, IEditorInput) or do you refer to
>>another "init"?
>>
>>Dani
>>
>>
>>
>>>tries to get its annnotation model (with getSourceViewer
>>>().getAnnotationModel()) it halts.
>>>The fact is that despite that, the editor launches perfectly, but when
>>>i'm debugging my own program is kind of amusing to have the debugger
>>>halt on that line every time.
>>>So i really have two questions:
>>>Need i have to create a source viewer before calling super.init?
>>>if i can't... is possible to disable the change ruler before so
>>>installChangeRulerModel doesn't get called?
>>>Thanks!
>>>
>>>
>>>
>>>
>
>Exactly that, i'm calling super.init(IEditorSite, IEditorInput) too
>
>
>This is my custom init method
>
>public void init(IEditorSite site, IEditorInput input)
> {
> try {
> super.init(site,input);
> } catch (PartInitException e) {
> e.printStackTrace();
> }
>
> getEditorSite().getActionBars().getStatusLineManager
>().setMessage(input.getName());
>
>}
>
>simple isn't it?
>
>
Having an editor with above init(...) method works for me. Of course the
viewer is null until createPartControl(...) has been called - which
happens after init(...).
Dani
|
|
|
Re: getSourceViewer() returning null on AbstractDecoratedTextEditor init [message #460152 is a reply to message #460122] |
Fri, 15 December 2006 07:08   |
Eclipse User |
|
|
|
Originally posted by: diebosto.fi.vupv.es
Daniel Megert <daniel_megert@ch.ibm.com> wrote in news:elra6a$hpa$1
@utils.eclipse.org:
> Diego Bosca wrote:
>
>>Daniel Megert <daniel_megert@ch.ibm.com> wrote in
>>news:ekmfuu$vm7$1@utils.eclipse.org:
>>
>>
>>
>>>Diego Bosca wrote:
>>>
>>>
>>>
>>>>I define my own editor that inherits from
AbstractDecoratedTextEditor,
>>>>and when i do the init of my editor i do a super.init to initialize
>>>>the AbstractDecoratedTextEditor too.
>>>>The problem is that while doing super.init, inside of
>>>>installChangeRulerModel() method getSourceViewer() returns null and
as
>>>>it
>>>>
>>>>
>>>>
>>>>
>>>Are you overriding init(IEditorSite, IEditorInput) or do you refer to
>>>another "init"?
>>>
>>>Dani
>>>
>>>
>>>
>>>>tries to get its annnotation model (with getSourceViewer
>>>>().getAnnotationModel()) it halts.
>>>>The fact is that despite that, the editor launches perfectly, but
when
>>>>i'm debugging my own program is kind of amusing to have the debugger
>>>>halt on that line every time.
>>>>So i really have two questions:
>>>>Need i have to create a source viewer before calling super.init?
>>>>if i can't... is possible to disable the change ruler before so
>>>>installChangeRulerModel doesn't get called?
>>>>Thanks!
>>>>
>>>>
>>>>
>>>>
>>
>>Exactly that, i'm calling super.init(IEditorSite, IEditorInput) too
>>
>>
>>This is my custom init method
>>
>>public void init(IEditorSite site, IEditorInput input)
>> {
>> try {
>> super.init(site,input);
>> } catch (PartInitException e) {
>> e.printStackTrace();
>> }
>>
>> getEditorSite().getActionBars().getStatusLineManager
>>().setMessage(input.getName());
>>
>>}
>>
>>simple isn't it?
>>
>>
> Having an editor with above init(...) method works for me. Of course
the
> viewer is null until createPartControl(...) has been called - which
> happens after init(...).
>
> Dani
>
So i should call super.init() after createPartControl()?
|
|
|
Re: getSourceViewer() returning null on AbstractDecoratedTextEditor init [message #460208 is a reply to message #460152] |
Mon, 18 December 2006 03:25   |
Eclipse User |
|
|
|
Diego Bosca wrote:
>Daniel Megert <daniel_megert@ch.ibm.com> wrote in news:elra6a$hpa$1
>@utils.eclipse.org:
>
>
>
>>Diego Bosca wrote:
>>
>>
>>
>>>Daniel Megert <daniel_megert@ch.ibm.com> wrote in
>>>news:ekmfuu$vm7$1@utils.eclipse.org:
>>>
>>>
>>>
>>>
>>>
>>>>Diego Bosca wrote:
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>>I define my own editor that inherits from
>>>>>
>>>>>
>AbstractDecoratedTextEditor,
>
>
>>>>>and when i do the init of my editor i do a super.init to initialize
>>>>>the AbstractDecoratedTextEditor too.
>>>>>The problem is that while doing super.init, inside of
>>>>>installChangeRulerModel() method getSourceViewer() returns null and
>>>>>
>>>>>
>as
>
>
>>>>>it
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>Are you overriding init(IEditorSite, IEditorInput) or do you refer to
>>>>another "init"?
>>>>
>>>>Dani
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>>tries to get its annnotation model (with getSourceViewer
>>>>>().getAnnotationModel()) it halts.
>>>>>The fact is that despite that, the editor launches perfectly, but
>>>>>
>>>>>
>when
>
>
>>>>>i'm debugging my own program is kind of amusing to have the debugger
>>>>>halt on that line every time.
>>>>>So i really have two questions:
>>>>>Need i have to create a source viewer before calling super.init?
>>>>>if i can't... is possible to disable the change ruler before so
>>>>>installChangeRulerModel doesn't get called?
>>>>>Thanks!
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>Exactly that, i'm calling super.init(IEditorSite, IEditorInput) too
>>>
>>>
>>>This is my custom init method
>>>
>>>public void init(IEditorSite site, IEditorInput input)
>>> {
>>> try {
>>> super.init(site,input);
>>> } catch (PartInitException e) {
>>> e.printStackTrace();
>>> }
>>>
>>> getEditorSite().getActionBars().getStatusLineManager
>>>().setMessage(input.getName());
>>>
>>>}
>>>
>>>simple isn't it?
>>>
>>>
>>>
>>>
>>Having an editor with above init(...) method works for me. Of course
>>
>>
>the
>
>
>>viewer is null until createPartControl(...) has been called - which
>>happens after init(...).
>>
>>Dani
>>
>>
>>
>
>
>So i should call super.init() after createPartControl()?
>
>
init(...) has to be called before createPartControl. You should not call
super.init(...) somewhere else than in init(...).
Dani
|
|
|
Re: getSourceViewer() returning null on AbstractDecoratedTextEditor init [message #460335 is a reply to message #460208] |
Wed, 20 December 2006 05:46   |
Eclipse User |
|
|
|
Originally posted by: diebosto.fi.vupv.es
Daniel Megert <daniel_megert@ch.ibm.com> wrote in news:em5j9u$pef$1
@utils.eclipse.org:
> Diego Bosca wrote:
>
>>Daniel Megert <daniel_megert@ch.ibm.com> wrote in news:elra6a$hpa$1
>>@utils.eclipse.org:
>>
>>
>>
>>>Diego Bosca wrote:
>>>
>>>
>>>
>>>>Daniel Megert <daniel_megert@ch.ibm.com> wrote in
>>>>news:ekmfuu$vm7$1@utils.eclipse.org:
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>>Diego Bosca wrote:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>I define my own editor that inherits from
>>>>>>
>>>>>>
>>AbstractDecoratedTextEditor,
>>
>>
>>>>>>and when i do the init of my editor i do a super.init to initialize
>>>>>>the AbstractDecoratedTextEditor too.
>>>>>>The problem is that while doing super.init, inside of
>>>>>>installChangeRulerModel() method getSourceViewer() returns null and
>>>>>>
>>>>>>
>>as
>>
>>
>>>>>>it
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>Are you overriding init(IEditorSite, IEditorInput) or do you refer
to
>>>>>another "init"?
>>>>>
>>>>>Dani
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>tries to get its annnotation model (with getSourceViewer
>>>>>>().getAnnotationModel()) it halts.
>>>>>>The fact is that despite that, the editor launches perfectly, but
>>>>>>
>>>>>>
>>when
>>
>>
>>>>>>i'm debugging my own program is kind of amusing to have the
debugger
>>>>>>halt on that line every time.
>>>>>>So i really have two questions:
>>>>>>Need i have to create a source viewer before calling super.init?
>>>>>>if i can't... is possible to disable the change ruler before so
>>>>>>installChangeRulerModel doesn't get called?
>>>>>>Thanks!
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>Exactly that, i'm calling super.init(IEditorSite, IEditorInput) too
>>>>
>>>>
>>>>This is my custom init method
>>>>
>>>>public void init(IEditorSite site, IEditorInput input)
>>>> {
>>>> try {
>>>> super.init(site,input);
>>>> } catch (PartInitException e) {
>>>> e.printStackTrace();
>>>> }
>>>>
>>>> getEditorSite().getActionBars().getStatusLineManager
>>>>().setMessage(input.getName());
>>>>
>>>>}
>>>>
>>>>simple isn't it?
>>>>
>>>>
>>>>
>>>>
>>>Having an editor with above init(...) method works for me. Of course
>>>
>>>
>>the
>>
>>
>>>viewer is null until createPartControl(...) has been called - which
>>>happens after init(...).
>>>
>>>Dani
>>>
>>>
>>>
>>
>>
>>So i should call super.init() after createPartControl()?
>>
>>
> init(...) has to be called before createPartControl. You should not
call
> super.init(...) somewhere else than in init(...).
>
> Dani
>
And so i'm doing that. the code is as i typed here before. the only thing
i do is call super.init() and is in that moment (inside super.init())
when createPartControl is called.
|
|
|
Re: getSourceViewer() returning null on AbstractDecoratedTextEditor init [message #460338 is a reply to message #460335] |
Wed, 20 December 2006 07:06   |
Eclipse User |
|
|
|
Diego Bosca wrote:
>Daniel Megert <daniel_megert@ch.ibm.com> wrote in news:em5j9u$pef$1
>@utils.eclipse.org:
>
>
>
>>Diego Bosca wrote:
>>
>>
>>
>>>Daniel Megert <daniel_megert@ch.ibm.com> wrote in news:elra6a$hpa$1
>>>@utils.eclipse.org:
>>>
>>>
>>>
>>>
>>>
>>>>Diego Bosca wrote:
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>>Daniel Megert <daniel_megert@ch.ibm.com> wrote in
>>>>>news:ekmfuu$vm7$1@utils.eclipse.org:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>Diego Bosca wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>>I define my own editor that inherits from
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>AbstractDecoratedTextEditor,
>>>
>>>
>>>
>>>
>>>>>>>and when i do the init of my editor i do a super.init to initialize
>>>>>>>the AbstractDecoratedTextEditor too.
>>>>>>>The problem is that while doing super.init, inside of
>>>>>>>installChangeRulerModel() method getSourceViewer() returns null and
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>as
>>>
>>>
>>>
>>>
>>>>>>>it
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>Are you overriding init(IEditorSite, IEditorInput) or do you refer
>>>>>>
>>>>>>
>to
>
>
>>>>>>another "init"?
>>>>>>
>>>>>>Dani
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>>tries to get its annnotation model (with getSourceViewer
>>>>>>>().getAnnotationModel()) it halts.
>>>>>>>The fact is that despite that, the editor launches perfectly, but
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>when
>>>
>>>
>>>
>>>
>>>>>>>i'm debugging my own program is kind of amusing to have the
>>>>>>>
>>>>>>>
>debugger
>
>
>>>>>>>halt on that line every time.
>>>>>>>So i really have two questions:
>>>>>>>Need i have to create a source viewer before calling super.init?
>>>>>>>if i can't... is possible to disable the change ruler before so
>>>>>>>installChangeRulerModel doesn't get called?
>>>>>>>Thanks!
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>Exactly that, i'm calling super.init(IEditorSite, IEditorInput) too
>>>>>
>>>>>
>>>>>This is my custom init method
>>>>>
>>>>>public void init(IEditorSite site, IEditorInput input)
>>>>> {
>>>>> try {
>>>>> super.init(site,input);
>>>>> } catch (PartInitException e) {
>>>>> e.printStackTrace();
>>>>> }
>>>>>
>>>>> getEditorSite().getActionBars().getStatusLineManager
>>>>>().setMessage(input.getName());
>>>>>
>>>>>}
>>>>>
>>>>>simple isn't it?
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>Having an editor with above init(...) method works for me. Of course
>>>>
>>>>
>>>>
>>>>
>>>the
>>>
>>>
>>>
>>>
>>>>viewer is null until createPartControl(...) has been called - which
>>>>happens after init(...).
>>>>
>>>>Dani
>>>>
>>>>
>>>>
>>>>
>>>>
>>>So i should call super.init() after createPartControl()?
>>>
>>>
>>>
>>>
>>init(...) has to be called before createPartControl. You should not
>>
>>
>call
>
>
>>super.init(...) somewhere else than in init(...).
>>
>>Dani
>>
>>
>>
>
>And so i'm doing that. the code is as i typed here before. the only thing
>i do is call super.init() and is in that moment (inside super.init())
>when createPartControl is called.
>
>
That shouldn't happen. I guess something else isn't correctly done on
your side. If you disagree simply zip your example and attach it to a
new bug report against Platform Text.
Dani
|
|
|
Re: getSourceViewer() returning null on AbstractDecoratedTextEditor init [message #460343 is a reply to message #460338] |
Wed, 20 December 2006 10:55  |
Eclipse User |
|
|
|
Originally posted by: diebosto.fi.vupv.es
Daniel Megert <daniel_megert@ch.ibm.com> wrote in
news:emb90o$kkh$1@utils.eclipse.org:
> Diego Bosca wrote:
>
>>Daniel Megert <daniel_megert@ch.ibm.com> wrote in news:em5j9u$pef$1
>>@utils.eclipse.org:
>>
>>
>>
>>>Diego Bosca wrote:
>>>
>>>
>>>
>>>>Daniel Megert <daniel_megert@ch.ibm.com> wrote in news:elra6a$hpa$1
>>>>@utils.eclipse.org:
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>>Diego Bosca wrote:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>Daniel Megert <daniel_megert@ch.ibm.com> wrote in
>>>>>>news:ekmfuu$vm7$1@utils.eclipse.org:
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>>Diego Bosca wrote:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>>I define my own editor that inherits from
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>AbstractDecoratedTextEditor,
>>>>
>>>>
>>>>
>>>>
>>>>>>>>and when i do the init of my editor i do a super.init to
>>>>>>>>initialize the AbstractDecoratedTextEditor too.
>>>>>>>>The problem is that while doing super.init, inside of
>>>>>>>>installChangeRulerModel() method getSourceViewer() returns null
>>>>>>>>and
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>as
>>>>
>>>>
>>>>
>>>>
>>>>>>>>it
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>Are you overriding init(IEditorSite, IEditorInput) or do you
>>>>>>>refer
>>>>>>>
>>>>>>>
>>to
>>
>>
>>>>>>>another "init"?
>>>>>>>
>>>>>>>Dani
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>>tries to get its annnotation model (with getSourceViewer
>>>>>>>>().getAnnotationModel()) it halts.
>>>>>>>>The fact is that despite that, the editor launches perfectly,
>>>>>>>>but
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>when
>>>>
>>>>
>>>>
>>>>
>>>>>>>>i'm debugging my own program is kind of amusing to have the
>>>>>>>>
>>>>>>>>
>>debugger
>>
>>
>>>>>>>>halt on that line every time.
>>>>>>>>So i really have two questions:
>>>>>>>>Need i have to create a source viewer before calling super.init?
>>>>>>>>if i can't... is possible to disable the change ruler before so
>>>>>>>>installChangeRulerModel doesn't get called?
>>>>>>>>Thanks!
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>Exactly that, i'm calling super.init(IEditorSite, IEditorInput)
>>>>>>too
>>>>>>
>>>>>>
>>>>>>This is my custom init method
>>>>>>
>>>>>>public void init(IEditorSite site, IEditorInput input)
>>>>>> {
>>>>>> try {
>>>>>> super.init(site,input);
>>>>>> } catch (PartInitException e) {
>>>>>> e.printStackTrace();
>>>>>> }
>>>>>>
>>>>>> getEditorSite().getActionBars().getStatusLineManager
>>>>>>().setMessage(input.getName());
>>>>>>
>>>>>>}
>>>>>>
>>>>>>simple isn't it?
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>Having an editor with above init(...) method works for me. Of
>>>>>course
>>>>>
>>>>>
>>>>>
>>>>>
>>>>the
>>>>
>>>>
>>>>
>>>>
>>>>>viewer is null until createPartControl(...) has been called - which
>>>>>happens after init(...).
>>>>>
>>>>>Dani
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>So i should call super.init() after createPartControl()?
>>>>
>>>>
>>>>
>>>>
>>>init(...) has to be called before createPartControl. You should not
>>>
>>>
>>call
>>
>>
>>>super.init(...) somewhere else than in init(...).
>>>
>>>Dani
>>>
>>>
>>>
>>
>>And so i'm doing that. the code is as i typed here before. the only
>>thing i do is call super.init() and is in that moment (inside
>>super.init()) when createPartControl is called.
>>
>>
> That shouldn't happen. I guess something else isn't correctly done on
> your side. If you disagree simply zip your example and attach it to a
> new bug report against Platform Text.
>
> Dani
Ok, i think i'll do that
thanks for all
|
|
|
Goto Forum:
Current Time: Tue Apr 15 02:56:59 EDT 2025
Powered by FUDForum. Page generated in 0.07458 seconds
|