简体   繁体   English

如何在Eclipse Problems View中的属性对话框中添加自定义项

[英]How to add custom item to properties dialog in Eclipse Problems View

I need to add custom item to properties dialog in Eclipse Problems View like this: 我需要像这样在Eclipse Problems View中的属性对话框中添加自定义项:

在此处输入图片说明

I originally thought that adding custom column will do the trick, but obviously it was a wrong idea. 我本来以为添加自定义列可以解决问题,但是显然这是一个错误的主意。

I will be grateful for any ideas. 我将不胜感激。 Thanks! 谢谢!

EDIT: 编辑:

Actually there is a straightforward way how to do it after all - overriding MarkersPropertyPage: 毕竟,实际上有一种直接的方法-覆盖MarkersPropertyPage:

public class MyMarkersPropertyPage extends MarkersPropertyPage{ 
@Override
protected Control createContents(final Composite parent)
{
    final Composite c = (Composite) super.createContents(parent);
    createCustomArea(c);

    return c;
}

private void createCustomArea(final Composite parent)
{ // contribution
}

...and hide the Eclipse one using activities: ...并使用活动隐藏Eclipse:

    <extension
        point="org.eclipse.ui.activities">
            <activity id="your.activity.id" name="disabledActivity">
            </activity>
    <activityPatternBinding
            activityId="your.activity.id"
            isEqualityPattern="true"
            pattern="org.eclipse.ui.ide/org.eclipse.ui.ide.markerEntry">
      </activityPatternBinding>>
   </extension>

This property page is provided by the org.eclipse.ui.internal.views.markers.MarkersPropertyPage property page. 此属性页由org.eclipse.ui.internal.views.markers.MarkersPropertyPage属性页提供。

Looking at the source of MarkersPropertyPage it does not support any way to add to the page. 查看MarkersPropertyPage的来源,它不支持任何添加到页面的方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM