自定义 RCP PropertySheet

首先 我们先说一下 property tabbed 的实现。
我们可以通过三个扩展点 来实现 属性的多页码显示。


1:propertyContributor
<extension
point="org.eclipse.ui.views.properties.tabbed.propertyContributor">
<propertyContributor
contributorId="gef.propertyContributor1">
<propertyCategory
category="gef.category">
</propertyCategory>
</propertyContributor>
</extension>

2:propertyTabs
<extension
point="org.eclipse.ui.views.properties.tabbed.propertyTabs">
<propertyTabs
contributorId="gef.propertyContributor1">
<propertyTab
category="gef.category"
id="gef.propertyTab1"
label="aa">
</propertyTab>
</propertyTabs>
</extension>

3:propertySections
<extension
point="org.eclipse.ui.views.properties.tabbed.propertySections">
<propertySections
contributorId="gef.propertyContributor1">
<propertySection
class="gef.model.property.session.ModelPropertSection"
filter="gef.model.property.filter.ModelFilter"
id="gef.propertySection1"
tab="gef.propertyTab1">
<input
type="org.eclipse.gef.editparts.AbstractEditPart">
</input>
</propertySection>
</propertySections>
</extension>

在实现 分页中有一点非常重要,需要在你part 添加:
public Object getAdapter(Class type) {

if (type == IPropertySheetPage.class) {

return new TabbedPropertySheetPage(this);
}
return super.getAdapter(type);
}

这一点非常重要,千万别忘了。 并且代码中的 Contributord 一定要与 plugin.xml中的一致。


现在 通过三个扩展 就可以实现 属性分页的功能了。

如何属性的页面中,定制自己的节目呢?
下面我们就需要研究下面两个类了。

这个是标准的 key value 的展现形式。
org.eclipse.ui.views.properties.tabbed.AdvancedPropertySection;
我们可以参考上面的代码,扩展下面的类,来实现自己的属性界面。
org.eclipse.ui.views.properties.tabbed.AbstractPropertySection;
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值