简体   繁体   English

选项卡式属性视图-来自同一IPropertySource的不同选项卡中的不同属性

[英]Tabbed Property View - different properties in different tabs from same IPropertySource

I am currently trying to put more tabs in the Tabbed Properties View as per this link , and from the same implementing class of IPropertySource I want to take out different properties for each tab. 我目前正在尝试根据此链接在“选项卡式属性视图”中放置更多选项卡,并且从IPropertySource的同一实现类中,我想为每个选项卡提取不同的属性。

At the moment, all the three tabs contain the entire property list. 目前,所有三个选项卡都包含整个属性列表。 Is there any elegant way of doing this? 有什么优雅的方法吗?
标签页

Thanks for your support, I will add more code if needed. 感谢您的支持,如果需要,我将添加更多代码。

I had the same problem. 我有同样的问题。

My solution was to create for each Tab a Selection class (implements IPropertySource ) and a Section class (extends AbstractPropertySection ). 我的解决方案是为每个Tab创建Selection类(实现IPropertySource )和Section类(扩展AbstractPropertySection )。 Then I created a new class “wrapper”, that implements ISelection and contains an array of ISelection . 然后,我创建了一个新类“包装器”,该类实现ISelection并包含ISelection数组。 In each Section class (ie public class InformationSection extends AbstractPropertySection ) I've used this “wrapper” class in setInput method from the AbstractPropertySection to store the StructuredSelection items. 在每个Section类中(即, public class InformationSection extends AbstractPropertySection ),我在AbstractPropertySection setInput方法中使用了该“包装器”类来存储StructuredSelection项。 After that with wrapper.getSelection()[0].getFirstElement I accesed all properties of Information Tab. 之后,使用wrapper.getSelection()[0].getFirstElement “信息”选项卡的所有属性。

I hope that my answer will help you. 希望我的回答对您有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM