]> git.argeo.org Git - lgpl/argeo-commons.git/blob - EmptyNodePage.java
cd3f75648dd25ebfb8323150d50de41002b7db30
[lgpl/argeo-commons.git] / EmptyNodePage.java
1 /*
2 * Copyright (C) 2007-2012 Argeo GmbH
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package org.argeo.cms.ui.workbench.internal.jcr.parts;
17
18 import org.eclipse.swt.SWT;
19 import org.eclipse.swt.layout.GridLayout;
20 import org.eclipse.swt.widgets.Label;
21 import org.eclipse.ui.forms.IManagedForm;
22 import org.eclipse.ui.forms.editor.FormEditor;
23 import org.eclipse.ui.forms.editor.FormPage;
24 import org.eclipse.ui.forms.widgets.ScrolledForm;
25
26 /**
27 * This page is only used at editor's creation time when current node has not
28 * yet been set
29 */
30 public class EmptyNodePage extends FormPage {
31 // private final static Log log = LogFactory.getLog(EmptyNodePage.class);
32
33 public EmptyNodePage(FormEditor editor, String title) {
34 super(editor, "Empty Page", title);
35 }
36
37 protected void createFormContent(IManagedForm managedForm) {
38 try {
39 ScrolledForm form = managedForm.getForm();
40 GridLayout twt = new GridLayout(1, false);
41 twt.marginWidth = twt.marginHeight = 0;
42 form.getBody().setLayout(twt);
43 Label lbl = new Label(form.getBody(), SWT.NONE);
44 lbl.setText("Empty page");
45 } catch (Exception e) {
46 e.printStackTrace();
47 }
48 }
49 }