]> git.uio.no Git - ifi-stolz-refaktor.git/blob - case-study/jdt-before/ui/org/eclipse/jdt/internal/ui/text/SimpleJavaSourceViewerConfiguration.java
Case Study: adding data and statistics
[ifi-stolz-refaktor.git] / case-study / jdt-before / ui / org / eclipse / jdt / internal / ui / text / SimpleJavaSourceViewerConfiguration.java
1 /*******************************************************************************
2  * Copyright (c) 2000, 2011 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  *     IBM Corporation - initial API and implementation
10  *******************************************************************************/
11 package org.eclipse.jdt.internal.ui.text;
12
13 import org.eclipse.jface.preference.IPreferenceStore;
14
15 import org.eclipse.jface.text.IAutoEditStrategy;
16 import org.eclipse.jface.text.IInformationControlCreator;
17 import org.eclipse.jface.text.ITextHover;
18 import org.eclipse.jface.text.formatter.IContentFormatter;
19 import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
20 import org.eclipse.jface.text.information.IInformationPresenter;
21 import org.eclipse.jface.text.source.IAnnotationHover;
22 import org.eclipse.jface.text.source.ISourceViewer;
23
24 import org.eclipse.ui.texteditor.ITextEditor;
25
26 import org.eclipse.jdt.ui.text.IColorManager;
27 import org.eclipse.jdt.ui.text.JavaSourceViewerConfiguration;
28
29
30 /**
31  * A simple {@linkplain org.eclipse.jdt.ui.text.JavaSourceViewerConfiguration Java source viewer configuration}.
32  * <p>
33  * This simple source viewer configuration basically provides syntax coloring
34  * and disables all other features like code assist, quick outlines, hyperlinking, etc.
35  * </p>
36  *
37  * @since 3.1
38  */
39 public class SimpleJavaSourceViewerConfiguration extends JavaSourceViewerConfiguration {
40
41
42         private boolean fConfigureFormatter;
43
44         /**
45          * Creates a new Java source viewer configuration for viewers in the given editor
46          * using the given preference store, the color manager and the specified document partitioning.
47          *
48          * @param colorManager the color manager
49          * @param preferenceStore the preference store, can be read-only
50          * @param editor the editor in which the configured viewer(s) will reside, or <code>null</code> if none
51          * @param partitioning the document partitioning for this configuration, or <code>null</code> for the default partitioning
52          * @param configureFormatter <code>true</code> if a content formatter should be configured
53          */
54         public SimpleJavaSourceViewerConfiguration(IColorManager colorManager, IPreferenceStore preferenceStore, ITextEditor editor, String partitioning, boolean configureFormatter) {
55                 super(colorManager, preferenceStore, editor, partitioning);
56                 fConfigureFormatter= configureFormatter;
57         }
58
59         /*
60          * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getAutoEditStrategies(org.eclipse.jface.text.source.ISourceViewer, java.lang.String)
61          */
62         @Override
63         public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {
64                 return null;
65         }
66
67         /*
68          * @see SourceViewerConfiguration#getAnnotationHover(ISourceViewer)
69          */
70         @Override
71         public IAnnotationHover getAnnotationHover(ISourceViewer sourceViewer) {
72                 return null;
73         }
74
75         /*
76          * @see SourceViewerConfiguration#getOverviewRulerAnnotationHover(ISourceViewer)
77          */
78         @Override
79         public IAnnotationHover getOverviewRulerAnnotationHover(ISourceViewer sourceViewer) {
80                 return null;
81         }
82
83         /*
84          * @see SourceViewerConfiguration#getConfiguredTextHoverStateMasks(ISourceViewer, String)
85          */
86         @Override
87         public int[] getConfiguredTextHoverStateMasks(ISourceViewer sourceViewer, String contentType) {
88                 return null;
89         }
90
91         /*
92          * @see SourceViewerConfiguration#getTextHover(ISourceViewer, String, int)
93          */
94         @Override
95         public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType, int stateMask) {
96                 return null;
97         }
98
99         /*
100          * @see SourceViewerConfiguration#getTextHover(ISourceViewer, String)
101          */
102         @Override
103         public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) {
104                 return null;
105         }
106
107         /*
108          * @see SourceViewerConfiguration#getContentFormatter(ISourceViewer)
109          */
110         @Override
111         public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) {
112                 if (fConfigureFormatter)
113                         return super.getContentFormatter(sourceViewer);
114                 else
115                         return null;
116         }
117
118         /*
119          * @see SourceViewerConfiguration#getInformationControlCreator(ISourceViewer)
120          */
121         @Override
122         public IInformationControlCreator getInformationControlCreator(ISourceViewer sourceViewer) {
123                 return null;
124         }
125
126         /*
127          * @see SourceViewerConfiguration#getInformationPresenter(ISourceViewer)
128          */
129         @Override
130         public IInformationPresenter getInformationPresenter(ISourceViewer sourceViewer) {
131                 return null;
132         }
133
134         /*
135          * @see org.eclipse.jdt.ui.text.JavaSourceViewerConfiguration#getOutlinePresenter(org.eclipse.jface.text.source.ISourceViewer, boolean)
136          */
137         @Override
138         public IInformationPresenter getOutlinePresenter(ISourceViewer sourceViewer, boolean doCodeResolve) {
139                 return null;
140         }
141
142         /*
143          * @see org.eclipse.jdt.ui.text.JavaSourceViewerConfiguration#getHierarchyPresenter(org.eclipse.jface.text.source.ISourceViewer, boolean)
144          */
145         @Override
146         public IInformationPresenter getHierarchyPresenter(ISourceViewer sourceViewer, boolean doCodeResolve) {
147                 return null;
148         }
149
150         /*
151          * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getHyperlinkDetectors(org.eclipse.jface.text.source.ISourceViewer)
152          */
153         @Override
154         public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) {
155                 return null;
156         }
157 }