不带 IAdaptable 的 Eclipse 属性视图
我尝试在 Eclipse RCP 应用程序中为图形模型创建属性视图。图形元素来自非 Eclipse 库,因此不实现 IAdaptable 甚至 IPropertySource。
选项卡式属性视图,解释如下: http://www.eclipse.org/articles/Article-Tabbed-Properties /tabbed_properties_view.html 似乎是一个简单的可能性 - 但仅适用于实现 IAdaptable 的输入。
我考虑过实现我自己的 IPropertySheetPage,但我发现的唯一实现是内置的 PropertySheetPage 和 TabbedPropertySheetPage,它们非常复杂。
是否有另一种方法可以为未实现 IAdaptable 的输入元素创建属性视图?我可以以我还没有看到的方式使用选项卡式属性视图吗?我可以看看还有其他不太复杂的 IPropertySheetPage 实现吗?
谢谢你!
克里斯蒂娜
I tried to create a properties view for a graph model in an Eclipse RCP Application. The graph elements are from a non-eclipse library and so don't implement IAdaptable or even IPropertySource.
The Tabbed Properties View, explained here:
http://www.eclipse.org/articles/Article-Tabbed-Properties/tabbed_properties_view.html
seems to be a simple possibility - but only for inputs that implement IAdaptable.
I've thought about implementing my own IPropertySheetPage but the only implementations I found are the built-in PropertySheetPage and TabbedPropertySheetPage which are very complex.
Is there another way to create a properties view for input elements that don't implement IAdaptable? Can I use Tabbed Properties View in a way I don't see yet? Are there any other less complex implementations of IPropertySheetPage, I can look at?
Thank you!
Kristina
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
实际上,您可以为未实现 IAdaptable 的对象编写一个 IAdapterFactory 并将其注册到plugin.xml 或插件激活器中。请参阅http://www.eclipsezone.com/eclipse/forums/t61666.html。
Actually, you can write an
IAdapterFactory
for objects which don't implementIAdaptable
and register it inplugin.xml
or in your plugin activator. See http://www.eclipsezone.com/eclipse/forums/t61666.html.简短的回答:不。
但是为什么不将不可适应的对象包装到您自己的实现 IAdaptable 或 IPropertySource 或其他什么的对象中,以便属性页可以与您的包装器一起使用,该包装器保存您想要通过其编辑的对象属性页。并且不要将此“库”对象提供给全局适配器机制,而是创建包装器,设置对象并将其提供给全局选择服务或其他服务。
Short answer: No.
But why don't you wrap the non-adaptable object into your own object that implements IAdaptable or IPropertySource or whatever, so that the property-page can work with your wrapper which holds the object you want to make editable through the property-page. And instead of providing this "library" object to global adapter-mechanism, create the wrapper, set the object and provide it to your global selection-service or whatever.