【发布时间】:2016-03-14 13:57:13
【问题描述】:
我在我的 Eclipse RCP 应用程序的上下文菜单中实现了一个条目。该函数应该以另一种格式导出右键单击的文件。我已经实现了转换功能。
我需要的是右键文件的路径和名称。这就是我所拥有的:
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
Shell shell = new Shell();
DirectoryDialog dialog = new DirectoryDialog(shell);
String saveToPath = dialog.open();
String filePath = // ... how to access the clicked file?
exportOtherFormat(filePath, saveToPath);
return null;
}
所以基本上我想知道,如何访问右键单击的文件,特别是路径和名称。
【问题讨论】:
标签: java path eclipse-plugin eclipse-rcp filepath