Skip to main content



      Home
Home » Modeling » TMF (Xtext) » EmbeddedEditor has missing key bindings(find/replace is not working with the Xtext EmbeddedEditor)
icon5.gif  EmbeddedEditor has missing key bindings [message #1240011] Wed, 05 February 2014 09:19 Go to next message
Eclipse UserFriend
I'm currently implementing an EditorPart which contains an Xtext EmbeddedEditor instance. Most features found within the standard editor are working, but some key bindings like for find/replace are not working.

The same behavior can be reproduced by creating the MyDsl demo project as well as a simple EditorPart for the mydsl file extension, which includes an EmbeddedEditor instance.

What could be the cause of the missing key bindings?






Re: EmbeddedEditor has missing key bindings [message #1240138 is a reply to message #1240011] Wed, 05 February 2014 14:48 Go to previous message
Eclipse UserFriend
Hi what about filing an enhancement request. never the less ...

import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchCommandConstants;
import org.eclipse.ui.texteditor.FindReplaceAction;
import org.eclipse.xtext.ui.editor.embedded.EmbeddedEditorActions;
import org.eclipse.xtext.ui.editor.embedded.EmbeddedEditorMessages;

import com.google.inject.Inject;

public class MyDslEmbeddedEditorActions extends EmbeddedEditorActions {
	
public static class Factory extends EmbeddedEditorActions.Factory {
		
		@Inject(optional=true)
		protected IWorkbench workbench;
		
		protected EmbeddedEditorActions createActions(ISourceViewer viewer) {
			return new MyDslEmbeddedEditorActions(viewer, workbench);
		}
	}

	public MyDslEmbeddedEditorActions(ISourceViewer viewer, IWorkbench workbench) {
		super(viewer, workbench);
	}
	
	@Override
	protected void createActions() {
		super.createActions();
		FindReplaceAction action= new FindReplaceAction(EmbeddedEditorMessages.getBundleForConstructedKeys(), "DontCare.", workbench.getActiveWorkbenchWindow().getShell(), viewer.getFindReplaceTarget()); //$NON-NLS-1$
		//action.setHelpContextId(IAbstractTextEditorHelpContextIds.QUICK_ASSIST_ACTION);
		action.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_FIND_AND_REPLACE);
		setAction(IWorkbenchCommandConstants.EDIT_FIND_AND_REPLACE, action);
	}

}


// In the UI Module ...
public Class<? extends EmbeddedEditorActions.Factory> bindEmbeddedEditorActions$Factory() {
			return MyDslEmbeddedEditorActions.Factory.class;
		}

[Updated on: Wed, 05 February 2014 14:52] by Moderator

Previous Topic:maven build fails for to long names
Next Topic:Adding another file into the generated src-gen folder with Xtext-xtend compiler
Goto Forum:
  


Current Time: Sun Jul 27 04:55:09 EDT 2025

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

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

Back to the top