java - ViewPart 或编辑器中的 Eclipse RCP 文件浏览器?

标签 java eclipse filesystems eclipse-rcp

我正在 Eclipse RCP 中使用 TreeViewer 实现一个文件浏览器。最好将它放在编辑器或 ViewPart 中。我问是因为,我需要能够为浏览器传递根路径,但不知道如何通过 View 来传递。由于 View 不是直接实例化的。

最佳答案

来自Eclipse FAQ ,关于编辑器和 View 之间的差异:

  • There is generally only one instance of a given view per workbench page, but there can be several instances of the same type of editor.
  • Editors can appear in only one region of the page, whereas views can be moved to any part of the page and minimized as fast views.
  • Editors can be in a dirty state, meaning that their contents are unsaved and will be lost if the editor is closed without saving.
  • Views have a local toolbar, whereas editors contribute buttons to the global toolbar.
  • Editors can be associated with a file name or an extension, and this association can be changed by users.

您的文件浏览器真的可以在这里使用 View 而不是编辑器。

您可以通过以下方式获取所有实例化的View:

 PlatformUI.getWorkbench().getViewRegistry().getViews();

然后得到它from its view id .

关于java - ViewPart 或编辑器中的 Eclipse RCP 文件浏览器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3401692/

相关文章:

Java、ASM : How to Get Opcode Name and TagValue from ASM InsnNode?

eclipse - 在 Eclipse 插件中,在滚动时不移动的 StyledText 中的绘图框

java - Parcel//ArrayList 的问题

node.js - TypeScript + Node.js 文件系统问题

go - 如何为滚动文件系统日志配置 uber-go/zap 记录器?

java - 如何从 JTextArea 中一行一行地删除

java - 使用java api将数据 append 到hadoop中的文件

java - 从外部库 jython 导入

python - Windows的这个符号链接(symbolic link)遍历代码有什么问题吗?

java - 需要 bean 的 JSONObject 构造函数不会映射父类(super class)中的属性