Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[pde-dev] Obtaining an *editable* model of the runtime workspace from development workspace

[Related to the previous thread, and since I've gotten no reply on the newgroups...]

I've inherited some PDE-related code that used to work in 3.0, but no longer
works in 3.1.

Basically, it programmatically adds extensions to a given project in the
workspace, triggered by user actions.

The key bit of code that no longer works is:

  PluginModelManager pmm = PDECore.getDefault().getModelManager();
  IPluginModelBase[] plugins = pmm.getAllPlugins();

The plugin models were then used to create new extensions in the user's
workspace.

This code now has two problems in 3.1:

 - getAllPlugins() actually returns models for the set of *installed* plugins,
   *minus* the workspace plugins.

 - The models returned are IPluginModel's (really BundlePluginModel's), which
   don't do IEditableModel, and hence do not support the save() method. They
   provide save(PrintWriter), but I suspect that might interfere with caching,
   notifications, or other stuff going on under the hood.

I surmise that the PluginModelManager was not the right fellow to talk to, but
that a WorkspaceModelManager would be more friendly to my cause (in part since
WorkspacePluginModel implements IEditableModel).

Unfortunately, WorkspaceModelManager provides no way to get at anything other
than IFeatureModel's, which won't help, unless the plugin I want to manipulate
happens to live inside a feature.

I know I'm treading on internal stuff here, so if there's API I should be
using instead, please point me at it!

Thanks for any assistance you can lend...

Cheers,
  -- Bob




Back to the top