KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > debug > internal > ui > views > memory > SetPaddedStringPreferencePage


1 /*******************************************************************************
2  * Copyright (c) 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11
12
13 package org.eclipse.debug.internal.ui.views.memory;
14
15 import org.eclipse.debug.internal.ui.DebugUIMessages;
16 import org.eclipse.debug.ui.DebugUITools;
17 import org.eclipse.debug.ui.IDebugUIConstants;
18 import org.eclipse.jface.preference.FieldEditorPreferencePage;
19 import org.eclipse.jface.preference.StringFieldEditor;
20 import org.eclipse.swt.SWT;
21 import org.eclipse.swt.widgets.Composite;
22 import org.eclipse.swt.widgets.Control;
23 import org.eclipse.swt.widgets.Label;
24 import org.eclipse.ui.PlatformUI;
25
26 public class SetPaddedStringPreferencePage extends FieldEditorPreferencePage {
27     
28     private StringFieldEditor fPaddedString;
29
30     public SetPaddedStringPreferencePage()
31     {
32         super(FieldEditorPreferencePage.GRID);
33         setPreferenceStore(DebugUITools.getPreferenceStore());
34         setTitle(DebugUIMessages.SetPaddedStringDialog_0);
35         
36     }
37
38     protected void createFieldEditors() {
39         fPaddedString = new StringFieldEditor(IDebugUIConstants.PREF_PADDED_STR, DebugUIMessages.SetPaddedStringPreferencePage_0, getFieldEditorParent());
40         fPaddedString.setEmptyStringAllowed(false);
41         fPaddedString.setTextLimit(5);
42         addField(fPaddedString);
43     }
44
45     protected Label createDescriptionLabel(Composite parent) {
46         Label label = new Label(parent, SWT.NONE);
47         label.setText(DebugUIMessages.SetPaddedStringDialog_1);
48         return label;
49     }
50
51     protected Control createContents(Composite parent) {
52         PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IDebugUIConstants.PLUGIN_ID + ".SetPaddedStrDialog_context"); //$NON-NLS-1$
53
return super.createContents(parent);
54     }
55
56 }
57
Popular Tags