KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > ui > text > SimpleJavaSourceViewerConfiguration


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 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 JavaDoc 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     public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String JavaDoc contentType) {
63         return null;
64     }
65
66     /*
67      * @see SourceViewerConfiguration#getAnnotationHover(ISourceViewer)
68      */

69     public IAnnotationHover getAnnotationHover(ISourceViewer sourceViewer) {
70         return null;
71     }
72
73     /*
74      * @see SourceViewerConfiguration#getOverviewRulerAnnotationHover(ISourceViewer)
75      */

76     public IAnnotationHover getOverviewRulerAnnotationHover(ISourceViewer sourceViewer) {
77         return null;
78     }
79
80     /*
81      * @see SourceViewerConfiguration#getConfiguredTextHoverStateMasks(ISourceViewer, String)
82      */

83     public int[] getConfiguredTextHoverStateMasks(ISourceViewer sourceViewer, String JavaDoc contentType) {
84         return null;
85     }
86
87     /*
88      * @see SourceViewerConfiguration#getTextHover(ISourceViewer, String, int)
89      */

90     public ITextHover getTextHover(ISourceViewer sourceViewer, String JavaDoc contentType, int stateMask) {
91         return null;
92     }
93
94     /*
95      * @see SourceViewerConfiguration#getTextHover(ISourceViewer, String)
96      */

97     public ITextHover getTextHover(ISourceViewer sourceViewer, String JavaDoc contentType) {
98         return null;
99     }
100
101     /*
102      * @see SourceViewerConfiguration#getContentFormatter(ISourceViewer)
103      */

104     public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) {
105         if (fConfigureFormatter)
106             return super.getContentFormatter(sourceViewer);
107         else
108             return null;
109     }
110
111     /*
112      * @see SourceViewerConfiguration#getInformationControlCreator(ISourceViewer)
113      */

114     public IInformationControlCreator getInformationControlCreator(ISourceViewer sourceViewer) {
115         return null;
116     }
117
118     /*
119      * @see SourceViewerConfiguration#getInformationPresenter(ISourceViewer)
120      */

121     public IInformationPresenter getInformationPresenter(ISourceViewer sourceViewer) {
122         return null;
123     }
124
125     /*
126      * @see org.eclipse.jdt.ui.text.JavaSourceViewerConfiguration#getOutlinePresenter(org.eclipse.jface.text.source.ISourceViewer, boolean)
127      */

128     public IInformationPresenter getOutlinePresenter(ISourceViewer sourceViewer, boolean doCodeResolve) {
129         return null;
130     }
131
132     /*
133      * @see org.eclipse.jdt.ui.text.JavaSourceViewerConfiguration#getHierarchyPresenter(org.eclipse.jface.text.source.ISourceViewer, boolean)
134      */

135     public IInformationPresenter getHierarchyPresenter(ISourceViewer sourceViewer, boolean doCodeResolve) {
136         return null;
137     }
138
139     /*
140      * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getHyperlinkDetectors(org.eclipse.jface.text.source.ISourceViewer)
141      */

142     public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) {
143         return null;
144     }
145 }
146
Popular Tags