我创建了一个新的 Eclipse 插件来安装新的 View 。 经过一些操作后,我用标记填充此 View 。
View 仅显示前 100 个标记,如下图所示:
Eclipse Markers http://www.imageupload.co.uk/images/2014/02/27/Markers.png
如何提高 100 个标记的限制?
这是我实现 View 的方法:
plugin.xml:
<extension
id="code_presentation.marker"
name="Code Presentation Markers"
point="org.eclipse.core.resources.markers">
<persistent
value="true">
</persistent>
<super
type="org.eclipse.core.resources.textmarker">
</super>
<attribute
name="owner">
</attribute>
</extension>
<extension
point="org.eclipse.ui.editors.annotationTypes">
<type
markerSeverity="0"
markerType="code_presentation.marker"
name="code_presentation.marker.type">
</type>
</extension>
<extension
point="org.eclipse.ui.editors.markerAnnotationSpecification">
<specification
annotationType="code_presentation.marker.type"
colorPreferenceKey="code_presentation.marker.type.color"
colorPreferenceValue="255,255,0"
contributesToHeader="true"
highlightPreferenceKey="code_presentation.marker.type.highlight"
highlightPreferenceValue="false"
includeOnPreferencePage="true"
isGoToNextNavigationTargetKey="code_presentation.marker.type.nextnavigation"
isGoToNextNavigationTarget="true"
isGoToPreviousNavigationTargetKey="code_presentation.marker.type.previousnavigation"
isGoToPreviousNavigationTarget = "true"
icon="icons/Code_Presentation_Small.png"
label="Qac error marker"
overviewRulerPreferenceKey="code_presentation.marker.type.overview"
overviewRulerPreferenceValue="true"
presentationLayer="0"
textPreferenceKey="code_presentation.marker.type.text"
textPreferenceValue="false"
textStylePreferenceValue="BOX"
verticalRulerPreferenceKey="code_presentation.marker.type.ruler"
verticalRulerPreferenceValue="true">
</specification>
</extension>
<extension
point="org.eclipse.ui.views">
<view
class="code_presentation.markersview.MyCustomMarkersView"
icon="icons/Code_Presentation_Small.png"
id="code_presentation.markersview.customMarker"
name="Code Presentation Markers">
</view>
</extension>
<extension
point="org.eclipse.ui.ide.markerSupport">
<markerField
class="code_presentation.markersview.JustificationField"
id="code_presentation.markersview.Justificationfield"
name="Justification">
</markerField>
<markerContentGenerator
id="code_presentation.markersview.myCustomMarkerGenerator"
name="My Marker Generator">
<markerTypeReference
id="code_presentation.marker"/>
<markerFieldReference
id="org.eclipse.ui.ide.priorityField"/>
<markerFieldReference
id="org.eclipse.ui.ide.severityAndDescriptionField"/>
<markerFieldReference
id="org.eclipse.ui.ide.resourceField"/>
<markerFieldReference
id="org.eclipse.ui.ide.locationField"/>
<markerFieldReference
id="code_presentation.markersview.justificationfield"/>
</markerContentGenerator>
</extension>
我有三个 java 文件,如下图所示:
First File Code. http://www.imageupload.co.uk/images/2014/02/27/Untitled1z3Sd6.png
Second File Code. http://www.imageupload.co.uk/images/2014/02/27/Untitled2.png
Third File Code. http://www.imageupload.co.uk/images/2014/02/27/Untitled3.png
最佳答案
限制设置为org.eclipse.ui.internal.views.markers.MarkerContentGenerator
但这是一个内部类,因此无法直接访问。
唯一设置限制的是 org.eclipse.ui.internal.views.markers.FiltersConfigurationDialog
这也是内部的。
您可以通过为命令 id org.eclipse.ui.ide.configureFilters
添加菜单内容来显示此过滤器配置对话框。 .
这是问题 View plugin.xml菜单定义的一部分,链接到过滤器菜单:
<extension
point="org.eclipse.ui.menus">
<menuContribution
locationURI="menu:org.eclipse.ui.views.ProblemView">
<command
commandId="org.eclipse.ui.ide.configureFilters"
mnemonic="%command.configureFilters.mnemonic"
style="push">
</command>
</menuContribution>
</extension>
您应该能够为您的 View 执行类似的操作。
关于java - Eclipse 插件自定义 View 标记数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22012817/