Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » TabbedProperties wont appear
TabbedProperties wont appear [message #1045745] Sat, 20 April 2013 20:14 Go to next message
Lars H. is currently offline Lars H.Friend
Messages: 1
Registered: April 2013
Junior Member
Hi,

I'm trying to add a TabbedPropertySheet based on the following tutorial: http://www.eclipse.org/articles/Article-Tabbed-Properties/tabbed_properties_view.html A difference is that I'm using a TreeViewer but that shouldn't matter.

I'm just getting the message "Properties are not available".

Thats is how I implemented it so far

The view: (Contributor ID is unique [org.test.view])

 public class MyTreeView extends ViewPart implements TabbedPropertySheetPageContributor{

     public String getContributorId() {
         return getSite().getId();
     }

     public Object getAdapter(Class adapter) {
         if (adapter == IPropertySheetPage.class)
             return new TabbedPropertySheetPage((ITabbedPropertySheetPageContributor) this);
         return super.getAdapter(adapter);
     }
     public void createPartControl(Composite parent) {
     ...    
        getSite().setSelectionProvider(viewer);
     }
}


The plugin.xml

 <extension point="org.eclipse.ui.views.properties.tabbed.propertyContributor">
     <propertyContributor contributorId="org.test.view">
        <propertyCategory category="sample"/>
     </propertyContributor>
 </extension>

 <extension point="org.eclipse.ui.views.properties.tabbed.propertyTabs">
    <propertyTabs contributorId="org.test.view">
    <propertyTab
        category="sample"
        id="org.test.TestTab"
        label="Test"/>
    </propertyTabs>
 </extension>

 <extension point="org.eclipse.ui.views.properties.tabbed.propertySections">
    <propertySections contributorId="org.test.view">
    <propertySection
           class="org.test.properties.TestSection"
           id="org.test.TestSection"
           tab="org.test.TestTab">
    </propertySection>
    </propertySections>
 </extension>


The property page with the control:

public class TestSection extends AbstractPropertySection {
    private Text labelText;

    public TestSection() {

    }

    @Override
    public void createControls(Composite parent,
            TabbedPropertySheetPage aTabbedPropertySheetPage) {
        super.createControls(parent, aTabbedPropertySheetPage);
     Composite composite = getWidgetFactory()
            .createFlatFormComposite(parent);
        FormData data;

        labelText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
        data = new FormData();
     data.left = new FormAttachment(0, STANDARD_LABEL_WIDTH);
        data.right = new FormAttachment(100, 0);
     data.top = new FormAttachment(0, ITabbedPropertyConstants.VSPACE);
        labelText.setLayoutData(data);

        CLabel labelLabel = getWidgetFactory()
            .createCLabel(composite, "Label:"); //$NON-NLS-1$
        data = new FormData();
        data.left = new FormAttachment(0, 0);
        data.right = new FormAttachment(labelText,
            -ITabbedPropertyConstants.HSPACE);
        data.top = new FormAttachment(labelText, 0, SWT.CENTER);
        labelLabel.setLayoutData(data);
    }

    @Override
     public void setInput(IWorkbenchPart part, ISelection selection) {
         super.setInput(part, selection);
         Assert.isTrue(selection instanceof IStructuredSelection);
         Object input = ((IStructuredSelection) selection).getFirstElement();
         Assert.isTrue(input instanceof Action);
         Action action = (Action)input;
         this.labelText.setText(action.getDescription());
     }


The problem is that the method createControls in the class TestSection is not being called.

Does anybody have an idea what I am doing wrong?

Thanks in advance
Lars
Re: TabbedProperties wont appear [message #1113426 is a reply to message #1045745] Sat, 21 September 2013 04:40 Go to previous message
Lee simple is currently offline Lee simpleFriend
Messages: 1
Registered: September 2013
Junior Member
Hi,

I'm a newbie. I met the same problem with you. Do you solve it?

Thanks for sharing
Lisa
Previous Topic:Renaming a compilation unit
Next Topic:Adding "standard" menu items to Eclipse RCP?
Goto Forum:
  


Current Time: Wed Apr 24 23:12:15 GMT 2024

Powered by FUDForum. Page generated in 0.02902 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top