/* (non-Javadoc) * @see org.eclipse.pde.internal.core.IPluginModelListener#modelsChanged(org.eclipse.pde.internal.core.PluginModelDelta) */ public void modelsChanged(PluginModelDelta delta) { final Control control = fPluginTable.getControl(); if (!control.isDisposed()) { control .getDisplay() .asyncExec( new Runnable() { public void run() { if (!control.isDisposed()) { fPluginTable.refresh(); updateRemoveButtons(true, true); } } }); } }
private void createImpTable(Composite container) { fElementViewer = new TableViewer(container, SWT.MULTI | SWT.V_SCROLL | SWT.BORDER); GridData gd = new GridData(GridData.FILL_BOTH); gd.heightHint = 250; fElementViewer.getControl().setLayoutData(gd); fElementViewer.getControl().setFont(container.getFont()); fElementViewer.setContentProvider( new DefaultTableProvider() { public Object[] getElements(Object inputElement) { ITargetDefinition target = getTargetDefinition(); if (target != null) { NameVersionDescriptor[] bundles = target.getImplicitDependencies(); if (bundles != null) { return bundles; } } return new NameVersionDescriptor[0]; } }); fElementViewer.setLabelProvider(new StyledBundleLabelProvider(false, false)); fElementViewer.setInput(PDEPlugin.getDefault()); fElementViewer.setComparator( new ViewerComparator() { public int compare(Viewer viewer, Object e1, Object e2) { NameVersionDescriptor bundle1 = (NameVersionDescriptor) e1; NameVersionDescriptor bundle2 = (NameVersionDescriptor) e2; return super.compare(viewer, bundle1.getId(), bundle2.getId()); } }); fElementViewer.addSelectionChangedListener( new ISelectionChangedListener() { public void selectionChanged(SelectionChangedEvent event) { updateImpButtons(); } }); fElementViewer .getTable() .addKeyListener( new KeyAdapter() { public void keyPressed(KeyEvent e) { if (e.character == SWT.DEL && e.stateMask == 0) { handleRemove(); } } }); }