Editor input without closing. [message #241272] |
Wed, 06 February 2008 07:16 |
Eclipse User |
|
|
|
Originally posted by: sushant.sirsikar.gmail.com
Hello all,
Is it necessary to close an editor and again open if the editor input
changes? I have tried the following, but didn't succeed.
1. Invoke setInputWithNotify(new_input) method with the new editor input -
on debugging it was discovered that the listeners list contains a set of
actions and IEditorPart instance.
2. Invoke init()- this does change the editor title to a new one, but no
changes are reflected in the Editor area.
3. Any previous thread where such problems are addressed.
Looking forward for some pointers.
Thanks in advance.
|
|
|
Re: Editor input without closing. [message #241283 is a reply to message #241272] |
Wed, 06 February 2008 11:40 |
Xiang Qinxian Messages: 119 Registered: July 2009 |
Senior Member |
|
|
Hi,
Sushant 写道:
> Hello all,
> Is it necessary to close an editor and again open if the editor input
> changes? I have tried the following, but didn't succeed.
> 1. Invoke setInputWithNotify(new_input) method with the new editor input
> - on debugging it was discovered that the listeners list contains a set
> of actions and IEditorPart instance. 2. Invoke init()- this does change
> the editor title to a new one, but no changes are reflected in the
> Editor area. 3. Any previous thread where such problems are addressed.
>
> Looking forward for some pointers.
> Thanks in advance.
>
>
If call setInputWithNotify method, a propertychangelistener on
PROP_INPUT should be registered.
But IMO, Editor not design for input change.
For GEF editor(GraphicalEditor) there is model and editpartfactory, like
EditPart's createFigure(), created, then not intend to change.
So, even if handle PROP_INPUT event, there somethings to do.
OK, let's focus on this point, I prefer create model wrapper, which
model related to real model. If need change input, just call
wrapper.setModel(new_input).
EditPartFactory can handle this easy.
Cheers,
Xianya
|
|
|
Powered by
FUDForum. Page generated in 0.03508 seconds