Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » key binding in editor does not work in eclipse 3.4
key binding in editor does not work in eclipse 3.4 [message #325721] Tue, 26 February 2008 03:10 Go to next message
nick tan is currently offline nick tanFriend
Messages: 56
Registered: July 2009
Member
Hi, all:

I recently migrate to eclipse 3.4. from 3.3, every thing works fine except
that
key binding in my xml editor does not work any more, like "ALT + SHIFT + R"
for renaming in file,
"ALT + ?" for content assist, "CTRL + O" for quick outline etc...
Whatever, it works fine in eclipse 3.3!
Did I miss anything?

Thanks in advance & Best Regards!
Nick
Re: key binding in editor does not work in eclipse 3.4 [message #325733 is a reply to message #325721] Tue, 26 February 2008 08:46 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
Nick Tan wrote:
> Hi, all:
>
> I recently migrate to eclipse 3.4. from 3.3, every thing works fine
> except that
> key binding in my xml editor does not work any more, like "ALT + SHIFT
> + R" for renaming in file,
> "ALT + ?" for content assist, "CTRL + O" for quick outline etc...
> Whatever, it works fine in eclipse 3.3!
> Did I miss anything?
What is "my xml editor"? Anything in .log (e.g. key binding conflicts)?

Dani
>
> Thanks in advance & Best Regards!
> Nick
Re: key binding in editor does not work in eclipse 3.4 [message #325757 is a reply to message #325733] Tue, 26 February 2008 13:47 Go to previous messageGo to next message
nick tan is currently offline nick tanFriend
Messages: 56
Registered: July 2009
Member
Daniel Megert wrote:
> Nick Tan wrote:
>> Hi, all:
>>
>> I recently migrate to eclipse 3.4. from 3.3, every thing works fine
>> except that
>> key binding in my xml editor does not work any more, like "ALT + SHIFT
>> + R" for renaming in file,
>> "ALT + ?" for content assist, "CTRL + O" for quick outline etc...
>> Whatever, it works fine in eclipse 3.3!
>> Did I miss anything?
> What is "my xml editor"? Anything in .log (e.g. key binding conflicts)?
>
> Dani
>> Thanks in advance & Best Regards!
>> Nick


Thanks for reply!
I implement my own xml editor, and retarget actions content assist, rename
in file etc. by overriding
org.eclipse.ui.editors.text.TextEditor.createActions() and extend
org.eclipse.ui.editors.text.TextEditorActionContributor

PS: no errors in .log and no key binding conflicts at all.

code snippets:
//
// com.bluebamboo.bluetools.xmleditor.editor.XmlEditor#createAc tions()
//
/**
* @see org.eclipse.ui.texteditor.AbstractTextEditor#createActions()
*/
protected void createActions() {
super.createActions();
ResourceBundle bundle = getEditorResourceBundle();
IAction action = new ContentAssistAction(bundle,
"ContentAssistProposal.", this);
action

..setActionDefinitionId(ITextEditorActionDefinitionIds.CONTE NT_ASSIST_PROPOSALS);
setAction("ContentAssistProposal", action);

action = new TextOperationAction(bundle,
"ContentFormat.", this, ISourceViewer.FORMAT); //$NON-NLS-1$
action.setActionDefinitionId(IJavaEditorActionDefinitionIds. FORMAT);
setAction("ContentFormat", action); //$NON-NLS-1$

action = new OpenDeclarationAction(this);
setAction("OpenDeclaration", action); //$NON-NLS-1$

action = new RenameInFileAction(this);
action

..setActionDefinitionId("com.bluebamboo.bluetools.xmleditor.renameInFile ");
//$NON-NLS-1$
setAction("renameInFile", action); //$NON-NLS-1$

// Create the quick outline action
createQuickOutlineAction(bundle);
}

//
// com.bluebamboo.bluetools.xmleditor.editor.XmlEditorActionCon tributor
//
/**
* @see
IEditorActionBarContributor#setActiveEditor(org.eclipse.ui.I EditorPart)
*/
public void setActiveEditor(IEditorPart part) {
super.setActiveEditor(part);
ITextEditor editor = null;
if (part instanceof ITextEditor) {
editor = (ITextEditor) part;
}
fContentAssistProposal.setAction(getAction(editor,
"ContentAssistProposal")); //$NON-NLS-1$
fContentFormat.setAction(getAction(editor, "ContentFormat"));
//$NON-NLS-1$

if (fToggleMarkOccurrencesAction != null) {
fToggleMarkOccurrencesAction.setEditor(editor);
}

if (editor instanceof XmlEditor) {
XmlEditor xmlEditor = (XmlEditor) editor;
fOpenDeclarationAction = new OpenDeclarationAction(xmlEditor);
contributeToMenu(getActionBars().getMenuManager());
fOpenDeclarationAction.setEditor(xmlEditor);
}
}
Re: key binding in editor does not work in eclipse 3.4 [message #325791 is a reply to message #325757] Wed, 27 February 2008 08:45 Go to previous message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
Nick Tan wrote:
> Daniel Megert wrote:
>
>> Nick Tan wrote:
>>
>>> Hi, all:
>>>
>>> I recently migrate to eclipse 3.4. from 3.3, every thing works fine
>>> except that
>>> key binding in my xml editor does not work any more, like "ALT + SHIFT
>>> + R" for renaming in file,
>>> "ALT + ?" for content assist, "CTRL + O" for quick outline etc...
>>> Whatever, it works fine in eclipse 3.3!
>>> Did I miss anything?
>>>
>> What is "my xml editor"? Anything in .log (e.g. key binding conflicts)?
>>
>> Dani
>>
>>> Thanks in advance & Best Regards!
>>> Nick
>>>
>
>
> Thanks for reply!
> I implement my own xml editor,
Which editor class do you subclass? Did you define your own key binding
context? I suggest to debug it using the tracing options:
http://wiki.eclipse.org/Platform_Command_Framework#Tracing_O ption

Dani
> and retarget actions content assist, rename
> in file etc. by overriding
> org.eclipse.ui.editors.text.TextEditor.createActions() and extend
> org.eclipse.ui.editors.text.TextEditorActionContributor
>
> PS: no errors in .log and no key binding conflicts at all.
>
> code snippets:
> //
> // com.bluebamboo.bluetools.xmleditor.editor.XmlEditor#createAc tions()
> //
> /**
> * @see org.eclipse.ui.texteditor.AbstractTextEditor#createActions()
> */
> protected void createActions() {
> super.createActions();
> ResourceBundle bundle = getEditorResourceBundle();
> IAction action = new ContentAssistAction(bundle,
> "ContentAssistProposal.", this);
> action
>
> .setActionDefinitionId(ITextEditorActionDefinitionIds.CONTEN T_ASSIST_PROPOSALS);
> setAction("ContentAssistProposal", action);
>
> action = new TextOperationAction(bundle,
> "ContentFormat.", this, ISourceViewer.FORMAT); //$NON-NLS-1$
> action.setActionDefinitionId(IJavaEditorActionDefinitionIds. FORMAT);
> setAction("ContentFormat", action); //$NON-NLS-1$
>
> action = new OpenDeclarationAction(this);
> setAction("OpenDeclaration", action); //$NON-NLS-1$
>
> action = new RenameInFileAction(this);
> action
>
> .setActionDefinitionId("com.bluebamboo.bluetools.xmleditor.renameInFile ");
> //$NON-NLS-1$
> setAction("renameInFile", action); //$NON-NLS-1$
>
> // Create the quick outline action
> createQuickOutlineAction(bundle);
> }
>
> //
> // com.bluebamboo.bluetools.xmleditor.editor.XmlEditorActionCon tributor
> //
> /**
> * @see
> IEditorActionBarContributor#setActiveEditor(org.eclipse.ui.I EditorPart)
> */
> public void setActiveEditor(IEditorPart part) {
> super.setActiveEditor(part);
> ITextEditor editor = null;
> if (part instanceof ITextEditor) {
> editor = (ITextEditor) part;
> }
> fContentAssistProposal.setAction(getAction(editor,
> "ContentAssistProposal")); //$NON-NLS-1$
> fContentFormat.setAction(getAction(editor, "ContentFormat"));
> //$NON-NLS-1$
>
> if (fToggleMarkOccurrencesAction != null) {
> fToggleMarkOccurrencesAction.setEditor(editor);
> }
>
> if (editor instanceof XmlEditor) {
> XmlEditor xmlEditor = (XmlEditor) editor;
> fOpenDeclarationAction = new OpenDeclarationAction(xmlEditor);
> contributeToMenu(getActionBars().getMenuManager());
> fOpenDeclarationAction.setEditor(xmlEditor);
> }
> }
>
Previous Topic:How to add jars and folders to classpath
Next Topic:cannot convert from URI to URI
Goto Forum:
  


Current Time: Thu Jun 27 20:09:16 GMT 2024

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

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

Back to the top