How to enable the Next Annotation/Previous Annotation buttons for an editor [message #313900] |
Tue, 27 March 2007 14:23  |
Eclipse User |
|
|
|
Hi,
I wrote an editor that is derived from AbstractDecoratedTextEditor, and
this editor has specific annotations that work fine. The annotation also
shows up in the "Next Annotation"/"Previous Annotation" drop-down tool
bar buttons. But "Next Annotation"/"Previous Annotation" buttons are
generally disabled in my editor, while they are active for example in
the Java editor.
I read in previous posts that people wanted to disable the action set
"org.eclipse.ui.edit.text.actionSet.annotationNavigation", but I have
the opposite problem. How can I enable this action set for my editor?
Thanks
Stephan
<extension point="org.eclipse.ui.editors.annotationTypes">
<type name="com.todo.plugin.annotate.version"/>
</extension>
<extension
point="org.eclipse.ui.editors.markerAnnotationSpecification ">
<specification
annotationType="com.todo.plugin.annotate.version"
colorPreferenceKey="annotateIndicationColor"
colorPreferenceValue="0,128,0"
contributesToHeader="false"
highlightPreferenceKey="annotateHighlighting"
highlightPreferenceValue="false"
icon="$nl$/icons/full/obj16/version_arrow.gif"
includeOnPreferencePage="true"
isGoToNextNavigationTarget="false"
isGoToNextNavigationTargetKey="isVersionGoToNextNavigationTarget "
isGoToPreviousNavigationTarget="false"
isGoToPreviousNavigationTargetKey="isVersionGoToPreviousNavigationTarget "
label="%AnnotateAnnotation.label"
overviewRulerPreferenceKey="annotateIndicationInOverviewRuler "
overviewRulerPreferenceValue="true"
presentationLayer="4"
showInNextPrevDropdownToolbarAction="true"
showInNextPrevDropdownToolbarActionKey="showVersionsInNextPrevDropdownToolbarAction "
textPreferenceKey="annotateIndication"
textPreferenceValue="false"
textStylePreferenceKey="showVersionTextStylePreferenceKey"
textStylePreferenceValue="NONE"
verticalRulerPreferenceKey="annotateIndicationInVerticalRuler "
verticalRulerPreferenceValue="true"/>
</extension>
|
|
|
|
|
Re: How to enable the Next Annotation/Previous Annotation buttons for an editor [message #313946 is a reply to message #313944] |
Wed, 28 March 2007 14:53  |
Eclipse User |
|
|
|
The hint with the EditorActionBarContributor pointed me into the right
direction. Now the Next/Previous Annotation buttons are working.
Thanks
Stephan
Stephan Muehlstrasser schrieb:
> Daniel Megert schrieb:
>> Stephan Muehlstrasser wrote:
>>
>> ...
>>
>> Which editor action bar contributor do you extend?
>
> Ah, that was probably the missing hint. I didn't know about the need for
> a EditorActionBarContributor. Up to now I just have referenced
> BasicTextEditorActionContributor as contributorClass in my editor
> extension and hadn't extended it.
>
> I see the following code in
> BasicJavaEditorActionContributor.setActiveEditor():
>
> /** The global actions to be connected with editor actions */
> IAction action= getAction(textEditor, ITextEditorActionConstants.NEXT);
>
> actionBars.setGlobalActionHandler(ITextEditorActionDefinitio nIds.GOTO_NEXT_ANNOTATION,
> action);
>
> actionBars.setGlobalActionHandler(ITextEditorActionConstants .NEXT,action);
> action= getAction(textEditor, ITextEditorActionConstants.PREVIOUS);
>
> actionBars.setGlobalActionHandler(ITextEditorActionDefinitio nIds.GOTO_PREVIOUS_ANNOTATION,
> action);
>
> actionBars.setGlobalActionHandler(ITextEditorActionConstants .PREVIOUS,
> action);
>
> Does it mean that I need to extend BasicTextEditorActionContributor and
> implement similar code for
> ITextEditorActionDefinitionIds.GOTO_PREVIOUS_ANNOTATION and
> ITextEditorActionDefinitionIds.GOTO_NEXT_ANNOTATION?
>
> Thanks
> Stephan
|
|
|
Powered by
FUDForum. Page generated in 0.04120 seconds