Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » How to bind Tab in plugin.xml for an editor.
How to bind Tab in plugin.xml for an editor. [message #328353] Thu, 22 May 2008 21:08 Go to next message
Gary is currently offline GaryFriend
Messages: 33
Registered: July 2009
Member
How do I do what the Java editor does for the Tab key?

The Java editor binds Control-I to "Correct Indentation" and it binds Tab to a
function that works almost the same if the cursor is in the whitespace at the
start of a line. But I can't find the Tab binding anywhere. I can find the
Control-I binding,

<extension point="org.eclipse.ui.bindings">
<key sequence="M1+I"
commandId="org.eclipse.jdt.ui.edit.text.java.indent"
......

But what is it binding to Tab and more importantly how is it doing it?
There's nothing bound to Tab according to the Preferences>Keys page but it
obviously is bound to something. I would like to provide the same general
functionality in my editor, but what goes into the plugin.xml file?

Gary
Re: How to bind Tab in plugin.xml for an editor. [message #328407 is a reply to message #328353] Sat, 24 May 2008 06:46 Go to previous message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
Gary E. Barnes wrote:
> How do I do what the Java editor does for the Tab key?
See
org.eclipse.ui.texteditor.AbstractTextEditor.setActionActiva tionCode(String,
char, int, int).
The Java editor does this: setActionActivationCode("IndentOnTab", '\t',
-1, SWT.NONE); //$NON-NLS-1$

Dani
>
> The Java editor binds Control-I to "Correct Indentation" and it binds
> Tab to a function that works almost the same if the cursor is in the
> whitespace at the start of a line. But I can't find the Tab binding
> anywhere. I can find the Control-I binding,
>
> <extension point="org.eclipse.ui.bindings">
> <key sequence="M1+I"
> commandId="org.eclipse.jdt.ui.edit.text.java.indent"
> ......
>
> But what is it binding to Tab and more importantly how is it doing it?
> There's nothing bound to Tab according to the Preferences>Keys page
> but it obviously is bound to something. I would like to provide the
> same general functionality in my editor, but what goes into the
> plugin.xml file?
>
> Gary
Previous Topic:How to prevent an editor from closing?
Next Topic:Marker object contributions no longer work in 3.4
Goto Forum:
  


Current Time: Thu Jun 27 19:18:57 GMT 2024

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

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

Back to the top