|
Link Here
|
| 11 |
import java.util.List; |
11 |
import java.util.List; |
| 12 |
import java.util.Map; |
12 |
import java.util.Map; |
| 13 |
|
13 |
|
|
|
14 |
import org.eclipse.core.commands.operations.DefaultOperationHistory; |
| 14 |
import org.eclipse.core.commands.operations.IOperationHistory; |
15 |
import org.eclipse.core.commands.operations.IOperationHistory; |
| 15 |
import org.eclipse.core.commands.operations.IUndoContext; |
16 |
import org.eclipse.core.commands.operations.IUndoContext; |
| 16 |
import org.eclipse.core.commands.operations.OperationHistoryFactory; |
17 |
import org.eclipse.core.commands.operations.OperationHistoryFactory; |
|
Link Here
|
| 27 |
import org.eclipse.jface.action.IAction; |
28 |
import org.eclipse.jface.action.IAction; |
| 28 |
import org.eclipse.jface.commands.ActionHandler; |
29 |
import org.eclipse.jface.commands.ActionHandler; |
| 29 |
import org.eclipse.jface.text.ITextOperationTarget; |
30 |
import org.eclipse.jface.text.ITextOperationTarget; |
|
|
31 |
import org.eclipse.jface.text.contentassist.ContentAssistant; |
| 30 |
import org.eclipse.jface.text.source.ISourceViewer; |
32 |
import org.eclipse.jface.text.source.ISourceViewer; |
| 31 |
import org.eclipse.jface.text.source.SourceViewer; |
33 |
import org.eclipse.jface.text.source.SourceViewer; |
| 32 |
import org.eclipse.jface.text.templates.TemplateException; |
34 |
import org.eclipse.jface.text.templates.TemplateException; |
|
Link Here
|
| 58 |
import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds; |
60 |
import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds; |
| 59 |
import org.eclipse.ui.texteditor.IUpdate; |
61 |
import org.eclipse.ui.texteditor.IUpdate; |
| 60 |
import org.eclipse.xtext.gmf.glue.Activator; |
62 |
import org.eclipse.xtext.gmf.glue.Activator; |
|
|
63 |
import org.eclipse.xtext.gmf.glue.partialEditing.CustomXtextSourceViewer; |
| 61 |
import org.eclipse.xtext.gmf.glue.partialEditing.ISyntheticResourceProvider; |
64 |
import org.eclipse.xtext.gmf.glue.partialEditing.ISyntheticResourceProvider; |
| 62 |
import org.eclipse.xtext.gmf.glue.partialEditing.OperationHistoryListener; |
65 |
import org.eclipse.xtext.gmf.glue.partialEditing.OperationHistoryListener; |
| 63 |
import org.eclipse.xtext.gmf.glue.partialEditing.PartialModelEditor; |
66 |
import org.eclipse.xtext.gmf.glue.partialEditing.PartialModelEditor; |
|
Link Here
|
| 109 |
private String semanticElementFragment; |
112 |
private String semanticElementFragment; |
| 110 |
private EObject semanticElement ; |
113 |
private EObject semanticElement ; |
| 111 |
private String textToEdit ; |
114 |
private String textToEdit ; |
|
|
115 |
|
| 112 |
/** |
116 |
/** |
| 113 |
* The file extension used to dynamically select the appropriate xtext editor |
117 |
* The file extension used to dynamically select the appropriate xtext editor |
| 114 |
*/ |
118 |
*/ |
|
Link Here
|
| 290 |
private void registerKeyListener() { |
294 |
private void registerKeyListener() { |
| 291 |
//XtextSourceViewer sourceViewer = (XtextSourceViewer) xtextEditor.getInternalSourceViewer(); |
295 |
//XtextSourceViewer sourceViewer = (XtextSourceViewer) xtextEditor.getInternalSourceViewer(); |
| 292 |
final StyledText xtextTextWidget = sourceViewerHandle.getViewer().getTextWidget(); |
296 |
final StyledText xtextTextWidget = sourceViewerHandle.getViewer().getTextWidget(); |
|
|
297 |
CustomXtextSourceViewer viewer = (CustomXtextSourceViewer)sourceViewerHandle.getViewer() ; |
| 293 |
keyListener = |
298 |
keyListener = |
| 294 |
new PopupXtextEditorKeyListener |
299 |
new PopupXtextEditorKeyListener |
| 295 |
(this, sourceViewerHandle.getViewer().getContentAssistantFacade()); |
300 |
(this, (ContentAssistant) viewer.getContentAssistant()); |
| 296 |
//keyListener.installUndoRedoSupport(sourceViewerHandle.getViewer()) ; |
301 |
//keyListener.installUndoRedoSupport(sourceViewerHandle.getViewer()) ; |
| 297 |
xtextTextWidget.addVerifyKeyListener(keyListener); |
302 |
xtextTextWidget.addVerifyKeyListener(keyListener); |
| 298 |
xtextTextWidget.addKeyListener(keyListener); |
303 |
xtextTextWidget.addKeyListener(keyListener); |