capint
11/4/2015 - 5:08 PM

Eclipse >> UI >> Property view

Eclipse >> UI >> Property view

public class LabelSection
        extends AbstractPropertySection {
  ...
  //*** Notifies the section that the workbench selection has changed
  @Override
  public void setInput(IWorkbenchPart part_p, ISelection selection_p) {
  }
}
<extension point="org.eclipse.ui.views.properties.tabbed.propertySections">
   <propertySections contributorId="mview.views.SampleView">
      <propertySection
            class="mview.views.LabelSection"
            id="mview.LabelSection"
            tab="mview.ButtonTab">
         <input type="mview.views.ButtonElement"/>
      </propertySection>
      <propertySection
            afterSection="mview.LabelSection"
            class="mview.views.SizeSection"
            id="mview.SizeSection"
            tab="mview.ButtonTab">
         <input type="mview.views.ButtonElement"/>
      </propertySection>
      <propertySection
            afterSection="mview.SizeSection"
            class="mview.views.FontSection"
            id="mview.FontSection"
            tab="mview.ButtonTab">
         <input type="mview.views.ButtonElement"/>
      </propertySection>
      <propertySection
            class="org.eclipse.ui.views.properties.tabbed.AdvancedPropertySection"
            id="mview.AdvancedSection"
            tab="mview.AdvancedTab">
         <input type="mview.views.ButtonElement"/>
      </propertySection>
   </propertySections>
</extension
<extension point="org.eclipse.ui.views.properties.tabbed.propertyTabs">
   <propertyTabs contributorId="mview.views.SampleView">
      <propertyTab
         category="sample"
            id="mview.ButtonTab"
         label="Button"/>
      <propertyTab
         afterTab="mview.ButtonTab"
         category="sample"
            id="mview.AdvancedTab"
         label="Advanced"/>
   </propertyTabs>
</extension>
//*** In the Sample View:
//*** We need to implement the ITabbedPropertySheetPageContributor interface
public String getContributorId() {
  return getSite().getId(); //mview.views.SampleView
}

//*** and return the good TabbedPropertySheetPage
public Object getAdapter(Class adapter) {
    if (adapter == IPropertySheetPage.class)
        return new TabbedPropertySheetPage(this);
    return super.getAdapter(adapter);
}
Source: https://eclipse.org/articles/Article-Tabbed-Properties/tabbed_properties_view.html
<!-- Most frequently, this identifier matches the unique workbench part id that is contributing the tabbed properties view -->
<extension point="org.eclipse.ui.views.properties.tabbed.propertyContributor">
   <propertyContributor contributorId="mview.views.SampleView"/>
</extension>