diff options
author | nitind | 2006-09-13 02:04:07 +0000 |
---|---|---|
committer | nitind | 2006-09-13 02:04:07 +0000 |
commit | 88498c01ef94553f356d5a1339e9919261eedbbc (patch) | |
tree | 44330c8448f3ae173f4e3e154427b1f7037dd214 /bundles/org.eclipse.jst.jsp.ui | |
parent | d7870fd2a6f98d70226f6d339908ac14e73bcaff (diff) | |
download | webtools.sourceediting-88498c01ef94553f356d5a1339e9919261eedbbc.tar.gz webtools.sourceediting-88498c01ef94553f356d5a1339e9919261eedbbc.tar.xz webtools.sourceediting-88498c01ef94553f356d5a1339e9919261eedbbc.zip |
[157120] Use correct coloring and font in new wizard template pages
Diffstat (limited to 'bundles/org.eclipse.jst.jsp.ui')
-rw-r--r-- | bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewJSPTemplatesWizardPage.java | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewJSPTemplatesWizardPage.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewJSPTemplatesWizardPage.java index 95ece8c58c..be0938f98c 100644 --- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewJSPTemplatesWizardPage.java +++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewJSPTemplatesWizardPage.java @@ -2,6 +2,7 @@ package org.eclipse.jst.jsp.ui.internal.wizard; import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.preference.PreferenceDialog; +import org.eclipse.jface.resource.JFaceResources; import org.eclipse.jface.text.Document; import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.source.SourceViewer; @@ -24,6 +25,8 @@ import org.eclipse.jface.viewers.TableViewer; import org.eclipse.jface.viewers.Viewer; import org.eclipse.jface.viewers.ViewerSorter; import org.eclipse.jface.wizard.WizardPage; +import org.eclipse.jst.jsp.core.internal.provisional.contenttype.ContentTypeIdForJSP; +import org.eclipse.jst.jsp.ui.StructuredTextViewerConfigurationJSP; import org.eclipse.jst.jsp.ui.internal.JSPUIMessages; import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin; import org.eclipse.jst.jsp.ui.internal.Logger; @@ -49,6 +52,9 @@ import org.eclipse.swt.widgets.Table; import org.eclipse.swt.widgets.TableColumn; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.dialogs.PreferencesUtil; +import org.eclipse.wst.sse.core.StructuredModelManager; +import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel; +import org.eclipse.wst.sse.ui.internal.StructuredTextViewer; /** * Templates page in new file wizard. Allows users to select a new file @@ -293,10 +299,23 @@ public class NewJSPTemplatesWizardPage extends WizardPage { * @return a configured source viewer */ private SourceViewer createViewer(Composite parent) { - SourceViewer viewer = new SourceViewer(parent, null, null, false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL); - SourceViewerConfiguration configuration = new SourceViewerConfiguration(); + SourceViewer viewer = null; + String contentTypeID = ContentTypeIdForJSP.ContentTypeID_JSP; + SourceViewerConfiguration configuration = new StructuredTextViewerConfigurationJSP(); + IDocument document = null; + if (configuration != null) { + viewer = new StructuredTextViewer(parent, null, null, false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL); + ((StructuredTextViewer) viewer).getTextWidget().setFont(JFaceResources.getTextFont()); + IStructuredModel scratchModel = StructuredModelManager.getModelManager().createUnManagedStructuredModelFor(contentTypeID); + document = scratchModel.getStructuredDocument(); + } + else { + viewer = new SourceViewer(parent, null, null, false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL); + configuration = new SourceViewerConfiguration(); + document = new Document(); + } + viewer.configure(configuration); - IDocument document = new Document(); viewer.setDocument(document); return viewer; } |