on Eclipse plug-in:how to implement such a propert

2019-05-22 14:30发布

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

alt text

How to do it? thx.

1条回答
Luminary・发光体
2楼-- · 2019-05-22 15:11

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.

查看更多
登录 后发表回答