1 package org.argosfields.preference;
2
3 import org.argosfields.resource.ResourceManager;
4 import org.eclipse.jface.preference.BooleanFieldEditor;
5 import org.eclipse.jface.preference.FieldEditorPreferencePage;
6 import org.eclipse.jface.preference.IntegerFieldEditor;
7 import org.eclipse.jface.preference.StringButtonFieldEditor;
8 import org.eclipse.jface.resource.ImageDescriptor;
9 import org.eclipse.swt.widgets.Composite;
10
11 /***
12 * ServerPreferencePage.java
13 * @author Xavier Cho
14 * @version $Revision: 1.1 $ $Date: 2004/04/15 05:43:55 $
15 */
16 public class ServerPreferencePage extends FieldEditorPreferencePage {
17
18 public static final String NAME = "Server";
19
20 public ServerPreferencePage() {
21 super(FieldEditorPreferencePage.GRID);
22 }
23
24 public ServerPreferencePage(final String title) {
25 super(title, FieldEditorPreferencePage.GRID);
26 }
27
28 public ServerPreferencePage(final String title, final ImageDescriptor image) {
29 super(title, image, FieldEditorPreferencePage.GRID);
30 }
31
32 /***
33 * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
34 */
35 protected void createFieldEditors() {
36 ResourceManager resources = ResourceManager.getInstance();
37
38 IntegerFieldEditor intEditor = new IntegerFieldEditor(
39 "server.port",
40 resources.getString("label.pref.server.port"),
41 getFieldEditorParent());
42
43 intEditor.setValidRange(0, 9999);
44 addField(intEditor);
45
46 intEditor = new IntegerFieldEditor(
47 "max.users",
48 resources.getString("label.pref.max.users"),
49 getFieldEditorParent());
50
51 intEditor.setValidRange(2, Integer.MAX_VALUE);
52 addField(intEditor);
53
54 Composite parent = getFieldEditorParent();
55
56 StringButtonFieldEditor stringEditor = new LargeStringFieldEditor(
57 "welcome.message",
58 resources.getString("label.pref.welcome.message"),
59 parent);
60
61 stringEditor.getTextControl(parent).setEditable(false);
62 addField(stringEditor);
63
64 BooleanFieldEditor boolEditor = new BooleanFieldEditor(
65 "allow.new.user",
66 resources.getString("label.pref.allow.new.user"),
67 getFieldEditorParent());
68
69 addField(boolEditor);
70 }
71 }
This page was automatically generated by Maven