]> git.argeo.org Git - lgpl/argeo-commons.git/blob - EmptyNodePage.java
b9f20b9cf764bebbb22605768b4946e696171d84
[lgpl/argeo-commons.git] / EmptyNodePage.java
1 package org.argeo.jcr.ui.explorer.editors;
2
3 import org.apache.commons.logging.Log;
4 import org.apache.commons.logging.LogFactory;
5 import org.eclipse.swt.SWT;
6 import org.eclipse.swt.layout.GridLayout;
7 import org.eclipse.swt.widgets.Label;
8 import org.eclipse.ui.forms.IManagedForm;
9 import org.eclipse.ui.forms.editor.FormEditor;
10 import org.eclipse.ui.forms.editor.FormPage;
11 import org.eclipse.ui.forms.widgets.ScrolledForm;
12
13 /**
14 * This page is only used at editor's creation time when current node has not
15 * yet been set
16 */
17 public class EmptyNodePage extends FormPage {
18 private final static Log log = LogFactory.getLog(EmptyNodePage.class);
19
20 public EmptyNodePage(FormEditor editor, String title) {
21 super(editor, "Empty Page", title);
22 }
23
24 protected void createFormContent(IManagedForm managedForm) {
25 try {
26 ScrolledForm form = managedForm.getForm();
27 GridLayout twt = new GridLayout(1, false);
28 twt.marginWidth = twt.marginHeight = 0;
29 form.getBody().setLayout(twt);
30 Label lbl = new Label(form.getBody(), SWT.NONE);
31 lbl.setText("Empty page");
32 } catch (Exception e) {
33 e.printStackTrace();
34 }
35 }
36 }