Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [pde-dev] how to reflect changes in view plug-in dynamically

Hi Vrush.  I'm a bit confused in reading your e-mail: I'm guessing
you're new to Eclipse development, and my reply assumes this.  If
that's not the case, I apologize.  I'd highly recommend you pick up
a copy of an something like the Java Developer's Guide to Eclipse.

>From your message, I think you're confusing `plug-in' and `view'
-- they're not the same thing.  A plug-in can contribute many views;
a view is provided by a plug-in.  A plug-in doesn't have to have
any views.


On 2007.03.22 07:18:48 -0700, vrushali babar wrote:
>   -         Plugin is not getting updated dynamically(the way
> outline gets updated as  editor contents changes).

Well that's your responsibility: upon any change (to your XML file)
you should refresh your view.  The Model-View-Controller style
suggests having your Eclipse view be notified of changes through
a listener interface provided by your model (something modelling
the XML file).

Or is this XML file being editted in an Eclipse editor?  If so,
you need to register as a listener for changes to the particular
text editor.

You could also try using the IResourceChangeListener framework (see
IWorkspace.addResourceChangeListener()) but this will cause you to
be notified for changes to all resources.

>   -         It gets initialized only once in its life time & each
> plugin has its own composite.

Yes, a plug-in is initialized only once for the entire workbench.
A view generally has only a single instance in any particular
workbench window.  Try creating a new window (Window -> New Window),
and then opening an instance of your view.

>   -         To update/refresh the contents of the plugin we need
> to dump the whole plugin so as to create the new one with the new
> composite & that will get initailised as per the current changes.

That's because you're not hooking in a listener.

>   -         Not able to dispose the current composite;so the
> changes are not getting reflacted in the plugin.
>
>   I have tried disposing the composite but failed.Even we have
> tried getting the respective methods executed on the particular
> event but without having new composite none the changes are getting
> reflacted.

I assume that you're trying to do this because of the lack of a
MVC style listener use.

Brian.

-- 
  Brian de Alwis | Software Practices Lab | UBC | http://www.cs.ubc.ca/~bsd/
      "Amusement to an observing mind is study." - Benjamin Disraeli


Back to the top