2 * Copyright (C) 2007-2012 Mathieu Baudier
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 package org
.argeo
.demo
.i18n
.editors
;
18 import org
.argeo
.ArgeoException
;
19 import org
.argeo
.demo
.i18n
.I18nDemoMessages
;
20 import org
.argeo
.demo
.i18n
.I18nDemoPlugin
;
21 import org
.eclipse
.core
.runtime
.IProgressMonitor
;
22 import org
.eclipse
.ui
.IEditorInput
;
23 import org
.eclipse
.ui
.IEditorSite
;
24 import org
.eclipse
.ui
.PartInitException
;
25 import org
.eclipse
.ui
.forms
.editor
.FormEditor
;
29 * Container for the node editor page. At creation time, it takes a JCR Node
30 * that cannot be changed afterwards.
33 public class SimpleMultitabEditor
extends FormEditor
{
35 // private final static Log log = LogFactory
36 // .getLog(SimpleMultitabEditor.class);
37 public final static String ID
= I18nDemoPlugin
.ID
+ ".simpleMultitabEditor";
39 private SimplePage simplePage
;
40 private MultiSectionPage multiSectionPage
;
42 public void init(IEditorSite site
, IEditorInput input
)
43 throws PartInitException
{
44 super.init(site
, input
);
45 // this.setPartName("Internationalized editor part name");
49 protected void addPages() {
51 simplePage
= new SimplePage(this,
52 I18nDemoMessages
.get().SimpleMultitabEditor_SimplePageTitle
);
55 multiSectionPage
= new MultiSectionPage(
57 I18nDemoMessages
.get().SimpleMultitabEditor_MultiSectionPageTitle
);
58 addPage(multiSectionPage
);
60 } catch (PartInitException e
) {
61 throw new ArgeoException("Not able to add an empty page ", e
);
66 public void doSaveAs() {
67 // unused compulsory method
71 public void doSave(IProgressMonitor monitor
) {
73 // Automatically commit all pages of the editor
75 firePropertyChange(PROP_DIRTY
);
76 } catch (Exception e
) {
77 throw new ArgeoException("Error while saving node", e
);
83 public boolean isSaveAsAllowed() {