使用Eclipse3.2的标签属性视图

英文:http://www.eclipse.org/articles/Article-Tabbed-Properties/tabbed_properties_view.html
在我开发插件DBDA(Database Development Assistant-”数据库开发助手“,我自已开发的一个数据库插件)时,有一个问题困扰了我很久,如何实现对同一个数据库对象,在不同的平台下显示不同的属性页,最好属性页能以标签的行式出现,我自已到是实现了一个这样的功能,但时经常会出现一些问题,而且性能也不是很好,直到我在Eclipse的网站上看到上面所提的那篇文章,我才发现问题有这么好的解决方法。
在Eclipse3.2中加入了一个插件“标签属性视图”( org.eclipse.ui.views.properties.tabbed),这个插件有三个扩展点:
  • org.eclipse.ui.views.properties.tabbed.PropertyContributor
  • org.eclipse.ui.views.properties.tabbed.PropertyTabs
  • org.eclipse.ui.views.properties.tabbed.PropertySections

Property Contributor

扩展点org.eclipse.ui.views.properties.tabbed.PropertyContributor是标签属性视图的关键. It most importantly identifies the unique contributor identifier for your tabs and sections. Most frequently, this identifier matches the unique workbench part id that is contributing the tabbed properties view.

Note that a property contributor can be shared among several workbench parts. For example, an application may have an explorer view, editor and outline whose selections share a common set of properties. In this case, all three workbench parts can share the same tabbed properties view as identified by the unique contributor identifier.

A workbench part cannot make use of two or more property contributors. It can identify a single property contributor by implementing the ITabbedPropertySheetPageContributor interface.

PropertyContributor扩展点定义了以下属性 :

typeMapper实现类型映射器的类.
labelProviderThe class that implements the label provider for the title bar.
propertyCategory一个或多个用于组织标签的种类属性.

Property Tabs

org.eclipse.ui.views.properties.tabbed.PropertyTabs 扩展点描述给于一个贡献者( contributor)的标签 (tabs) . Each tab belongs to one contributor as identified by its unique contributor identifier. The PropertyTabs extension point can define one or more tabs through the PropertyTab attribute.

A ProperyTab defines the following attributes:

idThe unique id for the tab.
labelThe label to be displayed on the tab.
categoryThe category from the PropertyContributor extension point used to group tabs.
afterTabWhen there is more than one tab in a category, tabs are sorted by the afterTab attribute.
imageThe optional image to display on the tab.
indentedtrue if the tab is indented.

Property Sections

The org.eclipse.ui.views.properties.tabbed.PropertySections extension point describes the sections for a contributor. Each section belongs to one configuration as identified by its unique contributor identifier.

The PropertySections extension point can define one or more sections through the PropertySection attribute. Each section belongs to one tab as identified by its unique tab identifier.

The PropertySection defines the following attributes:

idThe unique id for the section.
tabThe unique tab id in which this section appears.
classThe class that implements the section
afterSectionWhen there is more than one section in a tab, sections are sorted by the afterSection attribute.
filterThe class that implements a section filter.
enablesFora value indicating the selection count which must be met to enable the section. If specified and the condition is not met, the section is filtered. If omitted, the section enablement is not affected.
The following attribute formats are currently supported:
n - a precise number of items selected. For example: enablesFor=" 1" enables the section only when 1 item is selected

The PropertySection also defines one or more input type attributes. Each type is a class or interface that the selection must match for the section to be displayed on the tab.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值