Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsRuler Action via menus extension point
https://www.eclipse.org/forums/index.php/mv/msg/200089/638510/#msg_638510
How do I do that via org.eclipse.ui.menus extension point? (all the examples I've found show how to add commands to various other locations)]]>Nadav2010-11-11T14:35:02-00:00Re: Ruler Action via menus extension point
https://www.eclipse.org/forums/index.php/mv/msg/200089/638543/#msg_638543
> I'm trying to add commands to the left-hand ruler of an
> AbstractTextEditor. How do I do that via org.eclipse.ui.menus
> extension point? (all the examples I've found show how to add commands
> to various other locations)
Here's an example:
Dani]]>Dani Megert2010-11-11T15:13:27-00:00Re: Ruler Action via menus extension point
https://www.eclipse.org/forums/index.php/mv/msg/200089/638610/#msg_638610
Now can you tell me how to get at the IVerticalRulerInfo? Specifically I'm looking for the line-number where the ruler was clicked when selecting the action.
I can get the line number of the text selected in the editor by getting the editor from the context variables, but I don't see how to get the ruler or its line of last activity... final AbstractTextEditor editor=(AbstractTextEditor)event.getApplicationContext.getVa riable( "activeEditor");
editor.getSelectionProvider();]]>Nadav2010-11-11T19:02:59-00:00Re: Ruler Action via menus extension point
https://www.eclipse.org/forums/index.php/mv/msg/200089/639102/#msg_639102
private Integer getRulerLine(ExecutionEvent event)
{
if(event.getApplicationContext() instanceof EvaluationContext)
{
final EvaluationContext context=(EvaluationContext)event.getApplicationContext();
final IEditorPart editor=(IEditorPart)context.getVariable("activeEditor"); final IVerticalRulerInfo verticalRulerInfo=(IVerticalRulerInfo)editor.getAdapter(IVer ticalRulerInfo.class);
if(verticalRulerInfo!=null)
{
return verticalRulerInfo.getLineOfLastMouseButtonActivity();
}
}
return null;
}
]]>Nadav2010-11-15T10:11:39-00:00