Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[pdt-dev] Getting cursor position in current editor

Hi all,

i'm struggling with a simple task yet again;)

Does anyone know how i can get the cursor position of the current active editor ?

I've created a Handler (extends AbstractHandler) where i can get the IEditorPart, the current ISelection etc, but i have no clue where i can access the current cursor position, ie offset in the document.

I'm trying to switch between documents with keyboard shortcuts, so i've added the following extension
to my plugin:

<extension
         point="org.eclipse.ui.handlers">
<handler
            class="com.dubture.cpdt.internal.handlers.SwitchViewHandler"
            commandId="com.dubture.cpdt.ui.command">
</handler>
</extension>


The SwitchViewHandler extends AbstractHandler, and there i would need to access the cursor position.


thanks a lot,

-robert


Back to the top