KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > directory > ldapstudio > schemas > controller > PreferenceInitializer


1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the
7  * "License"); you may not use this file except in compliance
8  * with the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing,
13  * software distributed under the License is distributed on an
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15  * KIND, either express or implied. See the License for the
16  * specific language governing permissions and limitations
17  * under the License.
18  *
19  */

20
21 package org.apache.directory.ldapstudio.schemas.controller;
22
23
24 import org.apache.directory.ldapstudio.schemas.Activator;
25 import org.apache.directory.ldapstudio.schemas.PluginConstants;
26 import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
27 import org.eclipse.jface.preference.IPreferenceStore;
28
29
30 public class PreferenceInitializer extends AbstractPreferenceInitializer
31 {
32
33     public PreferenceInitializer()
34     {
35         super();
36     }
37
38
39     @Override JavaDoc
40     public void initializeDefaultPreferences()
41     {
42         IPreferenceStore store = Activator.getDefault().getPreferenceStore();
43
44         // Open and Save File Dialogs
45
store.setDefault( PluginConstants.PREFS_OPEN_FILE_DIALOG, System.getProperty( "user.home" ) ); //$NON-NLS-1$
46
store.setDefault( PluginConstants.PREFS_SAVE_FILE_DIALOG, System.getProperty( "user.home" ) ); //$NON-NLS-1$
47

48         // Schemas Editor Preference Page
49
store.setDefault( PluginConstants.PREFS_SCHEMAS_EDITOR_SPECIFIC_CORE, false );
50         store.setDefault( PluginConstants.PREFS_SCHEMAS_EDITOR_SPECIFIC_CORE_DIRECTORY, System
51             .getProperty( "user.home" ) ); //$NON-NLS-1$
52
store.setDefault( PluginConstants.PREFS_SCHEMAS_EDITOR_AUTO_OID, true );
53         store.setDefault( PluginConstants.PREFS_SCHEMAS_EDITOR_COMPANY_OID, "1.2.3.4.5.6" ); //$NON-NLS-1$
54

55         // Schema Elements View Preference Page
56
store.setDefault( PluginConstants.PREFS_SCHEMA_ELEMENTS_VIEW_LABEL,
57             PluginConstants.PREFS_SCHEMA_ELEMENTS_VIEW_LABEL_ALL_ALIASES );
58         store.setDefault( PluginConstants.PREFS_SCHEMA_ELEMENTS_VIEW_ABBREVIATE, true );
59         store.setDefault( PluginConstants.PREFS_SCHEMA_ELEMENTS_VIEW_ABBREVIATE_MAX_LENGTH, "50" ); //$NON-NLS-1$
60
store.setDefault( PluginConstants.PREFS_SCHEMA_ELEMENTS_VIEW_SECONDARY_LABEL_DISPLAY, true );
61         store.setDefault( PluginConstants.PREFS_SCHEMA_ELEMENTS_VIEW_SECONDARY_LABEL,
62             PluginConstants.PREFS_SCHEMA_ELEMENTS_VIEW_LABEL_OID );
63         store.setDefault( PluginConstants.PREFS_SCHEMA_ELEMENTS_VIEW_SECONDARY_LABEL_ABBREVIATE, false );
64         store.setDefault( PluginConstants.PREFS_SCHEMA_ELEMENTS_VIEW_SECONDARY_LABEL_ABBREVIATE_MAX_LENGTH, "50" ); //$NON-NLS-1$
65

66         // Schema Elements View Sorting
67
store.setDefault( PluginConstants.PREFS_SCHEMA_ELEMENTS_VIEW_GROUPING,
68             PluginConstants.PREFS_SCHEMA_ELEMENTS_VIEW_GROUPING_ATFIRST );
69         store.setDefault( PluginConstants.PREFS_SCHEMA_ELEMENTS_VIEW_SORTING_BY,
70             PluginConstants.PREFS_SCHEMA_ELEMENTS_VIEW_SORTING_BY_FIRSTNAME );
71         store.setDefault( PluginConstants.PREFS_SCHEMA_ELEMENTS_VIEW_SORTING_ORDER,
72             PluginConstants.PREFS_SCHEMA_ELEMENTS_VIEW_SORTING_ORDER_ASCENDING );
73
74         // Schemas View Preference Page
75
store.setDefault( PluginConstants.PREFS_SCHEMAS_VIEW_LABEL,
76             PluginConstants.PREFS_SCHEMAS_VIEW_LABEL_ALL_ALIASES );
77         store.setDefault( PluginConstants.PREFS_SCHEMAS_VIEW_ABBREVIATE, true );
78         store.setDefault( PluginConstants.PREFS_SCHEMAS_VIEW_ABBREVIATE_MAX_LENGTH, "50" ); //$NON-NLS-1$
79

80         // Schemas View Sorting
81
store.setDefault( PluginConstants.PREFS_SCHEMAS_VIEW_GROUPING,
82             PluginConstants.PREFS_SCHEMAS_VIEW_GROUPING_FOLDERS );
83         store.setDefault( PluginConstants.PREFS_SCHEMAS_VIEW_SORTING_BY,
84             PluginConstants.PREFS_SCHEMAS_VIEW_SORTING_BY_FIRSTNAME );
85         store.setDefault( PluginConstants.PREFS_SCHEMAS_VIEW_SORTING_ORDER,
86             PluginConstants.PREFS_SCHEMAS_VIEW_SORTING_ORDER_ASCENDING );
87
88         // Hierarchy View Preference Page
89
store.setDefault( PluginConstants.PREFS_HIERARCHY_VIEW_LABEL,
90             PluginConstants.PREFS_HIERARCHY_VIEW_LABEL_ALL_ALIASES );
91         store.setDefault( PluginConstants.PREFS_HIERARCHY_VIEW_ABBREVIATE, true );
92         store.setDefault( PluginConstants.PREFS_HIERARCHY_VIEW_ABBREVIATE_MAX_LENGTH, "50" ); //$NON-NLS-1$
93
store.setDefault( PluginConstants.PREFS_HIERARCHY_VIEW_SECONDARY_LABEL_DISPLAY, true );
94         store.setDefault( PluginConstants.PREFS_HIERARCHY_VIEW_SECONDARY_LABEL,
95             PluginConstants.PREFS_HIERARCHY_VIEW_LABEL_OID );
96         store.setDefault( PluginConstants.PREFS_HIERARCHY_VIEW_SECONDARY_LABEL_ABBREVIATE, false );
97         store.setDefault( PluginConstants.PREFS_HIERARCHY_VIEW_SECONDARY_LABEL_ABBREVIATE_MAX_LENGTH, "50" ); //$NON-NLS-1$
98
}
99 }
100
Popular Tags