Community
Participate
Working Groups
The "Plug-in with a View" template for PDE does not set the site selection provider in the createPartControl method. Therefore, pop-up items do not work as expected when the example is used out-of-the-box.
Can you please list down the steps to recreate the problem?
If I can find where the example is, I can submit a patch :) Steps to reproduce: 1. Create new plug-in project, based on Eclipse, will contribute to UI, not RCP 2. Next -> Next 3. Select "Plug-in with a view" example Source code for SampleView is created as follows: public void createPartControl(Composite parent) { viewer = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL); viewer.setContentProvider(new ViewContentProvider()); viewer.setLabelProvider(new ViewLabelProvider()); viewer.setSorter(new NameSorter()); viewer.setInput(getViewSite()); // Create the help context id for the viewer's control PlatformUI.getWorkbench().getHelpSystem().setHelp(viewer.getControl(), "example.viewer"); makeActions(); hookContextMenu(); hookDoubleClickAction(); contributeToActionBars(); } The code should have getSite().setSelectionProvider(viewer); To test: run the application, go to the view. Select an item. Note that the selection doesn't change (use the selection spy to see). Add line, re-run view, make a selection, and the selection does change.
In org.eclipse.pde.ui.templates, you can check org.eclipse.pde.ui.templates\templates_3.0\view\java\$className$.java The base level function called is org.eclipse.pde.ui.templates.AbstractNewPluginTemplateWizard.performFinish
Suggested change: https://git.eclipse.org/r/28929
http://git.eclipse.org/c/pde/eclipse.pde.ui.git/commit/?id=665c6be26f708ce414df6852464946500207ff40 Looks good, merged with master I see you included the Bug: tag in the commit message which is great, but please consider putting the bug number in the first line of the message as well. Makes for easier lookups when using git.eclipse.org.
Why can't you use this instead? https://git.eclipse.org/r/#/q/tr:438059,n,z Put any bug number in there, you'll get the change. Much easier than using a reference in the first line of a commit.
(In reply to Alex Blewitt from comment #6) > Why can't you use this instead? > > https://git.eclipse.org/r/#/q/tr:438059,n,z > > Put any bug number in there, you'll get the change. Much easier than using a > reference in the first line of a commit. I find the log page at git.eclipse.org a lot easier to read with the bug numbers at the start. Same goes for the eGit history view.
OK, I'll bear that in mind for future for PDE. But it seems to be a CVS/SVN convention that has been carried forward into Git - and that only existed because there wasn't a good way of having multi-line commits or fast indexing them. You'll note that the JGit and EGit projects don't put bug numbers in the first line of the message: https://git.eclipse.org/c/egit/egit.git/log/ https://git.eclipse.org/c/jgit/jgit.git/log/ Anyway, I wanted to point out that in general Git repositories refer to bugs in the footer, rather than in the first subject line. Still, I'll try and remember to provide submissions with bug in for PDE in the future.
verified on 4.5 M1 eclipse-SDK-I20140806-2000-win32