Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » How to enable the Next Annotation/Previous Annotation buttons for an editor
How to enable the Next Annotation/Previous Annotation buttons for an editor [message #313900] Tue, 27 March 2007 14:23 Go to next message
Eclipse UserFriend
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 #313917 is a reply to message #313900] Wed, 28 March 2007 04:17 Go to previous messageGo to next message
Eclipse UserFriend
Stephan Muehlstrasser wrote:

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

Which editor action bar contributor do you extend?

Dani

>
> 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 #313944 is a reply to message #313917] Wed, 28 March 2007 14:30 Go to previous messageGo to next message
Eclipse UserFriend
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
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 Go to previous message
Eclipse UserFriend
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
Previous Topic:EditorPart-isDirty and doSave implementation
Next Topic:New feature version is not picked up after drop-install
Goto Forum:
  


Current Time: Thu Jul 17 19:27:10 EDT 2025

Powered by FUDForum. Page generated in 0.04120 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top