1.add Dependences:org.eclipse.ui.views.properties.tabbed
2.add 3 extentions:
1:org.eclipse.ui.views.properties.tabbed.propertyContributor主要设置其ID并定义一个Category
这个是全局性的,要使用该propertyContributor的part必须实现ITabbedPropertySheetPageContributor接口
重写两个方法:
public String getContributorId() {
return BpmnDiagramEditor.ID_PROPERTY_SHEET_PAGE;// 该propertyContributor的ID
}
@Override
public Object getAdapter(Class type) {
if (type == IPropertySheetPage.class) {
return getTabbedPropertySheetPage();
}
return super.getAdapter(type);
}
protected TabbedPropertySheetPage getTabbedPropertySheetPage() {
if (propertySheetPage == null) {
propertySheetPage = new TabbedPropertySheetPage(this);
}
return propertySheetPage;
}
2:org.eclipse.ui.views.properties.tabbed.propertyTabs:
首先设置contributorId 为刚才的ID,凡是用到的contributorId 均是一致的。
并定义所需的Tab
3:org.eclipse.ui.views.properties.tabbed.propertySections
设置contributorId(同上),定义Sections, 每一个Section对应于一个上面定义的Tab,
Section用来定制页面的显示,必须为其提供一个Input类型,否则不可用。