KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > directory > ldapstudio > browser > core > BrowserCorePreferencesInitializer


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.browser.core;
22
23
24 import org.apache.directory.ldapstudio.browser.core.model.schema.BinaryAttribute;
25 import org.apache.directory.ldapstudio.browser.core.model.schema.BinarySyntax;
26 import org.eclipse.core.runtime.Preferences;
27 import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
28
29
30 /**
31  * This class is used to set default preference values.
32  *
33  * @author <a HREF="mailto:dev@directory.apache.org">Apache Directory Project</a>
34  * @version $Rev$, $Date$
35  */

36 public class BrowserCorePreferencesInitializer extends AbstractPreferenceInitializer
37 {
38     /**
39      * {@inheritDoc}
40      */

41     public void initializeDefaultPreferences()
42     {
43         Preferences store = BrowserCorePlugin.getDefault().getPluginPreferences();
44
45         store.setDefault( BrowserCoreConstants.PREFERENCE_CHECK_FOR_CHILDREN, true );
46         store.setDefault( BrowserCoreConstants.PREFERENCE_SHOW_ALIAS_AND_REFERRAL_OBJECTS, true );
47         store.setDefault( BrowserCoreConstants.PREFERENCE_FETCH_SUBENTRIES, false );
48
49         store.setDefault( BrowserCoreConstants.PREFERENCE_FORMAT_CSV_ATTRIBUTEDELIMITER, "," );
50         store.setDefault( BrowserCoreConstants.PREFERENCE_FORMAT_CSV_VALUEDELIMITER, "|" );
51         store.setDefault( BrowserCoreConstants.PREFERENCE_FORMAT_CSV_QUOTECHARACTER, "\"" );
52         store
53             .setDefault( BrowserCoreConstants.PREFERENCE_FORMAT_CSV_LINESEPARATOR, BrowserCoreConstants.LINE_SEPARATOR );
54         store.setDefault( BrowserCoreConstants.PREFERENCE_FORMAT_CSV_BINARYENCODING,
55             BrowserCoreConstants.BINARYENCODING_IGNORE );
56         store.setDefault( BrowserCoreConstants.PREFERENCE_FORMAT_CSV_ENCODING, BrowserCoreConstants.DEFAULT_ENCODING );
57
58         store.setDefault( BrowserCoreConstants.PREFERENCE_FORMAT_XLS_VALUEDELIMITER, "|" );
59         store.setDefault( BrowserCoreConstants.PREFERENCE_FORMAT_XLS_BINARYENCODING,
60             BrowserCoreConstants.BINARYENCODING_IGNORE );
61
62         store.setDefault( BrowserCoreConstants.PREFERENCE_LDIF_LINE_WIDTH, 76 );
63         store.setDefault( BrowserCoreConstants.PREFERENCE_LDIF_LINE_SEPARATOR, BrowserCoreConstants.LINE_SEPARATOR );
64         store.setDefault( BrowserCoreConstants.PREFERENCE_LDIF_SPACE_AFTER_COLON, true );
65
66         // default binary attributes
67
BinaryAttribute[] defaultBinaryAttributes = new BinaryAttribute[]
68             { new BinaryAttribute( "0.9.2342.19200300.100.1.7" ), // photo
69
// //$NON-NLS-1$
70
new BinaryAttribute( "0.9.2342.19200300.100.1.53" ), // personalSignature
71
// //$NON-NLS-1$
72
new BinaryAttribute( "0.9.2342.19200300.100.1.55" ), // audio
73
// //$NON-NLS-1$
74
new BinaryAttribute( "0.9.2342.19200300.100.1.60" ), // jpegPhoto
75
// //$NON-NLS-1$
76
new BinaryAttribute( "1.3.6.1.4.1.42.2.27.4.1.8" ), // javaSerializedData
77
// //$NON-NLS-1$
78
new BinaryAttribute( "1.3.6.1.4.1.1466.101.120.35" ), // thumbnailPhoto
79
// //$NON-NLS-1$
80
new BinaryAttribute( "1.3.6.1.4.1.1466.101.120.36" ), // thumbnailLogo
81
// //$NON-NLS-1$
82
new BinaryAttribute( "2.5.4.35" ), // userPassword
83
// //$NON-NLS-1$
84
new BinaryAttribute( "2.5.4.36" ), // userCertificate
85
// //$NON-NLS-1$
86
new BinaryAttribute( "2.5.4.37" ), // cACertificate
87
// //$NON-NLS-1$
88
new BinaryAttribute( "2.5.4.38" ), // authorityRevocationList
89
// //$NON-NLS-1$
90
new BinaryAttribute( "2.5.4.39" ), // certificateRevocationList
91
// //$NON-NLS-1$
92
new BinaryAttribute( "2.5.4.40" ), // crossCertificatePair
93
// //$NON-NLS-1$
94
new BinaryAttribute( "2.5.4.45" ), // x500UniqueIdentifier
95
// //$NON-NLS-1$
96
};
97         BrowserCorePlugin.getDefault().getCorePreferences().setDefaultBinaryAttributes( defaultBinaryAttributes );
98
99         // default binary syntaxes
100
BinarySyntax[] defaultBinarySyntaxes = new BinarySyntax[]
101             { new BinarySyntax( "1.3.6.1.4.1.1466.115.121.1.5" ), // Binary
102
// //$NON-NLS-1$
103
new BinarySyntax( "1.3.6.1.4.1.1466.115.121.1.8" ), // Certificate
104
// //$NON-NLS-1$
105
new BinarySyntax( "1.3.6.1.4.1.1466.115.121.1.9" ), // Certificate
106
// List
107
// //$NON-NLS-1$
108
new BinarySyntax( "1.3.6.1.4.1.1466.115.121.1.10" ), // Certificate
109
// Pair
110
// //$NON-NLS-1$
111
new BinarySyntax( "1.3.6.1.4.1.1466.115.121.1.23" ), // Fax
112
// //$NON-NLS-1$
113
new BinarySyntax( "1.3.6.1.4.1.1466.115.121.1.28" ), // JPEG
114
// //$NON-NLS-1$
115
new BinarySyntax( "1.3.6.1.4.1.1466.115.121.1.40" ), // Octet
116
// String
117
// //$NON-NLS-1$
118
new BinarySyntax( "1.3.6.1.4.1.1466.115.121.1.49" ) // Supported
119
// Algorithm
120
// //$NON-NLS-1$
121
};
122         BrowserCorePlugin.getDefault().getCorePreferences().setDefaultBinarySyntaxes( defaultBinarySyntaxes );
123     }
124 }
125
Popular Tags