KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ant > internal > ui > editor > templates > AntSourceViewerInformationControl


1 /*******************************************************************************
2  * Copyright (c) 2000, 2004 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Common Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/cpl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11
12 package org.eclipse.ant.internal.ui.editor.templates;
13
14 import org.eclipse.ant.internal.ui.editor.formatter.FormattingPreferences;
15 import org.eclipse.ant.internal.ui.editor.formatter.XmlFormatter;
16 import org.eclipse.ant.internal.ui.model.AntUIPlugin;
17 import org.eclipse.ant.internal.ui.preferences.AntEditorPreferenceConstants;
18 import org.eclipse.jface.text.DefaultInformationControl;
19 import org.eclipse.swt.widgets.Shell;
20
21 public class AntSourceViewerInformationControl extends DefaultInformationControl {
22     
23     public AntSourceViewerInformationControl(Shell parent, int shellStyle, int style, IInformationPresenter presenter) {
24         super(parent, shellStyle, style, presenter);
25     }
26     
27     public AntSourceViewerInformationControl(Shell parent, int shellStyle, int style, IInformationPresenter presenter, String JavaDoc statusFieldText) {
28         super(parent, shellStyle, style, presenter, statusFieldText);
29     }
30     
31     public AntSourceViewerInformationControl(Shell parent, int style, IInformationPresenter presenter) {
32         super(parent, style, presenter);
33     }
34     
35     public AntSourceViewerInformationControl(Shell parent, int style, IInformationPresenter presenter, String JavaDoc statusFieldText) {
36         super(parent, style, presenter, statusFieldText);
37     }
38     
39     public AntSourceViewerInformationControl(Shell parent) {
40         super(parent);
41     }
42     
43     public AntSourceViewerInformationControl(Shell parent, IInformationPresenter presenter) {
44         super(parent, presenter);
45     }
46     
47     /* (non-Javadoc)
48      * @see org.eclipse.jface.text.IInformationControl#setInformation(java.lang.String)
49      */

50     public void setInformation(String JavaDoc content) {
51         if (content != null
52             && AntUIPlugin.getDefault().getPreferenceStore().getBoolean(AntEditorPreferenceConstants.TEMPLATES_USE_CODEFORMATTER)) {
53             content= XmlFormatter.format(content, new FormattingPreferences());
54         }
55         super.setInformation(content);
56     }
57 }
58
Popular Tags