Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[pde-dev] Path of currently edited file

Hello!

I have a plug-in with following action:

public class SampleAction implements IWorkbenchWindowActionDelegate {
	private IWorkbenchWindow window;

        ...
	/**
	 * The action has been activated. The argument of the
	 * method represents the 'real' action sitting
	 * in the workbench UI.
	 * @see IWorkbenchWindowActionDelegate#run
	 */
	public void run(IAction action) {
		JOptionPane.showMessageDialog(null, "test");
	}
        ...
}

when the action is called, I want to display the path of currently open file in
the JOptionPane.

How can I fetch the path of the file in currently selected editor?

For instance, in the screenshot

http://dapissarenko.com/resources/2005_04_12_screenshot.jpg

the plug-in should display the path of the file SampleAction.java.

Thanks in advance

Dmitri Pissarenko

--
Dmitri Pissarenko
Software Engineer
http://dapissarenko.com


Back to the top