Skip to main content



      Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » File Selection from within VariableResolver
File Selection from within VariableResolver [message #646424] Thu, 23 December 2010 19:24 Go to next message
Eclipse UserFriend
I'm trying to get the list of selected files from the selection service (I was using the old Navigator, which worked).

My code is:


class SelectionHolder {
public ISelection s;
}

public class SelectedWorkspaceItemsResolver implements IDynamicVariableResolver {

@Override
public String resolveValue(IDynamicVariable arg0, String arg1) throws CoreException {
final IWorkbench wb = PlatformUI.getWorkbench();
final IWorkbenchWindow win = wb.getWorkbenchWindows()[0];
final ISelectionService svc = win.getSelectionService();
final SelectionHolder h = new SelectionHolder();
Display disp = wb.getDisplay();
disp.syncExec(new Runnable() {
@Override
public void run() {
h.s = svc.getSelection();
}
});

...

but I'm not seeing a selection result. Hints?
Re: File Selection from within VariableResolver [message #646425 is a reply to message #646424] Thu, 23 December 2010 19:29 Go to previous message
Eclipse UserFriend
Ooops. Take that back. I see the selection when I use Navigator, but not when I use the Java Package Explorer or the Project explorer....the rest of my code is looking for IFile objects iff the selection is an ITreeSelection.

That is probably the problem. I'll read more of the docs about the selections returned.
Previous Topic:JNI java.lang.UnsatisfiedLinkError with chain of libraries
Next Topic:Add ConsoleView to Perspective
Goto Forum:
  


Current Time: Sat Jul 05 22:49:39 EDT 2025

Powered by FUDForum. Page generated in 0.03639 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top