Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: d1830a2e38bb691636d5582688aaf32af4c21f6a (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
/*
 *(c) Copyright QNX Software Systems Ltd. 2002.
 * All Rights Reserved.
 * 
 */

package org.eclipse.cdt.debug.internal.ui.editors;

import org.eclipse.cdt.internal.ui.editor.asm.AsmSourceViewerConfiguration;
import org.eclipse.cdt.internal.ui.editor.asm.AsmTextEditor;
import org.eclipse.cdt.internal.ui.editor.asm.AsmTextTools;
import org.eclipse.cdt.internal.ui.text.CAnnotationHover;
import org.eclipse.cdt.internal.ui.text.HTMLTextPresenter;
import org.eclipse.jface.text.DefaultInformationControl;
import org.eclipse.jface.text.IInformationControl;
import org.eclipse.jface.text.IInformationControlCreator;
import org.eclipse.jface.text.source.IAnnotationHover;
import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Shell;

/**
 * Enter type comment.
 * 
 * @since May 5, 2003
 */
public class DisassemblySourceViewerConfiguration extends AsmSourceViewerConfiguration
{
	public DisassemblySourceViewerConfiguration( AsmTextTools tools, AsmTextEditor editor )
	{
		super( tools, editor );
	}

	/* (non-Javadoc)
	 * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getAnnotationHover(org.eclipse.jface.text.source.ISourceViewer)
	 */
	public IAnnotationHover getAnnotationHover(ISourceViewer sourceViewer)
	{
		return new CAnnotationHover();
	}
	
	/* (non-Javadoc)
	 * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getInformationControlCreator(org.eclipse.jface.text.source.ISourceViewer)
	 */
	public IInformationControlCreator getInformationControlCreator( ISourceViewer sourceViewer )
	{
		return getInformationControlCreator( sourceViewer, true );
	}

	public IInformationControlCreator getInformationControlCreator( ISourceViewer sourceViewer, final boolean cutDown )
	{
		return new IInformationControlCreator()
		{
			public IInformationControl createInformationControl( Shell parent )
			{
				int style = cutDown ? SWT.NONE : ( SWT.V_SCROLL | SWT.H_SCROLL );
				return new DefaultInformationControl( parent, style, new HTMLTextPresenter( cutDown ) );
			}
		};
	}
}

Back to the top