KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > freemarker > eclipse > FreemarkerPlugin


1 package freemarker.eclipse;
2
3 import org.eclipse.core.resources.IWorkspace;
4 import org.eclipse.core.resources.ResourcesPlugin;
5 import org.eclipse.core.runtime.IPluginDescriptor;
6 import org.eclipse.core.runtime.Preferences;
7 import org.eclipse.ui.plugin.AbstractUIPlugin;
8
9 import freemarker.eclipse.preferences.IPreferenceConstants;
10
11 /**
12  * @version $Id: FreemarkerPlugin.java,v 1.6 2004/06/04 15:00:20 stephanmueller Exp $
13  * @author <a HREF="mailto:stephan@chaquotay.net">Stephan Mueller </a>
14  */

15 public class FreemarkerPlugin extends AbstractUIPlugin implements IPreferenceConstants {
16
17     //The shared instance.
18
private static FreemarkerPlugin plugin;
19
20     public FreemarkerPlugin() {
21         super();
22         plugin = this;
23     }
24
25     /**
26      * The constructor.
27      */

28     public FreemarkerPlugin(IPluginDescriptor descriptor) {
29         super(descriptor);
30         plugin = this;
31     }
32
33     /**
34      * Returns the shared instance.
35      */

36     public static FreemarkerPlugin getDefault() {
37         return plugin;
38     }
39
40     /**
41      * Returns the workspace instance.
42      */

43     public static IWorkspace getWorkspace() {
44         return ResourcesPlugin.getWorkspace();
45     }
46
47     public static FreemarkerPlugin getInstance() {
48         return plugin;
49     }
50
51     /**
52      * Initializes the plugin preferences with default preference values for
53      * this plug-in.
54      */

55     protected void initializeDefaultPluginPreferences() {
56         Preferences prefs = getPluginPreferences();
57         prefs.setDefault(SHOW_ICONS, true);
58         prefs.setDefault(COLOR_COMMENT, "170,0,0");
59         prefs.setDefault(COLOR_TEXT, "0,0,0");
60         prefs.setDefault(COLOR_INTERPOLATION, "255,0,128");
61         prefs.setDefault(COLOR_DIRECTIVE, "0,0,255");
62         prefs.setDefault(COLOR_STRING, "0,128,128");
63         prefs.setDefault(COLOR_XML_COMMENT, "128,128,128");
64         prefs.setDefault(COLOR_XML_TAG, "0,0,128");
65         prefs.setDefault(XML_HIGHLIGHTING, true);
66     }
67 }
Popular Tags