views:

67

answers:

1

I want to display a array of objects in PropertyView/PropertySheet,just like this:

alt text

How to do it? thx.

A: 

You can follow this eclipse tips: creating a custom property view, based on PageBookView (which is the kind of view which displays the properties of the selected element in the active part. Whenever the selection changes or the active part changes, it tracks them and displays the properties, unless you used the 'Pin to selection' feature available from 3.5).

alt text

<view
  class="com.eclipse_tips.views.CustomPropertiesView"
  icon="icons/sample.gif"
  id="com.eclipse-tips.views.customePropertiesView"
  name="My Properties View">
</view>

Followed by:

public class CustomPropertiesView extends PropertySheet {

 @Override
 protected boolean isImportant(IWorkbenchPart part) {
  if (part.getSite().getId().equals(IPageLayout.ID_PROJECT_EXPLORER))
   return true;
  return false;
 }
}

Now this would react to properties from the project explorer (and not your own set of properties).
So you need to get back to the PageBookView article and see how to implement your own display.

VonC