1 package org
.argeo
.demo
.i18n
.editors
;
3 import org
.argeo
.demo
.i18n
.I18nDemoMessages
;
4 import org
.eclipse
.swt
.layout
.GridLayout
;
5 import org
.eclipse
.swt
.widgets
.Composite
;
6 import org
.eclipse
.ui
.forms
.AbstractFormPart
;
7 import org
.eclipse
.ui
.forms
.IManagedForm
;
8 import org
.eclipse
.ui
.forms
.editor
.FormEditor
;
9 import org
.eclipse
.ui
.forms
.editor
.FormPage
;
10 import org
.eclipse
.ui
.forms
.widgets
.FormToolkit
;
11 import org
.eclipse
.ui
.forms
.widgets
.ScrolledForm
;
14 * Main node editor page. Lists all properties of the current node and enable
15 * access and editing for some of them.
18 public class SimplePage
extends FormPage
{
19 // private final static Log log = LogFactory.getLog(SimplePage.class);
22 // protected DateFormat timeFormatter = new
23 // SimpleDateFormat(DATE_TIME_FORMAT);
26 private FormToolkit tk
;
28 // private List<Control> modifyableProperties = new ArrayList<Control>();
30 public SimplePage(FormEditor editor
, String title
) {
31 super(editor
, "id", title
);
34 protected void createFormContent(IManagedForm managedForm
) {
35 tk
= managedForm
.getToolkit();
36 ScrolledForm form
= managedForm
.getForm();
37 GridLayout twt
= new GridLayout(3, false);
38 twt
.marginWidth
= twt
.marginHeight
= 5;
40 form
.getBody().setLayout(twt
);
41 createPropertiesPart(form
.getBody());
44 private void createPropertiesPart(Composite parent
) {
45 // Initializes form part
46 tk
.createLabel(parent
, I18nDemoMessages
.get().SimplePage_DescriptionTxt
);
47 AbstractFormPart part
= new AbstractFormPart() {
48 public void commit(boolean onSave
) {
51 // We only commit when onSave = true,
52 // thus it is still possible to save after a tab
59 getManagedForm().addPart(part
);
67 * UNUSED FOR THE TIME BEING private class ModifiedFieldListener implements
70 * private AbstractFormPart formPart;
72 * public ModifiedFieldListener(AbstractFormPart generalPart) {
73 * this.formPart = generalPart; }
75 * public void modifyText(ModifyEvent e) { formPart.markDirty(); } }