1

I'm developing my custom text editors in Eclipse. For the configuration of my text editors, I have to access the current file which is being opened.

It is no problem, if the file is opened by being selected in project explorer:

    ISelection selection = PlatformUI.getWorkbench()
            .getActiveWorkbenchWindow().getSelectionService().getSelection();

My question is: How can I access the file, if it is being opened at the startup ? Eclipse remembers the files which were opened before the last termination, but there is no ISelection which would provide me the selected IResource.

4

1 回答 1

0

您可以使用 IPartListener2 接口在打开编辑器时收到通知。我在这里谈过。

于 2012-05-12T03:17:42.430 回答