]>
git.argeo.org Git - gpl/argeo-slc.git/blob - swt/org.argeo.tool.devops.e4/src/org/argeo/cms/ui/eclipse/forms/editor/FormEditor.java
1 package org
.argeo
.cms
.ui
.eclipse
.forms
.editor
;
3 import org
.argeo
.cms
.ui
.eclipse
.forms
.FormToolkit
;
4 import org
.eclipse
.jface
.dialogs
.IPageChangeProvider
;
7 * This class forms a base of multi-page form editors that typically use one or
8 * more pages with forms and one page for raw source of the editor input.
10 * Pages are added 'lazily' i.e. adding a page reserves a tab for it but does
11 * not cause the page control to be created. Page control is created when an
12 * attempt is made to select the page in question. This allows editors with
13 * several tabs and complex pages to open quickly.
15 * Subclasses should extend this class and implement <code>addPages</code>
16 * method. One of the two <code>addPage</code> methods should be called to
17 * contribute pages to the editor. One adds complete (standalone) editors as
18 * nested tabs. These editors will be created right away and will be hooked so
19 * that key bindings, selection service etc. is compatible with the one for the
20 * standalone case. The other method adds classes that implement
21 * <code>IFormPage</code> interface. These pages will be created lazily and
22 * they will share the common key binding and selection service. Since 3.1,
23 * FormEditor is a page change provider. It allows listeners to attach to it and
24 * get notified when pages are changed. This new API in JFace allows dynamic
25 * help to update on page changes.
29 // RAP [if] As RAP is still using workbench 3.4, the implementation of
30 // IPageChangeProvider is missing from MultiPageEditorPart. Remove this code
31 // with the adoption of workbench > 3.5
32 //public abstract class FormEditor extends MultiPageEditorPart {
33 public abstract class FormEditor
implements
35 private FormToolkit formToolkit
;
38 public FormToolkit
getToolkit() {
42 public void editorDirtyStateChanged() {
46 public FormPage
getActivePageInstance() {
50 // RAP [if] As RAP is still using workbench 3.4, the implementation of
51 // IPageChangeProvider is missing from MultiPageEditorPart. Remove this code
52 // with the adoption of workbench > 3.5
53 // private ListenerList pageListeners = new ListenerList();
58 // * @see org.eclipse.jface.dialogs.IPageChangeProvider#addPageChangedListener(org.eclipse.jface.dialogs.IPageChangedListener)
60 // public void addPageChangedListener(IPageChangedListener listener) {
61 // pageListeners.add(listener);
67 // * @see org.eclipse.jface.dialogs.IPageChangeProvider#removePageChangedListener(org.eclipse.jface.dialogs.IPageChangedListener)
69 // public void removePageChangedListener(IPageChangedListener listener) {
70 // pageListeners.remove(listener);
73 // private void firePageChanged(final PageChangedEvent event) {
74 // Object[] listeners = pageListeners.getListeners();
75 // for (int i = 0; i < listeners.length; ++i) {
76 // final IPageChangedListener l = (IPageChangedListener) listeners[i];
77 // SafeRunnable.run(new SafeRunnable() {
78 // public void run() {
79 // l.pageChanged(event);