在Eclipse插件上:如何实现这样的属性视图? [英] on Eclipse plug-in:how to implement such a property view?

查看:247
本文介绍了在Eclipse插件上:如何实现这样的属性视图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在PropertyView / PropertySheet中显示一个对象数组,就像这样:





如何做?
thx。

解决方案

您可以按照 eclipse提示:根据 http://blog.eclipse-tips.com/2009/05/how-to-create-pagebookview.htmlrel =nofollow noreferrer> PageBookView (这是一种显示所选元素在活动部分中的属性的视图,每当选择更改或活动部分更改时,它会跟踪它们并显示属性,除非您使用Pin to selection功能从3.5提供)。 b

文字>

 < view 
class =com.eclipse_tips.views.CustomPropertiesView
icon =icons / sample.gif
id =com.eclipse-tips.views.customePropertiesView
name =My属性视图>
< / view>

后跟:

  public class CustomPropertiesView extends PropertySheet {

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

现在这将对项目资源管理器的属性而不是你自己的一套属性)。

所以你需要回到 PageBookView文章,了解如何实现自己的显示。


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

How to do it? thx.

解决方案

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).

<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.

这篇关于在Eclipse插件上:如何实现这样的属性视图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆