Skip to main content
summaryrefslogtreecommitdiffstats
blob: 577dcd58091539ea2113a64940197bb4604526ae (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*****************************************************************************
 * Copyright (c) 2011 CEA LIST.
 *
 *    
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *  CEA LIST - Initial API and implementation
 *
 *****************************************************************************/

package org.eclipse.papyrus.infra.gmfdiag.xtext.glue.partialEditing;

import org.eclipse.jface.text.DocumentCommand;
import org.eclipse.jface.text.contentassist.IContentAssistant;
import org.eclipse.jface.text.source.IOverviewRuler;
import org.eclipse.jface.text.source.IVerticalRuler;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.xtext.ui.editor.XtextSourceViewer;

/**
 * This class extends XtextSourceViewer with the method getContentAssistant()
 * This method was available on XtextSourceViewer in Xtext 1.0, and used
 * for integration in Papyrus.
 * 
 * @author CEA LIST - Initial contribution and API
 */
public class CustomXtextSourceViewer extends XtextSourceViewer {

	/**
	 * @param parent 
	 * @param ruler 
	 * @param overviewRuler 
	 * @param showsAnnotationOverview 
	 * @param styles 
	 *
	 */
	public CustomXtextSourceViewer(Composite parent, IVerticalRuler ruler, IOverviewRuler overviewRuler,
			boolean showsAnnotationOverview, int styles) {
		super(parent, ruler, overviewRuler, showsAnnotationOverview, styles);
	}

	/**
	 * Used in papyrus integration for managing content assist in popup editors.
	 * @return the content assistant
	 *
	 */
	public IContentAssistant getContentAssistant() {
		return fContentAssistant;
	}

	@Override
	protected void customizeDocumentCommand(DocumentCommand command) {
		// TODO: TextViewer.customizeDocumentCommand generates exceptions. Why?
		//super.customizeDocumentCommand(command);
	}
	
	
	
}

Back to the top