View Javadoc

1   /*
2    * $Id: EditorPreferencesInitializaer.java,v 1.5 2005/05/31 19:37:20 jlerner Exp $
3    *
4    * Copyright (c) 1999-2004, BBN Technologies, LLC.
5    * All rights reserved.
6    * http://www.daml.org/legal/opensource/bbn_license.html
7    */
8    
9   package com.bbn.swede.editor;
10  
11  import org.eclipse.core.runtime.Preferences;
12  import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
13  
14  /***
15   * Initializer for SWeDE editor preferences.  See 
16   * {@link AbstractPreferenceInitializer} for more details about this mechanism.
17   * @author jlerner
18   */
19  public class EditorPreferencesInitializaer extends
20     AbstractPreferenceInitializer
21  {
22     /***
23      * Default number of spaces to substitute for a tab character in the OWL
24      * editor.
25      */
26     protected static final int DEFAULT_TAB_WIDTH = 2; //spaces
27     /***
28      * Default number of tabs to indent nested tags in the OWL editor.
29      */
30     protected static final int DEFAULT_INDENT_SIZE = 1;  //tabs
31     /***
32      * Default number of tabs to indent wrapped attributes in the OWL editor.
33      */
34     protected static final int DEFAULT_ATTRIBUTE_INDENT_SIZE = 1;  //tabs
35     /***
36      * Default maximum line length for the OWL editor.
37      */
38     protected static final int DEFAULT_LINE_LENGTH = 80;
39  
40     /* (non-Javadoc)
41      * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
42      */
43     public void initializeDefaultPreferences()
44     {
45        Preferences p = EditorPlugin.getPlugin().getPluginPreferences();
46        p.setDefault(EditorPlugin.PREFERENCE_TAB_WIDTH, 
47           DEFAULT_TAB_WIDTH);
48        p.setDefault(EditorPlugin.PREFERENCE_SUBSTITUTE_SPACES, false);
49        p.setDefault(EditorPlugin.PREFERENCE_MAXIMUM_LINE_LENGTH, DEFAULT_LINE_LENGTH);
50        p.setDefault(EditorPlugin.PREFERENCE_TAG_INDENT,
51           DEFAULT_INDENT_SIZE);
52        p.setDefault(EditorPlugin.PREFERENCE_ATTRIBUTE_DELIMITER, "\"");
53        p.setDefault(EditorPlugin.PREFERENCE_ATTRIBUTE_SPLIT, 
54           EditorPlugin.SPLIT_LONG);
55        p.setDefault(EditorPlugin.PREFERENCE_ATTRIBUTE_INDENT, 
56           DEFAULT_ATTRIBUTE_INDENT_SIZE);
57        p.setDefault(EditorPlugin.PREFERENCE_ATTRIBUTE_ALIGN, false);
58        p.setDefault(EditorPlugin.PREFERENCE_ATTRIBUTE_ALIGN_VALUE, false);
59        p.setDefault(EditorPlugin.PREFERENCE_LITERAL_SPLIT, 
60           EditorPlugin.SPLIT_LONG);
61     }
62  
63  }