intial source from ttp://www.sf.net/projects/wdte
[phpeclipse.git] / archive / net.sourceforge.phpeclipse.css.ui / src / net / sourceforge / phpeclipse / css / ui / internal / preferences / CssEditorTypingConfigurationBlock.java
1 /*
2  * Copyright (c) 2003-2004 Christopher Lenz 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  *     Christopher Lenz - initial API and implementation
10  * 
11  * $Id: CssEditorTypingConfigurationBlock.java,v 1.1 2004-09-02 18:11:50 jsurfer Exp $
12  */
13
14 package net.sourceforge.phpeclipse.css.ui.internal.preferences;
15
16 import net.sourceforge.phpeclipse.css.ui.internal.CssUIMessages;
17 import net.sourceforge.phpeclipse.css.ui.internal.CssUIPreferences;
18
19 import org.eclipse.jface.preference.IPreferenceStore;
20 import org.eclipse.swt.SWT;
21 import org.eclipse.swt.layout.GridLayout;
22 import org.eclipse.swt.widgets.Composite;
23 import org.eclipse.swt.widgets.Control;
24
25 /**
26  * 
27  */
28 final class CssEditorTypingConfigurationBlock
29         extends AbstractConfigurationBlock {
30
31         // Constructors ------------------------------------------------------------
32
33         public CssEditorTypingConfigurationBlock(IPreferenceStore store) {
34                 super(store);
35         }
36
37         // Public Methods ----------------------------------------------------------
38
39         public Control createControl(Composite parent) {
40
41                 Composite composite = new Composite(parent, SWT.NONE);
42                 GridLayout layout = new GridLayout();
43                 layout.numColumns = 2;
44                 composite.setLayout(layout);
45
46                 addBooleanField(composite,
47                         getString("insertSpaceForTabs"), //$NON-NLS-1$
48                         CssUIPreferences.EDITOR_SPACES_FOR_TABS, 1);
49                 initialize();
50
51                 return composite;
52         }
53
54         private static String getString(String key) {
55                 return CssUIMessages.getString(
56                         "CssEditorPreferencePage.typing." + key); //$NON-NLS-1$
57         }
58
59         private void initialize() {
60                 initializeFields();
61         }
62
63 }