private void addPlugin(String id, String version) { IProduct product = getProduct(); IProductModelFactory factory = product.getModel().getFactory(); IProductPlugin plugin = factory.createPlugin(); plugin.setId(id); plugin.setVersion(version); product.addPlugins(new IProductPlugin[] {plugin}); fPluginTable.setSelection(new StructuredSelection(plugin)); }
private void handleProperties() { IStructuredSelection ssel = (IStructuredSelection) fPluginTable.getSelection(); if (ssel.size() == 1) { IProductPlugin plugin = (IProductPlugin) ssel.toArray()[0]; VersionDialog dialog = new VersionDialog(PDEPlugin.getActiveWorkbenchShell(), isEditable(), plugin.getVersion()); dialog.create(); SWTUtil.setDialogSize(dialog, 400, 200); if (dialog.open() == Window.OK) { plugin.setVersion(dialog.getVersion()); } } }