Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » File Selection from within VariableResolver
File Selection from within VariableResolver [message #646424] Fri, 24 December 2010 00:24 Go to next message
Tony  is currently offline Tony Friend
Messages: 4
Registered: June 2010
Junior Member
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] Fri, 24 December 2010 00:29 Go to previous message
Tony  is currently offline Tony Friend
Messages: 4
Registered: June 2010
Junior Member
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: Thu Nov 27 00:34:35 GMT 2014

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

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